/* ============================================================
   NY软集仓 · 前台样式
   设计语言：暖纸底 / 墨色字 / 朱砂点缀 / 衬线标题（编辑部质感）
   ============================================================ */

:root {
    /* 纸与墨 */
    --paper: #f7f4ee;
    --paper-2: #efe9df;
    --surface: #fffdfa;
    --ink: #191714;
    --ink-2: #3f3a33;
    --muted: #8b8277;
    --line: #e4dccd;
    --line-2: #d2c7b4;

    /* 朱砂 + 辅色 */
    --accent: #b4442c;
    --accent-d: #93341f;
    --accent-soft: #f7e9e3;
    --jade: #3d6a5c;
    --gold: #b08a4f;

    --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;

    --maxw: 1180px;
    --radius: 10px;
    --shadow: 0 12px 34px rgba(60, 48, 32, .09);

    /* 旧变量别名（模板内联样式兼容） */
    --bg: var(--paper);
    --text: var(--ink);
    --brand: var(--accent);
    --brand-dark: var(--accent-d);
    --brand-soft: var(--accent-soft);
    --border: var(--line);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background-color: var(--paper);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

h1, h2, h3, h4 { line-height: 1.32; margin: 0 0 .5em; font-weight: 700; }
h1, h2 { font-family: var(--serif); letter-spacing: .005em; }

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

/* ===================== 顶部导航 ===================== */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(247, 244, 238, .88);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 70px; }

.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 7px; flex: 0 0 auto;
    background: var(--ink); color: var(--paper);
    display: grid; place-items: center;
    font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .03em; }

.nav-wrap { display: flex; align-items: center; gap: 20px; flex: 1 1 auto; min-width: 0; }
.site-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.site-nav > a, .nav-item > a {
    position: relative; display: inline-flex; align-items: center;
    padding: 10px 12px; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
    white-space: nowrap; transition: color .2s;
}
.site-nav > a::after, .nav-item > a::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 1.5px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.site-nav > a:hover, .nav-item > a:hover { color: var(--ink); }
.site-nav > a:hover::after, .nav-item > a:hover::after, .nav-item.has-child:focus-within > a::after { transform: scaleX(1); }

.nav-item.has-child { position: relative; }
.nav-item.has-child .caret { font-size: 9px; margin-left: 5px; opacity: .55; transition: transform .2s; }
.nav-item.has-child:hover .caret { transform: rotate(180deg); }
.nav-sub {
    position: absolute; top: calc(100% + 6px); left: 6px; min-width: 176px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow); padding: 7px; display: none; flex-direction: column; z-index: 70;
}
.nav-item.has-child:hover .nav-sub,
.nav-item.has-child:focus-within .nav-sub { display: flex; animation: navFade .18s ease; }
@keyframes navFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-sub a { padding: 9px 12px; border-radius: 6px; color: var(--ink-2); font-size: 14px; white-space: nowrap; transition: .16s; }
.nav-sub a:hover { background: var(--accent-soft); color: var(--accent-d); }

