/* =========================================================
   HZH · 个人站点 — 编辑式排版 / 暗色索引
   ========================================================= */

:root {
    --bg: #0A0B0D;
    --bg-2: #121316;
    --fg: #EDE9E1;
    --fg-dim: #8E8A82;
    --line: rgba(237, 233, 225, 0.13);
    --line-strong: rgba(237, 233, 225, 0.34);
    --accent: #D8A657;
    --danger: #D9694F;
    --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --sans: "Noto Sans CJK SC", "Source Han Sans SC", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --text: var(--fg);
    --text2: var(--fg-dim);
    --border: var(--line);
    --accent2: var(--accent);
    --mono: "JetBrains Mono", "SF Mono", "Roboto Mono", "Cascadia Mono", ui-monospace, "Noto Sans Mono CJK SC", monospace;
}

body.light {
    --bg: #F4F5F7;
    --bg-2: #EBECF0;
    --fg: #111318;
    --fg-dim: #666A73;
    --line: rgba(17, 19, 24, 0.14);
    --line-strong: rgba(17, 19, 24, 0.38);
    --accent: #9A6418;
    --danger: #B8422C;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.35s ease, color 0.35s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #0A0B0D; }

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 56px);
}

/* ============ 顶栏 ============ */
.masthead {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transition: background 0.35s ease;
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 66px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.24em;
    color: var(--fg);
}

.brand-mark {
    width: 6px;
    height: 6px;
    background: var(--accent);
    display: inline-block;
}

.topnav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
}

.topnav a {
    position: relative;
    padding: 4px 0;
    font-size: 12.5px;
    letter-spacing: 0.08em;
    color: var(--fg-dim);
    transition: color 0.25s ease;
}

.topnav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.28s ease;
}

.topnav a:hover { color: var(--fg); }
.topnav a:hover::after { width: 100%; }

.theme-toggle {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--fg-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
}

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

.main-wrap { padding-bottom: 0; }

/* ============ Hero ============ */
.hero { padding: clamp(56px, 10vh, 112px) 0 clamp(48px, 7vh, 80px); }

.hero-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-dim);
    animation: fadeUp 0.8s ease both;
}

.hero-meta .tz { font-style: normal; color: var(--accent); margin-left: 8px; }

#localClock { color: var(--fg); font-variant-numeric: tabular-nums; }

.hero-title {
    margin-top: clamp(38px, 7vh, 68px);
    font-family: var(--serif);
    font-weight: 900;
    color: var(--fg);
}

.hero-title .line { display: block; overflow: hidden; }

.hero-title .line > span {
    display: block;
    transform: translateY(115%);
    animation: riseIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title .line:first-child > span {
    font-size: clamp(62px, 12vw, 166px);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.hero-title .line-sub > span {
    padding-top: 0.14em;
    font-size: clamp(26px, 4.2vw, 56px);
    font-weight: 300;
    letter-spacing: 0.05em;
    line-height: 1.25;
    color: var(--fg-dim);
    animation-delay: 0.12s;
}

.hero-lede {
    max-width: 36ch;
    margin-top: clamp(26px, 4vh, 42px);
    color: var(--fg-dim);
    font-size: 15px;
    line-height: 1.9;
    animation: fadeUp 0.9s 0.28s both;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 36px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg);
    transition: border-color 0.3s ease;
    animation: fadeUp 0.9s 0.4s both;
}

.hero-cta .cta-arrow {
    color: var(--accent);
    transition: transform 0.3s ease;
}

.hero-cta:hover { border-color: var(--accent); }
.hero-cta:hover .cta-arrow { transform: translateX(6px); }

/* ============ 索引行（签名元素） ============ */
.index { border-top: 1px solid var(--line-strong); }

.index-row {
    position: relative;
    display: grid;
    grid-template-columns: 62px minmax(0, 1.05fr) minmax(0, 1.45fr) 32px;
    align-items: center;
    gap: 20px;
    padding: 30px 10px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.index-row::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--fg);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.45s cubic-bezier(0.76, 0, 0.24, 1);
}

.index-row:hover::before,
.index-row:focus-visible::before { transform: scaleY(1); }

.index-row > * {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease, transform 0.35s ease;
}

.idx {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--fg-dim);
}

.idx-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(22px, 2.8vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--fg);
}

.idx-desc {
    font-size: 13px;
    color: var(--fg-dim);
}

