/* ==========================================================================
   EduZiliao · Design System v2
   设计基准：8pt 网格 / 单一主色 + 完整色阶 / 三档圆角 / 四档阴影 / 统一动效
   参考：Ant Design 4、TDesign、Stripe 的信息层级与留白节奏
   --------------------------------------------------------------------------
   所有旧类名（.panel .card-res .pkg-card .file-table .ro-xxx 等）继续可用，
   但它们的圆角 / 阴影 / 间距 / 配色已全部改为引用下面的令牌，
   目的是消除「这里一个样、那里一个样」的问题。
   ========================================================================== */
:root {
  /* ---- 主色：单一品牌蓝 + 完整色阶 ---- */
  --brand-50:  #eff4ff;
  --brand-100: #dbe7fe;
  --brand-200: #bed3fd;
  --brand-300: #96b4fa;
  --brand-400: #6b8ff6;
  --brand-500: #3370ff;   /* 主色 */
  --brand-600: #2450d8;
  --brand-700: #1c3fae;

  /* ---- 中性色阶 ---- */
  --gray-0:   #ffffff;
  --gray-25:  #fcfcfd;
  --gray-50:  #f8f9fc;
  --gray-75:  #f4f6f9;
  --gray-100: #eef1f6;
  --gray-200: #e4e8ef;
  --gray-300: #d3d9e4;
  --gray-400: #aeb7c6;
  --gray-500: #7d8799;
  --gray-600: #5a6478;
  --gray-700: #3f4859;
  --gray-800: #2a3243;
  --gray-900: #171d2b;

  /* ---- 语义色（含配套底色 / 描边，避免各写一组 hex） ---- */
  --ok:        #0fae6a;  --ok-bg: #e8fbf2;  --ok-bd: #a7f0cd;
  --warn:      #e8910c;  --warn-bg:#fff8ec; --warn-bd:#fce0a3;
  --err:       #e8462f;  --err-bg: #fef3f1; --err-bd:#fbd3c9;
  --gold:      #d99e0b;  --gold-bg:#fffbeb; --gold-bd:#fce0a3;

  /* ---- 圆角：只用这四档 ---- */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  /* ---- 阴影：只用这四档 ---- */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-md: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --sh-lg: 0 12px 18px -4px rgba(16, 24, 40, .10), 0 4px 6px -2px rgba(16, 24, 40, .04);
  --sh-xl: 0 24px 32px -8px rgba(16, 24, 40, .16), 0 8px 12px -6px rgba(16, 24, 40, .06);

  /* 彩色强调阴影（焦点环 / 品牌按钮辉光 / 浮动控件），同样是令牌化的 */
  --sh-ring:       var(--sh-ring);
  --sh-ring-lg:    0 0 0 4px rgba(51, 112, 255, .12);
  --sh-select:     var(--sh-select);
  --sh-brand-btn:  var(--sh-brand-btn);
  --sh-brand-hov:  var(--sh-brand-hov);
  --sh-mark:       var(--sh-mark);
  --sh-pill:       var(--sh-pill);
  --sh-ok-btn:     var(--sh-ok-btn);
  --sh-err-btn:    var(--sh-err-btn);
  --sh-float-up:   var(--sh-float-up);
  --sh-gold-inset: var(--sh-gold-inset);

  /* ---- 间距：4pt 网格 ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* ---- 字号阶梯 ---- */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px;
  --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 20px; --fs-3xl: 24px;
  --fs-4xl: 30px; --fs-5xl: 38px;

  /* ---- 动效 ---- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-fast: .12s var(--ease);
  --t: .18s var(--ease);
  --t-slow: .28s var(--ease);

  /* ---- 结构常量 ---- */
  --nav-h: 64px;
  --container: 1240px;

  /* ================= 旧变量名兼容层（视图内联 style 仍在引用） ================= */
  --primary:        var(--brand-500);
  --primary-dark:   var(--brand-600);
  --success:        var(--ok);
  --warning:        var(--warn);
  --danger:         var(--err);
  --info:           var(--gray-500);
  --text:           var(--gray-900);
  --text-regular:   var(--gray-700);
  --text-secondary: var(--gray-500);
  --border:         var(--gray-300);
  --border-light:   var(--gray-200);
  --border-lighter: var(--gray-200);
  --bg:             var(--gray-50);
  --white:          #ffffff;
  --radius:         var(--r-lg);
  --shadow:         var(--sh-md);
  --shadow-card:    var(--sh-sm);
}

/* ============================ 基础重置 ============================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--gray-900); letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(51, 112, 255, .16); }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: var(--r-sm); }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--r-full); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--gray-400); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ 布局工具 ============================ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 12px; }
.between { justify-content: space-between; align-items: center; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}
.muted { color: var(--gray-500); }
.small { font-size: var(--fs-xs); }
.center { text-align: center; }
.hide { display: none !important; }

/* ============================ 顶部导航 ============================ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--gray-200);
}
.navbar .container { display: flex; align-items: center; gap: 28px; height: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--gray-900); letter-spacing: -.01em; flex: 0 0 auto; }
.logo-mark {
  width: 32px; height: 32px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-400) 100%);
  color: #fff; display: grid; place-items: center; font-size: 16px;
  box-shadow: var(--sh-mark);
}
.nav-links { display: flex; gap: 4px; flex: 1 1 auto; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: var(--r-full);
  font-size: var(--fs-base); font-weight: 500; color: var(--gray-600);
  transition: color var(--t), background var(--t);
}
.nav-links a:hover { color: var(--brand-600); background: var(--brand-50); }
.nav-links a.active { color: var(--brand-600); background: var(--brand-50); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ============================ 首页 Hero ============================ */
.search-hero {
  position: relative; overflow: hidden;
  padding: 60px 0 40px;
  background: radial-gradient(1100px 380px at 50% -12%, #e8efff 0%, rgba(232, 239, 255, 0) 62%),
              linear-gradient(180deg, #f7f9ff 0%, var(--gray-50) 100%);
  border-bottom: 1px solid var(--gray-200);
}
/* 极淡网格纹理（大厂常见的「布景层」） */
.search-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(51, 112, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 112, 255, .055) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 18%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 18%, #000 0%, transparent 72%);
}
.search-hero > .container { position: relative; z-index: 1; }
.search-title {
  font-size: var(--fs-5xl); font-weight: 700; text-align: center;
  margin: 0 0 10px; letter-spacing: -.02em; color: var(--gray-900);
}
.search-sub { text-align: center; color: var(--gray-500); margin-bottom: 26px; font-size: var(--fs-md); }

.search-box {
  max-width: 640px; margin: 0 auto; display: flex; align-items: center;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-full);
  padding: 6px 6px 6px 20px; box-shadow: var(--sh-md);
  transition: box-shadow var(--t), border-color var(--t);
}
.search-box:focus-within { border-color: var(--brand-400); box-shadow: var(--sh-ring-lg), var(--sh-md); }
.search-box input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; padding: 0; height: 42px; font-size: var(--fs-md); background: transparent; }
.search-box input::placeholder { color: var(--gray-400); }
.search-box button {
  flex: 0 0 auto; border: 0; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  color: #fff; height: 42px; padding: 0 28px; font-size: var(--fs-md); font-weight: 600;
  cursor: pointer; box-shadow: var(--sh-mark);
  transition: transform var(--t), box-shadow var(--t);
}
.search-box button:hover { transform: translateY(-1px); box-shadow: var(--sh-brand-hov); }
.search-box button:active { transform: translateY(0); }

.hot-words { max-width: 640px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; font-size: var(--fs-sm); color: var(--gray-500); }
.hot-words a {
  padding: 5px 12px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--r-full); color: var(--gray-600); font-size: var(--fs-sm);
  transition: color var(--t), border-color var(--t), background var(--t), transform var(--t);
}
.hot-words a:hover { color: var(--brand-600); border-color: var(--brand-300); background: var(--brand-50); transform: translateY(-1px); }

/* 数据统计条 */
.hero-stats {
  max-width: 720px; margin: 24px auto 0;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-full);
  box-shadow: var(--sh-xs); padding: 10px 8px; font-size: var(--fs-sm);
}
.hero-stats > span { padding: 0 20px; color: var(--gray-600); }
.hero-stats > span + span { border-left: 1px solid var(--gray-200); }
.hero-stats b { color: var(--gray-900); font-weight: 600; font-size: var(--fs-md); }

/* ============================ 区块标题 ============================ */
.section { margin-top: var(--sp-8); }
.section-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--gray-200);
}
.section-title { position: relative; padding-left: 12px; font-size: var(--fs-2xl); font-weight: 600; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 16px; border-radius: var(--r-full);
  background: linear-gradient(180deg, var(--brand-500), var(--brand-300));
}
.section-more { margin-left: auto; font-size: var(--fs-sm); color: var(--gray-500); transition: color var(--t); }
.section-more:hover { color: var(--brand-600); }
.side-title { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 12px; }

.quick-entry { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-entry a {
  padding: 6px 14px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--r-full); font-size: var(--fs-sm); color: var(--gray-600);
  transition: all var(--t);
}
.quick-entry a:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.quick-entry a.on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }

/* ============================ 卡片基座（全站统一） ============================ */
.panel, .card-res, .pkg-card, .stat-item, .admin-card, .ro-card,
.box-center, .file-drop, .qr-box, .delivery-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.panel, .admin-card, .ro-card { padding: var(--sp-5); }
.box-center { padding: var(--sp-8); }

