/* ========== 品牌色板 ========== */
:root {
    --primary: #6366f1;       /* 主色 - 靛蓝紫 */
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #06b6d4;     /* 辅色1 - 青蓝 */
    --secondary-light: #67e8f9;
    --accent: #f59e0b;        /* 辅色2 - 琥珀金 */
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
}

/* ========== 重置 & 基础 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}
.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
}
.logo-link:hover { color: var(--primary); }
.logo-icon { width: 32px; height: 32px; }
.logo-text { font-size: 20px; }
.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}
.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    position: relative;
    padding: 4px 0;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--primary); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ========== Hero区 ========== */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 50%, #ecfeff 100%);
    overflow: hidden;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}
.hero-logo {
    height: 48px;
    margin: 0 auto 24px;
}
.hero-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}
.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 背景装饰形状 */
.hero-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}
.shape-1 {
    width: 300px; height: 300px;
    background: var(--primary);
    top: -80px; right: -60px;
    animation: float 8s ease-in-out infinite;
}
.shape-2 {
    width: 200px; height: 200px;
    background: var(--secondary);
    bottom: 40px; left: -40px;
    animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
    width: 150px; height: 150px;
    background: var(--accent);
    bottom: 100px; right: 20%;
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: var(--font-sans);
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.3);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}
.btn-danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}
.btn-full { width: 100%; }

/* ========== 通用区块 ========== */
.section {
    padding: 80px 0;
}
.section.bg-light { background: var(--bg-light); }
.section-title {
    text-align: center;
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 48px;
}
.highlight { color: var(--primary); }

/* ========== 特色功能卡片 ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
}
.feature-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.feature-icon::before {
    content: '';
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 8px;
    opacity: 0.2;
    position: absolute;
}
.icon-smart::after { content: '🧠'; font-size: 28px; }
.icon-game::after { content: '🎮'; font-size: 28px; }
.icon-ai::after { content: '🤖'; font-size: 28px; }
.icon-track::after { content: '📊'; font-size: 28px; }
.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========== 单词卡片 ========== */
.words-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.word-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.word-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.word-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}
.word-en {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.word-phonetic {
    font-size: 14px;
    color: var(--text-muted);
    font-family: 'Inter', monospace;
}
.word-cn {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.word-example {
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.word-example strong { color: var(--text-primary); }
.word-tags {
    display: flex;
    gap: 8px;
}
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.tag-level {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* ========== 文章列表 ========== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.article-card {
    display: block;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.article-card-body {
    padding: 24px;
}
.article-category {
    display: inline-block;
    padding: 2px 10px;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.article-card-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.article-card-body p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}
.article-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========== 文章详情页 ========== */
.main-content {
    padding-top: 80px;
    min-height: 60vh;
}
.article-detail {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}
.article-detail h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}
.article-detail .article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 32px;
}
.article-body p { margin-bottom: 16px; }

/* ========== 分页 ========== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}
.page-link:hover,
.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state a { color: var(--primary); font-weight: 600; }

/* ========== 页脚 ========== */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 60px 0 0;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-logo {
    height: 32px;
    margin-bottom: 16px;
}
.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    max-width: 360px;
}
.footer-links h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}
.footer-links ul li {
    margin-bottom: 10px;
}
.footer-links a {
    color: #94a3b8;
    font-size: 14px;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary-light); }
.footer-bottom {
    border-top: 1px solid #334155;
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

/* ========== 后台管理 ========== */
.admin-body {
    background: #f1f5f9;
    min-height: 100vh;
}
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}
.admin-login-card {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 40px;
    box-shadow: var(--shadow-md);
    text-align: center;
}
.admin-login-card h2 {
    font-size: 24px;
    margin-bottom: 24px;
}
.admin-panel {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-header-left h2 { font-size: 18px; font-weight: 600; }
.admin-header-right { display: flex; gap: 8px; }

.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}
.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    font-family: var(--font-sans);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #fff;
}
.tab-content { display: none; padding: 28px; }
.tab-content.active { display: block; }

.admin-section {
    margin-bottom: 32px;
}
.admin-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.admin-form .form-group { margin-bottom: 16px; }
.admin-form label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.inline-form .form-row { margin-bottom: 0; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}
.admin-table tr:hover { background: rgba(99,102,241,0.02); }
.table-responsive { overflow-x: auto; }

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .hamburger { display: flex; }

    .hero { min-height: 70vh; padding: 100px 20px 60px; }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .form-row { grid-template-columns: 1fr; }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tab-btn { font-size: 13px; padding: 12px 10px; }
    .tab-content { padding: 20px 16px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 15px; }
    .features-grid { grid-template-columns: 1fr; }
    .words-list { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: 1fr; }
}