/* ==========================================================
   李植 · 个人博客  —— 视觉系统
   色彩：墨黑 / 深玉 / 玉绿 / 暖金 / 宣纸白 / 石灰
   字体：思源宋体（标题）/ 思源黑体（正文）/ JetBrains Mono（数据标签）
   信号元素：枝条生长线条（呼应"植"字），仅用于首屏与分隔处
   ========================================================== */

:root {
    --ink: #0c1210;
    --jade-deep: #0f2a24;
    --jade: #2f6f5e;
    --jade-light: #6fae98;
    --gold: #c9a15c;
    --gold-soft: #e4cf9d;
    --paper: #f1ede4;
    --stone: #8a8f87;
    --line: rgba(241, 237, 228, 0.12);

    --font-display: "Noto Serif SC", "Songti SC", serif;
    --font-body: "Noto Sans SC", "PingFang SC", sans-serif;
    --font-mono: "JetBrains Mono", "Consolas", monospace;

    --container: 1180px;
    --radius: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 60% 40% at 15% 0%, rgba(47,111,94,0.22), transparent 60%),
        radial-gradient(ellipse 50% 35% at 90% 10%, rgba(201,161,92,0.10), transparent 60%);
    background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: 0.02em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ---------- 滚动进度条 ---------- */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--jade), var(--gold));
    z-index: 9999; transition: width 0.1s linear;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 999;
    padding: 22px 0;
    transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}
.site-header.scrolled {
    background: rgba(12, 18, 16, 0.86);
    backdrop-filter: blur(14px) saturate(140%);
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.nav-flex { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.brand .brand-mark { color: var(--gold); font-size: 26px; }
.nav-links { display: flex; gap: 36px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.nav-links a { position: relative; padding: 4px 0; color: var(--paper); opacity: 0.82; transition: opacity 0.3s; }
.nav-links a::after {
    content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
    background: var(--gold); transition: width 0.35s var(--ease);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { opacity: 1; color: var(--gold-soft); }

.nav-user { display: flex; align-items: center; gap: 16px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; border-radius: 100px; font-size: 14px; font-weight: 600;
    border: 1px solid var(--line); cursor: pointer; transition: all 0.35s var(--ease);
    font-family: var(--font-body); background: transparent; color: var(--paper);
}
.btn-gold { background: linear-gradient(135deg, var(--gold), #a9824a); color: var(--ink); border: none; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(201,161,92,0.35); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* ---------- 生长线条 信号元素 ---------- */
.grow-line { position: absolute; pointer-events: none; opacity: 0.9; }
.grow-line path {
    stroke: var(--jade-light);
    stroke-width: 1.4;
    fill: none;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: draw-grow 2.6s var(--ease) forwards;
}
.grow-line .leaf { fill: var(--gold-soft); opacity: 0; transform-origin: center; animation: bud-in 0.8s var(--ease) forwards; animation-delay: 2.2s; }
@keyframes draw-grow { to { stroke-dashoffset: 0; } }
@keyframes bud-in { from { opacity: 0; transform: scale(0.2); } to { opacity: 0.9; transform: scale(1); } }

/* ---------- Hero ---------- */
.hero {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    padding-top: 120px; overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center; }
.eyebrow {
    font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--jade-light); display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
    opacity: 0; animation: rise 0.9s var(--ease) forwards; animation-delay: 0.1s;
}
.eyebrow::before { content: ""; width: 30px; height: 1px; background: var(--jade-light); }
.hero h1 {
    font-size: clamp(42px, 6vw, 74px); line-height: 1.15; margin-bottom: 26px;
    opacity: 0; animation: rise 1s var(--ease) forwards; animation-delay: 0.25s;
}
.hero h1 em { font-style: normal; color: var(--gold-soft); position: relative; }
.hero-desc {
    font-size: 17px; color: rgba(241,237,228,0.72); max-width: 460px; margin-bottom: 36px;
    opacity: 0; animation: rise 1s var(--ease) forwards; animation-delay: 0.4s;
}
.hero-actions { display: flex; gap: 18px; opacity: 0; animation: rise 1s var(--ease) forwards; animation-delay: 0.55s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.hero-visual { position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
    opacity: 0; animation: rise 1.2s var(--ease) forwards; animation-delay: 0.35s; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) contrast(1.05); }
.hero-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(12,18,16,0.7)); }
.hero-visual .frame { position: absolute; inset: 14px; border: 1px solid rgba(241,237,228,0.35); border-radius: 8px; pointer-events: none; }

.hero-stats { position: absolute; bottom: 26px; left: 26px; right: 26px; display: flex; gap: 26px; z-index: 2; }
.hero-stats .stat-num { font-family: var(--font-mono); font-size: 22px; color: var(--gold-soft); }
.hero-stats .stat-label { font-size: 12px; color: rgba(241,237,228,0.65); }

.scroll-hint { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.2em;
    color: var(--stone); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,8px); } }

/* ---------- Section 通用 ---------- */
.section { padding: 120px 0; position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 56px; gap: 24px; flex-wrap: wrap; }
.section-title { font-size: clamp(30px, 4vw, 42px); }
.section-title .num { font-family: var(--font-mono); color: var(--jade-light); font-size: 16px; display: block; margin-bottom: 10px; letter-spacing: 0.15em; }
.section-more { font-size: 14px; color: var(--gold-soft); display: flex; align-items: center; gap: 8px; }
.section-more svg { transition: transform 0.3s var(--ease); }
.section-more:hover svg { transform: translateX(6px); }

.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- 卡片：文章 / 视频 / 音乐 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
    background: linear-gradient(180deg, rgba(241,237,228,0.045), rgba(241,237,228,0.015));
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
    position: relative;
}
.card:hover { transform: translateY(-8px); border-color: rgba(201,161,92,0.4); box-shadow: 0 24px 50px rgba(0,0,0,0.35); }
.card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--jade-deep); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.card:hover .card-media img { transform: scale(1.07); }
.card-media .play-badge {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(12,18,16,0.25); opacity: 0; transition: opacity 0.4s var(--ease);
}
.card:hover .card-media .play-badge { opacity: 1; }
.play-badge span {
    width: 56px; height: 56px; border-radius: 50%; background: rgba(241,237,228,0.9);
    display: flex; align-items: center; justify-content: center; color: var(--ink);
    transform: scale(0.8); transition: transform 0.4s var(--ease);
}
.card:hover .play-badge span { transform: scale(1); }
.card-body { padding: 24px; }
.card-cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--jade-light); margin-bottom: 10px; display: block; }
.card-title { font-size: 20px; margin-bottom: 10px; line-height: 1.4; }
.card-summary { font-size: 14px; color: rgba(241,237,228,0.62); margin-bottom: 16px; }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--stone); font-family: var(--font-mono); }