/* 强调面板：全站只有这两种「有色面板」，不再各自写 hex */
.panel-accent { background: linear-gradient(180deg, var(--warn-bg) 0%, #fffdf7 100%); border-color: var(--warn-bd); }
.panel-brand  { background: linear-gradient(180deg, var(--brand-50) 0%, #fbfcff 100%); border-color: var(--brand-100); }

/* 底部抽屉（资料详情的「获取资料」面板） */
.sheet-up {
  position: fixed; inset: auto 0 0 0; z-index: 1200;
  max-width: 520px; margin: 0 auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-bottom: 0; box-shadow: var(--sh-xl);
  animation: sheet-up .24s var(--ease);
}
.sheet-title { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-900); }
@keyframes sheet-up { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }

/* 侧栏「相关资料」行 */
.rel-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--gray-200); }
.rel-row:last-child { border-bottom: 0; }
.rel-row:hover .rel-title { color: var(--brand-600); }
.rel-cover { width: 48px; height: 62px; flex: 0 0 auto; object-fit: cover; border-radius: var(--r-sm); background: var(--gray-75); }
.rel-main { flex: 1 1 auto; min-width: 0; }
.rel-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); line-height: 1.45; color: var(--gray-800); transition: color var(--t); }
.rel-meta { display: block; font-size: var(--fs-xs); color: var(--gray-400); margin-top: 2px; }

/* 资源卡片 */
.grid-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-4); }
.grid-cards.g4 { grid-template-columns: repeat(4, 1fr); }
.grid-cards.g3 { grid-template-columns: repeat(3, 1fr); }
.card-res {
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card-res:hover { box-shadow: var(--sh-lg); transform: translateY(-4px); border-color: var(--brand-200); }
.card-cover { position: relative; width: 100%; padding-top: 132%; background: var(--gray-75); overflow: hidden; }
.card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 500; color: #fff; line-height: 16px;
  background: rgba(51, 112, 255, .94); backdrop-filter: blur(4px);
}
.card-badge.free { background: rgba(15, 174, 106, .95); }
.card-badge.paid { background: rgba(232, 145, 12, .95); }
.card-pages { position: absolute; right: 8px; bottom: 8px; background: rgba(23, 29, 43, .62); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: var(--r-full); line-height: 16px; backdrop-filter: blur(4px); }
.card-body { padding: 12px 14px 14px; flex: 1 1 auto; display: flex; flex-direction: column; }
.card-title { font-size: var(--fs-base); font-weight: 500; line-height: 1.45; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--gray-900); }
.card-meta { margin-top: 6px; font-size: var(--fs-xs); color: var(--gray-500); }
.card-stats { margin-top: 8px; display: flex; gap: 10px; font-size: var(--fs-xs); color: var(--gray-500); }
.card-foot { margin-top: 10px; }

