:root {
  --ink: #1f1f1f;
  --muted: #8c8c8c;
  --line: #f0f0f0;
  --bg: #f5f6f8;
  --card: #fff;
  --red: #c41a1a;
  --blue: #1677ff;
  --green: #389e0d;
  --green-soft: #f6ffed;
  --amber: #d48806;
  --sider: #001529;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
#app {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #fff;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 48px 56px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(165deg, #002140, #001529 60%);
  color: #fff;
}
.login-copy h2 { margin: 0 0 12px; font-size: 32px; font-weight: 600; line-height: 1.35; max-width: 460px; }
.login-copy p { margin: 0; max-width: 420px; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.7; }
.login-pane { display: grid; place-items: center; padding: 32px 24px; background: #fff; }
.login-card { width: min(360px, 100%); }
.login-card h1 { margin: 0; font-size: 24px; font-weight: 600; }
.login-card .sub { margin: 8px 0 24px; color: var(--muted); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand b { display: block; font-size: 16px; }
.brand span { display: block; margin-top: 2px; color: rgba(255,255,255,.55); font-size: 12px; }
.logo {
  width: 36px; height: 36px;
  display: grid; place-items: center; flex: none;
  color: #fff;
}
.logo svg { width: 32px; height: 32px; display: block; }

.field { margin-bottom: 16px; }
.field label, .form label { display: block; margin-bottom: 6px; color: #595959; font-size: 13px; }
.field input, .form input, .cell-input {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; color: var(--ink); font-size: 14px;
}
.field input { height: 40px; }
.field input:focus, .form input:focus, .toolbar input:focus, .toolbar select:focus, .cell-input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22,119,255,.15);
}
/* 登录页大按钮；工具栏/页头里的 .btn.primary 不能继承 width:100% */
.login-card .primary {
  width: 100%; height: 40px; border: 0; border-radius: 6px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 600;
}
.login-card .primary:disabled { opacity: .45; cursor: default; }

.admin { height: 100vh; display: grid; grid-template-columns: 216px 1fr; background: var(--bg); }
.sider {
  background: var(--sider); color: #fff;
  display: flex; flex-direction: column; min-height: 0;
}
.sider .brand { padding: 16px 16px 8px; position: relative; }
.nav-toggle, .nav-close, .nav-mask { display: none; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.menu { padding: 8px 8px 16px; overflow: auto; }
.menu-label {
  margin: 14px 12px 6px; color: rgba(255,255,255,.4);
  font-size: 12px;
}
.menu button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  text-align: left; border: 0; background: transparent;
  color: rgba(255,255,255,.78); border-radius: 6px;
  padding: 9px 12px; font-size: 14px;
}
.menu button svg { width: 16px; height: 16px; flex: none; }
.menu button.on { background: rgba(255,255,255,.12); color: #fff; }
.menu button:hover { color: #fff; }
.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.crumb { color: #595959; font-size: 14px; }
.top-user { display: flex; align-items: center; gap: 12px; color: #595959; font-size: 13px; }
.top-user button { border: 0; background: transparent; color: #595959; padding: 0; font-size: 13px; }
.top-user button:hover { color: var(--red); }
.main { flex: 1; overflow: auto; padding: 16px 20px 32px; }

.page-head, .page-title {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.page-head h1, .page-title h1 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head p, .page-title p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.kicker { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.head-tags, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 12px;
}
.toolbar-filters, .toolbar-side {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0;
}
.toolbar-side { margin-left: auto; }
.toolbar input {
  width: 220px; max-width: 100%; flex: none; height: 32px; padding: 0 12px;
  border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; color: var(--ink); font-size: 13px;
}
.toolbar input[type="date"] { width: 150px; }
.toolbar select {
  width: 140px; flex: none; height: 32px; padding: 0 28px 0 10px;
  border: 1px solid #d9d9d9; border-radius: 6px; background: #fff;
  color: var(--ink); font-size: 13px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; width: auto !important; flex: none;
  box-sizing: border-box;
  background: #fff; color: var(--ink); border: 1px solid #d9d9d9;
  border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.btn.primary { background: var(--red); color: #fff; border-color: var(--red); font-weight: 600; }
.btn.danger { background: #fff; color: var(--red); border-color: #ffccc7; }
.btn.danger:hover { background: #fff1f0; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: default; color: #bfbfbf; background: #f5f5f5; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 12px; }
.mini-grid > div, .kpi, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.mini-grid > div { padding: 14px 16px; }
.mini-grid b { display: block; font-size: 22px; font-weight: 600; }
.mini-grid span, .kpi > span { color: var(--muted); font-size: 13px; }
.kpi { padding: 16px 16px 14px; }
.kpi b { display: block; margin-top: 8px; font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi b em { font-style: normal; color: #bfbfbf; font-size: 16px; font-weight: 500; }
.kpi .foot { margin-top: 10px; color: #8c8c8c; font-size: 12px; line-height: 1.5; }
.meter { height: 6px; margin-top: 12px; border-radius: 99px; background: #f5f5f5; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--red); border-radius: 99px; }

.panel { padding: 16px; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head span, .panel-note { color: var(--muted); font-size: 12px; }
.panel-note { margin: -6px 0 12px; }
.split { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 12px; }
.split .panel { margin-bottom: 0; }
.split + .split, .split + .panel, .mini-grid + .split { margin-top: 12px; }

.bars { height: 196px; display: flex; align-items: flex-end; gap: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bar-val { height: 18px; color: #595959; font-size: 12px; }
.bar-track { flex: 1; width: 100%; max-width: 28px; background: #fafafa; border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; }
.bar-track i { display: block; width: 100%; background: #ff7875; border-radius: 4px 4px 0 0; }
.bar-col.today .bar-track i { background: var(--red); }
.bar-col.future .bar-track { background: repeating-linear-gradient(135deg, #fafafa, #fafafa 4px, #f0f0f0 4px, #f0f0f0 8px); }
.bar-label { margin-top: 6px; color: #8c8c8c; font-size: 12px; }
.bar-col.today .bar-label { color: var(--red); font-weight: 600; }
.axis { display: flex; justify-content: space-between; margin-top: 4px; color: #bfbfbf; font-size: 12px; }

.lesson { padding: 12px 0 4px; }
.lesson b { display: block; font-size: 16px; }
.lesson span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.facts { margin: 8px 0 0; }
.facts div { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.unit-row { padding: 8px 0; }
.unit-name { display: flex; justify-content: space-between; font-size: 13px; }
.unit-name span { color: var(--muted); }
.unit-bar { height: 6px; margin-top: 6px; border-radius: 99px; background: #f5f5f5; overflow: hidden; }
.unit-bar i { display: block; height: 100%; background: #4096ff; border-radius: 99px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  position: sticky; top: 0; text-align: left; color: #8c8c8c; font-weight: 500;
  padding: 10px 12px; background: #fafafa; border-bottom: 1px solid var(--line);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
table.data tbody tr:hover td { background: #fafafa; }
table.data tr.off td { color: #bfbfbf; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 0 8px; height: 22px; line-height: 22px; border-radius: 4px; font-size: 12px; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: #fffbe6; color: var(--amber); }
.tag.bad { background: #fff1f0; color: var(--red); }
.tiers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tiers span { background: #fafafa; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; font-size: 12px; color: #595959; }
.form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; }
.form.one, .form.form-stack { grid-template-columns: minmax(0, 1fr); }
.form > * { min-width: 0; max-width: 100%; }
.account-panel { max-width: 560px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.form-actions .btn { min-width: 120px; }
.cell-input.short { width: 88px; }
.date-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
}
.date-wrap input[type="date"],
.form input,
.form input[type="date"],
.form input[type="number"],
.form input[type="text"],
input[type="date"],
input[type="number"].cell-input,
input[type="date"].cell-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
/* 中文 locale 下原生日期控件文案过长，强制收窄展示避免撑破/叠层 */
input[type="date"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
  width: 100%;
}
.video-panel { overflow: hidden; max-width: 100%; }
.video-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; font-size: 13px; color: #595959; flex-wrap: wrap;
}
.video-actions {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.video-actions .btn { flex: 1 1 140px; min-width: 0; }
.video-list { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.video-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: 100%;
  overflow: hidden;
}
.video-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.video-summary-main { min-width: 0; flex: 1; }
.video-day-cell { display: block; font-size: 15px; font-weight: 600; color: #262626; }
.video-summary-meta {
  display: block; margin-top: 4px; color: var(--muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-summary-side {
  display: flex; align-items: center; gap: 8px; flex: none;
}
.video-chev {
  width: 8px; height: 8px;
  border-right: 2px solid #bfbfbf;
  border-bottom: 2px solid #bfbfbf;
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.video-card.open .video-chev { transform: rotate(45deg); }
.video-editor {
  display: none;
  padding: 0 14px 14px;
  border-top: 1px solid #f0f0f0;
}
.video-card.open .video-editor { display: block; padding-top: 12px; }
.video-fields {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 110px) minmax(0, 1.2fr) minmax(0, 2fr);
  gap: 12px 14px;
  align-items: end;
}
.video-field {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0;
}
.video-field > span:first-child { color: var(--muted); font-size: 12px; line-height: 1.2; }
.video-field .cell-input,
.video-field input.cell-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.video-field-url { grid-column: 1 / -1; }
.video-url-row {
  display: flex; gap: 8px; align-items: center; min-width: 0; width: 100%;
}
.video-url-row .v-url {
  flex: 1 1 auto; min-width: 0; width: auto; max-width: 100%;
}
.video-editor-foot { margin-top: 12px; text-align: right; }
.upload-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 12px; margin: 0; cursor: pointer;
  white-space: nowrap; font-weight: 500; flex: 0 0 auto;
}
.upload-btn.disabled { opacity: .55; pointer-events: none; }
.upload-progress { margin-top: 8px; }
.upload-bar {
  height: 4px; border-radius: 99px; background: #f0f0f0; overflow: hidden;
}
.upload-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #1677ff, #69b1ff);
  border-radius: 99px; transition: width .2s ease;
}
.upload-progress-text { margin-top: 4px; color: #595959; font-size: 12px; }
@media (min-width: 801px) {
  .video-chev { display: none; }
  .video-summary { cursor: default; }
  .video-editor { display: block !important; padding-top: 0; border-top: 0; }
  .video-summary { padding-bottom: 8px; }
  .video-summary-meta { white-space: normal; }
}
.empty { text-align: center; color: var(--muted); padding: 28px 8px; font-size: 13px; }
.table-wrap { overflow: auto; }
.table-wrap.short { max-height: 320px; }
.pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; color: var(--muted); font-size: 13px;
}
.pager > div { display: flex; gap: 8px; }
.switch { width: 44px; height: 22px; border: 0; border-radius: 99px; background: #d9d9d9; position: relative; padding: 0; }
.switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.switch.on { background: var(--green); }
.switch.on i { left: 24px; }
.switch-label { font-size: 13px; color: #595959; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.atoast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; z-index: 1000;
}

.tag.muted { background: #f5f5f5; color: #8c8c8c; }
.muted { color: var(--muted); }
.link-btn {
  border: 0; background: transparent; padding: 0; color: var(--blue);
  font-size: 13px; cursor: pointer; text-decoration: none;
}
.link-btn:hover { color: #4096ff; }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { color: #e04040; }
td.ops { white-space: nowrap; }
td.ops .link-btn + .link-btn { margin-left: 14px; }
td.wrap { max-width: 320px; white-space: normal; line-height: 1.5; }
.cell-note { margin-top: 4px; color: var(--muted); font-size: 12px; max-width: 220px; white-space: normal; }
.btn.current { border-color: var(--red); color: var(--red); background: #fff; }
.btn.danger-solid { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn.danger-solid:hover { background: #a01616; }
.mini-grid.three { grid-template-columns: repeat(3, 1fr); }

.alert {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 9px 14px; border-radius: 6px; font-size: 13px;
}
.alert.warn { background: #fffbe6; border: 1px solid #ffe58f; color: #874d00; }
.alert.info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }

.form-title { margin: 6px 0 12px; font-size: 14px; font-weight: 600; }
.form-title:not(:first-child) { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.form.three, .panel .form:not(.one):not(.form-stack) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.form em, .field em { color: var(--red); font-style: normal; }
.login-tip { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 16px 32px; overflow: auto;
  background: rgba(0, 0, 0, .45);
}
.modal {
  width: 440px; max-width: 100%; background: #fff; border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
}
.modal.wide { width: 920px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-x { width: 28px; height: 28px; border: 0; background: transparent; color: #8c8c8c; border-radius: 4px; padding: 4px; }
.modal-x:hover { background: #f5f5f5; color: var(--ink); }
.modal-x svg { width: 18px; height: 18px; }
.modal-body { padding: 8px 20px 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 20px 16px; }
.modal-text { margin: 0 0 12px; color: #434343; font-size: 14px; line-height: 1.7; }
.modal-text.muted { color: var(--muted); font-size: 12px; margin-top: 12px; }
.modal textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 6px;
  font: inherit; font-size: 13px; resize: vertical; outline: none;
}
.modal textarea:focus { border-color: var(--blue); }
.modal .field label { display: block; margin-bottom: 6px; font-size: 13px; color: #595959; }

.detail-head { display: flex; align-items: center; gap: 16px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.detail-avatar {
  width: 48px; height: 48px; flex: none; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.detail-main { flex: 1; min-width: 0; }
.detail-main b { font-size: 16px; margin-right: 6px; }
.detail-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.detail-main span.tag { display: inline-block; margin-top: 0; }
.detail-main .detail-reason { color: var(--amber); }
.detail-stat { min-width: 96px; text-align: right; }
.detail-stat b { display: block; font-size: 20px; font-weight: 600; }
.detail-stat span { color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; gap: 8px; padding: 12px 0 4px; }
.detail-title { margin: 16px 0 8px; font-size: 14px; font-weight: 600; }
.detail-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table.data.compact td, table.data.compact th { padding: 8px 10px; }
.empty.small { padding: 16px 8px; }
@media (max-width: 1100px) {
  .kpi-grid, .mini-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .split .panel { margin-bottom: 12px; }
  .form:not(.one):not(.form-stack) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 180px; padding: 20px 20px 28px; }
  .login-copy h2 { font-size: 24px; max-width: none; }
  .login-copy p { font-size: 14px; }
  .login-pane { padding: 24px 16px 40px; align-content: start; }
  .admin {
    grid-template-columns: 1fr;
    height: 100vh;
    height: 100dvh;
    position: relative;
  }
  .nav-toggle, .nav-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: inherit;
  }
  .nav-toggle { color: #434343; }
  .nav-toggle:hover, .nav-close:hover { background: rgba(0,0,0,.06); }
  .nav-close {
    position: absolute; right: 8px; top: 12px; color: rgba(255,255,255,.78);
  }
  .nav-close:hover { background: rgba(255,255,255,.12); color: #fff; }
  .nav-toggle svg, .nav-close svg { width: 20px; height: 20px; }
  .nav-mask {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(0,0,0,.45); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .sider {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(280px, 86vw);
    z-index: 50; height: 100%; height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: none;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sider { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.28); }
  body.nav-open .nav-mask { opacity: 1; pointer-events: auto; }
  .workspace { min-width: 0; min-height: 0; height: 100%; }
  .topbar { padding: 0 12px; height: 52px; gap: 8px; }
  .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb-root { display: none; }
  .top-user { gap: 8px; flex: none; }
  .top-user .last-login { display: none; }
  .main {
    padding: 12px 12px 28px;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: auto;
  }
  .page-head, .page-title {
    flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px;
    max-width: 100%;
    min-width: 0;
  }
  .page-title > div, .page-head > div { min-width: 0; max-width: 100%; }
  .page-head h1, .page-title h1 { font-size: 18px; }
  .page-head p, .page-title p { word-break: break-word; overflow-wrap: anywhere; }
  .actions {
    width: 100%;
    max-width: 100%;
    display: flex;
    gap: 8px;
    box-sizing: border-box;
  }
  .actions .btn,
  .head-tags .btn {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    min-height: 36px;
    padding: 8px 10px;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
  }
  /* 表单一律纵向排列，避免双列被日期控件撑破叠在一起 */
  .form,
  .form.one,
  .form.form-stack,
  .form.three,
  .panel .form,
  .panel .form:not(.one),
  .detail-split {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: none !important;
  }
  .form > *,
  .panel .form > * {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .form label,
  .form small {
    display: block;
    max-width: 100%;
  }
  .form input,
  .form select,
  .form textarea,
  .date-wrap,
  .date-wrap input,
  .form input[type="date"],
  .date-wrap input[type="date"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .form input[type="date"],
  .date-wrap input[type="date"],
  .video-card input[type="date"] {
    font-size: 16px !important;
    line-height: 1.25 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .toolbar { gap: 10px; }
  .toolbar-filters, .toolbar-side { width: 100%; margin-left: 0; }
  .toolbar input, .toolbar select { width: 100%; flex: 1 1 100%; max-width: 100%; }
  .toolbar input[type="date"] { width: 100%; flex: 1 1 100%; }
  .toolbar-side { justify-content: space-between; }
  .toolbar .btn {
    height: auto; min-height: 36px; padding: 8px 12px;
    white-space: normal; line-height: 1.35;
  }
  .kpi-grid, .mini-grid, .mini-grid.three, .grid-4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 22px; word-break: break-word; overflow-wrap: anywhere; }
  .kpi .foot { overflow-wrap: anywhere; }
  .mini-grid > div { padding: 12px; min-width: 0; }
  .mini-grid b { font-size: 18px; word-break: break-word; }
  /* 两栏改单列，块与块之间留足间距，避免重叠 */
  .split {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
  }
  .split .panel { margin: 0; width: 100%; }
  .panel {
    padding: 12px;
    max-width: 100%;
    position: relative;
    z-index: 0;
    overflow: visible;
    isolation: isolate;
  }
  .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .panel-head h2 { flex: 1 1 auto; min-width: 0; word-break: break-word; }
  .panel-head .btn {
    flex: 0 0 auto;
    height: auto;
    min-height: 32px;
    padding: 6px 12px;
    white-space: normal;
  }
  .form-actions { justify-content: stretch; }
  .form-actions .btn {
    width: 100%; min-width: 0; height: auto; min-height: 40px;
    white-space: normal; padding: 10px 12px;
  }
  /* 关键：短表格限高 + overflow:visible 会叠到下一块；移动端取消限高 */
  .table-wrap,
  .table-wrap.short {
    margin: 0;
    max-width: 100%;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }
  table.data {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
  }
  table.data thead { display: none !important; }
  table.data th {
    position: static !important;
  }
  table.data tbody {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  table.data tbody tr {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    position: relative;
    float: none !important;
    clear: both;
  }
  table.data tbody tr:hover td { background: transparent; }
  table.data td {
    display: block !important;
    width: 100% !important;
    float: none !important;
    clear: both;
    position: static !important;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #f5f5f5;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left !important;
    vertical-align: top;
  }
  table.data td:last-child { border-bottom: 0; padding-bottom: 0; }
  table.data td:first-child { padding-top: 0; }
  table.data td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
  }
  table.data td:not([data-label])::before,
  table.data td[data-label=""]::before { display: none; }
  table.data td.num { text-align: left !important; }
  table.data td.ops {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  table.data td.ops .link-btn {
    display: block;
    margin: 0 !important;
    padding: 8px 0;
    text-align: left;
    white-space: normal;
    word-break: break-word;
  }
  table.data td.wrap,
  .cell-note { max-width: none; }
  .tag { white-space: normal; height: auto; line-height: 1.4; padding: 2px 8px; }
  .unit-row { padding: 10px 0; }
  .unit-name { gap: 8px; }
  .unit-name b { min-width: 0; word-break: break-word; }
  .pager {
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .pager > div { flex-wrap: wrap; justify-content: center; }
  .pager .btn {
    height: auto; min-height: 32px; padding: 6px 10px; white-space: normal;
  }
  /* 柱状图改成纵向列表，天数多也不会被挤掉 */
  .bars {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 10px;
    overflow: visible;
    width: 100%;
  }
  .bar-col {
    flex: none;
    flex-direction: row;
    align-items: center;
    height: auto;
    gap: 8px;
    width: 100%;
  }
  .bar-label {
    order: 0;
    margin: 0;
    flex: 0 0 52px;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
  }
  .bar-track {
    order: 1;
    flex: 1 1 auto;
    height: 10px;
    max-width: none;
    width: auto;
    min-width: 0;
    border-radius: 99px;
    align-items: stretch;
    background: #f0f0f0;
  }
  .bar-col.future .bar-track {
    background: repeating-linear-gradient(135deg, #fafafa, #fafafa 4px, #f0f0f0 4px, #f0f0f0 8px);
  }
  .bar-track i {
    display: block;
    height: 100% !important;
    width: var(--bar-w, 0%) !important;
    border-radius: 99px;
    min-width: 0;
  }
  .bar-val {
    order: 2;
    flex: 0 0 36px;
    height: auto;
    font-size: 12px;
    text-align: right;
  }
  .axis { display: none; }
  .alert { flex-wrap: wrap; padding: 10px 12px; overflow-wrap: anywhere; }
  .modal-mask { padding: 16px 12px; align-items: center; }
  .modal, .modal.wide {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 32px);
    overflow-x: clip;
    overflow-y: auto;
  }
  .detail-head { flex-wrap: wrap; }
  .detail-main span { overflow-wrap: anywhere; word-break: break-word; }
  .detail-stat { text-align: left; min-width: 0; width: 100%; display: flex; gap: 16px; flex-wrap: wrap; }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions .btn {
    flex: 1 1 100%;
    height: auto; min-height: 36px; padding: 8px 12px;
    white-space: normal; line-height: 1.35;
  }
  .video-panel { padding: 12px; overflow: hidden; width: 100%; max-width: 100%; box-sizing: border-box; }
  .video-toolbar {
    flex-direction: column; align-items: flex-start; gap: 4px;
  }
  .video-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
  }
  .video-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    min-height: 40px;
    padding: 10px 8px;
  }
  .video-list { gap: 8px; width: 100%; }
  .video-card { width: 100%; max-width: 100%; box-sizing: border-box; }
  .video-summary { padding: 12px; width: 100%; box-sizing: border-box; }
  .video-editor { padding: 0 12px 12px; width: 100%; box-sizing: border-box; }
  /* 视频编辑区也强制单列，日期不再和秒数并排 */
  .video-fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    grid-template-columns: none !important;
  }
  .video-field,
  .video-field-title,
  .video-field-sec,
  .video-field-url {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: auto !important;
    box-sizing: border-box;
  }
  .video-url-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .video-url-row .v-url,
  .video-url-row .upload-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .video-url-row .upload-btn {
    height: 40px;
    justify-content: center;
  }
  .video-editor-foot { text-align: left; }
  .video-card input,
  .video-card .cell-input,
  .video-card .date-wrap,
  .video-card input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .video-editor,
  .video-fields,
  .date-wrap {
    overflow: visible;
  }
  .atoast { left: 12px; right: 12px; bottom: 16px; transform: none; text-align: center; }
  .tiers { gap: 6px; }
  .tiers span { max-width: 100%; word-break: break-word; white-space: normal; }
  .facts div { grid-template-columns: 64px 1fr; }
  .facts dd { overflow-wrap: anywhere; word-break: break-word; }
}
@media (max-width: 480px) {
  .kpi-grid, .mini-grid, .mini-grid.three, .grid-4 { grid-template-columns: 1fr; }
  .login-brand { min-height: 150px; }
  .user-name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
