/* ============================================================
   圈儿院重点工作 · 视觉系统
   方向：院务档案。宣纸底 + 墨字 + 北大红朱印，标题宋体、正文黑体，
   发丝线分隔，左侧朱红书脊，月历按农历/公历混合的档案册质感。
   所有外观参数通过 --site-* 变量消费，可在设计工作台统一调整。
   ============================================================ */

:root {
  /* Nudge 外观变量：默认值即本设计的原始配色与字体 */
  --site-bg: #f6f1e8;
  --site-fg: #211d19;
  --site-accent: #94070a;
  --site-on-accent: #fff8f2;
  --site-surface: #fffdf9;
  --site-muted: #6d6357;
  --site-border: #ddd2c2;
  --site-font: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", SimSun, Georgia, serif;

  --site-radius: 10px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;

  /* 派生尺度：间距与字号统一由 Nudge 倍率驱动 */
  --s-1: calc(4px * var(--site-space));
  --s-2: calc(8px * var(--site-space));
  --s-3: calc(12px * var(--site-space));
  --s-4: calc(16px * var(--site-space));
  --s-5: calc(22px * var(--site-space));
  --s-6: calc(32px * var(--site-space));
  --s-7: calc(46px * var(--site-space));

  --fs-xs: calc(12px * var(--site-type));
  --fs-sm: calc(13.5px * var(--site-type));
  --fs-body: calc(16px * var(--site-type));
  --fs-md: calc(18px * var(--site-type));
  --fs-lg: calc(23px * var(--site-type));
  --fs-xl: calc(31px * var(--site-type));
  --fs-day: calc(15px * var(--site-type));

  --dur: calc(180ms * var(--site-motion));
  --dur-long: calc(320ms * var(--site-motion));

  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --serif: var(--site-font);

  /* 数据语义色：级别与状态，独立于界面强调色 */
  --lv-school: var(--site-accent);
  --lv-college: #1f4e79;
  --lv-personal: #a86a12;
  --st-done: #2f6b46;
  --st-ongoing: #1f4e79;
  --st-planned: var(--site-muted);
  --st-cancelled: #9a9186;

  --rail: 224px;
  --shadow: 0 1px 2px rgba(33, 29, 25, .05), 0 8px 24px -12px rgba(33, 29, 25, .18);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--site-bg);
  color: var(--site-fg);
  font: 400 var(--fs-body)/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
h1 { font-size: var(--fs-xl); line-height: 1.25; margin: 0; }
h2 { font-size: var(--fs-lg); line-height: 1.3; margin: 0 0 var(--s-3); }
h3 { font-size: var(--fs-md); line-height: 1.35; margin: 0 0 var(--s-2); }
p { margin: 0 0 var(--s-3); }
a { color: var(--site-accent); }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 2px; border-radius: 4px; }

.boot { padding: var(--s-6); text-align: center; color: var(--site-muted); }

