/* =====================================================
   Monofin · styles.css —— 黑白 iOS HIG
   只允许黑白灰：禁止任何彩色。深浅色由 prefers-color-scheme 自动切换。
   ===================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #F2F2F7;            /* iOS systemGroupedBackground */
  --card: #FFFFFF;
  --text: #000000;
  --text2: rgba(60, 60, 67, 0.6);   /* 次要文字 */
  --text3: rgba(60, 60, 67, 0.33);  /* 占位/更弱 */
  --hairline: #C6C6C8;
  --accent: #000000;        /* 主按钮/强调：纯黑 */
  --on-accent: #FFFFFF;
  --fill: rgba(120, 120, 128, 0.16);  /* iOS systemFill：进度条底/seg 底 */
  --fill2: rgba(120, 120, 128, 0.24);
  --tap: rgba(120, 120, 128, 0.12);   /* :active 反馈 */
  --bar-bg: rgba(249, 249, 249, 0.82);
  --seg-pill: #FFFFFF;
  --mask: rgba(0, 0, 0, 0.32);
  --radius-card: 16px;
  --radius-btn: 14px;
  /* 看板比例条黑白灰循环：纯黑 / 70% / 40% / 浅灰 */
  --s1: #000000;
  --s2: rgba(0, 0, 0, 0.68);
  --s3: rgba(0, 0, 0, 0.4);
  --s4: rgba(0, 0, 0, 0.16);
}

/* 深色变量：prefers-color-scheme 自动 + data-theme 手动调试钩子（?theme=dark） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1C1C1E;
    --text: #FFFFFF;
    --text2: rgba(235, 235, 245, 0.6);
    --text3: rgba(235, 235, 245, 0.29);
    --hairline: #38383A;
    --accent: #FFFFFF;      /* 深色下主按钮反转：白底黑字 */
    --on-accent: #000000;
    --fill: rgba(120, 120, 128, 0.24);
    --fill2: rgba(120, 120, 128, 0.32);
    --tap: rgba(120, 120, 128, 0.2);
    --bar-bg: rgba(22, 22, 23, 0.82);
    --seg-pill: #636366;
    --mask: rgba(0, 0, 0, 0.55);
    --s1: #FFFFFF;
    --s2: rgba(255, 255, 255, 0.7);
    --s3: rgba(255, 255, 255, 0.42);
    --s4: rgba(255, 255, 255, 0.2);
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1C1C1E;
  --text: #FFFFFF;
  --text2: rgba(235, 235, 245, 0.6);
  --text3: rgba(235, 235, 245, 0.29);
  --hairline: #38383A;
  --accent: #FFFFFF;
  --on-accent: #000000;
  --fill: rgba(120, 120, 128, 0.24);
  --fill2: rgba(120, 120, 128, 0.32);
  --tap: rgba(120, 120, 128, 0.2);
  --bar-bg: rgba(22, 22, 23, 0.82);
  --seg-pill: #636366;
  --mask: rgba(0, 0, 0, 0.55);
  --s1: #FFFFFF;
  --s2: rgba(255, 255, 255, 0.7);
  --s3: rgba(255, 255, 255, 0.42);
  --s4: rgba(255, 255, 255, 0.2);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}
input {
  font: inherit;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
}
.num, .hero-amount, .today-amount, .rate-num, .amount-display, .tx-amount, .sub-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
[hidden] { display: none !important; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- 收缩标题栏（滚动后浮现） ---------- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(44px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
#navbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0.5px;
  background: var(--hairline);
}
#navbar.visible { opacity: 1; }
#nav-title { font-size: 17px; font-weight: 600; }

/* ---------- 主滚动区 ---------- */
#main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(49px + env(safe-area-inset-bottom) + 84px); /* tab bar + FAB 空间 */
}
.view { animation: view-in 0.24s ease; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 18px 16px 2px;
}
.period-line {
  padding: 0 16px 10px;
  color: var(--text2);
  font-size: 13px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  margin: 12px 16px;
  padding: 16px;
}
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sub-label { color: var(--text2); font-size: 13px; }
.hint { color: var(--text3); font-size: 12px; margin-top: 4px; }
.strong { font-weight: 600; }

/* 本月结余 hero */
.hero { padding: 22px 16px 18px; }
.hero-label { color: var(--text2); font-size: 14px; }
.hero-amount {
  font-size: 44px;
  font-weight: 700;
  margin-top: 2px;
  word-break: break-all;
}
.hero-sub {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--hairline);
}
.hero-sub-item { display: flex; align-items: baseline; gap: 8px; }
.hero-sub-sep { width: 0.5px; height: 16px; background: var(--hairline); }
.sub-num { font-size: 17px; font-weight: 600; }
.sub-num.thin { font-weight: 400; }

