/* ============================================================
   ME·WORLD — 深色杂志风 · Dark Editorial
   ============================================================ */
:root {
    color-scheme: dark;
    --bg: #0b0d10;
    --bg-soft: #101318;
    --surface: #14181e;
    --surface-2: #181e26;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --ink: #e9ecef;
    --ink-soft: #9aa4b1;
    --ink-faint: #69737f;
    --accent: #e8b25b;
    --accent-deep: #d9a04a;
    --accent-dim: rgba(232, 178, 91, 0.12);
    --blue: #5b9df0;
    --serif: "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
    --sans: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
    --radius: 14px;
    --maxw: 880px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: radial-gradient(ellipse 70% 46% at 50% -8%, rgba(232, 178, 91, 0.055), transparent 70%), var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(232, 178, 91, 0.28); color: #fff; }

a { color: inherit; }

/* 阅读进度条 */
#progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    z-index: 100;
    transition: width 0.1s linear;
}

/* ---------- 页面骨架 ---------- */
.page {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 36px 28px 90px;
}

/* ---------- 头部 ---------- */
.site-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 54px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2b323c, #171c23);
    border: 1px solid var(--line-strong);
    color: var(--accent);
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

.brand-name {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.site-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14.5px;
    transition: color 0.2s;
    position: relative;
}

.site-nav a:hover,
.site-nav a.active { color: var(--ink); }

.site-nav a.active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ---------- 隐藏式折叠导航（汉堡菜单面板） ---------- */
.site-nav { position: relative; }

.nav-burger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 14px 5px 11px;
    cursor: pointer;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color 0.2s, color 0.2s;
}

.nav-burger:hover,
.nav-burger.open,
.nav-burger.active {
    border-color: var(--line-strong);
    color: var(--ink);
}

.burger-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 3.5px;
}

.burger-icon i {
    display: block;
    width: 15px;
    height: 1.6px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-burger.open .burger-icon i:nth-child(1) { transform: translateY(5.1px) rotate(45deg); }
.nav-burger.open .burger-icon i:nth-child(2) { opacity: 0; }
.nav-burger.open .burger-icon i:nth-child(3) { transform: translateY(-5.1px) rotate(-45deg); }

.nav-burger.active::after {
    content: "";
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.nav-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(560px, calc(100vw - 48px));
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    padding: 22px 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 80;
}

.nav-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.np-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 26px;
}

.nav-burger { position: relative; }

.np-title {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.np-group a {
    display: block;
    padding: 7px 10px;
    margin: 2px -10px;
    border-radius: 8px;
    font-size: 14.5px;
    color: var(--ink-soft);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.np-group a:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }

.np-group a.now { color: var(--accent); }

.np-group a.now::after {
    content: " ·当前";
    font-size: 11px;
    color: var(--accent);
}

@media (max-width: 640px) {
    .nav-panel { padding: 16px 18px; }
    .np-inner { grid-template-columns: 1fr 1fr; gap: 14px 20px; }
}

.nav-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-faint);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.nav-search:hover { border-color: var(--line-strong); color: var(--ink-soft); }

.nav-search kbd {
    font-family: var(--mono);
    font-size: 11px;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--bg-soft);
}

/* ---------- 首页 Hero ---------- */
.hero {
    padding: 26px 0 44px;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    top: -90px; right: -70px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(232, 178, 91, 0.12), transparent 65%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: -60px; left: -80px;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(91, 157, 240, 0.09), transparent 65%);
    pointer-events: none;
}

.hero-kicker::before {
    content: "";
    display: inline-block;
    width: 26px; height: 1px;
    background: var(--accent);
    vertical-align: middle;
    margin-right: 10px;
    opacity: 0.7;
}

.hero-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.hero h1 {
    margin-top: 16px;
    font-size: 46px;
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.5px;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(115deg, #f4cd82, var(--accent) 55%, #cf9339);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
}

.hero-desc {
    margin-top: 16px;
    max-width: 600px;
    color: var(--ink-soft);
    font-size: 16.5px;
}

.hero-stats {
    margin-top: 30px;
    display: flex;
    gap: 44px;
}

.hero-stats .stat .num {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
}

.hero-stats .stat .lbl {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
}

/* ---------- 区块标题 ---------- */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 52px 0 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.section-title .num {
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 19px;
    font-weight: 700;
    margin-right: 10px;
}

.section-more {
    font-size: 13px;
    color: var(--ink-faint);
    text-decoration: none;
}

.section-more:hover { color: var(--accent); }

/* ---------- 精选文章 ---------- */
.featured {
    display: block;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 34px 36px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.featured::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(232, 178, 91, 0.07), transparent 55%);
    pointer-events: none;
}

