/* =============================================
   RORO 工作台 — 淡彩主题样式
   ============================================= */

:root {
  --bg: #faf7fc;
  --bg-card: #ffffff;
  --text: #3d3650;
  --text-light: #8a8298;
  --text-muted: #b0a8bc;
  --border: #e8e0f0;
  --shadow-sm: 0 1px 3px rgba(140,120,180,0.06);
  --shadow: 0 2px 8px rgba(140,120,180,0.08);
  --shadow-lg: 0 4px 20px rgba(140,120,180,0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  /* 各模块淡彩色 */
  --cal-color: #d5c8f0;
  --cal-color-bg: #f4f0fb;
  --cal-color-text: #6b5b95;
  --todo-color: #fcd5c0;
  --todo-color-bg: #fef6f0;
  --todo-color-text: #c07a50;
  --memo-color: #c0ddf5;
  --memo-color-bg: #f0f5fb;
  --memo-color-text: #5b7fa0;
  --shop-color: #c0e8d0;
  --shop-color-bg: #f0faf3;
  --shop-color-text: #5b9068;
  --weight-color: #f0c0d5;
  --weight-color-bg: #faf0f5;
  --weight-color-text: #a05b78;
  --curr-color: #f0e5b8;
  --curr-color-bg: #faf8f0;
  --curr-color-text: #a08840;
  --metro-color: #b8dde8;
  --metro-color-bg: #f0f7fa;
  --metro-color-text: #4b8090;
  --period-color: #f0b8c8;
  --period-color-bg: #fef5f7;
  --period-color-text: #a05068;

  --sidebar-bg: linear-gradient(180deg, #f4f0fb 0%, #fef6f0 40%, #f0faf3 70%, #faf0f5 100%);
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.55);
  --sidebar-text: #6b5b95;
  --sidebar-active-text: #5b4090;
  --sidebar-width: 88px;
  --sidebar-width-desktop: 110px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}

/* 触摸反馈：所有可点击元素按下时缩小 */
button, .nav-item, .cat-pill, .btn-primary, .btn-add, .migrate-btn-primary, .migrate-btn-secondary, .migrate-btn-confirm, .migrate-btn-cancel, .exercise-toggle, .metro-city-btn, .cal-nav-btn, .image-zoom-btn {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button:active, .nav-item:active, .cat-pill:active, .btn-primary:active, .btn-add:active, .migrate-btn-primary:active, .migrate-btn-secondary:active, .migrate-btn-confirm:active, .migrate-btn-cancel:active, .exercise-toggle:active, .metro-city-btn:active, .cal-nav-btn:active, .image-zoom-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

/* 视图切换过渡动画 */
.view {
  animation: viewIn 0.25s ease-out;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 侧边栏 ========== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 14px 6px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  gap: 6px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-header {
  display: flex;
  justify-content: center;
  padding: 4px 0 10px;
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.logo-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #c9a8e8, #f0b8d0, #b8d8e8);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  font-size: 18px;
}
.logo-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-text);
  letter-spacing: 1px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  color: var(--sidebar-text);
  position: relative;
  transition: all 0.2s;
}
.nav-item:hover {
  background: var(--sidebar-hover);
}
.nav-item.active {
  background: var(--sidebar-active);
  box-shadow: 0 2px 8px rgba(140,120,180,0.12);
}
.nav-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-item.active .nav-icon {
  color: var(--sidebar-active-text);
}
.nav-label {
  display: none;
}
.nav-text {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: inherit;
  white-space: nowrap;
}
.nav-item.active .nav-text {
  font-weight: 600;
  color: var(--sidebar-active-text);
}
.nav-badge {
  position: absolute;
  top: 5px;
  right: 6px;
  background: #f0a0b8;
  color: #fff;
  font-size: 9px;
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  padding: 0 4px;
}

/* 侧边栏分组 */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.nav-group:last-child {
  margin-bottom: 0;
}
.nav-group-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0 3px;
  letter-spacing: 0.5px;
  opacity: 0.55;
}

