﻿/* 全局数字统一使用思源宋体（0-9 走 Noto Serif SC；英文继续 Georgia、中文继续思源宋体） */
@font-face {
  font-family: 'GlobalNum';
  src: url('https://fonts.gstatic.com/s/notoserifsc/v35/H4chBXePl9DZ0Xe7gG9cyOj7kqGWbg.woff2') format('woff2');
  unicode-range: U+0030-0039;
  font-display: swap;
}
/* ========== CSS Variables ========== */
:root {
  --gold: #d4a574;
  --gold-light: #e8c9a0;
  --gold-dark: #b88a5a;
  --pink: #f5d5dd;
  --pink-light: #fce8ec;
  --pink-deep: #e8a0b0;
  --white: #ffffff;
  --bg-main: #f9f6f0;
  /* Apple 极简 · 金粉白渐变大背景（透出底色，供毛玻璃卡片折射） */
  --bg-body:
    radial-gradient(1100px 750px at 88% -12%, rgba(245, 213, 221, 0.60), rgba(245, 213, 221, 0) 62%),
    radial-gradient(950px 700px at -8% 28%, rgba(232, 201, 160, 0.50), rgba(232, 201, 160, 0) 60%),
    radial-gradient(900px 800px at 55% 115%, rgba(248, 216, 224, 0.42), rgba(248, 216, 224, 0) 62%),
    linear-gradient(175deg, #fdfbf7 0%, #f9f5ee 55%, #faf1ec 100%);
  --bg-card: linear-gradient(135deg, rgba(255, 255, 255, 0.58) 0%, rgba(252, 235, 220, 0.48) 50%, rgba(252, 230, 238, 0.45) 100%);
  --bg-card-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(250, 230, 210, 0.62) 50%, rgba(252, 228, 235, 0.58) 100%);
  --bg-sidebar: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(252, 244, 236, 0.38) 100%);
  --bg-overlay: rgba(140, 140, 140, 0.35);
  --text-primary: #3a3228;
  --text-secondary: #7a6e60;
  --text-muted: #a89c8e;
  --border-color: rgba(255, 255, 255, 0.65);
  --shadow-sm: 0 2px 12px rgba(180, 150, 120, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  --shadow-md: 0 8px 28px rgba(180, 150, 120, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  --shadow-lg: 0 16px 48px rgba(180, 150, 120, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-width: 220px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-size: 16px;
  --font-weight: 400;
  --font-family: 'GlobalNum', 'Georgia', 'Noto Serif SC', 'Source Han Serif SC', '思源宋体', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', serif;
--font-num: 'GlobalNum', 'Georgia', 'Noto Serif SC', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', serif;
  --card-scale: 1;
  --card-opacity: 1;
  --page-width: 1200px;
  --priority-high: #e85d6c;
  --priority-medium: #f0a050;
  --priority-low: #6dba7a;
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg-main: #1a1714;
  --bg-body:
    radial-gradient(1100px 750px at 88% -12%, rgba(96, 62, 86, 0.38), rgba(96, 62, 86, 0) 62%),
    radial-gradient(950px 700px at -8% 28%, rgba(88, 68, 46, 0.32), rgba(88, 68, 46, 0) 60%),
    linear-gradient(175deg, #1e1a16 0%, #1a1714 55%, #1f1a17 100%);
  --bg-card: linear-gradient(135deg, rgba(48, 42, 38, 0.62) 0%, rgba(38, 33, 30, 0.52) 100%);
  --bg-card-hover: linear-gradient(135deg, rgba(58, 50, 46, 0.78) 0%, rgba(48, 42, 38, 0.68) 100%);
  --bg-sidebar: rgba(26, 23, 20, 0.72);
  --bg-overlay: rgba(20, 18, 16, 0.50);
  --text-primary: #f0e8dc;
  --text-secondary: #c4b8a8;
  --text-muted: #8a7e70;
  --border-color: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Theme accent overrides (set by JS) */
body[data-accent="dark"] {
  --bg-sidebar: rgba(30, 27, 40, 0.72);
  --text-primary: #f5f2ec;
  --text-secondary: #d8d0c4;
  --text-muted: #a89c8e;
  --bg-card: rgba(30, 27, 40, 0.58);
  --bg-card-hover: rgba(40, 36, 52, 0.74);
  --border-color: rgba(255, 255, 255, 0.14);
}

body[data-accent="purple"] {
  --bg-sidebar: rgba(52, 42, 88, 0.72);
  --text-primary: #f2edff;
  --text-secondary: #d5c8f5;
  --text-muted: #a89bc8;
  --bg-card: rgba(255, 255, 255, 0.55);
  --bg-card-hover: rgba(255, 255, 255, 0.75);
  --border-color: rgba(102, 126, 234, 0.25);
}

body[data-accent="warm"] {
  --bg-sidebar: rgba(122, 62, 82, 0.72);
  --text-primary: #fdf0f3;
  --text-secondary: #f2d5dd;
  --text-muted: #d5aab6;
  --bg-card: rgba(255, 250, 250, 0.55);
  --bg-card-hover: rgba(255, 250, 250, 0.75);
  --border-color: rgba(240, 147, 251, 0.25);
}

body[data-accent="blue"] {
  --bg-sidebar: rgba(28, 62, 105, 0.72);
  --text-primary: #eef7ff;
  --text-secondary: #c5def7;
  --text-muted: #8fb3d5;
  --bg-card: rgba(250, 252, 255, 0.55);
  --bg-card-hover: rgba(250, 252, 255, 0.75);
  --border-color: rgba(79, 172, 254, 0.25);
}

body[data-accent="green"] {
  --bg-sidebar: rgba(24, 78, 62, 0.72);
  --text-primary: #eefaf4;
  --text-secondary: #c5e8d8;
  --text-muted: #8fc5ad;
  --bg-card: rgba(250, 255, 252, 0.55);
  --bg-card-hover: rgba(250, 255, 252, 0.75);
  --border-color: rgba(67, 233, 123, 0.25);
}

body[data-accent="pink"] {
  --bg-sidebar: rgba(150, 90, 115, 0.72);
  --text-primary: #fdf0f5;
  --text-secondary: #f5d5e2;
  --text-muted: #d5aab8;
  --bg-card: rgba(255, 252, 253, 0.55);
  --bg-card-hover: rgba(255, 252, 253, 0.75);
  --border-color: rgba(255, 198, 214, 0.35);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--font-size); scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight);
  background: var(--bg-body, var(--bg-main));
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ========== Layout ========== */
/* 旧版侧边栏（保留兼容，实际隐藏） */
.sidebar {
  display: none;
}

/* 浮动玻璃拟态侧边栏 */
.floating-sidebar {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  /* 跨浏览器兼容：先设实色背景兜底，再叠加毛玻璃效果 */
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  -moz-backdrop-filter: blur(28px) saturate(1.7);
  border-radius: 80px;
  padding: 24px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 32px rgba(160, 100, 140, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.5s ease;
  /* 全功能直接展示：导航项较多时限制高度并可滚动，避免小屏溢出 */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.floating-sidebar::-webkit-scrollbar { display: none; }

/* 矮屏幕（笔记本）：收紧导航按钮尺寸，确保全部按钮一屏完整展示 */
@media (max-height: 800px) {
  .floating-sidebar { padding: 16px 10px; }
  .nav-list { gap: 9px; }
  .nav-item { width: 46px; height: 46px; }
}
@media (max-height: 680px) {
  .floating-sidebar { padding: 12px 8px; }
  .nav-list { gap: 6px; }
  .nav-item { width: 40px; height: 40px; }
}

/* 深色模式下浮动侧边栏 */
[data-theme="dark"] .floating-sidebar {
  background: rgba(30, 25, 40, 0.55);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 不支持 backdrop-filter 的浏览器降级为实色 */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .floating-sidebar {
    background: rgba(245, 240, 232, 0.96);
  }
  [data-theme="dark"] .floating-sidebar {
    background: rgba(30, 25, 40, 0.96);
  }
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  color: #9e5e78;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.15rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

/* 悬浮标题：由 JS 定位的 fixed 元素（不受侧边栏 overflow 裁剪影响，跨浏览器一致） */
.nav-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(60, 50, 75, 0.88);
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.nav-tooltip.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.nav-item:hover {
  transform: scale(1.15);
  background: rgba(245, 213, 221, 0.72);
  box-shadow: 0 4px 16px rgba(160, 100, 130, 0.2);
}

.nav-item.active {
  background: rgba(200, 120, 160, 0.88);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(160, 80, 120, 0.25);
}

/* 导航分隔线 */
.nav-divider {
  width: 22px;
  height: 1px;
  background: rgba(160, 100, 130, 0.2);
  margin: 2px 0;
  border-radius: 1px;
}

/* 深色模式下的导航项 */
[data-theme="dark"] .nav-item {
  background: transparent;
  color: #d5c8e0;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .nav-item:hover {
  background: rgba(80, 65, 100, 0.8);
}
[data-theme="dark"] .nav-item.active {
  background: rgba(180, 120, 160, 0.85);
  color: #fff;
}

.nav-icon { display: block; width: 24px; height: 24px; flex-shrink: 0; }
.nav-icon-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
/* 导航中的图片/网站图标 */
.nav-icon-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

/* ===== 更多功能展开面板 ===== */
.extras-panel {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  transform-origin: left center;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-radius: 24px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(160, 100, 140, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
}

.extras-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.extras-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: all 0.25s ease;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.4);
}

.extras-item:hover {
  background: rgba(245, 213, 221, 0.7);
  transform: translateX(3px);
}

.extras-icon { display: inline-flex; align-items: center; justify-content: center; }
.extras-icon svg { width: 18px; height: 18px; }
.extras-label { font-weight: 500; }

[data-theme="dark"] .extras-panel {
  background: rgba(30, 25, 40, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .extras-item {
  background: rgba(255, 255, 255, 0.08);
  color: #e8e0f0;
}
[data-theme="dark"] .extras-item:hover {
  background: rgba(80, 65, 100, 0.6);
}

/* ===== 旧版兼容：折叠模式等 ===== */
.sidebar.collapsed { display: none; }

.main-content {
  margin-left: 88px;
  min-height: 100vh;
  padding: 28px 28px 96px;
  position: relative;
  z-index: 1;
  transition: margin var(--transition);
}

/* ========== Views ========== */
.view {
  display: none;
  animation: fadeInUp 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  /* center every view's content horizontally */
  max-width: var(--page-width);
  margin-left: auto;
  margin-right: auto;
}

.view.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== Overview - Centered ========== */
.overview-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.overview-inner .widgets-grid,
.overview-inner .checkin-wall,
.overview-inner .nav-categories { text-align: left; }

.overview-clock-section { padding: 32px 0 24px; }

.clock-time {
  font-size: 4rem;
  font-weight: 400;
  letter-spacing: 4px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.clock-date { font-size: 1rem; color: var(--text-secondary); margin-top: 8px; }
.clock-lunar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 1.5em;
  margin-top: 4px;
}
.clock-lunar-row .clock-lunar,
.clock-lunar-row .clock-almanac {
  margin-top: 0;
}

.clock-lunar { font-size: 0.85rem; color: var(--gold-dark); margin-top: 4px; }
.clock-almanac { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.clock-quote {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.8;
  max-width: 500px;
}

/* 引言行：句子 + 右侧更新按钮 */
.clock-quote-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.quote-refresh-btn {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-dark);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.quote-refresh-btn:hover { background: rgba(212, 165, 116, 0.18); border-color: var(--gold); }
.quote-refresh-btn:active { transform: scale(0.9); }
.quote-refresh-btn.spinning { animation: quote-spin 0.5s ease; }
@keyframes quote-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== Search Bar ========== */
.search-bar-wrapper { display: flex; justify-content: center; margin: 20px 0 28px; }

.search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 4px 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.15), var(--shadow-md);
}

.search-icon { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: var(--font-family);
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  transition: color var(--transition), background var(--transition);
}
.search-clear-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover, rgba(0,0,0,0.06));
}
.search-clear-btn svg { width: 18px; height: 18px; }

/* ========== Widgets - cards per row (configurable via settings) ========== */
.widgets-section { margin-bottom: 32px; }

.widgets-grid {
  display: grid;
  grid-template-columns: repeat(var(--widget-cols, 4), minmax(0, 1fr));
  gap: 16px;
}

.widget-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  transform: scale(var(--card-scale));
  opacity: var(--card-opacity);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 198px;
}

.widget-card:hover {
  box-shadow: var(--shadow-md);
  transform: scale(calc(var(--card-scale) * 1.02));
}

.widget-card .widget-edit-btn {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* 鼠标悬停卡片时显示操作按钮 */
.widget-card:hover .widget-edit-btn {
  opacity: 1;
  visibility: visible;
}

/* 卡片操作按钮：小尺寸、无背景无边框（hover 时轻提示） */
.widget-card .widget-edit-btn button {
  width: 22px; height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.widget-card .widget-edit-btn button svg { width: 13px; height: 13px; display: block; stroke-width: 2.2; }
.widget-card .widget-edit-btn button:hover { color: var(--gold-dark); background: transparent; }
.widget-card .widget-edit-btn button:disabled { opacity: 0.25; cursor: not-allowed; pointer-events: none; }
.widget-card .widget-edit-btn .widget-move-btn { width: 20px; height: 20px; }
.widget-card .widget-edit-btn .widget-move-btn svg { width: 12px; height: 12px; }

.widget-icon { width: 30px; height: 30px; margin-bottom: 10px; color: var(--gold); }
.widget-title { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; }
.widget-value { font-size: 1.55rem; font-weight: 600; color: var(--text-primary); letter-spacing: 0.5px; }
/* 温度后紧跟的中文天气状况 */
.widget-value-desc { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); margin-left: 4px; }
/* 天气卡片：温度 + 中文天气描述强制单行显示，字体自适应缩小 */
.widget-value.weather-value {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
  overflow: hidden;
  font-size: clamp(1.1rem, 1.1rem + 0.6vw, 1.4rem);
}
.widget-value.weather-value .widget-value-desc {
  font-size: clamp(0.72rem, 0.72rem + 0.3vw, 0.85rem);
  margin-left: 6px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }

/* Weather detail rows (compact for one-row layout) */
.weather-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  padding: 2px 0;
  border-bottom: 1px dashed var(--border-color);
}

.weather-detail:last-child { border-bottom: none; }
.weather-detail .wd-label { color: var(--text-muted); }

/* Generic widget detail rows + progress bar (fuller cards) */
.widget-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  padding: 2px 0;
  border-bottom: 1px dashed var(--border-color);
}
.widget-detail:last-child { border-bottom: none; }
.widget-detail .wd-label { color: var(--text-muted); }

.widget-progress {
  height: 6px;
  background: rgba(212, 165, 116, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.widget-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.widget-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
  font-family: var(--font-family);
}

.widget-add-btn:hover { border-color: var(--gold); color: var(--gold-dark); }
.widget-add-btn svg { width: 18px; height: 18px; }
.widget-add-btn.hidden { display: none; }

/* ========== Section Blocks ========== */
.section-block { margin-bottom: 32px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* 各项目界面标题默认隐藏；概览打卡墙/网站墙标题显示且可点击编辑 */
.section-title { display: none; }
.section-block .section-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: text;
  outline: none;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--transition);
}
.section-block .section-title:hover { border-bottom-color: var(--border-color); }
.section-block .section-title.editing {
  border-bottom-color: var(--gold);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ========== Checkin Wall - Vertical Cards (icon top, text bottom) ========== */
.checkin-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.checkin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-height: 110px;
  text-align: center;
}

.checkin-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.checkin-card:active { transform: scale(0.97); }

/* 卡片真实链接覆盖层：浏览器原生支持"中键 = 后台新标签打开不跳转"，不拦截左键 JS 逻辑 */
.checkin-card .checkin-card-link,
.nav-site-card .nav-site-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  cursor: pointer;
  display: block;
}
.checkin-card .checkin-actions,
.nav-site-card .site-actions {
  z-index: 2;
}

/* 尾部「添加」卡片（虚线占位样式） */
.checkin-card.checkin-add-card {
  border-style: dashed;
  border-color: var(--border-color);
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
}
.checkin-card.checkin-add-card:hover { border-color: var(--gold); color: var(--gold-dark); box-shadow: none; }
.checkin-add-plus { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.checkin-add-plus svg { width: 18px; height: 18px; }

.checkin-card .checkin-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent; /* per-site bg applied inline */
  flex-shrink: 0;
  overflow: hidden;
}

/* 固定图标显示尺寸：不随图标本身大小变化，统一约束在 28px 容器内 */
.checkin-card .checkin-icon img,
.checkin-card .checkin-icon svg {
  width: 28px; height: 28px;
  max-width: 28px; max-height: 28px;
  object-fit: contain;
  display: block;
}

.checkin-card .checkin-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-all;
}

