/* ============================================
   Swiss Components — 所有组件样式
   依赖：variables.css（Swiss tokens）
   ============================================ */

/* ============================================
   Layout — Sidebar + Dashboard
   ============================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  width: 172px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  z-index: 50;
}

.sidebar-logo {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3xl);
  color: var(--text);
}

.sidebar-logo span { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .12s;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.sidebar-nav a:hover {
  background: var(--accent-light);
  color: var(--text);
}

.sidebar-nav a.active {
  background: var(--accent);
  color: #fff;
}

.sidebar-nav a .nav-icon {
  width: 16px;
  height: 16px;
  opacity: .5;
  flex-shrink: 0;
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-faint);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 20px 28px;
}

/* ============================================
   Tier 1: Hero Alert
   ============================================ */
.hero-alert {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.hero-alert.all-clear { border-left-color: var(--border); }

.hero-alert-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
}

.hero-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) 0;
  gap: var(--sp-md);
}

.hero-item + .hero-item { border-top: 1px solid var(--border-light); }

.hero-item-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.hero-item-text .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
  margin-right: var(--sp-sm);
  background: var(--text);
  color: #fff;
}

.hero-item-text .badge.overdue {
  background: #9B4A3A;
  color: #fff;
}

.hero-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.hero-done-btn {
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all .15s;
}

.hero-done-btn:hover { background: var(--accent-strong); }

.hero-all-clear {
  text-align: center;
  color: var(--text-faint);
  padding: var(--sp-sm) 0;
  font-size: 13px;
}

/* ============================================
   Tier 2: KPI Row
   ============================================ */
.kpi-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  flex: 1 1 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform .15s;
}

.kpi-card:hover { transform: translateY(-1px); }

.kpi-value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: var(--sp-xs);
}

.kpi-change { font-size: 10px; margin-top: 2px; }
.kpi-change.up { color: var(--accent); }
.kpi-change.down { color: var(--text-secondary); }

/* ============================================
   Tier 3: Module Grid & Cards
   ============================================ */
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  overflow: visible;
  transition: box-shadow .2s;
  display: flex;
  flex-direction: column;
}

.module-card:hover { box-shadow: var(--shadow-float); }

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.module-head h3 {
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.module-head h3 .icon {
  width: 14px;
  height: 14px;
  opacity: .5;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
}

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

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--accent-light);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-danger:hover {
  background: rgba(155,74,58,0.08);
  color: #9B4A3A;
  border-color: rgba(155,74,58,0.2);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
}

/* ============================================
   Inputs
   ============================================ */
.input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-warm);
  color: var(--text);
  transition: border-color .15s;
  width: 100%;
}

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

.select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  background: var(--bg-warm);
  color: var(--text);
}

/* ============================================
   Accounting Module
   ============================================ */
.txn-quick-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--sp-md);
  transition: all .15s;
  background: transparent;
}

.txn-quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.txn-list { max-height: 200px; overflow-y: auto; }

.txn-item {
  display: flex;
  align-items: center;
  padding: var(--sp-sm) 0;
  font-size: 13px;
}

.txn-item + .txn-item { border-top: 1px solid var(--border-light); }

.txn-source {
  display: inline-block;
  width: 48px;
  text-align: center;
  padding: 1px 0;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  margin-right: var(--sp-sm);
  flex-shrink: 0;
  background: var(--accent-light);
  color: var(--accent);
}

.txn-note {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.txn-amount {
  margin-left: auto;
  font-weight: 650;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* 删除按钮 — hover 显示 */
.txn-del-btn {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity .15s;
  line-height: 1;
}
.txn-item:hover .txn-del-btn { opacity: 1; }
.txn-del-btn:hover { color: #9B4A3A; }

/* Budget bar */
.budget-bar { margin-top: var(--sp-md); }

.budget-bar-track {
  height: 5px;
  border-radius: 3px;
  background: var(--border-light);
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width .3s, background .3s;
}
.budget-bar-fill.over { background: #9B4A3A; }

.budget-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.budget-edit {
  display: none;
  margin-top: 8px;
  gap: 6px;
  align-items: center;
}

.budget-edit.show { display: flex; }

.budget-edit input {
  width: 100px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--bg-warm);
}

.bill-link { text-align: center; margin-top: var(--sp-sm); }

.bill-link a {
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
}

.bill-link a:hover { color: var(--accent); }

/* ============================================
   Habits Module
   ============================================ */
.habit-target-row {
  display: flex;
  gap: var(--sp-md);
  align-items: center;
  margin-bottom: var(--sp-lg);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  font-size: 12px;
  color: var(--text-secondary);
}

.habit-target-row .ht-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.habit-target-row select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  background: var(--card);
  color: var(--text);
}

.habit-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
}

.habit-row + .habit-row { border-top: 1px solid var(--border-light); }

.habit-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-warm);
  cursor: pointer;
  transition: all .15s;
}

