/* ============================================================
   成长陪练 · 管理后台 / 老师端
   ============================================================ */

body.admin-body { background: #f4f2ec; }

/* ---------------- login ---------------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.login-art {
  display: none;
  background: linear-gradient(135deg, #0d4f3e 0%, #0a3f32 55%, #072a22 100%);
  color: #eef5f0; padding: 56px; position: relative; overflow: hidden;
  flex-direction: column; justify-content: space-between;
}
.login-art::before {
  content: ""; position: absolute; right: -120px; top: -80px; width: 440px; height: 440px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.015);
}
.login-art::after {
  content: ""; position: absolute; left: -80px; bottom: -180px; width: 380px; height: 380px;
  border-radius: 50%; background: rgba(221,143,63,.12); filter: blur(40px);
}
.login-art .la-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-art h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.22; margin-top: 40px; position: relative; z-index: 1; letter-spacing: -.01em; }
.login-art h1 em { font-style: normal; color: #f2c58e; }
.login-art .la-sub { font-size: 13px; color: rgba(238,245,240,.6); max-width: 440px; margin-top: 14px; line-height: 1.8; position: relative; z-index: 1; }
.login-art .la-stats { display: flex; gap: 36px; position: relative; z-index: 1; margin-top: 46px; flex-wrap: wrap; }
.login-art .la-stats b { display: block; font-family: var(--font-en); font-size: 30px; }
.login-art .la-stats span { font-size: 10.5px; color: rgba(255,255,255,.5); }
.login-panel {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px var(--gutter) calc(40px + var(--safe-b)); min-height: 100dvh;
}
.login-card { width: min(400px, 100%); }
.login-card h2 { font-size: 28px; }
.login-card .lc-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.login-tabs { display: flex; gap: 4px; background: var(--bg-deep); padding: 3px; border-radius: 999px; margin: 22px 0; }
.login-tabs button { flex: 1; padding: 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.login-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.code-row .btn { flex: none; min-width: 110px; }
.login-demo { margin-top: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--paper-2); }
.login-demo .ld-title { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; font-weight: 700; }
.login-demo .ld-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 7px; font-size: 11.5px; }
.login-demo b { color: var(--ink); }
.login-legal { font-size: 10px; color: var(--muted-2); margin-top: 22px; line-height: 1.6; }

/* ---------------- shell ---------------- */
.admin-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
/* 移动优先：侧栏默认收在屏幕外，点汉堡才滑出 */
.side {
  background: #0c2f27; color: #dbe7e0;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 130;
  width: 274px; max-width: 84vw; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(-100%);
  transition: transform .28s var(--ease-out);
}
.side::after {
  content: ""; position: absolute; left: -40%; bottom: -20%; width: 300px; height: 300px;
  border-radius: 50%; background: rgba(221,143,63,.07); filter: blur(20px); pointer-events: none;
}
.admin-shell.nav-open .side { transform: none; box-shadow: 0 0 70px -18px rgba(10, 63, 50, .6); }
.side-mask {
  display: none; position: fixed; inset: 0; z-index: 125;
  background: rgba(18, 32, 27, .42); animation: fade .2s;
}
.admin-shell.nav-open .side-mask { display: block; }
.at-menu { display: inline-flex; }
.side-head { padding: 18px 16px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-head .brand-mark { background: linear-gradient(150deg, #3f9b78, #135c47); width: 36px; height: 36px; border-radius: 11px; }
.side-head .sh-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; }
.side-head .sh-org { font-size: 9.5px; color: rgba(219,231,224,.45); margin-top: 1px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 12px 10px calc(20px + var(--safe-b)); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.side-scroll::-webkit-scrollbar { width: 4px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.side-group { margin-top: 16px; }
.side-group:first-child { margin-top: 4px; }
.side-label { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: rgba(219,231,224,.32); padding: 0 12px 6px; font-weight: 600; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 9px;
  font-size: 12.5px; color: rgba(219,231,224,.72); margin-bottom: 1px;
  transition: background .18s, color .18s; position: relative;
}
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.on { background: rgba(255,255,255,.09); color: #fff; font-weight: 600; }
.side-link.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2.5px; border-radius: 2px; background: #f2c58e; }
.side-link .sl-ic { width: 17px; height: 17px; opacity: .8; flex: none; }
.side-link .sl-badge { margin-left: auto; background: var(--rose); color: #fff; font-size: 9.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 10px; width: 100%; text-align: left; }
.side-user:hover { background: rgba(255,255,255,.06); }
.side-user .su-name { display: block; font-size: 12px; color: #fff; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .su-role { display: block; font-size: 9.5px; color: rgba(219,231,224,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .avatar { width: 32px; height: 32px; font-size: 12px; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  height: var(--nav-h); background: rgba(250,249,245,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; position: sticky; top: 0; z-index: 50;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* 滚起来之后顶栏才浮出投影：与页面内容分层 */
.admin-top.is-scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--line-strong); }
.admin-top .at-title { font-size: 15px; font-weight: 700; font-family: var(--font-serif); }
.admin-top .at-crumb { font-size: 10.5px; color: var(--muted); }
.admin-top .at-search { display: none; margin-left: auto; width: 220px; position: relative; }
.admin-top .at-search input { width: 100%; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 12px 0 31px; font-size: 11.5px; }
.admin-top .at-search input:focus { outline: none; border-color: var(--leaf); }
.admin-top .at-search svg { position: absolute; left: 11px; top: 9px; color: var(--muted-2); }
.admin-top .at-actions { display: flex; align-items: center; gap: 6px; }
.admin-top .icon-btn { width: 38px; height: 38px; }
.at-divider { width: 1px; height: 22px; background: var(--line); }
.at-user { display: flex; align-items: center; gap: 8px; padding: 3px 5px; border-radius: var(--radius-sm); }
.at-user:hover { background: var(--paper); }
.at-user .au-name { font-size: 11.5px; font-weight: 600; line-height: 1.2; }
.at-user .au-role { font-size: 9px; color: var(--muted); }

.admin-view { padding: 16px 16px calc(52px + var(--safe-b)); width: 100%; max-width: 1560px; animation: viewIn .28s var(--ease); }
.admin-page-head { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-page-head .aph-actions .btn { flex: 1 1 auto; }
.admin-page-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.admin-page-head .aph-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.admin-page-head .aph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi { padding: 13px 14px; border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); position: relative; overflow: hidden; }
.kpi .k-label { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi .k-val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 6px; }
.kpi .k-val small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi .k-foot { font-size: 10px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.kpi .k-delta { font-size: 10px; font-weight: 700; color: var(--pine); }
.kpi .k-delta.down { color: var(--rose); }
.kpi.accent { background: var(--pencil); color: #fff; border-color: transparent; }
.kpi.accent .k-label, .kpi.accent .k-foot { color: rgba(255,255,255,.62); }
.kpi.accent .k-val { color: #fff; }
.kpi.accent .k-val small { color: rgba(255,255,255,.55); }
.kpi.accent .k-delta { color: var(--sticker); }
.kpi .k-spark { position: absolute; right: 0; bottom: 0; width: 90px; opacity: .5; }

/* ---------------- panels ---------------- */
.a-grid { display: grid; gap: 14px; }
.a-grid.two { grid-template-columns: minmax(0, 1fr); align-items: start; }
.a-grid.three { grid-template-columns: minmax(0, 1fr); }
.a-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.a-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.a-panel-head h3 { font-size: 14px; font-weight: 700; font-family: var(--font-sans); }
.a-panel-head .aph-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.a-panel-body { padding: 16px 18px; }
.a-panel-body.flush { padding: 0; }
.a-panel-foot { padding: 11px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* trend chart */
.trend-box { position: relative; padding: 6px 0 0; }
.trend-box svg { width: 100%; height: 180px; overflow: visible; }
.trend-legend { display: flex; gap: 16px; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 7px; height: 7px; border-radius: var(--radius-xs); }

/* review queue */
.queue-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e9ecef; transition: background .15s; cursor: pointer; }
.queue-row:last-child { border-bottom: 0; }
.queue-row:hover { background: var(--paper-2); }
.queue-main { flex: 1; min-width: 0; }
.queue-main .qr-name { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.queue-main .qr-task { font-size: 11px; color: var(--muted); margin-top: 1px; }
.queue-time { font-size: 10.5px; color: var(--muted); flex: none; text-align: right; }
.queue-time b { display: block; color: var(--ink-2); font-size: 11.5px; }

/* charts / bars */
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 11.5px; }
.hbar .hb-name { width: 92px; color: var(--ink-2); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb-track { flex: 1; height: 8px; background: var(--bg-deep); border-radius: var(--radius-sm); overflow: hidden; }
.hbar .hb-track i { display: block; height: 100%; background-image: repeating-linear-gradient(90deg, var(--pencil) 0 5px, transparent 5px 8px); }
.hbar .hb-val { width: 46px; text-align: right; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 108px; height: 108px; border-radius: 50%; position: relative; flex: none; display: grid; place-items: center; }
.donut::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--paper); }
.donut .d-val { position: relative; text-align: center; font-size: 19px; font-weight: 700; line-height: 1.1; }
.donut .d-val span { display: block; font-size: 9px; color: var(--muted); font-weight: 500; }
.donut-legend { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 7px; }
.donut-legend span { display: flex; align-items: center; gap: 6px; }
.donut-legend i { width: 8px; height: 8px; border-radius: var(--radius-xs); }
.donut-legend b { color: var(--ink-2); margin-left: auto; font-variant-numeric: tabular-nums; }

/* filters */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .input, .filter-bar .select { height: 34px; font-size: 12px; width: auto; min-width: 120px; border-radius: var(--radius); }
.filter-bar .spacer { flex: 1; }
.filter-bar .seg button { padding: 5px 12px; }

/* courses */
.course-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.course-tile { display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .2s; }
.course-tile:hover { border-color: var(--pencil); }
.course-tile .ct-cover { height: 104px; border-radius: 0; }
.course-tile .ct-cover .ca-body { padding: 12px 14px; }
.course-tile .ct-cover .ca-title { font-size: 15px; }
.course-tile .ct-body { padding: 13px 15px 14px; flex: 1; display: flex; flex-direction: column; }
.course-tile .ct-name { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.course-tile .ct-meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.course-tile .ct-stats { display: flex; gap: 18px; margin: 11px 0; }
.course-tile .ct-stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.course-tile .ct-stats span { font-size: 9.5px; color: var(--muted); }
.course-tile .ct-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }

/* course editor */
.editor-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; align-items: start; }
.editor-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.editor-tabs button { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.editor-tabs button.on { color: var(--pine); border-bottom-color: var(--pine); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.item-edit-list { display: flex; flex-direction: column; gap: 7px; }
.item-edit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; }
.item-edit-row .ier-main { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.item-edit-row .ier-note { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.item-edit-row .ier-note textarea { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-size: 11.5px; line-height: 1.6; padding: 8px 10px; resize: vertical; }
.item-edit-row .ier-note textarea:focus { outline: none; border-color: var(--pencil); }
.item-edit-row .ier-note-foot { display: flex; justify-content: space-between; gap: 10px; }
.item-edit-row .ier-note-btn { flex: none; height: 24px; padding: 0 9px; border-radius: var(--radius-sm); border: 1px dashed var(--line); font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.item-edit-row .ier-note-btn:hover { color: var(--pencil); border-color: var(--pencil); }
.item-edit-row .ier-note-btn.has { color: var(--pencil); border-style: solid; border-color: var(--pencil-soft); background: var(--pencil-soft); }
.item-edit-row .ier-note-btn .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pencil); }
.item-edit-row .ier-handle { color: var(--muted-2); cursor: grab; font-size: 12px; }
.item-edit-row .ier-idx { width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--bg-deep); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); flex: none; }
.item-edit-row input { flex: 1; border: 0; background: transparent; font-size: 12.5px; padding: 4px 2px; }
.item-edit-row input:focus { outline: none; }
.item-edit-row .ier-tag { width: 68px; }
.item-edit-row .ier-actions { display: flex; gap: 2px; }
.item-edit-row .ier-actions button { width: 24px; height: 24px; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.item-edit-row .ier-actions button:hover { background: #fff; color: var(--pencil); }
/* 「复制」只出现在最新那条任务上：宽度自适应放中文，颜色提亮一档，和 ↑↓✕ 区分开 */
.item-edit-row .ier-actions button.ier-dup { width: auto; padding: 0 8px; font-size: 10.5px; font-weight: 600; color: var(--pencil); background: var(--pencil-soft); border: 1px dashed var(--pencil-soft); }
.item-edit-row .ier-actions button.ier-dup:hover { background: #fff; border-style: solid; }
.evidence-config { display: flex; flex-direction: column; gap: 9px; }
.ev-config-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.ev-config-row .ec-name { width: 104px; font-size: 12px; font-weight: 600; flex: none; }
.ev-config-row .ec-opts { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; transition: opacity .18s; }
.tt-grid.is-off { opacity: .45; pointer-events: none; }
.tt-item { display: flex; flex-direction: column; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); transition: opacity .18s, background .18s, border-color .18s; }
.tt-item.is-off { opacity: .5; background: var(--bg-deep); }
.tt-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tt-item-label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.tt-item .input { background: #fff; }
.tt-item.is-off .input { background: var(--bg-deep); color: var(--muted); }
.radio-pill { display: inline-flex; gap: 2px; background: var(--bg-deep); border-radius: var(--radius-sm); padding: 2px; }
.radio-pill button { padding: 4px 10px; border-radius: var(--radius-sm); font-size: 10.5px; color: var(--muted); }
.radio-pill button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-xs); }
.radio-pill button.on.req { color: var(--rose); }
.ver-note { background: var(--sticker-soft); border: 1px solid #f0e3c0; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 11px; color: var(--sticker-deep); line-height: 1.6; }
.ver-list { display: flex; flex-direction: column; }
.ver-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.ver-row:last-child { border-bottom: 0; }
.ver-row .vr-no { width: 40px; font-weight: 700; color: var(--pencil); flex: none; }

/* package builder */
.pkg-courses { display: flex; flex-direction: column; gap: 7px; }
.pkg-course { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.pkg-course .pc-idx { width: 21px; height: 21px; border-radius: var(--radius-sm); background: var(--pencil-soft); color: var(--pencil); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.pkg-course .pc-name { flex: 1; font-size: 12px; font-weight: 600; }
.pkg-course .pc-meta { font-size: 10px; color: var(--muted); }

/* student */
.stu-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stu-head .sh-info { flex: 1; min-width: 200px; }
.stu-head h1 { font-size: 25px; }
.stu-head .sh-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.profile-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 20px 0 18px; overflow-x: auto; }
.profile-tabs button { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.profile-tabs button.on { color: var(--pine); border-bottom-color: var(--pine); }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.info-cell { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.info-cell .ic-label { font-size: 10px; color: var(--muted); }
.info-cell .ic-val { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.info-cell .ic-sub { font-size: 9.5px; color: var(--muted); }
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 90px 18px minmax(0,1fr); gap: 10px; font-size: 11.5px; }
.tl-time { color: var(--muted); text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.tl-dot { position: relative; display: flex; justify-content: center; }
.tl-dot::before { content: ""; position: absolute; top: 7px; bottom: -8px; width: 1px; background: var(--line); }
.tl-row:last-child .tl-dot::before { display: none; }
.tl-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--pencil); margin-top: 5px; z-index: 1; box-shadow: 0 0 0 3px #fff; }
.tl-body { padding-bottom: 14px; }
.tl-body .tb-title { font-weight: 600; }
.tl-body .tb-sub { color: var(--muted); font-size: 10.5px; margin-top: 1px; }

/* review drawer */
.review-detail-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.evidence-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.evidence-view .ev-img { aspect-ratio: 1.25; border-radius: var(--radius-sm); background: linear-gradient(140deg, #e2e8ef, #b6c2ce); display: grid; place-items: center; color: rgba(22,36,31,.4); font-size: 18px; }
.evidence-view .ev-img:nth-child(2) { background: linear-gradient(140deg, #f3ddd7, #d9a79b); }
.detail-block { margin-top: 14px; }
.detail-block .db-label { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; margin-bottom: 5px; }
.detail-block .db-text { font-size: 12.5px; line-height: 1.7; background: var(--paper-2); border-radius: var(--radius); padding: 10px 12px; border: 1px solid var(--line); }
.quick-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.quick-tags .tag { cursor: pointer; height: 24px; font-size: 10.5px; }
.quick-tags .tag:hover { background: var(--pencil-soft); color: var(--pencil); }
.tosquare-row { display: flex; align-items: flex-start; gap: 10px; background: var(--sticker-soft); border: 1px solid #f0e3c0; border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 12px; }
.tosquare-row.disabled { background: var(--bg-deep); border-color: var(--line); opacity: .75; }

/* progress board */
.progress-table .pbar-cell { min-width: 140px; }
.pbar { display: flex; align-items: center; gap: 7px; }
.pbar .bar { flex: 1; height: 6px; }
.pbar span { font-size: 10px; color: var(--muted); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.candidate-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.candidate-row:last-child { border-bottom: 0; }
.candidate-main { flex: 1; min-width: 0; }
.candidate-main .cm-name { font-size: 12px; font-weight: 600; }
.candidate-main .cm-sub { font-size: 10px; color: var(--muted); }
.candidate-reason { font-size: 9.5px; color: var(--mark-deep); background: var(--mark-soft); padding: 2px 6px; border-radius: var(--radius-xs); font-weight: 700; white-space: nowrap; }

/* stats */
.stat-kpi-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.export-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); font-size: 11.5px; }
.export-row .er-name { flex: 1; font-weight: 600; }
.export-row .er-meta { color: var(--muted); font-size: 10px; }

/* medals admin */
.medal-rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.medal-rule-row:last-child { border-bottom: 0; }
.medal-rule-row .medal { width: 40px; height: 40px; margin: 0; font-size: 16px; }
.medal-rule-row .mrr-main { flex: 1; min-width: 0; }
.medal-rule-row .mrr-name { font-size: 12px; font-weight: 600; }
.medal-rule-row .mrr-meta { font-size: 10px; color: var(--muted); }

/* library admin */
.lib-admin-toggle { display: flex; align-items: center; gap: 6px; }
.sync-log { display: flex; flex-direction: column; }
.sync-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 11px; }
.sync-row:last-child { border-bottom: 0; }
.sync-row .sr-time { color: var(--muted); width: 110px; flex: none; font-variant-numeric: tabular-nums; }
.sync-row .sr-ok { color: var(--pencil); font-weight: 700; }
.sync-row .sr-fail { color: var(--rose); font-weight: 600; }
.tax-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.tax-row:last-child { border-bottom: 0; }
.tax-row .tr-src { flex: 1; }
.tax-row .tr-arrow { color: var(--muted-2); }

/* platform */
.platform-hero { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--pencil); border-radius: var(--radius-lg); padding: 22px 24px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.platform-hero h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.platform-hero p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.platform-hero .ph-note { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px 11px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 20px; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--muted); }
.rank-name { flex: 1; font-weight: 600; }
.rank-bar { width: 120px; height: 6px; background: var(--bg-deep); border-radius: var(--radius-sm); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background-image: repeating-linear-gradient(90deg, var(--pencil) 0 5px, transparent 5px 8px); }
.rank-val { width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* responsive */
/* ------------------------------------------------------------
   书库：系列管理弹窗（书本简介 / 批量导入 Quiz）
   ------------------------------------------------------------ */
.modal-head-act { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lib-desc {
  margin: 4px 0 14px;
  padding: 11px 13px 10px;
  border: 1px solid var(--line);  border-radius: var(--radius);
  background: var(--paper-2);
}
.lib-desc-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.lib-desc-label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.lib-desc-act { display: flex; align-items: center; gap: 8px; }
.lib-desc .textarea { background: #fff; font-size: 13px; line-height: 1.65; resize: vertical; min-height: 62px; }
.lib-desc.lib-age { padding: 9px 13px; margin-bottom: 8px; }
.lib-desc.lib-age .lib-desc-head { margin-bottom: 6px; }
.lib-desc.lib-age .input { height: 32px; font-size: 13px; }

/* 图书封面：预览小图 + 上传进度 */
.cover-prev {
  width: 66px; height: 88px; flex: none;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: #fff; overflow: hidden; display: grid; place-items: center;
}
.cover-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-prev-fallback { font-family: var(--font-en); font-size: 22px; font-weight: 700; color: var(--muted); }
.cover-prev + .tiny.muted { flex: 1; }
.lib-cover .ut-prog { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.lib-cover .ut-prog i { width: 160px; max-width: 50%; height: 4px; border-radius: 999px; background: var(--pine); display: block; transition: width .2s; }

/* 分册表内联编辑：默认看起来像文本，悬停 / 聚焦才显形 */
.tbl .vol-title, .tbl .vol-words {
  height: 30px; font-size: 12.5px; padding: 0 8px; background: transparent;
  border-color: transparent; box-shadow: none;
}
.tbl .vol-title { min-width: 180px; }
.tbl .vol-words { width: 100px; text-align: right; }
.tbl tbody tr:hover .vol-title, .tbl tbody tr:hover .vol-words { background: #fff; border-color: var(--line); }
.tbl .vol-title:hover, .tbl .vol-words:hover { border-color: var(--line-strong); }
.tbl .vol-title:focus, .tbl .vol-words:focus {
  background: #fff; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(47, 138, 107, .12);
}

/* 系列行「删除」：平时低调，悬停才转红，避免误点 */
.lib-acts { flex-wrap: wrap; row-gap: 4px; }
.lib-acts .btn { padding: 0 8px; }
.btn-del { color: var(--muted-2); }
.btn-del:hover { color: var(--rose); background: var(--rose-soft); }
.btn-del svg { margin-right: 3px; vertical-align: -1px; }

/* 表尾「增加分册」：与上方表格同为一张卡片的延伸 */
.vol-add {
  margin-top: 12px; padding: 11px 13px 12px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper-2);
}
.vol-add-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.vol-add-row { display: flex; align-items: center; gap: 8px; }
.vol-add-row .input { height: 34px; font-size: 13px; background: #fff; }
.vol-add-row #newVolTitle { flex: 1 1 auto; min-width: 200px; }
.vol-add-row #newVolWords { flex: 0 0 130px; width: 130px; text-align: right; }
.vol-add-row .btn { flex: 0 0 auto; }

/* 系列管理弹窗头部：系列名 / 英文原名直接改，默认像文本，悬停聚焦才显形 */
.series-rename { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.series-rename .sn {
  font: inherit; color: inherit; width: 100%; max-width: 380px;
  background: transparent; border: 1px solid transparent; border-bottom: 1px dashed var(--line-strong);
  border-radius: var(--radius); padding: 0 6px; margin-left: -6px; min-width: 0;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.series-rename .sn-cn { font-size: 20px; font-weight: 700; line-height: 1.45; }
.series-rename .sn-en { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.5; max-width: 300px; }
.series-rename .sn::placeholder { color: var(--muted-2); font-weight: 400; }
.series-rename .sn:hover { background: #fff; border-color: var(--line-strong); border-bottom-style: solid; }
.series-rename .sn:focus {
  outline: none; background: #fff; border-color: var(--pencil);
  box-shadow: 0 0 0 3px rgba(47, 138, 107, .12);
}
.series-rename-sub { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.series-rename-sub .sn-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-left: 2px; }

.bulk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.bulk-grid .textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; }
.bulk-side { border-left: 1px solid var(--line); padding-left: 16px; min-width: 0; }
.bulk-side-title { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.bulk-fmt { margin: 7px 0 8px; padding-left: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.75; }
.bulk-fmt li { margin-bottom: 5px; }
.bulk-fmt b { color: var(--ink-2); font-weight: 600; }
.bulk-fmt code {
  display: inline-block; padding: 1px 4px; margin: 1px 0;
  border-radius: var(--radius-sm); background: var(--paper-2); border: 1px solid var(--line);
  font-size: 10.5px; color: var(--ink-2);
}
.bulk-preview {
  margin-top: 10px; padding: 10px 11px; min-height: 96px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper-2);
  max-height: 232px; overflow: auto;
}
.bulk-sum { font-size: 12.5px; font-weight: 600; }
.bulk-sum.ok { color: var(--pencil); }
.bulk-sum.warn { color: var(--sticker-deep); }
/* 「没连上服务端」这类提醒文字：后台改动只在本机时用得上 */
.warn-text { color: var(--warn); }
.bulk-sum.bad { color: var(--rose); }
.bulk-err { margin: 7px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--rose); line-height: 1.7; }
.bulk-list { margin-top: 9px; display: grid; gap: 7px; }
.bulk-item { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.bulk-item .sm { font-size: 12px; color: var(--ink-2); }

/* 书目导入：列映射 */
.imp-map { margin-top: 7px; display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.imp-map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 8px; align-items: center; }
.imp-map-col {
  font-size: 11.5px; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 4px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imp-map-row .select { padding: 0 6px; }

@media (max-width: 720px) {
  .bulk-grid { grid-template-columns: 1fr; }
  .bulk-side { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 12px; }
  .modal-head-act .btn { padding: 5px 9px; font-size: 11px; }
  .series-rename .sn { max-width: 100%; }
  .series-rename .sn-cn { font-size: 17px; }
}

/* 营期课程表：一个营期一张卡，课程按序排列，可增删 / 调序 */
.camp-course-card {
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.camp-course-card:last-child { border-bottom: none; }
.cc-list { display: flex; flex-direction: column; gap: 6px; }
.cc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cc-idx {
  flex: none; min-width: 48px;
  font-size: 11px; font-weight: 700; color: var(--pencil);
  background: var(--pencil-soft); border-radius: var(--radius-xs);
  padding: 3px 7px; text-align: center;
}
.cc-item .btn[disabled] { opacity: .38; cursor: not-allowed; }

/* 「选一门课加入」那一行：下拉要吃掉剩余宽度——
   原来写死 min-width:180px，课程名稍长就被截成「桥梁书精读 · 起…」，
   右边却空着一大片。现在 flex 撑满，按钮不够位置就整体换行。 */
.cc-add-row { align-items: stretch; }
.cc-add-select {
  flex: 1 1 260px;
  width: auto;
  min-width: 0;
  height: 34px;
  font-size: 12.5px;
}
.cc-add-btn {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}
@media (max-width: 720px) {
  /* 手机上按钮占满整行，指头更好点 */
  .cc-add-btn { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 720px) {
  .cc-item { flex-wrap: wrap; }
  .cc-item .grow { min-width: 140px; }
}

/* ============================================================
   宽屏逐级增强：手机是基准，这里只做加法
   ============================================================ */
@media (min-width: 640px) {
  .tt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .admin-view { padding: 20px 18px calc(52px + var(--safe-b)); }
  .admin-page-head { flex-direction: row; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
  .admin-page-head h1 { font-size: 24px; }
  .admin-page-head .aph-actions .btn { flex: none; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .a-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-kpi-row { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .kpi { padding: 17px 18px; }
  .kpi .k-val { font-size: 27px; }
  .side-link { padding: 10px 12px; }
}
@media (min-width: 900px) {
  .admin-top .at-search { display: block; }
  .login-wrap { grid-template-columns: 1.08fr .92fr; }
  .login-art { display: flex; }
  .login-panel { padding: 40px; min-height: 100vh; align-items: center; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .bulk-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}
@media (min-width: 1000px) {
  .admin-shell { grid-template-columns: 244px minmax(0, 1fr); }
  .side { position: sticky; transform: none; width: auto; max-width: none; box-shadow: none; }
  .side-mask { display: none !important; }
  .at-menu { display: none !important; }
  .admin-top { height: 62px; padding: 0 28px; gap: 18px; }
  .admin-view { padding: 24px 28px 60px; }
  .a-grid.two { grid-template-columns: 1.55fr .95fr; }
  .a-grid.three { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(5, 1fr); }
  .course-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .editor-layout { grid-template-columns: minmax(0,1fr) 320px; }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .tt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* 触摸屏：后台顶栏图标按钮也要够大 */
@media (pointer: coarse) {
  .admin-top .icon-btn { width: var(--tap); height: var(--tap); }
  .side-link { padding: 13px 12px; }
}

/* ==================== 资料录入 ==================== */
.res-cover {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  background: var(--pine-050, #eef6f1); border: 1px solid var(--line, #e6e2d8);
}

/* 搜索记录 / 内容缺口 */
.res-search-list { display: flex; flex-direction: column; gap: 8px; }
.res-search-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line, #e6e2d8); border-radius: 12px;
  background: #fff;
}
.res-search-row.is-zero { border-color: var(--rose-300, #f0c2bc); background: var(--rose-050, #fdf2f0); }
.res-search-row .rs-main { min-width: 0; flex: 1 1 auto; }
.res-search-row .rs-query { font-size: 13.5px; font-weight: 600; color: var(--ink, #2c2a25); }
.res-search-row.is-zero .rs-query { color: var(--rose-deep, #b25a52); }
.res-search-row .rs-meta { font-size: 11px; color: var(--muted, #8a8578); margin-top: 2px; }
.res-search-row .rs-tags { flex: 0 0 auto; }
@media (max-width: 560px) {
  .res-search-row { flex-wrap: wrap; }
  .res-search-row .rs-tags { order: 3; }
}

/* 分页控件（每页 100 条） */
.res-pager {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 12px 18px; border-top: 1px solid var(--line, #e6e2d8);
  background: var(--bg-soft, #faf9f5);
}
.res-pager .pg-info { margin-right: auto; font-size: 12px; color: var(--muted, #8a8578); }
.pg-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--line, #e6e2d8);
  background: #fff; color: var(--ink, #2c2a25); font-size: 13px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.pg-btn:hover:not(.disabled):not(.active) { border-color: var(--pine-400, #57a184); color: var(--pine-700, #0f5c48); }
.pg-btn.active { background: var(--pine-700, #0f5c48); border-color: var(--pine-700, #0f5c48); color: #fff; font-weight: 600; }
.pg-btn.disabled { opacity: .45; cursor: default; }
.pg-ell { padding: 0 2px; color: var(--muted, #8a8578); font-size: 13px; }
.pg-jump { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted, #8a8578); margin-left: 6px; }
.pg-input {
  width: 56px; height: 30px; padding: 0 6px; text-align: center;
  border-radius: 8px; border: 1px solid var(--line, #e6e2d8); background: #fff;
}
