/* ========================================
   DeepSeed — 深度睡眠
   纯公益 AI 研究站点
   ======================================== */

/* -- 自定义属性 --------------------------------- */
:root {
    --bg-primary: #090c10;
    --bg-elevated: #0d1117;
    --bg-card: rgba(22,27,34,0.6);
    --bg-card-hover: rgba(30,37,46,0.8);
    --border-subtle: rgba(255,255,255,0.04);
    --border-card: rgba(255,255,255,0.06);
    --border-hover: rgba(88,166,255,0.18);
    --border-active: rgba(88,166,255,0.35);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --text-dim: #484f58;
    --accent: #58a6ff;
    --accent-glow: rgba(88,166,255,0.12);
    --accent-soft: rgba(88,166,255,0.06);
    --green: #3fb950;
    --green-glow: rgba(63,185,80,0.12);
    --purple: #d2a8ff;
    --purple-glow: rgba(210,168,255,0.10);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", "Cascadia Code", monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -- 基础 --------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 全局背景网格纹理 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(88,166,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

::selection {
    background: rgba(88,166,255,0.25);
    color: var(--text-primary);
}

/* 平滑链接 */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
    text-underline-offset: 3px;
}
a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* -- Header --------------------------------- */
.site-header {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: rgba(9,12,16,0.88);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    z-index: 100;
}

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

.logo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo:hover { text-decoration: none; color: var(--text-primary); }

/* Logo SVG icon */
.logo-icon {
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

.nav {
    display: flex;
    gap: 2px;
}

.nav a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.nav a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
    text-decoration: none;
}

.nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* -- Hero (首页) --------------------------------- */
.hero {
    padding: 90px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hero 光晕 */
.hero::before {
    content: "";
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(88,166,255,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
    position: relative;
}

/* 渐变文字效果 */
.hero-title-gradient {
    background: linear-gradient(135deg, #e6edf3 30%, #79c0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.08rem;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.hero-domain {
    font-size: 0.78rem;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    opacity: 0.7;
}

/* -- 页面头部 --------------------------------- */
.page-header {
    padding: 70px 0 40px;
    position: relative;
}

.page-header::before {
    content: "";
    position: absolute;
    top: -20%;
    left: 0;
    width: 240px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(88,166,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.page-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.page-desc {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    max-width: 500px;
    line-height: 1.7;
}

/* -- Section 通用 --------------------------------- */
.section {
    padding: 12px 0 44px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.5;
}

/* -- 简介卡片 --------------------------------- */
.intro-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
}

.intro-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(88,166,255,0.15), transparent);
}

.intro-card p {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 10px;
    line-height: 1.75;
}

.intro-card p:last-child { margin-bottom: 0; }

/* -- 文章/内容卡片 --------------------------------- */
.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 22px 26px;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    position: relative;
}

.post-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(88,166,255,0.04);
}

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

.post-date {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.post-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-tag.weekly {
    color: var(--accent);
    background: var(--accent-glow);
}

.post-tag.article {
    color: var(--green);
    background: var(--green-glow);
}

.post-tag.note {
    color: var(--purple);
    background: var(--purple-glow);
}

.post-title {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.5;
    transition: color var(--transition);
}

.post-card:hover .post-title { color: var(--accent); }

.post-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* -- 筛选/标签 --------------------------------- */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-btn {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 5px 14px;
    border: 1px solid var(--border-card);
    border-radius: 20px;
    color: var(--text-tertiary);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
}

.filter-btn:hover {
    border-color: rgba(255,255,255,0.12);
    color: var(--text-secondary);
}

.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

/* -- 年份分组 --------------------------------- */
.year-group { margin-bottom: 34px; }

.year-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    padding-left: 6px;
    font-family: var(--font-mono);
}

/* -- 关于页面 --------------------------------- */
.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    position: relative;
    padding-left: 16px;
}

.about-section h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), transparent);
    border-radius: 2px;
}

.about-section p,
.about-section li {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 8px;
    line-height: 1.75;
}

.about-section ul {
    padding-left: 22px;
    list-style: none;
}

.about-section ul li {
    position: relative;
    padding-left: 4px;
}

.about-section ul li::before {
    content: "·";
    position: absolute;
    left: -16px;
    color: var(--text-tertiary);
}

.about-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 许可协议盒子 */
.license-box {
    background: var(--bg-card);
    border: 1px solid rgba(63,185,80,0.15);
    border-radius: var(--radius-md);
    padding: 22px 26px;
    margin-top: 14px;
}

.license-box .license-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 6px;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.license-box .license-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* -- 订阅区 --------------------------------- */
.subscribe { padding: 36px 0 80px; }

.subscribe-desc {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 20px;
}

.subscribe-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
}

.btn-primary {
    border: 1px solid rgba(88,166,255,0.3);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-primary:hover {
    background: rgba(88,166,255,0.12);
    border-color: var(--border-active);
    color: var(--accent);
    text-decoration: none;
}

.btn-secondary {
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
    background: transparent;
}

.btn-secondary:hover {
    border-color: rgba(255,255,255,0.12);
    color: var(--text-primary);
    text-decoration: none;
}

/* -- 空状态 --------------------------------- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-tertiary);
}

.empty-state .icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.93rem;
    font-weight: 400;
}

/* -- Footer --------------------------------- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 30px 0;
    text-align: center;
}

.site-footer p {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.site-footer .license-link {
    font-size: 0.76rem;
}

.site-footer .license-link a {
    color: var(--text-tertiary);
}

.site-footer .license-link a:hover {
    color: var(--text-secondary);
}

/* -- SVG 图标辅助 --------------------------------- */
.svg-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

/* -- 代码块(预留) --------------------------------- */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text-primary);
}

pre {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

/* -- 文章内容(预留) --------------------------------- */
.article-body {
    padding: 20px 0 60px;
}

.article-body h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 36px 0 14px;
}

.article-body h3 {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 28px 0 10px;
}

.article-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.8;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 10px 18px;
    margin: 20px 0;
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-size: 0.93rem;
}

.article-body ul,
.article-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article-body li {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 6px;
    line-height: 1.7;
}

.article-header {
    padding: 60px 0 20px;
}

.article-header .article-date {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.article-header .article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 12px;
}

.article-header .article-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* -- 淡化动画 --------------------------------- */
.fade-up {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片交错动画 */
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }

/* -- 响应式 --------------------------------- */
@media (max-width: 600px) {
    .hero { padding: 60px 0 40px; }
    .hero-title { font-size: 2rem; }
    .page-header { padding: 50px 0 30px; }
    .page-title { font-size: 1.5rem; }

    .nav a {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .post-card { padding: 18px 20px; }
    .intro-card { padding: 20px 22px; }
    .about-section h2 { font-size: 1rem; }

    .filter-bar { gap: 6px; }
    .filter-btn { padding: 4px 12px; font-size: 0.78rem; }

    .article-header .article-title { font-size: 1.5rem; }
    .article-header { padding: 40px 0 16px; }
}

/* -- 打印 --------------------------------- */
@media print {
    body::before { display: none; }
    .site-header, .site-footer, .filter-bar, .subscribe, .nav { display: none; }
    body { background: #fff; color: #000; }
    a { color: #000; }
    .post-card { border: 1px solid #ddd; }
}