.featured:hover {
    transform: translateY(-3px);
    border-color: rgba(232, 178, 91, 0.35);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.featured .featured-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.featured h2 {
    margin-top: 16px;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.3px;
}

.featured p {
    margin-top: 12px;
    color: var(--ink-soft);
    font-size: 15.5px;
    max-width: 640px;
}

.featured .featured-foot {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--ink-faint);
}

.featured .read-cue {
    margin-left: auto;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s;
}

.featured:hover .read-cue { transform: translateX(4px); }

/* ---------- 文章列表（杂志索引式） ---------- */
.post-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 20px;
    align-items: baseline;
    padding: 22px 6px;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
}

.post-row:hover { background: rgba(255, 255, 255, 0.02); }

.post-row .row-date {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
}

.post-row .row-main h3 {
    font-size: 18.5px;
    font-weight: 700;
    line-height: 1.45;
    transition: color 0.15s;
}

.post-row:hover .row-main h3 { color: var(--accent); }

.post-row .row-main p {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 14.5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-row .row-tag {
    font-size: 12px;
    color: var(--accent);
    border: 1px solid rgba(232, 178, 91, 0.3);
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- 标签云 ---------- */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 13.5px;
    transition: all 0.2s;
}

.tag-chip:hover {
    color: var(--accent);
    border-color: rgba(232, 178, 91, 0.4);
    background: var(--accent-dim);
}

.tag-chip .cnt {
    margin-left: 6px;
    font-size: 11.5px;
    color: var(--ink-faint);
}

/* ---------- 文章页布局 ---------- */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 44px;
    align-items: start;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 26px;
    color: var(--ink-faint);
    text-decoration: none;
    font-size: 13.5px;
    transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

/* ---------- 文章正文 ---------- */
.article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 44px 48px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--ink-faint);
}

.article-meta .post-tag {
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
}

.article-meta .dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--ink-faint);
}

.article h1 {
    margin-top: 16px;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: -0.4px;
}

.article .content {
    margin-top: 30px;
    font-size: 16.5px;
    color: #c6ccd4;
}

.article .content p { margin-top: 18px; }

.article .content h2 {
    margin-top: 42px;
    padding-bottom: 10px;
    font-size: 22px;
    font-weight: 800;
    scroll-margin-top: 80px;
}

.article .content h2::before {
    content: "§ ";
    color: var(--accent);
    font-family: var(--serif);
}

.article .content h3 {
    margin-top: 28px;
    font-size: 18px;
    scroll-margin-top: 80px;
}

.article .content strong { color: var(--ink); }

.article .content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(232, 178, 91, 0.35);
}

.article .content blockquote {
    margin-top: 20px;
    padding: 18px 24px;
    border-left: 3px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 12px 12px 0;
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: 16px;
}

.article .content ul {
    margin-top: 16px;
    padding-left: 6px;
    list-style: none;
}

.article .content li {
    margin-top: 10px;
    padding-left: 22px;
    position: relative;
}

.article .content li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.article .content code {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--accent);
}

.article .content pre {
    margin-top: 20px;
    padding: 20px 22px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    position: relative;
    font-size: 13.5px;
    line-height: 1.7;
}

.article .content pre code {
    padding: 0;
    border: none;
    background: none;
    color: #cfe0f5;
}

.code-copy {
    position: absolute;
    top: 10px; right: 10px;
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--sans);
    color: var(--ink-faint);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

pre:hover .code-copy { opacity: 1; }
.code-copy:hover { color: var(--accent); }

/* ---------- 目录 TOC ---------- */
.toc {
    position: sticky;
    top: 32px;
    font-size: 13px;
}

.toc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 12px;
}

.toc a {
    display: block;
    padding: 5px 0 5px 14px;
    color: var(--ink-faint);
    text-decoration: none;
    border-left: 2px solid var(--line);
    line-height: 1.5;
    transition: color 0.15s, border-color 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc a:hover { color: var(--ink-soft); }

.toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.toc a.toc-h3 { padding-left: 28px; font-size: 12px; }

/* ---------- 文章底部：上下篇 / 分享 ---------- */
.post-nav {
    margin-top: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.post-nav a {
    display: block;
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.2s;
}

.post-nav a:hover { border-color: rgba(232, 178, 91, 0.4); }

.post-nav .dir {
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.1em;
}

.post-nav .pt {
    margin-top: 6px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-nav a:hover .pt { color: var(--accent); }

.post-nav a.next { text-align: right; }

.post-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: none;
    color: var(--ink-soft);
    font-size: 13.5px;
    font-family: var(--sans);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: var(--accent);
    border-color: rgba(232, 178, 91, 0.4);
}

/* ---------- 归档 ---------- */
.archive-year {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin: 44px 0 8px;
}

.archive-year:first-of-type { margin-top: 8px; }

.archive-year .y {
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 700;
    color: var(--accent);
}

.archive-year .n {
    font-size: 12.5px;
    color: var(--ink-faint);
}

.archive-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 18px;
    align-items: baseline;
    padding: 16px 6px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background 0.15s;
}

.archive-item:hover { background: rgba(255, 255, 255, 0.02); }

.archive-item .d {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--ink-faint);
}

