/* classboard.css —— 电子班牌 · 评价数据看板（v89；v90 增七日趋势图）
 * 复用全站变量（--card/--line/--ink/--ink2/--ink3/--tint/--tint-ink/--tint-line/--gray-bg），
 * 语义色（覆盖率/名次/正负积分）另给 deepblue 深色主题覆盖，避免深底看不见。 */

/* ---------------- 顶部信息条 ---------------- */
.cb-topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; padding: 12px 16px;
}
.cb-scope { font-size: 13px; color: var(--ink2); line-height: 1.9; }
.cb-scope-line b { color: var(--ink); }
.cb-scope-2 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cb-datesel {
  font-size: 13px; color: var(--ink2); font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}

/* ---------------- 页签 ---------------- */
.cb-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cb-tab {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink2); font-size: 13.5px; font-weight: 800;
  cursor: pointer; font-family: inherit; transition: .15s;
}
.cb-tab:hover { border-color: var(--tint-line); color: var(--tint-ink); }
.cb-tab.active { background: var(--tint); border-color: var(--tint-line); color: var(--tint-ink); }

/* ---------------- 工具条 / 表格 ---------------- */
.cb-filters { flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cb-scroll { overflow-x: auto; }
.cb-tbl { min-width: 820px; }
.cb-tbl th { white-space: nowrap; }
.cb-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-c { text-align: center; }
.cb-empty { text-align: center; color: var(--ink3); padding: 26px 12px; }
.cb-dash { color: var(--ink3); }
.cb-pos { color: #12855f; font-weight: 700; }
.cb-neg { color: #cf4040; font-weight: 700; }

/* ---------------- 语义徽标 ---------------- */
.cb-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; white-space: nowrap; line-height: 1.7;
}
.cb-s-ok { background: #e6f8f0; color: #12855f; }
.cb-s-bad { background: #ffeef0; color: #cf4040; }
.cb-s-warn { background: #fff6e0; color: #b4761c; }
.cb-s-mid { background: #e8f0ff; color: #2b6cd4; }
.cb-s-mute { background: var(--gray-bg); color: var(--ink2); }
.cb-ok { color: #12855f; }
.cb-err { color: #cf4040; }
.cb-danger { color: #cf4040; border-color: #f0c4c4; }

/* 覆盖率：徽标 + 迷你条 */
.cb-cov { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cb-bar {
  display: inline-block; width: 64px; height: 6px; border-radius: 99px;
  background: var(--gray-bg); overflow: hidden; vertical-align: middle;
}
.cb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--tint-strong, #2b6cd4); }

/* 名次 */
.cb-rk {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px;
  font-weight: 800; font-size: 13px; background: var(--gray-bg); color: var(--ink2);
}
.cb-rk1 { background: linear-gradient(135deg, #ffd76e, #f0a500); color: #5a3d00; }
.cb-rk2 { background: linear-gradient(135deg, #e6ecf5, #b9c6d8); color: #33465e; }
.cb-rk3 { background: linear-gradient(135deg, #f3cfa8, #d79a5b); color: #5a3618; }

/* ---------------- 领奖台 ---------------- */
.cb-podium { display: flex; gap: 12px; align-items: flex-end; justify-content: center; flex-wrap: wrap; padding: 10px 0 4px; }
.cb-pod {
  flex: 1 1 170px; max-width: 240px; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 14px; text-align: center; background: var(--card);
}
.cb-pod-1 { order: 2; border-color: #f0c36b; box-shadow: 0 8px 24px rgba(240, 195, 107, .28); }
.cb-pod-2 { order: 1; }
.cb-pod-3 { order: 3; }
.cb-pod-medal { font-size: 26px; line-height: 1; }
.cb-pod-cls { font-size: 19px; font-weight: 900; color: var(--ink); margin-top: 6px; }
.cb-pod-grade { font-size: 12.5px; color: var(--ink3); margin-top: 2px; }
.cb-pod-cov { font-size: 22px; font-weight: 900; color: var(--tint-ink, #2b6cd4); margin-top: 8px; }
.cb-pod-sub { font-size: 12.5px; color: var(--ink2); margin-top: 4px; }

/* ---------------- 口径说明 / 空态 ---------------- */
.cb-notes { margin: 6px 0 0; padding-left: 20px; color: var(--ink2); font-size: 13px; line-height: 1.9; }
.cb-notes li { margin: 2px 0; }
.stat-sub { font-size: 12px; color: var(--ink3); margin-top: 2px; line-height: 1.5; }

.cb-empty-card { text-align: center; padding: 44px 20px; }
.cb-empty-ico { font-size: 44px; line-height: 1; }
.cb-empty-card h3 { margin: 10px 0 6px; color: var(--ink); }
.cb-empty-ops { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------------- 弹层 ---------------- */
.cb-mask {
  position: fixed; inset: 0; z-index: 9999; background: rgba(16, 26, 44, .48);
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 30px; overflow: auto;
}
/* ⚠️ 必须显式声明：display:flex 会压过 UA 的 [hidden]{display:none}，
 *    否则「未打开的弹层遮罩」始终铺满屏幕并拦截所有点击。 */
.cb-mask[hidden] { display: none !important; }
.cb-dialog {
  width: min(720px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(16, 30, 60, .22); overflow: hidden;
}
.cb-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.cb-dialog-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.cb-x {
  border: none; background: transparent; font-size: 17px; color: var(--ink3);
  cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 8px;
}
.cb-x:hover { background: var(--gray-bg); color: var(--ink); }
.cb-form { padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.cb-dialog-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
}
.cb-dialog .page-sub { display: block; }
.cb-dialog .cb-form > .page-sub, .cb-dialog .cb-form > .cb-scroll { grid-column: 1 / -1; }

/* ---------------- 深色主题（deepblue） ---------------- */
html[data-theme="deepblue"] .cb-s-ok { background: rgba(46, 204, 138, .16); color: #63e0ad; }
html[data-theme="deepblue"] .cb-s-bad { background: rgba(255, 108, 122, .16); color: #ff9aa5; }
html[data-theme="deepblue"] .cb-s-warn { background: rgba(255, 190, 80, .16); color: #ffc866; }
html[data-theme="deepblue"] .cb-s-mid { background: rgba(90, 160, 255, .18); color: #8dbaff; }
html[data-theme="deepblue"] .cb-ok { color: #63e0ad; }
html[data-theme="deepblue"] .cb-err { color: #ff9aa5; }
html[data-theme="deepblue"] .cb-pos { color: #63e0ad; }
html[data-theme="deepblue"] .cb-neg { color: #ff9aa5; }
html[data-theme="deepblue"] .cb-danger { color: #ff9aa5; border-color: rgba(255, 108, 122, .4); }
html[data-theme="deepblue"] .cb-pod-1 { border-color: rgba(240, 195, 107, .55); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }

/* ---------------- 最近七日加减分柱形图（v91，可点击看当日详情） ---------------- */
.cb-legend { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--ink2); font-weight: 700; }
.cb-legend .lg { display: inline-block; width: 20px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.cb-legend .lg-add { background: #17a56b; }
.cb-legend .lg-sub { background: #e05252; }

.cb-bars { margin-top: 2px; }
/* 顶部预留一条展示带：当日详情浮层在此内左右锚定，不会盖住柱子 */
.cb-bars-band { position: relative; height: 106px; }
.cb-bars-tip {
  position: absolute; top: 2px; transform: translateX(-50%);
  min-width: 216px; max-width: 100%;
  padding: 8px 13px 9px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--tint-line);
  box-shadow: 0 10px 26px rgba(16, 30, 60, .15);
  color: var(--ink2); font-size: 12.5px; line-height: 1.8; white-space: nowrap;
}
.cb-bars-tip:after {
  content: ''; position: absolute; left: 50%; bottom: -5.5px; width: 10px; height: 10px;
  transform: translateX(-50%) rotate(45deg); background: var(--card);
  border-right: 1px solid var(--tint-line); border-bottom: 1px solid var(--tint-line);
}
.cb-bars-tip-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.cb-bars-tip-head b { color: var(--ink); font-size: 13.5px; }
.cb-bars-tip-head span { color: var(--ink3); font-size: 12px; }
.cb-bars-tip-row b { color: var(--ink); }
.cb-bars-tip-row .lg { width: 14px; height: 3px; margin: 0 4px 0 10px; }
.cb-bars-tip-row:nth-child(2) .lg:first-child { margin-left: 0; }
.cb-bars-tip-sub { color: var(--ink3); }

.cb-bars-svg { width: 100%; height: auto; display: block; color: var(--ink2); }
.cb-bars-grid { stroke: currentColor; stroke-opacity: .14; stroke-width: 1; }
.cb-bars-axis { stroke: currentColor; stroke-opacity: .3; stroke-width: 1; }
.cb-bars-svg text { font-size: 11.5px; fill: currentColor; opacity: .76; }
.cb-bars-x.is-sel { opacity: 1; font-weight: 800; }
.cb-bars-val { font-size: 11px; font-weight: 700; opacity: .88; }
.cb-bars-val.is-sel { opacity: 1; font-weight: 800; }
.cb-bars-selbg { fill: var(--tint); opacity: .85; }
.cb-bars-bar {
  transform-box: fill-box; transform-origin: bottom center;
  animation: cbBarGrow .52s cubic-bezier(.22, .8, .25, 1) both;
}
.cb-bars-add { fill: url(#cbAddGrad); }
.cb-bars-sub { fill: url(#cbSubGrad); }
.cb-bars-bar.is-sel { filter: drop-shadow(0 4px 8px rgba(16, 30, 60, .22)); }
.cb-bars-hit { fill: transparent; cursor: pointer; }
.cb-bars-hit:hover { fill: rgba(43, 108, 212, .06); }
.cb-bars-hit:focus-visible { fill: rgba(43, 108, 212, .12); outline: none; }
.cb-bars-hint { margin: 4px 0 0; font-size: 12px; color: var(--ink3); text-align: center; }
@keyframes cbBarGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

html[data-theme="deepblue"] .cb-bars-add { fill: #4ade9d; }
html[data-theme="deepblue"] .cb-bars-sub { fill: #ff8a97; }
html[data-theme="deepblue"] .cb-bars-tip { box-shadow: 0 10px 26px rgba(0, 0, 0, .42); }
html[data-theme="deepblue"] .cb-bars-hit:hover { fill: rgba(120, 170, 255, .12); }

@media (prefers-reduced-motion: reduce) {
  .cb-bars-bar { animation: none; }
}

@media (max-width: 620px) {
  .cb-form { grid-template-columns: 1fr; }
  .cb-podium { align-items: stretch; }
  .cb-pod { max-width: none; }
}