/* ============================ 按钮（全站一套度量） ============================ */
.btn, .ro-btn, .ft-btn, .st-btn, .cb-all, .cb-pay,
.btn-dl, .btn-buy, .btn-pv, .btn-share, .btn-fav {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--gray-300); border-radius: var(--r-md);
  background: #fff; color: var(--gray-700);
  font-size: var(--fs-base); font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t), transform var(--t);
  user-select: none;
}
.btn:hover, .ro-btn:hover, .ft-btn:hover, .st-btn:hover { color: var(--brand-600); border-color: var(--brand-400); background: var(--brand-50); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { color: var(--gray-700); border-color: var(--gray-300); background: #fff; }

.btn-primary { background: var(--brand-500); border-color: var(--brand-500); color: #fff; box-shadow: var(--sh-xs); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: var(--sh-brand-btn); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #0d955b; border-color: #0d955b; color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: #d13c27; border-color: #d13c27; color: #fff; }
.btn-warning { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-warning:hover { background: #d07f0a; border-color: #d07f0a; color: #fff; }
.btn-plain { border-color: transparent; background: transparent; }
.btn-plain:hover { background: var(--gray-100); border-color: transparent; color: var(--brand-600); }

.btn-sm, .btn-dl, .btn-buy, .btn-pv, .btn-share, .btn-fav { height: 30px; padding: 0 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { height: 44px; padding: 0 28px; font-size: var(--fs-lg); border-radius: var(--r-md); }
.btn-block { width: 100%; }

/* 语义按钮：只改配色，度量全部继承 */
.btn-dl { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 500; }
.btn-dl:hover:not(:disabled):not([disabled]) { background: #0d955b; border-color: #0d955b; color: #fff; }
.btn-buy { background: var(--err); border-color: var(--err); color: #fff; font-weight: 500; }
.btn-buy:hover:not(:disabled):not([disabled]) { background: #d13c27; border-color: #d13c27; color: #fff; }
.btn-pv { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-600); }
.btn-pv:hover:not(:disabled):not([disabled]) { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.btn-pv:disabled, .btn-pv[disabled] { background: var(--gray-100); border-color: var(--gray-200); color: var(--gray-400); cursor: not-allowed; }
.btn-share { background: #fff; border-color: var(--gray-300); color: var(--gray-600); }
.btn-share:hover:not(:disabled):not([disabled]) { border-color: var(--brand-400); color: var(--brand-600); background: var(--brand-50); }
/* 收藏：金色强调，全站唯一写法 */
.btn-fav { background: var(--gold-bg); border-color: var(--gold-bd); color: #9a6d0b; font-weight: 500; }
.btn-fav:hover:not(:disabled):not([disabled]) { background: #fdf3d4; border-color: var(--gold); color: #9a6d0b; }
.btn-fav.on { background: var(--gold-bg); border-color: var(--gold); color: #8a5d05; font-weight: 600; box-shadow: var(--sh-gold-inset); }
.btn-dl:disabled, .btn-buy:disabled, .btn-dl[disabled], .btn-buy[disabled] { opacity: .55; cursor: not-allowed; }

/* 分段控件（列表/卡片切换、首页 tab） */
.file-toggle, .show-toggle {
  display: inline-flex; background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: var(--r-md); padding: 3px; gap: 2px;
}
.ft-btn, .st-btn { height: 30px; padding: 0 14px; border: 0; background: transparent; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--gray-600); }
.ft-btn:hover, .st-btn:hover { color: var(--brand-600); background: rgba(255, 255, 255, .7); }
.ft-btn.active, .st-btn.active { background: #fff; color: var(--brand-600); font-weight: 600; box-shadow: var(--sh-xs); }

/* ============================ 表单 ============================ */
.form-item { margin-bottom: var(--sp-4); }
.form-item > label { display: block; font-size: var(--fs-sm); color: var(--gray-600); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 0 12px; height: 38px;
  border: 1px solid var(--gray-300); border-radius: var(--r-md);
  font-size: var(--fs-base); color: var(--gray-900); background: #fff; outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder { color: var(--gray-400); }
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--brand-500); box-shadow: var(--sh-ring);
}
.input[disabled], .input:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
select.input {
  padding-right: 32px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d8799' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.form-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--sp-3); }
.hint { font-size: var(--fs-xs); color: var(--gray-500); margin-top: var(--sp-1); line-height: 1.6; }

/* 筛选下拉（宽度自适应） */
select.input.ff-sel { width: auto; min-width: 106px; height: 32px; padding: 0 30px 0 11px; font-size: var(--fs-sm); }

/* ============================ 表格（前台 + 后台统一） ============================ */
.table, .file-table, .cat-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td, .file-table th, .file-table td, .cat-table th, .cat-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--gray-200);
  text-align: left; vertical-align: middle;
}
.table th, .file-table th, .cat-table th {
  background: var(--gray-50); color: var(--gray-600);
  font-weight: 500; white-space: nowrap; font-size: var(--fs-xs);
  letter-spacing: .02em;
}
.table th:first-child, .file-table th:first-child { border-top-left-radius: var(--r-md); }
.table th:last-child, .file-table th:last-child { border-top-right-radius: var(--r-md); }
.table tr:hover td, .file-table tr:hover td, .cat-table tr:hover td { background: var(--gray-25); }
.table tr:last-child td, .file-table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ============================ 面包屑 / 标签 / 分页 ============================ */
.breadcrumb { font-size: var(--fs-sm); color: var(--gray-500); margin: var(--sp-4) 0 var(--sp-3); }
.breadcrumb a:hover { color: var(--brand-600); }
.fg-crumb { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--gray-500); margin-bottom: var(--sp-3); }
.fg-crumb a:hover { color: var(--brand-600); }
.fg-crumb .fg-sep { color: var(--gray-300); }
.fg-crumb .fg-cur { color: var(--gray-700); font-weight: 500; }

.tag, .card-badge, .ct-hot {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 500; line-height: 1;
  background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100);
}
.tag.sm { height: 20px; padding: 0 8px; font-size: 11px; }
.tag.gray { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }
.tag.green { background: var(--ok-bg); color: #0a8a53; border-color: var(--ok-bd); }
.tag.orange { background: var(--warn-bg); color: #b3700a; border-color: var(--warn-bd); }
.tag.red { background: var(--err-bg); color: #c93a25; border-color: var(--err-bd); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-3); }

.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: var(--sp-6) 0; justify-content: center; }
.pager .pg {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; min-width: 32px; padding: 0 11px;
  border: 1px solid var(--gray-300); background: #fff; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--gray-600);
  transition: all var(--t);
}
.pager .pg:hover { color: var(--brand-600); border-color: var(--brand-400); background: var(--brand-50); }
.pager .pg.is-active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); box-shadow: var(--sh-pill); }
.pager .pg.is-disabled { opacity: .45; pointer-events: none; }
.pager .pg.total { border: 0; background: transparent; color: var(--gray-500); }

/* ============================ 提示类 ============================ */
.alert { display: flex; gap: 8px; padding: 11px 14px; border-radius: var(--r-md); font-size: var(--fs-sm); margin-bottom: var(--sp-3); border: 1px solid transparent; line-height: 1.6; }
.alert.success { background: var(--ok-bg); color: #0a8a53; border-color: var(--ok-bd); }
.alert.error   { background: var(--err-bg); color: #c93a25; border-color: var(--err-bd); }
.alert.info    { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }
/* 支付成功大勾：尺寸与配色统一 */
.ok-mark { font-size: 52px; line-height: 1; color: var(--ok); }

.empty {
  text-align: center; padding: 56px 20px; color: var(--gray-400); font-size: var(--fs-base);
  background: var(--gray-25); border: 1px dashed var(--gray-200); border-radius: var(--r-lg);
}
.toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(23, 29, 43, .93); color: #fff; padding: 10px 18px;
  border-radius: var(--r-md); font-size: var(--fs-base); box-shadow: var(--sh-lg);
  backdrop-filter: blur(8px); animation: toast-in .22s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ============================ 详情 ============================ */
.detail-wrap { display: grid; grid-template-columns: 1fr 340px; gap: var(--sp-6); align-items: start; }
.detail-wrap.has-catalog { grid-template-columns: 176px 1fr 340px; }
.detail-title { font-size: var(--fs-3xl); font-weight: 600; margin: 0 0 12px; letter-spacing: -.015em; }
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.preview-grid .pv { border: 1px solid var(--gray-200); border-radius: var(--r-md); overflow: hidden; background: var(--gray-75); }
.preview-grid .pv img { width: 100%; cursor: zoom-in; }

.preview-catalog {
  position: sticky; top: 78px; align-self: start;
  padding: var(--sp-3); max-height: calc(100vh - 108px);
  display: flex; flex-direction: column;
}
.pc-head { font-size: var(--fs-base); font-weight: 600; padding: 0 4px 10px; border-bottom: 1px solid var(--gray-200); margin-bottom: var(--sp-2); }
.pc-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 2px; }
.pc-item { position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--r-md); overflow: hidden; background: var(--gray-75); cursor: pointer; line-height: 0; transition: border-color var(--t-fast); }
.pc-item img { width: 100%; display: block; aspect-ratio: 900 / 1273; object-fit: cover; }
.pc-item .pc-no { position: absolute; left: 5px; bottom: 5px; background: rgba(23, 29, 43, .62); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: var(--r-full); line-height: 16px; }
.pc-item:hover { border-color: var(--brand-300); }
.pc-item.active { border-color: var(--brand-500); box-shadow: var(--sh-select); }
.preview-more { margin-top: var(--sp-3); text-align: center; }
.action-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.price-tag { font-size: var(--fs-4xl); color: var(--err); font-weight: 700; letter-spacing: -.02em; }
.price-old { color: var(--gray-400); text-decoration: line-through; font-size: var(--fs-base); margin-left: 6px; }
.pkg-card-static { border: 1px solid var(--warn-bd); background: var(--warn-bg); border-radius: var(--r-lg); padding: var(--sp-4); }
.list-check li { margin: 4px 0; font-size: var(--fs-sm); color: var(--gray-600); }
.info-line { display: flex; font-size: var(--fs-sm); padding: 9px 0; border-bottom: 1px dashed var(--gray-200); gap: var(--sp-3); }
.info-line span:first-child { width: 92px; color: var(--gray-500); flex: 0 0 auto; }
.info-line > span:last-child { color: var(--gray-800); }

/* ============================ 全部分类布局 ============================ */
.cat-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--sp-4); align-items: start; margin-top: var(--sp-4); }
.cat-side {
  position: sticky; top: 78px; padding: var(--sp-4);
  max-height: calc(100vh - 108px); overflow-y: auto;
}
.cat-side-head { margin-bottom: var(--sp-3); }
.ct-tree { font-size: var(--fs-sm); }
.ct-node > .ct-children { display: none; }
.ct-node.open > .ct-children { display: block; }
.ct-row {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  border-radius: var(--r-md); cursor: pointer; color: var(--gray-700);
  transition: background var(--t-fast), color var(--t-fast);
}
.ct-row:hover { background: var(--gray-100); color: var(--gray-900); }
.ct-row.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.ct-row.active .ct-name { color: var(--brand-600); }
.ct-row.active .ct-n { color: var(--brand-500); background: rgba(51, 112, 255, .1); }
.ct-caret { width: 0; height: 0; border-left: 5px solid var(--gray-400); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--t-fast), border-color var(--t-fast); flex: 0 0 auto; }
.ct-node.open > .ct-row > .ct-caret { transform: rotate(90deg); border-left-color: var(--brand-500); }
.ct-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-n { flex: 0 0 auto; font-size: 11px; color: var(--gray-400); background: var(--gray-100); border-radius: var(--r-full); padding: 0 7px; min-width: 20px; text-align: center; line-height: 18px; font-variant-numeric: tabular-nums; }
.ct-stage > .ct-name { font-weight: 600; color: var(--gray-900); }
.ct-children { padding-left: 12px; margin-left: 10px; border-left: 1px dashed var(--gray-200); }
.ct-type-block { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--gray-200); }
.ct-type-title { font-size: 11px; color: var(--gray-400); margin-bottom: 8px; letter-spacing: .04em; }
.ct-type-block .quick-entry a { padding: 5px 12px; font-size: var(--fs-xs); }
.ct-icon { flex: 0 0 auto; font-size: var(--fs-sm); line-height: 1; }
.ct-label { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--r-sm); }
.ct-hot { height: 16px; padding: 0 5px; border-radius: var(--r-sm); background: var(--err); color: #fff; font-size: 10px; font-weight: 500; }
.ct-bullet { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 4px; background: var(--brand-500); }
.ct-row .ct-n { background: transparent; padding: 0 2px; min-width: 16px; text-align: right; }
/* 当前内容源下没有内容的节点：淡化提示，避免点了右侧空白 */
.ct-row.ct-zero { opacity: .42; }
.ct-row.ct-zero .ct-n { color: var(--gray-300); }

.cat-main { min-width: 0; }

/* ============================ 文件目录 ============================ */
.file-panel { padding: var(--sp-5); }
.file-dir .mode-pane { display: none; }
.file-dir[data-mode="table"] .mode-pane[data-pane="table"] { display: block; }
.file-dir[data-mode="list"] .mode-pane[data-pane="list"] { display: block; }
.file-dir[data-mode="card"] .mode-pane[data-pane="card"] { display: block; }

.file-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.ft-left { display: flex; align-items: baseline; gap: 10px; }
.ft-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; }
.ft-head { position: relative; margin: 0; padding-left: 12px; font-size: var(--fs-xl); font-weight: 600; color: var(--gray-900); line-height: 1.4; flex: 0 0 auto; }
.ft-head::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 17px; border-radius: var(--r-full); background: linear-gradient(180deg, var(--brand-500), var(--brand-300)); }
.ff { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.ff-clear { font-size: var(--fs-sm); color: var(--gray-500); white-space: nowrap; transition: color var(--t); }
.ff-clear:hover { color: var(--brand-600); }
.ff-free { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--gray-600); cursor: pointer; white-space: nowrap; }
.ff-free input { margin: 0; accent-color: var(--brand-500); }

/* 汇总条（付费合计 / 全免费：同一套琥珀配色，只有文案与按钮不同） */
.cart-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  background: var(--warn-bg); border: 1px solid var(--warn-bd); color: #8a5a1a;
}
.cb-ico { flex: 0 0 auto; width: 20px; height: 18px; border-radius: var(--r-sm); background: var(--warn); position: relative; }
.cb-ico::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 2px; border-radius: 1px; background: var(--warn-bg); box-shadow: 0 5px 0 var(--warn-bg); }
.cb-text { flex: 1 1 auto; min-width: 200px; line-height: 1.6; }
.cb-text b { color: var(--err); font-weight: 600; }
.cb-text b.cb-price { font-size: var(--fs-lg); }
.cb-ops { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cb-all { background: #fff; border: 1px solid var(--warn-bd); color: #8a5a1a; height: 32px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.cb-all:hover { background: #fffaf0; color: #8a5a1a; border-color: var(--warn); }
.cb-pay { background: var(--brand-500); border: 1px solid var(--brand-500); color: #fff; height: 32px; padding: 0 18px; font-size: var(--fs-sm); border-radius: var(--r-sm); box-shadow: var(--sh-pill); }
.cb-pay:hover:not(:disabled):not([disabled]) { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.cb-pay:disabled, .cb-pay[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
/* 汇总条：付费态与「全免费」态**共用同一套琥珀配色**（用户要求统一为同一样式）。
   区别只在文案与按钮：全免费态没有「打包下载」这个付费动作。
   【坑】这里曾经有一个 .cart-bar-free 绿底变体，被用户点名要统一掉——不要再加回来。 */
.cb-text b.cb-free { color: #0a8a53; }
/* 汇总条上方的说明小字（不是卡片，只是一行灰字） */
.ft-note { margin: 0 0 12px; color: var(--gray-500); font-size: var(--fs-xs); line-height: 1.7; }

/* 文件表列宽 */
.file-table .ft-ck { width: 44px; text-align: center; padding-left: 16px; padding-right: 0; }
.file-table .ft-c-type { width: 92px; }
.file-table .ft-c-op { width: 104px; }
.file-table .ft-c-share { width: 132px; }
.file-table td.ft-ck { padding-right: 0; }
.file-table .ft-op { text-align: left; }
.file-table .ft-type { color: var(--gray-600); font-size: var(--fs-xs); }
.ft-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ft-doc { flex: 0 0 auto; color: var(--brand-500); }
.ft-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-900); font-weight: 500; font-size: var(--fs-base); cursor: pointer; transition: color var(--t); }
.ft-name:hover { color: var(--brand-600); }
.ft-hot { flex: 0 0 auto; height: 16px; padding: 0 5px; border-radius: var(--r-sm); background: var(--err); color: #fff; font-size: 10px; font-weight: 500; line-height: 16px; }
.ft-dim { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--gray-400); }
.ft-favshare { display: flex; gap: 6px; }
.ft-favshare .btn-fav, .ft-favshare .btn-share { padding: 0 10px; }
/* 下载列：绿色「下载」与红色「¥x」等宽统一（用户要求） */
.file-table .ft-op .btn-dl, .file-table .ft-op .btn-buy { width: 100%; max-width: 92px; padding: 0; }

/* 资料包表格（/packages 页）：与列表页同款 file-table，仅列语义不同 */
.file-table.pkg-table .ft-op { text-align: center; }
.file-table.pkg-table .ft-c-count { width: 110px; text-align: center; }
.file-table.pkg-table .ft-c-price { width: 122px; text-align: center; }
.file-table.pkg-table .ft-count { text-align: center; color: var(--gray-600); white-space: nowrap; }
.file-table.pkg-table .ft-price { text-align: center; white-space: nowrap; }
.file-table.pkg-table .pkg-free { color: var(--ok); font-weight: 600; }
.file-table.pkg-table .pkg-price { font-weight: 600; color: var(--err); }
.file-table.pkg-table .pkg-price s { color: var(--gray-400); font-weight: 400; margin-left: 5px; }

/* 资料包分组行（/packages：小学→按年级、年级→按学期）
   对齐铁律：分组行的第一个单元格**必须是 td.ft-ck**，不能写成 `<td colspan="6">` 再把勾选框塞进去。
   因为勾选框的水平位置由 .ft-ck 的 padding-left:16px + width:44px + text-align:center 决定（落在 22px），
   用 colspan 自己写 padding 就会偏 6px，和下面的资料包行对不齐。 */
.file-table .grp-row > td { background: var(--gray-50); border-top: 1px solid var(--gray-200); padding-top: 9px; padding-bottom: 9px; }
.file-table .grp-row .grp-ck { margin: 0; }
.grp-name { font-weight: 700; color: var(--gray-900); font-size: var(--fs-base); }
.grp-meta { margin-left: 10px; font-size: var(--fs-xs); color: var(--gray-400); }
.grp-sum { margin-left: 14px; font-size: var(--fs-xs); color: var(--err); font-weight: 600; }
/* 组头右侧操作区（细分类目）：打包下载 ¥X（付费动作，弹悬浮支付窗）+ 全选本组。
   .grp-ops 在 HTML 里必须排在组名之前，float:right 才会把它稳稳压到右端。 */
.grp-ops { float: right; display: flex; align-items: center; gap: 10px; }
.grp-buy { height: 24px; padding: 0 10px; font-size: var(--fs-xs); border-radius: var(--r-sm); font-weight: 600; box-shadow: none; }
.grp-all { font-size: var(--fs-xs); color: var(--brand-500); cursor: pointer; line-height: 24px; user-select: none; }
.grp-all:hover { color: var(--brand-600); }

/* 复选框（勾选资料包 / 合并支付用）
   坑：这行注释以前少了结束符，整段 .ck 规则被当成注释吞掉，全站勾选框 0×0 看不见。
   以后改这里务必确认注释是闭合的。 */
.ck, .ck-all {
  display: inline-block; width: 16px; height: 16px; flex: 0 0 auto;
  border: 1px solid var(--gray-300); border-radius: 4px; background: #fff;
  cursor: pointer; position: relative; vertical-align: middle;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.ck:hover, .ck-all:hover { border-color: var(--brand-500); }
.ck.on, .ck-all.on { background: var(--brand-500); border-color: var(--brand-500); }
.ck.on::after, .ck-all.on::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
/* 半选（组内只勾了一部分）：白横杠。必须写在 .on 之后，否则会被上一条的对勾盖掉 */
.ck.half, .ck-all.half { background: var(--brand-500); border-color: var(--brand-500); }
.ck.half::after, .ck-all.half::after {
  content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 2px;
  background: #fff; border-radius: 1px; border: 0; transform: none;
}
.ck.off, .ck-all.off { background: var(--gray-100); border-color: var(--gray-300); cursor: not-allowed; opacity: .7; }
.ck-off { border-style: dashed; border-color: var(--gray-200); background: var(--gray-75); cursor: default; }
.ck-off:hover { border-color: var(--gray-200); }

/* 列表 / 卡片两种模式 */
.file-area { margin-top: 2px; }
.file-area[data-mode="list"] .fl-item { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--gray-200); transition: background var(--t-fast); }
.file-area[data-mode="list"] .fl-item:hover { background: var(--gray-25); }
.file-area[data-mode="list"] .fl-item:last-child { border-bottom: 0; }
.file-area[data-mode="list"] .fl-cover { width: 52px; height: 70px; flex: 0 0 auto; border-radius: var(--r-sm); overflow: hidden; background: var(--gray-75); }
.file-area[data-mode="list"] .fl-cover img { width: 100%; height: 100%; object-fit: cover; }
.file-area[data-mode="list"] .fl-main { flex: 1 1 auto; min-width: 0; }
.file-area[data-mode="list"] .fl-name { font-weight: 500; color: var(--gray-900); font-size: var(--fs-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.file-area[data-mode="list"] .fl-name:hover { color: var(--brand-600); }
.file-area[data-mode="list"] .fl-meta { margin-top: 6px; display: flex; gap: 10px; align-items: center; }
.file-area[data-mode="list"] .fl-actions { flex: 0 0 auto; display: flex; gap: 8px; }

.file-area[data-mode="card"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: var(--sp-4); }
.file-area[data-mode="card"] .fl-item { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-xs); transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.file-area[data-mode="card"] .fl-item:hover { box-shadow: var(--sh-lg); transform: translateY(-3px); border-color: var(--brand-200); }
.file-area[data-mode="card"] .fl-cover { width: 100%; aspect-ratio: 3 / 4; background: var(--gray-75); }
.file-area[data-mode="card"] .fl-cover img { width: 100%; height: 100%; object-fit: cover; }
.file-area[data-mode="card"] .fl-main { padding: 12px 12px 0; }
.file-area[data-mode="card"] .fl-name { font-weight: 500; font-size: var(--fs-base); color: var(--gray-900); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; line-height: 1.45; }
.file-area[data-mode="card"] .fl-meta { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-area[data-mode="card"] .fl-actions { padding: 12px; display: flex; gap: 8px; margin-top: auto; }
.file-area[data-mode="card"] .fl-actions .btn { flex: 1; }

/* ============================ 资料包卡片 ============================ */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--sp-4); }
.pkg-card { display: flex; flex-direction: column; overflow: hidden; cursor: pointer; transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.pkg-card:hover { box-shadow: var(--sh-lg); transform: translateY(-4px); border-color: var(--brand-200); }
.pkg-covers { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; height: 100px; background: var(--gray-75); }
.pkg-covers img { width: 100%; height: 100%; object-fit: cover; }
.pkg-covers .ph { background: var(--gray-100); }
.pkg-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1 1 auto; }
.pkg-title { font-size: var(--fs-base); font-weight: 600; color: var(--gray-900); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pkg-meta { font-size: var(--fs-xs); color: var(--gray-500); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pkg-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pkg-foo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-200); }
/* 首页「单份资料」卡片：单张封面，和资料包卡共用同一套度量 */
.pkg-card.has-cover .pkg-cover { height: 128px; background: var(--gray-75); overflow: hidden; }
.pkg-card.has-cover .pkg-cover img { width: 100%; height: 128px; object-fit: cover; }
.pkg-price { color: var(--err); font-size: var(--fs-2xl); font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.pkg-price s { color: var(--gray-400); font-size: var(--fs-xs); font-weight: 400; margin-left: 5px; }
.pkg-free { color: var(--ok); font-size: var(--fs-lg); font-weight: 700; }

/* ============================ 统一弹层基座 ============================ */
.cat-modal, .pkg-modal, .res-overlay { position: fixed; inset: 0; display: none; }
.cat-modal { z-index: 1200; align-items: center; justify-content: center; }
.cat-modal[hidden] { display: none; }
/* 【坑】.cat-modal 默认就是 display:none（见上一行之前的合并规则），仅由 JS 去掉 hidden 属性并不会显示；
   .pkg-modal / .res-overlay 都是靠 .open 类（.pkg-modal.open{display:block}）才显示，本弹窗没有这个类 ——
   补这条 :not([hidden])，「详细」按钮（modal.hidden=false）才打得开。 */
.cat-modal:not([hidden]) { display: flex; }
.pkg-modal { z-index: 2600; }
.pkg-modal.open { display: block; }
.res-overlay { z-index: 2200; }
.res-overlay.open { display: block; }

.cat-modal-mask, .pkg-mask, .ro-mask {
  position: absolute; inset: 0;
  background: rgba(23, 29, 43, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
/* 弹层主体：统一 圆角 + 阴影 + 结构 */
.cat-modal-box, .pkg-dialog, .ro-dialog {
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--sh-xl); overflow: hidden;
  display: flex; flex-direction: column;
}
/* 【坑】mask 是 position:absolute，会盖住「未定位」的在流内容；.pkg-dialog/.ro-dialog 都自带
   position:relative;z-index:1 才浮在 mask 之上，分类弹窗的 box 以前没有 → 被半透明遮罩盖住，
   看起来「点了没反应」。补上定位与宽度/高度约束。 */
.cat-modal-box { position: relative; z-index: 1; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 72px); }

/* 资料包清单弹层 */
.pkg-dialog { position: relative; z-index: 1; width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 64px); margin: 32px auto; }
.pkg-head, .cat-modal-head, .ro-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200); flex: 0 0 auto;
}
.pkg-head h3 { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.5; flex: 1 1 auto; min-width: 0; }
.cat-modal-head { justify-content: space-between; font-size: var(--fs-md); font-weight: 600; }
.pkg-close, .ro-x {
  flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: var(--gray-100); border-radius: var(--r-md);
  font-size: 15px; color: var(--gray-500); cursor: pointer; line-height: 1;
  transition: background var(--t), color var(--t);
}
.pkg-close:hover, .ro-x:hover { background: var(--gray-200); color: var(--gray-900); }
.pkg-scroll { overflow: auto; padding: var(--sp-5); flex: 1 1 auto; }
.pkg-sum { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.pkg-sum .pkg-price { font-size: var(--fs-4xl); }
.pkg-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--gray-600); }
.pkg-stats b { color: var(--gray-900); font-weight: 600; }
.pkg-sec { margin-top: var(--sp-5); }
.pkg-sec h4 { margin: 0 0 10px; font-size: var(--fs-base); font-weight: 600; color: var(--gray-900); }
.pkg-desc { font-size: var(--fs-sm); color: var(--gray-600); line-height: 1.8; }
.pkg-pvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pkg-pvs button { padding: 0; border: 1px solid var(--gray-200); border-radius: var(--r-md); overflow: hidden; height: 130px; background: var(--gray-75); cursor: pointer; transition: border-color var(--t), transform var(--t); }
.pkg-pvs button:hover { border-color: var(--brand-500); transform: translateY(-2px); }
.pkg-pvs img { width: 100%; height: 100%; object-fit: cover; }
.pkg-files { border: 1px solid var(--gray-200); border-radius: var(--r-lg); overflow: hidden; }
.pkg-files-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); font-size: var(--fs-sm); color: var(--gray-600); }
.pkg-files-body { max-height: 300px; overflow: auto; }
.pkg-file { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--gray-200); font-size: var(--fs-sm); }
.pkg-file:last-child { border-bottom: 0; }
.pkg-file .n { color: var(--gray-400); width: 26px; flex: 0 0 auto; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.pkg-file .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-800); }
.pkg-file .m { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--gray-500); }
.pkg-file .lock { flex: 0 0 auto; font-size: 11px; color: #c93a25; border: 1px solid var(--err-bd); background: var(--err-bg); border-radius: var(--r-sm); padding: 0 5px; }
.pkg-foot, .cat-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--gray-200); background: var(--gray-50); flex: 0 0 auto;
}
.cat-modal-foot { justify-content: flex-end; gap: 10px; border-radius: 0; }
.pkg-foot-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-modal-body { padding: var(--sp-5); overflow: auto; flex: 1 1 auto; }