.search-box {
    display: flex; align-items: center; flex: 0 0 auto;
    background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
    padding: 2px 2px 2px 13px;
}
.search-box input {
    border: 0; background: transparent; outline: none; width: 168px;
    font-size: 14px; color: var(--ink); font-family: inherit; padding: 9px 0;
}
.search-box input::placeholder { color: #b3a99b; }
.search-box button {
    border: 0; width: 34px; height: 34px; border-radius: 6px; cursor: pointer;
    background: var(--ink); color: #fff; display: grid; place-items: center; transition: background .2s;
}
.search-box button:hover { background: var(--accent); }

.nav-toggle {
    display: none; width: 40px; height: 40px; flex: 0 0 auto;
    border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
    cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: .2s; }

.admin-link { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; }
.admin-link:hover { color: var(--accent); border-color: var(--accent); }

/* ===================== 首屏 ===================== */
.hero {
    position: relative; overflow: hidden;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 78px 0 70px;
}
.hero::before {
    content: ""; position: absolute; right: -140px; top: -170px; width: 560px; height: 560px; border-radius: 50%;
    background: radial-gradient(circle at 34% 34%, rgba(180, 68, 44, .16), rgba(180, 68, 44, 0) 64%);
    pointer-events: none;
}
.hero::after {
    content: ""; position: absolute; left: -60px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle at 60% 60%, rgba(61, 106, 92, .13), rgba(61, 106, 92, 0) 66%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero .eyebrow {
    font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase;
    color: var(--accent); font-weight: 700; margin: 0 0 16px;
}
.hero h1 { font-size: 48px; line-height: 1.22; margin: 0 0 16px; letter-spacing: -.01em; max-width: 15em; }
.hero h1 em { font-style: normal; position: relative; z-index: 0; white-space: nowrap; }
.hero h1 em::after {
    content: ""; position: absolute; left: -.02em; right: -.02em; bottom: .08em; height: .34em;
    background: rgba(180, 68, 44, .18); z-index: -1; border-radius: 2px;
}
.hero .lede { color: var(--ink-2); max-width: 40em; font-size: 15.5px; margin: 0 0 30px; }
.hero-search { display: flex; max-width: 540px; background: #fff; border: 1px solid var(--line-2); border-radius: 9px; padding: 5px 5px 5px 6px; box-shadow: 0 1px 0 rgba(60,48,32,.03); }
.hero-search input { flex: 1; border: 0; outline: none; padding: 11px 14px; font-size: 15px; border-radius: 6px; font-family: inherit; color: var(--ink); background: transparent; }
.hero-search input::placeholder { color: #b3a99b; }
.hero-search button { border: 0; background: var(--ink); color: #fff; padding: 0 26px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 14.5px; transition: background .2s; }
.hero-search button:hover { background: var(--accent); }

.hero-stats { display: flex; gap: 0; margin-top: 38px; flex-wrap: wrap; }
.hero-stats > div { padding: 0 30px; border-left: 1px solid var(--line-2); }
.hero-stats > div:first-child { padding-left: 0; border-left: 0; }
.hero-stats .num { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1.2; }
.hero-stats .lbl { color: var(--muted); font-size: 12.5px; letter-spacing: .08em; }

/* ===================== 区块 ===================== */
.section { padding: 52px 0; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 23px; margin: 0; display: flex; align-items: center; }
.section-head h2 small { font-family: var(--sans); }
.section-head a { color: var(--accent); font-size: 13.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.section-head a:hover { color: var(--accent-d); text-decoration: underline; text-underline-offset: 3px; }
.section-head .bar { width: 3px; height: 20px; background: var(--accent); display: inline-block; border-radius: 3px; margin-right: 11px; vertical-align: -2px; }

/* ===================== 资源卡片 ===================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 22px; }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: border-color .22s, transform .22s, box-shadow .22s;
}
.card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(60, 48, 32, .10); }
.card-thumb { aspect-ratio: 16/10; background: var(--paper-2); position: relative; overflow: hidden; display: block; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .card-thumb img { transform: scale(1.045); }
.card-cat {
    align-self: flex-start;
    background: var(--accent-soft); color: var(--accent-d);
    border: 1px solid rgba(180, 68, 44, .22);
    font-size: 11px; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px;
    text-decoration: none; transition: background .18s, color .18s;
}
.card-cat:hover { background: var(--accent); color: #fff; }
.card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 15.5px; font-weight: 600; margin: 0; font-family: var(--sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s; }
.card:hover .card-title a { background-size: 100% 1.5px; }
.card-summary { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; line-height: 1.62; }

/* ===================== 分类条（细线网格） ===================== */
.cat-strip {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    background: transparent;
    padding: 1px 0 0 1px;
}
.cat-pill {
    border: 1px solid var(--line); margin: -1px 0 0 -1px; background: var(--surface);
    padding: 20px 20px 18px; position: relative; transition: background .22s, color .22s;
}
.cat-pill::after {
    content: "→"; position: absolute; right: 18px; top: 20px; font-size: 15px;
    color: var(--line-2); transition: transform .25s, color .25s;
}
.cat-pill:hover { background: var(--accent-soft); border-color: var(--line-2); }
.cat-pill:hover::after { color: var(--accent); transform: translateX(4px); }
.cat-pill .ico { font-size: 20px; line-height: 1; }
.cat-pill .name { font-family: var(--serif); font-size: 17px; font-weight: 700; margin-top: 10px; letter-spacing: .02em; }
.cat-pill .cnt { font-size: 12px; color: var(--muted); margin-top: 3px; letter-spacing: .05em; }

/* ===================== 详情页 ===================== */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 30px 0 10px; align-items: start; }
.detail-main { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; min-width: 0; }
.detail-cover { width: 100%; border-radius: 8px; margin-bottom: 22px; border: 1px solid var(--line); }
.detail-title { font-size: 31px; margin-bottom: 8px; }
.detail-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 12px 0 22px; border-bottom: 1px solid var(--line); padding-bottom: 16px; letter-spacing: .03em; }
.detail-content { font-size: 15.5px; color: var(--ink-2); }
.detail-content img { border-radius: 8px; margin: 16px 0; border: 1px solid var(--line); }
.detail-content h2, .detail-content h3 { color: var(--ink); }
.detail-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 4px; }
.tag {
    border: 1px solid var(--line-2); color: var(--ink-2); font-size: 12.5px;
    padding: 4px 11px; border-radius: 5px; transition: .18s; letter-spacing: .02em;
}
.tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.dl-list { display: grid; gap: 10px; margin: 22px 0; }
.dl-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 8px;
    font-weight: 600; font-size: 15px; transition: background .2s, transform .2s;
    border: 1px solid var(--ink);
}
.dl-btn:hover { background: var(--accent); border-color: var(--accent); transform: translateX(3px); }
.dl-btn .mirror { font-size: 12px; opacity: .8; font-weight: 400; letter-spacing: .03em; }
.dl-btn .dl-ico { width: 22px; height: 22px; border-radius: 5px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.dl-btn .dl-label { display: inline-flex; align-items: center; gap: 10px; }

/* 下载提取码 */
.dl-code {
    display: inline-flex; align-items: center; gap: 8px;
    margin: -4px 2px 0; padding: 7px 12px;
    background: #fbf7ef; border: 1px dashed var(--accent); border-radius: 8px;
    font-size: 13px; color: #6b5a44;
}
.dl-code code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: 700; letter-spacing: .12em; color: var(--accent);
    background: transparent; padding: 0; border: 0;
}
.dl-copy {
    border: 1px solid var(--accent); background: #fff; color: var(--accent);
    border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer;
    transition: background .15s, color .15s;
}
.dl-copy:hover { background: var(--accent); color: #fff; }

.detail-side { display: grid; gap: 22px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.side-box h3 { font-size: 16px; font-family: var(--serif); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-list { display: grid; gap: 14px; }
.side-item { display: flex; gap: 12px; align-items: center; }
.side-item img { width: 66px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: 0 0 auto; }
.side-item .t { font-size: 14px; font-weight: 600; line-height: 1.5; }
.side-item:hover .t { color: var(--accent); }
.breadcrumb { font-size: 13px; color: var(--muted); padding: 20px 0 0; letter-spacing: .03em; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ===================== 表单 ===================== */
.form-wrap { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; letter-spacing: .02em; }
.field input, .field textarea, .field select {
    width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 13px;
    font-size: 14.5px; font-family: inherit; outline: none; background: #fff; color: var(--ink);
    transition: border-color .18s, box-shadow .18s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 68, 44, .1); }
.field .hint, .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
    display: inline-block; border: 1px solid var(--ink); background: var(--ink); color: #fff;
    padding: 11px 22px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 14.5px;
    font-family: inherit; transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-d); border-color: var(--accent); }
.btn-danger { background: #a5322a; border-color: #a5322a; }
.btn-danger:hover { background: #8c281f; border-color: #8c281f; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ===================== 分页 ===================== */
.pagination ul { display: flex; gap: 7px; list-style: none; padding: 0; justify-content: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-block; padding: 9px 14px; border-radius: 7px;
    border: 1px solid var(--line); background: var(--surface); font-size: 14px; transition: .18s;
}
.pagination a:hover { border-color: var(--ink); }
.pagination .active span { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .dots { border: 0; background: transparent; }

/* ===================== 其它 ===================== */
.empty { text-align: center; color: var(--muted); padding: 70px 0; font-family: var(--serif); font-size: 16px; }
.alert { padding: 13px 17px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; border-left: 3px solid; }
.alert-success { background: #eef6f1; color: #2c5a4b; border-color: var(--jade); }
.alert-error { background: #fbedeb; color: #8c281f; border-color: #a5322a; }
.alert-info { background: var(--accent-soft); color: var(--accent-d); border-color: var(--accent); }
.alert-warning { background: #fbf4e6; color: #7d5a20; border-color: var(--gold); }

.prose { font-size: 15.5px; color: var(--ink-2); line-height: 1.78; }
.prose h1 { font-size: 26px; margin-top: 30px; }
.prose h2 { font-size: 21px; margin-top: 32px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 17px; margin-top: 24px; }
.prose h4 { font-size: 15.5px; margin-top: 20px; }
.prose p { margin: 14px 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 14px 0; }
.prose li { margin: 5px 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-d); }
.prose code { background: var(--paper-2); padding: 2px 6px; border-radius: 4px; font-size: 13.5px; }
.prose pre {
    background: #1b1916; color: #e8ddcb; padding: 15px 18px; border-radius: 8px;
    overflow-x: auto; font-size: 13.5px; line-height: 1.65; margin: 18px 0;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.prose img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--paper-2); font-weight: 600; color: var(--ink); }
.about-prose { margin-top: 18px; }

/* ===================== 页脚 ===================== */
.site-footer {
    background: #1b1916; color: #b6ada0; margin-top: 70px; padding: 56px 0 22px;
    border-top: 3px solid var(--accent);
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 34px 40px; }
.footer-brand { flex: 1 1 280px; }
.footer-grid .footer-col:not(.footer-brand) { flex: 1 1 132px; }
.footer-col h4 {
    color: #f2ece1; font-family: var(--serif); font-size: 15px; font-weight: 700;
    letter-spacing: .08em; margin: 0 0 16px; position: relative; padding-bottom: 10px;
}
.footer-col h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 22px; height: 2px; background: var(--accent); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer-col a { color: #b6ada0; font-size: 14px; transition: color .18s; }
.footer-col a:hover { color: #fff; }
.footer-col ul li.more a { color: #d8a99a; }
.footer-text { font-size: 13.5px; line-height: 1.8; color: #a79e92; margin: 0; }
/* 页脚 Markdown 栏目 */
.footer-md { font-size: 13.5px; line-height: 1.8; color: #a79e92; }
.footer-md p { margin: 0 0 9px; }
.footer-md p:last-child { margin-bottom: 0; }
.footer-md strong { color: #e4dccf; }
.footer-md em { color: #cfc6b8; }
.footer-md a { color: #d8a99a; text-decoration: underline; text-underline-offset: 3px; }
.footer-md a:hover { color: #fff; }
.footer-md ul, .footer-md ol { list-style: none; padding: 0; margin: 0 0 9px; display: grid; gap: 9px; }
.footer-md code { background: #2a2622; color: #e0d6c6; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.footer-md blockquote { margin: 10px 0; padding-left: 12px; border-left: 2px solid var(--accent); color: #9d9488; }
.site-footer .brand { color: #f2ece1; }
.site-footer .brand-logo { background: var(--accent); color: #fff; }
.site-footer .brand-name { color: #f2ece1; }
.footer-desc { font-size: 13px; line-height: 1.8; color: #a79e92; margin: 14px 0 0; max-width: 34em; }
.footer-bottom {
    border-top: 1px solid #2d2924; margin-top: 42px; padding-top: 18px;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: 12.5px; letter-spacing: .04em; color: #8c8378;
}
.footer-bottom strong { color: #f2ece1; }
.footer-bottom a { color: #8c8378; }
.footer-bottom a:hover { color: #fff; }

/* ===================== 可访问性 ===================== */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* ===================== 版本徽标 / 版本历史 ===================== */
.ver-badge {
    display: inline-block; font-size: 12.5px; background: var(--accent-soft); color: var(--accent-d);
    border: 1px solid rgba(180, 68, 44, .3); padding: 2px 10px; border-radius: 5px;
    vertical-align: middle; font-weight: 700; letter-spacing: .04em; font-family: var(--sans);
}
.version-history { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 20px; }
.version-history li { border-left: 2px solid var(--line-2); padding: 2px 0 2px 18px; position: relative; }
.version-history li::before {
    content: ""; position: absolute; left: -5px; top: 8px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}
.version-history .vh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.version-history .vtag { font-weight: 700; color: var(--ink); font-family: var(--serif); font-size: 16px; }
.version-history .vlatest {
    font-size: 11px; letter-spacing: .06em; background: var(--accent); color: #fff;
    padding: 1px 7px; border-radius: 4px; font-weight: 600;
}
.version-history .vd { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.version-history .vc { font-size: 14.5px; color: var(--ink-2); margin-top: 3px; }
.version-history .vlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.version-history .vcode { font-size: 12.5px; color: var(--muted); }
.version-history .vcode code { background: var(--paper-2); padding: 2px 7px; border-radius: 4px; color: var(--accent-d); }
.version-history .vlink {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2);
    color: var(--ink-2); font-size: 13px; padding: 4px 11px; border-radius: 6px; transition: .18s;
}
.version-history .vlink:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.version-history .vlink img { width: 14px; height: 14px; border-radius: 3px; }

/* ===================== 分类页：子分类标签 ===================== */
.subcat-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 4px 0 20px; }
.subcat-label { color: var(--muted); font-size: 13.5px; letter-spacing: .04em; }
.subcat-pill {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px;
    padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: .18s;
}
.subcat-pill:hover { border-color: var(--accent); color: var(--accent-d); background: var(--accent-soft); }

/* ===================== 全部分类页 ===================== */
.cat-tree { display: grid; gap: 24px; }
.cat-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 26px; transition: border-color .2s; }
.cat-group:hover { border-color: var(--line-2); }
.cat-group-head { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; }
.cat-ico { font-size: 20px; }
.cat-group-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.cat-group-name:hover { color: var(--accent); }
.cat-group-cnt { font-size: 12.5px; color: var(--muted); letter-spacing: .05em; }
.cat-group-desc { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.subcat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.subcat-card {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 12px 15px; font-weight: 600; font-size: 14px; transition: background .2s, color .2s;
}
.subcat-card:hover { background: var(--accent-soft); color: var(--accent-d); }
.subcat-card .sc-name { font-weight: 600; }
.subcat-card .sc-cnt { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* ===================== 安装页 ===================== */
.install-box { max-width: 560px; margin: 60px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.install-box h1 { font-family: var(--serif); }
.code { background: #1b1916; color: #e8c9a0; padding: 15px 17px; border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.8; }

/* 通用动效（尊重系统偏好） */
.btn, .card, .cat-pill, .subcat-card { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   三端响应式
   ============================================================ */

/* 中屏 ≤1100：收紧间距，导航保持单行 */
@media (max-width: 1100px) {
    .header-inner { gap: 16px; }
    .nav-wrap { gap: 14px; }
    .site-nav > a, .nav-item > a { padding: 10px 9px; font-size: 13.5px; }
    .site-nav > a::after, .nav-item > a::after { left: 9px; right: 9px; }
    .search-box input { width: 150px; }
    .hero h1 { font-size: 40px; }
    .hero-stats > div { padding: 0 22px; }
}

/* 小平板 ≤900：切换为汉堡抽屉，详情单列 */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .nav-wrap {
        display: none; flex-direction: column; align-items: stretch; gap: 12px;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--surface); border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow); padding: 16px 22px 20px; z-index: 55;
    }
    .nav-wrap.open { display: flex; }
    .site-nav { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav > a, .nav-item > a { padding: 12px 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
    .site-nav > a::after, .nav-item > a::after { display: none; }
    .nav-item.has-child { position: static; }
    .nav-item.has-child .nav-sub {
        position: static; display: flex; box-shadow: none; border: 0; padding: 2px 0 6px 16px;
        min-width: 0; animation: none;
    }
    .nav-sub a { padding: 9px 0; border-bottom: 1px dashed var(--line); border-radius: 0; font-size: 13.5px; }
    .search-box { width: 100%; }
    .search-box input { width: 100%; }

    .detail-layout { grid-template-columns: 1fr; }
    .hero { padding: 52px 0 48px; }
    .hero h1 { font-size: 34px; }
    .section { padding: 38px 0; }
    .footer-grid { gap: 28px 32px; }
}

/* 手机 ≤720 */
@media (max-width: 720px) {
    .container { padding: 0 16px; }
    .header-inner { min-height: 62px; }
    .brand-name { font-size: 17px; }
    .hero { padding: 42px 0 40px; }
    .hero h1 { font-size: 28px; }
    .hero .lede { font-size: 14.5px; }
    .hero-stats { margin-top: 30px; }
    .hero-stats > div { padding: 0 16px; }
    .hero-stats .num { font-size: 22px; }
    .section-head h2 { font-size: 19px; }
    .grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
    .card-body { padding: 13px; }
    .cat-strip { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .detail-main { padding: 20px; }
    .detail-title { font-size: 23px; }
    .footer-grid { flex-direction: column; gap: 28px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .section { padding: 30px 0; }
}

/* 超小屏 ≤480 */
@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .hero h1 { font-size: 24px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .card-title { font-size: 14px; }
    .card-summary { display: none; }
    .cat-strip { grid-template-columns: 1fr 1fr; }
    .cat-pill { padding: 15px; }
    .cat-pill .name { font-size: 15px; }
    .subcat-grid { grid-template-columns: 1fr 1fr; }
    .dl-btn { flex-direction: column; align-items: flex-start; gap: 4px; }
    .dl-btn .mirror { align-self: flex-end; }
    .form-wrap { padding: 20px; }
    .hero-stats > div { border-left: 0; padding: 0; }
    .hero-stats { gap: 14px 26px; }
}