/* 今天还能花 */
.today-card { padding: 18px 16px; }
.today-label { color: var(--text2); font-size: 14px; }
.today-amount { font-size: 34px; font-weight: 700; margin-top: 2px; }
.today-sub { color: var(--text3); font-size: 12px; margin-top: 4px; }

/* 预算进度条：灰底黑条，超支全黑 */
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--fill);
  margin-top: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--text);
  transition: width 0.35s ease;
}
.over-label { color: var(--text); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ---------- inset grouped list ---------- */
.group-title {
  font-size: 13px;
  color: var(--text2);
  padding: 18px 32px 6px;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.group-title .net { font-variant-numeric: tabular-nums; }
.group-hint {
  font-size: 12px;
  color: var(--text3);
  padding: 0 32px 6px;
  margin-top: -14px;
}
.group {
  background: var(--card);
  border-radius: var(--radius-card);
  margin: 4px 16px;
  overflow: hidden;
}
.group > * + * { border-top: 0.5px solid var(--hairline); }
.group > *:first-child { border-top: none; }
/* hairline 左缩进（iOS 分隔线不对齐左缘） */
.group.inset-lines > * + * { border-top: none; }
.group.inset-lines > * + *::before {
  content: "";
  display: block;
  height: 0.5px;
  background: var(--hairline);
  margin-left: 60px;
}

/* 流水行 */
.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  width: 100%;
  text-align: left;
}
button.tx-row:active, .list-btn:active, .form-row:active { background: var(--tap); }
.tx-icon {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  background: var(--fill);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tx-icon svg { width: 18px; height: 18px; stroke: var(--text); fill: none; }
.tx-main { flex: 1; min-width: 0; }
.tx-name { font-size: 15px; font-weight: 500; }
.tx-note {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-amount { font-size: 16px; font-weight: 600; white-space: nowrap; }
.tx-amount.income { font-weight: 400; } /* 黑白语义：±符号 + 字重区分 */

/* 日分组头（明细） */
.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 32px 6px;
  font-size: 13px;
  color: var(--text2);
}
.day-head .day-total { font-variant-numeric: tabular-nums; }

.empty {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  padding: 36px 16px 80px; /* 底部多留 FAB 高度：空态无滚动内容时避免被「记一笔」遮挡 */
}

/* ---------- 明细月份切换 ---------- */
.month-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 4px 16px 8px;
}
.month-switch span { font-size: 17px; font-weight: 600; min-width: 110px; text-align: center; }
.chev {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chev:active { background: var(--tap); }

/* ---------- 统计 ---------- */
.rate-num { font-size: 40px; font-weight: 700; margin-top: 4px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.bar-name { width: 44px; flex: none; font-size: 13px; }
.bar-track { flex: 1; height: 10px; border-radius: 5px; background: var(--fill); overflow: hidden; }
.bar-fill { height: 100%; background: var(--text); border-radius: 5px; }
.bar-amount { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text2); min-width: 74px; text-align: right; }
.bar-name.wide { width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 黑白灰四档色阶：多行条形图（账户看板 / 永久组合）相互区分 */
.bar-fill.shade-0 { background: var(--text); }
.bar-fill.shade-1 { background: var(--text2); }
.bar-fill.shade-2 { background: var(--text3); }
.bar-fill.shade-3 { background: var(--fill2); }
.bar-fill.outline { background: transparent; border: 1.5px solid var(--text); } /* 透支账户：空心描边 */

.chart-card { padding: 14px 8px 8px; }
#st-chart svg { display: block; width: 100%; height: auto; }
.chart-exp { fill: var(--text); }                 /* 支出：黑实柱 */
.chart-inc { fill: none; stroke: var(--text); stroke-width: 1.5; } /* 收入：黑描边柱 */
.chart-label { fill: var(--text2); font-size: 10px; }
.chart-axis { stroke: var(--hairline); stroke-width: 0.5; }
.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text2);
  padding: 6px 0 4px;
}
.chart-legend .lg-exp,
.chart-legend .lg-inc {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  margin-left: 10px;
}
.chart-legend .lg-exp { background: var(--text); }
.chart-legend .lg-inc { border: 1.5px solid var(--text); }
.pace-row { padding: 2px 0; }
.hairline-gap { height: 0.5px; background: var(--hairline); margin: 10px 0; }

/* ---------- 设置 ---------- */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  min-height: 48px;
}
.form-row label { font-size: 15px; flex: none; }
.form-row input {
  flex: 1;
  text-align: right;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.form-row input::placeholder { color: var(--text3); }

.list-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  font-size: 16px;
  min-height: 48px;
}
.list-btn.left { text-align: left; }

