/* =========================================================
   时序 · styles
   温润纸张底色 + 松柏绿强调色，克制的阴影与圆角。
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-2: #edf1f8;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #eef2f9;
  --border: #dfe5ef;
  --border-strong: #cbd5e4;
  --text: #1b2433;
  --text-2: #58647a;
  --text-3: #768196;
  --text-inverse: #f7f9ff;
  --accent: #2f6bed;
  --accent-strong: #1f4fc4;
  --accent-soft: #e7efff;
  --accent-ink: #173a86;
  --coral: #c7523d;
  --coral-soft: #fbeae5;
  --amber: #a9702b;
  --amber-soft: #fbf0dd;
  --blue: #2f6bed;
  --violet: #7c6bb0;
  --sage: #4f8a6d;
  --shadow-sm: 0 1px 2px rgba(23, 34, 55, 0.05);
  --shadow-md: 0 10px 30px -18px rgba(23, 34, 55, 0.28);
  --shadow-lg: 0 28px 70px -28px rgba(18, 29, 50, 0.4);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.85, 0.28, 1);
  --hour-h: 68px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-2: #0f1628;
  --surface: #141c2e;
  --surface-2: #192338;
  --surface-3: #1f2b43;
  --border: #26344e;
  --border-strong: #3a4b6b;
  --text: #eef2fb;
  --text-2: #a8b4c9;
  --text-3: #8795ad;
  --text-inverse: #0b1020;
  --accent: #7aa2ff;
  --accent-strong: #a8c2ff;
  --accent-soft: #17284d;
  --accent-ink: #dbe6ff;
  --coral: #ef7c66;
  --coral-soft: #38231e;
  --amber: #e0a65a;
  --amber-soft: #332919;
  --blue: #7aa2ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 34px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 80px -26px rgba(0, 0, 0, 0.85);
}

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

[hidden] {
  display: none !important;
}

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

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

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 105% -8%, rgba(47, 107, 237, 0.08), transparent 70%),
    radial-gradient(900px 560px at -10% 105%, rgba(124, 107, 176, 0.055), transparent 70%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-y: scroll;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 560px at 105% -8%, rgba(122, 162, 255, 0.08), transparent 70%),
    radial-gradient(900px 600px at -10% 105%, rgba(124, 107, 176, 0.06), transparent 70%);
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--accent);
}

::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-3) 34%, transparent);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-3) 55%, transparent);
  border: 3px solid transparent;
  background-clip: content-box;
}

svg {
  display: block;
}

kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
}

/* ---------------- 布局骨架 ---------------- */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 258px;
  width: 258px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 14px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow: hidden;
  z-index: 50;
}

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

.content {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 42px clamp(22px, 4vw, 54px) 96px;
  outline: none;
}

/* ---------------- 品牌 ---------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  margin-bottom: 22px;
}

.brand-mark {
  color: var(--accent-strong);
  display: flex;
  filter: drop-shadow(0 6px 12px rgba(30, 70, 150, 0.2));
}

[data-theme="dark"] .brand-mark {
  color: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.brand-name {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.16em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: var(--text-3);
}

.new-task-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 13px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--accent-strong);
  color: var(--text-inverse);
  font-weight: 550;
  font-size: 14px;
  box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--accent-strong) 80%, transparent);
  transition: transform 0.16s var(--ease), background 0.16s, box-shadow 0.16s;
}

[data-theme="dark"] .new-task-btn {
  background: var(--accent);
  color: #0f2a23;
}

.new-task-btn:hover {
  transform: translateY(-1px);
  background: var(--accent);
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--accent-strong) 75%, transparent);
}

[data-theme="dark"] .new-task-btn:hover {
  background: var(--accent-strong);
}

.new-task-btn:active {
  transform: translateY(0) scale(0.99);
}

.new-task-btn span {
  flex: 1;
  text-align: left;
}

.new-task-btn kbd {
  color: color-mix(in srgb, var(--text-inverse) 62%, transparent);
  border-color: color-mix(in srgb, var(--text-inverse) 26%, transparent);
}

[data-theme="dark"] .new-task-btn kbd {
  color: rgba(15, 42, 35, 0.55);
  border-color: rgba(15, 42, 35, 0.25);
}

/* ---------------- 侧栏导航 ---------------- */

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.14s, color 0.14s;
  text-align: left;
}

.nav-item:hover {
  background: color-mix(in srgb, var(--text) 4.5%, transparent);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 560;
}

[data-theme="dark"] .nav-item.is-active {
  background: var(--surface-3);
}

.nav-icon {
  display: flex;
  color: var(--text-3);
  flex: 0 0 auto;
}

.nav-item.is-active .nav-icon {
  color: var(--accent);
}

.nav-label {
  flex: 1;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.nav-item.is-active .nav-count {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nav-count.is-zero {
  display: none;
}

/* ---------------- 清单 ---------------- */

.lists-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 12px 6px 14px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mini-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--text-3);
  transition: background 0.14s, color 0.14s;
}

.mini-icon:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}

.lists {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  flex: 0 1 auto;
  min-height: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 37px;
  padding: 0 8px 0 14px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  transition: background 0.14s, color 0.14s;
  text-align: left;
}

.list-item:hover {
  background: color-mix(in srgb, var(--text) 4.5%, transparent);
  color: var(--text);
}

.list-item.is-active {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  font-weight: 560;
}

.list-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--c, var(--accent));
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
}

.list-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  padding-right: 4px;
}

.list-edit {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-3);
}

.list-item:hover .list-edit,
.list-item:focus-within .list-edit {
  display: flex;
}

.list-item:hover .list-count {
  display: none;
}

.list-edit:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

/* ---------------- 今日进度卡 ---------------- */

.today-card {
  margin: 8px 2px 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.today-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.today-card-head strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.today-card-head .accent {
  color: var(--accent);
}

.mini-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #b9d9ca));
  transition: width 0.5s var(--ease);
}

.today-card-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-3);
}

/* ---------------- 侧栏底部 ---------------- */

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 0;
  border-top: 1px solid var(--border);
}

.foot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--text-2);
  transition: background 0.14s, color 0.14s;
}

.foot-btn:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}

.foot-brand {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

/* ---------------- 页面头部 ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.page-head-main {
  min-width: 0;
}

.page-head-titleline {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.today-title-ring {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex: 0 0 auto;
}

.page-head--today .page-head-titleline {
  align-items: center;
  gap: 10px;
}

.page-head-titleline .eyebrow {
  margin: 0;
}

.page-title.page-title-inline {
  font-size: clamp(21px, 2.3vw, 27px);
  line-height: 1.2;
  gap: 8px;
}

.page-title.page-title-inline .today-chip {
  height: 22px;
  padding: 0 8px;
  font-size: 10.5px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

.eyebrow .tick {
  width: 16px;
  height: 1px;
  background: color-mix(in srgb, var(--text-3) 55%, transparent);
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 3.3vw, 40px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.today-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transform: translateY(1px);
}

[data-theme="dark"] .today-chip {
  color: var(--accent);
}

.page-sub {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-sub .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
}

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

.tl-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-3);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.tl-lock-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.tl-lock-btn.is-locked {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.timeline-panel.is-locked .tl-task {
  cursor: default;
}

.timeline-panel.is-locked .tl-resize {
  display: none;
}

/* 进度环 */
.ring-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.ring svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}

.ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ring-label {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ring-label strong {
  font-size: 12.5px;
  font-weight: 600;
}

.ring-label span {
  font-size: 10.5px;
  color: var(--text-3);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: transform 0.14s var(--ease), background 0.14s, border-color 0.14s, box-shadow 0.14s;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--text-inverse);
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--accent-strong) 80%, transparent);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #102a23;
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border-color: transparent;
  color: var(--text);
}

.btn-danger {
  color: var(--coral);
  border-color: color-mix(in srgb, var(--coral) 30%, var(--border));
  background: transparent;
}

.btn-danger:hover {
  background: var(--coral-soft);
  border-color: color-mix(in srgb, var(--coral) 45%, var(--border));
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text-2);
  transition: background 0.14s, color 0.14s;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}

/* ---------------- 面板与任务行 ---------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 22px 9px;
}

.section-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  background: var(--surface-3);
}

.panel-head .spacer {
  flex: 1;
}

.panel-head-note {
  font-size: 11.5px;
  color: var(--text-3);
}

.panel-head-note b {
  color: var(--accent);
  font-weight: 650;
}

.panel-head-note.is-accent {
  color: var(--accent);
  font-weight: 600;
}

.panel-head-note .done-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 600;
}

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

.task-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 20px 13px 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  cursor: pointer;
  transition: background 0.14s;
}

.task-row:first-child {
  border-top-color: transparent;
}

.task-row:hover {
  background: var(--surface-2);
}

.task-row.is-done {
  opacity: 0.8;
}

.task-row.is-done:hover {
  opacity: 0.96;
}

.task-row.is-done .task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--text-2) 78%, transparent);
  text-decoration-skip-ink: none;
  color: var(--text-2);
}

.task-check {
  position: relative;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: border-color 0.16s, background 0.16s, color 0.16s, transform 0.16s var(--ease);
}

.task-check::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}

.task-row:hover .task-check {
  border-color: var(--accent);
  color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.task-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.16s, transform 0.2s var(--ease);
}

.task-check:hover {
  transform: scale(1.08);
}

.task-row.is-done .task-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

[data-theme="dark"] .task-row.is-done .task-check {
  color: #0b1b3a;
}

.task-row.is-done .task-check svg {
  opacity: 1;
  transform: scale(1);
}

.task-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
  transition: color 0.14s;
}

.task-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.meta-item svg {
  opacity: 0.8;
}

.meta-item.is-overdue {
  color: var(--coral);
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-3) 60%, transparent);
}

.priority-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}

.priority-flag.p3 {
  color: var(--coral);
  background: var(--coral-soft);
}

.priority-flag.p2 {
  color: var(--amber);
  background: var(--amber-soft);
}

.priority-flag.p1 {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.list-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.list-tag .list-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  box-shadow: none;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.14s, transform 0.14s;
  flex: 0 0 auto;
}

.task-row:hover .task-actions,
.task-row:focus-within .task-actions {
  opacity: 1;
  transform: none;
}

.row-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--text-3);
  transition: background 0.14s, color 0.14s;
}

.row-btn:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}

.row-btn.danger:hover {
  background: var(--coral-soft);
  color: var(--coral);
}

.row-btn.pin-btn.is-pinned {
  color: var(--accent);
  background: var(--accent-soft);
}

.task-row.is-pinned {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* 逾期 */
.overdue-panel {
  border-color: color-mix(in srgb, var(--coral) 26%, var(--border));
  background: color-mix(in srgb, var(--coral) 3.5%, var(--surface));
  margin-bottom: 16px;
}

.overdue-panel .section-title {
  color: var(--coral);
}

.overdue-panel .task-row:hover {
  background: color-mix(in srgb, var(--coral) 5%, var(--surface));
}

.overdue-panel.is-cleared {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  background: color-mix(in srgb, var(--accent) 3.5%, var(--surface));
}

.overdue-panel.is-cleared .section-title {
  color: var(--accent);
}

.overdue-panel.is-cleared .task-row:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

/* 快捷添加 */
.quick-add {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
}

.quick-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.6px dashed var(--border-strong);
  color: var(--text-3);
  flex: 0 0 auto;
}

.quick-add:focus-within .quick-plus {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

.quick-add input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  padding: 4px 0;
}

.quick-add input::placeholder {
  color: var(--text-3);
}

.quick-time {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color 0.14s, border-color 0.14s;
}

.quick-enter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--text-3);
  background: var(--surface);
  font-size: 9.5px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.14s, border-color 0.14s;
}

.quick-enter:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.today-date-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}

.today-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}

.today-nav-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.today-nav-btn.is-soft {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.quick-time:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 54px 24px 58px;
  gap: 4px;
}

.empty-art {
  width: 112px;
  height: 112px;
  margin-bottom: 12px;
  color: var(--accent);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.empty-text {
  font-size: 12.5px;
  color: var(--text-3);
  margin: 4px 0 14px;
  max-width: 300px;
}

/* ---------------- 周日期条 ---------------- */

.week-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

.week-strip {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.day-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 4px 6px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.16s var(--ease);
  overflow: hidden;
}

.day-chip:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.day-chip-name {
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.day-chip-num {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.day-chip.is-today {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.day-chip.is-today .day-chip-name {
  color: var(--accent);
}

.day-chip.is-selected {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--accent-strong) 85%, transparent);
}

[data-theme="dark"] .day-chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
}

.day-chip.is-selected .day-chip-name,
.day-chip.is-selected .day-chip-num {
  color: var(--text-inverse);
}

[data-theme="dark"] .day-chip.is-selected .day-chip-name,
[data-theme="dark"] .day-chip.is-selected .day-chip-num {
  color: #0b1b3a;
}

.day-meter {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-3) 25%, transparent);
  overflow: hidden;
  margin-top: 2px;
}

.day-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.day-chip.is-selected .day-meter {
  background: color-mix(in srgb, var(--text-inverse) 25%, transparent);
}

.day-chip.is-selected .day-meter i {
  background: var(--text-inverse);
}

[data-theme="dark"] .day-chip.is-selected .day-meter {
  background: rgba(15, 38, 32, 0.25);
}

[data-theme="dark"] .day-chip.is-selected .day-meter i {
  background: #0b1b3a;
}

.week-arrows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.week-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  flex: 1;
  min-height: 28px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}

.week-arrow:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* ---------------- 时间线 ---------------- */

.timeline-panel {
  overflow: hidden;
}

.tl-allday {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  min-height: 54px;
}

.tl-allday-label {
  flex: 0 0 48px;
  padding-top: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.tl-allday-items {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 26px;
}

.allday-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  height: 27px;
  padding: 0 10px 0 8px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--c) 26%, var(--border));
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  font-size: 12px;
  color: var(--text);
  transition: background 0.14s, transform 0.14s;
}

.allday-chip:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
}

.allday-chip.is-done {
  opacity: 0.6;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--text-2) 75%, transparent);
  text-decoration-skip-ink: none;
}

.allday-chip .list-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: none;
}

.allday-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.allday-check {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.3px solid color-mix(in srgb, var(--c) 45%, var(--border-strong));
  background: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.allday-check svg {
  width: 9px;
  height: 9px;
  stroke-width: 3.2;
}

.allday-check:hover {
  border-color: var(--c);
  color: color-mix(in srgb, var(--c) 40%, transparent);
}

.allday-chip.is-done .allday-check {
  background: var(--c);
  border-color: var(--c);
  color: #fff;
}

.allday-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
  font-size: 11.5px;
  transition: color 0.14s, border-color 0.14s;
}

