/* =====================================================================
   数字教材书架 · 朱砂印标签（V1 平台接入版 · 移植自 V3 v3.2）
   设计意图：教材本体是「深蓝布面 + 烫金细线」的学术书装，因此
   ① 书架以竖版 3:4 封面为主体；②「有数字教材」用**朱砂印**（红边框 + 红字 + 轻微旋转），
   与平台的紫色品牌色区分开，一眼可辨。

   移植说明（只在本文件内做，不改 V1 site.css 的任何令牌值）：
   V1 的设计令牌集与 V3 命名不同，本文件顶部 :root 补一层**别名**，
   把 V3 用到的令牌名指向 V1 现有令牌，样式规则本身保持与 V3 逐字一致。
   ===================================================================== */
:root {
  /* —— V1 → V3 令牌别名（局部，仅供本文件规则使用） —— */
  --r-sm: var(--radius);
  --r: var(--radius);
  --r-lg: var(--radius);
  --r-pill: var(--radius-pill);
  --shadow-1: var(--shadow);
  --shadow-2: var(--shadow-hover);
  --shadow-3: var(--shadow-hover);
  --ink-2: var(--ink);
  --muted-2: var(--muted);
  --fs-2: var(--fs-h2);
  --mono: var(--font-body);

  /* —— 数字教材专属色（与 V1 品牌紫并列，不替代任何 V1 令牌） —— */
  --seal: #b1241d;
  --seal-d: #8d1a15;
  --seal-soft: #fbeeec;
  --cloth: #123a63;
  --cloth-d: #0c2947;
  --brass: #c08a2e;
}

/* ---------- 朱砂印 ---------- */
.seal-tb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1.5px solid var(--seal);
  border-radius: 4px;
  background: var(--seal-soft);
  color: var(--seal);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.35;
  white-space: nowrap;
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 .5px rgba(177, 36, 29, .22);
}
.seal-tb-lg { padding: 4px 9px; font-size: 13px; border-width: 2px; border-radius: 5px; }
.seal-tb-flat { transform: none; }
a.seal-tb { text-decoration: none; cursor: pointer; transition: background .18s var(--ease), color .18s var(--ease); }
a.seal-tb:hover { background: var(--seal); color: #fff; }
.course-level { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 书架网格 ---------- */
.tb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 20px;
}
.tb-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.tb-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--cloth-d), var(--cloth));
  overflow: hidden;
}
.tb-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.tb-cover .tb-state { position: absolute; left: 10px; top: 10px; }
.tb-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.tb-name { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.tb-en { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); }
.tb-meta { font-size: 12.5px; color: var(--muted); }
.tb-blurb { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.tb-feats { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
.tb-feats span {
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 11.5px; white-space: nowrap;
}
.tb-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.tb-note { font-size: 11.5px; line-height: 1.6; color: var(--muted-2); }
.tb-course { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tb-course a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.tb-course a:hover { text-decoration: underline; }

/* ---------- 首页「数字教材」栏目（紧凑书脊条） ---------- */
.tb-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
.tb-mini {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); box-shadow: var(--shadow-1);
  text-decoration: none; color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tb-mini:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tb-mini-shot { position: relative; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--cloth-d); }
.tb-mini-shot img { width: 100%; height: 100%; display: block; object-fit: cover; }
.tb-mini-shot .tb-state { position: absolute; left: 6px; top: 6px; }
.tb-mini-shot .seal-tb { font-size: 10px; padding: 1px 4px; }
.tb-mini-t { font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.4; }
.tb-mini-m { font-size: 11.5px; color: var(--muted-2); }
.tb-mini.is-planned .tb-mini-shot { opacity: .96; }

/* ---------- 书架页页头 ---------- */
.tb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.tb-create { align-self: center; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; }
.tb-create small { font-size: 10.5px; font-weight: 400; opacity: .86; }
.tb-head-facts { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }
.tb-head-facts span {
  padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12.5px; font-weight: 600;
}
.tb-sect { margin-top: 30px; }
.tb-sect > h2 { margin: 0 0 4px; font-size: var(--fs-2); }
.tb-sect > p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.tb-path { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tb-path .arrow { color: var(--muted-2); font-size: 13px; }
.tb-path .node {
  padding: 6px 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.tb-path .node.is-on { border-color: var(--brass); color: var(--cloth); background: #fdf8ee; }

/* ---------- 首页 #textbooks 区块：标题与右侧「查看书架 →」同一行两端对齐 ---------- */
.tb-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .tb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .tb-body { padding: 11px 12px 13px; }
  .tb-name { font-size: 15px; }
  .tb-strip { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