.about-row { padding: 12px 16px; font-size: 14px; }
.about-row.dim { color: var(--text2); font-size: 13px; }

.acc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  min-height: 48px;
}
.acc-name { flex: 1; font-size: 15px; }
.acc-badge {
  font-size: 11px;
  color: var(--text2);
  border: 0.5px solid var(--hairline);
  border-radius: 6px;
  padding: 1px 6px;
}
.acc-balance { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text2); }
.acc-row .chevron, .rec-row .chevron { color: var(--text3); font-size: 18px; }

.rec-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
}
.rec-main { flex: 1; min-width: 0; }
.rec-name { font-size: 15px; }
.rec-sub { font-size: 12px; color: var(--text2); }
.rec-amount { font-size: 15px; font-variant-numeric: tabular-nums; }

/* iOS 开关（自绘） */
.switch {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--fill2);
  transition: background 0.2s ease;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.switch.on { background: var(--text); }
.switch.on::after { transform: translateX(20px); }

/* 导入预览 */
.preview-group { padding: 14px 16px; font-size: 14px; }
.preview-group p { margin-bottom: 10px; }
.preview-group .dim { color: var(--text2); font-size: 13px; }

/* 同步区块 */
.sync-code {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  padding: 8px 0 2px;
  font-variant-numeric: tabular-nums;
}
.sync-meta { text-align: center; color: var(--text2); font-size: 12px; padding-bottom: 8px; }
.sync-input-row { display: flex; gap: 8px; padding: 4px 0 10px; }
.sync-input-row input {
  flex: 1;
  background: var(--fill);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 17px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  min-width: 0;
}
.btn-black {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-btn);
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  flex: none;
}
.btn-black:active { opacity: 0.75; }
.btn-black:disabled { opacity: 0.35; }
.btn-plain {
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-btn);
  padding: 11px 18px;
  font-size: 15px;
}
.btn-plain:active { background: var(--tap); }
.btn-row { display: flex; gap: 10px; padding-top: 4px; }
.btn-row > * { flex: 1; }

/* ---------- FAB（记一笔） ---------- */
#fab-add {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(49px + env(safe-area-inset-bottom) + 14px);
  z-index: 45;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
  border-radius: 999px;
  padding: 14px 34px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
#fab-add:active { transform: translateX(-50%) scale(0.96); opacity: 0.85; }
body[data-tab="stats"] #fab-add,
body[data-tab="market"] #fab-add,
body[data-tab="settings"] #fab-add { display: none; }

/* ---------- 底部 Tab Bar ---------- */
#tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  height: calc(49px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
#tabbar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0.5px;
  background: var(--hairline);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #8E8E93; /* 未选：灰 */
  font-size: 10px;
}
.tab:active { opacity: 0.6; }
.tab-icon { width: 25px; height: 25px; stroke: currentColor; fill: none; }
.tab.active { color: var(--text); font-weight: 600; }
.tab.active .tab-icon { fill: currentColor; } /* 选中：实心 */
.tab.active .tab-icon path[fill="none"], .tab.active .tab-icon circle[fill="none"] { fill: none; }

/* ---------- 底部 Sheet ---------- */
#sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--mask);
  opacity: 0;
  transition: opacity 0.28s ease;
}
#sheet-mask.open { opacity: 1; }

#sheet, #form-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 61;
  background: var(--bg);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(102%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  max-height: 94dvh;
}
#sheet.open, #form-sheet.open { transform: translateY(0); }
.grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--fill2);
  margin: 8px auto 2px;
  flex: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 2px;
  flex: none;
}
.sheet-head span { font-size: 17px; font-weight: 600; }
.text-btn { font-size: 15px; }
.text-btn.danger { font-weight: 600; }
.text-btn:active { opacity: 0.5; }
.sheet-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px 10px;
  flex: 1;
  min-height: 0;
}

/* segmented control（滑块动画） */
.seg {
  position: relative;
  display: flex;
  background: var(--fill);
  border-radius: 10px;
  padding: 2px;
  margin: 4px 0 10px;
}
.seg-pill {
  position: absolute;
  top: 2px; bottom: 2px;
  left: 2px;
  width: calc(50% - 2px);
  border-radius: 8px;
  background: var(--seg-pill);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}
.seg-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 7px 0;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

/* 金额显示 */
.amount-display {
  font-size: 42px;
  font-weight: 700;
  text-align: right;
  padding: 4px 2px 12px;
  word-break: break-all;
  min-height: 56px;
}