.checkin-card .checkin-actions {
  position: absolute;
  top: 4px; right: 4px;
  display: none;
  gap: 3px;
}

.checkin-card:hover .checkin-actions { display: flex; }

.checkin-card .checkin-actions button {
  width: 22px; height: 22px;
  border: none;
  background: var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.6rem;
}

.checkin-card .checkin-actions button:hover { color: var(--gold-dark); }

/* ========== Nav Categories - Vertical Site Cards ========== */
.nav-category { margin-bottom: 20px; }

.nav-category-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-category-title .cat-actions { display: flex; gap: 2px; margin-left: auto; }
.nav-category-title .cat-actions button {
  width: 24px; height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.nav-category-title .cat-actions button:hover { color: var(--gold-dark); background: rgba(212, 165, 116, 0.15); }
.nav-category-title .cat-actions svg { width: 14px; height: 14px; }

.nav-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

/* 尾部「新增分类」卡片 */
.nav-category-add {
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  color: var(--text-muted);
}
.nav-category-add:hover { border-color: var(--gold); color: var(--gold-dark); }
.nav-category-add-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}
.nav-category-add-inner svg { width: 14px; height: 14px; }

.nav-site-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* 图标与文字在卡片内上下居中 */
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-height: 100px;
  text-align: center;
}

.nav-site-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.nav-site-card:active { transform: scale(0.97); }

.nav-site-card .site-icon {
  width: 22px; height: 22px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
  font-size: 0.95rem;
}

[data-theme="dark"] .nav-site-card .site-icon { background: transparent; }

.nav-site-card .site-icon img { width: 100%; height: 100%; object-fit: cover; }
/* 概览图片类图标：使用指定固定尺寸，不随图标字号/卡片尺寸变化而改变 */
:root { --overview-img-size: 22px; }
.nav-site-card .site-icon img,
.nav-site-card .site-icon .auto-icon-img { width: var(--overview-img-size); height: var(--overview-img-size); object-fit: cover; }
.checkin-wall .checkin-auto-img,
.checkin-wall .nav-icon-img { width: 20px; height: 20px; object-fit: cover; }
.nav-site-card .site-icon-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.4rem;
  line-height: 1;
}

.nav-site-card .site-name {
  font-size: 0.78rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-all;
}

.nav-site-card .site-actions {
  position: absolute;
  top: 4px; right: 4px;
  display: none;
  gap: 2px;
}

.nav-site-card:hover .site-actions { display: flex; }

.nav-site-card .site-actions button {
  width: 20px; height: 20px;
  border: none;
  background: var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.6rem;
}

.nav-site-card .site-actions button:hover { color: var(--gold-dark); }

/* ========== Page Header (centered) ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { display: none; }

/* ========== Buttons ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-family);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-family);
  min-height: 36px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-sm:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-sm:active { transform: scale(0.97); }
.btn-sm.danger:hover { border-color: var(--priority-high); color: var(--priority-high); }

.btn-icon-sm {
  width: 32px; height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  color: #4a3a2a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.45);
}

.btn-icon-sm:hover { background: rgba(255, 255, 255, 0.7); color: #6a4a20; border-color: rgba(160, 120, 70, 0.5); }
.btn-icon-sm:active { transform: scale(0.92); }
.btn-icon-sm svg { display: block; width: 20px; height: 20px; stroke-width: 2.5; }
.icon-sm { display: inline-block; width: 16px; height: 16px; flex-shrink: 0; }
.mt-8 { margin-top: 8px; }

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.12);
}

.form-textarea { resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ========== Weight Module (chart top / stats center / records / input bottom) ========== */
.weight-chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  opacity: var(--card-opacity);
  margin-bottom: 20px;
}

.weight-chart-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.weight-chart-header h3 { font-size: 1.1rem; color: var(--text-primary); }

/* 图表缩放控件（+ / − / 重置），缩放大小由 JS 记忆 */
.chart-zoom-controls { display: flex; align-items: center; gap: 6px; }
.chart-zoom-label { font-size: 0.75rem; color: var(--text-muted); }

/* 图表放大：占满卡片宽度，内层容器尺寸由 JS 按缩放比例控制 */
.weight-chart-wrapper { width: 100%; overflow-x: auto; overflow-y: hidden; }
#weightChartInner { width: 100%; }
#weightChart { width: 100%; height: 100%; display: block; }

/* Base card styles for stats / input / records panels */
.weight-stats-panel, .weight-input-panel, .weight-records-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  opacity: var(--card-opacity);
}

.weight-stats-panel h3, .weight-input-panel h3, .weight-records-panel h3 {
  font-size: 1.05rem; margin-bottom: 16px; color: var(--text-primary);
}

/* 统计数据 与 记录体重 左右并排，内容垂直居中 */
.weight-side-by-side {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.weight-side-by-side .weight-stats-panel,
.weight-side-by-side .weight-input-panel {
  flex: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.weight-side-by-side .weight-stats-panel h3,
.weight-side-by-side .weight-input-panel h3 { text-align: center; }

/* Stats: centered */
.weight-stats-center {
  text-align: center;
}
.weight-stats-center h3 { text-align: center; }

.weight-stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

/* 每行 4 张：最多 8 张卡 → 最多两行 */
.weight-stats-grid .stat-item {
  position: relative;
  width: calc((100% - 36px) / 4);
  min-width: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: rgba(212, 165, 116, 0.08);
}

.weight-stats-grid .stat-label { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.weight-stats-grid .stat-value { font-size: 1.25rem; font-weight: 600; color: var(--gold-dark); }
/* 涨红跌绿（体重升→红，降→绿） */
.weight-stats-grid .stat-value.up { color: #e85d6c; }
.weight-stats-grid .stat-value.down { color: #5a9e6f; }
.stat-unit { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); margin-left: 1px; }

/* 悬停显示的编辑/删除小按钮 */
.stat-card-tools {
  position: absolute;
  top: 3px;
  right: 4px;
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  z-index: 2;
  max-width: calc(100% - 8px);
}
.weight-stats-grid .stat-item:hover .stat-card-tools { display: flex; }
.stat-tool-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(122, 110, 96, 0.85);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-tool-btn:hover { background: var(--gold-dark); }
.stat-tool-btn:disabled { opacity: 0.25; cursor: default; }
.stat-tool-btn:disabled:hover { background: rgba(122, 110, 96, 0.12); }
.stat-tool-btn.danger:hover { background: #e85d6c; }

/* 添加指标虚线卡片 */
.weight-stats-grid .stat-item-add {
  border: 1.5px dashed var(--gold);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}
.weight-stats-grid .stat-item-add:hover { background: rgba(212, 165, 116, 0.14); }
.stat-add-plus { font-size: 1.15rem; font-weight: 600; color: var(--gold-dark); line-height: 1.3; }

/* 指标卡片编辑弹窗（复用组件弹窗样式，收窄） */
.stat-card-panel { max-width: 380px !important; }

/* 股市行情设置弹窗：宽度自适应（覆盖窄面板限制，列表+表单横排需要更宽） */
.stock-settings-panel { max-width: min(94vw, 760px) !important; }
@media (max-width: 768px) {
  .stock-settings-panel { max-width: 94vw !important; }
}

.weight-form-row { display: flex; gap: 12px; margin-bottom: 4px; }
.weight-form-row .form-group { flex: 1; }
.weight-input-panel .btn-primary { width: 100%; justify-content: center; }

/* Input panel pinned at the bottom */
.weight-input-bottom { margin-top: 20px; margin-bottom: 0; }

.weight-records-panel { margin-bottom: 20px; }

.weight-records-list { }

.weight-record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: background var(--transition);
  font-size: 0.95rem;
}

.weight-record-item:hover { background: rgba(212, 165, 116, 0.1); }
.weight-record-item .wr-weight { font-weight: 600; color: var(--gold-dark); }
.weight-record-item .wr-kg { font-weight: 400; }
.weight-record-item .wr-delete { color: var(--text-muted); cursor: pointer; border: none; background: transparent; }
.weight-record-item .wr-delete:hover { color: var(--priority-high); }

/* SVG Chart styles */
.chart-grid line { stroke: var(--border-color); stroke-dasharray: 4 4; }
.chart-axis text { font-size: 11px; fill: var(--text-muted); }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#chartGradient); opacity: 0.3; }
.chart-point { fill: var(--gold); stroke: white; stroke-width: 2; cursor: pointer; }
.chart-point:hover { r: 7; }

/* ========== Checklist ========== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  opacity: var(--card-opacity);
}

  .checklist-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; justify-content: space-between; }
.checklist-tags-left { display: flex; gap: 8px; flex-wrap: wrap; }
.checklist-tags-right { display: flex; gap: 8px; align-items: center; }
.checklist-tag-del { color: #e85d6c; border-color: rgba(232, 93, 108, 0.4); }
.checklist-tag-del:hover { border-color: #e85d6c; background: rgba(232, 93, 108, 0.08); }

.checklist-tag {
  padding: 4px 14px;
  min-height: 28px;
  height: 28px;
  box-sizing: border-box;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}

.checklist-tag.active { background: var(--gold); color: white; border-color: var(--gold); }
.checklist-tag:hover { border-color: var(--gold); }

.checklist-add-form, .todo-add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.checklist-add-form .form-input { flex: 1; min-width: 120px; }
.checklist-add-form .form-select { width: auto; min-width: 100px; }
.todo-add-form .form-input { flex: 1; min-width: 120px; }
.todo-add-form .form-select { width: auto; min-width: 120px; }



.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  margin-bottom: 4px;
}

.checklist-item:hover { background: rgba(212, 165, 116, 0.1); }

.checklist-item .ci-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.checklist-item.done .ci-checkbox { background: var(--gold); border-color: var(--gold); }
.checklist-item.done .ci-checkbox::after { content: '✓'; color: white; font-size: 0.8rem; font-weight: bold; }

.checklist-item .ci-text { flex: 1; font-size: 0.88rem; transition: all 0.3s; }
.checklist-item.done .ci-text { text-decoration: line-through; color: var(--text-muted); }

.checklist-item .ci-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.checklist-item .ci-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.checklist-item .ci-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  background: var(--pink-light);
  color: var(--pink-deep);
}

.checklist-item .ci-delete {
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: opacity var(--transition);
}

.checklist-item:hover .ci-delete { opacity: 1; }
.checklist-item .ci-delete:hover { color: var(--priority-high); }

/* Expense styles */
.expense-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.expense-stat {
  text-align: center;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background: rgba(212, 165, 116, 0.08);
}

.expense-stat .es-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.expense-stat .es-value { font-size: 1.15rem; font-weight: 600; }
.expense-stat.income .es-value { color: var(--priority-high); }
.expense-stat.expense .es-value { color: var(--priority-low); }
.expense-stat.balance .es-value { color: var(--gold-dark); }

.expense-add-form { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; margin-bottom: 12px; align-items: center; width: 100%; box-sizing: border-box; }
.expense-add-form .form-select { width: auto; min-width: 80px; }
.expense-add-form .form-input { width: auto; flex: 1; min-width: 80px; }
/* 日期输入框：缩小宽度 */
.expense-add-form #expenseDate {
  width: 130px;
  min-width: 130px;
  flex: 0 0 130px;
}
/* 支出/收入选择框：固定宽度 */
.expense-add-form #expenseType {
  width: 90px;
  min-width: 90px;
  flex: 0 0 90px;
}
/* 分类选择框：与支出/收入相同宽度 */
.expense-add-form #expenseCategory {
  width: 90px;
  min-width: 90px;
  flex: 0 0 90px;
}
/* 金额输入框 */
.expense-add-form #expenseAmount {
  width: 130px;
  min-width: 130px;
  flex: 0 0 130px;
}
/* 备注输入框：占据剩余空间 */
.expense-add-form #expenseNote {
  flex: 1;
  min-width: 100px;
}
/* 记一笔按钮 */
.expense-add-form .btn-primary {
  flex-shrink: 0;
}

.expense-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.expense-filter .form-input { width: auto; }

/* ===== Expense category manager (separate income/expense chips) ===== */
/* 默认隐藏：通过下拉列表中的「管理分类…」选项打开 */
.expense-cat-manager {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: none;
  gap: 12px;
}

.ecm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ecm-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

