/* ============================================================
   个人工作台 — 设计令牌
   chrome 中性，颜色只用来表达语义（优先级 / 状态 / AI）
   ============================================================ */
:root {
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --ink:       #1c2024;
  --ink-2:     #5b6570;
  --ink-3:     #8b95a1;
  --line:      #e3e6ea;
  --line-2:    #eef0f3;

  --accent:    #33455a;   /* 操作色：深石蓝 */
  --accent-2:  #24313f;   /* hover */
  --accent-bg: #eceff3;
  --focus:     #4a7fd4;

  --high: #c8452e;  --high-bg: #fbeeeb;
  --med:  #a86f14;  --med-bg:  #fbf3e4;
  --low:  #2f8a52;  --low-bg:  #ecf7f0;
  --ai:   #6549a0;  --ai-bg:   #f2eefa;

  --radius:    10px;
  --radius-sm: 7px;
  --shadow:    0 1px 2px rgba(20, 28, 40, .06), 0 1px 8px rgba(20, 28, 40, .04);

  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
          system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.view { display: none; }
.view.active { display: block; }

a { color: inherit; }

/* ============================================================
   登录
   ============================================================ */
.login-box {
  width: min(360px, calc(100vw - 40px));
  margin: clamp(60px, 18vh, 140px) auto;
  background: var(--surface);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-box h2 {
  text-align: center;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: 24px;
}
.login-box label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.login-box input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;              /* 16px 防 iOS 聚焦缩放 */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.login-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-submit:hover { background: var(--accent-2); }
.error { margin-top: 12px; font-size: 13px; text-align: center; color: var(--high); }

/* ============================================================
   导航
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.navbar-links::-webkit-scrollbar { display: none; }
.nav-link {
  flex: 0 0 auto;
  padding: 6px 11px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.logout-btn {
  padding: 5px 12px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.logout-btn:hover { color: var(--high); border-color: var(--high); }

/* ============================================================
   页面容器
   ============================================================ */
#main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.page { display: none; }
.page.active { display: block; }
body.embed-mode #main { display: none; }
.page.fullwidth.active {
  display: flex;
  flex-direction: column;
}
.page.fullwidth iframe {
  display: block;
  width: 100%;
  height: calc(100dvh - 112px);
  min-height: 420px;
  border: 0;
  background: #fff;
}
@media (max-width: 720px) {
  .page.fullwidth iframe { height: calc(100dvh - 150px); }
}

h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: .01em;
  margin: 4px 0 20px;
}

/* ============================================================
   表单
   ============================================================ */
form.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
form.inline label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
  font-size: 12.5px;
  color: var(--ink-2);
}
form.inline input,
form.inline select,
form.inline textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
form.inline textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
form.inline input:focus,
form.inline select:focus,
form.inline textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
form.inline label.wide { flex-basis: 100%; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.danger { color: var(--ink-2); background: transparent; border: 1px solid var(--line); }
.btn.danger:hover { color: var(--high); background: var(--high-bg); border-color: transparent; }

/* 键盘可达性 */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ============================================================
   首页导航 / 筛选
   ============================================================ */
.subtitle { margin: -12px 0 20px; font-size: 14px; color: var(--ink-3); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.app-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.app-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.app-card-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--bg);
  border-radius: 9px;
}
.app-card-body { min-width: 0; flex: 1; }
.app-card-title { font-size: 14.5px; font-weight: 600; }
.app-card-desc { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.app-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 20px;
}

.filter-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--line-2);
  border-radius: var(--radius-sm);
}
.segmented button {
  padding: 6px 16px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active {
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 28, 40, .08);
}

/* ============================================================
   待办
   ============================================================ */
.todo-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
}
.todo-item:last-child { border-bottom: 0; }
.todo-item.done .todo-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.todo-item.done .prio { opacity: .55; }

/* 左侧完成复选框 */
.todo-checkbox {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--low);
  cursor: pointer;
}
.todo-checkbox:disabled { cursor: default; }

.todo-body { flex: 1; min-width: 0; }
.todo-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}
.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.reminded { color: var(--low); }

/* 重复标记：(月) / (周) / (日) … 放在标题最前 */
.recur {
  color: var(--accent);
  font-weight: 600;
}