.habit-icon-btn:hover { background: var(--accent-light); }

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

.habit-label {
  font-size: 13px;
  font-weight: 600;
}

.habit-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--sp-xs);
  flex-shrink: 0;
}

.habit-check-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  min-width: 60px;
  transition: all .15s;
}

.habit-check-btn.done {
  background: var(--bg-warm);
  color: var(--text-secondary);
}

.habit-check-btn.confirming {
  animation: habitPulse .6s ease;
}

@keyframes habitPulse {
  0% { transform: scale(1); }
  50% { transform: scale(.94); }
  100% { transform: scale(1); }
}

.habit-note-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  flex-shrink: 0;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all .15s;
}

.habit-note-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.ex-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--sp-sm);
}

.ex-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
}

.ex-tag .del {
  cursor: pointer;
  opacity: .4;
  font-size: 14px;
}

.ex-tag .del:hover { opacity: 1; }

/* 7-Day Overview Strip (inline, desktop default visible) */
.habit-overview-strip {
  display: flex;
  gap: 3px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.habit-overview-strip .day-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.habit-overview-strip .day-dot .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.habit-overview-strip .day-dot .dot.on { background: var(--accent); }
.habit-overview-strip .day-dot .dot.off { background: var(--border); }

.habit-overview-strip .day-dot .day-label {
  font-size: 8px;
  color: var(--text-faint);
}

/* ============================================
   Todos Module
   ============================================ */
.todo-add-row {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
  align-items: center;
}

.todo-add-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--bg-warm);
  color: var(--text);
}

.todo-add-row input:focus {
  border-color: var(--accent);
  background: var(--card);
}

.todo-add-row select,
input[type="date"],
input[type="time"] {
  width: auto;
  min-width: 68px;
  padding: 8px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 11px;
  background: var(--bg-warm);
  color: var(--text);
}

.todo-filter-row {
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-sm);
}

.todo-filter-btn {
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .15s;
}

.todo-filter-btn:hover { background: var(--accent-light); }

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

.todo-list-wrap { max-height: 420px; overflow-y: auto; }

.todo-item {
  display: flex;
  align-items: center;
  padding: var(--sp-sm) 4px;
  gap: var(--sp-sm);
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: background .15s;
  cursor: default;
}

.todo-item:hover { background: var(--bg-warm); }
.todo-item.top-pick { background: var(--accent-light); }
.todo-item.drag-over { border-top: 2px solid var(--accent); }

/* Drag handle */
.todo-drag-handle {
  cursor: grab;
  color: var(--text-faint);
  font-size: 14px;
  padding: 0 2px;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
}

.todo-drag-handle:active { cursor: grabbing; }

/* Status circle — click = toggle complete */
.todo-status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  transition: all .15s;
  background: transparent;
}

.todo-status:hover { border-color: var(--accent); }

.todo-status.done {
  background: var(--accent);
  border-color: var(--accent);
}

.todo-status.done::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 3px 0 0 5px;
}

/* Priority tag */
.todo-priority {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 650;
  background: var(--border-light);
  color: var(--text-secondary);
}

.todo-priority.urgent {
  background: var(--text);
  color: #fff;
}

/* Title — click = edit overlay */
.todo-title-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 0;
}

.todo-title-text:hover { color: var(--accent); }

