/* 无镜 1.0.1 — 移动端样式 */
:root {
  --ink: #171613;
  --ink-2: #3b3730;
  --muted: #736c5f;
  --faint: #9c9485;
  --paper: #f4f1e9;
  --paper-deep: #ebe6da;
  --card: #fffdf8;
  --card-soft: #faf7ef;
  --line: #e3ddd0;
  --line-strong: #d2c9b7;
  --accent: #a8442f;
  --accent-deep: #87331f;
  --accent-soft: #f6e9e1;
  --gold: #c09a5c;
  --gold-soft: #f3e8d2;
  --green: #3f6a52;
  --danger: #a33827;
  --black: #0b0b0c;
  --black-2: #141311;
  --shadow-sm: 0 2px 10px rgba(37, 30, 20, 0.045);
  --shadow: 0 8px 26px rgba(37, 30, 20, 0.075);
  --shadow-lg: 0 18px 46px rgba(25, 19, 12, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 62px;
  --maxw: 560px;
  --font: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 50% -160px, #fbf8f1 0%, rgba(251, 248, 241, 0) 68%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.focus-card :focus-visible,
.modal :focus-visible {
  outline-color: var(--gold);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 0 0 12px 12px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.noscript {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

/* ---------- 外壳 ---------- */

.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: transparent;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--black);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.appbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.brand-logo {
  display: block;
  width: 44px;
  height: 44px;
  transform: scale(2.02);
  transform-origin: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.2;
}

.brand-name {
  color: #f5f0e4;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.appbar-action {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  color: #cfc7b7;
}

.appbar-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.view {
  display: block;
  padding: 16px 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 30px);
  outline: none;
}

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: var(--maxw);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 253, 248, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(33, 26, 17, 0.05);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--nav-h);
  padding: 7px 2px 0;
  border: 0;
  background: transparent;
  color: #8c8477;
  cursor: pointer;
}

.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.tab[aria-current="page"] {
  color: var(--accent);
}

.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

.tab[aria-current="page"] svg {
  stroke-width: 1.8;
}

/* ---------- 通用 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.section {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 10px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.eyebrow {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-primary {
  background: var(--ink);
  color: #fffdf7;
}

.btn-primary:hover {
  background: #2a2823;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-deep);
}

.btn-secondary {
  background: var(--card-soft);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn-secondary:hover {
  background: var(--paper-deep);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--card-soft);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- 首页：数据条 ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat {
  min-width: 0;
  padding: 11px 6px 10px;
  text-align: center;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat-value {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.stat-value.is-accent {
  color: var(--accent);
}

.stat-label {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------- 月历 ---------- */

.cal-card {
  padding: 11px 9px 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.cal-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px 4px;
}

.cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cal-nav:hover {
  background: var(--card-soft);
  color: var(--ink);
}

.cal-title {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
}

.today-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}

.today-btn:hover {
  background: var(--card-soft);
  color: var(--accent);
  border-color: var(--gold);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 5px 0 3px;
}

.cal-week span {
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: 0.05em;
}

.cal-week span.is-weekend {
  color: #a2795e;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 43px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.cal-day:hover {
  background: var(--card-soft);
}

.cal-day.is-out {
  color: #bdb4a4;
}

.cal-day.is-today {
  color: var(--accent);
  font-weight: 700;
  border-color: rgba(168, 68, 47, 0.28);
}

.cal-day.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffdf7;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(23, 22, 19, 0.18);
}

.cal-day.is-selected.is-today {
  border-color: var(--gold);
}

.cal-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 5px;
  margin-top: 2px;
}

.cal-dot {
  display: block;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
}

.cal-dot.is-task {
  background: var(--accent);
}

.cal-dot.is-diary {
  background: var(--gold);
}

.cal-dot.is-meeting {
  background: var(--green);
}

.cal-day.is-selected .cal-dot {
  background: #f0dfc0;
}

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 7px 0 1px;
  color: var(--faint);
  font-size: 10px;
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.legend-dot.is-task {
  background: var(--accent);
}

.legend-dot.is-diary {
  background: var(--gold);
}

.legend-dot.is-meeting {
  background: var(--green);
}

/* ---------- 任务 ---------- */

.day-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 2px 10px;
}

