/* =============================================================
   Midnight · 午夜书廊
   设计系统 / 全局框架 / 响应式
   ============================================================= */

:root {
    --md-bg: #08090c;
    --md-bg-2: #0b0d12;
    --md-bg-3: #0e1117;
    --md-panel: #10131a;
    --md-panel-2: #151922;
    --md-panel-3: #1b202b;
    --md-line: rgba(255, 255, 255, .07);
    --md-line-2: rgba(255, 255, 255, .13);
    --md-line-gold: rgba(226, 178, 109, .26);
    --md-text: #ece9e3;
    --md-text-2: #b9b5ac;
    --md-muted: #8b877f;
    --md-dim: #605d57;
    --md-gold: #e2b26d;
    --md-gold-2: #f4d6a2;
    --md-gold-soft: rgba(226, 178, 109, .11);
    --md-terra: #d97a5f;
    --md-sage: #7fb8a4;
    --md-indigo: #7f93c9;
    --md-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    --md-shadow-sm: 0 8px 24px rgba(0, 0, 0, .3);
    --md-r: 18px;
    --md-r-sm: 12px;
    --md-r-xs: 8px;
    --md-wrap: 1440px;
    --md-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
    --md-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.md-body {
    margin: 0;
    min-height: 100vh;
    color: var(--md-text);
    background:
        radial-gradient(1000px 560px at 12% -10%, rgba(226, 178, 109, .06), transparent 62%),
        radial-gradient(900px 520px at 96% 2%, rgba(127, 147, 201, .055), transparent 60%),
        var(--md-bg);
    font: 15px/1.72 var(--md-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.md-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .25;
    background-image: radial-gradient(rgba(255, 255, 255, .18) .5px, transparent .5px);
    background-size: 3px 3px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 55%);
}

a { color: inherit; text-decoration: none; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, opacity .18s ease; }
a:hover { color: var(--md-gold); }
img { max-width: 100%; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.32; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--md-line); margin: 0; }
table { border-collapse: collapse; width: 100%; }
mark { background: var(--md-gold-soft); color: var(--md-gold-2); border-radius: 3px; padding: 0 2px; }
::selection { background: var(--md-gold-soft); color: var(--md-gold-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--md-bg); }
::-webkit-scrollbar-thumb { background: var(--md-panel-3); border-radius: 10px; border: 2px solid var(--md-bg); }
::-webkit-scrollbar-thumb:hover { background: #2a3140; }

:focus-visible { outline: 2px solid var(--md-gold); outline-offset: 2px; }

.md-wrap { width: min(var(--md-wrap), calc(100% - 64px)); margin-inline: auto; }
.hidden { display: none !important; }
.md-hidden { display: none !important; }
.md-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.md-clear::after { content: ""; display: table; clear: both; }

/* ---------- 通用按钮 ---------- */
.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--md-panel-2);
    color: var(--md-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    transition: all .2s ease;
}
.md-btn:hover { color: var(--md-text); transform: translateY(-1px); }
.md-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.md-btn--gold {
    background: linear-gradient(135deg, var(--md-gold-2), var(--md-gold) 55%, #c8964f);
    color: #1a1206;
    box-shadow: 0 10px 26px rgba(226, 178, 109, .18);
}
.md-btn--gold:hover { color: #140e05; box-shadow: 0 14px 32px rgba(226, 178, 109, .26); }
.md-btn--ghost { background: transparent; border-color: var(--md-line-2); color: var(--md-text-2); }
.md-btn--ghost:hover { border-color: var(--md-line-gold); color: var(--md-gold); background: var(--md-gold-soft); }
.md-btn--sm { min-height: 34px; padding: 0 14px; font-size: 12.5px; }
.md-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--md-line);
    border-radius: 50%;
    color: var(--md-muted);
    background: transparent;
    transition: all .2s ease;
}
.md-icon-btn:hover { color: var(--md-gold); border-color: var(--md-line-gold); background: var(--md-gold-soft); }
.md-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 小标签 ---------- */
.md-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 6px;
    background: var(--md-gold-soft);
    color: var(--md-gold);
    font-size: 11px;
    font-style: normal;
    line-height: 1.75;
    white-space: nowrap;
}
.md-chip--terra { background: rgba(217, 122, 95, .13); color: var(--md-terra); }
.md-chip--sage { background: rgba(127, 184, 164, .13); color: var(--md-sage); }
.md-chip--line { background: transparent; border: 1px solid var(--md-line-2); color: var(--md-muted); }