.archive-item .t {
    font-size: 16px;
    font-weight: 600;
}

.archive-item:hover .t { color: var(--accent); }

.archive-item .tag {
    font-size: 11.5px;
    color: var(--ink-faint);
    border: 1px solid var(--line);
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- 标签页 ---------- */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tag-filter-bar .tag-chip.on {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

/* ---------- 关于页 ---------- */
.about-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 44px 48px;
}

.about-card h1 { font-size: 32px; font-weight: 800; }

.about-card .content {
    margin-top: 20px;
    color: #c6ccd4;
    font-size: 16px;
}

.about-card .content p { margin-top: 16px; }
.about-card .content strong { color: var(--ink); }

.fact-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fact {
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.fact .k {
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
}

.fact .v {
    margin-top: 5px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--ink);
}

/* ---------- 404 ---------- */
.err-hero { text-align: center; padding: 90px 0 60px; }

.err-hero .code {
    font-family: var(--serif);
    font-size: 110px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.err-hero h1 { margin-top: 22px; font-size: 26px; }

.err-hero p { margin-top: 12px; color: var(--ink-soft); }

.err-hero .btn-ghost { margin-top: 30px; }

/* ---------- 搜索浮层 ---------- */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 9, 0.72);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 0;
}

.search-overlay.open { display: flex; }

.search-box {
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.search-box input {
    width: 100%;
    padding: 18px 22px;
    background: none;
    border: none;
    outline: none;
    color: var(--ink);
    font-size: 16.5px;
    font-family: var(--sans);
}

.search-box input::placeholder { color: var(--ink-faint); }

.search-results {
    max-height: 46vh;
    overflow-y: auto;
    border-top: 1px solid var(--line);
}

.search-results:empty { display: none; }

.search-hit {
    display: block;
    padding: 14px 22px;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
}

.search-hit:hover, .search-hit.sel { background: var(--bg-soft); }

.search-hit .ht {
    font-size: 15px;
    font-weight: 700;
}

.search-hit .ht mark {
    background: none;
    color: var(--accent);
}

.search-hit .hs {
    margin-top: 4px;
    font-size: 13px;
    color: var(--ink-faint);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-hint {
    padding: 12px 22px;
    font-size: 12px;
    color: var(--ink-faint);
    border-top: 1px solid var(--line);
}

/* ---------- 返回顶部 ---------- */
#back-top {
    position: fixed;
    right: 30px;
    bottom: 34px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 17px;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s, color 0.2s, border-color 0.2s;
}

#back-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#back-top:hover {
    color: var(--accent);
    border-color: rgba(232, 178, 91, 0.5);
}

/* ---------- 页脚 ---------- */
.site-foot {
    margin-top: 84px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink-faint);
    font-size: 13px;
}

