:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --line: #e9edf3;
    --text: #1f2733;
    --muted: #8a94a6;
    --primary: #2f6fed;
    --primary-dark: #2257c4;
    --primary-soft: #eef4ff;
    --ok: #16a34a;
    --warn: #d97706;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
    --shadow-md: 0 6px 18px rgba(16,24,40,.07), 0 2px 6px rgba(16,24,40,.04);
    --shadow-lg: 0 16px 40px rgba(31,45,68,.12);
    --radius: 16px;
    --radius-sm: 10px;
}

/* ============ 粘贴夸克分享 · 多卡片（PasteMulti） ============ */
.pm-cards { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }

.pm-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pm-card.done { border-color: #b7e4c7; box-shadow: 0 0 0 2px rgba(22,163,74,.10); }
.pm-card.error { border-color: #f1c0c0; }
.pm-card.parsing { border-color: var(--primary); }

.pm-del {
    position: absolute; top: 8px; right: 8px;
    width: 24px; height: 24px; line-height: 22px; text-align: center;
    border: none; border-radius: 6px; cursor: pointer;
    background: #f2f4f8; color: var(--muted); font-size: 13px;
}
.pm-del:hover { background: #fde8e8; color: #d33; }

.pm-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pm-top .pm-pub { width: auto; margin: 0; }
.pm-top .pm-idx { font-weight: 600; color: var(--primary); font-size: 13px; margin-left: 2px; }

.pm-card > label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
.pm-card input[type="text"],
.pm-card select {
    width: 100%; box-sizing: border-box;
    padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 13px; color: var(--text); background: #fff;
}
.pm-card input[type="text"]:focus,
.pm-card select:focus { outline: none; border-color: var(--primary); }

.pm-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.pm-url { color: var(--muted); font-size: 12px; }

.pm-cats { display: flex; gap: 6px; }
.pm-cats select { flex: 1; min-width: 0; }

.pm-genpost-wrap { display: block; font-size: 12px; color: var(--text); margin-top: 10px; }
.pm-genpost-wrap input { width: auto; margin-right: 4px; vertical-align: -1px; }

.pm-dup {
    margin-top: 8px; padding: 7px 10px;
    font-size: 12px; color: #9a3412;
    background: #fff7ed; border: 1px solid #fed7aa;
    border-radius: 6px; line-height: 1.5;
}

.pm-toolbar {
    display: flex; align-items: center; gap: 10px;
    margin: 6px 0 14px;
}

@media (max-width: 560px) {
    .pm-grid { grid-template-columns: 1fr; }
    .pm-cats { flex-wrap: wrap; }
}

/* ============ 转存进度遮罩 ============ */
.transfer-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20, 28, 46, 0.55);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.transfer-box {
    width: min(360px, 86vw);
    background: #fff; border-radius: var(--radius); padding: 30px 26px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.transfer-spinner {
    width: 46px; height: 46px; margin: 0 auto 16px;
    border: 4px solid #e6ecf7; border-top-color: var(--primary);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.transfer-title { font-size: 16px; font-weight: 700; color: #1f2d44; margin-bottom: 14px; }
.transfer-bar {
    height: 10px; border-radius: 999px; background: #eef1f6; overflow: hidden;
}
.transfer-fill {
    height: 100%; width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f8bff, #2f6fed);
    background-size: 200% 100%;
    animation: transferStripes 1s linear infinite;
    transition: width .3s ease;
}
@keyframes transferStripes {
    0% { background-position: 0 0; }
    100% { background-position: 200% 0; }
}
.transfer-pct { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--primary); }
.transfer-sub { margin-top: 4px; font-size: 12px; color: var(--muted); min-height: 16px; }

/* ============ 后台帖子编辑表单 ============ */
.admin .panel form textarea[name="edescription"] { min-height: 70px; }
.admin .cat-selects { display: flex; gap: 8px; margin-top: 4px; }
.admin .cat-selects select { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin .rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin .chk { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.admin .chk input { width: auto; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 10;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo {
    font-size: 19px; font-weight: 800; text-decoration: none; letter-spacing: .3px;
    background: linear-gradient(135deg, #2f6fed 0%, #5b8cff 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar nav a { margin-left: 18px; color: var(--text); text-decoration: none; font-size: 14px; transition: color .15s; }
.topbar nav a:hover { color: var(--primary); }

/* Hero 横幅 */
.hero {
    margin: 22px 0 18px;
    border-radius: var(--radius);
    padding: 30px 32px;
    background: linear-gradient(135deg, #2f6fed 0%, #4f8bff 55%, #6aa1ff 100%);
    box-shadow: var(--shadow-md);
    color: #fff;
    position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,.12);
}
.hero::before {
    content: ""; position: absolute; right: 80px; bottom: -60px;
    width: 140px; height: 140px; border-radius: 50%;
    background: rgba(255,255,255,.10);
}
.hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.hero p { font-size: 14px; opacity: .92; margin-bottom: 16px; max-width: 560px; line-height: 1.7; }
.hero-btn {
    display: inline-block; background: #fff; color: var(--primary);
    text-decoration: none; font-weight: 700; font-size: 14px;
    padding: 10px 20px; border-radius: 999px; box-shadow: 0 6px 16px rgba(0,0,0,.12);
    transition: transform .15s, box-shadow .15s;
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.18); }

/* 布局 */
.layout { display: flex; gap: 22px; margin-top: 6px; align-items: flex-start; }
.side {
    width: 210px; flex: none; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px; position: sticky; top: 82px;
    box-shadow: var(--shadow-sm);
}
.side h3 { font-size: 12px; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.side h3:first-child { margin-top: 0; }
.cat-list { list-style: none; }
.cat-list li a { display: block; padding: 8px 11px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 14px; transition: background .15s; }
.cat-list li a:hover { background: var(--primary-soft); color: var(--primary); }
.cat-list li.active a { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.cat-list .sub { margin: 2px 0 2px 10px; padding-left: 8px; border-left: 1px solid var(--line); }
.cat-list .sub li a { font-size: 13px; padding: 6px 9px; }

/* ===================== 左侧分类菜单：默认折叠 ===================== */
/* 子级默认隐藏，仅当父级 .cat-item 带 .open 才展开（点击箭头切换，首页 JS 自动展开当前选中分支） */
.cat-sub { display: none; }
.cat-item.open > .cat-sub { display: block; }
.cat-toggle { cursor: pointer; display: inline-block; width: 16px; color: var(--muted); font-size: 11px; line-height: 1; transition: transform .15s ease; user-select: none; transform: rotate(0deg); vertical-align: middle; }
.cat-item.open > .cat-toggle { transform: rotate(90deg); }
.cat-item.has-children > a { display: inline-block; }
.sort-tabs a { display: inline-block; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; margin-right: 6px; font-size: 13px; color: var(--muted); text-decoration: none; transition: all .15s; }
.sort-tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-sm); }

.content { flex: 1; min-width: 0; }
.search { display: flex; gap: 10px; margin-bottom: 16px; }
.search input[type=text] {
    flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: 14px; background: var(--card); box-shadow: var(--shadow-sm); transition: border .15s, box-shadow .15s;
}
.search input[type=text]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.15); }
.search button, .btn-primary {
    background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm);
    padding: 11px 18px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
    transition: background .15s, transform .15s; font-weight: 600;
}
.search button:hover, .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary.big { padding: 13px 22px; font-size: 15px; width: 100%; margin-top: 8px; }

.post-count { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.post-list { list-style: none; }
.post-list li {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-list li:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d6e2fb; }
.post-title { font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; display: inline-block; margin: 2px 0; }
.post-title:hover { color: var(--primary); }
.post-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.post-sub { color: var(--muted); font-size: 13px; display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.tag { background: var(--primary-soft); color: var(--primary); font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.badge.ok { background: #e7f7ee; color: var(--ok); }
.badge.warn { background: #fdf3e3; color: var(--warn); }
.empty { color: var(--muted); padding: 40px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* 详情 */
.post-detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-top: 20px; box-shadow: var(--shadow-md); }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--primary); }
.post-detail h1 { font-size: 23px; margin: 12px 0; line-height: 1.4; }
.desc { background: #fafbfe; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 16px 0; white-space: pre-wrap; color: #2a3340; }
.link-box { background: #fafbfe; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 16px 0; }
.link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.link-row .label { width: 64px; color: var(--muted); font-size: 13px; flex: none; }
.link-row input { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; background: #fff; }
.link-row button { padding: 9px 14px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
.link-row button:hover { border-color: var(--primary); color: var(--primary); }
.hint, .warn-box { color: var(--warn); font-size: 13px; margin-top: 6px; }
.warn-box { background: #fdf3e3; border: 1px solid #f5d99b; padding: 10px 12px; border-radius: var(--radius-sm); }

.cmt-title { margin: 24px 0 12px; font-size: 17px; }
.cmt-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cmt-form input, .cmt-form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--card); }
.cmt-form textarea { min-height: 70px; resize: vertical; }
.cmt-form .btn-primary { width: auto; align-self: flex-start; }
.cmt-list { list-style: none; }
.cmt-list li { border-top: 1px solid var(--line); padding: 12px 0; }
.cmt-head { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.cmt-body { margin-top: 4px; white-space: pre-wrap; }

/* 发帖 */
.submit-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-top: 20px; box-shadow: var(--shadow-md); }
.submit-wrap h1 { font-size: 21px; margin-bottom: 8px; }
.lead { color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.submit-wrap label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.submit-wrap input, .submit-wrap textarea, .submit-wrap select {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--card);
}
.submit-wrap textarea { min-height: 80px; resize: vertical; }
.raw-actions { margin: 8px 0 4px; display: flex; align-items: center; gap: 10px; }
.cat-selects { display: flex; gap: 8px; }
.cat-selects select { width: 33.33%; }
.cat-selects select:disabled { color: var(--muted); background: #fafbfc; }

/* 提示框 */
.info { background: #e7f7ee; border: 1px solid #b6e6c8; color: #147a3a; padding: 11px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 14px; }
.error { background: #fdeaea; border: 1px solid #f4b9b9; color: #c0392b; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 14px; }

/* 后台 */
.admin-login { max-width: 340px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); }
.admin-login h1 { font-size: 18px; margin-bottom: 14px; }
.admin-login input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; }
.admin { margin-top: 20px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.panel label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
.panel input, .panel textarea, .panel select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--card); }
.panel textarea { min-height: 70px; resize: vertical; }
.panel small { color: var(--muted); font-size: 12px; }

/* 会员中心折叠面板（原生 <details> 实现，无需额外 JS） */
.panel.collapsible { padding: 0; }
.panel.collapsible > summary.panel-h {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin: 0;
  font-size: 16px; color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.panel.collapsible > summary.panel-h::-webkit-details-marker { display: none; }
.panel.collapsible > summary.panel-h .caret { color: var(--muted); display: inline-block; }
.panel.collapsible[open] > summary.panel-h .caret { transform: rotate(180deg); }
.panel.collapsible > .panel-bd { padding: 0 16px 16px; }
.panel.collapsible > .panel-bd > h3 { margin: 16px 0 8px; font-size: 14px; color: var(--muted); }
/* 兼容：标题移入 summary 后，清掉默认 h2 外边距，避免影响 flex 居中与 caret 对齐 */
.panel.collapsible > summary.panel-h h2 { margin: 0; }
.inline { display: flex; gap: 8px; margin-bottom: 10px; }
.inline input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.btn-mini { background: var(--primary-soft); color: var(--primary); border: none; border-radius: var(--radius-sm); padding: 6px 12px; font-size: 13px; cursor: pointer; text-decoration: none; }
.cat-admin { list-style: none; }
.cat-admin li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.del { color: #c0392b; text-decoration: none; margin-left: 8px; }

/* 分类管理树（无拖拽，行内编辑） */
.cat-manage-wrap { margin-top: 6px; }
.cat-manage-list { list-style: none; margin: 4px 0; padding-left: 22px; }
.cat-manage-list.root { padding-left: 0; }
.cat-manage-item { margin: 5px 0; }
.cat-manage-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 11px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.cat-manage-row:hover { border-color: var(--primary); }
.cat-name { flex: 1; font-size: 14px; }
.lvl { font-size: 11px; color: var(--muted); background: #f0f2f5; padding: 1px 7px; border-radius: 10px; }
.cat-edit-form { display: none; gap: 8px; margin: 6px 0 2px 22px; align-items: center; flex-wrap: wrap; }
.cat-edit-form input[type=text] { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 160px; }
.cat-edit-form select { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cat-row .del { font-size: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; }

/* 页脚 */
.footer {
    margin-top: 44px; padding: 28px 16px 36px; color: var(--muted); font-size: 13px;
    text-align: center; border-top: 1px solid var(--line); background: var(--card);
}
.footer-brand { font-weight: 700; color: var(--text); margin-bottom: 10px; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { color: var(--primary); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-beian { display: inline-block; margin-bottom: 6px; font-size: 12px; }
.footer-meta { font-size: 12px; margin: 2px 0; }

/* ============================================================
   移动端基础隐藏（桌面端隐藏）：必须定义在 ≤720px 媒体查询之前，
   以保证媒体查询内的 display:block / display:flex 在移动端能正确覆盖。
   （旧版曾把 .stage-entry / .bottom-nav 的桌面隐藏写在文件末尾，
    因级联顺序晚于媒体查询，导致移动端被错误隐藏 —— 现已上移修正）
   ============================================================ */
.stage-entry { display: none; }
/* 学段入口「你的学段」徽标（仅本人学段大卡显示，桌面端随 .stage-entry 隐藏） */
.stage-entry .stage-badge { font-size: 12px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; margin-left: 8px; }
.bottom-nav { display: none; }

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    /* 移动端不显示桌面左侧分类树（分类导航统一不在移动端首页展示，避免与移动端原生入口重复） */
    .side {
        display: none;
    }
    .hero { padding: 22px 20px; }
    .hero h1 { font-size: 21px; }

    /* 移动端不显示内联学段大卡（分类导航统一不在移动端首页展示，避免重复）；弹窗选择器不受影响 */
    .stage-entry { display: none; margin: 0 0 18px; }

    /* 单个学段大卡：更大、圆角、阴影 */
    .stage-entry .stage-card {
        border-radius: var(--radius);
        box-shadow: var(--shadow-md);
        padding: 16px 18px;
        margin-bottom: 14px;
    }
    /* 学段标题：更大字号、整卡可点（<button> 已占满宽度） */
    .stage-entry .stage-head {
        font-size: 18px;
        padding: 6px 0;
        color: var(--text);
        border-radius: var(--radius-sm);
        transition: color .15s ease, background .15s ease;
    }
    .stage-entry .stage-head:active { background: var(--primary-soft); }
    .stage-entry .stage-card.open .stage-head { color: var(--primary); }
    /* 学科 / 年级 chips：横向换行、清晰 */
    .stage-entry .stage-subs { gap: 12px; }
    .stage-entry .subj-block { gap: 8px; }
    .stage-entry .chip { font-size: 14px; padding: 7px 14px; }
    .stage-entry .grade-chips { flex-wrap: wrap; gap: 8px; margin-left: 10px; margin-top: 2px; }
    .stage-entry .chip-grade { font-size: 13px; padding: 6px 12px; }

    /* 底部固定导航（4 Tab：首页 / 分享 / 需求 / 我的） */
    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        background: #fff; border-top: 1px solid var(--line);
        box-shadow: 0 -2px 14px rgba(16,24,40,.10);
        align-items: stretch;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .bottom-nav .bn-item {
        flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px; padding: 8px 0; text-decoration: none; color: var(--muted); font-size: 11px;
        -webkit-tap-highlight-color: transparent; transition: color .15s ease, background .15s ease;
    }
    .bottom-nav .bn-item:active { background: var(--primary-soft); }
    .bottom-nav .bn-icon { font-size: 22px; line-height: 1; }
    .bottom-nav .bn-label { line-height: 1.1; }
    .bottom-nav .bn-item.active { color: var(--primary); font-weight: 600; }
    .bottom-nav .bn-item.active .bn-icon { transform: translateY(-1px); }

    /* 防止页面内容被 fixed 底部导航遮挡 */
    body { padding-bottom: 62px; }
}

/* ===================== 顶栏会员 ===================== */
nav .me { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 999px; color: var(--primary); font-size: 13px; }
nav .me-name { font-weight: 600; }
nav .me-lv { background: var(--primary); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 11px; }
nav .me-pts { color: #e6a23c; font-weight: 600; }
nav .logout { font-size: 13px; color: var(--muted); }

/* 顶栏头像：灰色圆形 + 首字占位（不新增图片文件） */
nav .me-avatar {
    width: 20px; height: 20px; border-radius: 50%;
    background: #c7ccd6; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex: none; line-height: 1;
}
/* SVIP 顶栏徽章：金/橙小药丸，与用户名保持间距（背景色由内联 style 提供） */
nav .me .svip-top-badge {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; color: #5a3d00;
    background: #FFD700; white-space: nowrap; margin-left: 2px;
}
/* SVIP 到期信息：小字、muted 色 */
nav .me .me-expire {
    font-size: 11px; color: var(--muted); margin-left: 4px; white-space: nowrap;
}

/* ===================== SVIP 头像边框（五级：日/月/季/年/终身） ===================== */

/* 会员中心大头像 56px —— 多层外发光 + 实色细边框 */
.member-card .avatar.svip-frame-day {
    border: 2px solid #4CAF50;
    box-shadow: 0 0 0 2px rgba(76,175,80,.15), 0 0 10px rgba(76,175,80,.25);
}
.member-card .avatar.svip-frame-month {
    border: 2px solid #2196F3;
    box-shadow: 0 0 0 2px rgba(33,150,243,.15), 0 0 10px rgba(33,150,243,.25);
}
.member-card .avatar.svip-frame-quarter {
    border: 2px solid #9C27B0;
    box-shadow: 0 0 0 2px rgba(156,39,176,.15), 0 0 10px rgba(156,39,176,.25);
}
.member-card .avatar.svip-frame-year {
    border: 2px solid #FF9800;
    box-shadow: 0 0 0 2px rgba(255,152,0,.15), 0 0 10px rgba(255,152,0,.25);
}
.member-card .avatar.svip-frame-lifetime {
    border: 2px solid #FFD700;
    box-shadow: 0 0 0 2px rgba(255,215,0,.2), 0 0 8px rgba(255,215,0,.35), 0 0 16px rgba(255,215,0,.45);
}

/* 顶部小头像 20px —— 细边框 + 轻微光晕 */
nav .me-avatar.svip-frame-day { border: 1.5px solid #4CAF50; box-shadow: 0 0 4px rgba(76,175,80,.35); }
nav .me-avatar.svip-frame-month { border: 1.5px solid #2196F3; box-shadow: 0 0 4px rgba(33,150,243,.35); }
nav .me-avatar.svip-frame-quarter { border: 1.5px solid #9C27B0; box-shadow: 0 0 4px rgba(156,39,176,.35); }
nav .me-avatar.svip-frame-year { border: 1.5px solid #FF9800; box-shadow: 0 0 4px rgba(255,152,0,.35); }
nav .me-avatar.svip-frame-lifetime { border: 1.5px solid #FFD700; box-shadow: 0 0 4px rgba(255,215,0,.55), 0 0 8px rgba(255,215,0,.35); }

/* ===================== 账户（登录/注册） ===================== */
.account-wrap { max-width: 420px; margin: 30px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); }
.account-wrap h1 { font-size: 22px; margin-bottom: 16px; }
.account-wrap form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.account-wrap label { font-size: 13px; color: var(--muted); }
.account-wrap input { padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.account-wrap .hint { margin-top: 12px; font-size: 13px; }
.account-wrap .hint a { color: var(--primary); }

/* 注册：邮箱 + 验证码输入同行（flex），与现有表单风格一致 */
.account-wrap .reg-code-row { display: flex; gap: 8px; margin: 4px 0 2px; }
.account-wrap .reg-code-row input[type="text"] { flex: 1; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.account-wrap .reg-code-row input[type="text"]:focus { outline: none; border-color: var(--primary); }
.account-wrap .reg-code-row .btn-mini { flex: none; white-space: nowrap; align-self: stretch; }
/* 倒计时禁用态 */
.account-wrap .reg-code-row .btn-mini:disabled { background: #e9edf3; color: var(--muted); cursor: not-allowed; }
.account-wrap #sendCodeMsg { margin: 4px 0 2px; }
@media (max-width: 480px) {
    .account-wrap .reg-code-row { flex-wrap: wrap; }
    .account-wrap .reg-code-row input[type="text"] { flex: 1 1 100%; }
    .account-wrap .reg-code-row .btn-mini { flex: 1 1 100%; }
}

/* ===================== 资源需求 ===================== */
.demands-wrap { max-width: 860px; margin: 0 auto; }
.demands-wrap .lead { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.demand-add { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.demand-add summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.demand-add form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.demand-list { list-style: none; display: grid; gap: 12px; }
.demand-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.demand-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.demand-card.solved { opacity: .7; }
.demand-title { font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; }
.demand-title:hover { color: var(--primary); }
.demand-desc { color: var(--muted); font-size: 13px; margin: 6px 0; white-space: pre-wrap; }
.demand-sub { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }

.demand-detail { max-width: 780px; margin: 0 auto; }
.demand-actions { display: flex; align-items: center; gap: 14px; margin: 18px 0 8px; flex-wrap: wrap; }
.need-count { font-size: 15px; }
.need-count b { color: var(--primary); font-size: 18px; }
.btn-solve { background: #fff; border: 1px solid var(--primary); color: var(--primary); padding: 9px 18px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; transition: all .15s; }
.btn-solve:hover { background: var(--primary); color: #fff; }

/* 需求详情：提交解答表单 */
.solve-form {
    margin-top: 16px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.solve-form > label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 14px 0 6px;
}
.solve-form > label:first-child { margin-top: 0; }
.solve-form > input[type="text"],
.solve-form > input[type="url"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.solve-form .cat-selects {
    display: flex;
    gap: 10px;
}
.solve-form .cat-selects select {
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #fff;
}
.solve-form .chk {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 4px;
    font-size: 14px;
    cursor: pointer;
}
.solve-form .chk input {
    margin: 0;
    width: auto;
}
.solve-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.solve-form .paste-box {
    margin-bottom: 14px;
    padding: 12px;
    background: #f5f8ff;
    border: 1px dashed var(--primary, #3a7afe);
    border-radius: var(--radius, 8px);
}
.solve-form .paste-box label {
    color: var(--primary, #3a7afe);
    font-weight: 600;
}
.solve-form textarea#solvePaste {
    width: 100%;
    box-sizing: border-box;
    min-height: 70px;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid var(--line, #ddd);
    border-radius: var(--radius-sm, 6px);
    font: inherit;
    resize: vertical;
    background: #fff;
}
.solve-form .paste-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.solve-form .paste-tip {
    font-size: 12px;
    color: #888;
}

.solve-form .dup-warn {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: var(--radius-sm, 6px);
    font-size: 13px;
    color: #ad6800;
    line-height: 1.6;
}
.solve-form .dup-warn b { color: #ad6800; }

/* ===================== 会员中心 ===================== */
.member-wrap { max-width: 780px; margin: 0 auto; }
.member-card { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.member-card .avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,#2f6fed,#5b8cff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.member-info { flex: 1; }
.m-name { font-size: 18px; font-weight: 700; }
.m-level { display: inline-block; background: #fff3e0; color: #e6a23c; border-radius: 8px; padding: 1px 8px; font-size: 12px; margin: 4px 0; }
.m-points { font-size: 14px; }
.m-points b { color: var(--primary); font-size: 16px; }
.m-bar { height: 8px; background: #eef0f3; border-radius: 6px; overflow: hidden; margin: 6px 0 3px; max-width: 320px; }
.m-bar span { display: block; height: 100%; background: linear-gradient(90deg, #4f9bff, #2f7be0); }
.m-gap { font-size: 12px; color: var(--muted); }
.mini-list { list-style: none; display: grid; gap: 6px; }
.mini-list li { font-size: 14px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.mini-list a { color: var(--text); text-decoration: none; }
.mini-list a:hover { color: var(--primary); }
.tbl .up { color: #19a34a; font-weight: 600; }
.tbl .down { color: #e8533f; font-weight: 600; }

/* ===================== 后台：分隔与子标题 ===================== */
.panel hr.sep { border: none; border-top: 1px dashed var(--line); margin: 20px 0 12px; }
.panel h3.sub { font-size: 14px; color: var(--text); margin: 0 0 8px; font-weight: 700; }

/* ===================== 首页批量复制工具栏 ===================== */
/* 默认隐藏，仅当用户点击「批量复制」进入批量模式（.content.batch-on）才显示 */
.bulk-bar { display: none; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.content.batch-on .bulk-bar { display: flex; }
.bulk-bar .chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin: 0; cursor: pointer; }
.bulk-bar .hint { margin: 0; }

/* 帖子列表多选布局 */
.post-list li { display: flex; align-items: flex-start; gap: 12px; }
.post-list li .sel-wrap { display: none; flex: none; padding-top: 3px; }
.content.batch-on .post-list li .sel-wrap { display: block; }
.post-list li .sel { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary); }

/* 会员中心批量复制：复选框与工具栏始终可见（不依赖首页 .content.batch-on 开关） */
.member-wrap .post-list li .sel-wrap { display: block; }
.member-wrap .bulk-bar { display: flex; }
.post-list li .post-body { flex: 1; min-width: 0; }

/* 「批量复制」切换按钮所在行 */
.post-count-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.post-count-row .post-count { margin-bottom: 0; }
.btn-mini.active { background: var(--primary); color: #fff; }

/* 后台手动扫描输出 */
.scan-out { background: #0f172a; color: #d1fae5; border-radius: var(--radius-sm); padding: 14px; margin-top: 12px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; max-height: 360px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ===================== 后台侧边栏框架 ===================== */
.admin-login .al-brand { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.admin-shell { display: flex; align-items: flex-start; gap: 0; margin-top: 18px; min-height: 70vh; }
.admin-side {
    width: 220px; flex: none; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 12px; position: sticky; top: 80px;
    box-shadow: var(--shadow-sm); align-self: flex-start;
}
.admin-brand { font-size: 16px; font-weight: 800; color: var(--text); padding: 6px 8px 12px; display: flex; align-items: center; gap: 8px; }
.admin-brand .ab-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg,#2f6fed,#5b8cff); display: inline-block; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-item { display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 14px; transition: background .15s, color .15s; }
.admin-nav-item:hover { background: var(--primary-soft); color: var(--primary); }
.admin-nav-item.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
/* 分组侧边栏（T08）：组容器 + 组标题，风格对齐 .side h3 / .admin-nav-item */
.admin-nav-group { margin-bottom: 10px; }
.admin-nav-group:last-child { margin-bottom: 0; }
.admin-nav-group-title {
    font-size: 11px; color: var(--muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    padding: 6px 8px 4px; margin-top: 4px;
}
.admin-nav-group:first-child .admin-nav-group-title { margin-top: 0; }
.admin-side-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.role-badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #eef2f7; color: var(--muted); }
.role-badge.role_super_admin { background: #eaf1ff; color: var(--primary); }
.role-badge.role_editor { background: #e7f7ee; color: var(--ok); }
.role-badge.role_auditor { background: #fdf3e3; color: var(--warn); }
.admin-side-foot .logout { font-size: 13px; color: var(--muted); text-decoration: none; }
.admin-content { flex: 1; min-width: 0; margin-left: 18px; }
.admin-top { display: none; align-items: center; gap: 12px; margin-bottom: 12px; }
.admin-drawer-toggle { display: none; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 16px; cursor: pointer; }
.admin-crumb { font-size: 15px; font-weight: 700; color: var(--text); }

/* 仪表盘卡片 */
.dash-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dash-card { background: linear-gradient(135deg,#2f6fed,#5b8cff); color: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.dash-card .dc-num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.dash-card .dc-label { font-size: 13px; opacity: .9; margin-top: 6px; }

/* 会员详情 / 分页 / 操作列 */
.member-detail { margin: 12px 0; }
.md-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.md-k { width: 86px; color: var(--muted); flex: none; }
.md-v { font-weight: 600; }
.md-actions { display: flex; gap: 10px; margin: 12px 0; }
.btn-mini.danger { background: #fdeaea; color: #c0392b; }
.btn-mini.btn-danger { background: #c0392b; color: #fff; border: none; }
.btn-mini.btn-danger:hover { background: #a93226; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager .pg { display: inline-block; min-width: 30px; text-align: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; color: var(--muted); text-decoration: none; }
.pager .pg.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.ops a { margin-right: 6px; }
.muted { color: var(--muted); font-size: 13px; }

/* 签到面板 */
.signin-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.signin-info { font-size: 14px; }
.signin-info b { color: var(--primary); font-size: 18px; }
.signin-info .muted { display: block; margin-top: 2px; }

/* 顶栏管理入口 */
.topbar nav a.admin-link { color: var(--primary); font-weight: 700; }

@media (max-width: 720px) {
    .admin-shell { flex-direction: column; }
    .admin-side {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: 230px;
        border-radius: 0; transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto;
    }
    .admin-shell.open .admin-side { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .admin-top { display: flex; }
    .admin-drawer-toggle { display: inline-block; }
    .dash-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   T04 前台视觉与移动端强化
   （仅用现有 CSS 变量，不引入与现有变量冲突的新色值）
   ============================================================ */

/* 全局：长内容/图片不撑破容器，杜绝横向溢出 */
img { max-width: 100%; height: auto; }
.post-title, .desc, .cmt-body, .audit-detail, .lead { overflow-wrap: anywhere; word-break: break-word; }
.wrap, .content, .side, .admin-content, .submit-wrap, .post-detail,
.account-wrap, .demands-wrap, .demand-detail, .member-wrap { min-width: 0; }

/* 顶栏：管理入口做成醒目胶囊；导航点击区域更大 */
.topbar nav a { padding: 6px 4px; }
.topbar nav a.admin-link {
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 999px;
    padding: 6px 14px;
    margin-left: 14px;
}
.topbar nav a.admin-link:hover { background: var(--primary); color: #fff; }

/* 主操作按钮不换行，保持突出 */
.search button, .search .btn-primary,
.post-detail .link-row .btn-primary { white-space: nowrap; }

/* 审计日志表格：横向滚动限制在容器内（不撑破页面） */
.audit-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
.audit-tbl { min-width: 660px; }
.audit-tbl .nowrap { white-space: nowrap; }
.audit-tbl .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.audit-act {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary); font-size: 12px; white-space: nowrap;
}
.audit-detail { max-width: 320px; color: var(--text); }
.audit-filter { flex-wrap: wrap; }
.audit-filter .audit-kw { flex: 1 1 200px; min-width: 0; }
.audit-export { background: #eef0f3; color: var(--muted); }

/* 键盘焦点可见性 */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
    outline: 2px solid rgba(47,111,237,.45); outline-offset: 1px;
}

/* ===================== 移动端（≤720px）强化 ===================== */
@media (max-width: 720px) {
    /* 顶栏导航换行，杜绝横向滚动 */
    .topbar .wrap { flex-wrap: wrap; height: auto; padding: 10px 14px; }
    .topbar nav { flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
    .topbar nav a { margin-left: 0; font-size: 13px; }
    .logo { font-size: 16px; }

    /* 首页搜索框堆叠：输入框占满，按钮均分 */
    .search { flex-wrap: wrap; }
    .search input[type=text] { flex: 1 1 100%; }
    .search button, .search .btn-primary { flex: 1 1 auto; text-align: center; }

    /* 批量复制工具栏换行 */
    .bulk-bar { flex-wrap: wrap; gap: 8px 12px; }

    /* 帖子详情链接行堆叠：标签在上，链接框占满，按钮均分 */
    .post-detail .link-row { flex-wrap: wrap; }
    .post-detail .link-row .label { width: auto; }
    .post-detail .link-row input { flex: 1 1 100%; }
    .post-detail .link-row button,
    .post-detail .link-row .btn-primary { flex: 1 1 auto; text-align: center; }

    /* 发帖页三级分类选择换行堆叠 */
    .cat-selects { flex-wrap: wrap; }
    .cat-selects select { width: 100% !important; }
}

@media (max-width: 480px) {
    .hero { padding: 20px 16px; }
    .hero h1 { font-size: 20px; }
    .post-detail, .submit-wrap { padding: 18px; }
    .dash-card { padding: 14px; }
    .dash-card .dc-num { font-size: 24px; }
}

/* ===================== 积分商城（前台 mall） ===================== */
.mall-wrap h1 { margin-bottom: 12px; }
.mall-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.mall-info-left { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.mall-pts { font-size: 18px; font-weight: 600; color: #f0a020; }
.mall-lv { color: #2f6fed; font-weight: 600; }

.mall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.mall-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.mall-card .mc-name { font-size: 16px; font-weight: 600; }
.mall-card .mc-desc { color: #666; font-size: 13px; line-height: 1.5; }
.mall-card .mc-stock { font-size: 13px; color: #555; }
.mall-card .mc-cost { font-size: 14px; color: #e0533d; font-weight: 600; }
.mall-card form { margin-top: 4px; }
.mall-card .btn-primary { width: 100%; }
.mall-card .btn-primary:disabled {
    background: #c9c9c9;
    cursor: not-allowed;
    opacity: .8;
}

/* ===================== 积分商城：兑换表单（每张商品卡内联 5 字段） ===================== */
.mall-ex-fields { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.mall-ex-fields label { font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.mall-ex-fields input,
.mall-ex-fields textarea {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--card);
}
.mall-ex-fields textarea { min-height: 46px; resize: vertical; }
.req-star { color: #e8533f; margin-left: 2px; font-weight: 700; }
.mall-remark-count { font-size: 11px; color: var(--muted); align-self: flex-end; margin-top: 2px; }
/* 字段级红字错误提示（兑换表单校验失败） */
.field-err {
    display: none;
    color: #c0392b;
    background: #fdeaea;
    border: 1px solid #f4b9b9;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin: 6px 0;
}
/* 后台 / 会员「兑换信息」列展示 */
.mall-ex-info { font-size: 12px; line-height: 1.6; color: var(--text); }
.mall-ex-info div { white-space: nowrap; }

/* ===================== 积分商城（后台 admin_mall） ===================== */
#mallForm { margin-bottom: 12px; }
#mallForm label { margin-top: 8px; }
#mallForm textarea { min-height: 60px; }

@media (max-width: 720px) {
    .mall-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ============================================================
   T-B 响应式导航与学段入口：基础样式（桌面端隐藏，移动端于媒体查询内显示）
   ============================================================ */

/* 学段入口：桌面端隐藏规则已上移至文件靠前位置（见「移动端基础隐藏」区块），
   以确保 ≤720px 媒体查询内的 .stage-entry { display:block } 能正确覆盖。 */

/* 学段大卡（小学 / 初中 / 高中） */
.stage-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.stage-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    background: none; border: none; cursor: pointer; padding: 4px 0;
    font-size: 16px; font-weight: 700; color: var(--text); font-family: inherit;
}
.stage-caret { color: var(--muted); transition: transform .2s ease; font-size: 13px; }
.stage-card.open .stage-caret { transform: rotate(180deg); }
.stage-subs { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.subj-block { display: flex; flex-direction: column; gap: 6px; }

/* chips：学科 / 年级标签，均链接 ?cat= */
.chip {
    display: inline-block; align-self: flex-start;
    background: var(--primary-soft); color: var(--primary);
    font-size: 13px; padding: 6px 12px; border-radius: 999px; text-decoration: none;
    border: 1px solid transparent; transition: background .15s, color .15s;
}
.chip:hover { background: #e0ebff; color: var(--primary-dark); }
.chip-subj { font-weight: 600; }
.grade-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.chip-grade { background: #f3f5f9; color: var(--muted); }
.chip-grade:hover { background: #e9edf3; color: var(--text); }

/* 底部导航：桌面端隐藏规则已上移至文件靠前位置（见「移动端基础隐藏」区块），
   以确保 ≤720px 媒体查询内的 .bottom-nav { display:flex } 能正确覆盖。 */

/* ============================================================
   T-C 会员中心批量复制增强：来源筛选 Tab + 来源标签
   ============================================================ */
.batch-filter { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.bf-tab {
    padding: 6px 14px; border: 1px solid var(--line); background: var(--card);
    border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer;
    transition: all .15s; font-family: inherit;
}
.bf-tab:hover { border-color: var(--primary); color: var(--primary); }
.bf-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* 来源标签：自己 / 受邀请人 */
.src-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.src-self { background: var(--primary-soft); color: var(--primary); }
.src-invitee { background: #f3f0ff; color: #7c3aed; }

/* ============================================================
   T-D 积分商城：商品图（缩略图 / 详情 / 后台预览）
   ============================================================ */
/* 前台商品卡：链接卡片，去掉默认下划线 */
.mall-card { text-decoration: none; color: inherit; }
.mc-thumb {
    width: 100%; height: 140px; object-fit: cover;
    border-radius: var(--radius-sm); background: #f1f4f9; display: block; margin-bottom: 10px;
}
.mc-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; color: var(--muted); background: #f1f4f9;
}
.mc-btn { margin-top: 4px; display: inline-block; align-self: flex-start; color: var(--primary); font-size: 13px; font-weight: 600; }

/* 商品详情 */
.mall-detail .back { display: inline-block; margin-bottom: 12px; }
.mall-detail-body { display: flex; gap: 22px; flex-wrap: wrap; }
.mall-detail-img {
    width: 240px; height: 240px; object-fit: cover;
    border-radius: var(--radius); background: #f1f4f9; flex: none;
}
.mall-detail-img-empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 64px; color: var(--muted); background: #f1f4f9;
}
.mall-detail-info { flex: 1; min-width: 240px; }
.mall-detail-info .mc-name { font-size: 22px; margin-bottom: 8px; }
.mall-detail-info .mc-desc { color: #555; line-height: 1.6; margin-bottom: 12px; }
.mall-detail-info .mall-ex-form { margin-top: 16px; }

/* 后台：图片预览 / 列表缩略图（复用 .mall-thumb，缩小尺寸） */
.mall-img-preview { margin: 8px 0; }
.mall-img-preview .mall-thumb { width: 120px; height: 120px; margin-bottom: 0; }
.tbl .mall-thumb { width: 56px; height: 56px; border-radius: 8px; margin-bottom: 0; }

/* ============================================================
   T-E 需求板移动接入与打磨
   ============================================================ */
/* 需求大厅关键词搜索 */
.demand-search { margin-bottom: 14px; }
.demand-search input[type=text] { flex: 1; min-width: 0; }

/* 置顶徽标 */
.badge.top { background: #fff3e0; color: #e6a23c; }
.demand-card.is-top { border-color: #f0c36d; box-shadow: 0 0 0 1px rgba(230,162,60,.25), var(--shadow-sm); }

/* 移动端发布需求浮动按钮（桌面隐藏，避开底部固定导航） */
.fab {
    display: none; position: fixed; right: 18px; bottom: 78px; z-index: 41;
    width: 52px; height: 52px; border-radius: 50%; border: none;
    background: var(--primary); color: #fff; font-size: 26px; line-height: 1;
    box-shadow: var(--shadow-lg); cursor: pointer;
}
@media (max-width: 720px) {
    .fab { display: flex; align-items: center; justify-content: center; }
    .demand-actions { flex-direction: column; align-items: stretch; }
    .demand-actions .btn-primary,
    .demand-actions .btn-solve,
    .demand-actions .btn-reopen { width: 100%; text-align: center; margin-top: 8px; }
}

/* ============================================================
   T-F 合规页与注册同意
   ============================================================ */
.doc-wrap { max-width: 800px; margin: 0 auto; }
.doc-wrap h1 { font-size: 22px; margin-bottom: 14px; }
.doc-body {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 24px; box-shadow: var(--shadow-sm);
    line-height: 1.8; color: #2a3340; white-space: normal;
}
.account-wrap .agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); margin: 4px 0 10px; }
.account-wrap .agree-row a { color: var(--primary); }
.doc-textarea { min-height: 140px; line-height: 1.6; }

/* ============================================================
   T-G 关键流程动画：列表淡入 / 卡片弹入 / 复制擦亮 / 轻提示
   全部包裹在 prefers-reduced-motion: no-preference，尊重系统减弱动效设置
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: none; }
    }
    @keyframes toastIn {
        from { opacity: 0; transform: translateY(12px) scale(.96); }
        to   { opacity: 1; transform: none; }
    }
    @keyframes popIn {
        from { opacity: 0; transform: scale(.92); }
        to   { opacity: 1; transform: scale(1); }
    }
    @keyframes bumpFlash {
        0%   { box-shadow: 0 0 0 0 rgba(47,111,237,.45); }
        100% { box-shadow: 0 0 0 10px rgba(47,111,237,0); }
    }

    /* 列表 / 卡片载入淡入（首页帖子、需求卡、商品卡） */
    .post-list li,
    .demand-list .demand-card,
    .mall-card { animation: fadeIn .35s ease both; }
    .post-list li:nth-child(2) { animation-delay: .04s; }
    .post-list li:nth-child(3) { animation-delay: .08s; }
    .post-list li:nth-child(4) { animation-delay: .12s; }
    .post-list li:nth-child(5) { animation-delay: .16s; }
    .post-list li:nth-child(n+6) { animation-delay: .20s; }

    /* 会员中心面板载入淡入 */
    .member-wrap .panel { animation: fadeIn .35s ease both; }
    .member-wrap .panel:nth-child(2) { animation-delay: .05s; }
    .member-wrap .panel:nth-child(3) { animation-delay: .10s; }
    .member-wrap .panel:nth-child(4) { animation-delay: .15s; }
    .member-wrap .panel:nth-child(n+5) { animation-delay: .20s; }

    /* 登录 / 注册卡片弹入 */
    .account-wrap { animation: popIn .3s ease both; }

    /* 复制后擦亮高亮（会员中心批量复制） */
    .post-list li.bump-flash { animation: bumpFlash .6s ease-out; }

    /* 会员中心折叠面板 caret 旋转过渡 */
    .panel.collapsible > summary.panel-h .caret { transition: transform .2s ease; }
}

/* 全局轻提示（toast）：固定底部居中，层级高于底部导航 */
#toast {
    position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
    z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none; width: max-content; max-width: 86vw;
}
.toast {
    background: rgba(31,39,59,.92); color: #fff; font-size: 13px;
    padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: no-preference) {
    .toast { animation: toastIn .25s ease both; }
}

/* ============ 复制热度 🔥 与「已复制」红态（T03 / T06 / T07 / T08） ============ */
/* 分享者行热度值（🔥） */
.post-sub .hot {
    color: var(--warn);
    font-weight: 600;
}
/* 「已复制」红态：红底 / 红边框 / 红字（详情页复制按钮、首页卡片均可复用） */
.copied-before {
    background: #fdeaea !important;
    border-color: #f4b9b9 !important;
    color: #dc2626;
}
/* 详情页复制按钮红态时文字保持红 */
.btn-copy.copied-before {
    color: #dc2626;
    border-color: #f4b9b9 !important;
    background: #fdeaea !important;
}
/* 单个资源「你已于 {时间} 复制过此资源」提示 */
.copied-note {
    display: none;
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
}
/* 首页卡片整体标红 + 提示换行显示 */
.post-list li.copied-before {
    background: #fdeaea !important;
    border-color: #f4b9b9 !important;
}
.post-list li.copied-before .copied-note {
    display: block;
}

/* ============================================================
   SVIP 后台管理增强（R2 卡片 / R3 生成列表 / R5 可点击复制）
   风格对齐现有 .panel / .data-table / .btn-primary / .btn-mini
   ============================================================ */
/* R2 · 套餐卡片网格 */
.svip-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.svip-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.svip-card:hover {
    box-shadow: 0 4px 14px rgba(16, 24, 40, .10);
    transform: translateY(-2px);
}
.svip-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
/* 彩色徽章药丸（彩色背景由内联 style 提供） */
.svip-card .svip-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    white-space: nowrap;
}
.svip-card .svip-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.svip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}
.svip-meta .svip-dur {
    color: var(--primary);
    font-weight: 600;
}
.svip-desc {
    font-size: 13px;
    color: var(--text);
    margin: 0;
    line-height: 1.5;
    flex: 1;
}
.svip-privs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.svip-privs .priv {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}
.svip-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #e9edf3;
    color: var(--muted);
}
.status-pill.on {
    background: #e7f7ee;
    color: #147a3a;
}
.svip-ops a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 10px;
    font-size: 13px;
}
.svip-ops a:hover {
    text-decoration: underline;
}

/* T09 · 套餐列表工具栏 + 就地展开的表单盒 */
.svip-plans-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.svip-plans-hint {
    font-size: 13px;
    color: var(--muted);
}
/* 新增 / 编辑表单：默认隐藏，置于卡片网格下方，作为独立区块就地展开 */
#planFormBox {
    margin-top: 18px;
    padding: 18px 20px;
    background: #fafbfe;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
#planFormBox > h3 {
    margin-top: 0;
}
#planFormBox .btn-mini {
    margin-left: 8px;
}

/* R3 · 生成后的本批次激活码列表 */
.svip-gen-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.svip-code-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.bulk-copy-row {
    margin: 10px 0 6px;
}

/* R5 · 可点击复制（激活码单元格 / 生成列表均可复用） */
.copy-code {
    cursor: pointer;
    user-select: all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text);
    transition: background .15s ease, border-color .15s ease;
}
.copy-code:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}
.copy-code code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: transparent;
    color: inherit;
}

/* ============================================================
   独立手机端模式（mobile_mode=1 且移动端 UA）
   作用域严格限定在 body.mobile-mode（layout.php 在移动端模式时为 <body> 添加此类）。
   桌面端页面无此类，以下规则一律不生效，确保零影响：
   - 顶栏（含顶部商城链接）隐藏
   - 首访身份选择弹窗 / 学段选择器模态
   - 首页游客 sticky 切换学段条
   - 游客「我的」面板 / 会员「我的」积分商城区块
   ============================================================ */
body.mobile-mode { padding-bottom: 62px; }
/* 顶栏隐藏（顶栏内积分商城链接随之隐藏，满足「商城移入『我的』」） */
body.mobile-mode .topbar { display: none; }

/* 首访身份选择弹窗 */
body.mobile-mode .entry-modal {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(16,24,40,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
body.mobile-mode .entry-card {
    background: #fff; border-radius: 18px; padding: 28px 22px; width: 100%; max-width: 320px;
    text-align: center; box-shadow: 0 12px 40px rgba(16,24,40,.25);
}
body.mobile-mode .entry-title { font-size: 19px; margin: 0 0 6px; color: var(--text); }
body.mobile-mode .entry-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
body.mobile-mode .entry-btn {
    display: block; width: 100%; border: none; border-radius: 12px; padding: 14px;
    font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 12px;
}
body.mobile-mode .entry-btn.guest { background: var(--primary); color: #fff; }
body.mobile-mode .entry-btn.member { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
body.mobile-mode .entry-btn:active { opacity: .88; }

/* 学段选择器模态框（从底部弹出，层级高于首访弹窗） */
body.mobile-mode .stage-picker-modal {
    position: fixed; inset: 0; z-index: 101;
    background: rgba(16,24,40,.55);
    display: flex; align-items: flex-end; justify-content: center;
}
body.mobile-mode .stage-picker-card {
    background: #fff; width: 100%; max-width: 560px;
    border-radius: 18px 18px 0 0; max-height: 82vh; overflow-y: auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
body.mobile-mode .sp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
body.mobile-mode .sp-title { font-size: 16px; font-weight: 700; color: var(--text); }
body.mobile-mode .sp-close {
    border: none; background: var(--primary-soft); color: var(--primary);
    width: 30px; height: 30px; border-radius: 50%; font-size: 15px; cursor: pointer;
}
/* 选择器内复用 .stage-entry：强制显示（覆盖桌面端 .stage-entry{display:none}） */
body.mobile-mode .guest-stage-picker .stage-entry { display: block; margin: 0; }
body.mobile-mode .guest-stage-picker .stage-card {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 12px;
}

/* 首页游客 sticky 切换学段条 */
body.mobile-mode .stage-switch-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 10px 14px; margin: 0 0 14px; box-shadow: var(--shadow-sm);
}
body.mobile-mode .ssb-info { font-size: 13px; color: var(--muted); }
body.mobile-mode .ssb-info b { color: var(--text); }
body.mobile-mode .ssb-sep { margin: 0 4px; color: var(--line); }
body.mobile-mode .ssb-btn {
    border: none; background: var(--primary); color: #fff; border-radius: 999px;
    padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* 游客「我的」面板 */
body.mobile-mode .guest-panel { max-width: 780px; margin: 0 auto; }
body.mobile-mode .guest-panel h1 { font-size: 20px; margin: 4px 0 14px; }
body.mobile-mode .g-account-bd { display: flex; flex-wrap: wrap; gap: 10px; }
body.mobile-mode .g-link {
    display: inline-block; padding: 10px 18px; border-radius: 10px;
    background: var(--primary); color: #fff; text-decoration: none; font-weight: 600;
}
body.mobile-mode .g-link-ghost { background: var(--primary-soft); color: var(--primary); }
body.mobile-mode .g-stage-info { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; font-size: 14px; }
body.mobile-mode .g-mall-link {
    display: inline-block; padding: 12px 16px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary); text-decoration: none; font-weight: 700;
}

/* 会员「我的」积分商城区块（仅移动端显示） */
body.mobile-mode .mall-block-link {
    display: inline-block; padding: 12px 16px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary); text-decoration: none; font-weight: 700;
}

/* ============================================================
   T06 强制登录首页浮动弹层（游客 + 开启强制登录 + 桌面端）
   固定遮罩 + 居中卡片；关闭时写 Cookie 24h 不重复弹（JS 见 layout.php）
   ============================================================ */
.force-login-pop {
    position: fixed; inset: 0; z-index: 80;
    display: flex; align-items: center; justify-content: center;
    background: rgba(16,24,40,.55);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    padding: 24px;
}
.force-login-card {
    position: relative; width: 100%; max-width: 340px;
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 26px 24px;
    text-align: center;
}
.force-login-card h3 { font-size: 17px; color: var(--text); margin: 0 0 10px; }
.force-login-card p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.force-login-card .btn-primary {
    display: block; width: 100%; text-align: center; margin-bottom: 10px;
}
.force-login-card .btn-mini {
    display: block; width: 100%; text-align: center;
    background: #eef0f3; color: var(--muted);
}
.force-login-close {
    position: absolute; top: 10px; right: 12px;
    width: 28px; height: 28px; line-height: 1; border: none;
    background: #f2f4f8; color: var(--muted); border-radius: 50%;
    font-size: 14px; cursor: pointer;
}
.force-login-close:hover { background: #fde8e8; color: #d33; }