.allday-add:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tl-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  min-height: 43px;
}

.tl-toolbar .spacer {
  flex: 1;
}

.tl-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--text-3);
  border: 1px solid transparent;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}

.tl-tool:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tl-tool.is-on {
  color: var(--accent);
  background: var(--accent-soft);
}

[data-theme="dark"] .tl-tool.is-on {
  color: var(--accent);
}

.tl-zoom {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.tl-zoom button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 26px;
  color: var(--text-3);
  background: var(--surface);
  transition: background 0.14s, color 0.14s;
}

.tl-zoom button + button {
  border-left: 1px solid var(--border);
}

.tl-zoom button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tl-zoom button:disabled {
  opacity: 0.35;
}

.tl-scroll {
  position: relative;
  height: calc(100vh - 372px);
  height: calc(100dvh - 372px);
  min-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--surface);
}

.tl-canvas {
  position: relative;
  height: calc(var(--hour-h) * 24);
  user-select: none;
}

.tl-gutter {
  position: absolute;
  left: 0;
  top: 0;
  width: 62px;
  height: 100%;
  border-right: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  pointer-events: none;
}

.tl-hour-label {
  position: absolute;
  right: 11px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  letter-spacing: -0.02em;
}

.tl-hour-label.first {
  transform: translateY(3px);
}

.tl-grid {
  position: absolute;
  left: 62px;
  right: 12px;
  top: 0;
  height: 100%;
}

.tl-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--border) 96%, transparent);
  pointer-events: none;
}

.tl-line.minor {
  background: transparent;
  border-top: 1px dashed color-mix(in srgb, var(--border) 48%, transparent);
}

.tl-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--coral);
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 10%, transparent);
}

.tl-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 16%, transparent);
}

.tl-now-label {
  position: absolute;
  left: -62px;
  top: -9px;
  width: 48px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  padding: 1px 0;
  border-radius: 4px;
}

.tl-task {
  position: absolute;
  left: 5px;
  width: calc(100% - 10px);
  min-height: 18px;
  padding: 3px 8px 2px;
  border-radius: 9px;
  border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 13%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 16%, transparent), 0 1px 2px rgba(20, 30, 25, 0.04);
  cursor: grab;
  touch-action: none;
  z-index: 10;
  overflow: hidden;
  transition: box-shadow 0.15s, background 0.15s, opacity 0.15s;
}

[data-theme="dark"] .tl-task {
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent);
}

[data-theme="dark"] .tl-task:hover {
  background: color-mix(in srgb, var(--c) 21%, var(--surface));
}

.tl-task:hover {
  z-index: 12;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 34%, transparent), 0 6px 16px -8px rgba(20, 30, 25, 0.28);
  background: color-mix(in srgb, var(--c) 18%, var(--surface));
}

.tl-task.is-done {
  opacity: 0.6;
}

.tl-task.is-done .tl-task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--text-2) 75%, transparent);
  text-decoration-skip-ink: none;
}

.tl-task.is-dragging {
  z-index: 60;
  cursor: grabbing;
  box-shadow: 0 18px 34px -14px rgba(20, 30, 25, 0.45), inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent);
  opacity: 0.96;
  transition: none;
}

body.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.tl-task-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  height: 100%;
  padding-right: 16px;
}

.tl-task-title {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.28;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.tl-task-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.tl-task-time svg {
  opacity: 0.65;
}

.tl-task.short .tl-task-time {
  display: none;
}

.tl-task.short .tl-task-title,
.tl-task.tight .tl-task-title {
  -webkit-line-clamp: 1;
}

.tl-task.short .tl-task-title {
  font-size: 11.5px;
}

.tl-resize {
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  z-index: 3;
  cursor: ns-resize;
}

.tl-resize::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 24px;
  height: 3px;
  margin-left: -12px;
  border-radius: 3px;
  background: var(--c);
  opacity: 0;
  transition: opacity 0.14s;
}

.tl-resize.top {
  top: 0;
}

.tl-resize.top::after {
  top: 2px;
}

.tl-resize.bottom {
  bottom: 0;
}

.tl-resize.bottom::after {
  bottom: 2px;
}

.tl-task:hover .tl-resize::after {
  opacity: 0.45;
}

.tl-task.is-resizing .tl-resize::after {
  opacity: 0.8;
}

.tl-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, var(--border-strong));
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s, background 0.14s, color 0.14s;
  z-index: 4;
}

.tl-check svg {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}

.tl-task:hover .tl-check,
.tl-task:focus-within .tl-check {
  opacity: 1;
}

.tl-check:hover {
  background: var(--c);
  color: var(--text-inverse);
}

.tl-task.is-done .tl-check {
  opacity: 1;
  background: var(--c);
  color: var(--text-inverse);
}

.tl-empty {
  position: absolute;
  left: 62px;
  right: 12px;
  top: calc(var(--hour-h) * 8.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  pointer-events: none;
  color: var(--text-3);
}

.tl-empty-title {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
}

.tl-empty-text {
  font-size: 11.5px;
}

.tl-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.tl-hint-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.tl-hint-item svg {
  opacity: 0.7;
}

.tl-footer .spacer {
  flex: 1;
}

.tl-load {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 拖动时间提示 */
.drag-tip {
  position: fixed;
  z-index: 300;
  transform: translate(-50%, -150%);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.4);
}

.drag-tip .muted {
  font-weight: 500;
  opacity: 0.6;
  margin-left: 5px;
}

/* ---------------- 全部任务 ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 210px;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 13px;
  color: var(--text-3);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.search-box input::placeholder {
  color: var(--text-3);
}

.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.search-clear {
  position: absolute;
  right: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--text-3);
}

.search-clear:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}

.filter-select {
  height: 40px;
  padding: 0 32px 0 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2392998f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  color: var(--text-2);
  font-size: 12.5px;
  appearance: none;
  cursor: pointer;
}

.group {
  margin-bottom: 22px;
}

.group-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 0 4px 8px;
}

.group-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.group-date {
  font-size: 11px;
  color: var(--text-3);
}

.group-count {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.group.is-overdue .group-title {
  color: var(--coral);
}

.list-header-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--c);
  margin-right: 2px;
}

/* ---------------- 已完成 ---------------- */

.completed-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.completed-row:first-child {
  border-top-color: transparent;
}

.completed-row:hover {
  background: var(--surface-2);
}

.completed-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.completed-title {
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--text-2) 70%, transparent);
  text-decoration-skip-ink: none;
  word-break: break-word;
}

.completed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.completed-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.14s;
}

.completed-row:hover .completed-actions,
.completed-row:focus-within .completed-actions {
  opacity: 1;
}

/* ---------------- 弹窗 ---------------- */

#modalRoot {
  position: relative;
  z-index: 200;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(18, 27, 22, 0.42);
  backdrop-filter: blur(5px) saturate(0.9);
  -webkit-backdrop-filter: blur(5px) saturate(0.9);
  animation: fadeIn 0.18s ease both;
  z-index: 200;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal {
  width: min(620px, 100%);
  max-height: min(90vh, 920px);
  max-height: min(90dvh, 920px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.24s var(--ease) both;
  overflow: hidden;
  outline: none;
}

.modal:focus {
  outline: none;
}

.modal.modal-sm {
  width: min(460px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 4px;
}

.modal-head-text {
  min-width: 0;
}

.modal-eyebrow {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 3px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--text-3);
  flex: 0 0 auto;
}

.modal-close:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}

