:root {
  --bg: #f4f6fa;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.72);
  --surface-tint: rgba(237, 244, 253, 0.86);
  --text: #182235;
  --text-secondary: #5f6c7e;
  --text-muted: #98a3b4;
  --line: rgba(129, 146, 170, 0.22);
  --line-strong: rgba(129, 146, 170, 0.34);
  --accent: #2b6cb0;
  --accent-soft: rgba(43, 108, 176, 0.11);
  --danger: #ba3d3d;
  --success: #27845c;
  --radius: 14px;
  --shadow: 0 2px 5px rgba(55, 69, 89, 0.08), 0 13px 28px -18px rgba(55, 69, 89, 0.38);
  --shadow-lift: 0 5px 11px rgba(55, 69, 89, 0.10), 0 22px 40px -20px rgba(43, 108, 176, 0.42);
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(43, 108, 176, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 108, 176, 0.015) 1px, transparent 1px),
    linear-gradient(155deg, #fbfcff, #f1f5fb 58%, #edf2fa);
  background-size: 36px 36px, 36px 36px, auto;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.48; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(43, 108, 176, 0.22);
  outline-offset: 2px;
}

.app-shell { width: min(100%, 720px); min-height: 100vh; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 18px calc(92px + var(--safe-bottom)); }

.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; min-height: 56px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 2.4px; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 650; letter-spacing: 0; }
h2 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 650; }
h3 { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 650; }
p { margin: 0; }

.icon-button, .round-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.icon-button:hover, .round-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift), inset 0 1px 0 #fff; }
.icon-button.is-back { font-size: 24px; }