/* 音乐条目 */
.music-row {
    display: flex; align-items: center; gap: 20px; padding: 16px 20px; border-radius: 10px;
    border: 1px solid transparent; transition: background 0.35s, border-color 0.35s; cursor: pointer;
}
.music-row:hover { background: rgba(241,237,228,0.04); border-color: var(--line); }
.music-row .idx { font-family: var(--font-mono); color: var(--stone); width: 24px; }
.music-row img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.music-row .info { flex: 1; min-width: 0; }
.music-row .m-title { font-size: 15px; margin-bottom: 3px; }
.music-row .m-artist { font-size: 12px; color: var(--stone); }
.music-row .m-dur { font-family: var(--font-mono); font-size: 12px; color: var(--stone); }
.music-row.playing { border-color: var(--gold); background: rgba(201,161,92,0.08); }
.music-row.playing .m-title { color: var(--gold-soft); }

/* 播放器 dock */
#player-dock {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 998;
    background: rgba(12,18,16,0.92); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 14px 0;
    transform: translateY(100%); transition: transform 0.5s var(--ease);
}
#player-dock.active { transform: translateY(0); }
.player-inner { display: flex; align-items: center; gap: 20px; }
.player-inner img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; }
.player-info { min-width: 160px; }
.player-info .p-title { font-size: 14px; }
.player-info .p-artist { font-size: 12px; color: var(--stone); }
.player-controls { display: flex; align-items: center; gap: 14px; }
.player-controls button { background: none; border: none; color: var(--paper); cursor: pointer; opacity: 0.85; }
.player-controls button:hover { opacity: 1; color: var(--gold-soft); }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--stone); }
.progress-bar { flex: 1; height: 4px; background: rgba(241,237,228,0.15); border-radius: 4px; position: relative; cursor: pointer; }
.progress-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); border-radius: 4px; width: 0%; }

