/* 版式：像电视台的节目编排表。看板顶部是概况条，先列要处理的剧，再列这周播出和已追平的剧。 */
:root {
  --bg: #eef1f4; --surface: #ffffff; --sunk: #e4e8ed; --ink: #142029; --muted: #5d6b78; --line: #d5dce3;
  --accent: #2f5bd3; --accent-ink: #ffffff; --onair: #d9822b;
  --have: #3a9a5b; --miss: #d6453d; --unaired: #c9d1d9; --extra: #8a63d2; --skipped: #e4e8ed;
  --ok-bg: #e3f3e8; --warn-bg: #fbeedd; --bad-bg: #fbe4e2; --info-bg: #e3eafb;
  --shadow: rgba(20, 32, 41, .12);
  --f-display: "ZCOOL QingKe HuangYou", -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --f-body: -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --f-num: "Saira Condensed", -apple-system, "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141a; --surface: #161f28; --sunk: #1d2833; --ink: #e3e9ef; --muted: #8d9aa7; --line: #263340;
    --accent: #6d92ff; --accent-ink: #0b1220; --onair: #f0a14f;
    --have: #4cb873; --miss: #ef6b62; --unaired: #33414e; --extra: #a687ea; --skipped: #1d2833;
    --ok-bg: #16301f; --warn-bg: #352512; --bad-bg: #3a1a18; --info-bg: #19254a;
    --shadow: rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-body); }
.wrap { max-width: 1760px; margin: 0 auto; padding-inline: clamp(16px, 2.5vw, 40px); }
main.wrap { padding-block: 0 48px; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.muted { color: var(--muted); }
a { color: var(--accent); }

button, .btnlink { font: 500 14px var(--f-body); border-radius: 7px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--miss); }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 10px; max-width: 100%; }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 10px 24px; padding-block: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font: 26px/1 var(--f-display); letter-spacing: .04em; }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--onair);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--onair) 25%, transparent); }
.lamp.off { background: var(--unaired); box-shadow: none; }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; cursor: pointer; }
nav a.on { color: var(--ink); background: var(--sunk); }
.who { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.banner { margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--bad-bg); color: var(--miss); cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10; background: var(--ink); color: var(--bg);
  padding: 8px 16px; border-radius: 8px; box-shadow: 0 4px 16px var(--shadow); }
.readonly { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* 概况条 */
.strip { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr) auto; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.strip > div { background: var(--surface); padding: 12px 16px; min-width: 0; }
.strip .k { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.strip .v { font: 600 26px/1.15 var(--f-num); }
.strip .v small { font: 400 13px var(--f-body); color: var(--muted); margin-left: 4px; }
.strip .v.miss { color: var(--miss); }
.strip .next .v { font: 500 18px/1.4 var(--f-body); }
.strip .act { display: flex; align-items: center; }
.checks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.chk { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); }
.chk i { width: 7px; height: 7px; border-radius: 50%; background: var(--have); }
.chk.bad { border-color: var(--miss); color: var(--miss); } .chk.bad i { background: var(--miss); }

h2 { font-size: 15px; font-weight: 700; margin: 28px 0 10px; display: flex; gap: 10px; align-items: baseline; }
h2 span { font-weight: 400; color: var(--muted); font-size: 13px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 18px; color: var(--muted); }

/* 海报 */
.poster { width: 44px; aspect-ratio: 2 / 3; border-radius: 4px; display: grid; place-items: center; color: #fff;
  font: 16px var(--f-body); font-weight: 700; max-width: 100%; overflow: hidden; flex: 0 0 auto; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster.big { width: 84px; font-size: 28px; border-radius: 6px; }
.poster.small { width: 30px; font-size: 12px; }

/* 节目行 */
.list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1.3fr) minmax(0, 2fr) 120px 110px; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.row.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; border-radius: 10px 10px 0 0; }
.t { min-width: 0; }
.t b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t span { color: var(--muted); font-size: 13px; }
/* 右对齐：放不下时从左边（较早的集）裁掉，最新几集和缺集说明总在 */
.ticks { display: flex; gap: 2px; align-items: center; justify-content: flex-end; min-width: 0; overflow: hidden; }
.ticks i { flex: 0 0 auto; width: 6px; height: 18px; border-radius: 2px; background: var(--have); }
.ticks i.missing { background: var(--miss); height: 22px; }
.ticks i.unaired { background: var(--unaired); }
.ticks i.skipped { background: var(--skipped); border: 1px solid var(--line); }
.ticks em { font-style: normal; font: 600 14px var(--f-num); color: var(--muted); margin-left: 8px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; max-width: 75%; }
.ticks em.err { color: var(--miss); font-family: var(--f-body); font-weight: 400; font-size: 13px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
  background: var(--sunk); color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--have); }