.modal-body {
  padding: 14px 24px 6px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 42%, var(--surface));
}

.modal-foot .spacer {
  flex: 1;
}

.modal-foot-note {
  font-size: 10.5px;
  color: var(--text-3);
}

/* 表单 */
.title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: none;
  background: transparent;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  padding: 4px 0 8px;
  color: var(--text);
  transition: border-color 0.16s;
}

.title-input:focus {
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.title-input::placeholder {
  color: var(--text-3);
  font-weight: 500;
}

.notes-input {
  width: 100%;
  min-height: 62px;
  max-height: 180px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.notes-input::placeholder {
  color: var(--text-3);
}

.notes-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
  background: var(--surface);
}

.field {
  margin-top: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}

.field-label .optional {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-3);
  opacity: 0.8;
}

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

.input,
.select-input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.input:focus,
.select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.input:disabled,
.select-input:disabled {
  opacity: 0.5;
  background: var(--surface-2);
}

.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2392998f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.time-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.all-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
}

.all-day-toggle input {
  appearance: none;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
  margin: 0;
}

.all-day-toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s var(--ease);
}

.all-day-toggle input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.all-day-toggle input:checked::after {
  transform: translateX(12px);
  background: #fff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.14s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip:active {
  transform: scale(0.98);
}

.chip.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent-ink);
  font-weight: 600;
}

[data-theme="dark"] .chip.is-active {
  color: var(--accent);
}

.chip .list-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: none;
}

.priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.chip.p-high.is-active {
  background: var(--coral-soft);
  border-color: color-mix(in srgb, var(--coral) 40%, var(--border));
  color: var(--coral);
}

.chip.p-mid.is-active {
  background: var(--amber-soft);
  border-color: color-mix(in srgb, var(--amber) 40%, var(--border));
  color: var(--amber);
}

.chip.p-low.is-active {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  border-color: color-mix(in srgb, var(--blue) 40%, var(--border));
  color: var(--blue);
}

.repeat-detail {
  margin-top: 10px;
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repeat-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-2);
}

.interval-input {
  width: 48px;
  height: 30px;
  text-align: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.interval-input:focus {
  border-color: var(--accent);
}

.weekday-picker {
  display: flex;
  gap: 6px;
}

.weekday-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.weekday-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.weekday-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

[data-theme="dark"] .weekday-btn.is-active {
  color: #0b1b3a;
}

.until-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}

.until-row .input {
  width: 150px;
  height: 31px;
  font-size: 12px;
}

.link-btn {
  font-size: 11.5px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hint {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}

.override-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--amber) 24%, var(--border));
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.45;
}

.override-row input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.override-row strong {
  color: var(--text);
  font-weight: 600;
}

/* 清单颜色 */
.color-swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid transparent;
  background: var(--c);
  position: relative;
  transition: transform 0.14s;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.is-active {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--c);
}

.swatch.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center / 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

/* ---------------- 设置 ---------------- */

.settings-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.settings-section:first-child {
  border-top: 0;
  padding-top: 4px;
}

.settings-title {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
  transition: border-color 0.14s, background 0.14s;
}

.theme-option:hover {
  border-color: var(--border-strong);
}

.theme-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

[data-theme="dark"] .theme-option.is-active {
  color: var(--accent);
}

.theme-preview {
  width: 100%;
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: #f4f6fb;
}

.theme-preview.dark {
  background: #0b1020;
  border-color: #26344e;
}

.theme-preview.auto {
  background: linear-gradient(100deg, #f4f6fb 0 50%, #0b1020 50% 100%);
}

.theme-preview::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 45%;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.2;
}

.theme-preview::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  width: 70%;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.12;
}

.theme-option .label {
  font-weight: 550;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.setting-row strong {
  color: var(--text);
  font-weight: 550;
}

.setting-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-status {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

body.auth-locked .sidebar,
body.auth-locked .main,
body.auth-locked .mobile-nav,
body.auth-locked .fab,
body.auth-locked .scrim {
  visibility: hidden;
}

.device-list {
  display: grid;
  gap: 8px;
}

.device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

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

.device-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.device-current {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 500;
}

.device-meta {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-key {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  word-break: break-all;
  user-select: all;
}

.kbd-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}

.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 0;
}

.kbd-row kbd {
  color: var(--text-2);
  border-color: var(--border-strong);
  background: var(--surface-2);
  font-size: 10px;
  min-width: 22px;
  text-align: center;
}

.about-text {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.65;
}

/* ---------------- 打卡 ---------------- */

.habit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.habit-period-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.habit-nav-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  color: var(--text-2);
}

.habit-nav-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.habit-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.habit-period-label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 158px;
  padding: 0 5px;
}

.habit-period-label strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.habit-period-label span {
  font-size: 11.5px;
  color: var(--text-3);
}

.habit-today-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.habit-today-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}

.habit-today-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.segmented button {
  height: 28px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .segmented button.is-active {
  background: var(--surface-2);
}

/* 日视图 */

.habit-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.habit-panel-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.habit-panel-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

.habit-total {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.habit-progress {
  width: 190px;
  max-width: 42%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.habit-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #b9d9ca));
  transition: width 0.45s var(--ease);
}

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

.habit-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  cursor: pointer;
  transition: background 0.14s;
}

.habit-row:first-child {
  border-top: 0;
}

.habit-row:hover {
  background: var(--surface-2);
}

.habit-row.is-done {
  background: color-mix(in srgb, var(--accent) 3.5%, var(--surface));
}

.habit-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 20%, transparent);
  font-size: 15px;
  font-weight: 650;
}

[data-theme="dark"] .habit-avatar {
  background: color-mix(in srgb, var(--c) 18%, var(--surface));
}

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

.habit-name {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-row.is-done .habit-name {
  color: var(--text-2);
}

.habit-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

.habit-meta-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-state {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.habit-state.is-done {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

[data-theme="dark"] .habit-state.is-done {
  color: var(--accent);
}

.habit-state.is-open {
  color: var(--amber);
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 24%, transparent);
}

.habit-recent {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 4px;
}

.habit-mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid transparent;
  display: inline-block;
}

.habit-mini-dot.is-on {
  background: var(--accent);
}

.habit-mini-dot.is-due {
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--text-2));
  background: transparent;
}

.habit-mini-dot.is-off {
  background: color-mix(in srgb, var(--text-3) 14%, transparent);
}

.habit-mini-dot.is-future {
  opacity: 0.3;
}

.habit-check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px dashed color-mix(in srgb, var(--c) 45%, var(--text-2));
  background: color-mix(in srgb, var(--c) 6%, var(--surface));
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.16s var(--ease);
}

.habit-check svg {
  width: 17px;
  height: 17px;
  stroke-width: 3;
}

.habit-check:hover {
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: color-mix(in srgb, var(--c) 55%, var(--text-2));
  transform: scale(1.04);
}

.habit-check.is-checked {
  border-style: solid;
  border-color: var(--c);
  background: var(--c);
  color: #fff;
  box-shadow: 0 7px 16px -9px color-mix(in srgb, var(--c) 80%, transparent);
}

.habit-check.just-checked {
  animation: pop 0.32s var(--ease);
}