/* Deadline */
.todo-deadline {
  margin-left: auto;
  font-size: 11px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.todo-deadline.overdue {
  color: #9B4A3A;
  font-weight: 650;
}

/* Delete button — hover reveal */
.todo-del-btn {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity .15s;
}

.todo-item:hover .todo-del-btn { opacity: 1; }
.todo-del-btn:hover { color: #9B4A3A; }

/* Collapse / expand */
.todo-collapse-btn {
  text-align: center;
  padding: var(--sp-sm);
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
}

.todo-collapse-btn:hover { color: var(--accent); }

/* Calendar subscription */
.cal-sub-row {
  text-align: center;
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--border-light);
}

.cal-sub-row button { font-size: 11px; padding: 6px 16px; }

/* ============================================
   News Module
   ============================================ */
.news-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-md);
}

.news-tab {
  padding: var(--sp-sm) var(--sp-lg);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}

.news-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.news-refresh {
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.news-refresh:hover { color: var(--accent); }

.news-list { max-height: 300px; overflow-y: auto; flex: 1; }

.news-item { padding: var(--sp-sm) 0; font-size: 12px; }

.news-item + .news-item { border-top: 1px solid var(--border-light); }

.news-item a {
  color: var(--text);
  display: block;
  line-height: 1.5;
  transition: color .15s;
}

.news-item a:hover { color: var(--accent); }

.news-meta {
  display: flex;
  gap: var(--sp-sm);
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

.news-loading,
.news-error,
.news-empty {
  text-align: center;
  padding: var(--sp-2xl);
  font-size: 12px;
  color: var(--text-secondary);
}

/* 新闻条目布局 */
.news-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
}

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

.news-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.news-item-title {
  color: var(--text);
  display: block;
  line-height: 1.5;
  transition: color .15s;
  font-weight: 500;
}

.news-item-summary {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
  line-height: 1.4;
}

.news-item-meta {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* 操作按钮 */
.news-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.news-action-btn {
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 3px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
}

.news-action-btn:hover { color: var(--accent); background: var(--accent-light); }

.news-action-btn.bookmarked { color: var(--accent); }

/* 模块头部操作区 */
.module-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-settings-btn {
  font-size: 14px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  cursor: pointer;
  transition: all .15s;
  background: transparent;
}

.news-settings-btn:hover { color: var(--text); background: var(--border-light); }

/* 新闻底部 */
.news-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--border-light);
  margin-top: var(--sp-sm);
}

.news-footer-text {
  font-size: 10px;
  color: var(--text-faint);
}

.news-refresh-small {
  font-size: 10px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}

.news-refresh-small:hover { color: var(--accent); }

/* 新闻来源标签 */
.news-source {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}

.news-time {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ============================================
   Settings Panel（推送设置 Overlay）
   ============================================ */
.settings-panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 210;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-lg) var(--sp-xl);
  border-bottom: 1px solid var(--border);
}

.settings-head h3 { font-size: 15px; font-weight: 650; }

.settings-close {
  font-size: 16px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  cursor: pointer;
  background: transparent;
}

.settings-close:hover { color: var(--accent); }

.settings-body { padding: var(--sp-lg) var(--sp-xl); }

.settings-section { margin-bottom: var(--sp-lg); }

.settings-section-title {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-sm);
}

.settings-subjects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.settings-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s;
}

.settings-checkbox:hover { background: var(--accent-light); }

.settings-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.settings-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

.settings-slider-val {
  font-size: 14px;
  font-weight: 650;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
}

.settings-textarea {
  width: 100%;
  padding: var(--sp-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.settings-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-input {
  width: 100%;
  padding: var(--sp-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-xl);
  border-top: 1px solid var(--border);
}

/* ============================================
   Overlays
   ============================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.overlay.show { display: flex; }

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(4px);
}

.overlay-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-2xl);
  max-width: 460px;
  width: 92%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: var(--shadow-float);
}

/* Todo Edit Panel */
.todo-edit-panel { max-width: 400px; }

.todo-edit-panel label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.todo-edit-panel label:first-child { margin-top: 0; }

/* ============================================
   Quick Sheet (bottom drawer)
   ============================================ */
.quick-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 210;
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-float);
  padding: var(--sp-2xl) var(--sp-xl) calc(var(--sp-3xl) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  max-height: 85vh;
  overflow-y: auto;
}

.quick-sheet.show { transform: translateY(0); }

.quick-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 209;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(4px);
  display: none;
}

.quick-sheet-backdrop.show { display: block; }