.ecm-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; row-gap: 10px; }

.ecm-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 64px;
  flex-shrink: 0;
}

.ecm-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 1 auto; }

.ecm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(212, 165, 116, 0.12);
  color: var(--text-secondary);
}

.ecm-chip i {
  font-style: normal;
  cursor: pointer;
  opacity: 0.55;
  font-size: 0.68rem;
}
.ecm-chip i:hover { opacity: 1; color: var(--priority-high); }

.ecm-add { display: flex; gap: 6px; align-items: center; flex-basis: 100%; padding-left: 72px; }
.ecm-add .form-input { width: 130px; padding: 5px 8px; font-size: 0.78rem; }

.ecm-empty { font-size: 0.75rem; color: var(--text-muted); }
.expense-filter label { color: var(--text-secondary); white-space: nowrap; }
.expense-filter span { color: var(--text-muted); }



.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 0.95rem;
  transition: background var(--transition);
}

.expense-item:hover { background: rgba(212, 165, 116, 0.1); }

.expense-item .ei-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.expense-item .ei-cat { font-size: 0.72rem; padding: 2px 6px; border-radius: 4px; background: var(--pink-light); color: var(--pink-deep); }
.expense-item .ei-amount.income { color: var(--priority-high); font-weight: 600; }
.expense-item .ei-amount.expense { color: var(--priority-low); font-weight: 600; }
.expense-item .ei-delete { opacity: 0; border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: opacity var(--transition); }
.expense-item:hover .ei-delete { opacity: 1; }
/* ===== 生活清单：内容编辑（✎ 按钮 + 行内编辑表单） ===== */
.checklist-item .ci-edit {
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition), color 0.2s, background 0.2s;
}
.checklist-item:hover .ci-edit { opacity: 1; }
.checklist-item .ci-edit:hover { color: var(--gold-dark); background: rgba(212, 165, 116, 0.15); }
@media (hover: none) {
  .checklist-item .ci-edit, .checklist-item .ci-delete { opacity: 1; }
}
.checklist-item.editing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.12); }
.checklist-item.editing .ci-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.checklist-item.editing .ci-edit-form .form-input { flex: 1; min-width: 160px; }
.checklist-item.editing .ci-edit-form .form-select { width: auto; min-width: 104px; }
.checklist-item.editing .ci-edit-form .btn-primary, .checklist-item.editing .ci-edit-form .btn-sm { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .checklist-item.editing .ci-edit-form { flex-direction: column; align-items: stretch; }
  .checklist-item.editing .ci-edit-form .form-select { width: 100%; }
}

/* ===== 生活收支：内容编辑（✎ 按钮 + 行内编辑表单） ===== */
.expense-item .ei-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.expense-item .ei-date {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.expense-item .ei-edit {
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition), color 0.2s, background 0.2s;
}
.expense-item:hover .ei-edit { opacity: 1; }
.expense-item .ei-edit:hover { color: var(--gold-dark); background: rgba(212, 165, 116, 0.15); }
@media (hover: none) {
  .expense-item .ei-edit, .expense-item .ei-delete { opacity: 1; }
}
.expense-item.editing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.12); }
.expense-item.editing .ei-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.expense-item.editing .ei-edit-form .form-input { flex: 1; min-width: 100px; }
.expense-item.editing .ei-edit-form .form-select { width: auto; min-width: 80px; }
.expense-item.editing .ei-edit-form .btn-primary, .expense-item.editing .ei-edit-form .btn-sm { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .expense-item.editing .ei-edit-form { flex-direction: column; align-items: stretch; }
  .expense-item.editing .ei-edit-form .form-select { width: 100%; }
}


/* ========== Travel Module ========== */
.travel-map-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  opacity: var(--card-opacity);
}

.travel-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.map-controls { display: flex; gap: 6px; }

.travel-map-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: grab;
  position: relative;
  background: linear-gradient(135deg, rgba(212,165,116,0.06), rgba(232,160,176,0.06));
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.travel-map-wrapper svg, .travel-map-wrapper svg text { user-select: none; -webkit-user-select: none; }

.travel-map-wrapper:active { cursor: grabbing; }

.map-add-travel-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  color: var(--gold-dark);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(160, 100, 130, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: all 0.3s;
  z-index: 5;
}
.map-add-travel-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(160, 100, 130, 0.2);
}
[data-theme="dark"] .map-add-travel-btn {
  background: rgba(60, 50, 75, 0.55);
  color: #d5c8e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .map-add-travel-btn:hover {
  background: rgba(80, 65, 100, 0.75);
}

/* 地图卡片高度适当放大 */
#chinaMap { width: 100%; height: 560px; touch-action: none; }

/* 地图头部省份定位下拉 */
.map-province-select {
  width: auto;
  min-width: 130px;
  max-width: 180px;
  padding: 5px 10px;
  font-size: 0.8rem;
}

.map-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  justify-content: center;
}

.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); display: inline-block; }
.legend-dot.unvisited { background: rgba(212, 165, 116, 0.25); }

/* National outline base: wide stroke under fills, only outer border stays visible */
.china-outline-base path {
  fill: none;
  stroke: var(--gold-dark);
  stroke-width: 3;
  opacity: 0.9;
  pointer-events: none;
}

.china-map-path {
  fill: rgba(212, 165, 116, 0.18);
  stroke: var(--gold-dark);
  stroke-width: 0.7;
  transition: fill 0.3s;
  cursor: pointer;
}

.china-map-path.visited { fill: var(--gold); }
.china-map-path:hover { fill: rgba(212, 165, 116, 0.5); }

/* 省份定位聚焦高亮 */
.china-map-path.map-focus {
  fill: var(--gold-dark);
  stroke: var(--gold-dark);
  stroke-width: 1.8;
}

.map-city-marker { cursor: pointer; }
.map-city-label { font-size: 11px; fill: var(--text-primary); pointer-events: none; font-weight: 500; }
.map-province-label { font-size: 9px; fill: var(--text-muted); pointer-events: none; }
/* 定位省份：标签文字变黑加粗（!important 覆盖已去过省份的内联白色），
   移除类后自动恢复原色（去过=白色，未去=默认灰） */
.map-province-label.map-label-focus {
  fill: #1a1a1a !important;
  font-weight: 700 !important;
}

.travel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.travel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  opacity: var(--card-opacity);
}

.travel-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.travel-card-cover {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--gold-light), var(--pink-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}

.travel-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.travel-card-body { padding: 16px; }
.travel-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.travel-card-location { font-size: 0.8rem; color: var(--gold-dark); margin-bottom: 4px; }
.travel-card-date { font-size: 0.75rem; color: var(--text-muted); }
.travel-card-stars { color: var(--gold); font-size: 0.85rem; margin-top: 4px; }
.travel-card-actions { display: flex; gap: 4px; margin-top: 8px; }
.travel-card-actions button { flex: 1; }

.travel-editor-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-overlay);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.travel-editor-overlay.active { display: flex; }

.travel-editor-panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.travel-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.travel-editor-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

.star-rating { display: flex; gap: 6px; }
.star { font-size: 1.6rem; color: var(--border-color); cursor: pointer; transition: color 0.2s; }
.star.active { color: var(--gold); }
.star:hover { color: var(--gold-light); }

/* ========== Todo Module ========== */
.todo-filter-bar { display: flex; gap: 8px; margin-bottom: 16px; }

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
  font-family: var(--font-family);
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn.active { background: var(--gold); color: white; border-color: var(--gold); }
.filter-btn:hover { border-color: var(--gold); }



.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.todo-item:hover { box-shadow: var(--shadow-sm); }

.todo-item .ti-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.todo-item.done .ti-checkbox { background: var(--gold); border-color: var(--gold); }
.todo-item.done .ti-checkbox::after { content: '✓'; color: white; font-size: 0.8rem; font-weight: bold; }

.todo-item .ti-text { font-size: 0.95rem; transition: all 0.3s; }
.todo-item.done .ti-text { text-decoration: line-through; color: var(--text-muted); }
.todo-item .ti-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-item .ti-time { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.todo-item .ti-priority {
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: var(--radius-xl);
  font-weight: 500;
}

.ti-priority.high { background: rgba(232, 93, 108, 0.15); color: var(--priority-high); }
.ti-priority.medium { background: rgba(240, 160, 80, 0.15); color: var(--priority-medium); }
.ti-priority.low { background: rgba(109, 186, 122, 0.15); color: var(--priority-low); }

.todo-item .ti-delete {
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: opacity var(--transition);
}

.todo-item:hover .ti-delete { opacity: 1; }
.todo-item .ti-delete:hover { color: var(--priority-high); }

/* ===== 任务编辑：✎ 按钮 + 行内编辑表单 ===== */
.todo-item .ti-edit {
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition), color 0.2s, background 0.2s;
}
.todo-item:hover .ti-edit { opacity: 1; }
.todo-item .ti-edit:hover { color: var(--gold-dark); background: rgba(212, 165, 116, 0.15); }
.todo-item .ti-edit svg { width: 15px; height: 15px; }
/* 触屏设备无 hover：编辑/删除按钮常显 */
@media (hover: none) {
  .todo-item .ti-edit, .todo-item .ti-delete { opacity: 1; }
}

.todo-item.editing { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.12); }
.todo-item.editing .ti-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.todo-item.editing .ti-edit-form .form-input { flex: 1; min-width: 160px; }
.todo-item.editing .ti-edit-form .form-select { width: auto; min-width: 104px; }
.todo-item.editing .ti-edit-form .btn-primary, .todo-item.editing .ti-edit-form .btn-sm { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .todo-item.editing .ti-edit-form { flex-direction: column; align-items: stretch; }
  .todo-item.editing .ti-edit-form .form-select { width: 100%; }
}

/* ========== Hotlist Module ========== */
.hotlist-update-time { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }

.hotlist-grid {
  display: grid;
  grid-template-columns: repeat(var(--hotlist-cols, 3), minmax(0, 1fr));
  gap: 20px;
}

.hotlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  opacity: var(--card-opacity);
}

.hotlist-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.hotlist-platform-icon { width: 24px; height: 24px; border-radius: 6px; }
.hotlist-platform-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.hotlist-source-badge {
  margin-left: auto;
  font-size: 0.62rem;
  color: var(--text-muted);
  background: rgba(212, 165, 116, 0.08);
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hotlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 0 -10px;
}

.hotlist-item:hover { background: rgba(212, 165, 116, 0.12); }

.hotlist-rank {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.15);
  color: var(--gold-dark);
  flex-shrink: 0;
}

.hotlist-rank.top1 { background: var(--priority-high); color: white; }
.hotlist-rank.top2 { background: var(--priority-medium); color: white; }
.hotlist-rank.top3 { background: var(--gold-dark); color: white; }

.hotlist-title {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.hotlist-hot { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }

/* ========== Settings ========== */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  opacity: var(--card-opacity);
  position: relative;
}

/* ===== 设置卡片拖拽排序 ===== */
.settings-card > .settings-card-title:first-of-type { padding-right: 44px; }

.sc-drag-handle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-secondary);
  cursor: grab;
  opacity: 0.45;
  touch-action: none; /* 触屏拖拽时不触发页面滚动 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  z-index: 5;
}

.sc-drag-handle:hover,
.sc-drag-handle:focus-visible { opacity: 1; }

.sc-drag-handle:active { cursor: grabbing; }

.settings-card.sc-dragging {
  opacity: 0.62;
  outline: 2px dashed var(--gold);
  outline-offset: -2px;
  transform: scale(0.99);
}

.settings-card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; color: var(--text-primary); }

/* 合并卡片内的分区线（云端同步 + 主题背景） */
.settings-card-divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0 20px;
}

.theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.theme-preset {
  height: 56px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  font-weight: 500;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.theme-preset:hover { transform: scale(1.05); }
.theme-preset.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.3); }

/* Custom color gradient row */
.custom-color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.custom-color-row input[type="color"] {
  width: 52px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}
.cc-arrow { color: var(--text-muted); }
.cc-label { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 12px;
  gap: 12px;
}

.settings-toggle label { font-size: 0.88rem; color: var(--text-secondary); }

.custom-font-preview {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: none;
}

/* 自定义字体库列表（本地文件 / 链接导入，点击应用，✕ 删除） */
.custom-font-lib { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

.font-lib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.font-lib-item:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }

.font-lib-item.active {
  border-color: var(--gold);
  background: rgba(212, 165, 116, 0.10);
}

.font-lib-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.font-lib-sample {
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-lib-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1px 8px;
  flex-shrink: 0;
}

.font-lib-item .btn-sm { width: 26px; height: 26px; padding: 0; flex-shrink: 0; }

/* 热榜设置弹窗（今日热榜页右上角按钮唤起，比默认编辑弹窗更宽，自适应屏幕宽度） */
.widget-editor-panel.hotlist-settings-panel {
  width: min(880px, 94vw);
  max-width: 880px;
}

/* 热榜数据源状态显示 */
.hotlist-ds-status {
  background: var(--bg-card, rgba(255,255,255,0.95));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 14px);
  padding: 12px 14px;
  font-size: 0.82rem;
}
.ds-status-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.ds-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}
.ds-status-row:last-child { border-bottom: none; }
.ds-dot { font-size: 0.9rem; flex-shrink: 0; }
.ds-name { min-width: 60px; color: var(--text-secondary); }
.ds-src { color: var(--text-muted); margin-left: auto; font-size: 0.78rem; }

.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-color);
  border-radius: 24px;
  transition: var(--transition);
}
.slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(212, 165, 116, 0.4);
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(212, 165, 116, 0.4);
}

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.success { border-color: var(--priority-low); }
.toast.error { border-color: var(--priority-high); }
.toast.info { border-color: var(--gold); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Icon Picker & Widget Editor ========== */
.icon-picker-overlay, .widget-editor-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-overlay);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.icon-picker-overlay.active, .widget-editor-overlay.active { display: flex; }

/* 图标选择器需显示在其他编辑弹窗（导航栏管理等 widget-editor-overlay）之上 */
.icon-picker-overlay { z-index: 1500; }

/* 图标选择器（居中弹窗模式）：遮罩点击外部关闭，面板相对界面居中 */
.icon-picker-panel {
  width: 360px;
  max-width: calc(100vw - 24px);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  max-height: min(560px, 85vh);
}
.icon-picker-site-row { margin-bottom: 10px; }
.icon-picker-site-row .form-group { margin-bottom: 8px; }
.icon-picker-site-row label { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.icon-picker-site-row input { padding: 6px 10px; font-size: 0.85rem; }
.icon-picker-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.icon-picker-cat-row label { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.icon-picker-cat-row select { padding: 5px 8px; font-size: 0.85rem; }
.picker-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 14px 0;
  text-align: center;
}
.picker-icon { width: 22px; height: 22px; color: var(--text-secondary); }

.icon-picker-panel, .widget-editor-panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s ease;
}

