/* ============ 股息率计算器 · 设计令牌 ============ */
:root {
  --red: #E5453C;
  --red-deep: #C93933;
  --red-bg: #FDECEC;
  --red-dim: #D98B86;
  --ink: #1A1D26;
  --gray: #5A6068;
  --gray2: #6B7280;
  --gray3: #9AA0A8;
  --gray4: #B4B9C1;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --line: #EDEFF2;
  --green: #0E9F6E;
  --font-cn: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: "Inter", "DIN Alternate", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { background: #E9EBEF; font-family: var(--font-cn); color: var(--ink); }

.stage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px; }

/* ============ 手机容器 ============ */
.phone {
  width: 390px; height: 844px; position: relative; overflow: hidden;
  background: var(--bg); border-radius: 44px;
  box-shadow: 0 24px 64px rgba(20, 24, 34, 0.22), 0 0 0 10px #20242E, 0 0 0 12px #3A4150;
}
@media (max-width: 460px) {
  .stage { padding: 0; }
  .phone { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
  .home-content,
  .result-content,
  .watch-content,
  .me-content { padding-top: 12px; }
}

.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ============ 屏1 首页 ============ */
.home-content { flex: 1; overflow-y: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 18px; }
.home-content::-webkit-scrollbar { display: none; }

.header { display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; flex-direction: column; gap: 2px; }
.app-title { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.app-subtitle { font-size: 12px; color: var(--gray3); }
.icon-btn { cursor: pointer; flex: none; }

/* 搜索卡 */
.search-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 4px 12px rgba(26, 29, 38, 0.06);
}
.search-input-wrap { position: relative; }
.search-input {
  display: flex; align-items: center; gap: 8px; background: #F2F3F5;
  border-radius: 12px; padding: 0 14px; height: 48px;
}
.search-input input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-cn); font-size: 14px; color: var(--ink);
}
.search-input input::placeholder { color: var(--gray3); }