.idx-arrow {
    justify-self: end;
    font-size: 18px;
    color: var(--fg-dim);
}

.index-row:hover .idx,
.index-row:hover .idx-name,
.index-row:hover .idx-arrow,
.index-row:hover .idx-desc {
    color: var(--bg);
}

.index-row:hover .idx-desc { opacity: 0.72; }
.index-row:hover .idx-arrow { transform: translateX(6px); }

/* ============ 项目 ============ */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-top: clamp(68px, 10vh, 104px);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

.project-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(0, 2.1fr) 96px 42px;
    gap: 24px;
    align-items: baseline;
    padding: 20px 10px;
    border-bottom: 1px solid var(--line);
    transition: background 0.25s ease;
}

.project-row:hover { background: rgba(255, 255, 255, 0.025); }
body.light .project-row:hover { background: rgba(17, 19, 24, 0.03); }

.p-name {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--fg);
    transition: color 0.25s ease;
}

.project-row:hover .p-name { color: var(--accent); }

.p-desc { font-size: 13px; line-height: 1.75; color: var(--fg-dim); }

.p-lang,
.p-year {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--fg-dim);
    text-align: right;
}

/* ============ 页脚 ============ */
.site-footer {
    margin-top: clamp(68px, 10vh, 104px);
    border-top: 1px solid var(--line-strong);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 26px;
    padding-bottom: 46px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.13em;
    color: var(--fg-dim);
}

/* =========================================================
   通用组件（文件 / 博客 / 管理 / 登录）
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--fg);
    font-size: 13px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn:hover { border-color: var(--fg); }

.btn-primary {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #0A0B0D;
}

.btn-secondary {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--fg);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--fg-dim);
}

.btn-ghost:hover { color: var(--fg); border-color: var(--line-strong); }

.btn-sm { padding: 5px 10px; font-size: 11px; }

/* 表单 */
.input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.25s ease;
}

.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--fg-dim); opacity: 0.7; }

textarea.input {
    min-height: 200px;
    resize: vertical;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

/* 网格 */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* 卡片 */
.card {
    background: transparent;
    border: 1px solid var(--line);
    padding: 22px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.card:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.02);
}

body.light .card:hover { background: rgba(17, 19, 24, 0.025); }

.card h3 { font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }

/* 文件项 */
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    transition: background 0.25s ease;
    animation: fadeUp 0.4s ease both;
}

.file-item:hover { background: rgba(255, 255, 255, 0.025); }
body.light .file-item:hover { background: rgba(17, 19, 24, 0.03); }

.file-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    font-size: 15px;
    flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }

.file-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-dim);
}

/* 文章卡片 */
.post-card {
    border: 1px solid var(--line);
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color 0.3s ease, background 0.25s ease;
    animation: fadeUp 0.5s ease both;
}

.post-card:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.02);
}

body.light .post-card:hover { background: rgba(17, 19, 24, 0.025); }

.post-card h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.post-card h3 a { color: var(--fg); transition: color 0.25s ease; }
.post-card h3 a:hover { color: var(--accent); }

.post-meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    margin-bottom: 8px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 6px;
    border: 1px solid var(--line-strong);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    cursor: pointer;
    transition: all 0.25s ease;
}

.tag:hover { border-color: var(--accent); color: var(--accent); }

/* 上传区 */
.upload-zone {
    border: 1px dashed var(--line-strong);
    padding: 42px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.upload-zone:hover { border-color: var(--accent); color: var(--accent); }
.upload-zone.uploading { animation: pulse 1.5s ease-in-out infinite; }

/* 搜索 */
.search-box { position: relative; max-width: 420px; margin: 0 auto; }
.search-box .input { padding-right: 40px; }
.search-box .search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-dim);
}

/* Toast */
.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 12px 22px;
    border: 1px solid var(--line-strong);
    background: var(--bg-2);
    color: var(--fg);
    font-size: 13px;
    z-index: 1000;
    animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast-success { border-left: 3px solid #4ade80; }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent); }

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; animation: fadeIn 0.25s ease; }

.modal-content {
    background: var(--bg);
    border: 1px solid var(--line-strong);
    padding: 28px;
    width: 90%;
    max-width: 520px;
    animation: modalUp 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--line);
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s;
}

/* 统计数字（管理页） */
.stat-number {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1.2;
}