/* ---------- 外壳布局 ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  border-right: 1px solid var(--site-border);
  background: var(--site-surface);
  padding: var(--s-5) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  position: sticky;
  top: 0;
  height: 100dvh;
}

.brand { display: flex; align-items: center; gap: var(--s-3); }
.brand-mark {
  width: calc(38px * var(--site-space));
  height: calc(38px * var(--site-space));
  border-radius: 50%;
  background: var(--site-accent);
  color: var(--site-on-accent);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: calc(19px * var(--site-type));
  flex: none;
}
.brand-text { min-width: 0; }
.brand-title { font-family: var(--serif); font-size: calc(19px * var(--site-type)); font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: var(--fs-xs); color: var(--site-muted); line-height: 1.4; }

.nav { display: flex; flex-direction: column; gap: var(--s-1); }
.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--site-radius);
  cursor: pointer;
  color: var(--site-muted);
  font-size: var(--fs-body);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  transition: background var(--dur) ease, color var(--dur) ease;
}
.nav-item:hover { background: color-mix(in srgb, var(--site-border) 45%, transparent); color: var(--site-fg); }
.nav-item[aria-current="page"] {
  background: color-mix(in srgb, var(--site-accent) 10%, var(--site-surface));
  color: var(--site-accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--site-accent);
}
.nav-icon { width: 18px; height: 18px; flex: none; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-2); }
.who {
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  padding: var(--s-3);
  background: var(--site-bg);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.avatar {
  width: calc(34px * var(--site-space)); height: calc(34px * var(--site-space));
  border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--site-accent) 14%, var(--site-surface));
  color: var(--site-accent);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: var(--fs-md);
}
.who-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.who-role { font-size: var(--fs-xs); color: var(--site-muted); }

main.content { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  background: color-mix(in srgb, var(--site-surface) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--site-border);
}
.topbar h1 { font-size: var(--fs-lg); }
.topbar .spacer { flex: 1 1 auto; }

.page { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.page > * { min-width: 0; }

/* ---------- 控件 ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--site-border);
  background: var(--site-surface);
  color: var(--site-fg);
  border-radius: var(--site-radius);
  padding: var(--s-2) var(--s-4);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--dur) ease, border-color var(--dur) ease, transform var(--dur) ease;
  display: inline-flex; align-items: center; gap: var(--s-2);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--site-accent) 45%, var(--site-border)); background: color-mix(in srgb, var(--site-accent) 5%, var(--site-surface)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.primary { background: var(--site-accent); border-color: var(--site-accent); color: var(--site-on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--site-accent) 88%, #000); border-color: color-mix(in srgb, var(--site-accent) 88%, #000); }
.btn.danger { color: #a12222; border-color: color-mix(in srgb, #a12222 35%, var(--site-border)); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, #a12222 8%, var(--site-surface)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--site-muted); }
.btn.ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--site-border) 45%, transparent); color: var(--site-fg); }
.btn.icon { padding: var(--s-2); }
.btn.block { width: 100%; justify-content: center; }
.btn.sm { padding: calc(4px * var(--site-space)) var(--s-3); font-size: var(--fs-xs); }

.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); color: var(--site-muted); }
.req { color: var(--site-accent); }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--site-border);
  background: var(--site-surface);
  border-radius: var(--site-radius);
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-body);
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.textarea { min-height: calc(88px * var(--site-space)); resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--site-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent) 16%, transparent); outline: none; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--site-muted) 50%), linear-gradient(135deg, var(--site-muted) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: var(--s-6); }

.grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.check { display: flex; align-items: flex-start; gap: var(--s-2); font-size: var(--fs-sm); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--site-accent); width: 16px; height: 16px; flex: none; }

.segmented { display: inline-flex; border: 1px solid var(--site-border); border-radius: var(--site-radius); background: var(--site-surface); padding: calc(3px * var(--site-space)); gap: calc(2px * var(--site-space)); flex-wrap: wrap; }
.segmented button { appearance: none; border: 0; background: transparent; padding: var(--s-1) var(--s-3); border-radius: calc(var(--site-radius) - 4px); cursor: pointer; font-size: var(--fs-sm); color: var(--site-muted); transition: background var(--dur) ease, color var(--dur) ease; }
.segmented button[aria-pressed="true"] { background: var(--site-accent); color: var(--site-on-accent); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  background: var(--site-surface);
  padding: var(--s-4);
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); }
.card-head h2, .card-head h3 { margin: 0; }
.card-note { font-size: var(--fs-sm); color: var(--site-muted); }

.empty { text-align: center; color: var(--site-muted); padding: var(--s-6) var(--s-4); border: 1px dashed var(--site-border); border-radius: var(--site-radius); font-size: var(--fs-sm); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); line-height: 1.5;
  padding: 1px var(--s-2);
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag.school { color: var(--lv-school); background: color-mix(in srgb, var(--lv-school) 8%, var(--site-surface)); }
.tag.college { color: var(--lv-college); background: color-mix(in srgb, var(--lv-college) 8%, var(--site-surface)); }
.tag.personal { color: var(--lv-personal); background: color-mix(in srgb, var(--lv-personal) 10%, var(--site-surface)); }
.tag.key { color: var(--site-on-accent); background: var(--site-accent); border-color: var(--site-accent); font-weight: 600; }
.tag.done { color: var(--st-done); }
.tag.ongoing { color: var(--st-ongoing); }
.tag.planned { color: var(--st-planned); }
.tag.cancelled { color: var(--st-cancelled); text-decoration: line-through; }
.tag.plain { border-color: var(--site-border); color: var(--site-muted); background: var(--site-bg); }

/* ---------- 月历 ---------- */
.month-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.month-title { font-family: var(--serif); font-size: var(--fs-xl); font-weight: 600; letter-spacing: .02em; }
.month-title small { font-size: var(--fs-sm); color: var(--site-muted); font-family: var(--sans); font-weight: 400; margin-left: var(--s-2); }