/* ---------- 段落标题 ---------- */
.md-sec { margin: 54px 0; }
.md-sec-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.md-sec-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.md-sec-index {
    color: var(--md-gold);
    font: 600 12px/1 var(--md-sans);
    letter-spacing: .2em;
}
.md-sec-head h2 {
    font: 600 clamp(21px, 1.8vw, 26px)/1.2 var(--md-serif);
    letter-spacing: .02em;
    white-space: nowrap;
}
.md-sec-head h2 em { color: var(--md-gold); font-style: normal; }
.md-sec-sub { color: var(--md-dim); font-size: 12px; letter-spacing: .08em; }
.md-more { display: inline-flex; align-items: center; gap: 6px; color: var(--md-muted); font-size: 13px; white-space: nowrap; }
.md-more:hover { color: var(--md-gold); }
.md-more svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 面板 ---------- */
.md-panel {
    background: var(--md-panel);
    border: 1px solid var(--md-line);
    border-radius: var(--md-r);
}

/* =============================================================
   顶部
   ============================================================= */
.md-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: color-mix(in srgb, var(--md-bg) 84%, transparent);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    border-bottom: 1px solid var(--md-line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .md-header { background: rgba(8, 9, 12, .92); }
}

.md-topbar {
    display: flex;
    align-items: center;
    gap: 30px;
    height: 76px;
}

.md-logo { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.md-logo:hover { color: var(--md-text); }
.md-logo-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(150deg, rgba(226, 178, 109, .2), rgba(226, 178, 109, .04));
    border: 1px solid var(--md-line-gold);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.md-logo-mark svg { width: 19px; height: 19px; fill: none; stroke: var(--md-gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.md-logo-text { font: 700 22px/1 var(--md-serif); letter-spacing: .05em; }
.md-logo-en {
    margin-left: 2px;
    padding-left: 12px;
    border-left: 1px solid var(--md-line);
    color: var(--md-dim);
    font-size: 9px;
    letter-spacing: .22em;
    text-transform: uppercase;
    white-space: nowrap;
}

.md-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    max-width: 430px;
    height: 42px;
    padding: 0 6px 0 16px;
    border: 1px solid var(--md-line);
    border-radius: 999px;
    background: var(--md-panel);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.md-search:focus-within { border-color: var(--md-line-gold); box-shadow: 0 0 0 4px rgba(226, 178, 109, .07); }
.md-search svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--md-muted); stroke-width: 1.8; stroke-linecap: round; }
.md-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--md-text);
    font-size: 13.5px;
}
.md-search input::placeholder { color: var(--md-dim); }
.md-search button {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--md-gold-soft);
    color: var(--md-gold);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
}
.md-search button:hover { background: var(--md-gold); color: #1a1206; }

.md-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-left: auto; }

.md-account { position: relative; display: flex; align-items: center; }
.md-account .login { display: flex; align-items: center; gap: 8px; }
.md-account .loginBtn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--md-line-2);
    border-radius: 999px;
    color: var(--md-text-2);
    font-size: 13px;
}
.md-account .loginBtn:hover { color: var(--md-gold); border-color: var(--md-line-gold); }
.md-account .registerBtn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--md-gold-2), var(--md-gold));
    color: #1a1206;
    font-size: 13px;
    font-weight: 700;
}
.md-account .registerBtn:hover { color: #140e05; filter: brightness(1.05); }
.md-account .isLogged { display: flex; align-items: center; gap: 8px; }
.md-account .isLogged a { display: none; }
.md-account .isLogged img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--md-line-2);
}
.md-account .suspend {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 132px;
    padding: 6px;
    background: var(--md-panel-2);
    border: 1px solid var(--md-line);
    border-radius: var(--md-r-sm);
    box-shadow: var(--md-shadow);
    z-index: 90;
}
.md-account .suspend a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--md-text-2); font-size: 13px; }
.md-account .suspend a:hover { background: var(--md-gold-soft); color: var(--md-gold); }
.md-account .suspend span { display: block; height: 1px; margin: 4px 8px; background: var(--md-line); }