.foot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.foot-brand .fm {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2b323c, #171c23);
    border: 1px solid var(--line-strong);
    color: var(--accent);
    font-family: var(--serif);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.foot-brand strong { color: var(--ink-soft); letter-spacing: 1px; font-family: var(--serif); }
.foot-brand p { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }

.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

.site-foot .foot-links { display: flex; gap: 18px; }

/* ---------- 滚动显现 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { transition: none !important; animation: none !important; }
}

/* ---------- 搜索命中高亮 ---------- */
.search-hit mark {
    background: rgba(232, 178, 91, 0.22);
    color: var(--accent);
    padding: 0 2px;
    border-radius: 3px;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #262c35;
    border-radius: 8px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #39414e; }

/* ---------- 键盘焦点态 ---------- */
:focus-visible {
    outline: 2px solid rgba(232, 178, 91, 0.7);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- 移动端目录 ---------- */
.toc-mobile { display: none; }

@media (max-width: 900px) {
    .toc-mobile { display: block; margin: 0 0 30px; }
    .toc-mobile summary {
        cursor: pointer;
        font-size: 13.5px;
        color: var(--ink-soft);
        padding: 11px 15px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
        list-style: none;
    }
    .toc-mobile summary::-webkit-details-marker { display: none; }
    .toc-mobile summary::before { content: "☰ "; color: var(--accent); }
    .toc-mobile[open] summary { border-color: var(--line-strong); }
    .toc-mobile a {
        display: block;
        padding: 8px 14px;
        margin-left: 15px;
        border-left: 2px solid var(--line);
        color: var(--ink-soft);
        text-decoration: none;
        font-size: 14px;
    }
    .toc-mobile a:hover { color: var(--accent); border-color: var(--accent); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .article-layout { grid-template-columns: 1fr; }
    .toc { display: none; }
}

@media (max-width: 640px) {
    .page { padding: 24px 18px 70px; }

    .site-nav { width: 100%; min-width: 0; justify-content: flex-start; }
    body { overflow-x: clip; }

    .site-head { margin-bottom: 40px; }
    .site-nav { gap: 12px 16px; flex-wrap: wrap; }
    .nav-search span.lbl, .nav-search kbd { display: none; }

    .hero h1 { font-size: 32px; }
    .hero-stats { gap: 28px; }

    .featured { padding: 26px 24px; }
    .featured h2 { font-size: 22px; }

    .post-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 4px; }
    .post-row .row-tag { justify-self: start; }

    .article, .about-card { padding: 28px 22px; }
    .article h1 { font-size: 26px; }

    .post-nav { grid-template-columns: 1fr; }
    .post-nav a.next { text-align: left; }

    .archive-item { grid-template-columns: 76px 1fr; }
    .archive-item .tag { display: none; }
    .archive-year .y { font-size: 27px; }

    .feature-grid { grid-template-columns: 1fr; }

    .fact-list { grid-template-columns: 1fr; }

    .site-foot { flex-direction: column; gap: 10px; }

    #back-top { right: 18px; bottom: 20px; }
}

/* ============================================================
   白昼主题 · Light Mode（开关灯）
   html[data-theme="light"] 时生效，默认黑夜不动
   ============================================================ */
html[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f5f0;
    --bg-soft: #f0ede6;
    --surface: #ffffff;
    --surface-2: #faf8f4;
    --line: rgba(28, 32, 40, 0.10);
    --line-strong: rgba(28, 32, 40, 0.20);
    --ink: #272b33;
    --ink-soft: #5b6472;
    --ink-faint: #8d96a3;
    --accent: #b07c22;
    --accent-deep: #96681c;
    --accent-dim: rgba(176, 124, 34, 0.10);
    --blue: #3d7dd2;
}

html[data-theme="light"] body {
    background:
        radial-gradient(ellipse 70% 46% at 50% -8%, rgba(176, 124, 34, 0.07), transparent 70%),
        var(--bg);
}

html[data-theme="light"] ::selection { background: rgba(176, 124, 34, 0.22); color: #272b33; }

/* 装饰光晕在白天下调 */
html[data-theme="light"] .hero::before {
    background: radial-gradient(circle, rgba(176, 124, 34, 0.10), transparent 65%);
}
html[data-theme="light"] .hero::after {
    background: radial-gradient(circle, rgba(61, 125, 210, 0.08), transparent 65%);
}

/* 品牌徽标渐变 */
html[data-theme="light"] .brand-mark,
html[data-theme="light"] .foot-brand .fm {
    background: linear-gradient(135deg, #ffffff, #efe9dc);
    border-color: var(--line-strong);
}

/* 悬停底色 / 阴影反转 */
html[data-theme="light"] .post-row:hover,
html[data-theme="light"] .archive-item:hover { background: rgba(28, 32, 40, 0.03); }

html[data-theme="light"] .np-group a:hover { background: rgba(28, 32, 40, 0.06); }

html[data-theme="light"] .featured:hover {
    box-shadow: 0 16px 36px rgba(120, 100, 60, 0.14);
}

html[data-theme="light"] .nav-panel {
    box-shadow: 0 18px 44px rgba(60, 55, 40, 0.18);
}

html[data-theme="light"] .search-overlay {
    background: rgba(240, 236, 228, 0.75);
}

html[data-theme="light"] .search-box {
    box-shadow: 0 30px 80px rgba(90, 80, 55, 0.22);
}

/* 正文与代码块颜色（原为硬编码深色系） */
html[data-theme="light"] .article .content,
html[data-theme="light"] .about-card .content { color: #3d434d; }

html[data-theme="light"] .article .content pre code { color: #274a70; }

/* 滚动条 */
html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #d8d2c4;
    border: 2px solid var(--bg);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #c2bba9; }

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 13px;
    font-family: var(--sans);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.theme-toggle:hover {
    border-color: var(--line-strong);
    color: var(--accent);
}

.theme-toggle .tt-ico {
    font-size: 13px;
    line-height: 1;
}

html.theme-anim body,
html.theme-anim .site-head,
html.theme-anim .featured,
html.theme-anim .article,
html.theme-anim .about-card,
html.theme-anim .nav-panel,
html.theme-anim .tag-chip,
html.theme-anim .fact,
html.theme-anim .post-nav a {
    transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

@media (max-width: 640px) {
    .theme-toggle .lbl { display: none; }
    .theme-toggle { padding: 5px 9px; }
}