.calendar { border: 1px solid var(--site-border); border-radius: var(--site-radius); background: var(--site-surface); overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: color-mix(in srgb, var(--site-accent) 6%, var(--site-surface)); border-bottom: 1px solid var(--site-border); }
.cal-dow div { padding: var(--s-2) var(--s-2); font-size: var(--fs-xs); color: var(--site-muted); text-align: right; }
.cal-dow div:nth-child(1), .cal-dow div:nth-child(7) { color: var(--site-accent); }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  border: 0; border-right: 1px solid var(--site-border); border-bottom: 1px solid var(--site-border);
  background: transparent; text-align: left; cursor: pointer;
  padding: var(--s-1) var(--s-1) var(--s-2);
  min-height: calc(96px * var(--site-space));
  display: flex; flex-direction: column; gap: 2px;
  transition: background var(--dur) ease;
  font: inherit; color: inherit;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: color-mix(in srgb, var(--site-accent) 4%, transparent); }
.cal-cell.out { background: color-mix(in srgb, var(--site-border) 22%, var(--site-surface)); }
.cal-cell.out .cal-day { color: color-mix(in srgb, var(--site-muted) 65%, var(--site-surface)); }
.cal-cell.today { background: color-mix(in srgb, var(--site-accent) 7%, var(--site-surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--site-accent) 35%, transparent); }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--site-accent); }

.cal-day { font-family: var(--serif); font-size: var(--fs-day); font-weight: 600; line-height: 1.2; padding: 2px calc(3px * var(--site-space)); display: flex; align-items: baseline; gap: var(--s-1); }
.cal-day .cal-day-sub { font-size: var(--fs-xs); font-weight: 400; color: var(--site-on-accent); background: var(--site-accent); border-radius: 999px; padding: 0 5px; font-family: var(--sans); }
.cal-cell:nth-child(7n+1) .cal-day, .cal-cell:nth-child(7n) .cal-day { color: var(--site-accent); }

.chip {
  display: block; width: 100%;
  border: 0; border-radius: calc(var(--site-radius) - 5px);
  padding: calc(2px * var(--site-space)) calc(6px * var(--site-space));
  font-size: var(--fs-xs); line-height: 1.45;
  text-align: left; cursor: pointer;
  color: var(--site-surface);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: filter var(--dur) ease;
}
.chip:hover { filter: brightness(1.12); }
.chip.school { background: var(--lv-school); }
.chip.college { background: var(--lv-college); }
.chip.personal { background: var(--lv-personal); }
.chip.done { opacity: .55; text-decoration: line-through; }
.chip.cancelled { background: var(--st-cancelled); opacity: .8; }
.chip .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #f2c664; margin-right: 4px; vertical-align: 1px; }
.cal-more { font-size: var(--fs-xs); color: var(--site-muted); padding-left: calc(6px * var(--site-space)); }