.suggest {
  position: absolute; top: 54px; left: 0; right: 0; z-index: 20;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(26, 29, 38, 0.14); overflow: hidden; display: none;
}
.suggest.show { display: block; }
.suggest-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer;
}
.suggest-item:hover { background: #F7F8FA; }
.suggest-name { font-size: 14px; font-weight: 500; }
.suggest-ind { font-size: 10px; color: var(--gray3); background: #F7F8FA; padding: 1px 6px; border-radius: 5px; flex: none; }
.suggest-code { font-family: var(--font-num); font-size: 12px; color: var(--gray3); }
.suggest-market {
  margin-left: auto; font-size: 10px; color: var(--gray2); background: #F2F3F5;
  padding: 2px 7px; border-radius: 6px; flex: none;
}
.suggest-empty { padding: 14px; font-size: 13px; color: var(--gray3); text-align: center; }
.suggest-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 4px; font-size: 11px; color: var(--gray4);
}
.suggest-clear {
  border: none; background: none; color: var(--red); font-size: 11px;
  cursor: pointer; padding: 2px 4px;
}
.suggest-clock { font-size: 12px; opacity: 0.75; }

.example-hint { font-size: 12px; color: var(--gray4); }
.calc-btn {
  height: 48px; border: none; border-radius: 14px; cursor: pointer;
  background: var(--red); color: #fff; font-family: var(--font-cn);
  font-size: 16px; font-weight: 600;
  box-shadow: 0 6px 12px rgba(229, 69, 60, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.calc-btn:active { transform: scale(0.98); box-shadow: 0 3px 8px rgba(229, 69, 60, 0.25); }
.calc-btn.loading { opacity: 0.75; }

/* 热门查询 */
.hot-section { display: flex; flex-direction: column; gap: 10px; }
.hot-title-row { display: flex; align-items: center; justify-content: space-between; }
.hot-title { font-size: 16px; font-weight: 600; }
.hot-meta { font-size: 11px; color: var(--gray3); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 16px; cursor: pointer; font-family: var(--font-cn);
  transition: transform 0.12s ease;
}
.chip:active { transform: scale(0.95); }
.chip .chip-name { font-size: 13px; font-weight: 500; }
.chip .chip-ind { font-size: 10px; opacity: 0.7; flex: none; }
.chip .chip-code { font-family: var(--font-num); font-size: 11px; }
.chip.hot { background: var(--red-bg); }
.chip.hot .chip-name { color: var(--red-deep); }
.chip.hot .chip-code { color: var(--red-dim); }
.chip.normal { background: #F2F3F5; }
.chip.normal .chip-name { color: var(--gray); }
.chip.normal .chip-code { color: var(--gray3); }

/* 算法说明卡 */
.algo-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px 16px 16px 16px; display: flex; flex-direction: column; gap: 12px;
}
.algo-title-row { display: flex; align-items: center; justify-content: space-between; }
.algo-title { font-size: 16px; font-weight: 600; }
.algo-tag { font-size: 11px; font-weight: 500; color: var(--gray2); background: #F2F3F5; padding: 3px 8px; border-radius: 8px; }
.algo-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #4A5058; line-height: 1.5; }
.step-badge {
  flex: none; width: 22px; height: 22px; border-radius: 11px; background: var(--red-bg);
  color: var(--red-deep); font-family: var(--font-num); font-weight: 600;
  font-size: 12px; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

/* ============ 屏2 结果页 ============ */
.nav-bar {
  height: 52px; flex: none; display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px; position: relative;
}
.nav-title { font-size: 16px; font-weight: 600; }
/* v2.28：结果页去掉无功能的三点图标后，标题绝对居中保持版式（仅结果页用 .nav-title） */
.nav-title { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; white-space: nowrap; }
.nav-title-lg { font-size: 18px; font-weight: 700; }

/* 结果页内嵌搜索框（直达继续查询，无须回首页） */
.result-search {
  flex: none; padding: 6px 16px 8px; background: var(--bg);
  position: relative;
}
.result-search .search-mini {
  height: 40px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px;
}
.result-search .search-mini input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-cn); font-size: 14px; color: var(--ink);
  margin-left: 8px; height: 100%;
}
.result-search .search-mini input::placeholder { color: var(--gray3); }
.result-search .suggest-result {
  position: absolute; left: 16px; right: 16px; top: 48px;
  background: var(--card); border-radius: 12px; box-shadow: 0 8px 20px rgba(26,29,38,0.12);
  z-index: 50; max-height: 240px; overflow-y: auto; display: none;
}
.result-search .suggest-result.show { display: block; }
.result-search .suggest-result::-webkit-scrollbar { display: none; }

.result-content {
  flex: 1; overflow-y: auto; padding: 0 20px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.result-content::-webkit-scrollbar { display: none; }

.stock-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px;
}
.stock-left { display: flex; flex-direction: column; gap: 3px; }
.stock-name { font-size: 18px; font-weight: 700; }
.stock-code-row { display: flex; align-items: center; gap: 6px; }
.stock-code { font-family: var(--font-num); font-size: 12px; color: var(--gray3); }
.market-tag { font-size: 10px; font-weight: 500; color: var(--gray2); background: #F2F3F5; padding: 2px 6px; border-radius: 6px; }
.stock-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.stock-price { font-family: var(--font-num); font-size: 20px; font-weight: 600; }
.stock-change { font-family: var(--font-num); font-size: 12px; font-weight: 500; }
.up { color: var(--red); }
.down { color: var(--green); }
.flat { color: var(--gray3); }

/* Hero 主卡 */
.hero-card {
  background: linear-gradient(135deg, #ED4F45 0%, #C72922 100%);
  border-radius: 20px; padding: 20px; color: #fff;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 8px 20px rgba(200, 55, 48, 0.35);
}
.hero-head { display: flex; align-items: center; justify-content: space-between; }
.hero-title { font-size: 14px; font-weight: 500; opacity: 0.9; }
.hero-badge { font-size: 11px; font-weight: 500; background: rgba(255, 255, 255, 0.18); padding: 4px 8px; border-radius: 8px; }
.hero-value { font-family: var(--font-num); font-size: 56px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; }
.hero-formula { font-size: 13px; opacity: 0.9; font-family: var(--font-cn); }
.hero-time { font-size: 11px; opacity: 0.6; }

/* 计算明细 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.detail-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px;
}
.detail-row + .detail-row { border-top: 1px solid #F4F5F7; margin-top: 10px; }
.detail-label { font-size: 13px; color: var(--gray2); }
.detail-value { font-size: 13px; font-weight: 500; }
.detail-value.highlight { color: var(--red-deep); font-weight: 600; }
.detail-value.strong { font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--red); }

/* 阈值判断 */
.judge-card { display: flex; flex-direction: column; gap: 10px; }
.judge-row { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.45; }
.judge-row .dot {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.dot.pass { background: var(--green); }
.dot.warn { background: #E5A23C; }
.dot.info { background: #D9DCE1; color: var(--gray2); }
.judge-main { color: var(--ink); }
.judge-sub { color: var(--gray2); }

/* 操作按钮 */
.action-row { display: flex; gap: 12px; padding-bottom: 4px; }
.btn {
  flex: 1; height: 48px; border-radius: 14px; cursor: pointer;
  font-family: var(--font-cn); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-outline { background: var(--card); border: 1.5px solid var(--red); color: var(--red); }
.btn-solid { background: var(--red); border: none; color: #fff; box-shadow: 0 6px 12px rgba(229, 69, 60, 0.3); }
.btn-solid.added { background: #F2F3F5; color: var(--gray2); box-shadow: none; border: 1.5px solid var(--line); }

/* ============ 屏3 自选页 ============ */
.watch-content { flex: 1; overflow-y: auto; padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.watch-content::-webkit-scrollbar { display: none; }
.edit-btn { font-size: 14px; color: var(--gray2); cursor: pointer; }
.edit-btn.on { color: var(--red); font-weight: 600; }

.stat-card {
  display: flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px;
}
.stat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* 第 1 栏「只数」固定窄宽，让位给行业两栏放完整不换行的 label */
.stat-card > .stat:nth-child(1) { flex: 0 0 56px; }
.stat:nth-child(2) { align-items: center; }
.stat:nth-child(3) { align-items: flex-end; }
.stat-value { font-family: var(--font-num); font-size: 22px; font-weight: 700; }
/* 行业名给 label 让一点空间：22 → 14px；与左栏 22px 形成主次 */
.stat-value.industry { font-size: 14px; letter-spacing: -0.5px; }
.stat-label { font-size: 11px; color: var(--gray3); display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; }
.stat-label > .stat-sub { white-space: normal; max-width: 100%; }
.stat-sub { font-size: 9px; color: #B9BDC9; font-weight: 400; }
.stat-value.red { color: var(--red); }
.stat-value.deep { color: var(--red-deep); }

.section-title-row { display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 15px; font-weight: 600; }
.section-meta { font-size: 11px; color: var(--gray3); }
.section-meta-row {
  font-size: 10px; color: var(--gray3); line-height: 1.4;
  padding: 0 2px 4px;
}

/* 排序按钮（watch 列表用） */
.sort-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 10px;
  font-family: var(--font-cn);
  font-size: 11px; font-weight: 500;
  background: #F2F3F5; color: var(--gray2);
  cursor: pointer; transition: background 0.15s ease, transform 0.1s ease;
  border: none; outline: none;
}
.sort-btn .arrow { font-family: var(--font-num); font-size: 10px; font-weight: 700; }
.sort-btn .label { font-size: 11px; }
.sort-btn.active { background: var(--red-bg); color: var(--red-deep); }
.sort-btn:active { transform: scale(0.96); }

.watch-list { display: flex; flex-direction: column; gap: 10px; }
.watch-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; position: relative; cursor: pointer;
}
.watch-left { display: flex; flex-direction: column; gap: 3px; }
.watch-name { font-size: 15px; font-weight: 600; }
.watch-industry { font-size: 11px; color: var(--gray3); font-weight: 500; }
.watch-code { font-family: var(--font-num); font-size: 11px; color: var(--gray3); }
.watch-mid { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.watch-price { font-family: var(--font-num); font-size: 14px; font-weight: 500; }
.watch-change { font-family: var(--font-num); font-size: 11px; }
.watch-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.watch-yield { font-family: var(--font-num); font-size: 16px; font-weight: 700; }
.watch-avg { font-family: var(--font-num); font-size: 11px; color: var(--gray3); font-weight: 500; }
.watch-del {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; background: #F04438; color: #fff; font-size: 12px;
  display: none; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.watch-item.editing .watch-del { display: flex; }
.drag-handle {
  display: none; flex: none; color: var(--gray3); font-size: 15px;
  cursor: grab; padding: 4px 2px 4px 8px; user-select: none;
}
.watch-item.editing .drag-handle { display: block; }
.watch-item.draggable:active { cursor: grabbing; }
.watch-item.dragging { opacity: 0.45; border-style: dashed; }
.watch-item.drag-over { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-bg); }
.watch-loading { padding: 26px 0; text-align: center; color: var(--gray3); font-size: 13px; }
.watch-refreshing-hint { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 8px 0; font-size: 12px; color: var(--gray3); }
.watch-refreshing-hint .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; animation: pulse-dot 1.4s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 0.4; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }

.empty-state { padding: 48px 20px; text-align: center; color: var(--gray3); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-state .big { font-size: 15px; color: var(--gray2); font-weight: 500; }
.empty-state .sub { font-size: 12px; }
.empty-go { margin-top: 10px; width: 160px; height: 42px; border-radius: 12px; background: var(--red); color: #fff; border: none; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ============ 底部导航 ============ */
.tabbar { flex: none; height: 96px; display: flex; align-items: flex-start; justify-content: center; padding: 12px 21px 0; }
.tab-pill {
  display: flex; width: 100%; height: 62px; background: var(--card);
  border: 1px solid var(--line); border-radius: 36px; padding: 4px; gap: 4px;
  box-shadow: 0 6px 16px rgba(26, 29, 38, 0.1);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border-radius: 26px; cursor: pointer; font-size: 10px; color: var(--gray3); font-weight: 500;
  transition: background 0.15s ease;
}
.tab-item.active { background: var(--red); color: #fff; font-weight: 600; }

/* 加载动画 */
.spin {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
  display: inline-block; margin-right: 8px; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 屏4 我的页 ============ */
.mine-content { flex: 1; overflow-y: auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.mine-content::-webkit-scrollbar { display: none; }

.profile-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px 16px; box-shadow: 0 4px 12px rgba(26, 29, 38, 0.06);
}
.avatar {
  width: 48px; height: 48px; border-radius: 16px; flex: none;
  background: linear-gradient(135deg, #ED4F45 0%, #C72922 100%);
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(200, 55, 48, 0.3);
}
.profile-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-size: 17px; font-weight: 700; }
.profile-sub { font-size: 12px; color: var(--gray3); }
.pro-badge {
  font-family: var(--font-num); font-size: 11px; font-weight: 600; color: var(--gray2);
  background: #F2F3F5; padding: 4px 9px; border-radius: 8px; flex: none;
}

.data-card { display: flex; flex-direction: column; }
.data-card .detail-row:first-of-type { padding-top: 10px; }
.detail-value.rt-rt { color: var(--red); font-weight: 600; }
.detail-value.rt-off { color: var(--gray3); font-weight: 500; }

/* ---------- 我的页·指数全景 ---------- */
.card-head-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-head-row .card-title { margin-bottom: 0; }
.card-meta {
  font-size: 11px; color: var(--gray3);
  background: #F4F6F8; padding: 3px 8px; border-radius: 6px;
}
/* 指数·横向滚动卡片流（v2.4 通达信风格：3 + 半张第 4 张露头提示可滑动）
   关键日（除权除息日 / 股权登记日 / 派息日 等）只保留 ≥ 今天的未来日期——已过去的时间无操作意义。 */
.indices-scroll {
  /* 每张卡片宽 = (容器 - 3 个 gap - 右 padding 供第 4 张露头) / 3.4 张可见 */
  --card-w: calc((100% - 26px - 14px) / 3.4);
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  margin: 4px 0 0;
  padding: 2px 14px 8px 0;       /* 右 padding 让第 4 张卡片能从右边缘漏出半张，提示可滚动 */
  scrollbar-width: none;          /* Firefox 隐藏滚动条 */
  -ms-overflow-style: none;       /* IE/旧 Edge */
  touch-action: pan-x;
}
.indices-scroll::-webkit-scrollbar { display: none; }  /* WebKit 系列隐藏滚动条 */
.indices-scroll > .index-cell-h {
  flex: 0 0 var(--card-w);
  scroll-snap-align: start;
  min-width: 0;
}
.indices-loading, .indices-empty {
  flex: 1 1 100%; padding: 18px 0; text-align: center;
  font-size: 13px; color: var(--gray3);
}

/* 市场情绪·spinner 加载态 */
.sentiment-grid[data-state="loading"] { display: block; padding: 14px 0; }
.sentiment-grid[data-state="ok"]      { display: grid; }
.sentiment-grid[data-state="error"]   { display: block; padding: 6px 0; }
.sent-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gray3); font-size: 13px; }
.sent-loading-text { letter-spacing: 0.2px; }
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #E1E4EA; border-top-color: var(--red, #E5453C);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 市场情绪·错误态（带重试按钮） */
.sent-error { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px; }
.sent-error-icon { font-size: 26px; }
.sent-error-text { font-size: 13px; color: var(--ink); text-align: center; }
.sent-error-hint { font-size: 11px; color: var(--gray4); text-align: center; margin-top: -2px; }
.sent-retry-btn {
  margin-top: 2px; padding: 7px 18px; border-radius: 18px; border: none;
  background: var(--red, #E5453C); color: #fff; font-size: 13px;
  cursor: pointer; transition: opacity 0.15s, transform 0.05s;
  letter-spacing: 0.5px;
}
.sent-retry-btn:hover { opacity: 0.92; }
.sent-retry-btn:active { transform: scale(0.97); }
.sent-retry-btn:disabled { background: var(--gray3); cursor: wait; opacity: 0.7; }
/* 指数·横向滚动卡片（v2.4 紧凑版：名称短一档、价格仍是主信号、振幅下沉到 chip 脚下） */
.index-cell-h {
  background: #FAFBFC; border-radius: 10px; padding: 10px 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
  /* v2.13: 去掉 border-left（被父级 border-radius 咬弯成 "}"），改用整卡底色浅染表达涨跌 */
  box-shadow: inset 0 0 0 1px #EFF1F4;
}
.index-cell-h.up    { background: #FFF4F4; }   /* 涨：红极浅 */
.index-cell-h.down  { background: #F0FAF0; }   /* 跌：绿极浅 */
.index-cell-h.flat  { background: #FAFBFC; }   /* 平：原中性 */
.index-cell-h .index-name {
  font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.index-cell-h .index-num {
  font-family: var(--font-num); font-size: 16px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.2px;
  line-height: 1.2; white-space: nowrap;
}
.index-cell-h .index-spark-wrap { height: 22px; margin: 2px 0 0; }
.index-cell-h .index-spark { width: 100%; height: 100%; display: block; }
.index-cell-h .index-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 1px;
}
.index-cell-h .index-foot .index-chg {
  font-family: var(--font-num); font-size: 11px; font-weight: 600;
}
.index-cell-h.up    .index-foot .index-chg { color: var(--red); }
.index-cell-h.down  .index-foot .index-chg { color: var(--green); }
.index-cell-h.flat  .index-foot .index-chg { color: var(--gray3); }
.index-cell-h .index-foot .index-amp {
  font-family: var(--font-num); font-size: 10px; color: var(--gray4);
}

/* 指数 card 底部操作行 */
.indices-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
}
.link-btn {
  border: 1px solid var(--line); background: transparent;
  color: var(--gray2); font-size: 12px; padding: 6px 12px;
  border-radius: 8px; cursor: pointer;
  font-family: var(--font-cn);
  transition: background 0.12s ease, color 0.12s ease;
}
.link-btn:hover { background: #F4F6F8; color: var(--ink); }
.link-btn:active { transform: scale(0.97); }
.link-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.indices-hint { font-size: 10px; color: var(--gray4); }

/* 市场情绪卡：涨跌家数 + 涨跌幅中位数 */
.sentiment-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 4px;
}
.sent-cell {
  background: #FAFBFC; border-radius: 10px; padding: 10px 12px 9px;
  display: flex; flex-direction: column; gap: 2px;
}
.sent-cell .sent-label { font-size: 12px; color: var(--gray3); }
.sent-num {
  font-family: var(--font-num); font-size: 19px; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.2px;
}
.sent-num.up   { color: var(--red); }
.sent-num.down { color: var(--green); }
.sent-num.flat { color: var(--gray3); }
.sent-sub { font-size: 10px; color: var(--gray4); }
.sent-median {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #FFFFFF, #F7F9FB);
}
.sent-median .sent-label { color: var(--ink); font-weight: 500; }
.sent-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--gray4); margin-top: 2px;
}
.sent-live .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  animation: sentPulse 1.6s ease-in-out infinite;
}
@keyframes sentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 老 .index-cell 样式已迁至 .index-cell-h（旧 v2.x 兼容代码清理） */

/* v2.15: .refresh-btn 全删（顶部"刷新行情数据"按钮已去除——与指数卡自带的"刷新指数"按钮重复，用户无感） */

.about-row {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 4px; text-align: center;
}
.about-row span:first-child { font-size: 12px; color: var(--gray3); }
.about-ver { font-size: 11px; color: var(--gray4); }

/* ---------- 实时/收盘价格徽章 ---------- */
.px-badge {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  background: #EEF0F4;
  color: #8A90A6;
  letter-spacing: 0.5px;
}
.px-badge.rt {
  background: #FDE9E7;
  color: #E5453C;
}

/* ============ 访问密码锁屏 ============ */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.25s ease;
}
.lock-screen.hide {
  display: none;
}
.lock-card {
  width: 300px;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 40px rgba(24, 25, 28, 0.10);
}
.lock-logo {
  margin-bottom: 2px;
}
.lock-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-cn);
}
.lock-sub {
  font-size: 12px;
  color: #9AA0A8;
  margin-bottom: 6px;
}
.lock-input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  background: #FAFBFC;
  outline: none;
  text-align: center;
  letter-spacing: 3px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lock-input:focus {
  border-color: var(--red);
  background: #fff;
}
.lock-input::placeholder {
  letter-spacing: 1px;
  color: #C9CCD2;
}
/* 用户名框：不做密码式字距（读起来更自然） */
#lock-user {
  letter-spacing: 1px;
  text-align: center;
}
#lock-password {
  letter-spacing: 3px;
}
.lock-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
  font-family: var(--font-cn);
  transition: opacity 0.15s ease;
}
.lock-btn:hover {
  opacity: 0.92;
}
.lock-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.lock-err {
  font-size: 11px;
  color: var(--red);
  min-height: 14px;
}
.lock-hint {
  font-size: 10px;
  color: #C9CCD2;
  margin-top: 2px;
}

/* ============ v2.3 自选股 分红财报提醒 ============ */
.news-list { min-height: 60px; }
.news-loading {
  display: flex; align-items: center; gap: 8px;
  padding: 22px 0; color: var(--gray3); font-size: 12px; justify-content: center;
}
.news-empty {
  padding: 22px 0; text-align: center; color: var(--gray3); font-size: 12px;
}
.news-error {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 0; color: var(--gray3); font-size: 12px;
}
.news-error-icon { font-size: 22px; }
.news-retry {
  border: 1px solid var(--line); background: #fff; color: var(--red);
  font-size: 12px; padding: 7px 18px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-cn); font-weight: 600;
}
.news-item {
  display: block; padding: 11px 2px;
  border-top: 1px solid #F4F5F7;
}
.news-item:active { background: #FAFBFC; }
.news-title {
  font-size: 13px; color: var(--ink); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta { font-size: 10px; color: var(--gray3); margin-top: 4px; }

/* v2.3 分红财报提醒：类型 chip */
.ann-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
}
.ann-chip {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px; line-height: 1.5;
}
.ann-chip-plan   { background: #FFF0E6; color: #C2410C; }
.ann-chip-impl   { background: #FDECEC; color: #C0392B; }
.ann-chip-adjust { background: #E8F6F6; color: #0E7490; }
.ann-chip-ex     { background: #FFF7E6; color: #B45309; }
.ann-chip-report { background: #EAF0FB; color: #1D4ED8; }
.ann-date { font-size: 10px; color: var(--gray3); }

/* v2.3 公告摘要要点（不跳外链，卡片内展示） */
.ann-points { margin: 7px 0 0; padding: 0; list-style: none; }
.ann-points li {
  position: relative; padding-left: 14px;
  font-size: 12px; color: var(--ink); line-height: 1.55;
}
.ann-points li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red-dim, #E8917F);
}
.ann-summary {
  margin-top: 7px; font-size: 12px; color: var(--gray2, #7A7F85);
  line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ v2.28 设置面板（底部弹层） ============ */
.settings-mask {
  position: fixed; inset: 0; z-index: 980;
  background: rgba(20, 22, 26, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.settings-mask.open { opacity: 1; pointer-events: auto; }
.settings-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 981;
  width: 100%; max-width: 430px; transform: translateX(-50%) translateY(105%);
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(24, 25, 28, 0.16);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.28, 1);
  max-height: 82vh; display: flex; flex-direction: column;
}
.settings-sheet.open { transform: translateX(-50%) translateY(0); }
.sheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-close {
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: var(--bg); color: var(--gray2);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sheet-close:active { background: var(--line); }
.sheet-body {
  flex: 1; overflow-y: auto; padding: 4px 20px calc(24px + env(safe-area-inset-bottom));
}
.set-group { margin-bottom: 18px; }
.set-group-title {
  font-size: 12px; color: var(--gray3); font-weight: 600;
  margin-bottom: 8px; letter-spacing: 0.5px;
}
.set-me-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-radius: 12px; padding: 12px 14px;
}
.set-me-user { font-size: 15px; font-weight: 600; }
.set-me-badge {
  font-size: 11px; padding: 2px 10px; border-radius: 20px;
  background: var(--red-bg); color: var(--red-deep); font-weight: 600;
}
.set-me-badge.is-admin { background: #FDF3D7; color: #A9790A; }
.set-label { font-size: 12px; color: var(--gray2); margin: 8px 2px 5px; }
.set-input {
  width: 100%; height: 40px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 14px; color: var(--ink);
  background: #FAFBFC; outline: none;
}
.set-input:focus { border-color: var(--red); background: #fff; }
.set-btn {
  width: 100%; height: 42px; border: none; border-radius: 12px;
  background: var(--red); color: #fff; font-size: 14px; font-weight: 500;
  cursor: pointer; margin-top: 10px; font-family: var(--font-cn);
}
.set-btn:disabled { opacity: 0.55; cursor: default; }
.set-btn.ghost {
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); font-weight: 500;
}
.set-btn.danger { background: var(--bg); color: var(--red-deep); border: 1px solid var(--red-bg); }
.set-tip { font-size: 11px; color: var(--gray3); margin-top: 8px; line-height: 1.5; }
.set-msg { font-size: 12px; margin-top: 8px; min-height: 0; }
.set-msg.ok { color: var(--green); }
.set-msg.err { color: var(--red); }
.divider { height: 1px; background: var(--line); margin: 4px 0 14px; }
.user-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.user-item:last-child { border-bottom: none; }
.user-item-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.user-item-name .admin-tag {
  font-size: 10px; color: #A9790A; background: #FDF3D7;
  padding: 1px 7px; border-radius: 10px; font-weight: 600;
}
.user-item-op { display: flex; gap: 8px; }
.mini-btn {
  font-size: 12px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--gray2);
}
.mini-btn.danger { color: var(--red-deep); border-color: var(--red-bg); }
.logout-btn {
  width: 100%; height: 46px; border: none; border-radius: 14px;
  background: var(--red-bg); color: var(--red-deep);
  font-size: 15px; font-weight: 600; cursor: pointer;
  margin-top: 6px; font-family: var(--font-cn);
}
@media (max-width: 460px) {
  .settings-sheet { max-width: 100vw; }
}

/* ============ v2.31 邀请码注册（锁屏 + 设置面板） ============ */
.lock-link { color: var(--red); text-decoration: none; font-weight: 600; }
.lock-link:hover { text-decoration: underline; }
#reg-user { letter-spacing: 1px; text-align: center; }
#reg-invite { letter-spacing: 1px; text-align: center; text-transform: uppercase; } /* 邀请码强制大写显示；后端 .upper() 兜底 */
#reg-pwd, #reg-pwd2 { letter-spacing: 3px; }

.inv-head { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.inv-note { font-size: 12px; color: var(--gray2); }
.inv-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 2px; border-bottom: 1px solid var(--line); }
.inv-item:last-child { border-bottom: none; }
.inv-code { font-family: ui-monospace, Consolas, monospace; font-size: 14px; font-weight: 600;
  letter-spacing: 2px; color: var(--ink); }
.inv-code.used { color: var(--gray3); font-weight: 400; }
.inv-meta { font-size: 10px; color: var(--gray3); }
.inv-ops { display: flex; gap: 8px; margin-top: 8px; }
.inv-empty { padding: 10px 0; color: var(--gray3); font-size: 11px; }
