:root {
  --bg: #f4f2ec;
  --panel: #ffffff;
  --ink: #1f2a24;
  --muted: #6b726d;
  --faint: #9aa09b;
  --line: #e3e0d6;
  --accent: #2d6a4f;
  --accent-soft: #e4efe8;
  --work: #2d6a4f;
  --work-soft: #e7f1ec;
  --lit: #a4562a;
  --lit-soft: #f7ece4;
  --mine: #fff6d6;
  --mine-line: #e6c65c;
  --danger: #b3261e;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { padding: 80px; text-align: center; color: var(--muted); }

/* ---------- 顶栏 ---------- */
header.top {
  background: var(--ink); color: #f4f2ec;
  padding: 14px max(20px, calc((100vw - 1040px) / 2));
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
header.top h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: .02em; }
header.top h1 small { font-weight: 400; opacity: .65; margin-left: 8px; font-size: 13px; }
header.top .who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; }
header.top .who button { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: inherit; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
header.top .who button:hover { background: rgba(255,255,255,.2); }
.role { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #e6c65c; color: var(--ink); font-weight: 600; }

nav.tabs {
  display: flex; gap: 4px; padding: 0 max(20px, calc((100vw - 1040px) / 2));
  background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto;
}
nav.tabs button {
  border: 0; background: none; padding: 12px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
nav.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

main { max-width: 1040px; margin: 0 auto; padding: 20px; }

/* ---------- 提示条 ---------- */
.next-banner {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--mine-line);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.next-banner b { font-size: 17px; }
.next-banner .sub { color: var(--muted); font-size: 13px; }
.demo-note { background: #fdf3d8; border: 1px dashed #d9b44a; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.dot.work { background: var(--work); } .dot.lit { background: var(--lit); }

/* ---------- 排班表 ---------- */
.sched { display: flex; flex-direction: column; gap: 8px; }
.wk {
  display: grid; grid-template-columns: 96px 1fr 1fr 36px; gap: 8px; align-items: stretch;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
}
.wk.past { opacity: .62; }
.wk.past:hover { opacity: 1; }
.wk.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wk.skip { background: repeating-linear-gradient(135deg, #f7f5ef, #f7f5ef 8px, #efece4 8px, #efece4 16px); }
.wk .date { display: flex; flex-direction: column; justify-content: center; padding-left: 8px; }
.wk .date .d { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wk .date .w { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 999px; margin-top: 3px; width: fit-content; }
.tag.now { background: var(--accent); color: #fff; }
.tag.adj { background: #ece7f7; color: #5b3fa0; }
.tag.note { background: #f0ede4; color: var(--muted); }
.skipnote { grid-column: 2 / 4; display: flex; align-items: center; color: var(--muted); font-size: 14px; padding: 0 8px; }

.slot {
  border: 0; text-align: left; cursor: pointer; border-radius: 9px; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 1px; min-height: 64px; position: relative;
}
.slot.work { background: var(--work-soft); }
.slot.lit { background: var(--lit-soft); }
.slot:hover { filter: brightness(.97); }
.slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot.mine { background: var(--mine); box-shadow: inset 0 0 0 2px var(--mine-line); }
.slot .lab { font-size: 11px; color: var(--muted); }
.slot .lab .dot { width: 6px; height: 6px; }
.slot .nm { font-size: 16px; font-weight: 600; }
.slot .nm .g { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.slot .tp { font-size: 13px; color: #3d4540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slot .tp a { text-decoration: none; }
.slot .tag.adj { position: absolute; top: 8px; right: 10px; margin: 0; }
.slot.empty .nm { color: var(--faint); font-weight: 400; }
.more { border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 8px; font-size: 18px; }
.more:hover { background: #f0ede4; color: var(--ink); }

/* ---------- 通用 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 14px; cursor: pointer;
}
.btn:hover { border-color: #c9c4b6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #24583f; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.card p.hint, .hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

table.list { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
table.list th, table.list td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 500; background: #faf9f5; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num { font-variant-numeric: tabular-nums; }
.st { font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.st.汇报中 { background: var(--accent-soft); color: var(--accent); }
.st.暂停中 { background: #fdf0d5; color: #8a6200; }
.st.未开始 { background: #e8eef7; color: #2f5590; }
.st.已结束, .st.已移除 { background: #eeece6; color: var(--muted); }
.tablewrap { overflow-x: auto; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form input, .form select, .form textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); font-size: 15px; width: 100%;
}
.form input:focus, .form select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > input, .inline > select { flex: 1; min-width: 120px; }

dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px));
  box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink);
}
dialog::backdrop { background: rgba(31, 42, 36, .45); }
.dlg-h { padding: 18px 20px 6px; display: flex; align-items: flex-start; gap: 10px; }
.dlg-h h3 { margin: 0; font-size: 17px; }
.dlg-h .x { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.dlg-b { padding: 6px 20px 20px; display: grid; gap: 16px; max-height: 75vh; overflow-y: auto; }
.sec { border-top: 1px solid var(--line); padding-top: 14px; }
.sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.who-now { font-size: 22px; font-weight: 650; }
.err { color: var(--danger); font-size: 13px; min-height: 1em; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  transition: .2s; pointer-events: none; z-index: 10; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--danger); }

.login { max-width: 360px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login h1 { font-size: 20px; margin: 0 0 4px; }

.logs li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; list-style: none; }
.logs { padding: 0; margin: 0; }
.logs .t { color: var(--faint); font-size: 12px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.empty-state { color: var(--muted); text-align: center; padding: 40px; }

@media (max-width: 640px) {
  main { padding: 14px 12px; }
  .wk { grid-template-columns: 1fr 1fr; position: relative; }
  .wk .date { grid-column: 1 / -1; grid-row: 1; flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 2px 4px; }
  .wk .slot.work { grid-row: 2; grid-column: 1; }
  .wk .slot.lit { grid-row: 2; grid-column: 2; }
  .wk .more { position: absolute; top: 6px; right: 6px; width: 32px; height: 28px; }
  .wk .more-ph { display: none; }
  .skipnote { grid-column: 1 / -1; grid-row: 2; padding: 4px; }
  .slot { padding: 8px 10px; }
  .slot .tag.adj { position: static; margin-top: 2px; }
  .row2 { grid-template-columns: 1fr; }
  header.top .who { margin-left: 0; width: 100%; }
}