.md-app { position: relative; }
.md-app .dlCon {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: 168px;
    padding: 14px;
    text-align: center;
    background: var(--md-panel-2);
    border: 1px solid var(--md-line);
    border-radius: var(--md-r-sm);
    box-shadow: var(--md-shadow);
    z-index: 90;
}
.md-app .dlCon span { display: block; margin-bottom: 8px; color: var(--md-muted); font-size: 11.5px; line-height: 1.5; }
.md-app .dlCon img { width: 132px; height: 132px; border-radius: 8px; background: #fff; padding: 4px; }

.md-burger { display: none; width: 40px; height: 40px; padding: 10px; border: 1px solid var(--md-line); border-radius: 11px; }
.md-burger span { display: block; height: 1.5px; margin: 4.5px 0; border-radius: 2px; background: var(--md-text-2); transition: .25s; }

/* 导航条 */
.md-navbar { border-top: 1px solid var(--md-line); background: rgba(255, 255, 255, .012); }
.md-navbar-inner { display: flex; align-items: center; gap: 24px; height: 48px; }
.md-nav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.md-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 15px;
    border-radius: 8px;
    color: var(--md-text-2);
    font-size: 14.5px;
    letter-spacing: .03em;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}
.md-nav-link:hover { color: var(--md-gold); background: var(--md-gold-soft); }
.md-nav-link.current { color: var(--md-gold); background: var(--md-gold-soft); }
.md-nav-link.current::after {
    content: "";
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--md-gold);
}
.md-nav-side { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; color: var(--md-muted); font-size: 12.5px; }
.md-nav-side a:hover { color: var(--md-gold); }
.md-nav-side .authorZone { display: inline-flex; align-items: center; gap: 6px; color: var(--md-gold); }
.md-nav-side .authorZone i { width: 5px; height: 5px; border-radius: 50%; background: var(--md-gold); box-shadow: 0 0 0 4px rgba(226, 178, 109, .12); }
.md-lang { display: inline-flex; align-items: center; padding-left: 14px; border-left: 1px solid var(--md-line); }
.md-lang select {
    height: 30px;
    max-width: 160px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--md-line);
    border-radius: 7px;
    background: var(--md-panel);
    color: var(--md-muted);
    font-size: 12px;
    cursor: pointer;
}

/* 移动抽屉 */
.md-drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(3, 4, 6, .7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: .25s;
}
.md-drawer-mask.on { opacity: 1; visibility: visible; }
.md-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 110;
    width: min(360px, 88vw);
    height: 100vh;
    padding: 24px;
    overflow-y: auto;
    background: var(--md-bg-2);
    border-left: 1px solid var(--md-line);
    box-shadow: var(--md-shadow);
    transform: translateX(102%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.md-drawer.on { transform: none; }
.md-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font: 600 18px var(--md-serif); }
.md-drawer-head button { font-size: 26px; line-height: 1; color: var(--md-muted); }
.md-drawer-search { display: flex; gap: 8px; margin-bottom: 18px; }
.md-drawer-search input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--md-line); border-radius: 999px; background: var(--md-panel); font-size: 13px; }
.md-drawer-search button { padding: 0 16px; border-radius: 999px; background: var(--md-gold); color: #1a1206; font-size: 13px; font-weight: 700; }
.md-drawer-nav a { display: flex; align-items: center; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid var(--md-line); color: var(--md-text-2); font-size: 15px; }
.md-drawer-nav a:hover, .md-drawer-nav a.current { color: var(--md-gold); }
.md-drawer-nav i { color: var(--md-dim); font-style: normal; }
.md-drawer-foot { display: flex; gap: 10px; margin-top: 22px; }
.md-drawer-foot a { flex: 1; padding: 11px; text-align: center; border: 1px solid var(--md-line-2); border-radius: 999px; font-size: 14px; }
.md-drawer-foot a.md-gold { background: var(--md-gold); border-color: var(--md-gold); color: #1a1206; font-weight: 700; }
.md-drawer-lang { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--md-line); }

/* =============================================================
   页面骨架 / 面包屑
   ============================================================= */
.md-main { padding: 30px 0 20px; }
.md-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--md-dim); font-size: 12.5px; }
.md-crumb a { color: var(--md-muted); }
.md-crumb a:hover { color: var(--md-gold); }
.md-crumb i { color: var(--md-dim); font-style: normal; }
.md-crumb span { color: var(--md-text-2); }