.todo-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* 优先级徽标：高红 / 中橙 / 低绿 */
.prio {
  flex: 0 0 auto;
  min-width: 26px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  border-radius: 5px;
}
.prio-high { background: var(--high); }
.prio-medium { background: var(--med); }
.prio-low { background: var(--low); }
/* 没设提醒时间：中性灰，不当成紧急 */
.prio-none { color: var(--ink-3); background: var(--line-2); }

/* 行内编辑表单 */
.todo-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line-2);
}
.todo-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 150px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.todo-edit label.wide { flex-basis: 100%; }
.todo-edit input,
.todo-edit select {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.todo-edit input:focus,
.todo-edit select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.todo-edit-actions { display: flex; gap: 8px; }

.btn.ghost { color: var(--ink-2); background: transparent; border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); background: var(--bg); }

.ai-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
  color: var(--ai);
  background: var(--ai-bg);
  border-radius: 4px;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ============================================================
   番茄钟
   ============================================================ */
.pomo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 26px 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pomo-ring { position: relative; width: 220px; height: 220px; max-width: 66vw; }
.pomo-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-track { fill: none; stroke: var(--line-2); stroke-width: 10; }
.pomo-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset .3s linear, stroke .3s;
}
.pomo-ring.is-break .pomo-progress { stroke: var(--low); }
.pomo-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.pomo-time {
  font-family: var(--mono);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.pomo-phase { font-size: 13px; color: var(--ink-3); letter-spacing: .14em; }

.pomo-modes {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: var(--line-2);
  border-radius: var(--radius-sm);
}
.pomo-mode {
  padding: 7px 15px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
.pomo-mode b { font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pomo-mode:hover { color: var(--ink); }
.pomo-mode.active {
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 28, 40, .08);
}
.pomo-mode.active b { color: var(--accent); }

.pomo-label { width: 100%; max-width: 340px; font-size: 12.5px; color: var(--ink-2); }
.pomo-label input {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pomo-label input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.pomo-actions { display: flex; gap: 10px; }
.pomo-actions .btn { min-width: 104px; }
.pomo-today { font-size: 13.5px; color: var(--ink-2); }
.pomo-today b { color: var(--accent); font-variant-numeric: tabular-nums; }

.pomo-h2 { font-size: 15px; font-weight: 650; margin: 26px 0 12px; }
.pomo-log { display: flex; flex-direction: column; gap: 8px; }
.pomo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pomo-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pomo-item.short_break .pomo-dot,
.pomo-item.long_break .pomo-dot { background: var(--low); }
.pomo-item-body { flex: 1; min-width: 0; }
.pomo-item-title { font-size: 14.5px; font-weight: 500; word-break: break-word; }
.pomo-item-meta { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ============================================================
   周期管理
   ============================================================ */
.cyc-summary {
  margin-bottom: 14px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cyc-summary b { font-variant-numeric: tabular-nums; }
.cyc-summary .soon { color: var(--med); }
.cyc-summary .urgent { color: var(--high); }

/* 用独立类名，不复用 .filter-bar —— 那是待办页的，改了会波及它 */
.cyc-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-bottom: 12px; }
.cyc-fields { display: flex; flex-wrap: wrap; gap: 10px; flex-basis: 100%; }
.cyc-fields label {
  display: flex; flex-direction: column; gap: 5px;
  flex: 1 1 150px; font-size: 12.5px; color: var(--ink-2);
}
.cyc-fields input {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.cyc-fields input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

.cyc-list { display: flex; flex-direction: column; gap: 10px; }
.cyc-item {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cyc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cyc-type {
  flex: 0 0 auto; padding: 2px 8px; font-size: 11.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-bg); border-radius: 20px;
}
.cyc-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 550; word-break: break-word; }
.cyc-days {
  flex: 0 0 auto; padding: 3px 10px; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; border-radius: 5px;
}
.cyc-days.urgent { color: #fff; background: var(--high); }
.cyc-days.soon   { color: #fff; background: var(--med); }
.cyc-days.ok     { color: var(--low); background: var(--low-bg); }
.cyc-when { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cyc-history { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.cyc-history summary { cursor: pointer; color: var(--ink-3); }
.cyc-history ul { margin: 6px 0 0 18px; }
.cyc-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }
.cyc-renew-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.cyc-renew-form label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; font-size: 12.5px; color: var(--ink-2); }
.cyc-renew-form input {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* 提醒节点：一份合同下的多个时间点 */
.cyc-nodes {
  margin-top: 10px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px dashed var(--line-2);
}
.cyc-node { font-size: 13.5px; }
.cyc-node-row { display: flex; align-items: center; gap: 9px; }
.cyc-node.done { opacity: .5; }
.cyc-node.done .cyc-node-label { text-decoration: line-through; }
.cyc-node-label { flex: 1; min-width: 0; word-break: break-word; }
.cyc-node-date { flex: 0 0 auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cyc-node-days {
  flex: 0 0 auto; padding: 2px 8px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; border-radius: 5px;
}
.cyc-node-days.urgent { color: #fff; background: var(--high); }
.cyc-node-days.soon   { color: #fff; background: var(--med); }
.cyc-node-days.ok     { color: var(--low); background: var(--low-bg); }
.cyc-node .btn.sm { padding: 3px 9px; font-size: 12px; }

/* 内联编辑表单（改合同 / 改节点共用） */
.cyc-edit-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 8px; }
.cyc-edit-form label {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1 1 150px; font-size: 12.5px; color: var(--ink-2);
}
.cyc-edit-form label.wide { flex-basis: 100%; }
.cyc-edit-form input,
.cyc-edit-form select {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.cyc-edit-form input:focus,
.cyc-edit-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.cyc-edit-actions { display: flex; gap: 8px; flex-basis: 100%; justify-content: flex-end; }
.cyc-node-form { margin-top: 4px; }

/* ============================================================
   记录（钥匙）
   ============================================================ */
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rec-item {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.rec-title { font-size: 15px; font-weight: 550; word-break: break-word; }
.rec-time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.rec-fields {
  margin-top: 10px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  font-size: 13.5px;
}
.rec-fields dt { color: var(--ink-3); }
.rec-fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.rec-foot { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

/* 记录的内联编辑表单（与新建表单同样的字段布局） */
.rec-edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
}
.rec-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.rec-edit-form label.wide { flex-basis: 100%; }
.rec-edit-form input,
.rec-edit-form textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rec-edit-form textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
.rec-edit-form input:focus,
.rec-edit-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.rec-edit-form .rec-foot { flex-basis: 100%; }

/* ============================================================
   外链嵌入页
   ============================================================ */
.embed-notice {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--med);
  background: var(--med-bg);
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  #main { padding: 18px 14px 56px; }
  h1 { font-size: 19px; margin-bottom: 16px; }

  .navbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .brand { font-size: 14px; }
  .navbar-links { order: 3; flex-basis: 100%; margin-left: 0; padding-bottom: 2px; }
  .navbar-user { margin-left: auto; }

  form.inline { padding: 14px; gap: 12px; }
  form.inline label { flex-basis: 100%; }
  form.inline .btn { flex: 1 1 100%; }

  .todo-item { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .todo-body { flex: 1 1 auto; }
  .todo-actions { flex-basis: 100%; justify-content: flex-end; }
  .todo-edit { padding: 12px 14px; }
  .todo-edit label { flex-basis: 100%; }

  .pomo { padding: 22px 14px 18px; }
  .pomo-ring { width: 190px; height: 190px; }
  .pomo-time { font-size: 38px; }
  .pomo-modes { width: 100%; }
  .pomo-mode { flex: 1; padding: 7px 8px; }
  .pomo-actions { width: 100%; }
  .pomo-actions .btn { flex: 1; min-width: 0; }

  .cyc-filters { flex-direction: column; align-items: stretch; }
  .cyc-filters .segmented { width: 100%; justify-content: space-between; }
  .cyc-fields label { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   车辆：里程 / 加油
   多列表格需要比默认 900px 更宽的容器
   ============================================================ */
body.wide-mode #main { max-width: 1440px; }

.v-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.v-toolbar .v-hint { font-size: 12.5px; color: var(--ink-3); }

.v-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.v-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.v-filters input {
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.v-filters input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.v-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
.v-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.v-table th,
.v-table td {
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
}
.v-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  background: #fafbfc;
}
.v-table tbody tr:hover { background: var(--bg); }
.v-table th.num,
.v-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.v-table .btn.sm { padding: 3px 8px; font-size: 12px; }

.v-actions { display: flex; align-items: center; gap: 6px; }
.v-table .v-actions { display: table-cell; white-space: nowrap; }
.v-table .v-actions .btn + .btn { margin-left: 4px; }

.v-muted { color: var(--ink-3); }
.v-ok { color: var(--low); }
.v-warn { color: var(--med); }
.v-est { color: var(--med); border-bottom: 1px dashed currentColor; }
.v-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--med);
  background: var(--med-bg);
  border-radius: 4px;
}
.v-badge.warn { color: var(--high); background: var(--high-bg); }
.v-row-warn { background: var(--high-bg) !important; }

.v-result {
  margin-bottom: 12px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--low);
  background: var(--low-bg);
  border-radius: var(--radius-sm);
}
.v-warn-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--med);
  background: var(--med-bg);
  border-radius: var(--radius-sm);
}

.v-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.v-summary > div {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.v-summary span { display: block; font-size: 12px; color: var(--ink-3); }
.v-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.v-panel {
  margin-bottom: 16px;
  padding: 0 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.v-panel summary {
  padding: 12px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.v-panel form.inline { margin-bottom: 0; padding: 0; border: 0; }

.v-section-title {
  margin: 22px 0 10px;
  font-size: 15px;
  font-weight: 650;
}

.v-readings { display: grid; gap: 8px; }
.v-reading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.v-reading-main {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  min-width: 200px;
  font-size: 13px;
}
.v-reading-main strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.v-reading-main time { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.v-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.v-photo-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); }

.print-only { display: none; }

@media (max-width: 720px) {
  .v-toolbar .btn { flex: 1 1 auto; }
  .v-filters label { flex: 1 1 140px; }
  .v-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-summary strong { font-size: 16px; }
  .v-reading-main { min-width: 100%; }
}

/* ============================================================
   打印：里程 / 加油台账
   A4 横向，表头每页重复
   ============================================================ */
@media print {
  @page { size: A4 landscape; margin: 10mm; }

  body, body.wide-mode { background: #fff; font-size: 10px; }
  body.wide-mode #main { max-width: none; }
  #main { max-width: none; padding: 0; }

  .navbar, .no-print, .v-toolbar, .v-filters, .v-panel, .v-result, .v-warn-box,
  .v-summary, .v-readings, .btn, h1 { display: none !important; }

  .page { display: none !important; }
  .page.active { display: block !important; }
  .print-only { display: block !important; }

  .v-print-head { display: block; margin-bottom: 6px; }
  .v-print-head h2 { font-size: 16px; text-align: center; margin-bottom: 2px; }
  .v-print-head div { font-size: 10px; color: #555; text-align: center; margin-bottom: 8px; }

  .v-table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .v-table { font-size: 9px; white-space: normal; }
  .v-table th, .v-table td {
    padding: 3px 4px;
    border: 1px solid #888;
    color: #000;
    background: #fff;
  }
  .v-table th { position: static; font-size: 9px; }
  .v-table thead { display: table-header-group; }
  .v-table tr { break-inside: avoid; }
  .v-table tbody tr:hover { background: none; }
  .v-row-warn { background: #fff !important; }
  .v-est { color: #000; border-bottom: 0; }
  .v-muted { color: #000; }
  .v-badge { color: #000; background: none; padding: 0; }
}

.v-legend {
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.v-page-sub {
  margin: -12px 0 16px;
  font-size: 13px;
  color: var(--ink-3);
}

/* 分页与行内编辑 */
tr.v-page-hidden { display: none; }

.v-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.v-pager[hidden] { display: none; }

.v-edit-row > td {
  padding: 12px 14px;
  background: #fbfcfd;
}
.v-edit-row form.inline {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  white-space: normal;
}
.v-edit-row form.inline .btn { align-self: flex-end; }

@media print {
  /* 打印的是当前筛选的全部记录，不是屏幕上的当前页 */
  tr.v-page-hidden { display: table-row !important; }
  tr.v-edit-row { display: none !important; }
}