/* ============================ 资源浮层（预览 + 详情）· 方案 A ============================ */
/* 版式：左区居中受控预览，右侧 264px 灰底信息与操作栏（目录 / 标签 / 信息 / 打包 / 相关 + 固定操作区）
   本层不放任何广告位；资料页是竖版，渲染尺寸由可用高度决定，所以信息一律侧向占用，绝不上下通栏。 */
.ro-dialog { position: absolute; z-index: 1; top: 10px; bottom: 10px; left: 50%; transform: translateX(-50%); width: min(1360px, calc(100vw - 16px)); }
.ro-head { padding: 10px 16px; gap: 10px; }
.ro-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ro-btn { height: 32px; padding: 0 14px; border-radius: var(--r-md); font-size: var(--fs-sm); }
.ro-link { color: var(--gray-600); }
.ro-x { border: 1px solid var(--gray-200); background: #fff; }

/* 主体：预览区 + 右侧信息与操作栏
   必须显式写 grid-template-rows: minmax(0, 1fr) —— 否则隐式行高为 auto，
   会被内容撑高（实测舞台 933px / 右栏 971px > 容器 827px），
   把右栏底部固定的操作区整个挤出对话框裁掉，主按钮变成看不见的死按钮。
   overflow:hidden 作为兜底，保证任何情况下都不会再溢出弹层。 */
.ro-body {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  grid-template-rows: minmax(0, 1fr);
}

/* 右侧信息与操作栏（目录 / 标签 / 信息 / 打包 / 相关），灰底不抢预览视线 */
.ro-side { border-left: 1px solid var(--gray-200); background: var(--gray-50); display: flex; flex-direction: column; min-height: 0; }
.ro-side-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px; }
.ro-sec { margin-bottom: 16px; }
.ro-sec:last-child { margin-bottom: 0; }
.ro-sec-h { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--gray-900); margin-bottom: 8px; }
.ro-card-note { font-size: 11px; font-weight: 400; color: var(--gray-400); }