.legend { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; font-size: var(--fs-xs); color: var(--site-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .school { background: var(--lv-school); }
.legend .college { background: var(--lv-college); }
.legend .personal { background: var(--lv-personal); }
.legend .key { background: #f2c664; }

/* ---------- 清单 ---------- */
.row-list { display: flex; flex-direction: column; gap: var(--s-2); }
.item {
  display: grid; grid-template-columns: calc(74px * var(--site-space)) minmax(0, 1fr) auto;
  gap: var(--s-3); align-items: start;
  border: 1px solid var(--site-border); border-radius: var(--site-radius);
  background: var(--site-surface); padding: var(--s-3);
  cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease, background var(--dur) ease;
}
.item:hover { border-color: color-mix(in srgb, var(--site-accent) 40%, var(--site-border)); box-shadow: var(--shadow); }
.item-date { font-family: var(--serif); text-align: center; border-right: 1px solid var(--site-border); padding-right: var(--s-2); }
.item-date b { display: block; font-size: var(--fs-lg); line-height: 1.1; font-weight: 600; }
.item-date span { font-size: var(--fs-xs); color: var(--site-muted); }
.item-title { font-size: var(--fs-body); font-weight: 600; line-height: 1.4; }
.item-meta { font-size: var(--fs-sm); color: var(--site-muted); display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin-top: 2px; }
.item-tags { display: flex; gap: var(--s-1); flex-wrap: wrap; justify-content: flex-end; max-width: 40vw; }
.day-groups { display: flex; flex-direction: column; }
.day-group h3 { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--fs-md); margin: var(--s-4) 0 var(--s-2); }
.day-group:first-child h3 { margin-top: 0; }
.day-group h3 .count { font-size: var(--fs-xs); color: var(--site-muted); font-family: var(--sans); font-weight: 400; }

/* ---------- 抽屉 ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; }
.sheet-root[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(33, 29, 25, .38); opacity: 0; transition: opacity var(--dur-long) ease; }
.sheet {
  position: relative; z-index: 1;
  width: min(560px, 100%);
  background: var(--site-surface);
  border-left: 1px solid var(--site-border);
  box-shadow: -18px 0 48px -24px rgba(33, 29, 25, .4);
  display: flex; flex-direction: column;
  transform: translateX(16px); opacity: 0;
  transition: transform var(--dur-long) cubic-bezier(.22,.61,.36,1), opacity var(--dur) ease;
}
.sheet-root.open .scrim { opacity: 1; }
.sheet-root.open .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--site-border); }
.sheet-head h2 { flex: 1 1 auto; font-size: var(--fs-lg); }
.sheet-body { padding: var(--s-5); overflow: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--s-4); }
.sheet-foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--site-border); display: flex; gap: var(--s-2); flex-wrap: wrap; }
.sheet-foot .spacer { flex: 1 1 auto; }

.defs { display: grid; grid-template-columns: calc(88px * var(--site-space)) minmax(0, 1fr); gap: var(--s-2) var(--s-3); font-size: var(--fs-sm); }
.defs dt { color: var(--site-muted); }
.defs dd { margin: 0; }
.defs dd.people { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.person { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); border: 1px solid var(--site-border); border-radius: 999px; padding: 0 var(--s-2); background: var(--site-bg); }
.person.lead { border-color: color-mix(in srgb, var(--site-accent) 45%, var(--site-border)); color: var(--site-accent); }
.progress-box { border-left: 3px solid var(--site-accent); background: color-mix(in srgb, var(--site-accent) 5%, var(--site-surface)); padding: var(--s-3); border-radius: 0 var(--site-radius) var(--site-radius) 0; font-size: var(--fs-sm); }

/* ---------- 人员多选 ---------- */
.people-picker { border: 1px solid var(--site-border); border-radius: var(--site-radius); background: var(--site-bg); max-height: calc(230px * var(--site-space)); overflow: auto; padding: var(--s-2); display: flex; flex-direction: column; gap: 2px; }
.people-picker label { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-2); border-radius: calc(var(--site-radius) - 4px); cursor: pointer; font-size: var(--fs-sm); }
.people-picker label:hover { background: var(--site-surface); }
.picked { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-2); }
.picked .person button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: var(--fs-xs); }

/* ---------- 报告 ---------- */
.report-toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.report-doc {
  border: 1px solid var(--site-border); border-radius: var(--site-radius);
  background: var(--site-surface); padding: var(--s-6);
  font-size: var(--fs-body);
}
.report-doc h2 { text-align: center; font-size: var(--fs-lg); letter-spacing: .04em; }
.report-doc .meta { text-align: center; color: var(--site-muted); font-size: var(--fs-sm); margin-bottom: var(--s-5); }
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s-2); margin: var(--s-4) 0; }
.stat { border: 1px solid var(--site-border); border-radius: var(--site-radius); padding: var(--s-3); background: var(--site-bg); text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.1; color: var(--site-accent); }
.stat span { font-size: var(--fs-xs); color: var(--site-muted); }
.report-section { margin-top: var(--s-5); }
.report-section > h3 { border-bottom: 1px solid var(--site-border); padding-bottom: var(--s-2); }
.report-item { display: grid; grid-template-columns: calc(84px * var(--site-space)) minmax(0, 1fr); gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px dashed var(--site-border); font-size: var(--fs-sm); }
.report-item:last-child { border-bottom: 0; }
.report-item .when { font-family: var(--serif); color: var(--site-accent); }
.report-item .what b { font-weight: 600; }
.report-item .what div { color: var(--site-muted); margin-top: 2px; }
.report-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.report-foot { margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--site-border); display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); color: var(--site-muted); }

