* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* 资料管理样式 */
.upload-area {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#materialInput {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

#materialInput:focus {
    outline: none;
    border-color: #667eea;
}

#materialTitle {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

#materialTitle:focus {
    outline: none;
    border-color: #667eea;
}

.materials-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.material-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.material-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.material-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.material-header h4 {
    color: #333;
    font-size: 1.1em;
}

.material-preview {
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 8px;
}

.material-date {
    color: #999;
    font-size: 0.8em;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* 文章生成样式 */
.input-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.result-area {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.article-content {
    max-height: 800px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    line-height: 1.8;
}

/* SEO元数据样式 */
.seo-metadata {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.seo-metadata h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.meta-item {
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.meta-item strong {
    color: #333;
    display: inline-block;
    min-width: 120px;
}

.meta-value {
    color: #555;
    margin-left: 10px;
}

.meta-item code {
    background: #f4f4f4;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
}

.meta-item small {
    color: #999;
    margin-left: 10px;
    font-size: 0.85em;
}

.keyword-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    margin: 2px;
    font-weight: 500;
}

.keyword-badge.focus {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.article-divider {
    height: 2px;
    background: linear-gradient(to right, #667eea, #764ba2);
    margin: 25px 0;
    border-radius: 2px;
}

/* SEO统计信息样式 */
.seo-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 25px;
    border: 2px solid #e0e0e0;
}

.stat-item {
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-item strong {
    color: #333;
}

.check-pass {
    color: #28a745;
    font-size: 1.2em;
    font-weight: bold;
    margin-left: 10px;
}

.check-fail {
    color: #dc3545;
    font-size: 0.9em;
    margin-left: 10px;
}

.check-warn {
    color: #ffc107;
    font-size: 1.2em;
    font-weight: bold;
    margin-left: 10px;
}

/* 资源链接样式 */
.resource-links {
    list-style: none;
    padding: 0;
}

.resource-links li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.resource-links li:before {
    content: "🔗";
    position: absolute;
    left: 0;
}

.resource-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.resource-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.article-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: none;
}

.article-content h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.article-content h4 {
    color: #555;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.article-content p {
    color: #555;
    margin-bottom: 15px;
    text-align: justify;
}

.article-section {
    margin-bottom: 25px;
}

.article-subsection {
    margin-left: 20px;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 3px solid #e0e0e0;
}

/* FAQ样式 */
.faq-item {
    background: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.faq-item h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.faq-item p {
    color: #555;
    line-height: 1.7;
}

.word-count {
    text-align: right;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.word-count small {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9em;
}

.placeholder {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 60px 20px;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    width: 100%;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    flex: 1;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-edit {
    background: #17a2b8;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 8px;
}

.btn-edit:hover {
    background: #138496;
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-update {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.material-actions {
    display: flex;
    gap: 5px;
}

.material-item.editing {
    border-left: 4px solid #f5576c;
    background: #fff5f7;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2);
}

#cancelEditBtn {
    width: 100%;
    margin-top: 10px;
}


/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .main-content {
        padding: 15px;
        gap: 20px;
    }

    .section {
        padding: 15px;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }
}