/* 右栏操作区（上移到「预览目录」下方）：主操作（免费下载 / 打包购买）+ 收藏 · 分享 */
.ro-side-op { padding: 10px 0 12px; border-bottom: 1px solid var(--gray-200); }
.ro-buybox { display: flex; flex-direction: column; gap: 5px; }
.ro-buybox .ro-get { width: 100%; height: 40px; font-size: var(--fs-md); }
.ro-buyhint { font-size: 11px; color: var(--gray-500); text-align: center; line-height: 1.4; }
.ro-foot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ro-fbtn {
  height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.ro-fbtn-fav { background: var(--gold-bg); border: 1px solid var(--gold-bd); color: #9a6d0b; }
.ro-fbtn-fav:hover { background: #fdf3d4; border-color: var(--gold); }
.ro-fbtn-fav.on { border-color: var(--gold); color: #8a5d05; box-shadow: var(--sh-gold-inset); }
.ro-fbtn-share { background: var(--brand-500); border: 1px solid var(--brand-500); color: #fff; }
.ro-fbtn-share:hover { background: var(--brand-600); border-color: var(--brand-600); }
.ro-tagrow { display: flex; flex-wrap: wrap; gap: 5px; }
.ro-tagrow .tag { height: 20px; padding: 0 7px; font-size: 11px; }
.ro-side .info-line { font-size: var(--fs-xs); padding: 6px 0; gap: 8px; }
.ro-side .info-line span:first-child { width: 58px; }
.ro-side .hint { font-size: 11px; line-height: 1.55; }

/* 预览目录：右栏里用 4 列网格，行高更低，给信息区留出空间 */
.ro-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ro-thumb { position: relative; display: block; width: 100%; padding: 0; margin: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: var(--gray-75); cursor: pointer; line-height: 0; transition: border-color var(--t-fast); }
.ro-thumb img { width: 100%; display: block; }
.ro-thumb.active { border-color: var(--brand-500); box-shadow: var(--sh-select); }
.ro-no { position: absolute; left: 3px; top: 3px; font-size: 11px; line-height: 14px; padding: 0 4px; border-radius: 3px; background: rgba(23, 29, 43, .62); color: #fff; }
.ro-more { grid-column: 1 / -1; width: 100%; height: 28px; border: 1px dashed var(--gray-300); border-radius: var(--r-sm); background: #fff; color: var(--gray-600); font-size: 11px; cursor: pointer; transition: all var(--t); }
.ro-more:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }

.ro-view { display: flex; flex-direction: column; min-width: 0; background: var(--gray-75); }
/* 预览留在舞台中间、四周留白，尺寸刻意收回：看清即可，不再铺满整屏 */
.ro-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 28px 84px; text-align: center; cursor: zoom-in; }
.ro-stage img {
  display: block; margin: 0 auto;
  width: auto; height: auto;
  max-width: min(100%, 620px); max-height: 100%;
  background: #fff; box-shadow: var(--sh-lg); border-radius: 2px;
}
.ro-empty { padding: 60px 0; color: var(--gray-400); font-size: var(--fs-sm); }
.ro-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--r-full); border: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, .95); color: var(--gray-600); font-size: 22px; line-height: 1;
  cursor: pointer; box-shadow: var(--sh-md); transition: all var(--t);
}
.ro-nav:hover { color: var(--brand-600); border-color: var(--brand-300); transform: translateY(-50%) scale(1.06); }
.ro-prev { left: 16px; }
.ro-next { right: 16px; }
.ro-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; padding: 8px 20px; background: #fff; border-top: 1px solid var(--gray-200); font-size: var(--fs-sm); }
.ro-index { font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.ro-tip { font-size: var(--fs-xs); color: var(--gray-400); }
.ro-spacer { flex: 1 1 auto; }
.ro-get { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 20px; border: 0; border-radius: var(--r-md); background: var(--ok); color: #fff; font-size: var(--fs-base); font-weight: 600; cursor: pointer; text-decoration: none; box-shadow: var(--sh-ok-btn); transition: all var(--t); }
.ro-get:hover:not(:disabled):not([disabled]) { background: #0d955b; }
.ro-get-paid { background: var(--err); box-shadow: var(--sh-err-btn); }
.ro-get-paid:hover:not(:disabled):not([disabled]) { background: #d13c27; }
.ro-get:disabled, .ro-get[disabled] { opacity: .6; cursor: not-allowed; box-shadow: none; }
.ro-close2 { font-size: var(--fs-xs); color: var(--gray-500); cursor: pointer; transition: color var(--t); }
.ro-close2:hover { color: var(--brand-600); }

/* 资料包（窄栏里改纵向卡片） */
.ro-pkg { padding: 9px 0; border-bottom: 1px dashed var(--gray-200); }
.ro-pkg:last-child { border-bottom: 0; padding-bottom: 0; }
.ro-pkg-cov { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; height: 34px; border-radius: 4px; overflow: hidden; background: var(--gray-75); margin-bottom: 6px; }
.ro-pkg-cov img { width: 100%; height: 100%; object-fit: cover; }
.ro-pkg-cov .ph { display: block; background: var(--gray-100); }
.ro-pkg-title { font-size: var(--fs-xs); font-weight: 500; line-height: 1.45; color: var(--gray-900); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ro-pkg-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.ro-pkg-foo { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.ro-pkg-foo .pkg-price { font-size: var(--fs-md); }
.ro-pkg-foo .pkg-free { font-size: var(--fs-sm); }
.ro-pkg-foo .btn { height: 24px; padding: 0 8px; font-size: 11px; border-radius: 4px; }
/* 相关资料 */
.ro-rel { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--gray-200); }
.ro-rel:last-child { border-bottom: 0; }
.ro-rel:hover .ro-rel-t { color: var(--brand-600); }
.ro-rel img { width: 34px; height: 44px; flex: 0 0 auto; object-fit: cover; border-radius: 4px; background: var(--gray-75); }
.ro-rel-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.4; color: var(--gray-800); transition: color var(--t); }
.ro-rel-m { display: block; font-size: 11px; color: var(--gray-400); margin-top: 1px; }

/* ============================ 后台 ============================ */
.admin-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: #fff; border-right: 1px solid var(--gray-200); padding: 14px 0; }
.admin-side .group-title { padding: 16px 20px 6px; font-size: 11px; color: var(--gray-400); letter-spacing: .06em; }
.admin-side a { display: block; padding: 9px 20px; font-size: var(--fs-base); color: var(--gray-600); border-left: 3px solid transparent; transition: all var(--t); }
.admin-side a:hover { background: var(--gray-50); color: var(--gray-900); }
.admin-side a.active { background: var(--brand-50); color: var(--brand-600); border-left-color: var(--brand-500); font-weight: 500; }
.admin-main { padding: 0 var(--sp-6) var(--sp-10); }
.admin-top { display: flex; align-items: center; gap: 12px; height: var(--nav-h); margin-bottom: var(--sp-3); }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-3); }
.stat-item { padding: var(--sp-4); transition: box-shadow var(--t), transform var(--t); }
.stat-item:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.stat-item .v { font-size: var(--fs-3xl); font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; }
.stat-item .k { font-size: var(--fs-xs); color: var(--gray-500); margin-top: 2px; }

.cat-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.cat-bar-l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cat-bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-count { font-size: var(--fs-md); font-weight: 600; }
.cat-filter { display: flex; gap: 8px; }
.cat-filter .input { width: 190px; }
.cat-batch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--r-md); margin-bottom: var(--sp-3); }
.cat-table td { padding: 6px 8px; }
.cat-table input.cell { width: 100%; padding: 5px 8px; font-size: var(--fs-sm); min-width: 0; }
.cat-table input.cell.ic { text-align: center; font-size: var(--fs-md); }
.cat-table input.cell.num { text-align: center; }
.cat-table .cnt { text-align: center; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.cat-table .ops { white-space: nowrap; }
.cat-table .ops form { display: inline; margin: 0; }

/* ===== 分类目录：层级缩进 + 层级标签（区分上下级；缩进由行内 padding-left 控制） ===== */
.cat-table td .cat-name { display: flex; align-items: center; gap: 6px; }
.cat-table .cat-name > input.cell { flex: 1 1 auto; min-width: 0; width: auto; }
/* 左侧 3px 色条按层级着色：学段蓝 / 年级绿 / 学期琥珀 / 学科紫 / 自定义灰 */
.cat-name[data-level="stage"]   { box-shadow: inset 3px 0 0 #3370FF; }
.cat-name[data-level="grade"]   { box-shadow: inset 3px 0 0 #0FAE6A; }
.cat-name[data-level="term"]    { box-shadow: inset 3px 0 0 #E8910C; }
.cat-name[data-level="subject"] { box-shadow: inset 3px 0 0 #7C5CF0; }
.cat-name[data-level="custom"]  { box-shadow: inset 3px 0 0 #7D8799; }
.cat-lv { flex: 0 0 auto; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 4px; white-space: nowrap; }
.cat-lv.lv-stage   { background: #EFF4FF; color: #3370FF; }
.cat-lv.lv-grade   { background: #E8FBF2; color: #0FAE6A; }
.cat-lv.lv-term    { background: #FFF8EC; color: #E8910C; }
.cat-lv.lv-subject { background: #F2EEFF; color: #7C5CF0; }
.cat-lv.lv-custom  { background: #F4F6F9; color: #7D8799; }
.cat-table tr[data-level="stage"] input.cell[data-f="name"] { font-weight: 600; }
.cat-table tr[data-id] input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand-500); }
.cc { display: inline-flex; align-items: center; gap: 4px; }
.cc-l { font-style: normal; font-size: var(--fs-xs); color: var(--gray-500); }
.cc input[type="color"] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--gray-300); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.ico-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ico-prev { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--r-md); font-size: var(--fs-base); background: var(--gray-100); min-width: 64px; justify-content: center; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 320px; }
.emoji-btn { width: 32px; height: 32px; line-height: 1; border: 1px solid var(--gray-200); background: #fff; border-radius: var(--r-md); cursor: pointer; font-size: 16px; transition: all var(--t); }
.emoji-btn:hover { border-color: var(--brand-400); background: var(--brand-50); }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swatches { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.sw-btn { width: 24px; height: 24px; border: 1px solid rgba(16, 24, 40, .1); border-radius: var(--r-sm); cursor: pointer; transition: transform var(--t-fast); }
.sw-btn:hover { transform: scale(1.14); }
.hex-mini { width: 92px; font-size: var(--fs-sm); }
.inline-cb { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-base); cursor: pointer; }
.inline-cb input { accent-color: var(--brand-500); }

/* 其它后台小件 */
.card-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.file-drop { border: 2px dashed var(--gray-300); padding: var(--sp-8); text-align: center; background: var(--gray-25); cursor: pointer; transition: all var(--t); }
.file-drop.hot { border-color: var(--brand-500); background: var(--brand-50); }
.progress { height: 10px; background: var(--gray-200); border-radius: var(--r-full); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); transition: width .3s var(--ease); }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-top: var(--sp-3); }
.result-grid div { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--r-md); padding: 10px; text-align: center; }
.result-grid b { display: block; font-size: var(--fs-2xl); color: var(--gray-900); }
.qr-box { width: 200px; height: 200px; margin: 0 auto; background: #fff; display: grid; place-items: center; }
.delivery-item { padding: var(--sp-4); margin-top: var(--sp-3); text-align: left; background: var(--gray-25); }
.code-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--fs-base); }
.code-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--gray-100); padding: 3px 10px; border-radius: var(--r-sm); letter-spacing: 2px; }

/* ============================ 广告位 ============================ */
.ad-slot { margin: 12px 0; text-align: center; }
.ad-item img { max-width: 100%; display: block; margin: 0 auto; border-radius: var(--r-md); border: 1px solid var(--gray-200); }
.ad-item a { display: block; }
.ad-cell img { border-radius: var(--r-sm); }
@media (max-width: 768px) { .ad-item[data-device="pc"] { display: none; } }
@media (min-width: 769px) { .ad-item[data-device="mobile"] { display: none; } }

/* ============================ 移动端底部操作栏 ============================ */
.mobile-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--gray-200); padding: 10px 12px; gap: 10px;
  box-shadow: var(--sh-float-up);
}

/* ============================ 移动端全局底部导航 ============================ */
.mobile-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  height: calc(54px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, .06);
}
.mobile-nav .mn-item {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; line-height: 1.2; color: var(--gray-600); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav .mn-item .mn-ico { font-size: 20px; line-height: 1; }
.mobile-nav .mn-item.active { color: var(--brand-600); }
.mobile-nav .mn-item:active { color: var(--brand-600); }

/* ============================ 页脚 ============================ */
.footer { margin-top: var(--sp-12); border-top: 1px solid var(--gray-200); background: #fff; padding: var(--sp-10) 0 0; font-size: var(--fs-sm); color: var(--gray-500); }
/* auto-fit：页脚栏目被后台关掉后（可能只剩 1 列）不会留出空轨道 */
.footer-in { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-8); padding-bottom: var(--sp-8); }
.footer-brand .logo { margin-bottom: 10px; }
.footer-desc { font-size: var(--fs-sm); color: var(--gray-500); line-height: 1.7; max-width: 320px; }
.footer-col h4 { font-size: var(--fs-sm); font-weight: 600; color: var(--gray-900); margin-bottom: 12px; }
.footer-col a { display: block; padding: 5px 0; color: var(--gray-500); transition: color var(--t); }
.footer-col a:hover { color: var(--brand-600); }
.footer-bar { border-top: 1px solid var(--gray-200); padding: var(--sp-4) 0; background: var(--gray-25); }
.footer-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--fs-xs); }
.footer-legal { display: flex; gap: 8px; flex-wrap: wrap; }
.footer a:hover { color: var(--brand-600); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 8px; }