.md-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 18px 0 22px; }
.md-page-head h1 { font: 600 clamp(26px, 2.4vw, 34px)/1.2 var(--md-serif); letter-spacing: .02em; }
.md-page-head p { margin-top: 6px; color: var(--md-muted); font-size: 13px; }
.md-page-count { color: var(--md-dim); font-size: 12px; letter-spacing: .06em; }

/* =============================================================
   标签控制台（借鉴 tadu_pc filter-box，重新绘制）
   ============================================================= */
.md-tagpanel {
    position: relative;
    padding: 6px 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 42%),
        var(--md-panel);
    border: 1px solid var(--md-line);
    border-radius: var(--md-r);
    box-shadow: var(--md-shadow-sm);
    overflow: hidden;
}
.md-tagrow {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 10px 22px;
    border-top: 1px dashed var(--md-line);
}
.md-tagrow:first-child { border-top: 0; }
.md-tagrow-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 7px;
    color: var(--md-muted);
    font: 600 12.5px/1.2 var(--md-serif);
    letter-spacing: .16em;
    white-space: nowrap;
}
.md-tagrow-label::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--md-gold); opacity: .85; }
.md-tagrow-list { display: flex; flex-wrap: wrap; gap: 6px 4px; min-width: 0; }
.md-tag {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--md-text-2);
    font-size: 13.5px;
    white-space: nowrap;
    transition: all .16s ease;
}
.md-tag:hover { color: var(--md-gold); background: var(--md-gold-soft); }
.md-tag.is-active {
    color: #1a1206;
    background: linear-gradient(135deg, var(--md-gold-2), var(--md-gold));
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(226, 178, 109, .16);
}
.md-tag.is-active:hover { color: #1a1206; filter: brightness(1.04); }
.md-tag--sub { height: 28px; padding: 0 11px; font-size: 12.5px; color: var(--md-muted); }
.md-tagrow--scroll .md-tagrow-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.md-tagrow--scroll .md-tagrow-list::-webkit-scrollbar { display: none; }

/* 排序条 */
.md-toolbar {
    position: sticky;
    top: 124px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 8px 10px 8px 16px;
    background: color-mix(in srgb, var(--md-bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid var(--md-line);
    border-radius: 14px;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .md-toolbar { background: rgba(8, 9, 12, .92); }
}
.md-sorts { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.md-sorts::-webkit-scrollbar { display: none; }
.md-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 15px;
    border-radius: 8px;
    color: var(--md-muted);
    font-size: 13.5px;
    white-space: nowrap;
}
.md-sort:hover { color: var(--md-gold); background: var(--md-gold-soft); }
.md-sort.is-active { color: var(--md-gold); background: var(--md-gold-soft); font-weight: 600; }
.md-sort.is-active::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--md-gold); }
.md-viewsw { display: inline-flex; flex: 0 0 auto; padding: 3px; border: 1px solid var(--md-line); border-radius: 10px; background: var(--md-panel); }
.md-viewsw a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 11px;
    border-radius: 7px;
    color: var(--md-dim);
    font-size: 12.5px;
}
.md-viewsw a svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.md-viewsw a.is-active { color: var(--md-gold); background: var(--md-gold-soft); }

/* =============================================================
   书卡
   ============================================================= */
