/* ============================================================
   简安软件库 · 视觉与主页 xhja.cn（homepage_new）统一
   冷浅灰底 / 白面板 + 1px 细边 / 4~8px 圆角 / 主色 #1b5e8c
   布局保持软件站形态：侧栏分类 + 精选轮播 + 卡片网格 + 详情抽屉
   ============================================================ */

:root {
    --bg-0: #eef1f5;
    --bg-1: #f6f8fa;
    --bg-2: #e9edf2;
    --bg-3: #dfe5ec;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --tint: #f4f7fa;
    --tint-2: #eaf1f7;
    --border: #dde3ea;
    --border-strong: #b9d3e4;
    --text: #17212b;
    --text-secondary: #3b4a5b;
    --text-muted: #63758a;
    --primary: #1b5e8c;
    --primary-light: #2a7cb4;
    --primary-dark: #14496d;
    --accent: #0f766e;
    --success: #177245;
    --danger: #b42318;
    --warning: #8f4f06;
    --shadow: 0 1px 2px rgba(20, 32, 48, 0.05);
    --shadow-md: 0 2px 8px rgba(20, 32, 48, 0.09);
    --shadow-glow: none;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --header-h: 64px;
    /* 顶部公告条高度：app.js 实测后写入，关闭时归零 */
    --notice-h: 40px;
}