/* ============================ 响应式 ============================ */
@media (max-width: 1200px) {
  .ro-body { grid-template-columns: minmax(0, 1fr) 228px; }
  .ro-rail { grid-template-columns: repeat(3, 1fr); }
  .grid-cards { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-wrap.has-catalog { grid-template-columns: 150px 1fr 300px; }
}
@media (max-width: 900px) {
  .ro-dialog { width: calc(100vw - 12px); top: 6px; bottom: 6px; }
  .ro-title { font-size: var(--fs-base); }
  .ro-actions .ro-link { display: none; }
  .ro-stage { padding: 14px 52px; }
  .ro-stage img { max-width: 100%; }
  /* 窄屏：右栏折成底部一条横向胶片条（只留目录 / 标签）+ 一条操作带 */
  .ro-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .ro-side { border-left: 0; border-top: 1px solid var(--gray-200); flex: 0 0 auto; }
  .ro-side-scroll { display: flex; gap: 10px; align-items: center; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; }
  .ro-side-scroll .ro-sec:nth-child(n + 3) { display: none; }
  .ro-sec { margin-bottom: 0; flex: 0 0 auto; }
  .ro-sec-h { margin-bottom: 0; }
  .ro-rail { display: flex; gap: 6px; }
  .ro-thumb { width: 44px; }
  .ro-more { width: auto; padding: 0 10px; }
  .ro-side-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
  .ro-buybox { flex: 1 1 auto; flex-direction: row; align-items: center; gap: 8px; }
  .ro-buybox .ro-get { width: auto; height: 34px; padding: 0 16px; font-size: var(--fs-sm); white-space: nowrap; }
  .ro-buyhint { display: none; }
  .ro-foot-row { margin-top: 0; flex: 0 0 auto; display: flex; gap: 8px; }
  .ro-fbtn { height: 34px; padding: 0 12px; }
}
@media (max-width: 860px) {
  .detail-wrap, .detail-wrap.has-catalog { grid-template-columns: 1fr; }
  .preview-catalog { position: static; max-height: none; margin-bottom: var(--sp-3); }
  .preview-catalog .pc-list { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .preview-catalog .pc-item { flex: 0 0 92px; }
  .grid-cards, .grid-cards.g4 { grid-template-columns: repeat(3, 1fr); }
  .card-list { grid-template-columns: repeat(2, 1fr); }
  .cat-layout { grid-template-columns: 1fr; }
  .cat-side { position: static; max-height: none; }
  .ct-children { border-left: 0; margin-left: 0; padding-left: 14px; }
}
@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .nav-links { display: none; }
  .grid-cards, .grid-cards.g4, .grid-cards.g3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-list { grid-template-columns: 1fr; }
  .search-hero { padding: 36px 0 28px; }
  .search-title { font-size: 26px; }
  .hero-stats { border-radius: var(--r-lg); }
  .hero-stats > span { padding: 4px 14px; }
  .hero-stats > span + span { border-left: 0; }
  .detail-title { font-size: var(--fs-2xl); }
  .preview-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .form-grid, .form-grid2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mobile-bar { display: flex; }
  .mobile-bar .btn { flex: 1; }
  .mobile-bar .btn-icon { flex: 0 0 62px; flex-direction: column; font-size: 11px; gap: 2px; }
  .mobile-nav { display: flex; }
  /* 非详情页：底部常驻导航已提供 我的/登录，收起顶部右侧冗余按钮，仅留 logo */
  body:not(.has-action-bar) .nav-right { display: none; }
  body.has-mobile-bar { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .file-toolbar { flex-direction: column; align-items: stretch; }
  .ff { width: 100%; }
  .ff-sel { flex: 1 1 45%; min-width: 0; }
  .cart-bar { flex-direction: column; align-items: stretch; }
  .cb-text { min-width: 0; }
  .cb-ops { width: 100%; }
  .cb-ops .btn { flex: 1 1 auto; }
  .file-table .ft-c-share, .file-table .ft-share { display: none; }
  .ft-dim { display: none; }
  .pkg-dialog { margin: 16px auto; max-height: calc(100vh - 32px); }
  .footer-in { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .footer-brand { grid-column: 1 / -1; }
  .cat-bar-r { width: 100%; }
  .cat-filter .input, .cat-filter select.input { width: auto; flex: 1; }
}
@media (max-width: 600px) {
  .search-box { padding: 5px 5px 5px 16px; }
  .search-box button { padding: 0 18px; }
  .search-title { font-size: 23px; }
  .file-area[data-mode="list"] .fl-item { gap: 10px; padding: 10px 4px; }
  .file-area[data-mode="list"] .fl-cover { width: 44px; height: 60px; }
  .file-area[data-mode="list"] .fl-actions { flex-direction: column; gap: 6px; }
  .footer-in { grid-template-columns: 1fr; }
  .ft-right { justify-content: space-between; }
  .file-table th, .file-table td { padding: 9px 8px; }
}

/* ==================== 顶部导航内嵌搜索框（全站常驻，悬浮弹层内隐藏） ==================== */
.navbar .container { gap: 16px; }
.nav-search {
  flex: 1 1 auto; max-width: 420px; margin: 0 auto; display: flex; gap: 6px; align-items: center;
  background: var(--gray-75); border: 1px solid var(--gray-200); border-radius: var(--r-full);
  padding: 4px 4px 4px 16px; transition: border-color var(--t), box-shadow var(--t);
}
.nav-search:focus-within { border-color: var(--brand-400); box-shadow: var(--sh-ring-lg); background: #fff; }
.nav-search input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; height: 34px; font-size: var(--fs-sm); }
.nav-search button { height: 34px; padding: 0 18px; border: 0; border-radius: var(--r-full); background: var(--brand-500); color: #fff; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; flex: 0 0 auto; }
.nav-search button:hover { background: var(--brand-600); }
body.overlay-open .nav-search, body.pay-open .nav-search { visibility: hidden; }

/* ==================== 价格色块（付费红 / 免费绿）==================== */
.pkg-price-block {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 96px; height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--err); color: #fff; font-weight: 700; font-size: var(--fs-md);
  border: 1px solid var(--err); cursor: pointer; white-space: nowrap; line-height: 1;
  box-shadow: 0 1px 2px rgba(232, 70, 47, .28); transition: background var(--t);
}
.pkg-price-block:hover { background: #d63d27; }
.pkg-free-block {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 96px; height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--ok); color: #fff; font-weight: 600; font-size: var(--fs-sm);
  border: 1px solid var(--ok); cursor: pointer; white-space: nowrap; line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 174, 106, .25); transition: background var(--t);
}
.pkg-free-block:hover { background: #0d975c; }
.pkg-table .ft-op .pkg-price-block { width: 96px; padding: 0; }

/* ==================== 多选结算条 ==================== */
.checkout-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-top: 14px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
}
.checkout-bar .co-text { flex: 1 1 auto; color: var(--gray-700); }
/* 【坑】.checkout-bar 是 display:flex，会盖掉浏览器默认的 [hidden]{display:none}，
   于是「一个都没勾」时结算条照样显示「已选 0 个资料包 ¥0.00」。必须显式关掉。 */
.checkout-bar[hidden] { display: none; }
.checkout-bar .co-text b { color: var(--err); }
.checkout-bar .co-right { flex: 0 0 auto; }
.co-amount { font-size: var(--fs-2xl); font-weight: 700; color: var(--err); }
.ck-all { cursor: pointer; }

/* ==================== 悬浮支付窗 ==================== */
.pay-overlay { position: fixed; inset: 0; z-index: 2950; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pay-overlay[hidden] { display: none; }
.pay-mask { position: absolute; inset: 0; background: rgba(17, 23, 43, .45); }
.pay-dialog { position: relative; width: 430px; max-width: 100%; max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-xl); }
.pay-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--gray-200); }
.pay-head .pay-title { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-900); flex: 1 1 auto; }
.pay-x { width: 30px; height: 30px; border: 0; background: transparent; color: var(--gray-500); font-size: 18px; cursor: pointer; border-radius: var(--r-sm); }
.pay-x:hover { background: var(--gray-100); color: var(--gray-800); }
.pay-body { padding: 16px 20px; }
.pay-order { border: 1px solid var(--gray-200); border-radius: var(--r-md); padding: 12px 14px; background: var(--gray-50); }
.pay-order .po-name { font-size: var(--fs-md); font-weight: 600; color: var(--gray-900); margin-bottom: 6px; }
.pay-order .po-sub { font-size: var(--fs-xs); color: var(--gray-500); font-weight: 400; margin-left: 8px; }
.pay-order .po-row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); padding: 3px 0; color: var(--gray-600); }
.pay-order .po-row .pv { color: var(--gray-800); }
.pay-order .po-row.total { border-top: 1px dashed var(--gray-300); margin-top: 6px; padding-top: 8px; font-weight: 600; color: var(--gray-800); }
.pay-order .po-row.total .amt { color: var(--err); font-size: var(--fs-xl); font-weight: 700; }
.pay-methods { display: flex; gap: 10px; margin: 14px 0; }
.pay-methods .pay-m { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-sm); color: var(--gray-700); background: #fff; }
.pay-methods .pay-m.on { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); color: var(--brand-700); }
.pm-ico { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; }
.pm-ico.wx { background: #07c160; }
.pm-ico.ali { background: #1677ff; }
.pay-submit { width: 100%; height: 44px; border: 0; border-radius: var(--r-md); background: var(--brand-500); color: #fff; font-size: var(--fs-lg); font-weight: 600; cursor: pointer; }
.pay-submit:hover { background: var(--brand-600); }
.pay-submit:disabled { opacity: .6; cursor: not-allowed; }
.pay-tip { margin-top: 12px; font-size: var(--fs-xs); color: var(--gray-500); background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--r-sm); padding: 8px 10px; display: flex; gap: 6px; align-items: flex-start; }
.pay-qr { margin-top: 12px; text-align: center; }
.pay-qr img { width: 180px; height: 180px; margin: 0 auto; border: 1px solid var(--gray-200); border-radius: var(--r-md); padding: 6px; background: #fff; }
body.pay-open { overflow: hidden; }

/* ==================== 响应式：搜索框 / 支付窗 ==================== */
@media (max-width: 768px) {
  .navbar .container { gap: 10px; }
  .nav-search { max-width: none; margin: 0; padding: 3px 3px 3px 12px; }
  .nav-search input { height: 32px; }
  .nav-search button { height: 32px; padding: 0 14px; }
  .pay-overlay { padding: 12px; align-items: flex-end; }
  .pay-dialog { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .checkout-bar { position: fixed; left: 0; right: 0; bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}

/* ==================== 顶部登录态：头像 + 退出 ==================== */
.nav-user { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 3px 10px 3px 3px; border-radius: var(--r-full); text-decoration: none; color: var(--gray-800); }
.nav-user:hover { background: var(--brand-50); color: var(--brand-600); }
.nu-avatar { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; background: var(--brand-500); color: #fff; font-size: 13px; font-weight: 600; line-height: 1; }
.nu-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nu-name { font-size: var(--fs-sm); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { color: var(--gray-600); }
.btn-logout:hover { color: var(--err); border-color: var(--err); }
/* 列表里的「付费」小标 */
.ft-paid { flex: 0 0 auto; height: 16px; padding: 0 5px; border-radius: var(--r-sm); background: var(--warn); color: #fff; font-size: 10px; line-height: 16px; font-weight: 500; }
.res-table-wrap { min-width: 0; }

@media (max-width: 768px) {
  /* 登录后，手机上顶部也要看得到头像与退出（未登录仍走底部导航，保持简洁） */
  body:not(.has-action-bar):not(.is-login) .nav-right { display: none; }
  body.is-login .nav-right { display: flex; gap: 6px; }
  body.is-login .nav-right .nu-name,
  body.is-login .nav-right .btn-admin { display: none; }
  body.is-login .nav-right .nav-user { padding: 0; }
  body.is-login .nav-right .nu-avatar { width: 32px; height: 32px; }
  body.is-login .nav-right .btn-logout { padding: 0 10px; height: 32px; line-height: 30px; font-size: var(--fs-sm); }
}

/* ==================== 首页浏览区：一行用法说明（替代原来的大色块） ==================== */
.browse-tip {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 12px;
  background: var(--brand-50); border: 1px solid #dbe6ff; border-radius: var(--r-md);
  font-size: var(--fs-xs); color: var(--gray-600); line-height: 1.5;
}
.browse-tip .bt-ico { flex: 0 0 auto; font-size: 14px; line-height: 1; }
.browse-tip .bt-text { flex: 1 1 auto; min-width: 0; }
.browse-tip .bt-more { flex: 0 0 auto; color: var(--brand-600); font-weight: 600; white-space: nowrap; }
.browse-tip .bt-more:hover { text-decoration: underline; }
@media (max-width: 768px) {
  .browse-tip { flex-wrap: wrap; }
  .browse-tip .bt-more { width: 100%; }
}

/* 合集条「打包下载」：红色主按钮 */
.cb-ops .btn-danger { font-weight: 600; }

/* ==========================================================================
   悬浮网盘链接窗（.dl-overlay）——免费下载 / 免费领取后不跳页，当前页弹窗
   版式对齐 .pay-overlay 的信息节奏：头部说明 → 每个网盘一块 → 底部主按钮
   ========================================================================== */
.dl-overlay { position: fixed; inset: 0; z-index: 2700; }
.dl-overlay[hidden] { display: none; }
.dl-mask { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); }
.dl-dialog {
  position: relative; z-index: 1; width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px); margin: 8vh auto 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--gray-0); border-radius: var(--r-xl); box-shadow: var(--sh-xl);
  animation: dlIn .18s var(--ease);
}
@keyframes dlIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.dl-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--gray-200); }
.dl-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--brand-50); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1;
}
.dl-head-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dl-title { font-size: var(--fs-md); font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-sub { font-size: var(--fs-xs); color: var(--gray-500); }
.dl-x {
  flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--gray-500); cursor: pointer; font-size: 14px; line-height: 1;
}
.dl-x:hover { background: var(--gray-100); color: var(--gray-800); }

.dl-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dl-item { border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: 14px; background: var(--gray-25); }
.dl-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dl-prov { font-size: var(--fs-base); font-weight: 600; color: var(--gray-900); }
.dl-open { padding: 6px 14px; }
.dl-dead { font-size: var(--fs-sm); color: var(--err); }

.dl-code, .dl-url { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--fs-sm); }
.dl-code-lb, .dl-url-lb { flex: 0 0 auto; color: var(--gray-500); }
.dl-code-v {
  flex: 0 0 auto; padding: 2px 10px; border: 1px dashed var(--err-bd); border-radius: var(--r-sm);
  background: var(--err-bg); color: var(--err);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-md); font-weight: 700; letter-spacing: .08em;
}
.dl-url-v {
  flex: 1 1 auto; min-width: 0; padding: 3px 8px;
  border: 1px solid var(--gray-200); border-radius: var(--r-sm); background: var(--gray-0);
  color: var(--gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-copy { flex: 0 0 auto; padding: 3px 10px; font-size: var(--fs-xs); }
.dl-note { margin-top: 10px; font-size: var(--fs-xs); color: var(--warn); }
.dl-hint { margin-top: 10px; font-size: var(--fs-xs); color: var(--gray-500); }
.dl-empty { padding: 28px 16px; text-align: center; color: var(--gray-500); }

.dl-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--gray-200); background: var(--gray-50);
}
.dl-tip { font-size: var(--fs-xs); color: var(--gray-500); }
.dl-ops { flex: 0 0 auto; display: flex; gap: 8px; }

