/* ============================================================
   次元123 — 深色科技风样式
   ============================================================ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #1f2b42;
    --bg-code: #0d1117;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-glow-strong: rgba(99, 102, 241, 0.3);
    --border: rgba(148, 163, 184, 0.1);
    --border-light: rgba(148, 163, 184, 0.2);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --gradient-hero: linear-gradient(135deg, #0a0e17 0%, #1a1040 40%, #0f172a 100%);
    --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-card: linear-gradient(145deg, rgba(26,34,53,0.8) 0%, rgba(17,24,39,0.9) 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99,102,241,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #a5b4fc;
    text-decoration: none;
}

img { max-width: 100%; border-radius: var(--radius-sm); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Animated Background === */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 0%, rgba(99,102,241,0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 80% 100%, rgba(139,92,246,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* === Header === */
.header {
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo:hover {
    opacity: 0.9;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.nav a {
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.25s;
    border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
    color: var(--text-primary);
    background: var(--accent-glow);
    border-color: rgba(99,102,241,0.2);
    text-decoration: none;
}

/* === Hero === */
.hero {
    background: var(--gradient-hero);
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 20%, rgba(99,102,241,0.08) 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(139,92,246,0.06) 0%, transparent 40%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, 2%); }
}

.hero .container { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--accent-glow);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--accent-light);
    margin-bottom: 24px;
    font-weight: 500;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 16px;
    letter-spacing: -1.5px;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 50%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 40px;
}

.stat-item { text-align: center; }

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99,102,241,0.4);
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-light);
}
.btn-outline:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
    border-color: rgba(99,102,241,0.3);
    text-decoration: none;
}

/* === Section === */
.section { padding: 64px 0; }

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* === Module Grid === */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.module-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.module-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99,102,241,0.3);
    box-shadow: var(--shadow-glow);
}

.module-card:hover::before { opacity: 1; }

.module-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.module-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 700;
}

.module-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.module-count {
    display: inline-block;
    margin-top: 12px;
    padding: 3px 12px;
    background: var(--accent-glow);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--accent-light);
    font-weight: 600;
}

/* === Article Grid === */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99,102,241,0.25);
    box-shadow: var(--shadow-glow);
}

.article-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.article-body { padding: 20px 22px; }

.article-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.module-tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-glow);
    border-radius: 100px;
    font-size: 0.7rem;
    color: var(--accent-light);
    font-weight: 600;
}

.article-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.5;
}

.article-card h3 a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.article-card h3 a:hover {
    color: var(--accent-light);
}

.article-summary {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* === Article List (Category) === */
.page-header {
    background: var(--gradient-hero);
    padding: 64px 0 40px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 50%);
}

.page-header .container { position: relative; z-index: 1; }

.breadcrumb {
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-light); }

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p { color: var(--text-muted); }

.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-list-item {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    transition: all 0.3s;
}

.article-list-item:hover {
    border-color: rgba(99,102,241,0.25);
    box-shadow: var(--shadow-glow);
    transform: translateX(4px);
}

.article-list-item h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.article-list-item h3 a { color: var(--text-primary); }
.article-list-item h3 a:hover { color: var(--accent-light); }

.article-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.article-list-footer {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === Article Detail === */
.article-detail {
    max-width: 860px;
    margin: 0 auto;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 56px;
    box-shadow: var(--shadow-md);
}

.article-detail h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: -1px;
    line-height: 1.3;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-detail .article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-primary);
}

.article-detail .article-content h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(99,102,241,0.2);
    font-weight: 700;
}

.article-detail .article-content h3 {
    font-size: 1.15rem;
    color: var(--accent-light);
    margin: 28px 0 12px;
    font-weight: 600;
}

.article-detail .article-content p { margin-bottom: 18px; }

.article-detail .article-content ul,
.article-detail .article-content ol {
    margin-bottom: 18px;
    padding-left: 24px;
}

.article-detail .article-content li { margin-bottom: 8px; }

.article-detail .article-content a {
    color: var(--accent-light);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.article-detail .article-content a:hover {
    border-bottom-color: var(--accent-light);
}

.article-detail .article-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-detail .article-content em {
    color: var(--text-secondary);
}

.article-detail .article-content pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.article-detail .article-content code {
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.88rem;
}

.article-detail .article-content :not(pre) > code {
    background: rgba(99,102,241,0.12);
    color: var(--accent-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.article-detail .article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 14px 20px;
    background: var(--accent-glow);
    margin-bottom: 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.article-detail .article-content img {
    border-radius: var(--radius-sm);
    margin: 16px 0;
    border: 1px solid var(--border);
}

.article-detail .article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.article-detail .article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-detail .article-content th,
.article-detail .article-content td {
    border: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
}

.article-detail .article-content th {
    background: var(--bg-card);
    color: var(--accent-light);
    font-weight: 600;
}

/* === Article Navigation === */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    gap: 16px;
}

.article-nav a {
    display: block;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-width: 48%;
    transition: all 0.3s;
}

.article-nav a:hover {
    background: var(--accent-glow);
    border-color: rgba(99,102,241,0.3);
    text-decoration: none;
}

.article-nav .nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-nav .nav-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
    display: block;
}

/* === Knowledge Graph === */
.kg-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 48px;
}

.kg-stat { text-align: center; }

.kg-num {
    display: block;
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.kg-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kg-module {
    margin-bottom: 40px;
}

.kg-module-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(99,102,241,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kg-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.kg-points {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.kg-point {
    display: block;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    transition: all 0.3s;
}

.kg-point:hover {
    border-color: rgba(99,102,241,0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    text-decoration: none;
}

.kg-point-title {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.kg-point-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: block;
}

/* === Tags === */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tag {
    display: inline-block;
    padding: 3px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--accent-glow);
    border-color: rgba(99,102,241,0.2);
    color: var(--accent-light);
    text-decoration: none;
}

/* === Footer === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 56px 0 32px;
    margin-top: 64px;
    position: relative;
    z-index: 1;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 700;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    padding: 4px 0;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--accent-light);
}

.footer-col p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.copyright {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 12px 20px;
    }
    .nav { margin-top: 8px; }

    .hero { padding: 60px 0 48px; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 24px; flex-wrap: wrap; }
    .stat-number { font-size: 1.6rem; }

    .article-grid { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

    .article-detail { padding: 28px 20px; }
    .article-detail h1 { font-size: 1.5rem; }

    .kg-points { grid-template-columns: 1fr; }

    .hero-actions { flex-direction: column; align-items: center; }
}

/* === Selection === */
::selection {
    background: rgba(99,102,241,0.3);
    color: #fff;
}

/* === Fade-in animation === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.article-card, .module-card, .article-list-item {
    animation: fadeInUp 0.5s ease-out both;
}

.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }
.article-card:nth-child(4) { animation-delay: 0.15s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }
.article-card:nth-child(6) { animation-delay: 0.25s; }