[data-theme="dark"] {
    --bg-0: #101720;
    --bg-1: #141b25;
    --bg-2: #18202b;
    --bg-3: #223041;
    --panel: #161e28;
    --panel-strong: #161e28;
    --tint: #1b2431;
    --tint-2: #202b3a;
    --border: #2a3746;
    --border-strong: #3c5266;
    --text: #e7edf4;
    --text-secondary: #b3c0cf;
    --text-muted: #7f8fa1;
    --primary: #6aa9cf;
    --primary-light: #8cc2e0;
    --primary-dark: #a5d2ea;
    --accent: #4fb3a6;
    --success: #63b98a;
    --danger: #d97066;
    --warning: #c9a063;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-glow: none;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-0);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* 旧版背景粒子层：与纸感底不搭，隐藏（app.js 里也不再初始化） */
#tech-canvas { display: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
textarea { resize: vertical; line-height: 1.6; }

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-ghost, .btn-ghost-sm, .btn-mini, .btn-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-weight: 600; border-radius: var(--radius-sm); transition: background .15s, border-color .15s, color .15s;
}
.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: 1px solid transparent;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { padding: 10px 20px; background: #fff; color: var(--text); border: 1px solid var(--field-border, var(--border)); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { padding: 9px 18px; background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); background: transparent; }
.btn-ghost-sm { padding: 6px 14px; background: transparent; color: var(--text-secondary); border: 1px solid var(--border); font-size: 12.5px; }
.btn-ghost-sm:hover { color: var(--primary); border-color: var(--primary); }
.btn-mini { padding: 6px 12px; font-size: 12px; background: var(--tint); color: var(--primary-dark); border: 1px solid var(--border); }
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { padding: 10px 20px; background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: transparent; font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
}
.btn-icon:hover { border-color: var(--primary); background: var(--tint); }

/* ===== Header ===== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--header-h);
    background: rgba(255, 255, 253, 0.96);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .site-header { background: rgba(18, 24, 32, 0.96); }
.header-inner {
    max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand-logo { width: 33px; height: 33px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.22; }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: 0.2px; color: var(--text); }
.brand-slogan { font-size: 10px; color: var(--text-muted); letter-spacing: 0.7px; }

.header-search {
    flex: 1; max-width: 420px; margin-left: auto;
    display: flex; align-items: center; gap: 10px;
    padding: 0 12px; height: 38px; border-radius: var(--radius-sm);
    background: #fff; border: 1px solid var(--border);
    transition: border-color .15s, box-shadow .15s;
}
[data-theme="dark"] .header-search { background: var(--tint); }
.header-search:focus-within { border-color: #879cac; box-shadow: 0 0 0 3px rgba(27, 94, 140, .12); }
.header-search .s-icon { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.header-search input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; outline: none; font-size: 13px; }
.header-search input::placeholder { color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.quota { display: flex; flex-direction: column; gap: 3px; min-width: 108px; }
.quota-txt { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.quota-bar { height: 3px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.quota-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--primary); transition: width 0.4s ease; }

/* ===== Layout ===== */
.layout {
    position: relative; z-index: 1;
    /* ⚠ 下面三行是「页脚贴底」所需，别只删 width:100%：
       body 是纵向 flex，本元素又带 margin:0 auto ⇒ 横向 auto 外边距会取消 stretch，
       宽度会塌成「收缩到内容宽度」，右侧内容区被压扁。给个确定宽度即可撑满+居中。 */
    width: 100%;
    flex: 1 0 auto;
    max-width: 1320px; margin: 0 auto;
    padding: calc(var(--header-h) + var(--notice-h) + 28px) 24px 44px;
    display: flex; gap: 26px; align-items: flex-start;
}

/* ===== Sidebar ===== */
.sidebar {
    position: sticky; top: calc(var(--header-h) + var(--notice-h) + 20px);
    flex: 0 0 216px; padding: 16px;
    border-radius: var(--radius-md);
    background: var(--panel); border: 1px solid var(--border);
}
.side-group { margin-bottom: 18px; }
.side-label {
    font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted);
    margin-bottom: 10px; padding-left: 10px;
}
.side-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 9px 10px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s; border: none; background: transparent; text-align: left;
}
.side-item:hover { background: var(--tint-2); color: var(--text); }
.side-item.active {
    background: var(--tint-2);
    color: var(--primary-dark); font-weight: 650;
}
.side-count { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.side-item.active .side-count { color: var(--primary); }
.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.side-foot { padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

/* ===== Content ===== */
.content { flex: 1; min-width: 0; }

.hero-wrap { margin-bottom: 26px; }
.hero-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hero-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.hero-head h2::before { content: ''; width: 3px; height: 15px; border-radius: 1px; background: var(--primary); }
.hero-nav { display: flex; gap: 6px; }
.hero-nav button {
    width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 15px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s;
}
.hero-nav button:hover { color: var(--primary); border-color: var(--primary); }
.hero {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 8px; scrollbar-width: thin;
}
.hero::-webkit-scrollbar { height: 6px; }
.hero::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.hero-card {
    flex: 0 0 360px; scroll-snap-align: start;
    display: flex; align-items: center; gap: 14px;
    padding: 16px; border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--panel);
    transition: border-color .15s; cursor: pointer; text-align: left;
}
.hero-card:hover { border-color: var(--border-strong); }
.hero-art {
    width: 60px; height: 60px; border-radius: var(--radius-md); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 28px;
    background: var(--tint); border: 1px solid var(--border);
}
.hero-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.hero-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; color: var(--primary); }
.hero-title { font-size: 15px; font-weight: 650; margin: 2px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-desc { font-size: 12.5px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-cta { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }

/* ===== Upload zone ===== */
.upload-zone {
    margin-bottom: 22px; padding: 16px; border-radius: var(--radius-md);
    border: 1.5px dashed var(--border-strong); background: var(--tint);
    transition: border-color .15s, background .15s;
}
.upload-zone.admin { border-style: solid; border-color: var(--primary); background: var(--tint-2); }
.upload-zone.drag { background: var(--tint-2); border-color: var(--primary); }
.upload-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding: 6px 0; }
.upload-icon { font-size: 22px; opacity: .85; }
.upload-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.upload-sub { font-size: 11.5px; color: var(--text-muted); }
.upload-opts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.upload-opts select {
    height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
    background: #fff; border: 1px solid var(--border); outline: none; font-size: 12.5px;
}
[data-theme="dark"] .upload-opts select { background: var(--tint); }

/* ===== Grid head ===== */
.grid-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 14px; }
.grid-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.grid-head h2::before { content: ''; width: 3px; height: 15px; border-radius: 1px; background: var(--primary); }
.grid-right { display: flex; align-items: center; gap: 10px; }
.sort-select { height: 32px; padding: 0 10px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--border); outline: none; font-size: 12.5px; }
[data-theme="dark"] .sort-select { background: var(--tint); }
.grid-count { font-size: 11.5px; color: var(--text-muted); background: var(--tint); border: 1px solid var(--border); padding: 2px 9px; border-radius: 4px; }