.view { display: none; }
.view.is-active { display: block; animation: view-in 0.2s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.glass-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 253, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1.5px 0 #fff, inset 0 -1px 0 rgba(110, 126, 149, 0.12);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

/* 总览 */
.home-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.home-subtitle, .section-hint { color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.home-action { min-height: 34px; padding: 7px 11px; color: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; }
.stat-button { display: grid; gap: 4px; min-height: 76px; padding: 14px; color: var(--text); background: transparent; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.stat-button:nth-child(2n) { border-right: 0; }
.stat-button:nth-last-child(-n + 2) { border-bottom: 0; }
.stat-button:hover, .stat-button.is-active { background: var(--accent-soft); }
.stat-button strong { font-size: 24px; line-height: 1; font-weight: 650; }
.stat-button.is-active strong { color: var(--accent); }
.stat-button small { color: var(--text-muted); font-size: 11px; }

.plan-panel { margin-bottom: 18px; padding: 16px; }
.plan-head, .section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.plan-head .eyebrow { margin-bottom: 4px; letter-spacing: 1px; }
.plan-next { max-width: 44%; padding: 6px 9px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(43, 108, 176, 0.14); border-radius: 99px; font-size: 11px; line-height: 1.3; text-align: right; }
.plan-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan-summary div { display: grid; gap: 3px; min-width: 0; padding: 12px 8px; border-left: 1px solid var(--line); }
.plan-summary div:first-child { padding-left: 0; border-left: 0; }
.plan-summary strong { font-size: 20px; font-weight: 650; }
.plan-summary span { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 8px; }
.legend-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; }
.legend-dot { display: block; width: 7px; height: 7px; border-radius: 50%; }
.plan-chart { width: 100%; min-height: 132px; }
.plan-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: rgba(129, 146, 170, 0.19); stroke-width: 1; }
.chart-guide { stroke: rgba(129, 146, 170, 0.1); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-label { fill: var(--text-muted); font-family: var(--font); font-size: 10px; text-anchor: middle; }
.chart-count { font-family: var(--font); font-size: 10px; font-weight: 650; text-anchor: middle; }
.plan-upcoming { display: grid; gap: 7px; margin-top: 12px; }
.plan-upcoming-item { display: grid; grid-template-columns: 8px 38px minmax(0, 1fr); align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11px; }
.plan-upcoming-item i { width: 7px; height: 7px; border-radius: 50%; }
.plan-upcoming-item time { color: var(--text-muted); }
.plan-upcoming-item strong { overflow: hidden; color: var(--text-secondary); font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }

/* 今日进度 hero */
.hero-panel { margin-bottom: 16px; padding: 16px; }
.hero-main { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hero-ring { flex: 0 0 auto; width: 68px; height: 68px; }
.ring-track { fill: none; stroke: rgba(129, 146, 170, 0.18); stroke-width: 6; }
.ring-value { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray 0.3s ease; }
.ring-num { fill: var(--text); font-family: var(--font); font-size: 17px; font-weight: 650; text-anchor: middle; }
.ring-den { fill: var(--text-muted); font-family: var(--font); font-size: 9px; text-anchor: middle; }
.hero-copy { display: grid; gap: 4px; min-width: 0; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.hero-stats div { display: grid; gap: 3px; padding: 10px 8px 2px; border-left: 1px solid var(--line); }
.hero-stats div:first-child { padding-left: 0; border-left: 0; }
.hero-stats strong { font-size: 20px; font-weight: 650; }
.hero-stats span { color: var(--text-muted); font-size: 10px; }

/* 堆叠柱状图 */
.chart-seg-count { fill: #fff; font-family: var(--font); font-size: 10px; font-weight: 650; text-anchor: middle; }
.chart-guide.is-today { stroke: rgba(43, 108, 176, 0.32); stroke-dasharray: none; }
.chart-label.is-today { fill: var(--accent); font-weight: 650; }

/* 记忆节奏热力图 */
.rhythm-panel { margin-bottom: 18px; padding: 16px; }
.hm-svg { display: block; width: 100%; height: auto; }
.hm-cell { cursor: pointer; }
.hm-l0 { fill: rgba(129, 146, 170, 0.13); }
.hm-l1 { fill: rgba(43, 108, 176, 0.26); }
.hm-l2 { fill: rgba(43, 108, 176, 0.48); }
.hm-l3 { fill: rgba(43, 108, 176, 0.7); }
.hm-l4 { fill: rgba(43, 108, 176, 0.92); }
.hm-plan { fill: none; stroke: rgba(43, 108, 176, 0.45); stroke-width: 1.2; stroke-dasharray: 2 2; }
.hm-today { stroke: var(--accent); stroke-width: 1.6; }
.hm-cell.is-active { stroke: var(--text); stroke-width: 1.4; }
.hm-month { fill: var(--text-muted); font-family: var(--font); font-size: 9px; }
.hm-wlab { fill: var(--text-muted); font-family: var(--font); font-size: 9px; text-anchor: end; }
.hm-div { stroke: rgba(129, 146, 170, 0.34); stroke-width: 1; stroke-dasharray: 3 4; }
.hm-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--text-muted); font-size: 10px; }
.hm-sw { display: block; width: 10px; height: 10px; border-radius: 3px; }
.hm-plan-note { margin-left: auto; padding-left: 10px; }
.hm-caption { margin: 6px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }

/* 详情抽屉强度曲线 */
.sheet-curve { display: grid; gap: 8px; margin: 14px 0 4px; padding: 12px; background: var(--surface-tint); border: 1px solid var(--line); border-radius: 10px; }
.sheet-curve-stats { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sheet-curve-stats strong { color: var(--accent); font-size: 14px; font-weight: 650; white-space: nowrap; }
.sheet-curve-stats span { color: var(--text-muted); font-size: 10.5px; line-height: 1.5; text-align: right; }
.curve-svg { display: block; width: 100%; height: auto; overflow: visible; }
.curve-grid { stroke: rgba(129, 146, 170, 0.19); stroke-width: 1; }
.curve-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.curve-future { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; opacity: 0.65; }
.curve-area { fill: rgba(43, 108, 176, 0.1); }
.curve-today { stroke: rgba(43, 108, 176, 0.4); stroke-width: 1; stroke-dasharray: 2 3; }
.curve-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.curve-label { fill: var(--text-muted); font-family: var(--font); font-size: 9px; text-anchor: middle; }

.filter-area { display: grid; gap: 10px; margin-bottom: 14px; }
.search-input { width: 100%; min-height: 44px; padding: 11px 13px; color: var(--text); background: rgba(255, 255, 255, 0.82); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: inset 0 1px 0 #fff; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 30px; padding: 5px 10px; color: var(--text-secondary); background: rgba(255, 255, 255, 0.66); border: 1px solid var(--line); border-radius: 99px; font-size: 11px; }
.filter-chip.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.filter-chip-soft { background: rgba(255, 255, 255, 0.42); border-style: dashed; }
.memory-result-meta { display: flex; align-items: center; justify-content: space-between; min-height: 22px; color: var(--text-muted); font-size: 11px; }
.memory-result-meta button { padding: 0; color: var(--accent); background: none; border: 0; font-size: 11px; }

.memory-list { display: grid; gap: 10px; }
.memory-card { width: 100%; padding: 14px; color: inherit; background: var(--surface-soft); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 10px; box-shadow: 0 4px 13px -11px rgba(43, 57, 75, 0.42), inset 0 1px 0 #fff; text-align: left; }
.memory-card:hover { border-color: rgba(43, 108, 176, 0.32); box-shadow: var(--shadow-lift), inset 0 1px 0 #fff; transform: translateY(-2px); }
.memory-card-top, .memory-card-bottom { display: flex; align-items: center; gap: 8px; }
.memory-card-top { margin-bottom: 9px; }
.memory-card time { margin-left: auto; color: var(--text-muted); font-size: 10px; }
.memory-card-title { display: block; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 560; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.memory-card-description { display: -webkit-box; margin: 5px 0 10px; overflow: hidden; color: var(--text-secondary); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.memory-image-thumb { display: block; width: 100%; height: 130px; margin: 0 0 10px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.memory-card-bottom { min-height: 18px; color: var(--text-muted); font-size: 10px; }
.memory-card-bottom .tags { flex: 1; overflow: hidden; white-space: nowrap; }
.memory-card-bottom em { font-style: normal; }
.memory-card-status { flex: none; }
.memory-card-status.status-due { color: #a36318; }
.memory-card-status.status-mastered { color: var(--success); }
.memory-card-status.status-archived { color: var(--text-muted); }
.memory-card-status.status-knowledge, .memory-status-pill.status-knowledge { color: #247768; background: #e7f3ee; }
.memory-card-relations { display: block; margin-top: 8px; color: var(--text-muted); font-size: 10px; }

.type-badge, .tag, .model-badge { display: inline-flex; align-items: center; min-width: 0; padding: 3px 7px; border: 1px solid transparent; border-radius: 99px; font-size: 10px; line-height: 1.35; white-space: nowrap; }
.type-text { color: #506174; background: rgba(115, 128, 150, 0.11); border-color: rgba(115, 128, 150, 0.16); }
.type-code { color: #207249; background: rgba(47, 133, 90, 0.11); border-color: rgba(47, 133, 90, 0.16); }
.type-shell { color: #b35222; background: rgba(192, 86, 33, 0.11); border-color: rgba(192, 86, 33, 0.16); }
.type-link { color: #0b6b70; background: rgba(15, 118, 110, 0.11); border-color: rgba(15, 118, 110, 0.16); }
.type-filepath { color: #8d6514; background: rgba(183, 121, 31, 0.12); border-color: rgba(183, 121, 31, 0.18); }
.type-image { color: #704bc2; background: rgba(128, 89, 214, 0.1); border-color: rgba(128, 89, 214, 0.16); }
.tag { max-width: 96px; margin-right: 4px; overflow: hidden; color: var(--accent); background: var(--accent-soft); text-overflow: ellipsis; }
.model-badge { color: var(--text-muted); background: rgba(255, 255, 255, 0.58); border-color: var(--line); }

.empty-state { padding: 38px 20px; color: var(--text-muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 15px; }
.empty-state p { font-size: 12px; line-height: 1.55; }
.empty-state button { margin-top: 15px; }

/* 速记 */
.capture-form { display: grid; gap: 13px; }
.capture-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.capture-head h2 { margin-top: 3px; color: var(--text); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.capture-intro { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.capture-mode-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 3px; scrollbar-width: none; }
.capture-mode-row::-webkit-scrollbar { display: none; }
.capture-mode { flex: 0 0 auto; min-height: 30px; padding: 5px 11px; color: var(--text-secondary); background: rgba(255,255,255,0.58); border: 1px solid var(--line); border-radius: 99px; font-size: 11px; }
.capture-mode.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.capture-editor { overflow: hidden; background: rgba(255,255,255,0.84); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: inset 0 1px 0 #fff; }
.capture-editor textarea { display: block; width: 100%; min-height: 158px; padding: 14px; color: var(--text); background: transparent; border: 0; resize: vertical; line-height: 1.6; }
.capture-editor textarea:focus { outline: 0; }
.capture-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.capture-editor-foot span { color: var(--text-muted); font-size: 10px; }
.capture-attachment-actions { display: flex; gap: 4px; }
.capture-add-image { padding: 4px 7px; color: var(--accent); background: transparent; border: 0; font-size: 11px; }
.capture-format-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; color: var(--text-muted); background: rgba(234,243,253,0.52); border: 1px solid rgba(43,108,176,0.18); border-radius: 10px; font-size: 10px; line-height: 1.4; }
.capture-format-tools button { flex: 0 0 auto; padding: 5px 8px; color: var(--accent); background: #fff; border: 1px solid rgba(43,108,176,0.24); border-radius: 7px; font-size: 11px; font-weight: 600; }
.format-preview { position: relative; z-index: 11; display: grid; gap: 10px; padding: 11px; background: rgba(255,255,255,0.96); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lift); }
.format-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.format-preview-head strong, .format-preview-head small { display: block; }
.format-preview-head strong { color: var(--text); font-size: 12px; }
.format-preview-head small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.format-preview-head button { width: 26px; height: 26px; padding: 0; color: var(--text-muted); background: transparent; border: 0; font-size: 19px; }
.format-preview-grid { display: grid; gap: 8px; }
.format-preview-grid > div > span { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 10px; }
.format-preview-grid pre { max-height: 135px; margin: 0; padding: 9px; overflow: auto; color: var(--text-secondary); background: var(--surface-tint); border-radius: 7px; font-family: var(--font-mono); font-size: 10px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.format-preview-actions { display: flex; gap: 7px; }
.format-preview-actions button { flex: 1; min-height: 35px; }
body.is-format-previewing .tab-bar { opacity: 0; pointer-events: none; transform: translateY(12px); }
body:has(#capture-format-preview:not([hidden])) .tab-bar { opacity: 0; pointer-events: none; transform: translateY(12px); }
.field { display: grid; gap: 7px; }
.field > span { color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.field textarea, .field input, .field select {
  width: 100%; color: var(--text); background: rgba(255, 255, 255, 0.84); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: inset 0 1px 0 #fff; }
.field textarea { min-height: 144px; padding: 13px; resize: vertical; line-height: 1.55; }
.field input, .field select { min-height: 43px; padding: 10px 12px; }
.field textarea:focus, .field input:focus, .field select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12); }
.image-picker { display: grid; gap: 10px; padding: 14px; border: 1px dashed rgba(43, 108, 176, 0.34); border-radius: 10px; background: rgba(234, 243, 253, 0.45); }
.image-picker p { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.image-actions { display: flex; gap: 8px; }
.image-actions button { flex: 1; }
.image-preview-wrap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.6); }
.image-preview-wrap img { display: block; width: 100%; max-height: 280px; object-fit: contain; }
.image-preview-remove { position: absolute; top: 8px; right: 8px; width: 31px; height: 31px; padding: 0; color: #fff; background: rgba(24, 34, 53, 0.72); border: 0; border-radius: 50%; font-size: 20px; }
.capture-tags-field { display: grid; gap: 7px; }
.capture-field-head { display: flex; align-items: center; justify-content: space-between; }
.capture-field-head span { color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.capture-field-head small, .capture-advanced summary small { color: var(--text-muted); font-size: 10px; font-weight: 400; }
.capture-tag-suggestions { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.capture-tag-suggestions::-webkit-scrollbar { display: none; }
.capture-tag-suggestions button { flex: 0 0 auto; padding: 4px 8px; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 99px; font-size: 10px; }
.capture-tags-field input { width: 100%; min-height: 43px; padding: 10px 12px; color: var(--text); background: rgba(255,255,255,0.84); border: 1px solid var(--line-strong); border-radius: 10px; }
.capture-advanced { padding: 0 12px 2px; background: rgba(255,255,255,0.46); border: 1px solid var(--line); border-radius: 10px; }
.capture-advanced summary { padding: 11px 0; color: var(--text-secondary); cursor: pointer; font-size: 12px; font-weight: 600; list-style: none; }
.capture-advanced summary::-webkit-details-marker { display: none; }
.capture-advanced summary::after { float: right; color: var(--text-muted); content: '＋'; font-size: 16px; font-weight: 400; }
.capture-advanced[open] summary::after { content: '−'; }
.capture-advanced .field { padding: 3px 0 10px; }
.capture-actions { display: grid; gap: 7px; }
.capture-continue { min-height: 34px; border: 0; }

.button-primary, .button-secondary, .button-danger, .button-quiet {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}
.button-primary { color: #fff; background: linear-gradient(180deg, #4286cc, #2b6cb0); border: 1px solid #28629f; box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 8px 17px -9px rgba(43, 108, 176, 0.66); }
.button-primary:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 14px 25px -12px rgba(43, 108, 176, 0.72); }
.button-secondary { color: var(--accent); background: rgba(255, 255, 255, 0.86); border: 1px solid rgba(43, 108, 176, 0.26); }
.button-danger { color: var(--danger); background: rgba(255, 247, 247, 0.8); border: 1px solid rgba(186, 61, 61, 0.23); }
.button-quiet { color: var(--text-secondary); background: transparent; border: 1px solid var(--line); }
.save-button { width: 100%; margin-top: 4px; }

/* 复习 */
.review-status { margin: -4px 0 14px; color: var(--text-muted); font-size: 12px; }
.review-card { padding: 18px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.review-counter { color: var(--text-muted); font-size: 11px; }
.review-prompt { min-height: 150px; padding: 14px 0; color: var(--text); font-size: 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-prompt span { color: var(--text-muted); font-size: 11px; }
.review-prompt p { margin-top: 14px; }
.review-reveal { width: 100%; }
.review-content { min-height: 185px; padding: 14px 0; color: var(--text-secondary); font-size: 15px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; }
.review-content.is-code { padding: 13px; color: #dce8f7; background: #263244; border-radius: 9px; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-x: auto; }
.review-content img { display: block; width: 100%; max-height: 300px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; }
.review-note { margin: 0 0 15px; padding: 10px 12px; color: var(--text-secondary); background: rgba(43, 108, 176, 0.06); border-left: 3px solid rgba(43, 108, 176, 0.54); border-radius: 0 7px 7px 0; font-size: 12px; line-height: 1.55; }
.rating-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rate-button { min-height: 56px; padding: 10px 8px; background: rgba(255, 255, 255, 0.82); border: 1px solid var(--line); border-radius: 9px; color: var(--text-secondary); font-size: 12px; font-weight: 600; touch-action: manipulation; }
.rate-button small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; font-weight: 400; }
.rate-again { border-color: rgba(186, 61, 61, 0.28); color: #a93535; }
.rate-hard { border-color: rgba(192, 128, 25, 0.30); color: #966413; }
.rate-good { border-color: rgba(43, 108, 176, 0.28); color: var(--accent); }
.rate-easy { border-color: rgba(39, 132, 92, 0.28); color: var(--success); }
.review-card-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.review-card-actions button { min-height: 32px; padding: 5px 8px; background: transparent; border: 0; color: var(--text-muted); font-size: 11px; }

/* 设置 */
.settings-list { display: grid; gap: 12px; }
.settings-panel { padding: 16px; }
.settings-panel h2 { margin-bottom: 4px; }
.settings-panel > p { color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.model-list { display: grid; gap: 9px; margin-top: 14px; }
.model-setting { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.55); }
.model-setting.is-default { border-color: rgba(43, 108, 176, 0.52); background: rgba(237, 245, 254, 0.85); box-shadow: inset 0 2px 0 rgba(43, 108, 176, 0.58); }
.model-setting-head { display: flex; align-items: flex-start; gap: 9px; }
.model-radio { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.model-setting-head p { margin: 0 0 2px; color: var(--accent); font-size: 10px; font-weight: 650; }
.model-setting-desc, .model-setting-note { margin-top: 8px; color: var(--text-secondary); font-size: 11px; line-height: 1.55; }
.model-setting-note { color: var(--text-muted); }
.model-fields { display: grid; gap: 8px; margin-top: 10px; }
.model-field { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 9px; color: var(--text-secondary); font-size: 11px; }
.model-field input { width: 100%; min-height: 34px; padding: 6px 8px; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; }
.settings-actions { display: grid; gap: 8px; margin-top: 14px; }
.settings-actions .button-quiet { width: 100%; }
.backup-note { margin-top: 8px; color: var(--text-muted); font-size: 10px; line-height: 1.5; }

/* 详情抽屉 */
.sheet-overlay { position: fixed; z-index: 20; inset: 0; display: grid; align-items: end; background: rgba(23, 34, 53, 0.28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
/* 分析占据完整视图，AI 设置抽屉仍可在上方打开。 */
#logic-root { position: fixed; z-index: 15; inset: 0; max-width: 100%; overflow: auto; overscroll-behavior: contain; color: var(--text); background: var(--bg); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#logic-root[hidden] { display: none; }
body.logic-open { overflow: hidden; }
.memory-tools { display: flex; justify-content: flex-end; margin: 12px 0; }
.sheet { width: min(100%, 720px); max-height: min(84vh, 760px); margin: 0 auto; padding: 12px 18px calc(18px + var(--safe-bottom)); overflow-y: auto; color: var(--text); background: rgba(250, 252, 255, 0.97); border: 1px solid rgba(255, 255, 255, 0.96); border-radius: 18px 18px 0 0; box-shadow: 0 -14px 45px rgba(23, 34, 53, 0.2), inset 0 1.5px 0 #fff; animation: sheet-in 0.22s cubic-bezier(0.22, 0.61, 0.36, 1); }
.entry-review-type { margin: 2px 0 12px; color: var(--text-muted); font-size: 11px; }
.entry-review-prompt { padding: 15px 0; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-review-prompt span { color: var(--accent); font-size: 11px; font-weight: 700; }
.entry-review-prompt p { margin-top: 9px; font-size: 16px; line-height: 1.6; }
.sheet .review-content { min-height: 0; max-height: 35vh; padding: 14px 0; overflow: auto; border-top: 1px solid var(--line); }
.sheet .review-content img { max-height: 28vh; }
.entry-review-reveal, .entry-review-return { width: 100%; }
.entry-review-status { min-height: 18px; margin-top: 8px; color: var(--danger); font-size: 11px; }
.entry-review-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.entry-review-footer button { padding: 7px 0; border: 0; color: var(--text-muted); background: transparent; font-size: 12px; }
.entry-review-footer button:last-child { color: var(--accent); }
.entry-review-done { display: grid; gap: 8px; padding: 22px 0 25px; }
.entry-review-done strong { font-size: 19px; }
.entry-review-done span { color: var(--text-muted); font-size: 13px; }
@keyframes sheet-in { from { transform: translateY(32px); } to { transform: translateY(0); } }
.sheet-handle { width: 34px; height: 4px; margin: 0 auto 15px; background: rgba(129, 146, 170, 0.4); border-radius: 99px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.sheet-head > div:first-child { flex: 1; min-width: 0; }
.sheet-head h2 { max-width: 100%; overflow-wrap: anywhere; }
.sheet-status-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.memory-status-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: 10px; }
.memory-status-pill.status-due { color: #a36318; background: rgba(203, 137, 35, 0.13); }
.memory-status-pill.status-mastered { color: var(--success); background: rgba(39, 132, 92, 0.11); }
.memory-status-pill.status-archived { color: var(--text-muted); background: rgba(129, 146, 170, 0.12); }
.sheet-inline-meta { color: var(--text-muted); font-size: 10px; }
.sheet-close { width: 30px; height: 30px; flex: none; padding: 0; color: var(--text-secondary); background: rgba(255,255,255,0.8); border: 1px solid var(--line); border-radius: 50%; font-size: 20px; line-height: 1; }
.sheet-content { color: var(--text-secondary); font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.sheet-content.is-code { padding: 13px; color: #dce8f7; background: #263244; border-radius: 9px; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.6; overflow-x: auto; }
.sheet-image { display: block; width: 100%; max-height: 420px; object-fit: contain; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.sheet-note { margin: 0 0 14px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.meta-chip { display: inline-flex; align-items: center; padding: 3px 9px; color: var(--text-muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 99px; font-size: 10px; }
.sheet-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 14px 0; }
.sheet-stat-grid > div { display: grid; gap: 4px; min-width: 0; padding: 10px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
.sheet-stat-grid small { color: var(--text-muted); font-size: 9px; }
.sheet-stat-grid strong { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sheet-section { margin-top: 18px; }
.sheet-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.sheet-section-head .eyebrow { margin-bottom: 3px; }
.relation-count { color: var(--text-muted); font-size: 10px; }
.relation-list { display: grid; border-top: 1px solid var(--line); }
.relation-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 0; color: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); }
.relation-row > button { border: 0; color: inherit; background: none; }
.relation-row > button:first-of-type { display: grid; min-width: 0; gap: 3px; flex: 1; text-align: left; }
.relation-row > button:first-of-type strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.relation-row > button:first-of-type small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.relation-row .relation-edit { flex: none; color: var(--accent); font-size: 11px; }
.capture-review-only[hidden], .edit-review-only[hidden] { display: none; }
.relation-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #aab6c2; }
.relation-dot.is-manual { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.relation-row-main { display: grid; min-width: 0; gap: 3px; flex: 1; }
.relation-row-main strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.relation-row-main small { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.relation-arrow { color: var(--text-muted); font-size: 18px; }

/* 文本记忆富文本展示 */
.sheet-content.is-rich { display: grid; gap: 9px; white-space: normal; color: var(--text); font-size: 13.5px; line-height: 1.75; }
.rich-p { margin: 0; }
.rich-heading { margin: 2px 0; color: var(--text); font-size: 14px; font-weight: 650; }
.rich-list { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.rich-quote { margin: 0; padding: 9px 12px; color: var(--text-secondary); background: var(--surface-tint); border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0; font-size: 12.5px; }
.rich-code { padding: 1.5px 6px; color: #b35222; background: rgba(192, 86, 33, 0.09); border-radius: 5px; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.rich-link { color: var(--accent); word-break: break-all; text-decoration: none; border-bottom: 1px solid rgba(43, 108, 176, 0.3); }
.sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.sheet-actions .button-danger { grid-column: span 2; }
.sheet-actions-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-actions-main .button-primary { grid-column: span 2; }
.sheet-actions-secondary { margin-top: 8px; }
.sheet-form { display: grid; gap: 12px; }
.form-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 6px; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(76px + var(--safe-bottom)); max-width: calc(100vw - 36px); padding: 10px 14px; color: var(--text-secondary); background: rgba(255, 255, 255, 0.96); border: 1px solid rgba(255, 255, 255, 0.98); border-radius: 99px; box-shadow: var(--shadow), inset 0 1px 0 #fff; font-size: 12px; text-align: center; transform: translateX(-50%); }
.toast.is-error { color: var(--danger); }
.toast.is-success { color: var(--success); }

.tab-bar { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: calc(65px + var(--safe-bottom)); padding: 7px max(12px, calc((100vw - 720px) / 2 + 18px)) var(--safe-bottom); background: rgba(251, 253, 255, 0.86); border-top: 1px solid rgba(255, 255, 255, 0.96); box-shadow: 0 -6px 20px -15px rgba(43, 57, 75, 0.45); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); }
.tab-button { display: grid; justify-items: center; gap: 3px; min-height: 52px; padding: 5px; color: var(--text-muted); background: transparent; border: 0; border-radius: 10px; }
.tab-button span { display: grid; width: 25px; height: 25px; place-items: center; font-size: 20px; line-height: 1; }
.tab-button small { font-size: 10px; }
.tab-button.is-active { color: var(--accent); background: rgba(43, 108, 176, 0.08); }

@media (min-width: 560px) {
  .app-shell { padding-right: 30px; padding-left: 30px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-button { min-height: 82px; border-bottom: 0; }
  .stat-button:nth-child(2n) { border-right: 1px solid var(--line); }
  .stat-button:last-child { border-right: 0; }
  .rating-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tab-bar { padding-right: max(30px, calc((100vw - 720px) / 2 + 30px)); padding-left: max(30px, calc((100vw - 720px) / 2 + 30px)); }
}

/* 服务器同步状态：与设置页其它说明文字保持一致的字号。 */
.sync-status { margin: 10px 0 0; color: #4a5568; font-size: 13px; line-height: 1.5; }
.sync-status.is-error { color: #b53232; }
.sync-status.is-ok { color: #2f7a4f; }

/* ===== 交互微反馈 ===== */
button, .memory-card, .filter-chip, .rate-button, .legend-chip, .hm-cell {
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

/* 按压缩放（触屏反馈核心：按下即缩，松手回弹） */
.memory-card:active { transform: translateY(0) scale(0.975); }
.icon-button:active, .round-button:active, .sheet-close:active, .home-action:active { transform: scale(0.92); }
.button-primary:active, .button-secondary:active, .button-danger:active, .button-quiet:active { transform: scale(0.95); }
.stat-button:active, .filter-chip:active, .rate-button:active { transform: scale(0.96); }

/* 记忆列表入场：卡片依次浮入 */
.memory-list .memory-card { animation: card-in 0.26s ease-out backwards; }
.memory-list .memory-card:nth-child(2) { animation-delay: 0.025s; }
.memory-list .memory-card:nth-child(3) { animation-delay: 0.05s; }
.memory-list .memory-card:nth-child(4) { animation-delay: 0.075s; }
.memory-list .memory-card:nth-child(5) { animation-delay: 0.1s; }
.memory-list .memory-card:nth-child(6) { animation-delay: 0.125s; }
.memory-list .memory-card:nth-child(7) { animation-delay: 0.15s; }
.memory-list .memory-card:nth-child(8) { animation-delay: 0.175s; }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* 底部标签切换：图标弹跳 + 按压缩小 */
.tab-button span, .tab-button small { transition: transform 0.16s ease; }
.tab-button:active span { transform: scale(0.8); }
.tab-button.is-active span { animation: tab-pop 0.24s ease-out; }
@keyframes tab-pop { 0% { transform: scale(0.72); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* 抽屉遮罩淡入、提示浮出 */
.sheet-overlay { animation: overlay-in 0.2s ease-out; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.toast { animation: toast-in 0.26s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 热力图格子：悬停放大（transform-box 让 SVG rect 以自身为中心缩放） */
.hm-cell { transform-box: fill-box; transform-origin: center; }
.hm-cell:hover { transform: scale(1.18); }

/* 图表元素淡入 */
.plan-chart svg, .hm-svg, .curve-svg, .hero-ring { animation: fade-in 0.3s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 无障碍：用户系统开启减弱动态效果时，关闭装饰动画 */
@media (prefers-reduced-motion: reduce) {
  .memory-list .memory-card, .tab-button.is-active span, .sheet-overlay, .toast,
  .plan-chart svg, .hm-svg, .curve-svg, .hero-ring { animation: none; }
}

/* ===== 纸页工作台：减少装饰，让内容、状态和关联成为主角 ===== */
:root {
  --bg: #f5f6f8;
  --surface: #fffdf9;
  --surface-soft: #fffdf9;
  --surface-tint: #f7f4ed;
  --text: #202938;
  --text-secondary: #667180;
  --text-muted: #98a1ad;
  --line: #e5e8ec;
  --line-strong: #d7dde4;
  --accent: #2f6fae;
  --accent-soft: #edf4fa;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 42, 56, 0.04), 0 8px 24px rgba(31, 42, 56, 0.05);
  --shadow-lift: 0 8px 24px rgba(31, 42, 56, 0.10);
}

body {
  background: var(--bg);
  background-image: none;
}

.app-shell { max-width: 760px; padding-top: calc(24px + env(safe-area-inset-top)); }
.app-header { align-items: center; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--text-muted); letter-spacing: 1.8px; }
.icon-button, .round-button { color: var(--accent); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: none; font-size: 24px; }
.icon-button:hover, .round-button:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.glass-panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.today-focus, .today-section, .rhythm-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.today-focus { padding: 20px; }
.today-section { padding: 16px; }
.section-hint, .home-subtitle { color: var(--text-secondary); }
.filter-area { gap: 12px; margin-bottom: 16px; }
.search-input { background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.search-input:focus { box-shadow: 0 0 0 3px rgba(47, 111, 174, 0.12); }
.filter-chip { background: transparent; border-color: var(--line); }
.filter-chip.is-active { color: var(--accent); background: var(--accent-soft); border-color: rgba(47, 111, 174, 0.24); }
.filter-chip-soft { border-style: solid; }
.memory-result-meta { padding-top: 2px; }
.memory-list { gap: 0; border-top: 1px solid var(--line); }
.memory-card { padding: 15px 2px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.memory-card:hover { background: rgba(255, 253, 249, 0.62); border-color: var(--line); box-shadow: none; transform: none; }
.memory-card-top { margin-bottom: 7px; }
.memory-card-title { font-size: 15px; font-weight: 600; }
.memory-card-description { margin: 4px 0 8px; color: var(--text-secondary); }
.memory-card-relations { margin-top: 6px; }
.capture-form { gap: 16px; }
.capture-head h2 { font-size: 24px; letter-spacing: -0.03em; }
.capture-mode-row { gap: 4px; padding: 0; }
.capture-mode { background: transparent; border-color: var(--line); }
.capture-mode.is-active { color: var(--accent); background: var(--accent-soft); border-color: rgba(47, 111, 174, 0.24); }
.capture-editor { background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.capture-editor textarea { min-height: 184px; padding: 16px; font-size: 15px; line-height: 1.7; }
.capture-editor-foot { padding: 9px 12px; border-top-color: var(--line); }
.capture-format-tools { background: var(--surface-tint); border-color: var(--line); }
.capture-tags-field { gap: 8px; }
.capture-field-head span { color: var(--text); font-size: 12px; }
#capture-tags { background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.capture-advanced { background: transparent; border-color: var(--line); }
.format-preview { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.format-preview[hidden] { display: none; }
.button-primary, .today-action { background: var(--accent); box-shadow: none; }
.button-primary:hover, .today-action:hover { background: #285f96; box-shadow: none; transform: translateY(-1px); }
.button-quiet, .button-secondary { background: transparent; border-color: var(--line-strong); box-shadow: none; }
.tab-bar { background: rgba(255, 253, 249, 0.96); border-top-color: var(--line); box-shadow: 0 -6px 18px rgba(31, 42, 56, 0.06); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tab-button.is-active { color: var(--accent); background: var(--accent-soft); }
.sheet { background: var(--surface); border-color: var(--line); box-shadow: 0 -12px 32px rgba(31, 42, 56, 0.12); }
.capture-advanced:not([open]) > :not(summary) { display: none; }
.is-capture-view .app-shell { padding-bottom: calc(24px + var(--safe-bottom)); }
.is-capture-view .tab-bar { display: none; }

@media (min-width: 680px) {
  .app-shell { padding-right: 42px; padding-left: 42px; }
  .capture-form { max-width: 720px; margin: 0 auto; }
  .memory-list { padding: 0 10px; }
}

/* ===== 交互反馈：让每次点击、切换和处理中都有明确回应 ===== */
:root {
  --motion-fast: 120ms;
  --motion-base: 220ms;
  --success: #347a59;
  --success-soft: #edf7f0;
  --error: #b84a4a;
}

button, input, select, textarea, .memory-card, .glass-panel, .today-section, .today-focus {
  transition: transform var(--motion-fast) ease, background-color var(--motion-base) ease,
    border-color var(--motion-base) ease, box-shadow var(--motion-base) ease,
    color var(--motion-base) ease, opacity var(--motion-base) ease;
}

button:not(:disabled):active, .memory-card:active { transform: scale(0.97); filter: brightness(0.97); }
button.is-loading, button[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
button.is-loading::after, button[aria-busy="true"]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--accent);
  content: '';
  animation: button-spin 0.7s linear infinite;
}
button.is-success { color: var(--success) !important; background: var(--success-soft) !important; border-color: rgba(52, 122, 89, 0.24) !important; }
.view.is-active { animation: view-in var(--motion-base) cubic-bezier(0.22, 0.61, 0.36, 1); }
body.is-view-changing .view.is-active { animation-duration: 260ms; }
#graph-root { transition: opacity var(--motion-base) ease, transform var(--motion-base) ease; }
#graph-root.is-changing { opacity: 0.35; transform: translateY(5px); }
.toast.is-success { color: var(--success); background: var(--success-soft); border-color: rgba(52, 122, 89, 0.22); }
.toast.is-success::before { margin-right: 6px; content: '✓'; font-weight: 700; }
.toast.is-error { color: var(--error); }
@keyframes button-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  button, input, select, textarea, .memory-card, .glass-panel, .today-section, .today-focus, #graph-root { transition: none !important; }
  button.is-loading::after, button[aria-busy="true"]::after { animation: none; }
}
