/* ============================================================
   灵鹿书签 · 内页共享样式
   ============================================================ */
:root {
    color-scheme: light;
    --bg: #fdfcf8;
    --surface: #ffffff;
    --surface-strong: #fff;
    --surface-muted: #e9e6de;
    --ink: #171713;
    --ink-soft: #65635d;
    --line: #d1e2d4;
    --brand: #2d4a33;
    --brand-hover: #1e3323;
    --lime: #c9f85a;
    --accent: #2d4a33;
    --shadow: 0 18px 50px rgba(31, 29, 24, .09);
    --radius-lg: 28px;
    --radius-md: 19px;
    --page: 1180px;
}

body.dark {
    color-scheme: dark;
    --bg: #11110f;
    --surface: #191916;
    --surface-strong: #22221e;
    --surface-muted: #2a2a25;
    --ink: #f6f3e9;
    --ink-soft: #aaa79e;
    --line: #373630;
    --brand: #6fa87f;
    --brand-hover: #8fc19e;
    --lime: #bce94f;
    --shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 30;
    opacity: .04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 58%, transparent); outline-offset: 3px; }
.page-shell { width: min(calc(100% - 48px), var(--page)); margin-inline: auto; }

/* ---------------- 头部 ---------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-wrap { min-height: 76px; display: flex; align-items: center; gap: 34px; }
.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 850; letter-spacing: -.04em; }
.logo-img { height: 40px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.main-nav a { color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.header-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: color-mix(in srgb, var(--surface) 78%, transparent); cursor: pointer; transition: .18s ease; }
.icon-button:hover { transform: translateY(-2px); border-color: var(--ink-soft); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-button { display: none; }

/* ---------------- 详情主体 ---------------- */
.detail-main { padding: 30px 0 76px; }
.detail-hero {
    position: relative;
    min-height: 260px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    padding: clamp(28px, 4vw, 48px);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}
.detail-hero::after { content: attr(data-glyph); position: absolute; right: -16px; bottom: -70px; color: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 230px; font-weight: 950; letter-spacing: -.09em; line-height: 1; pointer-events: none; }
.hero-copy, .hero-figure { position: relative; z-index: 2; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 50px); line-height: 1; letter-spacing: -.055em; }
.hero-summary { max-width: 640px; margin: 17px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.5rem;
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    cursor: pointer;
    border: none;
}
.btn-primary { background: #2d4a33; color: #fff; box-shadow: 0 10px 40px rgba(45, 74, 51, .2); }
.btn-primary:hover { background: #1e3323; transform: scale(1.05); }
.btn-secondary { background: var(--surface-strong); color: var(--brand); border: 2px solid var(--line); }
.btn-secondary:hover { background: var(--bg); border-color: var(--brand); transform: scale(1.05); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; border-radius: 10px; }
.btn-sm svg { width: 14px; height: 14px; }
.hero-figure { width: clamp(280px, 34vw, 430px); }
.hero-figure img { display: block; width: 100%; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 10px 30px -10px rgba(45, 74, 51, .1); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 22px; align-items: start; margin-top: 22px; }
.article-card, .side-card { border: 1px solid var(--line); background: var(--surface); }
.article-card { padding: clamp(26px, 4vw, 48px); border-radius: var(--radius-lg); }
.article-body { max-width: 760px; font-size: 16px; line-height: 1.9; }
.article-body h2 { margin: 42px 0 14px; font-size: 28px; line-height: 1.25; letter-spacing: -.035em; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 30px 0 10px; font-size: 20px; line-height: 1.3; }
.article-body p { margin: 0 0 19px; color: color-mix(in srgb, var(--ink) 86%, var(--ink-soft)); }
.article-body ul { margin: 0 0 24px; padding-left: 22px; }
.article-body li { margin-bottom: 9px; padding-left: 4px; }
.article-body li::marker { color: var(--accent); }
.article-body a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; font-weight: 650; }
.article-body code { padding: 2px 6px; border-radius: 6px; background: var(--surface-muted); color: var(--brand); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; }

.sidebar { position: sticky; top: 94px; display: grid; gap: 14px; }
.side-card { padding: 20px; border-radius: var(--radius-md); }
.side-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.side-card-head h2 { margin: 0; }
.side-card h2 { font-size: 25px; letter-spacing: -.02em; }
.hero-figure img { background: var(--surface-muted); object-fit: cover; }
.side-card-img { display: block; width: 100%; margin-bottom: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-muted); object-fit: cover; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.fact:last-child { padding-bottom: 0; border-bottom: 0; }
.fact span:first-child { color: var(--ink-soft); }
.fact span:last-child { font-weight: 750; text-align: right; }
.series-copy { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.series-copy:last-of-type { margin-bottom: 0; }
.related { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.related:last-child { padding-bottom: 0; border-bottom: 0; }
.related-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-muted); font-size: 19px; }
.related-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 750; }
.related-meta { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }

.qa-section { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--line); }
.qa-section h2 { margin: 0 0 17px; font-size: 23px; letter-spacing: -.03em; }
.qa-item { margin-bottom: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); }
.qa-question { margin-bottom: 7px; font-size: 14px; font-weight: 800; }
.qa-answer { color: var(--ink-soft); font-size: 13px; line-height: 1.7; }

/* ---------------- 尾部 ---------------- */
.site-footer { background: var(--surface); padding: 26px 0; border-top: 1px solid var(--line); }
.footer-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.footer-copy { color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.footer-disclaimer { color: var(--ink-soft); font-size: 12px; line-height: 1.7; opacity: .75; }

/* ---------------- 滚动显现动画 ---------------- */
.animate-in { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.animate-in.visible { opacity: 1; transform: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar .side-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .page-shell { width: min(calc(100% - 28px), var(--page)); }
    .nav-wrap { min-height: 66px; justify-content: space-between; }
    .main-nav { position: absolute; top: 66px; left: 14px; right: 14px; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-strong); box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px; border-radius: 10px; }
    .main-nav a:hover { background: var(--surface-muted); }
    .menu-button { display: inline-grid; }
    .detail-main { padding-top: 18px; }
    .detail-hero { min-height: 0; grid-template-columns: 1fr; align-items: start; padding: 25px 22px; border-radius: 22px; }
    .detail-hero::after { bottom: -40px; font-size: 150px; }
    h1 { font-size: clamp(31px, 10vw, 46px); }
    .hero-summary { font-size: 13px; }
    .hero-figure { width: 100%; }
    .article-card { padding: 24px 20px; border-radius: 22px; }
    .article-body { font-size: 15px; line-height: 1.85; }
    .article-body h2 { font-size: 23px; }
    .sidebar { grid-template-columns: 1fr; }
    .sidebar .side-card:last-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