@media (max-width: 768px) {
  .dl-dialog { width: calc(100vw - 24px); margin: 12px auto 0; max-height: calc(100vh - 24px); }
  .dl-body { padding: 14px; }
  .dl-foot { flex-wrap: wrap; }
  .dl-ops { width: 100%; }
  .dl-ops .btn { flex: 1 1 auto; }
  .dl-url { flex-wrap: wrap; }
  .dl-url-v { flex: 1 1 100%; order: 3; }
}

/* ===== 专题列表（按学段分组） ===== */
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--gray-200);
  border-radius: 999px; font-size: var(--fs-sm); color: var(--gray-600); background: #fff; transition: all var(--t); }
.tchip:hover { border-color: var(--brand-400); color: var(--brand-600); }
.tchip.on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.tchip b { font-weight: 600; opacity: .82; }
.topic-group { margin-top: var(--sp-8); }
.topic-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.topic-group-head h2 { font-size: var(--fs-xl); }
.topic-group-n { font-size: var(--fs-xs); color: var(--gray-400); }
.topic-card { position: relative; display: block; }
.topic-card-title { font-size: var(--fs-lg); font-weight: 600; color: var(--gray-900); }
.topic-card-stage { position: absolute; top: 12px; right: 12px; font-size: var(--fs-xs); color: var(--brand-600);
  background: var(--brand-50); border-radius: 999px; padding: 2px 8px; }

/* ===== 后台「页脚导航」开关 ===== */
.footer-cfg { display: grid; gap: 14px; margin-top: 6px; }
.fc-block { border: 1px solid var(--gray-200); border-radius: var(--r-md); padding: 12px 14px; background: var(--gray-25); }
.fc-col { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); color: var(--gray-900); cursor: pointer; margin-bottom: 8px; }
.fc-links { display: flex; flex-wrap: wrap; gap: 14px; }
.fc-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--gray-600); cursor: pointer; }
.fc-col input, .fc-link input { width: 15px; height: 15px; accent-color: var(--brand-500); }

@media (max-width: 768px) {
  .topic-card-stage { position: static; display: inline-block; margin-top: 8px; }
}

/* ===== 后台分类：行内「图标」选择器（点图标格弹 emoji 面板） ===== */
.cat-table input.cell.ic { cursor: pointer; }
.emoji-pop { position: fixed; z-index: 3000; display: grid; grid-template-columns: repeat(9, 32px); gap: 4px;
  padding: 8px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); max-height: 248px; overflow: auto; max-width: calc(100vw - 16px); }
.emoji-pop[hidden] { display: none; }