.habit-foot {
  padding: 11px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
  font-size: 11px;
  color: var(--text-3);
}

.habit-rest {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 52px 24px;
}

.habit-rest-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.habit-rest h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.habit-rest p {
  margin: 5px 0 16px;
  font-size: 12.5px;
  color: var(--text-3);
  max-width: 320px;
}

.empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 周视图 */

.habit-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}

.habit-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-3);
}

.habit-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

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

.habit-legend-dot.is-due {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--text-2));
  background: transparent;
}

.habit-week-scroll {
  overflow-x: auto;
}

.habit-week-grid {
  display: grid;
  grid-template-columns: minmax(146px, 1.35fr) repeat(7, minmax(34px, 1fr));
  gap: 4px;
  padding: 12px 16px 8px;
  align-items: center;
}

.habit-week-corner {
  padding-left: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.habit-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 0;
  border-radius: 8px;
  font-size: 10px;
  color: var(--text-3);
}

.habit-week-day strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.habit-week-day.is-today {
  background: var(--accent-soft);
  color: var(--accent);
}

.habit-week-day.is-today strong {
  color: var(--accent);
}

.habit-week-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 0;
  cursor: pointer;
}

.habit-week-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--c) 13%, var(--surface));
  color: var(--c);
  font-size: 12px;
  font-weight: 650;
}

.habit-week-name-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.habit-week-name-text strong {
  font-size: 12px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-week-name-text small {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.habit-week-cell {
  width: 34px;
  height: 34px;
  justify-self: center;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--c) 45%, var(--text-2));
  background: color-mix(in srgb, var(--c) 6%, transparent);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.14s, border-color 0.14s, transform 0.14s;
}

button.habit-week-cell:hover {
  background: color-mix(in srgb, var(--c) 16%, transparent);
  transform: scale(1.06);
}

.habit-week-cell.is-checked {
  border-style: solid;
  border-color: var(--c);
  background: var(--c);
  color: #fff;
}

.habit-week-cell.is-off,
.habit-week-cell.is-future {
  border-color: transparent;
  background: transparent;
}

.habit-week-cell.is-future {
  opacity: 0.55;
}

.habit-week-cell.is-future::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.55;
}

.habit-week-cell.is-today {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.habit-week-cell.just-checked {
  animation: pop 0.32s var(--ease);
}

.habit-week-cell svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

/* 月视图 */

.habit-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.habit-stat-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.habit-stat-card span {
  font-size: 11px;
  color: var(--text-3);
}

.habit-stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.habit-stat-card strong i {
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.habit-stat-bar {
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.habit-stat-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.habit-month-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.habit-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px 9px;
}

.habit-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 6px 16px;
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
}

.habit-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 6px 16px 16px;
}

.habit-cal-cell {
  min-height: 66px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  transition: border-color 0.14s, transform 0.14s, box-shadow 0.14s;
}

button.habit-cal-cell:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.habit-cal-cell.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.habit-cal-cell.is-future {
  opacity: 0.4;
}

.habit-cal-cell.is-blank {
  border-color: transparent;
  background: transparent;
}

.habit-cal-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.habit-cal-frac {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.habit-cal-bar {
  margin-top: auto;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-3) 18%, transparent);
  overflow: hidden;
}

.habit-cal-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.habit-summary-list {
  display: flex;
  flex-direction: column;
}

.habit-summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  cursor: pointer;
  transition: background 0.14s;
}

.habit-summary-row:first-child {
  border-top: 0;
}

.habit-summary-row:hover {
  background: var(--surface-2);
}

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

.habit-summary-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.habit-summary-top strong {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-summary-top span {
  color: var(--text-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.habit-summary-bar {
  height: 4px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.habit-summary-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

/* 年视图 */

.habit-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.habit-year-month {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.14s, box-shadow 0.14s;
}

.habit-year-month:hover:not(:disabled) {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.habit-year-month.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.habit-year-month.is-future {
  opacity: 0.42;
  cursor: default;
}

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

.habit-year-month-head strong {
  font-size: 12.5px;
  font-weight: 600;
}

.habit-year-month-head span {
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.habit-mini-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.habit-mini-cell {
  aspect-ratio: 1;
  border-radius: 2.5px;
  background: var(--surface-3);
}

.habit-mini-cell.is-blank {
  background: transparent;
}

.habit-mini-cell.is-today {
  box-shadow: 0 0 0 1.5px var(--accent);
}

.habit-mini-cell.is-future {
  opacity: 0.35;
}

.habit-legend-foot {
  margin-top: 14px;
  padding: 0 2px;
}

/* 打卡弹窗 */

.habit-weekday-slot {
  margin-top: 10px;
}

.habit-weekday-slot:empty {
  margin-top: 0;
}

.habit-preview {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .habit-preview {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .habit-year-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .habit-month-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .habit-toolbar {
    gap: 10px;
    margin-bottom: 14px;
  }

  .habit-period-nav {
    flex: 1;
    width: 100%;
    justify-content: space-between;
  }

  .habit-period-label {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .habit-period-label strong {
    font-size: 14px;
  }

  .habit-today-btn {
    flex: 0 0 auto;
  }

  .habit-segmented {
    width: 100%;
  }

  .habit-segmented button {
    flex: 1;
    padding: 0;
  }

  .habit-day-head {
    padding: 15px 16px;
    gap: 12px;
  }

  .habit-progress {
    width: 120px;
    max-width: 42%;
  }

  .habit-row {
    padding: 13px 14px;
    gap: 10px;
  }

  .habit-avatar {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    font-size: 14px;
  }

  .habit-name {
    font-size: 14px;
  }

  .habit-meta {
    font-size: 11.5px;
  }

  .habit-recent {
    display: none;
  }

  .habit-check {
    width: 38px;
    height: 38px;
  }

  .habit-foot {
    padding: 10px 14px;
    font-size: 10.5px;
  }

  .habit-stat-grid {
    gap: 8px;
  }

  .habit-stat-card {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .habit-stat-card span {
    font-size: 10px;
  }

  .habit-stat-card strong {
    font-size: 20px;
  }

  .habit-stat-card strong i {
    font-size: 10px;
  }

  .habit-month-layout {
    gap: 12px;
  }

  .habit-weekdays {
    gap: 4px;
    padding: 4px 10px;
  }

  .habit-calendar {
    gap: 4px;
    padding: 5px 10px 12px;
  }

  .habit-cal-cell {
    min-height: 54px;
    padding: 5px;
    border-radius: 8px;
  }

  .habit-cal-day {
    font-size: 11px;
  }

  .habit-cal-frac {
    font-size: 9px;
  }

  .habit-week-grid {
    grid-template-columns: minmax(88px, 1.15fr) repeat(7, minmax(26px, 1fr));
    gap: 3px;
    padding: 10px 8px 6px;
  }

  .habit-week-cell {
    width: 28px;
    height: 28px;
  }

  .habit-week-avatar {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 11px;
  }

  .habit-week-name {
    gap: 6px;
  }

  .habit-week-name-text strong {
    font-size: 11px;
  }

  .habit-week-name-text small {
    font-size: 9px;
  }

  .habit-week-day strong {
    font-size: 12px;
  }

  .habit-week-day span {
    font-size: 9px;
  }

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

  .habit-year-month {
    padding: 10px;
  }

  .habit-legend-foot {
    margin-top: 10px;
  }

  body[data-view="habits"] .fab {
    display: none;
  }
}

@media (max-width: 420px) {
  .mobile-nav-item {
    font-size: 9px;
  }

  .habit-stat-card strong {
    font-size: 18px;
  }

  .habit-cal-cell {
    min-height: 48px;
  }
}

/* ---------------- 备忘录 ---------------- */

.memo-day-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 16px;
  align-items: start;
}

.memo-editor {
  overflow: hidden;
}

.memo-format-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 22px 10px;
}

.memo-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.memo-tool:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.memo-format-hint {
  margin-left: auto;
  color: var(--text-3);
  font-size: 9.5px;
}

.memo-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 14px;
}

.memo-image-item {
  position: relative;
  width: 94px;
  height: 94px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.memo-image-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.memo-image-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memo-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(20, 24, 22, 0.62);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.78;
  transition: opacity 0.14s, background 0.14s;
}

.memo-image-item:hover .memo-image-remove {
  opacity: 1;
  background: rgba(20, 24, 22, 0.82);
}

.memo-image-remove svg {
  width: 11px;
  height: 11px;
}

.modal.modal-image {
  width: auto;
  max-width: 94vw;
  max-height: 92vh;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.image-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 94vw;
  max-height: 92vh;
}

.image-viewer-img {
  display: block;
  max-width: 94vw;
  max-height: 84vh;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.6);
}

.image-viewer-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 22, 0.78);
  color: #fff;
}

.image-viewer-caption {
  margin-top: 8px;
  color: #fff;
  font-size: 11.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.memo-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 12px;
}

.memo-eyebrow {
  margin: 0 0 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.memo-date-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.memo-editor-sub {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.memo-save-status {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.memo-input {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: 8px 22px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.85;
  resize: vertical;
}

.memo-input:focus {
  outline: none;
}

.memo-rich {
  min-height: 250px;
  max-height: 520px;
  overflow-y: auto;
  white-space: normal;
}

.memo-rich p,
.memo-rich div {
  margin: 0 0 7px;
}

.memo-rich ol,
.memo-rich ul {
  margin: 4px 0 9px;
  padding-left: 1.55em;
}

.memo-rich li {
  margin: 3px 0;
  padding-left: 2px;
}

.memo-rich li::marker {
  font-weight: 800;
  color: var(--text);
}

.memo-rich strong,
.memo-rich b {
  font-weight: 700;
}

.memo-rich:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  opacity: 0.85;
}

.memo-input::placeholder {
  color: var(--text-3);
  opacity: 0.85;
}

.memo-editor-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  font-size: 10.5px;
  color: var(--text-3);
}

.memo-autosave-hint {
  color: var(--text-3);
}

.memo-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}

.memo-panel-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.memo-panel-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
}

.memo-panel-tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10.5px;
}

.memo-activity-list {
  display: flex;
  flex-direction: column;
}

.memo-activity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 18px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 0.14s;
}