.day-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.day-week {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.day-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.task-card {
  position: relative;
  padding: 12px 12px 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.task-card.is-done {
  background: #fbf9f3;
  border-color: #e8e2d5;
}

.task-card.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.task-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-check {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 1.5px solid #b8ad99;
  border-radius: 7px;
  background: #fffdf8;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.task-check:checked {
  border-color: var(--green);
  background: var(--green);
}

.task-check:checked::after {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 2.5px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}

.task-check:focus-visible {
  outline-offset: 3px;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-desc {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.meta-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.meta-sep {
  color: #c8c0b0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  padding: 1px 7px;
  border: 1px solid #e8e1d3;
  border-radius: 999px;
  background: #f4f0e7;
  color: #625a4c;
  font-size: 10.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.chip-due {
  border-color: #ead4c8;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.chip-important {
  border-color: #1d1c18;
  background: #1d1c18;
  color: #f0d8a7;
}

.chip-done {
  border-color: #d8e3d9;
  background: #eef4ee;
  color: #3d6249;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px dashed #e9e3d7;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}

.mini-btn:hover {
  background: #f4efe5;
  color: var(--ink);
}

.mini-btn.is-accent {
  color: var(--accent);
  font-weight: 600;
}

.mini-btn.is-done {
  color: var(--green);
  font-weight: 600;
}

.mini-btn.icon-only {
  width: 34px;
  padding: 0;
  color: var(--muted);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.task-card.is-done .mini-btn.is-accent {
  display: none;
}

/* ---------- 空状态 ---------- */

.empty {
  padding: 26px 20px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.55);
  text-align: center;
}

.empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
}

.empty-title {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.empty-text {
  max-width: 280px;
  margin: 5px auto 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

/* ---------- 专注 ---------- */

.focus-card {
  position: relative;
  overflow: hidden;
  padding: 17px 15px 15px;
  border: 1px solid #25231f;
  border-radius: 22px;
  background:
    radial-gradient(460px 280px at 50% -30%, rgba(192, 154, 92, 0.17) 0%, rgba(192, 154, 92, 0) 68%),
    linear-gradient(165deg, #171613 0%, #0c0c0b 100%);
  color: #f6f1e5;
  box-shadow: 0 16px 36px rgba(20, 16, 10, 0.2);
  text-align: center;
}

.focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px;
}

.focus-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d6b87d;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.mode-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9a45f;
  box-shadow: 0 0 0 4px rgba(201, 164, 95, 0.12);
}

.focus-status {
  color: #8d8678;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.timer-wrap {
  position: relative;
  width: min(236px, 64vw);
  height: min(236px, 64vw);
  margin: 7px auto 2px;
}

.timer-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: #2a2823;
  stroke-width: 5.5;
}

.timer-progress {
  fill: none;
  stroke: #c9a45f;
  stroke-width: 5.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear;
}

.timer-progress.is-break {
  stroke: #8fa892;
}

.timer-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
}

.timer-time {
  color: #fbf6ea;
  font-family: "SF Mono", "Roboto Mono", "DIN Alternate", ui-monospace, monospace;
  font-size: clamp(39px, 11.6vw, 52px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
  line-height: 1;
}

.timer-sub {
  display: -webkit-box;
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  color: #b4ac9d;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.timer-state {
  margin-top: 4px;
  color: #827b6d;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.focus-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
}

.focus-controls .btn {
  min-width: 108px;
}

.btn-light {
  background: #f5efe2;
  color: #171613;
}

.btn-light:hover {
  background: #fffaf0;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ded7c9;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.34);
}

.focus-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  color: #9a9283;
  font-size: 10.5px;
}

.focus-note::before {
  content: "";
  width: 14px;
  height: 1px;
  background: #4a463e;
}

.panel {
  margin-top: 13px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.panel-title {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.panel-note {
  color: var(--faint);
  font-size: 10.5px;
}

.select {
  width: 100%;
  min-height: 44px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.select:disabled {
  background: #f2eee5;
  color: var(--muted);
  cursor: default;
}

.hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.setting-row + .setting-row {
  border-top: 1px solid #efe9dd;
}

.setting-label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.setting-label small {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 400;
}

.stepper {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #faf7ef;
}

.stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.stepper button:hover:not(:disabled) {
  background: #f0e9da;
}

.stepper button:disabled {
  color: #c4bcac;
  cursor: default;
}

.stepper-out {
  min-width: 57px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.stepper-out small {
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 400;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid #eadcc2;
  border-radius: 14px;
  background: #fbf4e6;
}

.banner-close {
  width: 30px;
  height: 30px;
  color: #9a8a6c;
  font-size: 19px;
}

.banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0e2c7;
  color: #876c3c;
  font-family: var(--serif);
  font-size: 14px;
}

.banner-body {
  flex: 1;
  min-width: 0;
}

.banner-title {
  color: #5c4a2d;
  font-size: 12.5px;
  font-weight: 650;
}

.banner-text {
  margin-top: 1px;
  color: #8a795b;
  font-size: 10.5px;
  line-height: 1.5;
}

.banner .btn {
  flex: 0 0 auto;
}

/* ---------- 记录列表 ---------- */

.record-list {
  margin-top: 2px;
}

.record-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}

.record-row + .record-row {
  border-top: 1px solid #efe9dd;
}

.record-main {
  flex: 1;
  min-width: 0;
}

.record-title {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-time {
  margin-top: 1px;
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.record-duration {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------- 日报 ---------- */

.date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 11px;
}

.date-nav .cal-nav {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--card);
}

.date-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.date-title strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.date-title span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.diary-card {
  padding: 13px 14px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.diary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.diary-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.diary-title small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.diary-status {
  color: var(--faint);
  font-size: 10.5px;
  text-align: right;
}

.diary-status.is-dirty {
  color: var(--accent);
}

.diary-paper {
  position: relative;
  border-radius: 12px;
  background-color: #fdfbf6;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    #eee8db 27px,
    #eee8db 28px
  );
  border: 1px solid #ece5d8;
}

.diary-input {
  display: block;
  width: 100%;
  min-height: 224px;
  padding: 9px 12px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 28px;
  resize: vertical;
  outline: none;
}

.diary-input:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(168, 68, 47, 0.42);
}

.diary-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.diary-count {
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.draft-note {
  margin-top: 7px;
  color: #8a6c3d;
  font-size: 10.5px;
}

.draft-note[hidden] {
  display: none;
}

.daily-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 11px;
}

.mini-stat {
  padding: 9px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.mini-stat b {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.mini-stat span {
  color: var(--muted);
  font-size: 10.5px;
}

.task-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
}

.task-line + .task-line {
  border-top: 1px solid #efe9dd;
}

.task-line-mark {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.task-line.is-done .task-line-mark {
  background: var(--green);
}

.task-line-body {
  flex: 1;
  min-width: 0;
}

.task-line-title {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.task-line.is-done .task-line-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-line-meta {
  margin-top: 1px;
  color: var(--faint);
  font-size: 10.5px;
}

/* ---------- 月报 ---------- */

.month-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.month-head .cal-nav {
  border: 1px solid var(--line);
  background: var(--card);
}

.month-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric {
  position: relative;
  padding: 12px 13px 11px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.metric-value {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.metric-value small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
}

.metric.is-wide {
  grid-column: 1 / -1;
}

.metric.is-wide .metric-value {
  font-size: 24px;
}

.metric-foot {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
}

.report-card {
  margin-top: 13px;
  padding: 13px 14px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.report-title {
  font-size: 14px;
  font-weight: 700;
}

.report-meta {
  margin-top: 1px;
  color: var(--faint);
  font-size: 10.5px;
}

.report-meta.is-dirty {
  color: var(--accent);
}

.report-input {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fdfbf6;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
  resize: vertical;
}

.report-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.report-actions .btn:first-child {
  margin-right: auto;
}

.report-empty {
  padding: 16px 4px 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.report-preview {
  max-height: 46vh;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf7ef;
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- 设置 / 弹层 ---------- */

.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin: 10px 0 3px;
}

.backup-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.backup-item b {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.backup-item span {
  color: var(--muted);
  font-size: 10.5px;
}

.notice {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #ecd9c9;
  border-radius: 11px;
  background: #fbf0e8;
  color: #75402f;
  font-size: 11.5px;
  line-height: 1.65;
}

.notice-soft {
  border-color: var(--line);
  background: var(--card-soft);
  color: var(--muted);
}

.notice .btn {
  margin-left: 6px;
  vertical-align: middle;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 11px 0;
}

.compare-col {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.compare-col h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.compare-col p {
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.8;
}

.compare-col p b {
  font-variant-numeric: tabular-nums;
}

/* ---------- Toast ---------- */

.toast-region {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(92%, 480px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #1b1916;
  color: #f6f1e6;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  overflow-wrap: anywhere;
  animation: toast-in 0.2s ease both;
}

.toast.is-leaving {
  opacity: 0;
  transition: opacity 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 12, 8, 0.52);
  animation: fade-in 0.18s ease both;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--maxw);
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 50px rgba(15, 11, 6, 0.24);
  animation: sheet-in 0.22s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0.7;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 18px 9px;
  border-bottom: 1px solid #f0ebe0;
}

.modal-title-box {
  flex: 1;
  min-width: 0;
}

.modal-title {
  flex: 1;
  min-width: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.modal-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.modal-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--card-soft);
  color: var(--ink);
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 4px 18px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #f0ebe0;
  background: var(--card);
  border-radius: 0 0 0 0;
}

.modal-foot .btn {
  flex: 0 1 auto;
}

.modal-message {
  padding: 9px 0 2px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

/* ---------- 表单 ---------- */

.field {
  margin: 12px 0;
}

.field > label,
.field-label {
  display: block;
  margin-bottom: 5px;
  color: #5c5548;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}

[data-diary-input],
[data-summary-input] {
  font-size: 1rem;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(168, 68, 47, 0.16);
  outline-offset: 0;
}

.field input[type="date"],
.field input[type="time"] {
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-hint {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.form-error {
  display: block;
  margin: 9px 0 0;
  padding: 8px 10px;
  border: 1px solid #ecd2c8;
  border-radius: 9px;
  background: #fbeee9;
  color: #8b3524;
  font-size: 11.5px;
  line-height: 1.55;
}

.form-error[hidden] {
  display: none;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
  cursor: pointer;
}

.inline-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.inline-check span {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.inline-check small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.modal-actions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 4px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.action-row-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.action-row-title {
  display: block;
  color: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.action-row-sub {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.5;
}

.action-row.is-danger .action-row-sub {
  color: #9c6254;
}

.action-row:hover {
  background: var(--paper-deep);
}

.action-row .action-arrow {
  color: var(--faint);
  font-size: 17px;
}

.action-row.is-danger {
  border-color: #ecd2c8;
  background: #fbefea;
  color: var(--danger);
}

.action-row.is-danger:hover {
  background: #f8e5de;
}

.action-row:disabled {
  opacity: 0.5;
  cursor: default;
}

.task-summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.task-summary-title {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.task-summary-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ---------- 宽屏 ---------- */

@media (min-width: 620px) {
  .app-shell {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    box-shadow: 0 0 60px rgba(40, 32, 20, 0.05);
  }

  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .modal {
    border-radius: 22px;
    max-height: 86vh;
  }

  .modal-foot {
    border-radius: 0 0 22px 22px;
  }
}

@media (max-width: 380px) {
  .view {
    padding-right: 11px;
    padding-left: 11px;
  }

  .appbar-inner {
    padding: 0 50px;
  }

  .brand-name {
    font-size: 15px;
  }

  .cal-day {
    height: 40px;
    border-radius: 9px;
    font-size: 13px;
  }

  .stat-value {
    font-size: 14px;
  }

  .stat-label {
    font-size: 9.5px;
  }

  .section-title {
    font-size: 16px;
  }

  .day-title {
    font-size: 18px;
  }

  .mini-btn {
    padding: 0 7px;
    font-size: 12px;
  }

  .focus-controls .btn {
    min-width: 96px;
  }

  .metric-value {
    font-size: 18px;
  }

  .compare {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 320px) {
  .cal-day {
    height: 37px;
  }

  .task-actions .mini-btn {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
 * 2.6 — 计划 / 记录 / 提醒 / 录音 / 循环 / 同步
 * ============================================================ */

/* ---------- 通用分段控件 ---------- */

.seg {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-soft);
}

.seg button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
}

.seg button.is-active {
  background: var(--ink);
  color: #fffdf7;
}

.seg button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ---------- 计划页 ---------- */

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 2px 10px;
}

.plan-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.plan-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.plan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 2px 9px;
}

.plan-bar-text {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.plan-date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.plan-date-nav .date-title strong {
  font-size: 17px;
}

/* ---------- 一周概览 ---------- */

.week-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.week-head {
  display: grid;
  grid-template-columns: 58px repeat(3, minmax(0, 1fr));
  background: var(--card-soft);
  border-bottom: 1px solid var(--line);
}

.week-head span {
  padding: 7px 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
}

.week-head span:first-child {
  text-align: left;
  padding-left: 8px;
}

.week-row {
  display: grid;
  grid-template-columns: 58px repeat(3, minmax(0, 1fr));
  min-height: 64px;
}

.week-row + .week-row {
  border-top: 1px solid #efe9dd;
}

.week-row.is-today {
  background: #fdf8ed;
}

.week-date {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 4px 5px 8px;
  border-right: 1px solid #efe9dd;
  cursor: pointer;
  user-select: none;
}

.week-date b {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.week-row.is-today .week-date b {
  color: var(--accent);
}

.week-num {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.wk-badge {
  margin-top: 2px;
  color: #9b6b32;
  font-size: 9px;
  line-height: 1.3;
  white-space: nowrap;
}

.week-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 4px 3px;
  border-right: 1px solid #f1ece1;
  cursor: pointer;
}

.week-cell:last-child {
  border-right: 0;
}

.wk-chip {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 2px 4px;
  overflow: hidden;
  border: 0;
  border-left: 2.5px solid var(--cat, #d2c9b7);
  border-radius: 5px;
  background: var(--cat-tint, #f4f0e7);
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.wk-chip b {
  margin-right: 3px;
  font-size: 9px;
  font-weight: 800;
}

.wk-chip.is-done {
  opacity: 0.55;
}

.wk-chip.is-done span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.wk-more {
  padding-left: 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
}

.wk-none {
  height: 100%;
  min-height: 18px;
}

button.week-date {
  width: 100%;
  border: 0;
  border-right: 1px solid #efe9dd;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button.week-date:hover {
  background: var(--card-soft);
}

button.wk-more {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

button.wk-more:hover {
  text-decoration: underline;
}

/* ---------- 日计划 ---------- */

.pending-block {
  margin-bottom: 12px;
  padding: 11px 11px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.6);
}

.pending-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.pending-title {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pending-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 12px;
}

.pending-entry-head .mini-btn {
  flex: none;
}

.minute-timeline {
  --ruler-width: 53px;
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.minute-tick {
  position: absolute;
  inset-inline: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.minute-tick span {
  display: block;
  padding: 4px 6px;
}

.minute-bands {
  position: absolute;
  inset: 0 5px 0 var(--ruler-width);
  border-inline-start: 1px solid var(--line);
}

.minute-group {
  position: absolute;
  inset: 0 0 0 4px;
  pointer-events: none;
}

.minute-group.has-overflow {
  right: 45px;
}

.minute-slot {
  position: absolute;
  left: calc(100% * var(--lane) / var(--lane-count));
  width: calc(100% / var(--lane-count));
  height: max(var(--preview-height), var(--duration));
  padding-inline: 2px;
  pointer-events: auto;
}

.minute-fill {
  position: absolute;
  top: 0;
  inset-inline: 2px;
  height: var(--duration);
  min-height: 2px;
  border-inline-start: 3px solid var(--category);
  border-radius: 6px;
  background: var(--shade);
}

.minute-task {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-auto-rows: min-content;
  align-items: start;
  gap: 0 5px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 4px 5px 3px 8px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.minute-slot.is-point .minute-fill {
  height: var(--preview-height);
  border-bottom: 1px dashed var(--category);
}

.minute-slot.is-short .minute-task {
  border-radius: 6px;
  background: linear-gradient(to bottom, transparent var(--duration), var(--card-soft) var(--duration));
  box-shadow: inset 0 0 0 1px var(--line);
}

.minute-task-title {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.minute-slot.is-done .minute-task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.minute-grade {
  min-width: 18px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.minute-task-time,
.minute-task-info {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.minute-detail-info {
  margin: 5px 4px 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}

.minute-more {
  position: absolute;
  right: -44px;
  width: 39px;
  min-height: 25px;
  padding: 1px 2px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--card-soft);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
}

/* ---------- 任务卡（80% 类别 / 20% 等级） ---------- */

.pcard {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.pcard-main {
  flex: 1 1 80%;
  min-width: 0;
  padding: 8px 9px 6px;
  border-left: 4px solid var(--cat, #d2c9b7);
  background: var(--cat-tint, #faf7ef);
}

.pcard-top {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.pcard-text {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  outline: none;
}

.pcard-title {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.pcard-desc {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.pcard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.pcard-meta .meta-time {
  font-weight: 600;
}

.pcard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin-top: 3px;
}

.pcard-actions .mini-btn {
  min-height: 30px;
  padding: 0 7px;
  font-size: 11.5px;
}

.pcard-grade {
  display: flex;
  flex: 0 0 20%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.09);
}

.pcard-grade b {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pcard-grade span {
  font-size: 8px;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

.pcard.is-done {
  border-color: #e9e3d6;
  box-shadow: none;
}

.pcard.is-done .pcard-main {
  background: #f7f4ed;
}

.pcard.is-done .pcard-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.pcard.is-done .pcard-meta,
.pcard.is-done .pcard-desc {
  opacity: 0.72;
}

/* 完成后仍保留 A–E 与可读等级色，只用透明度淡化。 */
.pcard.is-done .pcard-grade {
  opacity: 0.9;
  filter: saturate(0.78);
}

.pcard.is-done .pcard-grade b {
  opacity: 1;
}

.pcard.is-done .pcard-grade span {
  opacity: 0.92;
}

.today-row.is-done .today-grade.is-done-grade {
  opacity: 0.58;
  font-weight: 700;
}

.pcard .task-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.pcard .task-check:checked::after {
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
}

.chip-cat {
  border-color: transparent;
  background: transparent;
  font-weight: 600;
}

.chip-remind {
  border-color: #d8c7a8;
  background: #f7efdf;
  color: #7b5f2f;
}

.chip-loc {
  border-color: #e3ddd0;
  background: transparent;
  color: var(--muted);
}

.chip-meeting {
  border-color: #d5e3da;
  background: #eef5ef;
  color: #3f624b;
}

.mini-btn.is-danger-text {
  color: var(--danger);
  font-weight: 600;
}

.mini-btn.is-danger-text:hover {
  background: #fbeee9;
}

.chip-missing {
  border-color: #ecd2c8;
  background: #fbeee9;
  color: #8b3524;
}

/* ---------- 首页今日 ---------- */

.today-card {
  margin-top: 13px;
  padding: 13px 13px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.today-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.today-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.today-sub {
  margin-top: 1px;
  color: var(--faint);
  font-size: 10px;
}

.today-list {
  display: flex;
  flex-direction: column;
}

.today-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 5px 1px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}

.today-row + .today-row {
  border-top: 1px solid #f1ece1;
}

.today-row:hover {
  background: var(--card-soft);
}

.today-time {
  flex: 0 0 50px;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.today-cat {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat, #d2c9b7);
}

.today-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-row.is-done .today-name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.today-grade {
  flex: 0 0 auto;
  min-width: 16px;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.today-more {
  margin-top: 5px;
  color: var(--faint);
  font-size: 10px;
}

.today-focus-panel {
  margin-top: 13px;
}

.focus-total {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 2px 0 7px;
}

.focus-total b {
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.focus-total span {
  color: var(--muted);
  font-size: 10.5px;
}

/* ---------- 记录页 ---------- */

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 1px 2px 11px;
}

.records-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.records-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.records-grid .action-row {
  min-height: 84px;
}

.record-history-filters {
  margin-bottom: 12px;
}

.storage-usage {
  margin-block: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
}

.storage-usage dt {
  color: var(--muted);
  font-size: 11px;
}

.storage-usage dd {
  margin: 1px 0 8px;
  font-size: 13px;
  font-weight: 650;
}

/* ---------- 复盘摘要 ---------- */

.summary-card {
  margin-top: 13px;
  padding: 13px 13px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 7px;
}

.summary-title {
  font-size: 14px;
  font-weight: 700;
}

.summary-range {
  margin: 1px 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.summary-status {
  color: var(--faint);
  font-size: 10.5px;
  text-align: right;
  line-height: 1.5;
}

.summary-status.is-dirty {
  color: var(--accent);
}

.summary-input {
  display: block;
  width: 100%;
  min-height: 190px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fdfbf6;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
  resize: vertical;
}

.summary-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.summary-actions .btn:first-child {
  margin-right: auto;
}

.summary-empty {
  padding: 14px 3px 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---------- 会议 ---------- */

.meeting-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.meeting-card {
  padding: 11px 12px 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.meeting-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.meeting-title {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.meeting-date {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}

.meeting-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.meeting-excerpt {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meeting-excerpt.is-empty {
  color: var(--faint);
  font-style: normal;
}

.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed #ece6da;
}

.meeting-actions .mini-btn {
  min-height: 31px;
  padding: 0 7px;
  font-size: 11.5px;
}

.audio-state {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.audio-state.is-live {
  color: var(--accent);
  font-weight: 600;
}

.audio-panel {
  margin-top: 11px;
  padding: 11px 12px 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
}

.audio-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.audio-panel-title {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.audio-actions .btn {
  min-height: 34px;
  padding: 0 11px;
  font-size: 11.5px;
}

.audio-duration {
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.browser-note {
  margin-top: 7px;
  padding: 7px 9px;
  border: 1px dashed #d8cfbd;
  border-radius: 9px;
  background: #faf6ec;
  color: #7c715d;
  font-size: 10px;
  line-height: 1.6;
}

.transcript-preview {
  max-height: 30vh;
  margin-top: 8px;
  padding: 10px 11px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf7ef;
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.speech-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 7px;
}

.speech-row {
  display: flex;
  gap: 7px;
  padding: 6px 0;
}

.speech-row + .speech-row {
  border-top: 1px solid #f1ece1;
}

.speech-time {
  flex: 0 0 74px;
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  white-space: nowrap;
}

.speech-body {
  flex: 1;
  min-width: 0;
}

.speech-text {
  padding: 2px 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.speech-body textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fffdf8;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.speech-tools {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 2px;
}

.speech-tools .mini-btn {
  min-height: 28px;
  padding: 0 6px;
  font-size: 10.5px;
}

.decision-box {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #ead9c4;
  border-radius: 11px;
  background: #fbf4e7;
}

.decision-box[hidden] {
  display: none;
}

.decision-text {
  color: #6f5a36;
  font-size: 10.5px;
  line-height: 1.6;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.decision-actions .btn {
  min-height: 31px;
  padding: 0 9px;
  font-size: 11px;
}

.meeting-form .field {
  margin: 10px 0;
}

.meeting-form .field textarea {
  min-height: 120px;
}

/* ---------- 任务弹窗顶部状态栏 ---------- */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 6px 0 2px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}

.status-bar-label {
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.status-bar .seg {
  flex: 0 1 auto;
  border-color: var(--line);
  background: #fffdf8;
}

.status-bar .btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

/* ---------- A–E 等级选择 ---------- */

.grade-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.grade-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 3px 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--ink-2);
  line-height: 1.2;
  cursor: pointer;
}

.grade-btn b {
  font-size: 14px;
  font-weight: 800;
}

.grade-btn span {
  color: var(--muted);
  font-size: 8.5px;
}

.grade-btn.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: #fffdf8;
}

.grade-btn.is-active b {
  color: var(--ink);
}

/* ---------- 提醒 ---------- */

.reminder-box {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.reminder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.reminder-row[hidden] {
  display: none;
}

.reminder-row input[type="number"] {
  width: 82px;
  min-height: 40px;
}

.reminder-row input[type="datetime-local"] {
  flex: 1;
  min-width: 180px;
  min-height: 40px;
}

.reminder-row span {
  color: var(--muted);
  font-size: 11.5px;
}

.reminder-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
}

.field-note {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
}

/* ---------- 分类内联编辑 ---------- */

.cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cat-row .select {
  flex: 1;
  min-width: 130px;
}

.cat-inline {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.cat-inline[hidden] {
  display: none;
}

.cat-inline-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.cat-inline-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cat-inline-fields input[type="text"] {
  flex: 1;
  min-width: 120px;
  min-height: 38px;
}

.cat-inline-fields input[type="color"] {
  flex: 0 0 44px;
  width: 44px;
  min-height: 38px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffdf8;
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0;
}

.cat-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
}

.color-dot {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.cat-list-row b {
  flex: 1;
  min-width: 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.cat-list-row .mini-btn {
  min-height: 30px;
  padding: 0 8px;
}

/* ---------- 专注模式切换 ---------- */

.clock-switch {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.clock-switch .seg {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.clock-switch .seg button {
  color: #b9b1a2;
}

.clock-switch .seg button.is-active {
  background: #f5efe2;
  color: #171613;
}

.timer-goal {
  margin-top: 5px;
  color: #8b8476;
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

/* ---------- 录音浮条 ---------- */

.audio-bar {
  position: fixed;
  z-index: 65;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(94%, 520px);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #191713;
  color: #f6f1e5;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.audio-bar[hidden] {
  display: none;
}

.audio-bar-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9a45f;
}

.audio-bar.is-recording .audio-bar-dot {
  background: #d9534f;
  animation: audio-pulse 1.1s ease-in-out infinite;
}

.audio-bar.is-busy .audio-bar-dot {
  background: #c9a45f;
  animation: audio-pulse 1.4s ease-in-out infinite;
}

@keyframes audio-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.audio-bar-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.audio-bar-title {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-bar-sub {
  color: #b8b0a1;
  font-size: 9.5px;
  line-height: 1.4;
}

.audio-bar-btn {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: transparent;
  color: #f6f1e5;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.audio-bar-btn.is-primary {
  border-color: transparent;
  background: #f5efe2;
  color: #171613;
}

.audio-bar-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 0 0 14px 14px;
  background: #c9a45f;
  transition: width 0.3s ease;
}

body.has-audio-bar .view {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 92px);
}

body.has-audio-bar .toast-region {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 70px);
}

/* ---------- 小屏适配 ---------- */

@media (max-width: 380px) {
  .week-head,
  .week-row {
    grid-template-columns: 50px repeat(3, minmax(0, 1fr));
  }

  .week-date {
    padding-left: 6px;
  }

  .week-date b {
    font-size: 10px;
  }

  .wk-chip {
    font-size: 9px;
    padding: 2px 3px;
  }

  .tl-time {
    flex-basis: 44px;
    padding-left: 6px;
    font-size: 9.5px;
  }

  .pcard-main {
    padding: 7px 7px 5px;
  }

  .pcard-title {
    font-size: 12.5px;
  }

  .pcard-grade b {
    font-size: 15px;
  }

  .today-time {
    flex-basis: 44px;
  }

  .grade-btn b {
    font-size: 13px;
  }

  .audio-bar {
    width: calc(100% - 16px);
  }
}

/* ---------- 2.6 循环任务 ---------- */

.repeat-box {
  margin-top: 2px;
  padding: 10px 11px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
}

.repeat-box .select {
  width: 100%;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.weekday-picker[hidden] {
  display: none;
}

.weekday-btn {
  flex: 1 1 0;
  min-width: 39px;
  min-height: 33px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fffdf8;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.weekday-btn.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdf8;
}

.repeat-until {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.repeat-until[hidden] {
  display: none;
}

.repeat-until input {
  flex: 1 1 150px;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fffdf8;
  color: var(--ink);
}

.repeat-until-note {
  color: var(--faint);
  font-size: 9.5px;
}

.repeat-summary {
  margin-top: 7px;
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.5;
}

.repeat-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
}

.chip-repeat {
  border-color: #cfd9c2;
  background: #eef2e7;
  color: #50623f;
  font-weight: 600;
}

/* ---------- 2.6 作用范围选择层 ---------- */

.choice-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 12, 8, 0.58);
  animation: fade-in 0.16s ease both;
}

.choice-sheet {
  width: 100%;
  max-width: var(--maxw);
  max-height: 84vh;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  background: var(--card);
  box-shadow: 0 -16px 50px rgba(15, 11, 6, 0.3);
  animation: sheet-in 0.2s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.choice-sheet-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.choice-sheet-text {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.choice-sheet-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.choice-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.choice-option:hover {
  background: var(--card-soft);
}

.choice-option.is-recommended {
  border-color: #c9b28a;
  background: #fbf5e9;
}

.choice-option.is-danger {
  border-color: #e2b9ae;
  background: #fdf3ef;
  color: #7d2c1c;
}

.choice-option-title {
  font-size: 13px;
  font-weight: 700;
}

.choice-option-text {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.choice-option.is-danger .choice-option-text {
  color: #8a5b4d;
}

.choice-sheet-cancel {
  width: 100%;
  margin-top: 10px;
}

.choice-sheet-note {
  margin-top: 9px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
}

/* ---------- 2.6 录音暂停 / 恢复 ---------- */

.audio-bar.is-paused .audio-bar-dot {
  background: #c9a45f;
}

.audio-bar-btn:disabled {
  opacity: 0.55;
}

.audio-recovery {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #e7d2b5;
  border-radius: 11px;
  background: #fcf5e8;
}

.audio-recovery[hidden] {
  display: none;
}

.audio-recovery-text {
  color: #705a38;
  font-size: 10.5px;
  line-height: 1.6;
}

.audio-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.audio-recovery-actions .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

/* ---------- 2.6 设备同步 ---------- */

.sync-panel {
  padding-top: 2px;
}

.sync-state {
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card-soft);
}

.sync-state.is-busy {
  border-color: #d9c7a7;
  background: #fbf6eb;
}

.sync-state-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b9b1a2;
}

.sync-state.is-busy .sync-dot {
  background: var(--accent);
  animation: audio-pulse 1.2s ease-in-out infinite;
}

.sync-state-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.sync-status-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.sync-error {
  margin-top: 7px;
  padding: 7px 9px;
  border: 1px solid #e2b9ae;
  border-radius: 9px;
  background: #fdf3ef;
  color: #8a3a27;
  font-size: 10.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.sync-error[hidden] {
  display: none;
}

.sync-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #eee7db;
  color: var(--faint);
  font-size: 9.5px;
}

.sync-intro {
  margin-top: 11px;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.7;
}

.sync-note {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px dashed #d8cfbd;
  border-radius: 10px;
  background: #faf6ec;
  color: #7c715d;
  font-size: 9.5px;
  line-height: 1.65;
}

.sync-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.sync-section-title {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sync-section-text {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.sync-field {
  margin: 9px 0;
}

.sync-field > label {
  display: block;
  margin-bottom: 4px;
  color: #5c5548;
  font-size: 11px;
  font-weight: 650;
}

.sync-field input,
.sync-field textarea {
  width: 100%;
  min-height: 39px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 12.5px;
}

.sync-field input:focus,
.sync-field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.sync-field .sync-pair-input {
  display: block;
  line-height: 1.5;
  overflow-wrap: anywhere;
  resize: vertical;
}

.sync-field-hint {
  margin-top: 4px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.55;
}

.sync-form-error {
  margin: 6px 0;
  color: var(--danger);
  font-size: 10.5px;
  line-height: 1.6;
}

.sync-form-error[hidden] {
  display: none;
}

.sync-section .btn-block {
  margin-top: 6px;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.sync-actions .btn {
  flex: 1 1 130px;
}

.sync-hint {
  margin-top: 8px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
}

.sync-code-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #cdbb9a;
  border-radius: 14px;
  background: #fbf5e8;
  text-align: center;
}

.sync-code-label {
  color: #7c6a4a;
  font-size: 10px;
}

.sync-code {
  margin: 5px 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.sync-code-meta {
  color: #8a7a5e;
  font-size: 9.5px;
  line-height: 1.6;
}

.sync-code-card .btn {
  margin-top: 8px;
}

.sync-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.sync-preview-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.sync-preview-item b {
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sync-preview-item span {
  color: var(--muted);
  font-size: 9.5px;
}

.sync-warning {
  margin-top: 9px;
  padding: 7px 9px;
  border: 1px solid #ead9c4;
  border-radius: 9px;
  background: #fbf4e7;
  color: #7a5f36;
  font-size: 10px;
  line-height: 1.6;
}

.sync-conflicts {
  margin-top: 13px;
}

.sync-conflict {
  margin-top: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}

.sync-conflict-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.sync-conflict-kind {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.sync-conflict-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sync-versions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.sync-version {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}

.sync-version:hover {
  border-color: #c9b28a;
  background: #fbf6eb;
}

.sync-version.is-deleted {
  border-color: #e2b9ae;
  background: #fdf3ef;
}

.sync-version b {
  color: var(--ink);
  font-size: 10.5px;
}

.sync-version-text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.sync-empty {
  margin-top: 10px;
  color: var(--faint);
  font-size: 9.5px;
}

@media (max-width: 380px) {
  .sync-code {
    font-size: 20px;
    letter-spacing: 0.1em;
  }

  .sync-actions .btn {
    flex-basis: 100%;
  }

  .choice-sheet {
    padding-left: 14px;
    padding-right: 14px;
  }

  .audio-bar-btn {
    padding: 0 7px;
    font-size: 10px;
  }
}