/* ---------- 管理后台 ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--site-border); border-radius: var(--site-radius); background: var(--site-surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--s-3); border-bottom: 1px solid var(--site-border); vertical-align: middle; white-space: nowrap; }
th { font-weight: 600; color: var(--site-muted); background: color-mix(in srgb, var(--site-border) 22%, var(--site-surface)); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--site-accent) 3%, transparent); }
td.wrap { white-space: normal; min-width: calc(180px * var(--site-space)); }
td.actions { display: flex; gap: var(--s-1); flex-wrap: wrap; }
code.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-sm); background: var(--site-bg); border: 1px solid var(--site-border); border-radius: 6px; padding: 1px var(--s-2); }

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: var(--s-5); }
.auth-card { width: min(440px, 100%); border: 1px solid var(--site-border); border-radius: calc(var(--site-radius) + 4px); background: var(--site-surface); box-shadow: var(--shadow); overflow: hidden; }
.auth-head { padding: var(--s-6) var(--s-5) var(--s-4); border-bottom: 1px solid var(--site-border); background: color-mix(in srgb, var(--site-accent) 5%, var(--site-surface)); }
.auth-head .brand { margin-bottom: var(--s-3); }
.auth-head p { font-size: var(--fs-sm); color: var(--site-muted); margin: 0; }
.auth-body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.auth-tabs button { appearance: none; border: 1px solid var(--site-border); background: var(--site-bg); padding: var(--s-2); border-radius: var(--site-radius); cursor: pointer; font-size: var(--fs-sm); color: var(--site-muted); transition: all var(--dur) ease; }
.auth-tabs button[aria-pressed="true"] { background: var(--site-accent); border-color: var(--site-accent); color: var(--site-on-accent); font-weight: 600; }
.hint { font-size: var(--fs-xs); color: var(--site-muted); line-height: 1.6; }
.err { color: #a12222; font-size: var(--fs-sm); }
.ok-note { color: var(--st-done); font-size: var(--fs-sm); }

/* ---------- 站点页脚 ---------- */
.site-foot {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--s-3) var(--s-5) var(--s-5);
  font-size: var(--fs-xs); color: var(--site-muted); line-height: 1.7;
  border-top: 1px dashed var(--site-border);
}
.site-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-card .site-foot {
  border-top: 1px solid var(--site-border);
  padding: var(--s-3) var(--s-5);
  background: color-mix(in srgb, var(--site-accent) 3%, var(--site-surface));
}

/* ---------- 提示条 ---------- */
.toast-root { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: var(--s-2); align-items: center; pointer-events: none; }
.toast {
  background: var(--site-fg); color: var(--site-bg);
  border-radius: 999px; padding: var(--s-2) var(--s-4);
  font-size: var(--fs-sm); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur) ease, transform var(--dur) ease;
  max-width: min(90vw, 520px);
}
.toast.show { opacity: .96; transform: none; }
.toast.error { background: #8b1d1d; color: #fff4f4; }

.banner { border: 1px solid color-mix(in srgb, var(--site-accent) 30%, var(--site-border)); background: color-mix(in srgb, var(--site-accent) 6%, var(--site-surface)); border-radius: var(--site-radius); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); }
.banner.warn { border-color: color-mix(in srgb, #a86a12 35%, var(--site-border)); background: color-mix(in srgb, #a86a12 8%, var(--site-surface)); }

/* ---------- 移动端底部导航 ---------- */
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { padding: var(--s-3) var(--s-4); position: sticky; }
  .topbar h1 { font-size: var(--fs-md); }
  .page { padding: var(--s-3); gap: var(--s-3); }
  .cal-cell { min-height: calc(58px * var(--site-space)); }
  .cal-cell .chip { font-size: calc(10.5px * var(--site-type)); }
  .cal-cell .chip span.text { display: none; }
  .cal-cell .chip::after { content: attr(data-initial); }
  .cal-more { display: none; }
  .item { grid-template-columns: calc(58px * var(--site-space)) minmax(0, 1fr); }
  .item-tags { grid-column: 2; max-width: none; justify-content: flex-start; }
  .sheet { width: 100%; border-left: 0; }
  .report-doc { padding: var(--s-4); }
  .mobile-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: sticky; bottom: 0; z-index: 20;
    background: var(--site-surface); border-top: 1px solid var(--site-border);
    padding: calc(6px * var(--site-space)) 0 calc(6px * var(--site-space));
    padding-bottom: calc(6px * var(--site-space) + env(safe-area-inset-bottom));
  }
  .mobile-nav button { appearance: none; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s-1) 0; font-size: calc(11px * var(--site-type)); color: var(--site-muted); cursor: pointer; }
  .mobile-nav button[aria-current="page"] { color: var(--site-accent); font-weight: 600; }
  .mobile-nav svg { width: 20px; height: 20px; }
  .toast-root { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .site-foot { padding: var(--s-3) var(--s-4) var(--s-4); }
}

@media (max-width: 560px) {
  .cal-dow div { text-align: center; padding: var(--s-1); }
  .month-title { font-size: var(--fs-lg); }
}

@media print {
  .rail, .topbar, .mobile-nav, .report-toolbar, .sheet-root, .toast-root, .report-actions { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .report-doc { border: 0; padding: 0; }
  .page { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