.quick-sheet-bar {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto var(--sp-lg);
}

.quick-sheet .type-pick {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}

.quick-sheet .type-pick div {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}

.quick-sheet .type-pick div.sel {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.quick-sheet .src-grid {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}

.quick-sheet .src-item {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}

.quick-sheet .src-item.sel {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============================================
   Bill Detail Panel
   ============================================ */
.bill-panel { max-width: 560px; }

.bill-section-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-faint);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: var(--sp-xl) 0 var(--sp-sm);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--border-light);
}

.bill-section-label:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* —— 收支统计三卡片 —— */
.bill-summary-item {
  text-align: center;
  padding: 0 8px;
}
.bill-num {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bill-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.bill-compare {
  font-size: 10px;
  font-weight: 600;
  margin-left: 2px;
}
.bill-compare.up   { color: var(--accent); }
.bill-compare.down { color: var(--text-faint); }

/* —— 分类横向条形图 —— */
.bill-cat-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: 6px;
  position: relative;
}
.bill-cat-name {
  width: 48px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bill-cat-bar {
  flex: 1;
  height: 14px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: visible;
  position: relative;
}
.bill-cat-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  min-width: 2px;
  transition: width .3s;
}
.bill-cat-val {
  width: 56px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* 上月对比白点 */
.bill-last-dot {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--text-faint);
  z-index: 2;
}

/* —— 饼图容器 —— */
.bill-pie-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xl);
  margin: var(--sp-md) 0;
}
.bill-pie-legend {
  font-size: 11px;
  color: var(--text-secondary);
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.bill-trend { width: 100%; margin: var(--sp-sm) 0; }

/* —— 明细列表 —— */
.bill-detail-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 5px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--border-light);
}
.bill-detail-date {
  color: var(--text-faint);
  width: 40px;
  flex-shrink: 0;
}
.bill-detail-src {
  color: var(--text-secondary);
  width: 48px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bill-detail-note {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bill-detail-amount {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   Wheel Picker Overlay
   ============================================ */
.wheel-cols {
  display: flex;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.wheel-col {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.wheel-col::-webkit-scrollbar { display: none; }

.wheel-col .wheel-inner {
  padding: 88px 0;
}

.wheel-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
  color: var(--text-faint);
}

.wheel-item.center {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--text);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.toast.show { opacity: 1; }

/* ============================================
   Login Page — Swiss Design 登录/注册
   ============================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding: var(--sp-lg);
}

.login-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  font-size: 28px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: .02em;
  margin-bottom: var(--sp-xs);
}
.login-logo span {
  color: var(--accent);
  font-weight: 700;
}

.login-tagline {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: var(--sp-2xl);
}

.auth-input-group {
  margin-bottom: var(--sp-md);
}
.auth-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: var(--sp-xs);
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-warm);
  box-sizing: border-box;
  transition: border-color .15s;
}
.login-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}

.auth-error {
  background: rgba(204,51,51,0.06);
  color: var(--accent);
  font-size: 12px;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-md);
  display: none;
}

.login-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 650;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, opacity .15s;
  margin-bottom: var(--sp-sm);
}

.login-btn-primary {
  background: var(--accent);
  color: #fff;
}
.login-btn-primary:hover {
  background: var(--accent-strong);
}
.login-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-btn-wechat {
  background: #07C160;
  color: #fff;
}
.login-btn-wechat:hover {
  background: #06AD56;
}
.login-btn-wechat:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #8C8C8C;
}

.auth-switch {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--sp-md);
  margin-bottom: var(--sp-sm);
}
.auth-switch a {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.auth-switch a:hover {
  text-decoration: underline;
}

.auth-divider {
  text-align: center;
  margin: var(--sp-lg) 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: var(--card);
  padding: 0 var(--sp-md);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* 侧边栏用户信息 */
.sidebar-user {
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-user-email {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.btn-logout {
  font-size: 10px;
  color: var(--text-faint);
  cursor: pointer;
  white-space: nowrap;
}
.btn-logout:hover {
  color: var(--accent);
}

/* ============================================
   Utility: desktop-only / mobile-only
   ============================================ */
@media (min-width: 769px) {
  .mobile-only { display: none; }
}

@media (max-width: 768px) {
  .desktop-only { display: none; }
}