.icon-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.icon-picker-header h3 { font-size: 1.05rem; color: var(--text-primary); }

.icon-picker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.icon-picker-category { grid-column: 1 / -1; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-top: 8px; padding: 4px 0; border-bottom: 1px solid var(--border-color); }

.icon-picker-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.icon-picker-item:hover { border-color: var(--gold); transform: scale(1.1); }

/* Icon picker background color row */
.icon-picker-bg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.icon-picker-bg-row input[type="color"] {
  width: 40px; height: 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.icon-picker-bg-row .btn-sm.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #fff;
  border: none;
}

/* ========== Settings: icon library & hotlist platform editor ========== */
.settings-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 6px 0 12px;
  line-height: 1.5;
}

.icon-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
}

.icon-lib-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  position: relative;
  font-size: 1.7rem;
  padding: 8px;
  transition: all var(--transition);
}

.icon-lib-item:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }

.icon-lib-actions {
  position: absolute;
  top: -8px; right: -8px;
  display: none;
  gap: 2px;
}

.icon-lib-item:hover .icon-lib-actions { display: flex; }

.icon-lib-actions button {
  width: 18px; height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.icon-lib-actions button:hover { color: var(--gold-dark); background: var(--gold-light); }

.hotlist-platform-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.hotlist-platform-row .hp-icon { font-size: 1.1rem; }
.hotlist-platform-row .hp-name { font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.hotlist-platform-row .hp-meta {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hotlist-platform-row .btn-sm.danger { width: 26px; height: 26px; padding: 0; flex-shrink: 0; }

.widget-type-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.widget-type-option {
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  font-size: 0.85rem;
}

.widget-type-option:hover { border-color: var(--gold); }
.widget-type-option.selected { border-color: var(--gold); background: rgba(212, 165, 116, 0.1); }
.widget-type-option .wt-icon { font-size: 1.4rem; display: block; margin-bottom: 6px; }

/* ========== Stock Market 股市行情 ========== */
.stock-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.stock-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stock-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 14px 0;
}
.stock-section-header .stock-section-title { margin-bottom: 0; }

/* 大盘指数卡片 */
.stock-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.stock-index-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stock-index-name { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 6px; }
.stock-index-price { font-size: 1.35rem; font-weight: 700; font-family: var(--font-num); }
.stock-index-change { font-size: 0.78rem; margin-top: 4px; font-family: var(--font-num); }

/* 市场环境模块 */
.market-env-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.market-env-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  transition: all var(--transition);
}
.market-env-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}
.market-env-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.market-env-value {
  font-size: 1.3rem;
  font-weight: 400;
  font-family: var(--font-num);
  margin-bottom: 4px;
}
.market-env-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.market-env-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.market-env-bar {
  height: 6px;
  background: var(--bg-hover, rgba(0,0,0,0.06));
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.market-env-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* 复盘与策略模块 */
.recap-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recap-row {
  display: grid;
  gap: 12px;
}
.recap-row-top {
  grid-template-columns: 1fr 1fr;
}
.recap-col { display: flex; flex-direction: column; gap: 12px; }
.recap-field { display: flex; flex-direction: column; }
.recap-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.recap-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: normal !important;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-card);
  resize: none;
  outline: none;
  line-height: 1.55;
  overflow: hidden;
  transition: border-color var(--transition);
}
.recap-textarea:focus { border-color: var(--gold); }
.recap-textarea::placeholder { color: var(--text-muted); }