.memo-activity:first-child {
  border-top: 0;
}

.memo-activity:hover {
  background: var(--surface-2);
}

.memo-activity-time {
  width: 36px;
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.memo-activity-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
}

.memo-activity-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.memo-activity-title {
  font-size: 12.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-activity-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  color: var(--text-3);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-auto-tag {
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 600;
}

[data-theme="dark"] .memo-auto-tag {
  color: var(--accent);
}

.memo-activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 22px;
  gap: 3px;
  color: var(--text-3);
}

.memo-activity-empty svg {
  color: var(--text-3);
  opacity: 0.6;
  margin-bottom: 6px;
}

.memo-activity-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.memo-activity-empty span {
  font-size: 11.5px;
}

.memo-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.memo-day-card {
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 13px 13px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 0.14s, transform 0.14s, box-shadow 0.14s;
}

.memo-day-card:hover:not(:disabled) {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.memo-day-card.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.memo-day-card.is-future {
  opacity: 0.45;
  cursor: default;
}

.memo-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-3);
  font-size: 10.5px;
}

.memo-day-head strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.memo-day-card.is-today .memo-day-head,
.memo-day-card.is-today .memo-day-head strong {
  color: var(--accent);
}

.memo-day-counts {
  margin-top: 7px;
  color: var(--text-3);
  font-size: 10px;
}

.memo-day-excerpt {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memo-day-memo-dot {
  width: 6px;
  height: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-radius: 50%;
  background: var(--violet);
}

.memo-week-review {
  overflow: hidden;
}

.memo-review-day {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
}

.memo-review-day:first-of-type {
  border-top: 0;
}

.memo-review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.memo-review-head:hover .memo-review-date {
  color: var(--accent);
}

.memo-review-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.14s;
}

.memo-review-counts {
  color: var(--text-3);
  font-size: 10.5px;
  white-space: nowrap;
}

.memo-review-excerpt {
  margin: 8px 0 0;
  padding: 8px 11px;
  border-left: 2px solid var(--violet);
  border-radius: 0 7px 7px 0;
  background: color-mix(in srgb, var(--violet) 5%, var(--surface-2));
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
}

.memo-review-activity {
  margin-top: 4px;
}

.memo-review-activity .memo-activity {
  padding: 8px 0;
  border-top: 1px dashed color-mix(in srgb, var(--border) 65%, transparent);
}

.memo-review-activity .memo-activity:hover {
  background: transparent;
}

.memo-cal-marks {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 10px;
}

.memo-cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--violet);
  display: inline-block;
}

.memo-cal-count {
  color: var(--text-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.memo-cal-image {
  color: var(--violet);
  font-size: 9px;
  white-space: nowrap;
}

.memo-cal-cell.has-memo {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 30%, transparent);
}

.memo-cal-cell.has-memo.is-today {
  box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 1px color-mix(in srgb, var(--violet) 35%, transparent);
}

.memo-list-panel {
  overflow: hidden;
}

.memo-list-scroll {
  max-height: 515px;
  overflow-y: auto;
}

.memo-list-row {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  background: transparent;
  text-align: left;
  transition: background 0.14s;
}

.memo-list-row:first-child {
  border-top: 0;
}

.memo-list-row:hover {
  background: var(--surface-2);
}

.memo-list-date {
  flex: 0 0 auto;
  width: 48px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.memo-list-date small {
  display: block;
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 400;
}

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

.memo-list-main strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 450;
  line-height: 1.55;
}

.memo-list-main small {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 10px;
}

.memo-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  display: inline-block;
}

.habit-mini-cell.has-memo {
  position: relative;
}

.habit-mini-cell.has-memo::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--violet);
}

.memo-year-month .habit-year-month-head span {
  color: var(--violet);
}