/* 空状态 */
.empty-state { padding: 60px 20px; text-align: center; color: var(--fg-dim); }
.empty-state .empty-icon { display: block; font-size: 3rem; margin-bottom: 14px; }
.empty-state h3 { color: var(--fg); font-weight: 600; margin-bottom: 8px; }

/* 加载 */
.loader {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

#pageLoader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s;
}

#pageLoader.hidden { opacity: 0; visibility: hidden; }

/* 回到顶部 */
#backToTop {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--fg-dim);
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

#backToTop.show { opacity: 1; visibility: visible; }
#backToTop:hover { color: var(--fg); border-color: var(--fg); }

/* 主题按钮补充：浅色下 */
body.light .theme-toggle { color: var(--fg-dim); }

/* 文章正文 */
.post-content { line-height: 1.95; font-size: 16px; }

.post-content h1,
.post-content h2,
.post-content h3 {
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.4;
    margin: 1.6em 0 0.6em;
}

.post-content h2 { font-size: 1.5em; }
.post-content h3 { font-size: 1.2em; }

.post-content p { margin: 0.9em 0; }

.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.post-content code {
    padding: 2px 6px;
    background: rgba(216, 166, 87, 0.12);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.86em;
}

.post-content pre {
    padding: 18px 20px;
    margin: 1.2em 0;
    border: 1px solid var(--line);
    background: var(--bg-2);
    overflow-x: auto;
}

.post-content pre code { background: none; border: none; padding: 0; }

.post-content ul,
.post-content ol { margin: 0.9em 0 0.9em 1.4em; }
.post-content li { margin: 0.3em 0; }

.post-content blockquote {
    margin: 1.2em 0;
    padding-left: 18px;
    border-left: 2px solid var(--accent);
    color: var(--fg-dim);
}

.post-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; }
.post-content th,
.post-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.post-content th { background: var(--bg-2); font-weight: 600; }

.post-content img { margin: 1.2em 0; }

/* 阅读时长 */
.read-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--line-strong);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
}

/* 评论区 */
.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    animation: fadeUp 0.4s ease both;
}

.comment-item:last-child { border-bottom: none; }

.comment-head { display: flex; align-items: center; gap: 10px; }

.comment-avatar {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

/* ============ 动画 ============ */
@keyframes riseIn {
    from { transform: translateY(115%); }
    to { transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
    .project-row {
        grid-template-columns: 1fr auto;
        gap: 4px 16px;
        padding: 18px 8px;
    }

    .p-name { font-size: 14px; }
    .p-desc { grid-column: 1 / -1; grid-row: 2; }
    .p-lang { grid-column: 2; grid-row: 1; }
    .p-year { display: none; }
}

@media (max-width: 720px) {
    .masthead-inner { height: 58px; }
    .topnav { gap: 14px; }
    .topnav a { font-size: 12px; }
    .topnav a[href*="github"] { display: none; }

    .index-row {
        grid-template-columns: 34px minmax(0, 1fr) 22px;
        gap: 4px 12px;
        padding: 22px 6px;
    }

    .idx { grid-column: 1; grid-row: 1; }
    .idx-name { grid-column: 2; grid-row: 1; }
    .idx-desc { grid-column: 2; grid-row: 2; font-size: 12px; }
    .idx-arrow { grid-column: 3; grid-row: 1 / span 2; align-self: center; }

    .hero-title .line:first-child > span { letter-spacing: -0.02em; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.001ms !important;
    }
    html { scroll-behavior: auto; }
}

/* 键盘可达性 */
a:focus-visible,
button:focus-visible,
.input:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 3px;
}

/* ============ 页面头（文件 / 博客 / 登录） ============ */
.eyebrow {
    display: block;
    margin-bottom: 10px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    padding: clamp(36px, 6vh, 64px) 0 26px;
    border-bottom: 1px solid var(--line-strong);
    margin-bottom: 12px;
}

.page-title {
    font-family: var(--serif);
    font-size: clamp(34px, 5vw, 60px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.page-head .search-box { width: 100%; max-width: 340px; margin: 0; }

.search-meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--fg-dim);
    margin-top: 14px;
}

/* 博客列表改为清单式 */
.post-card {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 26px 0;
    margin: 0;
    background: transparent;
}

.post-card:hover { background: transparent; border-color: var(--line); }
.post-card h3 { font-size: 21px; }
.post-card h3 a:hover { color: var(--accent); }

/* 文章页 */
.back-link {
    display: inline-block;
    margin: 36px 0 28px;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--fg-dim);
    transition: all 0.25s ease;
}