/* 研报中心 */
.research-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.research-tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-family);
}
.research-tab:hover { color: var(--text-primary); }
.research-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.research-list {
  max-height: 550px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  background: var(--bg-card);
}
.research-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.research-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition);
}
.research-item:last-child { border-bottom: none; }
.research-item:hover { background: var(--bg-hover, rgba(0,0,0,0.04)); }
.research-item-title {
  font-size: 0.95rem;
  font-weight: normal !important;
  font-family: inherit;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.55;
}
.research-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.research-rating {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}
.research-rating.buy { background: rgba(232,93,108,0.12); color: #e85d6c; }
.research-rating.hold { background: rgba(240,160,80,0.12); color: #f0a050; }
.research-rating.sell { background: rgba(109,186,122,0.12); color: #6dba7a; }

/* 龙虎榜模块 */
.lhb-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lhb-section {
  display: flex;
  flex-direction: column;
}
.lhb-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.lhb-list {
  max-height: 400px;
  overflow-y: auto;
}
.lhb-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.lhb-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.lhb-item:last-child { border-bottom: none; }
.lhb-item:hover { background: var(--bg-hover, rgba(0,0,0,0.04)); }
.lhb-item-info { flex: 1; min-width: 0; }
.lhb-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lhb-item-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-num);
}
.lhb-item-reason {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lhb-item-data {
  text-align: right;
  flex-shrink: 0;
}
.lhb-item-net {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-num);
}
.lhb-item-net.in { color: #e85d6c; }
.lhb-item-net.out { color: #6dba7a; }
.lhb-item-pct {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.lhb-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(232,93,108,0.12);
  color: #e85d6c;
}

/* 技术指标分析 */
.tech-indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.tech-indicator-group {
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.tech-indicator-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.tech-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 5px 0;
  gap: 8px;
}
.tech-kv span { color: var(--text-secondary); flex-shrink: 0; }
.tech-kv b { color: var(--text-primary); font-family: var(--font-num); font-weight: 600; text-align: right; }

.tech-signals-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}
.tech-signals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-signals-header span:first-child {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.tech-score {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-num);
}
.tech-signals-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px;
}
.tech-signals-col {
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.tech-signals-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.tech-signals-col.buy .tech-signals-title { color: #e85d6c; }
.tech-signals-col.sell .tech-signals-title { color: #6dba7a; }
.tech-signal-item {
  font-size: 0.8rem;
  padding: 5px 0;
  line-height: 1.5;
  border-bottom: 1px dashed var(--border-color);
}
.tech-signal-item:last-child { border-bottom: none; }
.tech-signal-item.buy { color: #e85d6c; }
.tech-signal-item.sell { color: #6dba7a; }
.tech-signal-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0;
}
/* 中性信号（补充展示，位于买入/卖出两列下方，不破坏左右两列布局） */
.tech-signals-neutral {
  margin-top: 10px;
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.tech-signals-title.neutral { color: var(--text-secondary); }
.tech-signal-item.neutral { color: var(--text-secondary); }

/* 技术指标左右布局 */
.tech-analysis-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  align-items: start;
}
.tech-analysis-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tech-analysis-right {
  display: flex;
  flex-direction: column;
}
.tech-analysis-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
@media (max-width: 900px) {
  .tech-analysis-layout {
    grid-template-columns: 1fr;
  }
}

/* 行情设置弹窗 */
.stock-settings-panel {
  width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}
.stock-settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.stock-settings-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-family);
}
.stock-settings-tab:hover { color: var(--text-primary); }
.stock-settings-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.stock-settings-content { margin-bottom: 16px; }
.stock-settings-pane { display: block; }

/* 卡片顺序及隐藏列表 */
.settings-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: grab;
  transition: all var(--transition);
}
.settings-card-item:hover { border-color: var(--gold); }
.settings-card-item.dragging { opacity: 0.5; }
.settings-card-item.drag-over { border-color: var(--gold); border-style: dashed; }
.settings-card-handle {
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  font-size: 1rem;
}
.settings-card-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.settings-card-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border-color);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.settings-card-toggle.active { background: var(--gold); }
.settings-card-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.settings-card-toggle.active::after { transform: translateX(18px); }

/* 接口修正列表 */
.settings-api-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-api-item {
  padding: 10px 12px;
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.settings-api-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.settings-api-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.settings-api-actions {
  display: flex;
  gap: 6px;
}

/* 数据源状态列表 */
.settings-datasource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.datasource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.datasource-name {
  font-size: 0.85rem;
  color: var(--text-primary);
}
.datasource-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.datasource-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.datasource-dot.direct { background: #6dba7a; }
.datasource-dot.proxy { background: #f0a050; }
.datasource-dot.local { background: #4a90d9; }
.datasource-dot.fail { background: #e85d6c; }
.datasource-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* 外部数据快捷入口 */
.stock-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stock-quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}
.stock-quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stock-ql-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; }
.stock-ql-icon svg { width: 22px; height: 22px; display: block; }
.stock-ql-icon img { width: 22px; height: 22px; border-radius: 4px; display: block; }
.stock-ql-icon span { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.stock-ql-name { font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; }

/* 持仓股列表 */
.stock-portfolio-list { display: flex; flex-direction: column; gap: 8px; }
.stock-portfolio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.stock-port-info { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.stock-port-code { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-num); }
.stock-port-name { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }
.stock-port-data { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; }
.stock-port-price { font-size: 1rem; font-weight: 600; font-family: var(--font-num); }
.stock-port-chg { font-size: 0.82rem; font-family: var(--font-num); }
.stock-port-vol { font-size: 0.72rem; color: var(--text-muted); }

.stock-add-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.stock-add-form .form-input { flex: 1; }

/* 昨日回顾 & 盘前策略（宽度自适应内容：窄屏/单列时自动堆叠，文本域高度随内容增长） */
.stock-strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stock-strategy-card { margin-bottom: 0; }
.stock-notes-area {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.88rem;
  line-height: 1.7;
  resize: vertical;
  overflow-y: hidden;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.stock-notes-area:focus { border-color: var(--gold); }

/* 新闻列表 */
.stock-news-list { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow-y: auto; }
.stock-news-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.stock-news-item:hover { background: var(--bg-card-hover); }
.stock-news-num {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.stock-news-title { font-size: 0.95rem; font-weight: normal !important; font-family: inherit; color: var(--text-secondary); line-height: 1.55; flex: 1; }
.stock-news-item[onclick] .stock-news-title:hover { color: var(--gold-dark); text-decoration: underline; }
.stock-news-time { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; margin-left: auto; flex-shrink: 0; margin-top: 3px; }
.stock-index-amt { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

/* 市场通知 */
.stock-notifications { display: flex; flex-direction: column; gap: 8px; }
.stock-notification {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid;
}
.stock-notification.notif-high { background: rgba(232, 93, 108, 0.08); border-left-color: #e85d6c; }
.stock-notification.notif-medium { background: rgba(240, 160, 80, 0.08); border-left-color: #f0a050; }
.stock-notification.notif-info { background: rgba(109, 186, 122, 0.08); border-left-color: #6dba7a; }
.notif-icon { font-size: 1rem; flex-shrink: 0; display: inline-flex; align-items: center; }
.notif-content { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.notif-type { font-size: 0.72rem; color: var(--text-muted); }
.notif-title { font-size: 0.85rem; color: var(--text-primary); }
.notif-time { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-num); }

.stock-loading { color: var(--text-muted); font-size: 0.85rem; padding: 16px 0; text-align: center; }
.stock-empty { color: var(--text-muted); font-size: 0.85rem; padding: 20px 0; text-align: center; }

/* ===== 卡片自定义移动（拖拽手柄 + 落点高亮） ===== */
.stock-move-handle {
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 2px 8px;
  cursor: grab;
  flex-shrink: 0;
}
.stock-move-handle:hover { color: var(--gold); border-color: var(--gold); }
.stock-movable.dragging { opacity: 0.45; }
.stock-movable.drag-over { outline: 2px dashed var(--gold); outline-offset: 3px; }

/* ===== 窗格设置弹窗行 ===== */
.stock-layout-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--bg-card);
}
.stock-layout-name { font-size: 0.88rem; color: var(--text-primary); }
.stock-layout-row .btn-icon-sm:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===== 异动监控标签 ===== */
.stock-port-info { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.stock-port-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.stock-alert-tag {
  font-size: 0.66rem;
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 500;
}
.stock-alert-tag.tag-up { background: rgba(232, 93, 108, 0.12); color: #e85d6c; }
.stock-alert-tag.tag-down { background: rgba(109, 186, 122, 0.14); color: #4a9b5e; }
.stock-alert-tag.tag-warn { background: rgba(240, 160, 80, 0.14); color: #d98b2b; }
.stock-alert-tag.tag-hot { background: rgba(212, 165, 116, 0.18); color: #b98a4e; }

/* 标签/详情内联 SVG 小图标（替代 emoji，无字体依赖） */
.tag-ic { width: 12px; height: 12px; vertical-align: -1px; flex-shrink: 0; }
.stock-alert-tag .tag-ic { width: 11px; height: 11px; vertical-align: -1px; margin-right: 2px; }
.stock-detail-block-title .tag-ic { width: 15px; height: 15px; }
.risk-line .tag-ic { width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.notif-ic { width: 12px; height: 12px; flex-shrink: 0; }
.stock-title-icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.tag-ic.spin { animation: tag-spin 1s linear infinite; }
@keyframes tag-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 融合新闻卡片的小节标题 */
.stock-news-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 12px 0 6px 0;
  padding-left: 8px;
  border-left: 3px solid var(--accent-color, #4a90d9);
}
.stock-news-sub:first-of-type { margin-top: 0; }

/* ===== 持仓动态监控详情 ===== */
.stock-port-row { display: flex; flex-direction: column; }
.stock-port-row .stock-portfolio-item { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.stock-port-row .stock-portfolio-item:only-child { border-radius: var(--radius-md); }
.stock-detail {
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--bg-card);
  padding: 12px 14px 16px;
}
.stock-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stock-detail-block {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-card);
  position: relative;
}
/* 宽卡片：跨2列（个股深度分析） */
.stock-detail-block-wide {
  grid-column: span 2;
}
/* 全宽卡片：跨4列（技术指标综合分析等） */
.stock-detail-block-full {
  grid-column: span 4;
}
/* 卡片拖拽手柄 */
.detail-move-handle {
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: grab;
  flex-shrink: 0;
  margin-left: auto;
}
.detail-move-handle:hover { color: var(--gold); border-color: var(--gold); }
.stock-detail-block.dragging { opacity: 0.45; }
.stock-detail-block.drag-over { outline: 2px dashed var(--gold); outline-offset: 3px; }
/* 持仓股列表拖拽手柄 */
.port-move-handle {
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: grab;
  flex-shrink: 0;
  margin-right: 4px;
}
.port-move-handle:hover { color: var(--gold); border-color: var(--gold); }
.port-move-handle:active { cursor: grabbing; }
.stock-port-row.dragging { opacity: 0.45; }
.stock-port-row.drag-over { outline: 2px dashed var(--gold); outline-offset: 3px; border-radius: var(--radius-md); }
.stock-detail-block-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stock-detail-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.88rem;
}
.stock-detail-kv span { color: var(--text-muted); flex-shrink: 0; }
.stock-detail-kv b { color: var(--text-primary); font-weight: 500; font-family: var(--font-num); text-align: right; }
.stock-detail-loading { color: var(--text-muted); font-size: 0.88rem; padding: 8px 0; }

/* 主力资金柱状行 */
.fflow-bar-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }

/* 主力资金与智能风控合并卡片的分区线 */
.ffrisk-divider {
  height: 1px;
  margin: 10px 0 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.65), rgba(200, 120, 160, 0.25), rgba(255, 255, 255, 0.65));
  border-radius: 1px;
}
[data-theme="dark"] .ffrisk-divider {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(180, 120, 160, 0.3), rgba(255, 255, 255, 0.12));
}
.fflow-date { font-size: 0.76rem; color: var(--text-muted); width: 42px; flex-shrink: 0; font-family: var(--font-num); }
.fflow-bar-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(128, 128, 128, 0.12); overflow: hidden; }
.fflow-bar { height: 100%; border-radius: 4px; }
.fflow-bar.in { background: #e85d6c; }
.fflow-bar.out { background: #6dba7a; margin-left: auto; }
.fflow-val { font-size: 0.78rem; width: 68px; text-align: right; flex-shrink: 0; font-family: var(--font-num); }

/* 智能风控 */
.risk-badge { font-size: 0.72rem; color: #fff; border-radius: 10px; padding: 2px 9px; font-weight: 500; }
.risk-line { font-size: 0.88rem; color: var(--text-secondary); padding: 4px 0; line-height: 1.55; }
.risk-line.lv-high { color: #c74a57; }

/* 公司公告（可点击行跳转东方财富公告详情页） */
.ann-line { display: flex; gap: 8px; padding: 5px 0; font-size: 0.86rem; align-items: baseline; }
.ann-date { color: var(--gold); font-family: var(--font-num); flex-shrink: 0; }
.ann-title { color: var(--text-secondary); line-height: 1.55; }
.ann-line.ann-clickable { cursor: pointer; border-radius: var(--radius-sm); }
.ann-line.ann-clickable:hover .ann-title { color: var(--gold-dark); text-decoration: underline; }

/* 个股深度分析 */
.stock-analysis-block { border-left: 3px solid var(--gold); }
.analysis-section { margin-bottom: 12px; }
.analysis-section:last-of-type { margin-bottom: 0; }
.analysis-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 6px;
  padding-left: 2px;
}
.analysis-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.86rem;
  line-height: 1.55;
}
.analysis-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.analysis-tag {
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.analysis-text { color: var(--text-secondary); flex: 1; }

/* 持股意见 */
.analysis-advice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid;
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.advice-icon { font-size: 1.4rem; flex-shrink: 0; font-weight: 700; }
.advice-content { display: flex; flex-direction: column; gap: 2px; }
.advice-label { font-size: 0.75rem; color: var(--text-muted); }
.advice-text { font-size: 0.95rem; font-weight: 600; }
.advice-detail { font-size: 0.76rem; color: var(--text-muted); font-family: var(--font-num); }

/* 主营结构及企业盈利逻辑 */
.biz-line { padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.biz-line:last-of-type { border-bottom: none; }
.biz-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.biz-name { font-size: 0.86rem; font-weight: 500; color: var(--text-primary); }
.biz-pct { font-size: 0.86rem; font-weight: 600; font-family: var(--font-num); }
.biz-bar-track { height: 6px; border-radius: 3px; background: rgba(128, 128, 128, 0.12); overflow: hidden; margin-bottom: 4px; }
.biz-bar { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.biz-detail { display: flex; gap: 12px; font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-num); }
.biz-detail span { white-space: nowrap; }
.biz-logic { margin-top: 10px; padding: 8px 10px; background: var(--bg-card); border-radius: var(--radius-sm); border-left: 3px solid var(--gold); }
.biz-logic-title { font-size: 0.8rem; font-weight: 600; color: var(--gold); margin-bottom: 4px; }
.biz-logic-text { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.55; }

/* 响应式补充 */
@media (max-width: 600px) {
  .stock-detail-grid { grid-template-columns: 1fr; }
  .stock-detail-block-wide { grid-column: span 1; }
  .stock-detail-block-full { grid-column: span 1; }
  .stock-port-tags { display: none; }
}

/* 响应式 */
@media (max-width: 768px) {
  .stock-strategy-grid { grid-template-columns: 1fr; }
  .stock-index-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  /* 持仓股手机端：垂直排列，避免横向挤压重叠 */
  .stock-portfolio-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    position: relative;
  }
  .stock-port-info { min-width: 0; width: 100%; padding-right: 28px; }
  .stock-port-data {
    width: 100%;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: wrap;
  }
  .stock-port-price { font-size: 1.1rem; }
  .stock-port-chg { font-size: 0.9rem; }
  .stock-port-vol { display: none; }
  .stock-portfolio-item .btn-icon-sm {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  .stock-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-detail-block-wide { grid-column: span 2; }
  /* 全宽卡片在手机端占满2列，避免 span 4 溢出网格 */
  .stock-detail-block-full { grid-column: span 2; }
  /* 复盘与策略：市场综述|明日关注 改为上下独立显示，避免并排挤压重叠 */
  .recap-row-top { grid-template-columns: 1fr; }
}

/* ========== Empty States ========== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-text { font-size: 0.9rem; }

/* Emoji 图标统一使用系统 Emoji 字体（避免桌面端全局衬线字体栈导致 emoji 不显示） */
.auto-icon-emoji, .checkin-auto-emoji, .icon-lib-emoji, .picker-icon-emoji, .hotlist-platform-emoji,
.nav-icon-emoji, .site-icon-emoji, .bottom-nav-item .nav-icon-emoji, .more-sheet-item .nav-icon-emoji,
.empty-state .empty-icon {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* ========== Bottom Nav（移动端：左侧半透明磨砂玻璃垂直圆形导航，自动隐藏） ========== */
.bottom-nav { display: none; }

.bottom-nav {
  position: fixed !important;
  left: 14px !important;
  right: auto !important;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  top: auto !important;
  width: auto;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 11px;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  -moz-backdrop-filter: blur(28px) saturate(1.7);
  border-radius: 80px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 32px rgba(160, 100, 140, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  z-index: 9999 !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  /* 确保不随页面滚动 */
  transform: translateZ(0);
  will-change: transform;
}
.bottom-nav::-webkit-scrollbar { display: none; }

/* 自动隐藏状态：整体滑出屏幕左侧 */
@media (max-width: 1024px) {
  .bottom-nav.nav-collapsed {
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
  }
}

@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .bottom-nav { background: rgba(245, 240, 232, 0.96); }
  [data-theme="dark"] .bottom-nav { background: rgba(30, 25, 40, 0.96); }
}

[data-theme="dark"] .bottom-nav {
  background: rgba(30, 25, 40, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 圆形柔粉色图标按钮 */
.bottom-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(245, 213, 221, 0.72);
  color: #9e5e78;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(160, 100, 130, 0.1);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.bottom-nav-item:active { transform: scale(0.9); }
.bottom-nav-item.active {
  background: rgba(200, 120, 160, 0.88);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(160, 80, 120, 0.25);
}
.bottom-nav-item .nav-icon { width: 24px; height: 24px; }
.bottom-nav-item .nav-icon-img { width: 26px; height: 26px; }
.bottom-nav-item .nav-icon-emoji { width: 26px; height: 26px; font-size: 1.25rem; }

[data-theme="dark"] .bottom-nav-item {
  background: rgba(60, 50, 75, 0.6);
  color: #d5c8e0;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .bottom-nav-item.active {
  background: rgba(180, 120, 160, 0.85);
  color: #fff;
}
.bottom-nav-more { flex-shrink: 0; }

/* ===== 导航栏手动隐藏按钮（导航柱底部小圆钮，点击立即隐藏导航栏） ===== */
.bottom-nav-hide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: 4px;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
  color: #9e5e78;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(160, 100, 130, 0.10);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.bottom-nav-hide svg { width: 15px; height: 15px; }
.bottom-nav-hide:active { transform: scale(0.88); }
.bottom-nav-hide:hover { background: rgba(255, 255, 255, 0.65); color: #7d4a60; }
[data-theme="dark"] .bottom-nav-hide {
  background: rgba(60, 50, 75, 0.6);
  color: #d5c8e0;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .bottom-nav-hide:hover { background: rgba(60, 50, 75, 0.85); }
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .bottom-nav-hide { background: rgba(245, 240, 232, 0.96); }
  [data-theme="dark"] .bottom-nav-hide { background: rgba(30, 25, 40, 0.96); }
}

/* ===== 左下半屏导航唤起柄（导航自动隐藏后显示，点击恢复） ===== */
.nav-peek-handle {
  display: none;
  position: fixed;
  left: 0;
  bottom: calc(24vh + env(safe-area-inset-bottom, 0px));
  width: 26px;
  height: 108px;
  border-radius: 0 54px 54px 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-left: none;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 2px 4px 20px rgba(160, 100, 140, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #9e5e78;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, visibility 0.3s, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-peek-handle svg { width: 15px; height: 15px; }
.nav-peek-handle.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.nav-peek-handle:active { background: rgba(255, 255, 255, 0.6); }

[data-theme="dark"] .nav-peek-handle {
  background: rgba(30, 25, 40, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d5c8e0;
  box-shadow: 2px 4px 20px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .nav-peek-handle:active { background: rgba(60, 50, 75, 0.7); }

@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .nav-peek-handle { background: rgba(245, 240, 232, 0.96); }
  [data-theme="dark"] .nav-peek-handle { background: rgba(30, 25, 40, 0.96); }
}

/* ===== 移动端「更多」弹层 ===== */
.bottom-more-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  /* 必须高于 .bottom-nav 的 100，否则底栏会盖住弹层底部 */
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  /* 防止弹层打开时背景页面跟随滚动手势滚动 */
  overscroll-behavior: contain;
}
.bottom-more-overlay.active {
  opacity: 1;
  visibility: visible;
}
.bottom-more-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border-color);
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.bottom-more-overlay.active .bottom-more-sheet { transform: translateY(0); }
.bottom-more-sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  margin: 0 auto 14px;
}
.more-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.more-sheet-item:active { background: rgba(212, 165, 116, 0.15); }
.more-sheet-item .nav-icon { width: 22px; height: 22px; color: var(--gold-dark); flex-shrink: 0; }
.more-sheet-item .nav-icon-img { width: 22px; height: 22px; background: rgba(255, 255, 255, 0.85); }
.more-sheet-item .nav-icon-emoji { font-size: 1.15rem; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.more-sheet-item.active { color: var(--gold-dark); font-weight: 600; background: rgba(212, 165, 116, 0.12); }
.more-sheet-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 14px 0; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .floating-sidebar { display: none; }
  /* 移动端：左侧圆形导航栏悬浮在页面上方，不挤占内容空间 */
  .main-content { margin-left: 0; padding: 20px 16px 96px; }
  .bottom-nav { display: flex; }
  .nav-peek-handle { display: flex; }
  .travel-grid { grid-template-columns: repeat(2, 1fr); }
  .hotlist-grid { grid-template-columns: 1fr; gap: 14px; }
  .clock-time { font-size: 3rem; }
  /* 手机端概览卡片保持两列布局，与桌面端一致 */
  .widgets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .widget-card { min-height: 170px; padding: 14px 14px; gap: 3px; }
  /* 触摸设备无 hover，操作按钮始终显示（已在全局 media hover:none 处理） */
  .weight-side-by-side { flex-direction: column; }
  /* 无顶部标题栏，视图内标题保持显示 */
  .page-header { margin-bottom: 16px; justify-content: center; gap: 8px; flex-wrap: wrap; }
  .page-header .btn-primary, .page-header .btn-sm { white-space: nowrap; }
}

@media (max-width: 640px) {
  .main-content { padding: 14px 12px 96px; }
  .travel-grid { grid-template-columns: 1fr; }
  /* 概览卡片手机端保持两列布局，优化内边距和字号避免挤压 */
  .widgets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .widget-card { padding: 12px 12px; min-height: 160px; gap: 2px; }
  .widget-icon { width: 22px; height: 22px; margin-bottom: 4px; }
  .widget-title { font-size: 0.68rem; margin-bottom: 0; }
  .widget-value { font-size: 1.15rem; letter-spacing: 0; }
  .widget-value.weather-value { font-size: 1rem; letter-spacing: 0; flex-wrap: wrap; }
  .widget-value.weather-value .widget-value-desc { font-size: 0.65rem; margin-left: 3px; }
  .weather-detail { font-size: 0.65rem; padding: 1px 0; gap: 2px; }
  .widget-detail { font-size: 0.65rem; padding: 1px 0; gap: 2px; }
  .widget-progress { margin: 3px 0; height: 4px; }
  .widget-progress-fill { height: 4px; }
  /* 今日打卡卡片手机端自适应 */
  .checkin-wall { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .checkin-card { padding: 10px 8px 8px; min-height: 85px; gap: 5px; }
  .checkin-card .checkin-icon { width: 24px; height: 24px; }
  .checkin-card .checkin-icon img,
  .checkin-card .checkin-icon svg { width: 24px; height: 24px; max-width: 24px; max-height: 24px; }
  .checkin-card .checkin-name { font-size: 0.7rem; }
  /* 网站导航卡片手机端自适应 */
  .nav-sites-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .nav-site-card { padding: 10px 6px 8px; min-height: 80px; gap: 5px; }
  .nav-site-card .site-icon { width: 20px; height: 20px; font-size: 0.85rem; }
  .nav-site-card .site-icon img,
  .nav-site-card .site-icon .auto-icon-img { width: 20px; height: 20px; }
  .nav-site-card .site-name { font-size: 0.65rem; }
  .nav-category-title { font-size: 0.85rem; margin-bottom: 8px; }
  .theme-presets { grid-template-columns: repeat(2, 1fr); }
  .clock-time { font-size: 2.2rem; letter-spacing: 1px; }
  .settings-layout { grid-template-columns: 1fr; }
  .icon-picker-grid { grid-template-columns: repeat(5, 1fr); }
  .expense-stats { grid-template-columns: 1fr; }
  .checklist-add-form, .todo-add-form { flex-direction: column; }
  .checklist-add-form .form-input, .todo-add-form .form-input { width: 100%; }
  .ecm-add { width: 100%; }
  .ecm-add .form-input { flex: 1; width: auto; }
  .page-title { font-size: 1.15rem; }
  .form-row { flex-direction: column; }
  .weight-form-row { flex-direction: column; }
  .weight-stats-grid .stat-item { width: calc((100% - 24px) / 3); min-width: 0; }
  #chinaMap { height: 300px; }
  /* 今日热榜移动端优化：确保内容完整显示，不被截断 */
  .hotlist-grid { gap: 12px; }
  .hotlist-card { padding: 14px 12px; overflow: visible; }
  .hotlist-card-header { gap: 6px; margin-bottom: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .hotlist-platform-name { font-size: 0.9rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hotlist-source-badge { font-size: 0.58rem; padding: 2px 6px; }
  .hotlist-items { overflow: visible; }
  .hotlist-item { padding: 9px 6px; gap: 8px; margin: 0 -6px; min-height: 40px; }
  .hotlist-rank { width: 22px; height: 22px; font-size: 0.68rem; flex-shrink: 0; }
  .hotlist-title { font-size: 0.85rem; line-height: 1.3; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hotlist-hot { font-size: 0.62rem; flex-shrink: 0; white-space: nowrap; }
  .hotlist-update-time { font-size: 0.72rem; margin-bottom: 10px; }
  /* 移动端左侧导航栏：固定位置，不随滚动漂移 */
  .bottom-nav { left: 8px; gap: 10px; padding: 12px 8px; max-height: calc(100vh - 80px); }
  .bottom-nav-item { width: 48px; height: 48px; }
  .bottom-nav-item .nav-icon { width: 22px; height: 22px; }
  .bottom-nav-hide { width: 30px; height: 30px; }
  .nav-peek-handle { width: 22px; height: 90px; bottom: calc(22vh + env(safe-area-inset-bottom, 0px)); }
}

/* ========== 导航栏管理（设置页） ========== */
.nav-mgr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 8px;
}
.nav-mgr-row.is-hidden { opacity: 0.5; }
.nav-mgr-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.nav-mgr-label { font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mgr-type { font-size: 0.7rem; color: var(--gold-dark); background: rgba(212, 165, 116, 0.12); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.nav-mgr-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ========== 自定义卡片页 ========== */
.custom-page-wrap { width: 100%; }
.custom-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.custom-card {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  min-height: 110px;
  overflow: hidden;
}
.custom-card-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.custom-card-content { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin: 0; word-break: break-word; }
.custom-card-link { display: inline-block; margin-top: 10px; font-size: 0.8rem; color: var(--gold-dark); text-decoration: none; border: 1px solid var(--border-color); padding: 4px 10px; border-radius: 12px; }
.custom-card-link:hover { background: rgba(212, 165, 116, 0.14); }
/* 链接覆盖层：整卡可点击，浏览器原生支持中键后台打开 */
.custom-card.has-link { cursor: pointer; }
.custom-card-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  text-decoration: none;
}
.custom-card-link-overlay:hover ~ .custom-card-title,
.custom-card.has-link:hover .custom-card-title {
  color: var(--gold-dark);
}
/* HTML 内容容器 */
.custom-card-html {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-word;
  overflow: hidden;
}
.custom-card-html img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.custom-card-html a {
  color: var(--gold-dark);
  text-decoration: none;
  word-break: break-all;
}
.custom-card-html a:hover {
  text-decoration: underline;
}
.custom-card-html table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}
.custom-card-html th, .custom-card-html td {
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  text-align: left;
}
.custom-card-html pre {
  background: rgba(0, 0, 0, 0.04);
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.75rem;
}
.custom-card-html code {
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.75rem;
}
.custom-card-html blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-muted);
}
.custom-card-html ul, .custom-card-html ol {
  padding-left: 20px;
  margin: 6px 0;
}
.custom-card-html h1, .custom-card-html h2, .custom-card-html h3,
.custom-card-html h4, .custom-card-html h5, .custom-card-html h6 {
  margin: 10px 0 6px 0;
  color: var(--text-primary);
}
.custom-card-html hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 10px 0;
}
/* HTML 类型卡片：确保内容区域可滚动、链接可点击 */
.custom-card.is-html-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.custom-card.is-html-card .custom-card-title {
  flex-shrink: 0;
}
.custom-card.is-html-card .custom-card-html {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px;
  min-height: 100px;
  position: relative;
  z-index: 2;
  -webkit-overflow-scrolling: touch;
}
/* 完整 HTML 文档卡片：使用 iframe 渲染 */
.custom-card.is-full-html {
  padding: 0;
  overflow: hidden;
}
.custom-card.is-full-html .custom-card-title {
  padding: 12px 16px 8px;
  margin: 0;
}
.custom-card-iframe {
  width: 100%;
  min-height: 300px;
  border: none;
  display: block;
  background: transparent;
  position: relative;
  z-index: 2;
}
/* 可点击卡片（链接卡片和 HTML 卡片）：样式保持一致 */
.custom-card.has-link,
.custom-card.is-html-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-main);
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  display: block;
}
.custom-card.has-link .custom-card-title,
.custom-card.is-html-clickable .custom-card-title {
  font-family: var(--font-main);
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}
.custom-card.has-link .custom-card-content,
.custom-card.is-html-clickable .custom-card-content,
.custom-card.has-link .card-content,
.custom-card.is-html-clickable .card-content {
  font-family: var(--font-main);
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}
.custom-card.has-link:hover,
.custom-card.is-html-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
/* 可点击卡片的操作按钮 */
.custom-card.has-link .stat-card-tools,
.custom-card.is-html-clickable .stat-card-tools {
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.custom-card.has-link:hover .stat-card-tools,
.custom-card.is-html-clickable:hover .stat-card-tools {
  opacity: 1;
}
.custom-card.is-full-html .stat-card-tools {
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 2px;
}

/* ===== 扩展页分栏分类样式 ===== */








.category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}











/* 分栏中的卡片加大宽度和内边距 */










.category-add-icon {
  font-size: 1.2rem;
}
.category-add-text {
  font-size: 0.9rem;
}

/* 移动端适配 */
@media (max-width: 1200px) {
  
}
@media (max-width: 768px) {
  
  
  
  
}

/* 分类颜色选择器 */
.ecm-color-picker {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
}
.ecm-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}
.ecm-color-picker::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 50%;
}
.ecm-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
  min-height: 24px;
}
.ecm-chip i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
  font-size: 0.75rem !important;
}

/* 待办清单标签颜色管理 */
.checklist-tag-color-manage {
  margin-bottom: 10px;
  padding: 8px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.tag-color-manage-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.tag-color-manage-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.tag-color-picker {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
  flex-shrink: 0;
}
.tag-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}
.tag-color-picker::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 50%;
}
.tag-color-manage-name {
  font-size: 0.8rem;
  color: var(--text-primary);
}

/* 当前选中标签的颜色选择器 */
.checklist-tag-color-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  min-height: 28px;
  height: 28px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  margin: 0;
  box-sizing: border-box;
}
.tag-color-current-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1;
}
.checklist-tag-color-current .tag-color-picker {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}
/* HTML 内容中的链接确保可点击 */
.custom-card-html a {
  cursor: pointer;
  position: relative;
  z-index: 3;
}
.custom-card-html a:hover {
  text-decoration: underline;
}
/* HTML 内容中的按钮确保可点击 */
.custom-card-html button,
.custom-card-html input,
.custom-card-html select,
.custom-card-html textarea {
  position: relative;
  z-index: 3;
  cursor: pointer;
}
/* HTML 内容中的图片自适应 */
.custom-card-html img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto;
}
/* HTML 内容中的视频自适应 */
.custom-card-html video,
.custom-card-html iframe {
  max-width: 100%;
  height: auto;
}
/* 滚动条样式 */
.custom-card-html::-webkit-scrollbar {
  width: 6px;
}
.custom-card-html::-webkit-scrollbar-track {
  background: transparent;
}
.custom-card-html::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.3);
  border-radius: 3px;
}
.custom-card-html::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 165, 116, 0.5);
}
/* 黑屏模式 HTML 内容优化：确保深色背景下文字可读 */
.custom-card-html {
  background: transparent;
}
.custom-card-html [style*="background: black"],
.custom-card-html [style*="background:#000"],
.custom-card-html [style*="background-color: black"],
.custom-card-html [style*="background-color:#000"] {
  color: #fff !important;
  padding: 12px;
  border-radius: 8px;
}
.custom-card .stat-card-tools { position: absolute; top: 6px; right: 6px; display: none; gap: 3px; }
.custom-card:hover .stat-card-tools { display: flex; }
/* 卡片拖拽排序手柄与状态 */
.card-move-handle { cursor: grab; touch-action: none; }
.card-move-handle:active { cursor: grabbing; }
.custom-card.dragging { opacity: 0.45; transform: scale(0.98); }
.custom-card.drag-over { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.45); }
.custom-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--gold);
  background: transparent;
  cursor: pointer;
  min-height: 110px;
  transition: background 0.2s;
}
.custom-card-add:hover { background: rgba(212, 165, 116, 0.14); }
.custom-card-add-text { font-size: 0.8rem; color: var(--gold-dark); }