.chip.warn { background: var(--warn-bg); color: var(--onair); }
.chip.bad { background: var(--bad-bg); color: var(--miss); }
.chip.info { background: var(--info-bg); color: var(--accent); }
.when { font-size: 13px; color: var(--muted); text-align: right; }
.when b { display: block; color: var(--ink); font: 600 16px var(--f-num); }

/* 展开的详情 */
.detail { background: var(--surface); border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 10px 10px; margin-top: -8px;
  padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 24px; grid-column: 1 / -1; }
.done .detail { margin-top: 0; border-top: 1px solid var(--accent); border-radius: 10px; }
.detail h3 { margin: 0 0 10px; font-size: 14px; }
.detail .full { grid-column: 1 / -1; }
.facts { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 500; }
.facts .err { color: var(--miss); }
.season { margin-bottom: 12px; }
.season .lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cells { display: flex; flex-wrap: wrap; gap: 3px; }
.cells span { width: 30px; height: 24px; border-radius: 4px; display: grid; place-items: center; font: 600 12px var(--f-num);
  background: var(--have); color: #fff; }
.cells span.missing { background: var(--miss); }
.cells span.unaired { background: var(--unaired); color: var(--muted); }
.cells span.skipped { background: var(--skipped); color: var(--muted); border: 1px solid var(--line); }
.cells span.extra { background: var(--extra); }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.cand { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.cand + .cand { margin-top: 8px; }
.cand.pick { border-color: var(--accent); background: var(--info-bg); }
.cand .h { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.cand .h b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cand .meta { font-size: 13px; color: var(--muted); display: flex; gap: 2px 14px; flex-wrap: wrap; }
.cand .why { font-size: 13px; }
details.rej summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px; }
details.rej ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
details.rej li span { color: var(--miss); }
.subform { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: end; font-size: 13px; color: var(--muted); }
.subform label { display: grid; gap: 2px; }
.subform label.inline { display: flex; gap: 6px; align-items: center; color: var(--ink); font-size: 14px; }
.subform .numin { width: 90px; }
.evmini { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.evmini time { color: var(--muted); margin-right: 8px; }

/* 这周播出 */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.day { background: var(--surface); padding: 10px; min-height: 100px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day .d { font: 600 13px var(--f-num); color: var(--muted); letter-spacing: .04em; }
.day.today { background: var(--info-bg); }
.day.today .d { color: var(--accent); }
.ep { font-size: 13px; line-height: 1.35; border-left: 3px solid var(--accent); padding-left: 6px; min-width: 0; }
.ep.have { border-color: var(--have); } .ep.missing { border-color: var(--miss); }
.ep span { display: block; color: var(--muted); font: 500 12px var(--f-num); }

/* 已追平 */
.done { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mini { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; min-width: 0; cursor: pointer; }
.mini:hover, .mini.open { border-color: var(--accent); }
.mini.paused { opacity: .6; }
.mini div { min-width: 0; }
.mini b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini span { font: 500 13px var(--f-num); color: var(--muted); }

/* 其他页面 */
.pagehead { margin: 22px 0 14px; }
.pagehead h1 { font-size: 22px; margin: 0; }
.pagehead p { margin: 2px 0 0; color: var(--muted); }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; }
.searchbar input { flex: 1 1 220px; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--sunk); }
.seg button { border: 0; background: transparent; padding: 5px 12px; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 2px var(--shadow); }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 14px; }
.res { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.rb { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.rb b { font-size: 16px; } .rb > span:not(.chip) { color: var(--muted); font-size: 13px; }
.note { margin-top: 18px; background: var(--sunk); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; justify-items: start; }
.note p { margin: 0; color: var(--muted); font-size: 14px; }

.calhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.calhead b { font-size: 20px; }
.calhead .legend { margin: 0 0 0 auto; }
.calhead button { padding: 4px 12px; font-size: 18px; line-height: 1; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wd { background: var(--sunk); text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }
.dc { background: var(--surface); min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dc .n { font: 600 14px var(--f-num); color: var(--muted); }
.dc.off { background: var(--bg); } .dc.off .n { opacity: .5; }
.dc.today { box-shadow: inset 0 0 0 2px var(--accent); } .dc.today .n { color: var(--accent); }
.dc i { font-style: normal; font-size: 12px; line-height: 1.3; padding: 2px 5px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--info-bg); color: var(--accent); }
.dc i.have { background: var(--ok-bg); color: var(--have); }
.dc i.missing { background: var(--bad-bg); color: var(--miss); }
.dc i.skipped { background: var(--sunk); color: var(--muted); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { border-radius: 999px; padding: 4px 14px; }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.log { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.day-h { background: var(--sunk); font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 16px; }
.ev { display: grid; grid-template-columns: 52px 64px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 10px 16px; border-top: 1px solid var(--line); }
.day-h + .ev { border-top: 0; }
.ev time { font-size: 15px; color: var(--muted); }
.ev .chip { justify-self: start; }
.ev p { margin: 0; overflow-wrap: anywhere; }

.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  display: grid; gap: 10px; align-content: start; justify-items: start; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel h3 { margin: 0; font-size: 15px; }
.panel p { margin: 0; color: var(--muted); font-size: 13px; }
.field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; font-size: 14px; }
.field > span:first-child { color: var(--muted); }
.field select, .field input:not([type=checkbox]) { width: min(260px, 100%); }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; position: relative; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 36px; height: 20px; border-radius: 999px; background: var(--unaired); position: relative; flex: 0 0 36px; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.switch input:checked + i { background: var(--accent); } .switch input:checked + i::after { left: 18px; }
.switch input:disabled + i { opacity: .5; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px 16px; width: 100%; }
.checklist li { display: flex; gap: 8px; align-items: baseline; font-size: 14px; min-width: 0; white-space: nowrap; }
.checklist i { width: 8px; height: 8px; border-radius: 50%; background: var(--have); flex: 0 0 8px; transform: translateY(-1px); }
.checklist li.bad i { background: var(--miss); } .checklist li.bad span { color: var(--miss); }
.checklist span { color: var(--muted); font-size: 13px; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.login { min-height: 100%; display: grid; place-items: center; padding-inline: 16px; padding-block: 10vh; }
.login form { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 24px; display: grid; gap: 14px; }
.login .brand b { font-size: 34px; }
.login p { margin: 0; color: var(--muted); }
.login label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.login .error { color: var(--miss); }

@media (max-width: 820px) {
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .next { grid-column: 1 / -1; }
  .row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px 12px; }
  .row .ticks { grid-column: 2 / -1; grid-row: 2; }
  .row .when { grid-column: 3; grid-row: 1; }
  .row .st { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; }
  .day .d { width: 84px; white-space: nowrap; }
  .who span { display: none; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ev { grid-template-columns: 48px minmax(0, 1fr); }
  .ev p { grid-column: 1 / -1; }
  .calhead .legend { margin-left: 0; width: 100%; }
  .dc { min-height: 64px; padding: 4px; }
  .dc i { font-size: 10px; padding: 1px 3px; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .mini { transition: border-color .15s; }
  .switch i::after { transition: left .15s; }
}