.back-link:hover { color: var(--fg); border-color: var(--accent); }

.article-head {
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line-strong);
}

.article-head h1 {
    margin: 0 0 18px;
    font-family: var(--serif);
    font-size: clamp(30px, 4.4vw, 52px);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.article-head .post-meta { margin-bottom: 12px; }

.article-body {
    max-width: 780px;
    padding: 36px 0 0;
}

/* 登录页 */
.login-wrap { max-width: 380px; margin: clamp(48px, 10vh, 96px) auto; }
.login-wrap .card { padding: 28px; }

/* ============ 布局：页脚沉底 ============ */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrap {
    flex: 1 0 auto;
    width: 100%;
    padding-bottom: clamp(40px, 6vh, 72px);
}

/* ============ 导航当前页 ============ */
.topnav a.active { color: var(--fg); }
.topnav a.active::after { width: 100%; }

/* ============ 登录引导 ============ */
.auth-gate {
    max-width: 520px;
    padding: clamp(28px, 5vw, 44px) 0;
    border-top: 1px solid var(--line);
}

.auth-gate p {
    color: var(--fg-dim);
    font-size: 14px;
    margin-bottom: 22px;
}

/* 文件列表 */
.file-list { display: block; margin-top: 18px; }

/* ============ 登录页（编辑式） ============ */
.login-box {
    width: 100%;
    padding-top: clamp(24px, 5vh, 44px);
    border-top: 1px solid var(--line-strong);
}

.login-title {
    font-family: var(--serif);
    font-size: clamp(30px, 4.4vw, 42px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.login-note {
    font-size: 13.5px;
    color: var(--fg-dim);
    margin-bottom: 30px;
}

@media (max-width: 480px) {
    .masthead-inner { gap: 12px; }
    .topnav { gap: 11px; }
    .topnav a { font-size: 11.5px; letter-spacing: 0.03em; }
    .theme-toggle { width: 26px; height: 26px; font-size: 12px; }
    .hero-meta { font-size: 9.5px; letter-spacing: 0.12em; }
    .brand { font-size: 12px; letter-spacing: 0.18em; }
}

@media (max-width: 520px) {
    .masthead-inner {
        height: auto;
        flex-wrap: wrap;
        gap: 8px 0;
        padding-top: 12px;
        padding-bottom: 10px;
    }
    .topnav {
        width: 100%;
        justify-content: space-between;
        gap: 0;
    }
    .topnav a { padding: 2px 0; }
    .masthead { position: static; }
}

/* ============ 图标：主题切换 / 文件类型 ============ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tt-icon {
    position: relative;
    display: block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: currentColor;
    transition: background 0.25s ease;
}

body.light .tt-icon {
    background: transparent;
    box-shadow: inset 0 0 0 1.3px currentColor;
}

body.light .tt-icon::after {
    content: "";
    position: absolute;
    top: -1.5px;
    right: -2.5px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
}

.file-icon {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
}

/* 搜索图标（SVG） */
.search-box .search-icon { width: 15px; height: 15px; }

/* ============ 管理后台 ============ */
.admin-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--fg-dim);
    letter-spacing: 0.02em;
}

.head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}

.admin-stats .stat {
    padding: 30px 10px;
    text-align: center;
    border-left: 1px solid var(--line);
}

.admin-stats .stat:first-child { border-left: 0; }

.admin-stats .stat p {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--fg-dim);
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .admin-stats { grid-template-columns: 1fr; }
    .admin-stats .stat {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 22px 10px;
    }
    .admin-stats .stat:first-child { border-top: 0; }
}

.admin-stats { border-top: 0; }
.admin-stats .stat-number { font-size: 2.8rem; }
.admin-stats .stat p { letter-spacing: 0.14em; text-transform: none; font-size: 11px; }

/* ============ 评论区 ============ */
.comment-block {
    margin-top: clamp(40px, 6vh, 64px);
    padding-top: 24px;
    border-top: 1px solid var(--line-strong);
}

.comment-title {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.comment-title span {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    color: var(--fg-dim);
    letter-spacing: 0.06em;
}

.comment-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.comment-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

/* 文章排版微调 */
.post-content { line-height: 1.85; }
.post-content h2 { margin-top: 1.2em; }
.comment-block { margin-top: clamp(36px, 5vh, 52px); }