.md-book { position: relative; min-width: 0; }
.md-book-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: var(--md-panel-2);
    border: 1px solid var(--md-line);
    box-shadow: var(--md-shadow-sm);
    transition: transform .28s ease, border-color .2s ease, box-shadow .28s ease;
}
.md-book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease, filter .3s ease; }
.md-book-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 58%, rgba(4, 5, 8, .72));
    opacity: 0;
    transition: opacity .25s ease;
}
.md-book:hover .md-book-cover { transform: translateY(-4px); border-color: var(--md-line-gold); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
.md-book:hover .md-book-cover img { transform: scale(1.035); }
.md-book:hover .md-book-cover::after { opacity: 1; }
.md-book-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(8, 9, 12, .82);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--md-gold);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    backdrop-filter: blur(6px);
}
.md-book-state {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    padding: 1px 7px;
    border-radius: 4px;
    background: rgba(8, 9, 12, .78);
    color: var(--md-text-2);
    font-size: 10.5px;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .25s ease;
}
.md-book:hover .md-book-state { opacity: 1; }
.md-book-title { margin: 12px 0 5px; font: 600 15px/1.4 var(--md-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-book-title a:hover { color: var(--md-gold); }
.md-book-meta { display: flex; align-items: center; gap: 7px; color: var(--md-dim); font-size: 12px; overflow: hidden; white-space: nowrap; }
.md-book-meta em { font-style: normal; color: var(--md-muted); overflow: hidden; text-overflow: ellipsis; }
.md-book-meta i { width: 2px; height: 2px; border-radius: 50%; background: var(--md-dim); flex: 0 0 auto; }
.md-book-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.md-book-tags .md-chip { font-size: 10px; padding: 1px 7px; }
.md-book-desc {
    margin-top: 7px;
    color: var(--md-muted);
    font-size: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 网格 */
.md-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px 20px; }
.md-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.md-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.md-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* =============================================================
   分页
   ============================================================= */
.md-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 44px 0 10px; }
.md-pager a, .md-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--md-line);
    border-radius: 9px;
    color: var(--md-muted);
    font-size: 13px;
    background: var(--md-panel);
}
.md-pager a:hover { color: var(--md-gold); border-color: var(--md-line-gold); }
.md-pager .current, .md-pager .active { color: var(--md-gold); border-color: var(--md-line-gold); background: var(--md-gold-soft); }
.md-pager .disabled { opacity: .45; cursor: not-allowed; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 44px 0 10px; }
.pagination li { list-style: none; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--md-line);
    border-radius: 9px;
    color: var(--md-muted);
    font-size: 13px;
    background: var(--md-panel);
}
.pagination a:hover { color: var(--md-gold); border-color: var(--md-line-gold); }
.pagination .active span, .pagination .current { color: var(--md-gold); border-color: var(--md-line-gold); background: var(--md-gold-soft); }

/* =============================================================
   表单
   ============================================================= */
.md-field { display: flex; flex-direction: column; gap: 7px; }
.md-field > label { color: var(--md-muted); font-size: 12.5px; letter-spacing: .04em; }
.md-input, .md-field input[type="text"], .md-field input[type="password"], .md-field input[type="email"], .md-field input[type="tel"] {
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--md-line);
    border-radius: 10px;
    background: var(--md-bg-3);
    color: var(--md-text);
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.md-field input:focus, .md-input:focus { border-color: var(--md-line-gold); box-shadow: 0 0 0 3px rgba(226, 178, 109, .08); outline: none; }
.md-field input::placeholder, .md-input::placeholder { color: var(--md-dim); }

/* =============================================================
   空状态 / 表格
   ============================================================= */
.md-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 64px 20px;
    border: 1px dashed var(--md-line-2);
    border-radius: var(--md-r);
    color: var(--md-muted);
    text-align: center;
}
.md-empty svg { width: 34px; height: 34px; fill: none; stroke: var(--md-dim); stroke-width: 1.4; }
.md-empty b { color: var(--md-text-2); font-weight: 600; }
.md-empty p { color: var(--md-dim); font-size: 13px; }

.md-table { width: 100%; border-collapse: collapse; }
.md-table th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--md-line);
    color: var(--md-dim);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-align: left;
}
.md-table td { padding: 13px 12px; border-bottom: 1px dashed var(--md-line); font-size: 13px; color: var(--md-text-2); }
.md-table tr:last-child td { border-bottom: 0; }
.md-table tbody tr:hover td { background: rgba(255, 255, 255, .018); }

/* =============================================================
   页脚
   ============================================================= */