/* 侧栏底部 */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 4px;
  border-top: 1px solid var(--border);
}
.sidebar-migrate-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-light);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-migrate-btn:hover {
  background: var(--border);
  color: var(--text);
}
.sidebar-version {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ========== 主内容区 ========== */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.main-header {
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,247,252,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.content {
  flex: 1;
  padding: 14px;
  padding-bottom: 40px;
}

/* ========== 视图切换 ========== */
.view { display: none; }
.view.active { display: block; }

/* ========== 日历视图 ========== */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.calendar-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cal-nav-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.cal-nav-btn:hover {
  background: var(--cal-color-bg);
  color: var(--cal-color-text);
}
.cal-main-title {
  font-size: 17px;
  font-weight: 700;
  min-width: 130px;
  text-align: center;
  color: var(--cal-color-text);
}
.cal-today-btn {
  padding: 6px 14px;
  border: 1px solid var(--cal-color);
  border-radius: 20px;
  background: var(--cal-color-bg);
  color: var(--cal-color-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cal-today-btn:hover {
  background: var(--cal-color);
}

.calendar-scroll {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.calendar-scroll::-webkit-scrollbar { width: 3px; }
.calendar-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.cal-month-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.cal-month-card.current-month {
  border-color: var(--cal-color);
  background: var(--cal-color-bg);
}
.cal-month-label {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--cal-color-text);
  margin-bottom: 6px;
}
.current-month .cal-month-label {
  color: var(--cal-color-text);
  font-size: 14px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  padding: 0 1px;
}
.calendar-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 1px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  min-height: 44px;
  overflow: hidden;
}
.cal-cell:hover {
  background: rgba(180,160,210,0.12);
}
.cal-cell.other-month {
  opacity: 0.3;
}
.cal-cell.today {
  background: var(--cal-color-bg);
  border: 2px solid var(--cal-color);
}
.cal-cell .solar {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-top: 1px;
}
.cal-cell.today .solar {
  color: var(--cal-color-text);
  font-weight: 700;
}
.cal-cell.weekend .solar {
  color: #d09090;
}
.cal-cell .lunar {
  font-size: 8px;
  color: var(--text-muted);
  line-height: 1;
  margin-top: 1px;
  white-space: nowrap;
}
.cal-cell .lunar.festival {
  color: #e07070;
  font-weight: 600;
}
.cal-cell .lunar.special {
  color: #d09050;
  font-weight: 600;
}
.cal-cell .weight-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 2px;
  width: 100%;
}
.cal-cell .weight-tag {
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(135deg, #f0c0d8 0%, #e8a0c0 100%);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 2px rgba(200,120,160,0.25);
}
.cal-cell .weight-diff {
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}
.weight-diff.loss { color: #3a8e5e; }
.weight-diff.gain { color: #d05050; }

/* 日历运动打卡标签 */
.cal-cell .ex-row {
  display: flex;
  gap: 1px;
  justify-content: center;
  margin-top: 1px;
  flex-wrap: wrap;
}
.cal-cell .ex-tag {
  font-size: 11px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 3px;
  background: #e0f0e8;
  box-shadow: 0 1px 2px rgba(100,160,120,0.15);
}

/* 经期标记点 — 左上角 */
.period-dot-row {
  position: absolute; top: 2px; left: 2px;
  display: flex; gap: 2px;
}
.period-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.period-dot.actual { background: #e05050; }
.period-dot.predicted { background: #f0a0b8; }

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
/* 日历中计划内容 */
.cell-plan {
  font-size: 8px;
  color: #3b6fa0;
  background: #dceaf5;
  padding: 2px 4px;
  border-radius: 4px;
  margin-top: 2px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  border: 1px solid #c0d8ee;
}
.cell-plan.done {
  background: #d0eed0;
  color: #3a7030;
  text-decoration: line-through;
  border-color: #a8d8a8;
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.dot-weight { background: var(--weight-color); border: 1px solid #d098b8; }
.legend-dot-inline {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0; vertical-align: middle; margin-right: 1px;
}
.legend-diff {
  font-size: 8px; font-weight: 700;
  color: #4a9e6e; background: #e0f5e8;
  padding: 1px 5px; border-radius: 3px;
}

/* ========== 通用卡片 ========== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.add-card {
  border-left: 3px solid var(--cal-color);
}

/* ========== 按钮 ========== */
.btn-primary {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: linear-gradient(135deg, #c9a8e8, #d5b8e8);
  color: #fff;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; }
.btn-text {
  background: none; border: none;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
}
.btn-text:hover { background: var(--border); }

/* ========== 分类标签栏（始终可见） ========== */
.category-bar {
  display: flex;
  gap: 6px;
  padding: 8px 0 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 52px;
  z-index: 10;
  background: var(--bg);
}
.cat-pill {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-light);
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill:hover { background: #f4f0fb; }
.cat-pill.active { font-weight: 700; }

/* 待办分类色 */
.cat-pill.cat-urgent { color: #e0506a; }
.cat-pill.cat-urgent.active { background: #fde8ec; border-color: #f0a0b0; color: #c03050; }
.cat-pill.cat-work { color: #c08050; }
.cat-pill.cat-work.active { background: #fef0e5; border-color: #f5c8a0; color: #a06030; }
.cat-pill.cat-life { color: #60a080; }
.cat-pill.cat-life.active { background: #e8f5ec; border-color: #a0d8b8; color: #408060; }
.cat-pill.cat-buy { color: #a080c0; }
.cat-pill.cat-buy.active { background: #f0e8f8; border-color: #c8b0e0; color: #7050a0; }
.cat-pill.cat-read { color: #6080c0; }
.cat-pill.cat-read.active { background: #e8f0f8; border-color: #a0c0e0; color: #4060a0; }
.cat-pill.cat-manman { color: #b06f8f; }
.cat-pill.cat-manman.active { background: #f9eaf1; border-color: #ddb2c7; color: #8f4f70; }

/* 备忘录分类色 */
.cat-pill.cat-roro { color: #d08090; }
.cat-pill.cat-roro.active { background: #fde8ec; border-color: #f0b8c0; color: #b05060; }
.cat-pill.cat-beiguo { color: #c09060; }
.cat-pill.cat-beiguo.active { background: #fdf0e5; border-color: #f0c8a0; color: #a06830; }
.cat-pill.cat-gege { color: #60a0c0; }
.cat-pill.cat-gege.active { background: #e8f2f8; border-color: #a0c8e0; color: #4070a0; }
.cat-pill.cat-mantou { color: #80b060; }
.cat-pill.cat-mantou.active { background: #ecf5e5; border-color: #b8d8a0; color: #508030; }
.cat-pill.cat-other { color: #a0a0b0; }
.cat-pill.cat-other.active { background: #f0f0f5; border-color: #c8c8d8; color: #707080; }

/* ========== 待办列表 ========== */
.add-form-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.add-form-row input[type="text"] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  background: #faf7fc;
  color: var(--text);
  outline: none;
  transition: border 0.2s;
}
.add-form-row input[type="text"]:focus {
  border-color: #c9a8e8;
}
.category-select {
  padding: 9px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  background: #faf7fc;
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.btn-add {
  flex-shrink: 0;
}

.todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}
.todo-checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.todo-checkbox.done {
  background: #b8d8c0;
  border-color: #80c090;
}
.todo-checkbox.done::after {
  content: '✓';
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}
.todo-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.todo-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.todo-cat-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.todo-cat-tag.urgent { background: #fde8ec; color: #e0506a; }
.todo-cat-tag.work { background: #fef0e5; color: #c08050; }
.todo-cat-tag.life { background: #e8f5ec; color: #60a080; }
.todo-cat-tag.buy { background: #f0e8f8; color: #a080c0; }
.todo-cat-tag.read { background: #e8f0f8; color: #6080c0; }
.todo-cat-tag.manman { background: #f9eaf1; color: #b06f8f; }
.todo-del-btn {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: all 0.2s;
}
.todo-item:hover .todo-del-btn { opacity: 1; }
.todo-del-btn:hover { color: #e07070; }

/* 拖拽手柄 */
.todo-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -2px;
  user-select: none;
  padding: 0 2px;
  touch-action: none;
}
.todo-drag-handle:active { cursor: grabbing; }

/* 自定义指针拖拽 */
.todo-wrapper {
  position: relative;
  overflow: hidden;
}
.todo-wrapper.drag-placeholder {
  opacity: 0.12;
}
.todo-drag-clone {
  box-shadow: 0 8px 28px rgba(0,0,0,0.16);
  opacity: 0.96;
  border-radius: var(--radius-sm);
}

/* 左滑删除背景 */
.todo-swipe-del {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 76px;
  background: #f5c8c8;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* 分组标题 */
.todo-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.todo-group-header:first-child { margin-top: 0; }
.todo-group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.todo-group-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* 组内列表 */
.todo-group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

/* ===== 急办项高亮 ===== */
.todo-item.todo-urgent-item {
  border-left: 3px solid #e0506a;
  background: linear-gradient(90deg, #fff5f7 0%, var(--bg-card) 30%);
}

/* ===== 类目标签可点击 ===== */
.todo-cat-tag[data-action="cat"] {
  cursor: pointer;
  transition: all 0.15s;
}
.todo-cat-tag[data-action="cat"]:hover {
  filter: brightness(0.92);
}
.todo-cat-arrow {
  font-size: 8px;
  opacity: 0.6;
  margin-left: 1px;
}

/* ===== 已完成折叠区 ===== */
.todo-done-section {
  margin-top: 12px;
}
.todo-done-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f0f0f5;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.todo-done-header:hover {
  background: #e8e8f0;
}
.todo-done-arrow {
  font-size: 10px;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
}
.todo-done-arrow.collapsed { color: var(--text-muted); }
.todo-done-arrow.expanded { color: var(--text); }
.todo-done-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
}
.todo-done-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.todo-done-list .todo-item {
  opacity: 0.65;
}
.todo-done-list .todo-item:hover {
  opacity: 1;
}

/* ===== 类目切换浮窗 ===== */
.cat-switcher {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 10px;
  min-width: 160px;
  animation: catSwitcherIn 0.15s ease-out;
}
@keyframes catSwitcherIn {
  from { opacity: 0; transform: scale(0.92) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.cat-switcher-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 0 2px;
}
.cat-switcher-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  color: var(--text);
}
.cat-switcher-btn:hover {
  background: #f4f0fb;
}
.cat-switcher-btn.active {
  background: #f0e6f6;
}
.cat-switcher-btn.active::after {
  content: '✓';
  margin-left: auto;
  font-size: 12px;
}

/* ========== 备忘录 ========== */
.memo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.memo-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid transparent;
}
.memo-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.memo-card.cat-roro { border-left-color: #e8b0b8; background: #fdf5f7; }
.memo-card.cat-beiguo { border-left-color: #e8c8a8; background: #fdf8f2; }
.memo-card.cat-gege { border-left-color: #a8c8e0; background: #f2f6fa; }
.memo-card.cat-mantou { border-left-color: #b0d898; background: #f4faf0; }
.memo-card.cat-other { border-left-color: #c8c8d8; background: #f7f7fa; }
.memo-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.memo-card-preview {
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memo-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.memo-card-cat {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 10px;
}
.memo-card-cat.roro { background: #fde8ec; color: #b05060; }
.memo-card-cat.beiguo { background: #fdf0e5; color: #a06830; }
.memo-card-cat.gege { background: #e8f2f8; color: #4070a0; }
.memo-card-cat.mantou { background: #ecf5e5; color: #508030; }
.memo-card-cat.other { background: #f0f0f5; color: #707080; }

/* 全屏备忘编辑器 */
.modal-overlay.memo-editor-open {
  align-items: stretch;
  padding: 0;
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.modal.memo-editor {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  animation: none;
  box-shadow: none;
}
.memo-editor .modal-header {
  flex: 0 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  background: var(--bg-card);
}
.memo-editor .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 0;
  overflow: hidden;
}
.memo-editor-form {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}
.memo-editor-title-group {
  flex: 0 0 auto;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.memo-editor-content-group {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
}
.memo-editor-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
}
.memo-editor-title-input,
.memo-editor-content {
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  color: var(--text);
  background: transparent;
  font-family: inherit;
}
.memo-editor-title-input {
  padding: 4px 0;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
}
.memo-editor-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 0 24px;
  resize: none;
  font-size: 16px;
  line-height: 1.75;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.memo-editor-content::placeholder { color: var(--text-muted); }
.memo-editor-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.memo-editor-delete,
.memo-editor-save {
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.memo-editor-delete {
  flex: 0 0 82px;
  border: 1px solid #e8c0c0;
  background: transparent;
  color: #c06060;
}
.memo-editor-save {
  flex: 1 1 auto;
  border: none;
  color: #fff;
  background: linear-gradient(135deg,#c9a8e8,#d5b8e8);
}

/* ========== 购物清单（无数量） ========== */
.shopping-form-row {
  display: flex;
  gap: 6px;
}
.shopping-form-row input {
  flex: 1;
}
.shopping-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 8px;
  font-size: 12px;
}
.shopping-stats { color: var(--text-light); }
.shopping-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.shopping-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.shopping-item.bought { opacity: 0.5; }
.shopping-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.shopping-check.checked {
  background: #b0d8a0;
  border-color: #80b870;
}
.shopping-check.checked::after {
  content: '✓';
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}
.shopping-name {
  flex: 1;
  font-size: 13px;
}
.shopping-name.done { text-decoration: line-through; color: var(--text-muted); }
.shopping-del {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 16px; cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}
.shopping-item:hover .shopping-del { opacity: 1; }
.shopping-del:hover { color: #e07070; }

/* ========== 体重记录 ========== */
.weight-add-card { border-left: 3px solid var(--weight-color); }
.weight-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
}
.weight-date-input, .weight-value-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  background: #faf7fc;
  color: var(--text);
  outline: none;
  width: 100%;
}
.weight-value-input { font-size: 18px; font-weight: 700; text-align: center; }
.type-toggle {
  display: flex;
  gap: 8px;
}
.type-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.type-btn.active {
  background: var(--weight-color);
  color: var(--weight-color-text);
  border-color: var(--weight-color);
}

.weight-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.weight-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.weight-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--weight-color-text);
}
.weight-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.weight-chart-card { border-left: 3px solid var(--weight-color); }
.weight-chart-card canvas {
  width: 100% !important;
  height: auto !important;
}

/* ===== 运动打卡（体重记录内）===== */
.exercise-card { border-left: 3px solid #5ba870; }
.exercise-cal { margin-bottom: 8px; }
.exercise-day-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}
.exercise-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.exercise-toggle {
  padding: 7px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.exercise-toggle.checked {
  border-color: #5ba870;
  background: #e0f0e4;
  color: #408050;
}

/* ===== 迷你日历（体重 & 运动）===== */
.minical-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.minical-arrow {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.15s;
}
.minical-arrow:hover { background: var(--cal-color-bg); }
.minical-today {
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
  white-space: nowrap;
}
.minical-today:hover { background: var(--accent); color: #fff; }
.minical-today:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.minical-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.minical-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}
.minical-dow {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 0;
  font-weight: 600;
}
.minical-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid transparent;
  min-width: 0;
}
.minical-day.empty { background: none; cursor: default; }
.minical-day.today { border-color: var(--weight-color); }
.minical-day.selected { background: var(--weight-color); color: #fff; }
.minical-day.ex-day { aspect-ratio: auto; min-height: 36px; padding: 2px 1px; }
.minical-day.ex-day span { line-height: 1.2; }
.minical-day .ex-dots {
  font-size: 9px;
  letter-spacing: -1px;
  line-height: 1;
}

/* 体重日历中的数值标记 */
.minical-day .wcell-val {
  font-size: 8px;
  font-weight: 700;
  color: var(--weight-color-text);
  line-height: 1;
  margin-top: -2px;
}

/* 经期迷你日历标记 */
.minical-day.period-marked {
  background: var(--period-color-bg);
  color: var(--period-color-text);
  font-weight: 700;
}
.minical-day .pcell-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin: 1px auto 0;
}
.minical-day .pcell-dot.start { background: var(--period-color); }
.minical-day .pcell-dot.end { background: var(--period-color); }
.minical-day .pcell-dot.single { background: var(--period-color); }
.minical-day .pcell-dot.mid { background: var(--period-color); opacity: 0.5; }

/* 移除旧体重表单样式 */
.weight-form { display: none; }
.weight-date-input, .weight-value-input, .weight-date-view { display: none; }

.weight-list { display: flex; flex-direction: column; gap: 6px; }
.weight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
}
.weight-item .w-date { color: var(--text-muted); font-size: 11px; width: 70px; flex-shrink: 0; }
.weight-item .w-type {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.weight-item .w-type.morning { background: #e8d5f5; color: #7b5ea8; }
.weight-item .w-type.toilet { background: #f5d5e0; color: #a85b78; }
.weight-item .w-value { font-weight: 700; flex: 1; }
.weight-item .w-diff { font-weight: 700; font-size: 12px; }
.weight-item .w-diff.loss { color: #4a9e6e; }
.weight-item .w-diff.gain { color: #d06868; }
.weight-item .w-del {
  background: none; border: none;
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  padding: 2px 6px;
}
.weight-item .w-del:hover { color: #e07070; }

/* ========== 汇率 ========== */
.currency-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 3px solid var(--curr-color);
}
.currency-row {
  display: flex;
  gap: 8px;
}
.currency-amount, .currency-result {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-weight: 600;
  background: #faf7fc;
  color: var(--text);
  outline: none;
  text-align: center;
}
.currency-result { background: var(--curr-color-bg); border-color: var(--curr-color); }
.currency-select {
  padding: 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  background: #faf7fc;
  color: var(--text);
  cursor: pointer;
  min-width: 70px;
  outline: none;
}
.currency-swap-btn {
  align-self: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
}
.currency-swap-btn:hover { background: var(--curr-color-bg); color: var(--curr-color-text); }
.rate-info {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--curr-color-text);
  padding: 8px;
  background: var(--curr-color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.rate-update {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.rate-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 14px;
  background: var(--curr-color-bg);
  border: 1px solid var(--curr-color);
  border-radius: var(--radius-xs);
  font-size: 11px;
  color: var(--curr-color-text);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.rate-refresh-btn:hover { background: var(--curr-color); }
.rate-refresh-btn:active { opacity: 0.7; }
.rate-refresh-btn.loading svg {
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rate-refresh-btn-wrapper {
  text-align: center;
  margin-bottom: 8px;
}
.quick-rate-card { border-left: 3px solid var(--curr-color); }
.quick-rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
}
.quick-rate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--curr-color-bg);
  border-radius: var(--radius-xs);
  font-size: 13px;
}
.quick-rate-item .qr-pair { color: var(--text-light); font-weight: 500; }
.quick-rate-item .qr-rate { font-weight: 800; color: var(--curr-color-text); font-size: 14px; }

/* ========== 出行导航 ========== */
.metro-city-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.metro-city-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
}
.metro-city-btn.active {
  background: var(--metro-color-bg);
  border-color: var(--metro-color);
  color: var(--metro-color-text);
}
.city-flag { font-size: 16px; }

/* 导航式路线查询卡片 */
.nav-route-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--metro-color);
  margin-bottom: 14px;
}
.nav-route-form { display: flex; flex-direction: column; gap: 0; }

.nav-input-group {
  background: #faf7fc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}
.nav-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}
.nav-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-dot.start {
  background: #60c080;
  box-shadow: 0 0 0 4px rgba(96, 192, 128, 0.2);
}
.nav-dot.end {
  background: #e07070;
  box-shadow: 0 0 0 4px rgba(224, 112, 112, 0.2);
}
.nav-input-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 0 32px;
}
.nav-location-input {
  flex: 1;
  padding: 12px 4px;
  border: none;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  outline: none;
}
.nav-location-input::placeholder { color: var(--text-muted); }
.nav-location-input:focus { outline: none; }

.nav-route-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-swap-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
  flex-shrink: 0;
}
.nav-swap-btn:hover { background: var(--metro-color-bg); color: var(--metro-color-text); }

.nav-search-btn {
  flex: 1;
  padding: 11px 20px;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
}

/* 结果容器 */
.nav-result { margin-bottom: 14px; }
.nav-result-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.nav-empty-icon { font-size: 36px; margin-bottom: 8px; }

/* 结果头部：起终点 + 距离 */
.nav-result-header {
  background: var(--metro-color-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.nav-od-info { display: flex; flex-direction: column; gap: 8px; }
.nav-od-point {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-od-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-od-dot.start { background: #60c080; }
.nav-od-dot.end { background: #e07070; }
.nav-od-name { font-weight: 700; font-size: 14px; }
.nav-od-nearby {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.nav-dist-badge {
  text-align: center;
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-light);
}

/* 地铁线路卡片 */
.nav-subway-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 12px;
}
.nav-subway-card.nav-no-route {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.nav-subway-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.nav-mode-icon { font-size: 22px; }
.nav-mode-title { font-size: 15px; font-weight: 700; color: var(--metro-color-text); }
.nav-mode-time {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-light);
}
.nav-mode-time b { color: var(--metro-color-text); font-size: 18px; }

.nav-subway-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.nav-line-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-subway-steps { margin-bottom: 8px; }

/* 路线段 */
.nav-segment {
  display: flex;
  gap: 10px;
  padding: 4px 0;
}
.nav-segment-line {
  width: 4px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-height: 48px;
  position: relative;
}
.nav-segment-start-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  position: absolute;
  top: 4px;
}
.nav-segment-end-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 3px solid;
  background: #fff;
  position: absolute;
  bottom: 4px;
}
.nav-segment-end-dot.solid {
  width: 12px; height: 12px;
  border: none;
}
.nav-segment-info {
  flex: 1;
  padding: 2px 0;
}
.nav-segment-stations {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}
.nav-segment-from, .nav-segment-to {
  font-weight: 600;
  color: var(--text);
}
.nav-segment-arrow { color: var(--text-muted); font-size: 12px; }
.nav-segment-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.nav-segment-line-name {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

/* 换乘步骤 */
.nav-transfer-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 6px 14px;
  font-size: 12px;
  color: var(--text-light);
}
.nav-transfer-icon {
  font-size: 16px;
  color: #f0a030;
  font-weight: 700;
}

.nav-subway-summary {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}

/* 出行方式对比 */
.nav-compare-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 14px;
}
.nav-compare-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.nav-compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.nav-compare-item {
  text-align: center;
  padding: 12px 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.nav-compare-item.metro { background: var(--metro-color-bg); border-color: var(--metro-color); }
.nav-compare-item.taxi { background: #fdf5f0; border-color: #f0d0b0; }
.nav-compare-item.walk { background: #f0f8f0; border-color: #c0e0c0; }
.nav-compare-item.bike { background: #f5f0fa; border-color: #d8c8f0; }

.nav-compare-icon { font-size: 24px; margin-bottom: 4px; }
.nav-compare-label { font-size: 11px; font-weight: 600; color: var(--text-light); margin-bottom: 4px; }
.nav-compare-time {
  font-size: 16px; font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.nav-compare-cost {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.nav-compare-item.metro .nav-compare-time { color: var(--metro-color-text); }
.nav-compare-item.taxi .nav-compare-time { color: #a06830; }
.nav-compare-item.walk .nav-compare-time { color: #408050; }
.nav-compare-item.bike .nav-compare-time { color: #7050a0; }

/* 候选站点��表 */
.nav-candidates {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-candidate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.nav-candidate-item:hover {
  background: var(--metro-color-bg);
  border-color: var(--metro-color);
}
.nav-candidate-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.nav-candidate-lines {
  font-size: 11px;
}

/* 附近站点列表 */
.nav-nearby-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-nearby-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.nav-nearby-row:hover {
  background: var(--metro-color-bg);
  border-color: var(--metro-color);
}
.nav-nearby-rank {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--metro-color);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-nearby-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-nearby-name { font-size: 14px; font-weight: 600; }
.nav-nearby-lines { font-size: 10px; color: var(--text-muted); }
.nav-nearby-dist {
  font-size: 13px;
  font-weight: 700;
  color: var(--metro-color-text);
  white-space: nowrap;
}
.nav-nearby-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 站点联想下拉 */
.metro-suggestions {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  min-width: 200px;
}
.metro-suggestions.show { display: block; }
.metro-suggestion-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.metro-suggestion-item:hover {
  background: var(--metro-color-bg);
}

/* 路线方案切换标签 */
.nav-route-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.nav-route-tab {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.nav-route-tab.active {
  background: var(--metro-color-bg);
  border-color: var(--metro-color);
  color: var(--metro-color-text);
}
.nav-route-panels { position: relative; }
.nav-route-panel { display: none; }
.nav-route-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 地铁线路总览图 */
.metro-overview-card {
  border-left: 3px solid var(--metro-color);
  margin-top: 14px;
}
.metro-overview-card .card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: -8px 0 12px;
}
.metro-overview-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
  position: relative;
}
.metro-overview-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.2s;
}
.metro-overview-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 图片缩放模态框 */
.image-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.92);
  z-index: 1000;
  flex-direction: column;
}
.image-zoom-overlay.show { display: flex; }
.image-zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  flex-shrink: 0;
}
.image-zoom-title { font-size: 15px; font-weight: 700; }
.image-zoom-btns { display: flex; gap: 8px; }
.image-zoom-btn {
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.image-zoom-btn:hover { background: rgba(255,255,255,0.28); }
.image-zoom-close { background: rgba(255,100,100,0.3); }
.image-zoom-close:hover { background: rgba(255,100,100,0.5); }
.image-zoom-stage {
  flex: 1;
  overflow: hidden;
  cursor: grab;
  position: relative;
  touch-action: none;
}
.image-zoom-stage img {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.image-zoom-tip {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.85);
  border-radius: 20px;
  font-size: 12px;
  pointer-events: none;
}

/* ========== 左滑删除 ========== */
.swipe-wrapper {
  position: relative;
  overflow: hidden;
}
.swipe-del-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: #f0c0c0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.swipe-del-bg:active { background: #e8a0a0; }

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  background: #3d3650;
  color: #fff;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ========== 模态框 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(60,40,70,0.3);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes modalSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: none;
  font-size: 22px; cursor: pointer;
  color: var(--text-light);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 16px; }

/* ========== 经期记录 ========== */

/* ========== 经期记录 ========== */
.period-add-card { border-left: 3px solid var(--period-color); }
.period-form-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.period-predict-card { border-left: 3px solid var(--period-color); }
.period-predict-content { text-align: center; }
.period-next-date {
  padding: 16px 10px;
  background: var(--period-color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.period-next-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.period-next-start {
  font-size: 22px;
  font-weight: 800;
  color: var(--period-color-text);
}
.period-next-end {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}
.period-next-status {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.period-status-soon {
  background: #fde8d0;
  color: #c07040;
}
.period-status-today {
  background: #fde0e0;
  color: #c04040;
}
.period-status-normal {
  background: #e0f0e8;
  color: #408050;
}
.period-status-ongoing {
  background: #fde0ea;
  color: #c04060;
}
.period-status-late {
  background: #e8e0f0;
  color: #7050a0;
}
.period-next-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

.period-stats-card { border-left: 3px solid var(--period-color); }
.period-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}
.period-stat-item {
  background: var(--period-color-bg);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.period-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--period-color-text);
}
.period-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.period-history-card { border-left: 3px solid var(--period-color); }
.period-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.period-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s;
  position: relative;
}
.period-item-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 120px;
  flex-shrink: 0;
}
.period-item-start {
  font-weight: 700;
  font-size: 14px;
  color: var(--period-color-text);
}
.period-item-arrow {
  color: var(--text-muted);
  font-size: 12px;
}
.period-item-end {
  font-size: 13px;
  color: var(--text-light);
}
.period-item-ongoing {
  font-size: 11px;
  padding: 2px 8px;
  background: #fde0ea;
  color: #c04060;
  border-radius: 10px;
  font-weight: 600;
}
.period-item-info {
  display: flex;
  gap: 10px;
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
}
.period-duration {
  font-weight: 600;
  color: var(--text-light);
}
.period-cycle {
  color: var(--text-muted);
}
.period-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: all 0.2s;
}
.period-item:hover .period-del { opacity: 1; }
.period-del:hover { color: #e07070; }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 36px; margin-bottom: 8px; }

/* ========== 响应式：手机端 ========== */
@media (max-width: 640px) {
  :root {
    --sidebar-width: 60px;
    --sidebar-width-desktop: 60px;
  }
  .sidebar { padding: 8px 3px; }
  .logo-icon { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
  .logo-text { display: none; }
  .nav-item { padding: 6px 2px 4px; }
  .nav-text { font-size: 8px; }
  .nav-icon { width: 24px; height: 24px; }
  .nav-icon svg { width: 18px; height: 18px; }
  .nav-badge { top: 3px; right: 3px; font-size: 8px; min-width: 14px; height: 14px; }
  .nav-group { margin-bottom: 8px; }
  .nav-group-title { font-size: 7px; padding: 2px 0 1px; }

  .content { padding: 10px; padding-bottom: 40px; }
  .main-header { padding: 10px 14px; }
  .page-title { font-size: 16px; }

  .calendar-scroll { max-height: calc(100vh - 180px); }
  .cal-main-title { font-size: 14px; min-width: 100px; }
  .cal-cell { min-height: 38px; }
  .cal-cell .solar { font-size: 11px; }
  .cal-cell .lunar { font-size: 7px; }
  .cal-cell .weight-tag { font-size: 7px; padding: 1px 3px; }
  .cal-cell .weight-diff { font-size: 7px; }
  .cal-cell .ex-tag { font-size: 10px; }

  .memo-grid { grid-template-columns: 1fr; }
  .add-form-row { flex-wrap: wrap; }
  .category-select { flex: 1; min-width: 60px; }
  .btn-add { padding: 8px 12px; font-size: 12px; }

  .metro-compare, .metro-route-summary { grid-template-columns: repeat(3, 1fr); }
  .metro-city-btn { font-size: 11px; padding: 8px 6px; }
  .nav-compare-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-location-input { font-size: 13px; }
  .nav-search-btn { font-size: 13px; padding: 10px 16px; }
  .nav-compare-time { font-size: 14px; }
  .nav-route-card { padding: 12px 10px; }
}

/* 桌面端 */
@media (min-width: 768px) {
  :root { --sidebar-width: 110px; }
  .sidebar { padding: 16px 8px; }
  .nav-text { font-size: 12px; }
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius); max-height: 80vh; }
}

/* ========== 数据迁移 ========== */
.migrate-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.migrate-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.migrate-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.migrate-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 10px;
}
.migrate-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.migrate-btn-primary {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.15s;
}
.migrate-btn-primary:hover { opacity: 0.88; }
.migrate-btn-secondary {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.migrate-btn-secondary:hover { background: var(--border); }
.migrate-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.migrate-summary-item {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.migrate-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.migrate-summary-label {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}
.migrate-warn {
  font-size: 12px;
  color: #e74c3c;
  background: #fdf0ef;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 10px 0;
  line-height: 1.5;
}
.migrate-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.direct-transfer-area {
  margin-top: 10px;
}
.direct-transfer-code {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 11px;
  font-family: monospace;
  word-break: break-all;
  resize: vertical;
  color: var(--text);
}
.direct-transfer-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
  line-height: 1.5;
}
.migrate-import-preview {
  margin: 10px 0;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.preview-label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.migrate-btn-confirm {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: #e74c3c;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.migrate-btn-confirm:hover { opacity: 0.88; }
.migrate-btn-cancel {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}

/* ===== iOS 小组件教程 ===== */
.widget-sync-status {
  margin-bottom: 10px;
}
.widget-sync-hint {
  font-size: 11px;
  color: var(--text-light);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.widget-sync-info {
  font-size: 11px;
  color: #60a080;
  padding: 6px 10px;
  background: #e8f5ec;
  border-radius: var(--radius-sm);
}
.widget-tutorial {
  padding: 4px 0;
}
.widget-tutorial-step {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.widget-tutorial-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.widget-tutorial-content {
  flex: 1;
}
.widget-tutorial-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.widget-tutorial-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}
.widget-tutorial-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.widget-tutorial-btn-row .migrate-btn-primary,
.widget-tutorial-btn-row .migrate-btn-secondary {
  flex: none;
  min-width: auto;
  padding: 6px 12px;
  font-size: 12px;
}
.widget-tutorial-note {
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  margin-top: 4px;
}