@media (max-width: 980px) {
  .memo-day-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body .mobile-nav-item {
    font-size: 9.2px;
    gap: 1px;
    min-width: 0;
    padding: 0 2px;
    overflow: hidden;
  }

  body .mobile-nav-item > span:last-child {
    white-space: nowrap;
  }

  body .mobile-nav-icon {
    width: 26px;
  }

  body .mobile-nav {
    padding-left: 4px;
    padding-right: 4px;
  }

  body[data-view="memo"] .fab,
  body[data-view="notes"] .fab {
    display: none;
  }

  .memo-toolbar .habit-period-nav {
    width: 100%;
  }

  .memo-editor-head {
    padding: 16px 16px 8px;
  }

  .memo-format-bar {
    padding: 0 16px 8px;
  }

  .memo-format-hint {
    width: 100%;
    margin-left: 0;
  }

  .memo-images {
    padding: 0 16px 12px;
  }

  .memo-image-item {
    width: 78px;
    height: 78px;
  }

  .memo-date-title {
    font-size: 17px;
  }

  .memo-input {
    min-height: 210px;
    padding: 6px 16px 12px;
    font-size: 14px;
  }

  .memo-editor-foot {
    padding: 9px 16px;
  }

  .memo-activity {
    padding: 10px 14px;
  }

  .memo-activity-time {
    width: 32px;
  }

  .memo-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .memo-day-card {
    min-height: 128px;
    padding: 11px;
  }

  .memo-day-head strong {
    font-size: 17px;
  }

  .memo-review-day {
    padding: 13px 14px;
  }

  .memo-list-scroll {
    max-height: none;
  }

  .memo-list-row {
    padding: 12px 14px;
  }

  .memo-list-date {
    width: 44px;
  }

  .memo-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------- 备忘便签 ---------------- */

.notes-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.note-folder-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.note-folder-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.note-folder-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1 1 0;
  max-width: 112px;
  min-width: 0;
  gap: 0;
}

.note-folder-wrap .note-folder-chip {
  width: 100%;
}

.note-folder-chip:not(.has-delete) {
  flex: 1 1 0;
  max-width: 112px;
  min-width: 0;
}

.note-folder-add {
  flex: 1 1 0;
  max-width: 112px;
  min-width: 0;
  justify-content: center;
}

.note-folder-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 6px;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.14s, background 0.14s, color 0.14s;
}

.note-folder-wrap:hover .note-folder-del,
.note-folder-del:focus {
  opacity: 1;
  pointer-events: auto;
}

.note-folder-wrap:hover .note-folder-chip span {
  opacity: 0;
}

.note-folder-del:hover {
  opacity: 1;
  background: var(--coral-soft);
  color: var(--coral);
}

.folder-delete-action {
  width: 100%;
  height: 44px;
  justify-content: center;
}

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

.note-folder-hint {
  display: none;
}

.note-folder-chip span {
  color: var(--text-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.note-folder-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.note-folder-chip.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  color: var(--accent-ink);
}

[data-theme="dark"] .note-folder-chip.is-active {
  color: var(--accent);
}

.note-folder-chip.is-active span {
  color: inherit;
  opacity: 0.7;
}

.note-folder-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--text-3);
  font-size: 11.5px;
}

.note-folder-add:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.note-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 150px;
  padding: 16px 17px 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  overflow: hidden;
  transition: border-color 0.14s, transform 0.14s, box-shadow 0.14s;
}

.note-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.note-card-title {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--text-3);
  font-size: 10px;
}

.note-card-arrow {
  display: flex;
  color: var(--text-3);
}

.note-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-modal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 11.5px;
}

.note-folder-select {
  height: 30px;
  margin-left: 4px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
}

.note-format-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.note-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
}

.note-tool:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.note-editor {
  min-height: 310px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  outline: none;
}

.note-editor:focus {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.note-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
}

.note-editor p,
.note-editor div {
  margin: 0 0 7px;
}

.note-editor ol,
.note-editor ul {
  margin: 4px 0 9px;
  padding-left: 1.55em;
}

.note-editor li {
  margin: 3px 0;
}

.note-editor li::marker {
  font-weight: 800;
  color: var(--text);
}

.note-editor strong,
.note-editor b {
  font-weight: 700;
}

.note-editor img {
  display: block;
  max-width: 100%;
  max-height: 340px;
  margin: 8px 0;
  border-radius: 9px;
  object-fit: contain;
}

.note-todo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
}

.note-box {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 3px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

.note-todo[data-checked="1"] .note-box {
  background: var(--accent);
  border-color: var(--accent);
}

.note-todo[data-checked="1"] .note-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.note-todo-text {
  flex: 1;
  min-width: 0;
  min-height: 1.75em;
  outline: none;
}

.note-todo[data-checked="1"] .note-todo-text {
  color: var(--text-3);
  text-decoration: line-through;
}

@media (max-width: 980px) {
  .note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  body .mobile-nav {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    right: auto;
  }

  .note-grid,
  .note-card {
    max-width: calc(100vw - 48px);
  }

  .note-card-text {
    max-width: 100%;
  }

  .note-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .note-folder-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .note-folder-chip,
  .note-folder-add {
    flex: 0 0 auto;
  }

  .note-editor {
    min-height: 250px;
    max-height: 44vh;
  }

  .note-format-bar {
    gap: 5px;
  }

  .note-tool {
    padding: 0 8px;
    font-size: 11px;
  }
}

/* ---------------- 提示条 ---------------- */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 12.5px;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.26s var(--ease) both;
}