.md-footer {
    margin-top: 70px;
    border-top: 1px solid var(--md-line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .012), transparent 30%), var(--md-bg-2);
}
.md-footer-top {
    display: grid;
    grid-template-columns: 1.4fr .8fr 1fr .7fr;
    gap: 40px;
    padding: 52px 0 36px;
}
.md-footer-brand p { margin-top: 14px; max-width: 320px; color: var(--md-dim); font-size: 12.5px; line-height: 1.9; }
.md-footer h3 { margin-bottom: 14px; color: var(--md-text-2); font-size: 13px; font-weight: 600; letter-spacing: .1em; }
.md-footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.md-footer-nav a, .md-footer-cats a { color: var(--md-muted); font-size: 12.5px; }
.md-footer-nav a:hover, .md-footer-cats a:hover { color: var(--md-gold); }
.md-footer-cats { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.md-footer-qr { display: flex; align-items: center; gap: 12px; }
.md-footer-qr img { width: 92px; height: 92px; padding: 5px; border-radius: 10px; background: #fff; }
.md-footer-qr span { color: var(--md-dim); font-size: 11.5px; line-height: 1.7; }
.md-friendlink { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 18px 0; border-top: 1px solid var(--md-line); color: var(--md-dim); font-size: 12px; }
.md-friendlink > span { color: var(--md-muted); }
.md-friendlink a { color: var(--md-dim); font-size: 12px; }
.md-friendlink a:hover { color: var(--md-gold); }
.md-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 0 26px;
    border-top: 1px solid var(--md-line);
    color: var(--md-dim);
    font-size: 11.5px;
}
.md-footer-bottom a { color: var(--md-dim); }
.md-footer-bottom a:hover { color: var(--md-gold); }
.md-footer-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.md-footer-service { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* 返回顶部 */
.md-totop {
    position: fixed;
    right: 26px;
    bottom: 30px;
    z-index: 70;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--md-line-2);
    border-radius: 50%;
    background: var(--md-panel);
    color: var(--md-gold);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: .25s;
}
.md-totop.on { opacity: 1; visibility: visible; transform: none; }
.md-totop:hover { border-color: var(--md-line-gold); background: var(--md-gold-soft); }
.md-totop svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =============================================================
   响应式
   ============================================================= */
@media (max-width: 1360px) {
    .md-wrap { width: calc(100% - 48px); }
    .md-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .md-footer-top { grid-template-columns: 1.3fr .8fr 1fr .7fr; gap: 30px; }
    .md-footer-qr { display: none; }
}

@media (max-width: 1180px) {
    .md-logo-en { display: none; }
    .md-search { max-width: 360px; }
    .md-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 16px; }
    .md-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .md-wrap { width: calc(100% - 40px); }
    .md-topbar { gap: 20px; height: 68px; }
    .md-search { max-width: 300px; }
    .md-nav { overflow-x: auto; scrollbar-width: none; }
    .md-nav::-webkit-scrollbar { display: none; }
    .md-nav-link { padding: 0 11px; font-size: 14px; }
    .md-nav-side .authorZone { display: none; }
    .md-sec { margin: 44px 0; }
    .md-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .md-navbar { display: none; }
    .md-burger { display: block; }
    .md-search { max-width: none; flex: 1 1 auto; }
    .md-app { display: none; }
    .md-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-tagrow { grid-template-columns: 72px minmax(0, 1fr); padding: 9px 16px; gap: 10px; }
    .md-toolbar { top: 96px; }
    .md-footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
    .md-wrap { width: calc(100% - 32px); }
    .md-logo-text { font-size: 19px; }
    .md-logo-mark { width: 32px; height: 32px; border-radius: 9px; }
    .md-search { height: 38px; }
    .md-search button { height: 28px; padding: 0 12px; }
    .md-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
    .md-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-tagrow { grid-template-columns: 1fr; gap: 4px; }
    .md-tagrow-label { padding-top: 2px; }
    .md-tagrow--scroll .md-tagrow-list { flex-wrap: nowrap; margin-right: -16px; padding-right: 16px; }
    .md-tag { height: 30px; padding: 0 12px; font-size: 13px; }
    .md-toolbar { position: static; flex-wrap: wrap; padding: 8px; }
    .md-sec-head { align-items: center; }
    .md-sec-head h2 { font-size: 20px; }
    .md-sec-index, .md-sec-sub { display: none; }
    .md-page-head h1 { font-size: 25px; }
}