/* 分类标签栏 */








/* 卡片上的分类标签 */

.custom-card.has-link 

/* 移动端分类标签栏 */
@media (max-width: 768px) {
  
  
}

/* ===== Sync Status (overview clock section, subtle) ===== */
.clock-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 12px;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s;
  user-select: none;
  opacity: 0.85;
}
.clock-sync-status:hover { background: rgba(212, 165, 116, 0.12); opacity: 1; }
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sync-dot.online {
  background: #4caf50;
}
.sync-dot.offline {
  background: #9e9e9e;
}
.sync-dot.pending {
  background: #ff9800;
  animation: sync-pulse 1.5s ease-in-out infinite;
}
@keyframes sync-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(255, 152, 0, 0); }
}
.clock-sync-status.offline .sync-text { color: var(--text-muted); }
.clock-sync-status.pending .sync-text { color: #e65100; }
.clock-sync-status.online .sync-text { color: var(--text-muted); }

/* ===== Sync Settings Card ===== */
.sync-status-row {
  display: flex;
  gap: 16px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.sync-status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(212, 165, 116, 0.08);
  border-radius: 8px;
  flex: 1;
  min-width: 100px;
}
.sync-status-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.sync-status-value {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-primary);
}
.sync-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sync-actions button {
  flex: 1;
  min-width: 100px;
}
.settings-hint-inline {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ---- Cloud sync settings ---- */
.sync-cloud-info {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-sidebar, rgba(0,0,0,0.03));
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.06));
}
.sync-cloud-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.sync-cloud-row + .sync-cloud-row {
  border-top: 1px solid var(--border-color, rgba(0,0,0,0.05));
}
.sync-cloud-row .sync-status-label {
  min-width: 64px;
  flex-shrink: 0;
}
.sync-cloud-row .sync-status-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-item {
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--bg-card, #fff);
}
.snapshot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.snapshot-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #333);
}
.snapshot-meta {
  font-size: 0.7rem;
  color: var(--text-muted, #999);
  flex: 1;
  min-width: 60px;
}

.settings-version {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #999);
  background: var(--bg-card, rgba(255,255,255,0.6));
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  border-radius: 20px;
  padding: 2px 12px;
  vertical-align: middle;
}

/* 通用弹窗：确保显示在所有内容之上 */
#wbModal {
  z-index: 2000 !important;
}

/* 恢复快照差异弹窗：卡片适当加宽，便于阅读差异内容 */
#wbModal .widget-editor-panel { max-width: 560px; }