/* ===== App cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.app-card {
    position: relative; display: flex; flex-direction: column; gap: 9px;
    padding: 16px; border-radius: var(--radius-md);
    background: var(--panel); border: 1px solid var(--border);
    transition: border-color .15s; cursor: pointer; text-align: left;
}
.app-card:hover { border-color: var(--border-strong); }
.app-ico {
    width: 50px; height: 50px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; font-size: 25px;
    background: var(--tint); border: 1px solid var(--border);
}
.app-name { font-size: 14px; font-weight: 650; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sub { font-size: 12px; color: var(--primary); font-weight: 600; }
.app-desc { font-size: 12px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.app-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.app-get {
    margin-top: auto; height: 30px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
    background: var(--tint); color: var(--primary-dark); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s;
}
.app-card:hover .app-get { background: var(--primary); color: #fff; border-color: transparent; }
.app-badge {
    position: absolute; top: 10px; right: 10px; font-size: 10.5px; padding: 1px 7px; border-radius: 4px;
    background: var(--tint-2); color: var(--primary-dark); font-weight: 600;
}
.app-badge.private { background: #f7f3ea; color: var(--warning); }
[data-theme="dark"] .app-badge.private { background: rgba(195, 154, 99, .14); }
.app-admin { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.app-card:hover .app-admin { opacity: 1; }
.app-admin button {
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    background: #fff; border: 1px solid var(--border); color: var(--text-secondary);
}
[data-theme="dark"] .app-admin button { background: var(--tint); }
.app-admin button:hover { color: var(--primary); border-color: var(--primary); }
.app-admin button.danger:hover { color: var(--danger); border-color: var(--danger); }

.loading, .empty { padding: 44px 0; text-align: center; color: var(--text-muted); font-size: 13px; }
.empty { grid-column: 1 / -1; }
.error { padding: 16px; border-radius: var(--radius-sm); background: #fdf4f3; border: 1px solid #f0d9d6; color: var(--danger); font-size: 12.5px; line-height: 1.8; }
[data-theme="dark"] .error { background: rgba(201, 106, 98, .12); border-color: rgba(201, 106, 98, .3); color: #d99b94; }

/* ===== Detail sheet ===== */
.sheet-mask {
    position: fixed; inset: 0; z-index: 1200; background: rgba(35, 41, 37, 0.32);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1300;
    width: 440px; max-width: 92vw;
    background: var(--panel);
    border-left: 1px solid var(--border); box-shadow: var(--shadow-md);
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    overflow-y: auto;
}
.sheet.show { transform: translateX(0); }
.sheet-close {
    position: sticky; top: 0; float: right; margin: 12px 14px 0 0; z-index: 2;
    width: 30px; height: 30px; border-radius: var(--radius-sm); font-size: 18px; line-height: 1;
    background: var(--tint); color: var(--text-secondary); border: 1px solid var(--border);
}
.sheet-close:hover { color: var(--text); border-color: var(--border-strong); }
.sheet-body { padding: 26px 24px 36px; }
.sheet-hero { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.sheet-ico {
    width: 76px; height: 76px; border-radius: var(--radius-lg); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 38px;
    background: var(--tint); border: 1px solid var(--border);
}
.sheet-title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.sheet-sub { font-size: 12.5px; color: var(--primary); margin-top: 2px; }
.sheet-desc { font-size: 13px; color: var(--text-secondary); margin-top: 6px; line-height: 1.7; }
.sheet-actions { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.sheet-actions .btn-primary { flex: 1; min-width: 140px; }
.sheet-info {
    border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden;
}
.sheet-info div {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 9px 12px; font-size: 12.5px; border-bottom: 1px solid var(--border);
}
.sheet-info div:last-child { border-bottom: none; }
.sheet-info dt { color: var(--text-muted); flex-shrink: 0; }
.sheet-info dd { color: var(--text); text-align: right; word-break: break-all; }
.sheet-sec { margin-top: 20px; }
.sheet-sec h4 { font-size: 11.5px; font-weight: 700; color: var(--text-muted); letter-spacing: .8px; margin-bottom: 7px; }
.sheet-sec p, .sheet-sec li { font-size: 12.5px; color: var(--text-secondary); line-height: 1.8; }
.sheet-sec ul { padding-left: 18px; }
.sheet-log { white-space: pre-wrap; background: var(--tint); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; color: var(--text-secondary); }
.sheet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sheet-tags span { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; background: var(--tint); border: 1px solid var(--border); color: var(--primary-dark); }

/* ===== Footer（与 box.xhja.cn 同款：两行） ===== */
.site-footer {
    position: relative; z-index: 1; margin-top: auto;
    border-top: 1px solid #dde3ea;
    background: #f6f8fa;
}
[data-theme="dark"] .site-footer { background: #131a23; border-top-color: #2a3746; }
.footer-inner {
    max-width: 1320px; margin: 0 auto; padding: 16px 24px 15px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.footer-row {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; flex-wrap: wrap; line-height: 1.6;
}
.footer-brand { display: inline-flex; align-items: center; gap: 6px; }
.footer-logo { width: 18px; height: 18px; object-fit: contain; opacity: .9; }
.footer-name { font-size: 12.5px; font-weight: 700; }
.footer-dot { color: var(--text-muted); font-size: 11px; opacity: .7; }
.footer-copy { color: #63758a; font-size: 12px; }
[data-theme="dark"] .footer-copy { color: var(--text-muted); }
.footer-meta { font-size: 11.5px; color: #989f97; gap: 8px; }
.footer-meta a { color: #989f97; transition: color 0.15s; }
.footer-meta a:hover { color: var(--primary); }
[data-theme="dark"] .footer-meta, [data-theme="dark"] .footer-meta a { color: var(--text-muted); }
.footer-beian[hidden] + .footer-dot { display: none; }
.footer-beian { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: inherit; color: inherit; }
.footer-beian a { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.footer-beian a svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: .8; }
.beian-sep { margin: 0 2px; opacity: .4; }
.xhja-mail { margin: 0; font-size: inherit; }
.xhja-mail a { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.xhja-mail a:hover { color: var(--primary); }
.footer-pv { color: inherit; }

/* ===== Queue ===== */
.queue {
    position: fixed; right: 20px; bottom: 20px; z-index: 1400; width: 320px; max-width: 88vw;
    border-radius: var(--radius-md); background: var(--panel);
    border: 1px solid var(--border); box-shadow: var(--shadow-md); overflow: hidden;
}
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--border); }
.queue-body { max-height: 260px; overflow-y: auto; }
.q-item { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.q-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-bar { height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; margin: 6px 0 4px; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.3s ease; }
.q-state { font-size: 11px; color: var(--text-muted); }
.q-state.ok { color: var(--success); }
.q-state.err { color: var(--danger); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(35, 41, 37, 0.38);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto;
    padding: 22px; border-radius: var(--radius-md);
    background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.modal-lg { max-width: 560px; }
.modal-sm { max-width: 360px; }
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.modal label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 6px; }
.modal input, .modal select, .modal textarea {
    width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
    background: #fff; border: 1px solid var(--border); outline: none; transition: border-color .15s, box-shadow .15s;
}
[data-theme="dark"] .modal input, [data-theme="dark"] .modal select, [data-theme="dark"] .modal textarea { background: var(--tint); }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: #879cac; box-shadow: 0 0 0 3px rgba(27, 94, 140, .12); }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal .err { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--danger); }
.modal .hint { font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.modal .login-note { margin: -4px 0 12px; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.modal .login-note b { color: var(--text-secondary); font-weight: 600; }
.modal label.remember-line {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
}
.modal label.remember-line input[type="checkbox"] {
    width: auto; flex: none; margin: 0; padding: 0;
    accent-color: var(--primary); cursor: pointer;
}
.confirm-text { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.form-row { display: flex; gap: 10px; }
.form-col { flex: 1; min-width: 0; }
.form-col-narrow { flex: 0 0 86px; }

/* ===== Toast ===== */
.toast {
    position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(16px);
    z-index: 2000; max-width: 88vw; padding: 10px 18px; border-radius: var(--radius-sm);
    background: var(--panel); border: 1px solid var(--border);
    box-shadow: var(--shadow-md); font-size: 12.5px; color: var(--text);
    opacity: 0; pointer-events: none; transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
    .header-search { max-width: 260px; }
}
@media (max-width: 900px) {
    .layout { flex-direction: column; padding-top: calc(var(--header-h) + var(--notice-h) + 18px); }
    /* ⚠ 纵向排列后 .content 也必须有确定宽度：flex 容器的 align-items:flex-start
       会让它按内容宽度（max-content）撑出去，手机上是横向溢出。 */
    .content { width: 100%; }
    .sidebar {
        position: static; flex: none; width: 100%;
        display: flex; gap: 14px; overflow-x: auto; padding: 12px;
    }
    .side-group { margin-bottom: 0; }
    .cat-nav { flex-direction: row; gap: 6px; }
    .side-item { white-space: nowrap; }
    .side-foot { display: none; }
    .hero-card { flex: 0 0 300px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .sheet { width: 100%; max-width: 100%; top: auto; height: 82vh; border-left: none; border-top: 1px solid var(--border); transform: translateY(100%); }
    .sheet.show { transform: translateY(0); }
}
@media (max-width: 640px) {
    .header-inner { padding: 0 14px; gap: 10px; }
    .brand-slogan { display: none; }
    .header-search { max-width: none; }
    .quota { display: none; }
    .layout { padding-left: 14px; padding-right: 14px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .footer-inner { padding: 14px 14px 13px; gap: 7px; }
    .footer-row { gap: 7px; }
    .footer-meta { font-size: 10.5px; gap: 4px; letter-spacing: -.1px; }
    .footer-beian { gap: 6px; }
    .footer-meta .beian-sep { display: none; }
    .footer-pv, .footer-dot-pv { display: none; }
}
@media (max-width: 380px) {
    .footer-inner { padding: 12px 8px 11px; }
    .footer-meta { font-size: 10px; gap: 3px; letter-spacing: -.2px; }
    .footer-beian { gap: 5px; }
    .footer-dot { display: none; }
}

/* ===== 顶部公告条（上游新增功能，配色改为与主页一致） ===== */
.notice-bar {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 990;
    background: #f6f8fa;
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .notice-bar { background: #141b25; }
.notice-bar[hidden] { display: none !important; }
.notice-inner {
    position: relative; max-width: 1320px; margin: 0 auto; padding: 9px 44px;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    font-size: 12.5px; line-height: 1.6; color: var(--text-secondary);
}
.notice-icon { flex: 0 0 auto; width: 16px; height: 16px; color: var(--primary); }
.notice-text b { color: var(--text); font-weight: 700; }
.notice-text i { font-style: normal; margin: 0 7px; opacity: 0.4; }
.notice-close {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; padding: 0; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-muted);
    font-size: 16px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.notice-close:hover { background: var(--tint-2); color: var(--text); }
@media (max-width: 900px) {
    .notice-inner { padding: 8px 40px; text-align: left; justify-content: flex-start; }
}
@media (max-width: 640px) {
    .notice-inner { padding: 7px 34px 7px 14px; font-size: 11.5px; gap: 6px; }
    .notice-text i { margin: 0 4px; }
}