/* 横滑 chips */
.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 0.5px solid var(--hairline);
  font-size: 14px;
  white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; } /* 选中态黑底白字 */
.chip:active { opacity: 0.7; }

#add-note {
  width: 100%;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  margin-bottom: 4px;
}
#add-note::placeholder { color: var(--text3); }

/* 数字键盘（iOS 键盘风：大号数字） */
.keypad {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 16px 8px;
}
.keypad button {
  height: 50px;
  border-radius: 10px;
  background: var(--card);
  font-size: 26px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.keypad button:active { background: var(--fill2); }
#add-done {
  flex: none;
  margin: 0 16px 12px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-btn);
  padding: 14px 0;
  font-size: 17px;
  font-weight: 600;
}
#add-done:active { opacity: 0.75; }
#add-done:disabled { opacity: 0.35; }

/* ---------- 表单 Sheet 内部 ---------- */
#form-sheet-body { padding-bottom: 20px; }
.field-label { font-size: 13px; color: var(--text2); padding: 14px 2px 6px; }
.field-input {
  width: 100%;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}
.field-input::placeholder { color: var(--text3); }
.form-actions { display: flex; gap: 10px; padding-top: 18px; }
.form-actions > * { flex: 1; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(49px + env(safe-area-inset-bottom) + 76px);
  z-index: 80;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.22s ease;
  max-width: 84vw;
  text-align: center;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) none; }
}

/* ---------- 市场 Tab ---------- */
.mkt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 16px 0;
}
.mkt-grid .card { margin: 0; }
.mkt-name { font-size: 13px; color: var(--text2); }
.mkt-price {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  word-break: break-all;
}
.mkt-unit { font-size: 13px; font-weight: 400; color: var(--text2); }
.mkt-chg { font-size: 13px; color: var(--text2); font-weight: 400; }
.mkt-chg.on { color: var(--text); font-weight: 700; } /* 涨跌：▲▼ + 字重，不用颜色 */
.mkt-sub { font-size: 13px; color: var(--text2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.mkt-ts {
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  margin: 8px 16px 0;
}
.mkt-error { text-align: center; padding: 28px 16px; }
.mkt-error p { color: var(--text2); font-size: 14px; margin-bottom: 12px; }
.mkt-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  padding: 14px 32px 8px;
}
.title-btn {
  font-size: 13px;
  color: var(--text2);
  padding: 2px 10px;
  border: 0.5px solid var(--hairline);
  border-radius: 999px;
}
.title-btn:active { background: var(--tap); }

.news-item {
  display: block;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
}
.news-item:active { background: var(--tap); }
.news-title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.news-summary {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.45;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* 骨架屏（黑白灰脉冲） */
.sk { background: var(--fill); border-radius: 6px; animation: sk-pulse 1.1s ease-in-out infinite; }
.sk-name { width: 40%; height: 13px; }
.sk-price { width: 72%; height: 26px; margin-top: 8px; }
.sk-line { width: 90%; height: 12px; margin-top: 10px; }
.sk-title { width: 86%; height: 15px; }
.sk-meta { width: 34%; height: 11px; margin-top: 8px; }
@keyframes sk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- 永久组合（统计 Tab） ---------- */
.pp-idea p { margin: 0 0 8px; font-size: 13px; color: var(--text2); line-height: 1.6; }
.pp-idea p:last-child { margin-bottom: 0; }
.pp-idea strong { color: var(--text); font-weight: 600; }
.pp-note { text-align: center; font-size: 11px; color: var(--text3); padding: 2px 32px 8px; margin: 0; line-height: 1.5; }
.pp-gold-hint { font-size: 11px; color: var(--text3); margin-left: 6px; }

.pp-row { padding: 9px 0; }                 /* 卡片已有内边距，行内不再重复 */
.pp-track { position: relative; overflow: visible; }
.pp-target {                              /* 25% 目标虚线 */
  position: absolute;
  left: 25%;
  top: -3px;
  bottom: -3px;
  width: 0;
  border-left: 1px dashed var(--text3);
}
.pp-alert {                               /* 越出 15%–35% 区间：黑框警示（深浅色自动反色） */
  outline: 1px solid var(--text);
  outline-offset: 3px;
  border-radius: 10px;
}
.pp-vs { font-size: 11px; color: var(--text3); }
.pp-legend { font-size: 11px; color: var(--text3); margin: 10px 0 0; line-height: 1.5; }
.pp-advice-ok { font-size: 15px; font-weight: 600; padding: 4px 0 8px; }

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