.wb-modal-body {
  font-size: 0.85rem;
  color: var(--text-primary, #333);
}
.wb-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}
.wb-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #666);
  margin-bottom: 10px;
  line-height: 1.6;
}
.wb-diff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}
.wb-diff-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.wb-diff-item.wb-diff-changed {
  border-color: rgba(212,165,116,0.5);
  background: rgba(212,165,116,0.06);
}
.wb-diff-main { flex: 1; min-width: 0; }
.wb-diff-key {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary, #333);
  margin-bottom: 4px;
  word-break: break-all;
}
.wb-diff-pair {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.72rem;
  line-height: 1.5;
}
.wb-diff-tag {
  flex-shrink: 0;
  color: var(--text-muted, #999);
}
.wb-diff-val {
  color: var(--text-primary, #444);
  word-break: break-all;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  padding: 1px 5px;
  min-width: 0;
}
.wb-diff-snap {
  color: var(--accent, #d4a574);
  background: rgba(212,165,116,0.1);
}
.wb-diff-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.72rem;
  line-height: 1.5;
  margin-top: 2px;
}
.wb-diff-field {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-secondary, #666);
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  padding: 0 5px;
}
.wb-diff-cur {
  flex: 1;
  color: var(--text-primary, #444);
  word-break: break-all;
}
.wb-diff-arrow {
  flex-shrink: 0;
  color: #c48a3f;
}
.wb-diff-snapv {
  flex: 1;
  color: var(--accent, #d4a574);
  word-break: break-all;
}
.wb-progress {
  height: 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
  margin: 12px 0 6px;
}
.wb-progress i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8c48f, var(--accent, #d4a574));
  transition: width 0.3s ease;
}
.wb-progress-pct {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted, #999);
}

.btn-mini {
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--accent, #d4a574);
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-mini:hover { opacity: 0.85; }
.btn-mini.lg {
  font-size: 0.92rem;
  padding: 9px 22px;
  border-radius: 10px;
}
.cloud-server-input {
  font-size: 0.8rem !important;
  padding: 4px 8px !important;
  flex: 1 !important;
  min-width: 120px !important;
}

/* ========== 通用自动适配图标（Emoji / 文字 / 图片链接 / 网站 favicon） ========== */
/* renderIcon 输出：<span class="<cls>-emoji"> 或 <img class="<cls>-img"> */

/* 网站卡片 .site-icon 内的自动图标 */
.auto-icon-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: inherit;
}
.auto-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* 每日打卡卡片图标（checkin-auto-*） */
.checkin-auto-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: inherit;
}
.checkin-auto-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* 图标选择器（picker-icon-*） */
.picker-icon-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: inherit;
}
.picker-icon-img {
  display: block;
  width: 60%;
  height: 60%;
  object-fit: cover;
  border-radius: 6px;
}

/* 图标库网格（icon-lib-*） */
.icon-lib { width: 34px; height: 34px; color: var(--text-secondary); }
.icon-lib-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  line-height: 1;
  border-radius: inherit;
}
.icon-lib-img {
  display: block;
  width: 82%;
  height: 82%;
  object-fit: contain;
  border-radius: 10px;
}

/* 热榜平台图标（hotlist-platform-*） */
.hotlist-platform-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.hotlist-platform-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* 导航栏管理行内的图片图标 */
.nav-mgr-icon .auto-icon-img,
.nav-mgr-icon img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* ================================================================
   Apple 极简 · 全局毛玻璃拟态（Glassmorphism）
   大背景金粉白渐变透出底色，所有卡片为磨砂玻璃质感
   ================================================================ */

/* —— 大容器卡片：强磨砂（blur 28px + 饱和度提升，折射背景色彩） —— */
.search-bar,
.widget-card,
.checkin-card,
.nav-site-card,
.weight-chart-container,
.weight-stats-panel,
.weight-input-panel,
.weight-records-panel,
.panel,
.travel-map-section,
.travel-card,
.travel-editor-panel,
.todo-item,
.hotlist-card,
.settings-card,
.stock-section,
.stock-index-card,
.stock-quick-link,
.stock-portfolio-item,
.stock-notes-area,
.stock-layout-row,
.stock-detail,
.stock-detail-block,
.analysis-advice,
.biz-logic,
.bottom-more-sheet,
.custom-card,
  .icon-picker-panel,
  .widget-editor-panel,
  .nav-mgr-row,
  .devices-panel,
  .hotlist-ds-status,
  .toast {
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
}

/* —— 小控件：轻磨砂（按钮 / 输入框 / 列表行） —— */
.btn-sm,
.form-input,
.form-select,
.form-textarea,
.checkin-card .checkin-actions button,
.nav-site-card .site-actions button,
.icon-lib-actions button,
.stock-news-item {
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
}

/* —— 玻璃卡片边缘高光：细白描边增强"玻璃厚度" —— */
.search-bar,
.widget-card,
.checkin-card,
.nav-site-card,
.weight-chart-container,
.weight-stats-panel,
.weight-input-panel,
.weight-records-panel,
.panel,
.travel-map-section,
.travel-card,
.travel-editor-panel,
.todo-item,
.hotlist-card,
.settings-card,
.stock-section,
.stock-index-card,
.stock-quick-link,
.stock-portfolio-item,
.stock-notes-area,
.stock-layout-row,
.stock-detail,
.stock-detail-block,
  .analysis-advice,
  .bottom-more-sheet,
  .custom-card,
  .nav-mgr-row,
  .devices-panel {
  border: 1px solid rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .search-bar,
[data-theme="dark"] .widget-card,
[data-theme="dark"] .checkin-card,
[data-theme="dark"] .nav-site-card,
[data-theme="dark"] .weight-chart-container,
[data-theme="dark"] .weight-stats-panel,
[data-theme="dark"] .weight-input-panel,
[data-theme="dark"] .weight-records-panel,
[data-theme="dark"] .panel,
[data-theme="dark"] .travel-map-section,
[data-theme="dark"] .travel-card,
[data-theme="dark"] .travel-editor-panel,
[data-theme="dark"] .todo-item,
[data-theme="dark"] .hotlist-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .stock-section,
[data-theme="dark"] .stock-index-card,
[data-theme="dark"] .stock-quick-link,
[data-theme="dark"] .stock-portfolio-item,
[data-theme="dark"] .stock-notes-area,
[data-theme="dark"] .stock-layout-row,
[data-theme="dark"] .stock-detail,
[data-theme="dark"] .stock-detail-block,
[data-theme="dark"] .analysis-advice,
[data-theme="dark"] .bottom-more-sheet,
[data-theme="dark"] .custom-card,
[data-theme="dark"] .nav-mgr-row {
  border-color: rgba(255, 255, 255, 0.10);
}

/* —— Apple 极简排版：标题收紧字距，视觉更精致 —— */
h1, h2, h3, h4, .section-title, .icon-picker-header h3 { letter-spacing: -0.015em; }

/* —— 不支持 backdrop-filter 的浏览器：回退为高不透明度实底，保证可读性 —— */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  :root {
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: rgba(255, 255, 255, 1);
  }
  [data-theme="dark"] {
    --bg-card: rgba(40, 35, 30, 0.94);
    --bg-card-hover: rgba(50, 44, 38, 1);
  }
}

/* —— 股市行情内层小卡片：进一步增强通透感，避免在玻璃面板内显白 —— */
.stock-index-card,
.stock-quick-link,
.stock-portfolio-item,
.stock-notes-area,
.stock-layout-row,
.stock-detail-block {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(252, 244, 236, 0.34) 100%);
  backdrop-filter: blur(32px) saturate(1.8);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
}

[data-theme="dark"] .stock-index-card,
[data-theme="dark"] .stock-quick-link,
[data-theme="dark"] .stock-portfolio-item,
[data-theme="dark"] .stock-notes-area,
[data-theme="dark"] .stock-layout-row,
[data-theme="dark"] .stock-detail-block {
  background: linear-gradient(135deg, rgba(48, 42, 38, 0.45) 0%, rgba(38, 33, 30, 0.38) 100%);
}

/* ===== 在线设备弹窗（连续性同步 / 指定下线） ===== */
.devices-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-overlay);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.devices-overlay.active { display: flex; }