@media (max-width: 560px) {
    .md-wrap { width: calc(100% - 24px); }
    .md-topbar { gap: 10px; height: 60px; }
    .md-logo { gap: 7px; }
    .md-logo-mark { width: 29px; height: 29px; }
    .md-logo-text { font-size: 17px; }
    .md-search { display: none; }
    .md-account .loginBtn { display: none; }
    .md-actions { gap: 7px; }
    .md-account .registerBtn { height: 34px; padding: 0 13px; font-size: 12px; }
    .md-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
    .md-book-title { font-size: 14px; }
    .md-book-desc { display: none; }
    .md-footer-top { grid-template-columns: 1fr; gap: 26px; }
    .md-footer-bottom { flex-direction: column; }
    .md-totop { right: 14px; bottom: 18px; }
}

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

/* =============================================================
   兼容层：旧组件沿用 --nc-* 变量，这里做一次映射
   ============================================================= */
body.md-body {
    --nc-bg: var(--md-bg);
    --nc-bg-2: var(--md-bg-2);
    --nc-surface: var(--md-panel);
    --nc-surface-2: var(--md-panel-2);
    --nc-surface-3: var(--md-panel-3);
    --nc-line: var(--md-line);
    --nc-line-2: var(--md-line-2);
    --nc-text: var(--md-text);
    --nc-text-2: var(--md-text-2);
    --nc-muted: var(--md-muted);
    --nc-dim: var(--md-dim);
    --nc-gold: var(--md-gold);
    --nc-gold-2: var(--md-gold-2);
    --nc-gold-soft: var(--md-gold-soft);
    --nc-red: var(--md-terra);
    --nc-teal: var(--md-sage);
    --nc-blue: var(--md-indigo);
    --nc-r: var(--md-r);
    --nc-r-sm: var(--md-r-sm);
    --nc-shadow: var(--md-shadow);
    --nc-shadow-sm: var(--md-shadow-sm);
    --nc-serif: var(--md-serif);
    --nc-sans: var(--md-sans);
}

.md-header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }

/* 迷你头部（详情 / 作者等页） */
.md-mini { border-bottom: 1px solid var(--md-line); background: var(--md-bg-2); }
.md-mini-inner { display: flex; align-items: center; gap: 26px; height: 70px; }
.md-mini-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.md-mini-nav a { padding: 7px 12px; border-radius: 8px; color: var(--md-text-2); font-size: 13.5px; white-space: nowrap; }
.md-mini-nav a:hover, .md-mini-nav a.current { color: var(--md-gold); background: var(--md-gold-soft); }
.md-mini-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.md-search--mini { max-width: 260px; height: 38px; }
.md-search--mini input { font-size: 12.5px; }
.md-mini .login { display: flex; gap: 7px; }
.md-mini .loginBtn, .md-mini .registerBtn { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px; font-size: 12.5px; }
.md-mini .loginBtn { border: 1px solid var(--md-line-2); color: var(--md-text-2); }
.md-mini .registerBtn { background: var(--md-gold); color: #1a1206; font-weight: 700; }
.md-mini .suspend { position: absolute; }
@media (max-width: 1024px) {
    .md-mini-inner { gap: 16px; height: 62px; }
    .md-mini-nav { display: none; }
}

/* 抽屉分类 */
.md-drawer-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.md-drawer-cats a { padding: 5px 11px; border: 1px solid var(--md-line); border-radius: 7px; color: var(--md-muted); font-size: 12px; }
.md-drawer-cats a:hover { color: var(--md-gold); border-color: var(--md-line-gold); background: var(--md-gold-soft); }

/* 兼容分页器（控制器输出 ul.pager） */
.pager, .md-pager .pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pager li { list-style: none; }
.pager a, .pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--md-line-2);
    border-radius: 9px;
    color: var(--md-text-2);
    font-size: 13px;
    background: var(--md-panel-2);
}
.pager a:hover { color: var(--md-gold); border-color: var(--md-line-gold); }
.pager .active span, .pager .active a { color: var(--md-gold); border-color: var(--md-line-gold); background: var(--md-gold-soft); }
.pager .disabled span, .pager .disabled a { opacity: .45; cursor: not-allowed; }

/* 收藏态 */
.js-bk3-shelf.is-on { border-color: var(--md-line-gold); color: var(--md-gold); background: var(--md-gold-soft); }
.js-bk3-follow.is-on { border-color: var(--md-line-gold); color: var(--md-gold); background: var(--md-gold-soft); }