/* ---------- 关于/签名区 ---------- */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 70px; align-items: center; }
.about-photo { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.quote-mark { font-family: var(--font-display); font-size: 60px; color: var(--jade); line-height: 1; }
.pull-quote { font-family: var(--font-display); font-size: 26px; line-height: 1.6; color: var(--gold-soft); margin: 14px 0 26px; }

/* ---------- 页脚 ---------- */
.site-footer { padding: 70px 0 34px; border-top: 1px solid var(--line); margin-top: 60px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; margin-bottom: 46px; }
.footer-brand { font-family: var(--font-display); font-size: 24px; }
.footer-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h5 { font-size: 13px; color: var(--stone); letter-spacing: 0.1em; margin-bottom: 16px; text-transform: uppercase; }
.footer-col a { display: block; font-size: 14px; margin-bottom: 10px; color: rgba(241,237,228,0.75); transition: color 0.3s; }
.footer-col a:hover { color: var(--gold-soft); }
.footer-bottom { display: flex; justify-content: space-between; font-size: 13px; color: var(--stone); flex-wrap: wrap; gap: 10px; }

/* ---------- 内页通用（列表/详情/表单） ---------- */
.page-hero { padding: 160px 0 60px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); }
.page-hero p { color: rgba(241,237,228,0.65); max-width: 560px; margin-top: 16px; }

.article-body { font-size: 17px; color: rgba(241,237,228,0.88); }
.article-body h2, .article-body h3 { margin: 40px 0 16px; color: var(--gold-soft); }
.article-body p { margin-bottom: 22px; }
.article-body img { border-radius: 10px; margin: 26px 0; }
.article-header { padding: 150px 0 40px; border-bottom: 1px solid var(--line); }
.article-cover { border-radius: var(--radius); overflow: hidden; margin: 30px 0 50px; aspect-ratio: 21/9; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-tags { display: flex; gap: 10px; margin-top: 18px; }
.tag { font-family: var(--font-mono); font-size: 11px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 100px; color: var(--jade-light); }

.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 60px; }
.sidebar-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.sidebar-box h4 { font-size: 15px; margin-bottom: 16px; color: var(--gold-soft); }
.side-item { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.side-item img { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.side-item .t { font-size: 13px; line-height: 1.5; }

/* 评论区 */
.comments-section { margin-top: 70px; padding-top: 50px; border-top: 1px solid var(--line); }
.comment-form textarea {
    width: 100%; min-height: 100px; background: rgba(241,237,228,0.04); border: 1px solid var(--line);
    border-radius: 10px; padding: 16px; color: var(--paper); font-family: var(--font-body); font-size: 14px;
    resize: vertical; transition: border-color 0.3s;
}
.comment-form textarea:focus { outline: none; border-color: var(--gold); }
.comment-item { display: flex; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.comment-item img { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.comment-author { font-size: 14px; font-weight: 600; margin-right: 10px; }
.comment-date { font-size: 12px; color: var(--stone); font-family: var(--font-mono); }
.comment-content { margin-top: 8px; font-size: 14px; color: rgba(241,237,228,0.82); }
.login-prompt { padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--stone); }
.login-prompt a { color: var(--gold-soft); font-weight: 600; }

/* 表单（登录/注册） */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 120px 20px 60px; }
.auth-box { width: 100%; max-width: 420px; padding: 46px; border: 1px solid var(--line); border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(241,237,228,0.05), rgba(241,237,228,0.01)); }
.auth-box h2 { font-size: 28px; margin-bottom: 8px; }
.auth-box .sub { color: var(--stone); font-size: 14px; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; color: var(--stone); margin-bottom: 8px; }
.form-group input, .form-group select {
    width: 100%; padding: 13px 16px; background: rgba(241,237,228,0.04); border: 1px solid var(--line);
    border-radius: 8px; color: var(--paper); font-family: var(--font-body); font-size: 14px; transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); }
.btn-block { width: 100%; justify-content: center; padding: 13px; margin-top: 8px; }
.auth-alt { text-align: center; margin-top: 24px; font-size: 14px; color: var(--stone); }
.auth-alt a { color: var(--gold-soft); font-weight: 600; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 20px; }
.alert-error { background: rgba(196,80,80,0.12); border: 1px solid rgba(196,80,80,0.35); color: #e39a9a; }
.alert-success { background: rgba(47,111,94,0.18); border: 1px solid rgba(47,111,94,0.5); color: var(--jade-light); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 60px; }
.pagination a, .pagination span {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-mono); font-size: 13px;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold-soft); }
.pagination .active { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* 响应式 */
@media (max-width: 980px) {
    .hero-grid, .about-grid, .two-col { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .nav-links { display: none; }
}
@media (max-width: 600px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: 80px 0; }
    .hero { padding-top: 100px; }
}

/* 键盘可访问性 */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--gold); outline-offset: 3px;
}
