/* 值班管理系统 - 前端样式
 * 作者：陪你去流浪_ · QQ：1179269449 · 邮箱：1179269449@qq.com
 */
:root {
  --bg: #f2f5fb;
  --card: #ffffff;
  --ink: #1f2937;
  --ink-2: #6b7280;
  --ink-3: #9ca3af;
  --line: #e5e9f2;
  --brand: #4f6ef7;
  --brand-2: #6b8cf8;
  --brand-deep: #3b55d9;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --green-ink: #166534;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --amber-ink: #92400e;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --red-ink: #991b1b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(23, 35, 61, .07), 0 4px 14px rgba(23, 35, 61, .05);
}

* { box-sizing: border-box; }
/* v1.4.0（D4）：hidden 属性必须生效，防止作者样式（如 .banner{display:flex}）覆盖导致空横幅常驻 */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(120deg, #4054d6 0%, #4f6ef7 55%, #6b8cf8 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(59, 85, 217, .25);
}
.topbar-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.ver { font-size: 12px; opacity: .85; }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sync-info { font-size: 12px; opacity: .9; text-align: right; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v1.4.0（UI11）：窄屏顶栏下方同步信息条，手机端也能判断数据是否最新 */
.m-sync-bar {
  display: none;
  padding: 6px 14px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .92);
  background: rgba(59, 85, 217, .35);
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-sync {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-sync:hover { background: rgba(255, 255, 255, .28); }
.btn-sync:disabled { opacity: .6; cursor: wait; }
/* 回到主页：导航类按钮，视觉权重低于「同步数据」操作按钮 */
.btn-home {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-home:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .6); }
.btn-home:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-home .ico { font-size: 16px; line-height: 1; }

/* ---------- 错误横幅 ---------- */
.banner {
  max-width: 1020px;
  margin: 10px auto 0;
  padding: 10px 14px;
  background: var(--red-bg);
  color: var(--red-ink, #991b1b);
  border: 1px solid #fecaca;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px;
}
.banner button { border: none; background: none; font-size: 18px; color: inherit; cursor: pointer; line-height: 1; }

/* ---------- Tabs ---------- */
.tabs-wrap { position: sticky; top: 0; z-index: 20; background: rgba(242, 245, 251, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.tabs {
  max-width: 1020px; margin: 0 auto; padding: 10px 20px;
  display: flex; gap: 8px; flex-wrap: wrap;
}.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.tab:hover { color: var(--brand); border-color: var(--brand-2); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 8px rgba(79, 110, 247, .35); }

/* ---------- 布局 ---------- */
.container { max-width: 1020px; width: 100%; margin: 0 auto; padding: 18px 20px 40px; flex: 1; }
.footer {
  text-align: center;
  padding: 14px 20px 18px;
  color: var(--ink-3);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  background: #fff;
}

/* ---------- 今日 hero ---------- */
.hero {
  border-radius: var(--radius);
  background: linear-gradient(120deg, #4054d6, #4f6ef7 60%, #6b8cf8);
  color: #fff;
  padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.hero-week { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.hero-sub { font-size: 13px; opacity: .92; margin-top: 6px; }
.nowrap { white-space: nowrap; } /* v1.4.0（UI10）：日期区间不拆行 */
.hero-stats { display: flex; gap: 14px; flex: none; }
.stat {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 12px;
  padding: 10px 18px;
  text-align: center;
  min-width: 86px;
}
.stat b { display: block; font-size: 24px; font-weight: 800; }
.stat span { font-size: 12px; opacity: .9; }

.now-banner {
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  color: var(--green-ink);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14.5px;
  display: flex; align-items: center; gap: 10px;
}
.now-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); } }
.now-banner b { font-weight: 800; }

/* ---------- 时段卡 ---------- */
.slot-list { display: flex; flex-direction: column; gap: 10px; }
.slot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; gap: 16px; align-items: flex-start;
}
.slot-time {
  flex: none;
  width: 128px;
  border-right: 1px dashed var(--line);
  padding-right: 14px;
}
.slot-time .t { display: block; font-weight: 800; font-size: 15.5px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.slot-time .p { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.slot-body { flex: 1; min-width: 0; }
.slot-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; flex-wrap: wrap; }
.slot-head b { color: var(--ink); font-size: 14px; }
.tag-now {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: #fff;
  font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 2px 10px;
}
.tag-now::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease infinite; }
.tag-past { background: var(--bg); border: 1px solid var(--line); color: var(--ink-3); font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.slot.now { border-color: var(--green); background: linear-gradient(0deg, rgba(22, 163, 74, .04), rgba(22, 163, 74, .04)), #fff; }
/* v1.4.0（D15）：已结束卡片只淡化时间标签，姓名保持全黑可读 */
.slot.past .slot-time { opacity: .55; }
.slot.empty .slot-body { color: var(--ink-3); font-size: 14px; padding-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  color: var(--green-ink);
  border-radius: 10px;
  padding: 5px 12px;
}
.chip b { font-size: 14.5px; font-weight: 700; }
.chip i { font-style: normal; font-size: 12px; opacity: .78; }

/* ---------- 周视图 ---------- */
.week-nav {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.week-nav button {
  border: 1px solid var(--line); background: #fff; color: var(--brand-deep);
  border-radius: 10px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.week-nav button:hover:not(:disabled) { background: #eef2ff; border-color: var(--brand-2); }
.week-nav button:disabled { opacity: .35; cursor: not-allowed; }
.week-title { text-align: center; }
.week-title b { font-size: 17px; }
.week-title small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }

.pcount-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pcount {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px;
  font-size: 13px; color: var(--ink-2);
  box-shadow: var(--shadow);
}
.pcount b { color: var(--ink); }
.pcount.ok b { color: var(--green); }
.pcount.warn { background: var(--amber-bg); border-color: #fde68a; }
.pcount.warn b { color: var(--amber); }

.day-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.day-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(0deg, var(--bg), var(--bg));
  border-bottom: 1px solid var(--line);
}
.day-head b { font-size: 15.5px; }
.day-head .date { color: var(--ink-2); font-size: 13.5px; }
.badge-today { background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.day-head .cnt { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.day-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.day-line { display: flex; gap: 12px; align-items: baseline; font-size: 14px; flex-wrap: wrap; }
.day-line .when { color: var(--brand-deep); font-weight: 700; flex: none; min-width: 196px; font-variant-numeric: tabular-nums; }
.day-none { color: var(--ink-3); font-size: 13.5px; padding: 4px 0 2px; }

/* ---------- 日视图控件 ---------- */
.controls {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.controls label { font-size: 13.5px; color: var(--ink-2); flex: none; }
.controls select {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 14px; color: var(--ink);
  background: #fff; cursor: pointer;
}
.day-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.day-btn {
  border: 1px solid var(--line); background: #fff;
  color: var(--ink-2);
  border-radius: 8px; padding: 6px 13px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.day-btn:hover { border-color: var(--brand-2); color: var(--brand); }
.day-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 人员视图 ---------- */
.person-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.person {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 7px 15px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; box-shadow: var(--shadow);
}
.person:hover { border-color: var(--brand-2); color: var(--brand); }
.person.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.person.active small { color: rgba(255, 255, 255, .85); }
.person small { font-weight: 400; font-size: 11.5px; opacity: .75; margin-left: 4px; }
.person-total { font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.person-total b { color: var(--brand-deep); }

/* ---------- 统计表 ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.stats-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 640px; }
.stats-table th, .stats-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.stats-table th { background: var(--bg); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.stats-table td.name { text-align: left; font-weight: 700; }
/* v1.4.0（UI12）：窄屏横向滚动时姓名列固定，仍能对上人 */
.stats-table th:first-child, .stats-table td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; }
.stats-table th:first-child { z-index: 3; background: var(--bg); }
.stats-table td.dorm { color: var(--ink-2); font-size: 12.5px; }
.stats-table tr:last-child td { border-bottom: none; }
.pill { display: inline-block; min-width: 34px; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--green-bg); color: var(--green-ink); }
.pill.warn { background: var(--amber-bg); color: var(--amber-ink); }
.stats-note { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }

/* ---------- 空态/错误 ---------- */
.empty-card {
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px; text-align: center; color: var(--ink-2);
}
.empty-card b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.error-card {
  background: var(--card); border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 40px 24px; text-align: center; color: var(--ink-2);
}
.error-card b { display: block; font-size: 16px; color: var(--red); margin-bottom: 8px; }
.error-card code { display: block; margin: 10px auto 16px; max-width: 560px; word-break: break-all; font-size: 12.5px; color: #991b1b; background: var(--red-bg); border-radius: 8px; padding: 10px 12px; }
.btn-retry {
  border: none; background: var(--brand); color: #fff;
  border-radius: 10px; padding: 9px 22px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(23, 32, 55, .92); color: #fff;
  border-radius: 999px; padding: 10px 22px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  z-index: 99;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- 值班变更（v1.1.0） ---------- */
.mini-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 5px;
  background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 700; font-style: normal;
  vertical-align: middle;
  margin-left: 4px;
  cursor: help;
}
.chip .mini-badge { margin-left: 2px; }
.chip.adjusted { border-style: dashed; border-color: var(--brand-2); background: #eef2ff; color: var(--brand-deep); }
.chip-adj {
  border: 1px solid #bbf7d0; background: #fff; color: var(--green-ink);
  border-radius: 6px; font-size: 11px; font-weight: 700;
  padding: 1px 6px; cursor: pointer; line-height: 1.5;
  margin-left: 4px; flex: none;
}
.chip-adj:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.day-line .chip-adj { margin-left: 6px; }
.adjust-note {
  font-size: 12.5px; color: var(--amber-ink);
  background: var(--amber-bg);
  border: 1px dashed #fde68a;
  border-radius: 8px;
  padding: 5px 10px;
  margin-top: 8px;
}
.mode-switch { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mode-switch button { border: none; background: none; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.mode-switch button.active { background: var(--brand); color: #fff; }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stats-head h2 { margin: 0; font-size: 16px; }

.adj-intro {
  background: #eef2ff; border: 1px solid #dbe4ff; color: var(--brand-deep);
  border-radius: 12px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 14px;
}
.adj-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px;
}
.adj-card h3 { margin: 0 0 12px; font-size: 15px; }
.adj-form-grid { display: flex; flex-direction: column; gap: 0; }
.adj-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 0; }
.adj-row:first-child { padding-top: 2px; }
.adj-row.divider { border-bottom: 1px solid #d3dcee; }
/* v1.4.0（D8）：提交按钮与表单控件列对齐（label 92px + gap 10px） */
.adj-actions { display: flex; gap: 10px; align-items: center; padding-top: 12px; padding-left: 102px; }
.adj-row > label { flex: none; width: 92px; font-size: 13.5px; color: var(--ink-2); }
.adj-row select, .adj-row input[type="text"] {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 14px; color: var(--ink);
  background: #fff; min-width: 180px;
}
.adj-row input[type="text"] { flex: 1; min-width: 220px; }
#adjSrcWeek { min-width: 110px; width: 110px; flex: none; }
/* v1.4.0：允许班次下拉在窄屏收缩（flex:none 不可收缩导致 390px 溢出 36px） */
#adjSrc { flex: 0 1 auto; max-width: min(340px, 100%); }
.adj-target { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; }
/* v1.4.0：下拉不超过父容器宽（「已过期」标注使选项文本变长，390px 下曾溢出 36px） */
.adj-target select { min-width: 240px; max-width: 100%; }
.btn-primary {
  border: none; background: var(--brand); color: #fff;
  border-radius: 10px; padding: 9px 22px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:disabled { opacity: .5; cursor: wait; }
.btn-ghost {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 10px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--brand-2); color: var(--brand); }
/* v1.4.0（UI6）：目标选择实时提示 */
.adj-live-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--amber-ink);
  background: var(--amber-bg);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 5px 10px;
}
/* v1.5.0：目标已过期等硬拦截提示用红色（区别于可确认的黄色警告）；v1.6.0（N7）：加左侧实线与字重，提升对比度 */
.adj-live-hint.block {
  color: var(--red-ink);
  background: var(--red-bg);
  border-color: #fecaca;
  border-left: 3px solid var(--red);
  font-weight: 600;
}
.adj-list { display: flex; flex-direction: column; gap: 10px; }
.adj-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.adj-item .txt { flex: 1; min-width: 260px; font-size: 14.5px; font-weight: 600; }
.adj-item .txt small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.adj-status { flex: none; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 11px; }
.adj-status.ok { background: var(--green-bg); color: var(--green-ink); }
.adj-status.stale { background: var(--red-bg); color: #991b1b; }
.adj-status.noeffect { background: var(--amber-bg); color: var(--amber-ink); }
.adj-status.pending { background: #eef2ff; color: var(--brand-deep); border: 1px dashed var(--brand-2); }
/* v1.4.0（UI8）：待确认条目整行浅蓝底色，管理员一眼找到待办 */
.adj-item.pending { background: #eef2ff; border-color: var(--brand-2); }
.btn-danger {
  border: 1px solid #fecaca; background: #fff; color: var(--red);
  border-radius: 9px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
  flex: none;
}
.btn-danger:hover { background: var(--red-bg); }
.btn-confirm {
  border: 1px solid var(--green); background: var(--green); color: #fff;
  border-radius: 9px; padding: 6px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
  flex: none;
}
.btn-confirm:hover { background: var(--green-ink); }

/* ---------- 密码模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(23, 32, 55, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(420px, calc(100vw - 40px));
  background: #fff; border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal-tip { font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.modal-pw {
  width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 16px; letter-spacing: 2px;
  outline: none;
}
.modal-pw:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(79, 110, 247, .15); }
.modal-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 6px; }
.modal-warn {
  background: var(--amber-bg); border: 1px solid #fde68a; color: var(--amber-ink);
  border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-top: 8px;
}
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.adj-empty { text-align: center; color: var(--ink-3); font-size: 14px; padding: 18px 0 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar-inner { padding: 10px 14px; }
  .sync-info { display: none; }
  .m-sync-bar { display: block; }
  /* 窄屏只留返回箭头，避免顶栏两个按钮把标题挤出屏幕（title/aria-label 仍可说明用途） */
  .topbar-right { gap: 8px; }
  .btn-home { padding: 8px 10px; }
  .btn-home .txt { display: none; }
  .container { padding: 14px 12px 32px; }
  /* v1.4.0（UI9）：tabs 单行横向滚动，不再折成两行；v1.6.0（N2）：缘部渐隐提示可横向滑动（v1.6.1：跟随滚动位置动态显示左/右缘） */
  .tabs { padding: 8px 12px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 7px 13px; font-size: 13px; flex: none; scroll-snap-align: start; }
  .tabs-wrap::before, .tabs-wrap::after {
    content: '';
    position: absolute; top: 0; bottom: 0; width: 28px;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
  }
  .tabs-wrap::before {
    left: 0;
    background: linear-gradient(to right, rgba(242, 245, 251, .96) 30%, rgba(242, 245, 251, 0));
  }
  .tabs-wrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(242, 245, 251, .96) 30%, rgba(242, 245, 251, 0));
  }
  .tabs-wrap.fade-left::before { opacity: 1; }
  .tabs-wrap.fade-right::after { opacity: 1; }
  .hero { flex-direction: column; align-items: flex-start; padding: 18px; }
  .hero-week { font-size: 21px; }
  .hero-stats { width: 100%; }
  .stat { flex: 1; }
  .slot { flex-direction: column; gap: 8px; padding: 12px 14px; }
  .slot-time { width: auto; border-right: none; border-bottom: 1px dashed var(--line); padding: 0 0 8px; display: flex; align-items: center; gap: 10px; }
  .slot-time .p { margin-top: 0; }
  .week-nav { flex-wrap: wrap; }
  .week-title { flex: 1; min-width: 200px; }
  .day-line .when { min-width: 0; }
  .footer { font-size: 11.5px; }
  /* v1.4.0（D8）：窄屏提交按钮不缩进 */
  .adj-actions { padding-left: 0; }
  /* v1.4.0（UI5）：窄屏「调整至」按钮组多行折行时，标签贴住第一行而不是孤零零垂直居中 */
  .adj-row { align-items: flex-start; }
  .adj-row > label { padding-top: 8px; }
}