.devices-panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 22px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s ease;
}
.devices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.devices-header h3 { font-size: 1.05rem; color: var(--text-primary); }
.devices-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.devices-close:hover { color: var(--text-primary); }
.devices-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  word-break: break-all;
}
.devices-list { display: flex; flex-direction: column; gap: 10px; }
.devices-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 18px 0;
}
.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(212, 165, 116, 0.08);
  border: 1px solid var(--border-color);
}
.device-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.device-dot.online { background: #2e9e5b; box-shadow: 0 0 0 3px rgba(46, 158, 91, 0.18); }
.device-dot.self { background: var(--gold, #d4a574); box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.22); }
.device-info { flex: 1; min-width: 0; }
.device-name {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-self-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: var(--gold, #d4a574);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.device-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.device-id {
  font-size: 0.66rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 1px;
  font-family: var(--font-num);
}
.device-offline-btn {
  flex-shrink: 0;
  border: 1px solid #e0795f;
  color: #e0795f;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.device-offline-btn:hover { background: #e0795f; color: #fff; }
.device-dot.stale { background: #999; box-shadow: 0 0 0 3px rgba(153, 153, 153, 0.18); }
.device-row.device-stale { opacity: 0.6; }
.device-stale-tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: #999;
  background: rgba(153, 153, 153, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.device-clear-btn {
  flex-shrink: 0;
  border: 1px solid #999;
  color: #999;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.device-clear-btn:hover { background: #999; color: #fff; }
.devices-footer {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.devices-footer .btn-secondary { flex: 1; justify-content: center; }
/* 高级同步操作行：从云端拉取 / 本机覆盖云端 */
.devices-footer-adv { margin-top: 8px; }
.devices-footer-adv .btn-mini { flex: 1; justify-content: center; }
.devices-footer-adv .btn-mini.danger { color: #c0504a; border-color: rgba(192, 80, 74, 0.35); }
.devices-footer-adv .btn-mini.danger:hover { background: rgba(192, 80, 74, 0.12); }
.devices-tip {
  margin-top: 10px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ================================================================
   转场 / 界面微动画（让玻璃界面"活"起来，不死板）
   ================================================================ */

/* 卡片入场：淡入 + 轻微上浮，营造通透浮现感 */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 弹窗遮罩淡入 */
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 弹窗面板弹入（替代原 scaleIn，更柔的缓动） */
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 卡片统一入场动画 + 更顺滑的过渡曲线 */
.widget-card, .checkin-card, .nav-site-card, .todo-item, .hotlist-card,
.settings-card, .custom-card, .travel-card, .panel, .weight-chart-container,
.weight-stats-panel, .weight-input-panel, .weight-records-panel,
.stock-section, .stock-index-card, .stock-quick-link, .stock-portfolio-item,
.stock-notes-area, .analysis-advice, .biz-logic, .nav-mgr-row,
.icon-lib-item, .device-row {
  animation: cardIn 0.46s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1),
              box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

/* 悬浮微动：轻抬 + 微放大，玻璃通透感更灵动 */
.widget-card:hover, .nav-site-card:hover, .todo-item:hover, .hotlist-card:hover,
.custom-card:hover, .travel-card:hover, .panel:hover, .settings-card:hover,
.weight-stats-panel:hover, .weight-input-panel:hover, .weight-records-panel:hover,
.stock-index-card:hover, .stock-quick-link:hover, .stock-portfolio-item:hover,
.analysis-advice:hover, .biz-logic:hover, .device-row:hover {
  transform: translateY(-4px) scale(1.015);
}

/* 弹窗遮罩淡入 + 面板弹入（统一微动画） */
.icon-picker-overlay, .widget-editor-overlay, .travel-editor-overlay,
.bottom-more-overlay, .devices-overlay {
  animation: overlayIn 0.3s ease;
}
.icon-picker-panel, .widget-editor-panel, .travel-editor-panel,
.devices-panel, .bottom-more-sheet {
  animation: popIn 0.42s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

/* 侧边栏导航点击微缩反馈，强化"可交互"质感 */
.nav-item:active, .bottom-nav-item:active, .more-sheet-item:active {
  transform: scale(0.92);
  transition: transform 0.12s ease;
}

/* 尊重系统"减少动态效果"偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}

/* ========== 右下角花朵滚动指示器（替代原生右侧滚动条） ========== */
/* 隐藏原生页面滚动条，由右下角花朵提供滚动反馈 */
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

/* 内部可滚动容器恢复细滚动条，保证长列表可用性 */
.checklist-items, .expense-list, .todo-list, .stock-news-list,
.weight-records-list, .travel-records-list, .nav-site-list, .hotlist-items,
.icon-picker-panel, .widget-editor-panel, .bottom-more-sheet, .devices-panel,
.bottom-nav, .modal-content, .editor-body, .scroll-y {
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.checklist-items::-webkit-scrollbar, .expense-list::-webkit-scrollbar, .todo-list::-webkit-scrollbar,
.stock-news-list::-webkit-scrollbar, .weight-records-list::-webkit-scrollbar, .travel-records-list::-webkit-scrollbar,
.nav-site-list::-webkit-scrollbar, .hotlist-items::-webkit-scrollbar, .icon-picker-panel::-webkit-scrollbar,
.widget-editor-panel::-webkit-scrollbar, .bottom-more-sheet::-webkit-scrollbar, .devices-panel::-webkit-scrollbar,
.bottom-nav::-webkit-scrollbar, .modal-content::-webkit-scrollbar, .editor-body::-webkit-scrollbar, .scroll-y::-webkit-scrollbar {
  width: 6px; height: 6px;
}
.checklist-items::-webkit-scrollbar-thumb, .expense-list::-webkit-scrollbar-thumb, .todo-list::-webkit-scrollbar-thumb,
.stock-news-list::-webkit-scrollbar-thumb, .weight-records-list::-webkit-scrollbar-thumb, .travel-records-list::-webkit-scrollbar-thumb,
.nav-site-list::-webkit-scrollbar-thumb, .hotlist-items::-webkit-scrollbar-thumb, .icon-picker-panel::-webkit-scrollbar-thumb,
.widget-editor-panel::-webkit-scrollbar-thumb, .bottom-more-sheet::-webkit-scrollbar-thumb, .devices-panel::-webkit-scrollbar-thumb,
.bottom-nav::-webkit-scrollbar-thumb, .modal-content::-webkit-scrollbar-thumb, .editor-body::-webkit-scrollbar-thumb, .scroll-y::-webkit-scrollbar-thumb {
  background: var(--gold); border-radius: 3px;
}

/* 右下角滚动指示器：梭形地平线 + 玻璃态日月，仅桌面端显示 */
/* ========== 天体运动滚动指示器 ========== */
/* 太阳居中，地球绕太阳公转，月球绕地球公转 */
.celestial-scene {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 90px;
  height: 90px;
  z-index: 55;
  pointer-events: none;
}
/* 地球公转轨道：淡蓝虚线圆 */
.c-orbit-earth {
  position: absolute;
  left: 50%; top: 50%;
  width: 48px; height: 48px;
  margin-left: -24px; margin-top: -24px;
  border-radius: 50%;
  border: 1px dashed rgba(120, 190, 255, 0.12);
}
/* 太阳 ☀️：玻璃态发光圆 + 6 射线，居中 */
.c-sun {
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin-left: -8px; margin-top: -8px;
}
/* 太阳核心：玻璃态发光圆 */
.c-sun-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  margin-left: -4px; margin-top: -4px;
  background: radial-gradient(circle at 38% 38%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 240, 180, 0.8) 40%,
    rgba(255, 200, 80, 0.4) 75%,
    transparent 100%
  );
  border-radius: 50%;
  box-shadow:
    0 0 5px rgba(255, 230, 130, 0.75),
    0 0 12px rgba(255, 200, 60, 0.4),
    inset 0 0 3px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
/* 太阳 6 根射线 */
.c-ray {
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 1.2px;
  margin-left: -8px; margin-top: -0.6px;
  background: linear-gradient(90deg, rgba(255,215,0,0) 0%, rgba(255,215,0,0.55) 25%, rgba(255,230,100,0.7) 50%, rgba(255,215,0,0.55) 75%, rgba(255,215,0,0) 100%);
  transform-origin: center;
  transform: rotate(var(--r));
  box-shadow: 0 0 3px rgba(255, 215, 0, 0.3);
  border-radius: 1px;
}
/* 地球系统：锚点在场景中心，JS 设置 translate 驱动公转 */
.c-earth-system {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  /* JS 设置 transform: translate(ex, ey) */
}
/* 地球 🌍：玻璃态蓝绿球体 */
.c-earth {
  position: absolute;
  left: -5px; top: -5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(100, 180, 255, 0.6) 30%,
    rgba(60, 140, 200, 0.4) 60%,
    rgba(40, 120, 180, 0.2) 85%,
    transparent 100%
  );
  box-shadow:
    0 0 4px rgba(80, 160, 240, 0.5),
    0 0 10px rgba(60, 140, 220, 0.25),
    inset 0 0 3px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
/* 地球陆地（已去除突兀的绿色色块，保持纯净蓝白玻璃球；如需恢复可取消下面注释）
.c-earth::after {
  content: '';
  position: absolute;
  left: 2px; top: 3px;
  width: 4px; height: 3px;
  border-radius: 40% 60% 50% 40%;
  background: rgba(80, 180, 120, 0.35);
}
*/
.c-earth::after { content: none; }
/* 月球公转轨道：极淡虚线圆，跟随地球系统 */
.c-orbit-moon {
  position: absolute;
  left: -10px; top: -10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(200, 215, 255, 0.08);
}
/* 月亮 🌙：玻璃态发光弯刀月亮，JS 设置 translate 驱动公转 */
.c-moon {
  position: absolute;
  left: -5px; top: -5px;
  width: 10px; height: 10px;
  /* JS 设置 transform: translate(mx, my) */
}
/* 弯月月亮主体：mask 内切出清晰月牙，玻璃体发光 */
.c-moon-body {
  position: absolute;
  left: 1px; top: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 45%, rgba(235, 242, 255, 0.98) 0%, rgba(200, 220, 255, 0.8) 55%, rgba(160, 190, 255, 0.5) 100%);
  box-shadow:
    0 0 4px rgba(180, 205, 255, 0.45),
    0 0 9px rgba(150, 180, 255, 0.22);
  -webkit-mask: radial-gradient(circle at 76% 50%, transparent 40%, #000 42%);
  mask: radial-gradient(circle at 76% 50%, transparent 40%, #000 42%);
  transform: rotate(-18deg);
}
/* 弯月内弧高光 */
.c-moon-body::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 76% 50%, transparent 44%, rgba(255, 255, 255, 0.28) 52%, transparent 60%);
  -webkit-mask: inherit;
  mask: inherit;
}
/* 弯刀月亮刀尖发光：上下两端亮点 */
.c-moon-tip {
  position: absolute;
  left: 0; top: 0;
  width: 1.5px; height: 1.5px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow:
    0 8px 0 rgba(255, 255, 255, 0.6),
    0 0 3px rgba(200, 220, 255, 0.4),
    0 8px 3px rgba(200, 220, 255, 0.25);
  transform: rotate(-15deg);
}

/* 平板/手机等非桌面端隐藏滚动指示器 */
@media (max-width: 1023px) {
  .celestial-scene { display: none; }
}

/* ========== 持仓股搜索下拉 ========== */
.stock-add-form { position: relative; flex-wrap: wrap; }
.stock-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
}
.stock-search-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.stock-search-item:hover { background: rgba(212, 165, 116, 0.16); }
.ssi-name { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }
.ssi-code { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.stock-search-empty { padding: 10px; font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* 添加股票弹窗卡片（持仓股监控） */
.stock-add-panel { max-width: 480px; width: calc(100% - 32px); }
.stock-add-panel .stock-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 4px;
}
.stock-add-panel .stock-search-results {
  position: static;
  max-height: 240px;
}

/* ========== 启动画面（玻璃发光天体 · 云端同步期间展示） ========== */
/* 启动期间将粒子背景（金色光点 + 金线网络）提到启动画面之上 */
body.splash-active #particle-canvas { z-index: 10001; }

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 不透明金粉白渐变背景，与应用 body 一致 */
  background:
    radial-gradient(1100px 750px at 88% -12%, rgba(245, 213, 221, 0.55), rgba(245, 213, 221, 0) 62%),
    radial-gradient(950px 700px at -8% 28%, rgba(232, 201, 160, 0.50), rgba(232, 201, 160, 0) 60%),
    radial-gradient(900px 800px at 55% 115%, rgba(248, 216, 224, 0.42), rgba(248, 216, 224, 0) 62%),
    linear-gradient(175deg, #fdfbf7 0%, #f9f5ee 55%, #faf1ec 100%);
  opacity: 1;
  visibility: visible;
  /* 快速淡出：同步完成后 0.25s 消退，概览自然呈现 */
  transition: opacity 0.25s ease;
}
.splash-screen.done { display: none; }

/* 无外边框卡片：仅作布局容器，天体与文字直接呈现在粒子背景上 */
.splash-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px 28px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* 启动画面天体：放大复用的太阳/月亮/地球玻璃发光样式（与右下角指示器同一套视觉） */
.splash-celestial {
  position: relative;
  width: 240px; height: 240px;
  transform-origin: center center;
  /* 强制独立 GPU 合成层，避免父元素 backdrop-filter 在某些浏览器中冻结子元素动画 */
  transform: translateZ(0);
  will-change: transform;
}
.splash-celestial .c-sun {
  width: 44px; height: 44px;
  margin-left: -22px; margin-top: -22px;
  animation: splashSunSpin 26s linear infinite;
  will-change: transform;
  transform: translateZ(0);
}
.splash-celestial .c-sun-core {
  width: 26px; height: 26px;
  margin-left: -13px; margin-top: -13px;
  animation: splashSunGlow 2.4s ease-in-out infinite;
  will-change: transform;
  /* 移除子元素 backdrop-filter，避免与父元素 blur 叠加导致动画冻结 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.splash-celestial .c-ray {
  width: 46px; height: 3px;
  margin-left: -23px; margin-top: -1.5px;
}
.splash-celestial .c-earth-system {
  transform: translateX(90px);
  animation: splashOrbitEarth 9s linear infinite;
  will-change: transform;
  transform: translateZ(0);
}
.splash-celestial .c-earth {
  width: 22px; height: 22px;
  left: -11px; top: -11px;
  /* 移除子元素 backdrop-filter，避免与父元素 blur 叠加导致动画冻结 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.splash-celestial .c-earth::after {
  content: none;
}
.splash-celestial .c-moon {
  width: 20px; height: 20px;
  left: -10px; top: -10px;
  transform: translateX(28px);
  animation: splashOrbitMoon 3.6s linear infinite;
  will-change: transform;
  transform: translateZ(0);
}
.splash-celestial .c-moon-body {
  width: 15px; height: 15px;
  left: 0; top: 0;
  -webkit-mask: radial-gradient(circle at 76% 50%, transparent 40%, #000 42%);
  mask: radial-gradient(circle at 76% 50%, transparent 40%, #000 42%);
}
.splash-celestial .c-moon-tip {
  width: 2px; height: 2px;
  box-shadow:
    0 13px 0 rgba(255, 255, 255, 0.6),
    0 0 5px rgba(200, 220, 255, 0.4),
    0 13px 5px rgba(200, 220, 255, 0.25);
}

/* 启动画面天体动画：太阳呼吸发光 / 射线缓旋 / 地球绕日 / 月球绕地 */
@keyframes splashSunSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes splashSunGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 14px rgba(255, 230, 130, 0.9),
      0 0 32px rgba(255, 200, 60, 0.5),
      inset 0 0 5px rgba(255, 255, 255, 0.6);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      0 0 22px rgba(255, 240, 150, 1),
      0 0 52px rgba(255, 200, 60, 0.8),
      inset 0 0 6px rgba(255, 255, 255, 0.75);
  }
}
@keyframes splashOrbitEarth {
  0%   { transform: rotate(0deg) translateX(90px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(90px) rotate(-360deg); }
}
@keyframes splashOrbitMoon {
  0%   { transform: rotate(0deg) translateX(28px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(28px) rotate(-360deg); }
}

.splash-title {
  margin-top: 18px;
  font-family: var(--font-family);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.7);
}
.splash-status {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.7);
}
.splash-bar {
  width: 180px; height: 4px;
  margin-top: 14px;
  border-radius: 4px;
  background: rgba(212, 165, 116, 0.18);
  overflow: hidden;
}
.splash-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold), var(--gold-dark));
  transition: width 0.4s ease;
}

/* 深色主题适配 */
[data-theme="dark"] .splash-screen {
  background:
    radial-gradient(1100px 750px at 88% -12%, rgba(96, 62, 86, 0.42), rgba(96, 62, 86, 0) 62%),
    radial-gradient(950px 700px at -8% 28%, rgba(88, 68, 46, 0.36), rgba(88, 68, 46, 0) 60%),
    linear-gradient(175deg, #1e1a16 0%, #1a1714 55%, #1f1a17 100%);
}



/* ===== 列表自适应查阅：查看更多按钮 ===== */
.list-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-top: 12px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
}
.list-more-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 165, 116, 0.05);
}


/* ===== 分页控件 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 36px;
  text-align: center;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 165, 116, 0.08);
}
.page-btn.active {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
}












/* ========== 平板端生活收支输入栏优化（768px-1280px，覆盖8.8寸等小平板） ========== */
@media (min-width: 730px) and (max-width: 1280px) {
  .expense-add-form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .expense-add-form #expenseDate {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    flex: 0 0 95px !important;
    box-sizing: border-box !important;
  }
  .expense-add-form #expenseType {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    flex: 0 0 68px !important;
    box-sizing: border-box !important;
  }
  .expense-add-form #expenseCategory {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    flex: 0 0 68px !important;
    box-sizing: border-box !important;
  }
  .expense-add-form #expenseAmount {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    flex: 0 0 95px !important;
    box-sizing: border-box !important;
  }
  .expense-add-form #expenseNote {
    flex: 1 1 auto !important;
    min-width: 50px !important;
    width: auto !important;
    box-sizing: border-box !important;
  }
  .expense-add-form .btn-primary {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
}

/* ========== 生活收支手机端宽度自适应优化 ========== */
@media (max-width: 729px) {
  /* ===== 输入栏：宽度自适应布局 ===== */
  .expense-add-form {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    gap: 8px;
    margin-bottom: 16px;
    align-items: stretch !important;
    width: 100% !important;
  }
  /* 手机端输入框高度优化：重置移动端默认样式，统一高度 */
  .expense-add-form .form-input,
  .expense-add-form .form-select {
    -webkit-appearance: none;
    appearance: none;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
  }
  .expense-add-form .btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 16px !important;
    font-size: 0.9rem !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-sm) !important;
  }
  /* 日期：自适应最小宽度 */
  .expense-add-form #expenseDate {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 100%;
    width: auto;
  }
  /* 支出/收入：自适应最小宽度 */
  .expense-add-form #expenseType {
    flex: 1 1 80px;
    min-width: 70px;
    max-width: 100%;
    width: auto;
  }
  /* 分类：自适应最小宽度 */
  .expense-add-form #expenseCategory {
    flex: 1 1 80px;
    min-width: 70px;
    max-width: 100%;
    width: auto;
  }
  /* 金额：自适应最小宽度 */
  .expense-add-form #expenseAmount {
    flex: 1 1 100px;
    min-width: 80px;
    max-width: 100%;
    width: auto;
  }
  /* 备注：自适应，占据剩余空间 */
  .expense-add-form #expenseNote {
    flex: 2 1 150px;
    min-width: 120px;
    max-width: 100%;
    width: auto;
  }
  /* 记一笔按钮：自适应 */
  .expense-add-form .btn-primary {
    flex: 1 1 100px;
    min-width: 80px;
    max-width: 100%;
    width: auto;
    padding: 10px 16px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  /* ===== 查询筛选栏：宽度自适应布局 ===== */
  .expense-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
  }
  /* "查询时间段："标签 */
  .expense-filter > label:first-child {
    flex: 0 0 auto;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  /* 开始日期：自适应 */
  .expense-filter #expenseDateFrom {
    flex: 1 1 100px;
    min-width: 90px;
    max-width: 100%;
    width: auto;
  }
  /* "至"文本 */
  .expense-filter > span {
    flex: 0 0 auto;
    text-align: center;
    font-size: 0.85rem;
    padding: 0 2px;
  }
  /* 结束日期：自适应 */
  .expense-filter #expenseDateTo {
    flex: 1 1 100px;
    min-width: 90px;
    max-width: 100%;
    width: auto;
  }
  /* "分类："标签 */
  .expense-filter > label:nth-of-type(2) {
    flex: 0 0 auto;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  /* 分类下拉框：自适应 */
  .expense-filter #expenseFilterCategory {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 100%;
    width: auto;
  }
  /* 查询、全部按钮：自适应 */
  .expense-filter .btn-sm {
    flex: 1 1 70px;
    min-width: 60px;
    max-width: 100%;
    width: auto;
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* ===== 列表项：宽度自适应 ===== */
  .expense-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .expense-item .ei-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    gap: 6px;
  }
  .expense-item .ei-cat {
    flex: 0 0 auto;
    font-size: 0.7rem;
    padding: 2px 5px;
    white-space: nowrap;
  }
  .expense-item .ei-note {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
  .expense-item .ei-right {
    flex: 0 0 auto;
    text-align: right;
    min-width: 80px;
    max-width: 40%;
  }
  .expense-item .ei-amount {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
  }
  .expense-item .ei-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
  }
  .expense-item .ei-delete {
    opacity: 1;
    padding: 4px;
    margin-left: 4px;
    flex: 0 0 auto;
  }

  /* ===== 统计卡片：宽度自适应 ===== */
  .expense-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .expense-stat {
    flex: 1;
    min-width: 0;
    padding: 10px;
    text-align: center;
  }
  .expense-stat .es-label {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .expense-stat .es-value {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ===== 分页控件：宽度自适应 ===== */
  .pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }
  .pagination button {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 36px;
    white-space: nowrap;
  }
  .pagination .page-info {
    flex: 1 1 100%;
    text-align: center;
    font-size: 0.8rem;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ===== 分类管理：宽度自适应 ===== */
  .expense-cat-manager {
    width: 100%;
    box-sizing: border-box;
  }
  .ecm-add {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .ecm-add .form-input {
    flex: 1;
    min-width: 100px;
  }
  .ecm-add .btn-sm {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* 小屏幕手机（max-width: 480px）进一步优化 */
@media (max-width: 480px) {
  .expense-add-form {
    gap: 6px;
  }
  .expense-add-form #expenseDate {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .expense-add-form #expenseType {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .expense-add-form #expenseCategory {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .expense-add-form #expenseAmount {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .expense-add-form #expenseNote {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .expense-add-form .btn-primary {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .expense-item {
    padding: 8px 10px;
  }
  .expense-item .ei-amount {
    font-size: 0.9rem;
  }
  .expense-stat .es-value {
    font-size: 0.9rem;
  }
  .expense-filter > label:first-child,
  .expense-filter > label:nth-of-type(2) {
    flex: 1 1 100%;
  }
}


/* ========== 确保移动端导航栏固定定位 ========== */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  #bottomNav {
    position: fixed !important;
    left: 14px !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    right: auto !important;
    z-index: 100 !important;
    transform: translateZ(0) !important;
  }
  #bottomNav.nav-collapsed {
    transform: translateX(calc(-100% - 24px)) !important;
    opacity: 0;
    pointer-events: none;
  }
  #navPeekHandle {
    position: fixed !important;
    z-index: 99 !important;
  }

}