.toast .toast-msg {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast .toast-action {
  color: color-mix(in srgb, var(--accent) 65%, var(--bg));
  font-weight: 650;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
}

[data-theme="dark"] .toast .toast-action {
  color: var(--accent);
}

.toast .toast-action:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toast .toast-close {
  color: color-mix(in srgb, var(--bg) 55%, transparent);
  display: flex;
  align-items: center;
}

/* ---------------- 移动端 ---------------- */

.mobile-bar,
.mobile-nav,
.fab,
.scrim {
  display: none;
}

@media (max-width: 1020px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-104%);
    transition: transform 0.28s var(--ease);
    box-shadow: var(--shadow-lg);
    width: 276px;
    flex-basis: 276px;
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(18, 27, 22, 0.38);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s;
    z-index: 45;
  }

  body.sidebar-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .mobile-nav,
  body.sidebar-open .fab {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 40;
    height: 54px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  }

  .mobile-brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.14em;
  }

  .mobile-mark {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  .content {
    padding: 26px 20px 108px;
  }

  .list-edit {
    display: flex;
  }

  .list-item:hover .list-count {
    display: inline;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border-top: 1px solid var(--border);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 48px;
    border-radius: 10px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 500;
  }

  .mobile-nav-item.is-active {
    color: var(--accent);
  }

  .mobile-nav-item.is-active .mobile-nav-icon {
    background: var(--accent-soft);
  }

  .mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 24px;
    border-radius: 8px;
  }

  .fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 18px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 61;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--accent-strong);
    color: var(--text-inverse);
    box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--accent-strong) 70%, transparent);
    transition: transform 0.16s var(--ease);
  }

  [data-theme="dark"] .fab {
    background: var(--accent);
    color: #0b1b3a;
  }

  .fab:active {
    transform: scale(0.94);
  }

  .toast-root {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  .head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .head-actions .btn-primary {
    flex: 1;
  }

  .page-title {
    font-size: 29px;
  }

  .page-sub {
    font-size: 12.5px;
  }

  .ring-card {
    padding-right: 10px;
  }

  .ring-label {
    display: none;
  }

  .week-row {
    gap: 5px;
  }

  .week-strip {
    gap: 4px;
  }

  .day-chip {
    padding: 7px 2px 6px;
    border-radius: 10px;
  }

  .day-chip-num {
    font-size: 15px;
  }

  .day-chip-name {
    font-size: 9px;
  }

  .day-meter {
    width: 14px;
  }

  .week-arrow {
    width: 26px;
  }

  .tl-scroll {
    height: calc(100vh - 544px);
    height: calc(100dvh - 544px);
    min-height: 260px;
  }

  body[data-view="timeline"] .content {
    padding-bottom: 18px;
  }

  body[data-view="timeline"] .fab {
    display: none;
  }

  .tl-gutter {
    width: 48px;
  }

  .tl-grid {
    left: 48px;
    right: 8px;
  }

  .tl-hour-label {
    right: 7px;
    font-size: 9px;
  }

  .tl-now-label {
    left: -48px;
    width: 38px;
    font-size: 9px;
  }

  .tl-task {
    padding: 3px 5px 2px;
  }

  .tl-check {
    opacity: 1;
  }

  .tl-task-title {
    font-size: 11.5px;
  }

  .tl-task-time {
    font-size: 9.5px;
  }

  .tl-empty {
    left: 48px;
    right: 8px;
  }

  .tl-footer {
    gap: 10px;
    font-size: 10px;
    padding: 8px 12px;
  }

  .tl-hint-item.hide-sm {
    display: none;
  }

  .toolbar {
    gap: 8px;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .task-row {
    padding: 12px 14px;
  }

  .task-actions {
    display: none;
    opacity: 1;
    transform: none;
    position: absolute;
    right: 8px;
    top: 50%;
    z-index: 2;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: translateY(-50%);
  }

  .task-row.is-actions-open .task-actions {
    display: flex;
  }

  .task-row.is-actions-open .task-main {
    padding-right: 102px;
  }

  .task-row.is-actions-open {
    background: var(--surface-2);
  }

  .task-actions .row-btn:not(.danger):not(.pin-btn):not(.undo-btn) {
    display: none;
  }

  .panel-head {
    padding: 15px 16px 8px;
  }

  .quick-add {
    padding: 10px 14px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    animation: sheetIn 0.28s var(--ease) both;
  }

  .modal-head {
    padding: 18px 20px 2px;
  }

  .modal-body {
    padding: 12px 20px 10px;
  }

  .modal-foot {
    padding: 13px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .title-input {
    font-size: 20px;
    padding: 2px 0 6px;
  }

  .notes-input {
    min-height: 54px;
  }

  .field {
    margin-top: 14px;
  }

  .field-label {
    margin-bottom: 6px;
  }

  .chip {
    height: 32px;
    padding: 0 10px;
    gap: 5px;
    font-size: 12px;
  }

  .input,
  .select-input,
  .notes-input,
  .search-box input,
  .quick-add input,
  .filter-select {
    font-size: 16px;
  }

  .quick-enter {
    display: inline-flex;
  }

  .quick-add {
    gap: 7px;
    padding: 10px 12px;
  }

  .quick-time {
    padding: 4px 6px;
  }

  .today-date-nav {
    order: -1;
    margin-right: 0;
  }

  .title-input {
    font-size: 20px;
  }

  .modal-foot-note {
    display: none;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .theme-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .kbd-list {
    grid-template-columns: 1fr;
  }

  .toast {
    max-width: 100%;
  }

  .completed-actions {
    display: none;
    opacity: 1;
    position: absolute;
    right: 8px;
    top: 50%;
    z-index: 2;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: translateY(-50%);
  }

  .completed-row {
    position: relative;
  }

  .completed-row.is-actions-open .completed-actions {
    display: flex;
  }

  .completed-row.is-actions-open .completed-main {
    padding-right: 100px;
  }

  .completed-row.is-actions-open {
    background: var(--surface-2);
  }

  .note-folder-del {
    display: none;
  }

  .note-folder-hint {
    display: inline;
    color: var(--text-3);
  }

  .note-folder-hint.sep {
    display: inline-block;
  }

  .note-folder-chip {
    -webkit-touch-callout: none;
    user-select: none;
    padding: 0 5px;
    gap: 3px;
    font-size: 11px;
    touch-action: manipulation;
  }

  .note-folder-chip:not(.has-delete),
  .note-folder-add,
  .note-folder-wrap {
    flex: 1 1 66px;
    width: auto;
    min-width: 66px;
    max-width: none;
  }

  .note-folder-wrap .note-folder-chip {
    width: 100%;
  }

  .note-folder-add {
    padding: 0 5px;
    gap: 3px;
    font-size: 11px;
  }

  .note-folder-chip.is-pressing {
    transform: scale(0.97);
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .page-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .page-head--today {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    margin-bottom: 8px;
  }

  .page-head--today .page-head-titleline {
    gap: 7px;
  }

  .page-head--today .today-title-ring .ring-card {
    padding: 4px 7px 4px 5px;
  }

  .page-head--today .page-head-main {
    width: 100%;
    flex: 0 0 auto;
  }

  .page-head--today .head-actions {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .page-head--today .ring-card {
    margin-left: auto;
  }

  .page-head--today .head-actions .btn-primary {
    display: none;
  }

  .page-head--timeline,
  .page-head--habits {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }

  .page-head--timeline .page-head-main,
  .page-head--habits .page-head-main {
    flex: 1;
    min-width: 0;
  }

  .page-head--timeline .page-sub {
    display: none;
  }

  .page-head--timeline .head-actions,
  .page-head--habits .head-actions {
    width: auto;
    flex: 0 0 auto;
  }

  .page-head--timeline .head-actions .btn-ghost {
    display: none;
  }

  .page-head--timeline .head-actions .btn-primary,
  .page-head--habits .head-actions .btn-primary {
    display: inline-flex;
    flex: 0 0 auto;
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .habit-toolbar {
    margin-bottom: 10px;
    gap: 8px;
  }

  .habit-day-head {
    padding: 10px 14px;
    gap: 10px;
  }

  .habit-row {
    padding: 10px 14px;
    gap: 10px;
  }

  .habit-progress {
    height: 5px;
  }

  .habit-panel-title {
    font-size: 14px;
  }

  .habit-panel-sub {
    font-size: 11.5px;
  }

  .habit-foot {
    display: none;
  }

  .week-row {
    margin-bottom: 8px;
    gap: 5px;
  }

  .day-chip {
    padding: 6px 3px 5px;
  }

  .tl-allday {
    min-height: 42px;
    padding: 8px 12px;
  }

  .tl-scroll {
    height: calc(100dvh - 420px);
    min-height: 320px;
  }

  body[data-view="timeline"] .tl-footer {
    display: none;
  }

  .page-head-titleline {
    gap: 7px;
    margin-bottom: 1px;
  }

  .page-head .eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.08em;
  }

  .page-sub {
    margin-top: 4px;
    font-size: 11.5px;
    gap: 7px;
  }

  .task-row {
    padding: 8px 12px;
    gap: 10px;
    touch-action: pan-y;
  }

  .completed-row {
    touch-action: pan-y;
  }

  .task-title {
    font-size: 14px;
    line-height: 1.4;
  }

  .task-meta {
    font-size: 11px;
    gap: 6px;
  }

  .task-note {
    font-size: 11px;
  }

  .panel-head {
    padding: 10px 14px 6px;
  }
}

@media (max-width: 420px) {
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .day-chip-name {
    letter-spacing: -0.03em;
  }

  .page-title {
    font-size: 26px;
  }

  .head-actions .btn {
    padding: 0 12px;
  }
}

/* ---------------- 动效 ---------------- */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.task-row.just-checked .task-check {
  animation: pop 0.32s var(--ease);
}

.noscript {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  z-index: 999;
}

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

@media (hover: none) {
  .tl-check {
    opacity: 1;
  }

  .list-edit {
    display: flex;
  }

  .list-item:hover .list-count {
    display: inline;
  }
}
