:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-light: #ccfbf1;
  --bg: #f7f3ec;
  --card: #ffffff;
  --text: #292524;
  --text-2: #57534e;
  --line: #eae3d6;
  --line-strong: #ddd2bd;
  --red: #dc2626;
  --green: #059669;
  --amber: #d97706;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(120, 90, 40, 0.07);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.identity-btn {
  background: none; border: none; color: #fff; font: inherit; cursor: pointer;
  padding: 4px 6px; border-radius: 10px; display: flex; align-items: center; gap: 6px;
}
.identity-btn:active { background: rgba(255, 255, 255, .15); }
.identity-caret { font-size: 11px; opacity: .8; }
.brand-logo {
  width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .2);
  display: grid; place-items: center; font-size: 17px;
}
.scope-chip {
  background: rgba(255, 255, 255, .18); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; display: flex; align-items: center; gap: 6px;
}
.scope-chip button { background: none; border: none; color: #fff; font-size: 14px; padding: 0; cursor: pointer; }

.pages { padding: 14px 14px calc(env(safe-area-inset-bottom) + 92px); }
.page { display: flex; flex-direction: column; gap: 12px; }
.page[hidden] { display: none; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
details.card > summary.card-title { margin-bottom: 0; display: flex; align-items: center; justify-content: space-between; }
details.card > summary.card-title::-webkit-details-marker { display: none; }
details.card > summary.card-title::after { content: '▸'; color: #a8a29e; font-size: 12px; transition: transform .2s; }
details.card[open] > summary.card-title::after { content: '▾'; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px -4px; }

/* 语音卡 */
.voice-card { background: linear-gradient(135deg, #ffffff, #f0fdfa); }
.voice-row { display: flex; align-items: center; gap: 14px; }
.mic-btn {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  border: none; cursor: pointer;
  background: var(--teal); color: #fff; font-size: 28px;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .35);
  transition: transform .1s;
}
.mic-btn:active { transform: scale(.94); }
.mic-btn.recording { background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  70% { box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
@keyframes authPop {
  0% { opacity: 0; transform: translateY(12px) scale(.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.voice-text { min-width: 0; flex: 1; }
.voice-status { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.voice-transcript { font-size: 16px; font-weight: 600; color: var(--teal-dark); min-height: 20px; word-break: break-all; }

.quick-row { display: flex; gap: 8px; margin-top: 12px; }
.quick-row input { flex: 1; min-width: 0; }

/* 输入 */
input[type="text"], input[type="number"], input[type="date"], input[type="month"], input[type="search"] {
  border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 12px;
  font-size: 16px; width: 100%; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
.form-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.form-row label { min-width: 48px; flex: none; color: #57534e; font-size: 14px; font-weight: 600; }
.form-row input { flex: 1; }
.form-duo { display: flex; gap: 10px; }
.form-duo .form-row { flex: 1; min-width: 0; }

/* 按钮 */
.btn {
  border: none; border-radius: 10px; padding: 11px 16px; font-size: 15px;
  cursor: pointer; font-weight: 600;
  white-space: nowrap; flex-shrink: 0; /* 按钮文字禁止折行，flex 行内保持完整 */
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:active { background: var(--teal-dark); }
.btn-ghost { background: var(--teal-light); color: var(--teal-dark); border: 1.5px solid #9fe8d8; }
.btn-danger { background: #fef2f2; color: var(--red); }
.btn-block { width: 100%; margin-top: 14px; }
.btn.small, .btn-icon { padding: 7px 12px; font-size: 13px; }
.btn-icon { border: 1px solid var(--line); background: #fafbfb; border-radius: 10px; font-size: 17px; cursor: pointer; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row.wrap { flex-wrap: wrap; }

/* 分段选择 */
.seg { display: flex; background: #f0e9dc; border-radius: 12px; padding: 3px; gap: 2px; }
.seg.small { padding: 2px; }
.seg-item {
  flex: 1; border: none; background: transparent; padding: 9px 0; border-radius: 9px;
  font-size: 14px; color: var(--text-2); cursor: pointer; font-weight: 600;
  transition: background .15s, color .15s;
}
.seg.small .seg-item { padding: 8px 0; font-size: 14px; }
.seg-item.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; box-shadow: 0 2px 6px rgba(15, 118, 110, .3);
}
.range-seg .seg-item { flex: 1; }
#tradesSeg .seg-item { font-size: 12.5px; }

/* ★v668 选股页签栏（7 个标签：盘中实时/周期龙头/观察池/尾盘/维度/龙头/龙虎榜）
 * 问题：.seg-item 默认 flex:1，7 个标签在窄屏（手机）会被压到每格不足 40px，
 *      中文标签折行或被裁切，且点击区域过小很难点中。
 * 方案：改为「按内容宽度排列 + 整行横向滚动」，标签本身不再被压缩；
 *      滚动条隐藏但手势可用，同时保证键盘/读屏仍可聚焦。
 * 桌面端宽度足够时不会溢出，外观与之前一致。 */
.pickseg {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;              /* ★禁止换行，否则移动端会挤成两行 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox 隐藏滚动条 */
  scroll-snap-type: x proximity;
  /* 窄屏时允许标签保持最小可点宽度（约 64px），超出则横向滚动 */
  padding-bottom: 2px;
}
.pickseg::-webkit-scrollbar { display: none; }          /* Chrome/Safari 隐藏滚动条 */
.pickseg .seg-item {
  flex: 0 0 auto;                /* ★关键：不参与等分，按内容宽度 */
  min-width: 64px;
  white-space: nowrap;           /* ★禁止文字折行 */
  padding: 8px 12px;
  scroll-snap-align: start;
}
/* 窄屏下字号略收，避免单个标签就占满一行 */
@media (max-width: 480px) {
  .pickseg .seg-item { min-width: 58px; padding: 7px 10px; font-size: 13px; }
  .pickseg .seg-ico { margin-right: 2px; }
}
/* 桌面端宽度充裕时收紧 padding，让 7 个标签尽量一屏排满、不必滚动 */
@media (min-width: 900px) {
  .pickseg { justify-content: space-between; overflow-x: visible; }
  .pickseg .seg-item { flex: 1 1 auto; min-width: 0; padding: 8px 6px; }
}

/* data-tip 悬浮气泡：position:fixed + JS 挂 body，不被任何 overflow 容器裁掉 */
[data-tip] { cursor: help; }
#__global_tip__ {
  position: fixed; pointer-events: none; z-index: 9999;
  background: #1f2937; color: #fff; font-size: 12px; line-height: 1.6;
  padding: 7px 10px; border-radius: 8px; max-width: 260px; text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); white-space: normal;
  opacity: 0; transform: translateX(-50%); transition: opacity .15s ease;
}
#__global_tip__._show { opacity: 1; }
/* v721：多行提示（含 \n）按行渲染并放宽宽度——用于「得分怎么来的」结构化说明 */
#__global_tip__._multi { white-space: pre-line; max-width: 340px; }
#__global_tip__._below { transform: translateX(-50%); }
#__global_tip__._above::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1f2937;
}
#__global_tip__._below::after {
  content: ''; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #1f2937;
}

/* 历史盈亏可点链接（虚线下划线，点击弹逐笔明细） */
.realized-link { cursor: pointer; text-decoration: underline dotted rgba(120, 113, 108, .75); text-underline-offset: 3px; }
.realized-link:active { opacity: .65; }

/* 金额 */
.amount-row { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; }
.amount-cny { font-size: 26px; font-weight: 700; color: var(--teal); }
.amount-input { border: none !important; background: transparent !important; font-size: 34px; font-weight: 800; width: 100%; padding: 4px 0 !important; }

/* 分类网格 */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 4px; }
.cat-item {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 2px; text-align: center; cursor: pointer; font-size: 12px; color: var(--text-2);
}
.cat-item .cat-emoji { display: block; font-size: 20px; margin-bottom: 2px; }
.cat-item.active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); font-weight: 700; }

/* 解析预览 */
.parse-preview {
  margin-top: 12px; border: 1.5px dashed var(--teal); border-radius: 12px;
  padding: 12px; background: #f0fdfa; font-size: 14px; line-height: 1.9;
}
.parse-preview .pv-big { font-size: 22px; font-weight: 800; color: var(--teal-dark); }
.parse-preview .tag { background: #fff; border-radius: 6px; padding: 1px 8px; margin-right: 6px; color: var(--teal-dark); }
.parse-preview .pv-actions { display: flex; gap: 8px; margin-top: 8px; }

/* 小卡 */
.summary-row { display: flex; gap: 10px; }
.summary-row.three .mini-card { flex: 1; }
.summary-row.three .mini-value { white-space: nowrap; }
.mini-card {
  flex: 1; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px;
}
.mini-label { color: var(--text-2); font-size: 12px; }
.mini-value { font-size: 19px; font-weight: 800; margin-top: 4px; }
.mini-value.expense { color: var(--green); }
.mini-value.income { color: var(--red); }

/* 明细 */
.filter-bar { display: flex; gap: 10px; align-items: center; }
.filter-bar input { flex: none; width: 118px; }
.filter-bar .seg { flex: 1; }
.day-group { margin-top: 12px; }
.day-head {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2);
  padding: 0 4px 6px;
}
.rec-card {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.rec-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-light); display: grid; place-items: center; font-size: 19px; flex: none; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.rec-amt { font-weight: 700; font-size: 15px; white-space: nowrap; }
.rec-amt.expense { color: var(--green); }
.rec-amt.income { color: var(--red); }
.rec-del { background: none; border: none; color: #cbd5e1; font-size: 18px; cursor: pointer; padding: 4px; }
.rec-del:active { color: var(--red); }
.trd-row:hover .rec-del, .trd-row:focus-within .rec-del { display: block !important; }
.empty { text-align: center; color: var(--text-2); padding: 48px 0; font-size: 14px; }

/* 统计条形 */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.bar-name { width: 64px; flex: none; display: flex; align-items: center; gap: 4px; }
.bar-track { flex: 1; height: 10px; background: #f1f5f5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #2dd4bf, var(--teal)); border-radius: 999px; }
.bar-val { width: 78px; text-align: right; flex: none; color: var(--text-2); font-size: 12px; }

.trend-bars { display: flex; align-items: flex-end; gap: 3px; height: 96px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.trend-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.trend-bar { width: 62%; background: var(--teal-light); border-radius: 3px 3px 0 0; }
.trend-col.today .trend-bar { background: var(--teal); }
.trend-labels { display: flex; gap: 3px; margin-top: 4px; }
.trend-label { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; font-size: 9px; line-height: 1; color: #9ca3af; }

.chips-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--text-2); border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.chip:active { background: var(--teal-light); }
.chip.active { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 600; }
.ask-answer { margin-top: 12px; background: #f0fdfa; border-radius: 12px; padding: 14px; }
.ask-headline { font-size: 15px; font-weight: 700; color: var(--teal-dark); line-height: 1.6; }
.ask-rows { margin-top: 8px; }
.ask-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text); padding: 4px 0; border-bottom: 1px dashed #d9f2ec; }
.ask-row:last-child { border-bottom: none; }
.ask-muted { color: var(--text-2); font-size: 12px; margin-top: 8px; }

/* 旅行 */
.trip-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 12px; cursor: pointer; }
.trip-card:active { background: #fafdfc; }
.trip-top { display: flex; justify-content: space-between; align-items: center; }
.trip-name { font-weight: 700; font-size: 16px; }
.trip-date { color: var(--text-2); font-size: 12px; margin-top: 3px; }
.trip-amt { text-align: right; font-size: 13px; color: var(--text-2); }
.trip-amt b { display: block; font-size: 16px; color: var(--text); }
.trip-progress { height: 8px; background: #f1f5f5; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.trip-progress .bar-fill { background: linear-gradient(90deg, #fbbf24, var(--amber)); }
.trip-progress.over .bar-fill { background: linear-gradient(90deg, #f87171, var(--red)); }
.trip-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.budget-grid { display: flex; gap: 8px; margin-top: 10px; }
.budget-grid input { flex: 1; min-width: 0; }
.budget-line { margin: 14px 0; }
.budget-line .b-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.budget-line.over .b-top { color: var(--red); font-weight: 700; }

.hint { color: var(--text-2); font-size: 13px; line-height: 1.8; margin: 0; }
.hint.steps { padding-left: 18px; }
.hint code { background: #f1f5f5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.tab {
  flex: 1; border: none; background: none; padding: 8px 0 7px;
  color: #9ca3af; font-size: 11px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab span { font-size: 20px; filter: grayscale(40%); }
.tab.active { color: var(--teal); font-weight: 700; }
.tab.active span { filter: none; }

/* 成员选择条（记账页） */
.member-bar {
  display: flex; gap: 8px; margin: 12px 0 4px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.member-bar .m-chip {
  display: flex; align-items: center; gap: 4px; flex: none;
  border: 1.5px solid var(--line); background: #fafbfb; border-radius: 999px;
  padding: 7px 14px; font-size: 14px; color: var(--text-2); cursor: pointer; font-weight: 600;
  white-space: nowrap;
}
.member-bar .m-chip.active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }
.member-bar .m-chip .m-emoji { font-size: 16px; }

/* 成员下拉/年份下拉 */
.member-select, .year-select {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font-size: 14px; background: #fafbfb; color: var(--text); flex: none;
  outline: none; cursor: pointer;
}
.member-select { width: 86px; }
.year-select { width: 100px; }

/* 设置页成员列表 */
.member-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: none; }
.member-row .m-emoji { font-size: 24px; }
.member-row .m-name { font-weight: 700; }
.member-row .m-role { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.member-row .m-edit { margin-left: auto; display: flex; gap: 8px; }
.member-row input { width: 80px; padding: 6px 8px; font-size: 14px; }
.member-row select { padding: 6px 8px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }

/* 年度报表 */
.year-summary { display: flex; gap: 10px; margin-bottom: 12px; }

/* ========== 明细并入记账页 ========== */
.list-head { margin: 18px 2px 8px; }
.filter-bar { flex-wrap: wrap; gap: 8px; }

/* 关键字检索 */
.filter-bar.search-bar { margin-top: 4px; }
.filter-bar.search-bar input[type="search"] {
  flex: 1; width: auto; min-width: 0;
  border: 1.5px solid #10b981; border-radius: 8px;
  padding: 7px 10px; font-size: 14px; background: #fff;
}
.filter-bar.search-bar input[type="search"]:focus { outline: none; border-color: #059669; box-shadow: 0 0 0 2px rgba(16,185,129,.18); }
.search-clear {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: #e5e7eb; color: #6b7280; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0;
}
.search-clear:hover { background: #d1d5db; }
.search-summary {
  margin: 8px 2px; padding: 9px 12px;
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
  border: 1px solid #6ee7b7; border-radius: 8px;
  font-size: 13px; color: #064e3b; font-weight: 600;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  box-shadow: 0 1px 3px rgba(16,185,129,.08);
}
.search-summary b { color: #047857; font-size: 14px; }
.search-summary .ss-exp { color: #dc2626; }
.search-summary .ss-inc { color: #16a34a; }
.search-summary .ss-net { color: #2563eb; }

/* ========== 股票模块 ========== */
.summary-row.four { gap: 8px; }
.summary-row.four .mini-card { padding: 10px 8px; min-width: 0; }
.summary-row.four .mini-value { font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-row.four .mini-label { white-space: nowrap; }

.pl-up { color: var(--red); }    /* A 股习惯：红涨 */
.pl-down { color: var(--green); }/* 绿跌 */

.stock-search-wrap { position: relative; margin-bottom: 10px; }
.stock-search-wrap input {
  border: 2px solid var(--line-strong); border-radius: 12px;
  padding: 13px 14px 13px 42px; font-size: 16px; font-weight: 600;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
}
.stock-search-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.ss-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14); overflow: hidden;
}
.ss-item {
  display: flex; gap: 10px; align-items: center; width: 100%;
  border: none; background: #fff; padding: 12px 14px; font-size: 15px;
  cursor: pointer; text-align: left;
}
.ss-item:active { background: var(--teal-light); }
.ss-code { color: var(--teal-dark); font-weight: 700; min-width: 64px; }
.ss-name { color: var(--text); }

.stock-picked {
  background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a;
  border-radius: 12px; padding: 10px 12px;
  font-size: 14px; margin-bottom: 10px;
}
.stock-form-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
/* 交易填单区：默认只显示买入/卖出切换条，点击后下拉展开（grid 高度过渡动画） */
.stock-form-body {
  display: grid; grid-template-rows: 1fr; opacity: 1;
  transition: grid-template-rows .28s ease, opacity .2s ease;
}
.stock-form-body.collapsed { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.stock-form-inner { overflow: hidden; min-height: 0; }
.stock-collapse-btn {
  display: block; width: 100%; margin-top: 6px; padding: 8px;
  background: none; border: none; cursor: pointer;
  color: #a8a29e; font-size: 13px;
}
.stock-collapse-btn:active { color: var(--teal); }
select {
  border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 10px;
  font-size: 16px; background: #fff; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
select:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }

/* 股票信息（新闻） */
.news-toolbar { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 6px; margin: 10px 0 0; overflow: hidden; }
/* ★v729：持仓头部工具栏允许换行（窄屏时 PNL / 同步 / AI 按钮整行掉到下一行完整显示，不挤压截断） */
.news-toolbar.pos-tools { flex-wrap: wrap; overflow: visible; }
.news-toolbar .hint { margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-toolbar .btn { flex: none; }
/* 今日盈亏大数字 */
.day-pnl-wrap { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0; min-width: 0; overflow: hidden; }
.day-pnl-wrap .pnl-label { font-size: 11px; color: var(--muted,#7b7063); white-space: nowrap; }
.day-pnl-wrap .pnl-btn { background: none; border: none; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.2; }
.day-pnl-wrap .pnl-amt { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.day-pnl-wrap .pnl-pct { font-size: 12px; font-weight: 700; margin-left: 2px; }
.news-list { margin-top: 4px; }
.news-item { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.news-item:last-child { border-bottom: none; }
.news-item:active { background: #fffbeb; border-radius: 8px; }
.news-time { flex: none; min-width: 72px; color: var(--text-2); font-size: 12px; line-height: 1.35; padding-top: 3px; }
.news-body { min-width: 0; flex: 1; }
.news-title {
  font-size: 14px; line-height: 1.5; color: var(--text); word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-sub { margin-top: 3px; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 600; background: var(--teal-light); color: var(--teal-dark);
  vertical-align: 1px;
}
.news-tag.imp { background: #fee2e2; color: var(--red); }
/* 资讯情感：利好红 / 利空绿 / 中性黑（标题整行着色，标签胶囊描边） */
.news-sent {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; vertical-align: 1px;
  border: 1.5px solid currentColor; background: transparent;
}
.news-s-good .news-title { color: var(--red); }
.news-s-bad .news-title { color: var(--green); }
.news-s-neutral .news-title { color: var(--text); }
.news-sent.good { color: var(--red); }
.news-sent.bad { color: var(--green); }
.news-sent.neutral { color: var(--text-2); border-color: var(--line-strong); }

.pos-card {
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  position: relative;
}
/* 「可买入」对角水印：仅交易机会卡里现价在买入区间内、可立即执行的标的显示。
   镂空描边字：红色粗描边够显眼，笔画中间镂空，不遮住底下的文字 */
.buy-wm {
  position: absolute; right: -8px; top: -4px;
  transform: rotate(16deg);
  font-size: 38px; font-weight: 900; letter-spacing: 5px;
  color: rgba(220, 38, 38, .04);
  -webkit-text-stroke: 2.5px rgba(220, 38, 38, .6);
  text-shadow: 0 0 1px rgba(220, 38, 38, .2);
  pointer-events: none; user-select: none; white-space: nowrap; line-height: 1;
  z-index: 1;
}
.pos-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 1px; align-items: baseline; }
/* 评分曲线 tab 专用：两行两列严格对齐（不影响持仓卡等其他 .pos-top） */
.pos-top.score-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; }
.pos-top.score-top .pt-row1-name { grid-column: 1; grid-row: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pos-top.score-top .pt-row1-adv  { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.pos-top.score-top .pt-row2-meta { grid-column: 1; grid-row: 2; min-width: 0; }
.pos-top.score-top .pt-row2-btn  { grid-column: 2; grid-row: 2; display: flex; justify-content: flex-end; }
.pos-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
/* ★v729：持仓卡标题行拆两行——第一行 名称+代码+信号灯(持有)，第二行 打标+板块 chip 整行换行显示 */
.pos-title-line { display: inline; }
.pos-sig-slot { margin-left: 6px; flex: none; }
.pos-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; align-items: center; }
.pos-tags .chip { margin: 0; }
.pos-meta { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-realized { grid-column: 1 / -1; }
/* 🛟 跑路提醒：跌破止损价 / 涨到目标价的持仓卡 → 红底闪烁加粗（底色自带，深浅主题均醒目） */
.pos-card.pos-alert-flee, .pos-card.pos-alert-take {
  border: 2px solid #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}
.pos-alert {
  grid-column: 1 / -1;
  margin-top: 7px; padding: 7px 11px; border-radius: 9px;
  background: #dc2626; color: #fff;
  font-weight: 800; font-size: 13.5px; line-height: 1.5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.pos-alert .pa-sub { font-weight: 600; font-size: 11.5px; opacity: .93; white-space: nowrap; }
.pos-alert-blink { animation: posFlash .85s ease-in-out infinite; }
@keyframes posFlash {
  0%, 100% { background: #dc2626; }
  50% { background: #7f1d1d; }
}
@media (prefers-reduced-motion: reduce) { .pos-alert-blink { animation: none; } }
.pos-flee-line { font-size: 12px; margin-top: 3px; cursor: default; }
/* 🎖️ 每日纪律分横幅：绿=满分/无买入 黄=轻度扣分 红=重度扣分，点击展开明细与规则 */
.disc-banner {
  margin: 8px 2px 0; border-radius: 12px; padding: 9px 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
}
.disc-banner.disc-warn { background: #fffbeb; border-color: #fde68a; }
.disc-banner.disc-bad { background: #fef2f2; border-color: #fecaca; }
.disc-banner .disc-row { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; flex-wrap: wrap; }
.disc-banner .disc-main { font-weight: 800; font-size: 14px; color: #b91c1c; white-space: nowrap; flex-shrink: 0; }
.disc-banner .disc-streak { flex-shrink: 0; white-space: nowrap; font-size: 13px; color: #b91c1c; font-weight: 700; }
.disc-banner .disc-main b { font-size: 19px; }
.disc-banner.disc-warn .disc-main { color: #b91c1c; }
.disc-banner.disc-bad .disc-main { color: #b91c1c; }
/* 分数序列涨红跌绿（股民配色） */
.disc-banner .disc-sub .sc-up { color: #dc2626; font-weight: 700; }
.disc-banner .disc-sub .sc-down { color: #059669; font-weight: 700; }
.disc-banner .disc-sub { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disc-banner .disc-arrow { font-size: 11px; color: var(--text-2); flex-shrink: 0; transition: transform .15s; }
.disc-banner.open .disc-arrow { transform: rotate(180deg); }
.disc-banner .disc-detail { margin-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); padding-top: 7px; font-size: 12.5px; line-height: 1.9; color: var(--text); }
.disc-banner .disc-h { font-weight: 800; font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.disc-banner .disc-vio { color: #b91c1c; font-weight: 700; }
.disc-banner .disc-vio-d { font-weight: 400; color: var(--text-2); padding-left: 14px; }
.disc-banner .disc-ok { color: #047857; font-weight: 700; }
/* 纪律口号大字行（横幅最顶，折叠也可见；统一红色醒目） */
.disc-banner .disc-motto {
  font-size: 17px; font-weight: 800; letter-spacing: .5px;
  color: #b91c1c; flex-shrink: 0; white-space: nowrap;
}
.disc-banner .disc-rules { color: var(--text-2); display: flex; flex-wrap: wrap; gap: 3px 0; }
/* 每条扣分规则做成 chip：虚线下划线提示可悬停看解释 */
.disc-banner .disc-rule {
  border-bottom: 1px dashed rgba(0,0,0,.25); cursor: help;
  padding: 0 1px;
}
.disc-banner .disc-rule + .disc-rule::before { content: ' ｜ '; color: rgba(0,0,0,.18); border-bottom: none; cursor: default; }
.disc-banner .disc-days { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.disc-banner .disc-days .good { color: #047857; }
.disc-banner .disc-days .bad { color: #b91c1c; font-weight: 700; }
.pos-cost { font-weight: 800; font-size: 16px; color: var(--text); }
/* 🎯 统一裁决条：多提示仲裁后的一句话指令（纪律价 > 卖出信号 > 评分） */
.verdict-strip {
  margin: 8px 0 2px; padding: 7px 10px; border-radius: 8px;
  background: #ecfdf5; border: 1px solid #a7f3d0;
  font-size: 12.5px; line-height: 1.5;
}
.verdict-strip.verdict-warn { background: #fffbeb; border-color: #fde68a; }
.verdict-strip .verdict-cmd { display: block; font-weight: 800; color: #047857; }
.verdict-strip.verdict-warn .verdict-cmd { color: #b45309; }
.verdict-strip .verdict-sub { display: block; font-size: 10.5px; color: var(--text-2); margin-top: 1px; }
/* 📋 今日开盘预案卡（高低开 → 隔日纪律动作） */
.plan-card {
  margin: 8px 2px 0; border-radius: 12px; padding: 9px 12px;
  background: #eff6ff; border: 1px solid #bfdbfe;
}
.plan-card.plan-warn { background: #fffbeb; border-color: #fde68a; }
.plan-card.plan-bad { background: #fef2f2; border-color: #fecaca; }
.plan-card .plan-head { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.plan-card .plan-main { font-weight: 800; font-size: 14px; color: #1e40af; white-space: nowrap; flex-shrink: 0; }
.plan-card.plan-warn .plan-main { color: #92400e; }
.plan-card.plan-bad .plan-main { color: #991b1b; }
.plan-card .plan-sub { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-card .plan-arrow { font-size: 11px; color: var(--text-2); flex-shrink: 0; transition: transform .15s; }
.plan-card.open .plan-arrow { transform: rotate(180deg); }
.rv-card.open .plan-arrow { transform: rotate(180deg); }
.plan-card .plan-body { margin-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); padding-top: 7px; }
.plan-item { padding: 5px 0; border-bottom: 1px dashed rgba(0,0,0,.08); }
.plan-item:last-of-type { border-bottom: none; }
.plan-item .plan-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; min-width: 0; }
.plan-item .plan-name { font-weight: 800; }
.plan-item .plan-op { font-weight: 700; padding: 0 6px; border-radius: 8px; font-size: 11.5px; background: rgba(0,0,0,.06); white-space: nowrap; }
.plan-item .plan-ctx { color: var(--text-2); font-size: 11.5px; }
.plan-item .plan-act { font-size: 13px; font-weight: 700; line-height: 1.5; margin-top: 2px; }
.plan-item .plan-why { font-size: 10.5px; color: var(--text-2); font-weight: 400; margin-left: 5px; vertical-align: 1px; }
.plan-item.plan-bad .plan-act { color: #b91c1c; }
.plan-item.plan-warn .plan-act { color: #b45309; }
.plan-item.plan-ok .plan-act { color: #047857; }
.plan-item.plan-muted .plan-act { color: var(--text-2); font-weight: 500; }
.plan-card .plan-note { margin-top: 6px; font-size: 11px; color: var(--text-2); line-height: 1.6; }
/* 📋 今日交易复盘卡 */
.rv-card {
  margin: 8px 2px 0; border-radius: 12px; padding: 9px 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
}
.rv-card .rv-head { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.rv-card .rv-main { font-weight: 800; font-size: 14px; color: #166534; white-space: nowrap; flex-shrink: 0; }
.rv-card .rv-sub { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-card .rv-body { margin-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); padding-top: 7px; }
.rv-card .rv-section { margin-bottom: 8px; }
.rv-card .rv-section:last-of-type { margin-bottom: 4px; }
.rv-card .rv-sec-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.rv-card .rv-sec-title .hint { font-weight: 400; font-size: 11px; }
.rv-card .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rv-card .dot.buy { background: #dc2626; }
.rv-card .dot.sell { background: #16a34a; }
.rv-card .dot.hold { background: #2563eb; }
.rv-card .rv-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; line-height: 1.6; flex-wrap: wrap; }
.rv-card .rv-name { font-weight: 700; white-space: nowrap; }
.rv-card .rv-shares { color: var(--text-2); white-space: nowrap; }
.rv-card .rv-price { color: var(--text-2); white-space: nowrap; }
.rv-card .rv-amt { font-weight: 700; white-space: nowrap; }
.rv-card .rv-rz { font-weight: 700; white-space: nowrap; }
.rv-card .rv-unt-pl { margin-left: auto; font-weight: 700; white-space: nowrap; }
.rv-card .rv-sum { margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(0,0,0,.08); font-size: 12px; font-weight: 700; text-align: right; }
.rv-card .rv-foot { margin-top: 6px; font-size: 10.5px; color: var(--text-2); line-height: 1.6; }
/* AI 复盘按钮与结果区 */
.rv-card .rv-ai-btn {
  flex-shrink: 0; padding: 2px 8px; font-size: 11px; font-weight: 700;
  background: #16a34a; color: #fff; border: none; border-radius: 10px;
  cursor: pointer; line-height: 1.6;
}
.rv-card .rv-ai-btn:active { opacity: .7; }
.rv-card .rv-ai-result { margin-top: 8px; }
.rv-card .rv-ai-loading {
  padding: 10px; text-align: center; font-size: 12px; color: var(--text-2);
  background: rgba(255,255,255,.5); border-radius: 8px;
}
.rv-card .rv-ai-box {
  padding: 10px 12px; background: #fff; border-radius: 8px;
  border: 1px solid #bbf7d0; font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; color: var(--text);
}
.rv-card .rv-ai-error {
  padding: 10px; text-align: center; font-size: 12px; color: #dc2626;
  background: #fef2f2; border-radius: 8px; border: 1px solid #fecaca;
}
.pos-amt { text-align: right; font-size: 14px; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.pos-price { font-size: 15px; }
.pos-amt .hint { font-weight: 400; }
@media (max-width: 430px) {
  .pos-meta { font-size: 12px; }
  .pos-cost { font-size: 15px; }
  .pos-pl { font-size: 13px; line-height: 1.3; }
  .pl-pct { display: block; font-size: 11.5px; font-weight: 600; }
  .pos-price { font-size: 14px; line-height: 1.3; }
  /* 选股区5页签：缩字号+紧凑padding，强制单行不折行 */
  #pickSeg { gap: 1px; }
  #pickSeg .seg-item { font-size: 12.5px; padding: 7px 2px; white-space: nowrap; }
}
@media (max-width: 380px) {
  /* 超窄屏：隐藏页签 emoji 再挤一档，保证5个全显示 */
  #pickSeg .seg-item { font-size: 12px; padding: 7px 1px; }
  #pickSeg .seg-ico { display: none; }
}

.trd-list { background: #fff; border-radius: 14px; overflow: hidden; }
.trd-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}
.trd-row:last-child { border-bottom: none; }
.trd-side {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.trd-buy { background: #fef2f2; color: var(--red); }
.trd-sell { background: #ecfdf5; color: var(--green); }
.trd-main { flex: 1; min-width: 0; }
.fit-line { white-space: nowrap; overflow: hidden; }
.rv-sum { font-size: 11px; color: var(--hint, #8a8f98); padding: 0 2px 6px; }
.trd-title { font-weight: 600; font-size: 14px; }
/* ★v729：交易记录持仓卡标题——名称+代码一行，打标 chip / 见顶 / 止损 徽标独占下一行完整展示 */
.trd-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; align-items: center; }
.trd-tags .chip, .trd-tags .tw-badge { margin: 0; }
.trd-amt { font-weight: 700; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.trd-member {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: #fdf3e3; color: #9a6b1f; border: 1px solid #ecd9b8;
  border-radius: 999px; font-size: 11px; font-weight: 500; vertical-align: 1px;
}

/* 交易记录四页签：固定高度滚动 + 点击展开明细 */
.trd-scroll { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.trd-stock { cursor: pointer; }
.trd-stock:active { background: #fffbeb; }
.trd-chev { flex: none; color: var(--text-2); font-size: 11px; }
.trd-detail { background: #faf8f4; padding: 2px 12px 6px; }
/* 明细行：金额与日期首行平齐；模式核对独占整行宽度（flex-wrap），不再被金额列挤窄 */
.trd-detail .trd-row { padding: 9px 2px; align-items: flex-start; flex-wrap: wrap; row-gap: 3px; }
.trd-detail .trd-amt { margin-top: 1px; }
.trd-detail .mc-toggle, .trd-detail .mc-body { flex-basis: 100%; }
.trd-detail .mc-body { padding-left: 2px; }
.trd-detail .rec-del { width: 26px; height: 26px; font-size: 12px; }

/* 已清仓交易复盘：得分区间筛选条 + 卡片头部整轮按钮 + 卖出明细行 mini 入口 */
.rv-filter { display: flex; gap: 4px; padding: 2px 4px 8px; }
.rv-filter .chip { flex: 1; text-align: center; font-size: 10px; padding: 2px 0; white-space: nowrap; }
.rv-btn {
  flex: none; white-space: nowrap; padding: 3px 10px; border-radius: 999px;
  border: 1px solid #d8cfc2; background: #faf7f1; color: var(--text-2);
  font-size: 11px; line-height: 1.4; cursor: pointer;
}
.rv-btn:active { background: #f3ede2; }
.rv-btn b { color: var(--red); font-size: 12px; margin-left: 2px; }
.rv-btn.rv-done { border-color: #f0b8b8; background: #fff5f5; color: #b91c1c; }
.rv-mini {
  flex: none; white-space: nowrap; font-size: 10px; font-weight: 600;
  color: var(--teal); border: 1px solid #bfe6dc; background: #f0faf7;
  border-radius: 999px; padding: 1px 8px; cursor: pointer; margin-top: 2px;
}
.rv-mini:active { background: #dff2ec; }

/* 复盘评分弹层（限定在弹层内，避免与「今日交易复盘」卡的 .rv-head 类名冲突） */
#sheetBody .rv-head {
  display: flex; gap: 14px; align-items: center;
  background: #faf7f1; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.rv-score {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff; background: #94a3b8;
}
.rv-score.g5 { background: var(--red); }
.rv-score.g4 { background: #ea580c; }
.rv-score.g3 { background: #d97706; }
.rv-score.g2 { background: #0f766e; }
.rv-score.g1 { background: var(--green); }
.rv-head-info { min-width: 0; flex: 1; }
.rv-grade { font-size: 16px; font-weight: 800; margin-bottom: 2px; }
.rv-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.rv-fact {
  background: #faf7f1; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0;
}
.rv-fact .hint { font-size: 10.5px; }
.rv-dims { margin-top: 12px; }
.rv-dim { margin-bottom: 11px; }
.rv-dim-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.rv-bar { height: 8px; border-radius: 999px; background: #f0ebe0; overflow: hidden; }
.rv-bar i { display: block; height: 100%; border-radius: 999px; }
#sheetBody .rv-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
#sheetBody .rv-sub b { color: #3d3730; }
.rv-note { border-radius: 10px; padding: 8px 11px; font-size: 13px; line-height: 1.6; margin-bottom: 6px; background: #f8fafc; border: 1px solid var(--line); }
.rv-note.good { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.rv-note.bad { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.rv-note.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.rv-lot { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 7px; }
.rv-lot-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.rv-lot-h > span:last-child { text-align: right; }
.rv-ms { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; margin-right: 5px; white-space: nowrap; }
.rv-ms.ms-good { background: #fef2f2; color: #b91c1c; }
.rv-ms.ms-bad { background: #ecfdf5; color: #047857; }
.rv-cat { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: #fdf3e3; color: #9a6b1f; white-space: nowrap; }
.rv-sellsum { background: #faf7f1; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 14px; }
@media (max-width: 380px) {
  .rv-facts { grid-template-columns: repeat(2, 1fr); }
  .rv-score { width: 56px; height: 56px; font-size: 23px; }
}

/* 历史交易导入 */
#stockSheet textarea, #impText {
  border: 1px solid #d8cfc2; border-radius: 10px; padding: 8px 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: #3d3730;
  box-sizing: border-box;
}
#impFile { font-size: 13px; color: var(--text-2); }
.imp-summary {
  background: #f0faf7; border: 1px solid #bfe6dc; border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; line-height: 1.6; margin-bottom: 8px;
}
.imp-err {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; color: #b91c1c; line-height: 1.6;
}
.imp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 420px; }
.imp-table th, .imp-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.imp-table th { background: #faf7f1; color: var(--text-2); font-weight: 600; text-align: left; }
.imp-table tr:last-child td { border-bottom: none; }
.imp-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.imp-stat-grid > div {
  background: #faf7f1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
.imp-stat-grid .mini-value { font-size: 16px; font-weight: 800; margin-top: 2px; }
.imp-stat-grid .mini-value .hint { font-size: 12px; font-weight: 400; }

/* 五维选股榜 */
.scan-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.scan-row:last-child { border-bottom: none; }
.scan-row:active { background: var(--teal-light); }
.watch-add-btn:hover, .watch-del-btn:hover { opacity: 1 !important; transform: scale(1.15); }
/* 观察池排序 */
.watch-row { position: relative; transition: box-shadow .15s; }
.watch-drag {
  flex: none; align-self: center; cursor: grab; color: var(--text-2);
  font-size: 16px; line-height: 1; padding: 8px 2px; letter-spacing: -2px; opacity: .45;
  touch-action: none;
}
.watch-drag:active { cursor: grabbing; }
.watch-row.dragging { opacity: .4; }
.watch-row.drop-before { box-shadow: inset 0 3px 0 0 var(--teal); }
.watch-row.drop-after { box-shadow: inset 0 -3px 0 0 var(--teal); }
.watch-move-btn, .watch-del-btn {
  border: none; background: none; font-size: 13px; cursor: pointer;
  padding: 2px 5px; opacity: .5; line-height: 1.2;
}
.watch-move-btn:hover, .watch-del-btn:hover { opacity: 1; }
.watch-move-btn:disabled { opacity: .15; cursor: default; }
.scan-rank {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: #f1f5f5; color: #64748b; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.scan-row:nth-child(1) .scan-rank,
.scan-row:nth-child(2) .scan-rank,
.scan-row:nth-child(3) .scan-rank { background: #fef3c7; color: #b45309; }
.scan-main { flex: 1; min-width: 0; }
.scan-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
/* 观察池卡片标题行：强制单行 + JS自动缩字号 */
.watch-title { display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; font-size: 14px; line-height: 1.5; }
.watch-title .watch-pct { margin-left: auto; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
/* 观察池卡片详情行：默认ellipsis截断，点击展开换行 */
.watch-detail { font-size: 12px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: all .15s; }
.watch-detail.expanded { white-space: normal; overflow: visible; text-overflow: clip; cursor: default; }
.scan-score {
  font-weight: 800; font-size: 20px; min-width: 40px; text-align: right;
  flex-shrink: 0; font-variant-numeric: tabular-nums;
}

/* ★v742（T32）V3 全市场排行：强势/中性/偏弱三档底纹
   设计意图：一屏扫过就能分出「该看哪几行」，不用逐行读分数。
   · 强势（≥70）：淡红底 + 左侧红条 —— A股红=强；实证正期望区，视觉最重
   · 中性（55~70）：淡琥珀底 + 左条 —— 可观察但不主动
   · 偏弱（<55）：无底色 + 灰左条 —— 默认弱化，避免噪音 */
.v3-row { border-left: 3px solid transparent; }
.v3-row.v3--good {
  background: linear-gradient(90deg, #fef2f2 0%, #fff 62%);
  border-left-color: #dc2626;
}
.v3-row.v3--neutral {
  background: linear-gradient(90deg, #fffbeb 0%, #fff 62%);
  border-left-color: #f59e0b;
}
.v3-row.v3--bad { border-left-color: #e2e8f0; }
.v3-row.v3--good .scan-rank { background: #fee2e2; color: #b91c1c; }
.v3-row.v3--neutral .scan-rank { background: #fef3c7; color: #b45309; }
.v3-lv-tag {
  font-size: 10px; line-height: 1.7; padding: 1px 6px; border-radius: 999px;
  margin-left: 5px; vertical-align: middle; white-space: nowrap;
}
.v3--good .v3-lv-tag { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.v3--neutral .v3-lv-tag { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.v3--bad .v3-lv-tag { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.v3-ind {
  font-size: 11px; color: #94a3b8; font-weight: 500; margin-left: 6px;
  max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
/* 七维迷你条：量能/涨停/动量/资金/技术/板块 六根小条，悬浮有完整说明 */
.v3-dims {
  display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 4px;
  font-size: 9px; line-height: 1.4;
}

/* 短线·一夜持股 */
.short-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.short-tag {
  font-size: 11px; line-height: 1.7; padding: 1px 8px; border-radius: 999px;
  background: #f0fdfa; color: var(--teal-dark); border: 1px solid #99f6e4; white-space: nowrap;
}
.short-tag.hot { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.short-tag.zt { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.short-tag.ok { background: #ecfdf5; color: var(--green); border-color: #a7f3d0; }

/* 龙头股分层折叠 */
.dragon-layer { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.dragon-layer-head {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer;
  font-size: 13px; font-weight: 700; list-style: none; user-select: none;
}
.dragon-layer-head::-webkit-details-marker { display: none; }
.dragon-layer-head::before { content: '▶'; font-size: 9px; color: var(--text-2); transition: transform .15s; }
.dragon-layer[open] .dragon-layer-head::before { transform: rotate(90deg); }
.dragon-layer-icon { font-size: 14px; }
.dragon-layer-count { font-size: 12px; color: var(--text-2); font-weight: 600; }
.streak-hi > .dragon-layer-head { background: #fef2f2; }
.streak-mid > .dragon-layer-head { background: #fff7ed; }
.streak-new > .dragon-layer-head { background: #f0fdfa; }
.dragon-layer-body { padding: 0; }
.streak-badge {
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
  margin-left: 4px; vertical-align: middle; white-space: nowrap;
}
.streak-badge.streak-hi { background: #fee2e2; color: var(--red); }
.streak-badge.streak-mid { background: #ffedd5; color: #c2410c; }
.dragon-scan-date { font-size: 11px; color: var(--text-2); margin-top: 4px; }

/* 规则说明/统计摘要折叠（选股模块四个标签页共用） */
/* ══════ ★v653 策略中心：单一入口 Tab ══════
   原来 7 个平铺折叠区信息过载、找不到重点，改为 4 个聚焦 Tab */
.trk-tabs {
  display: flex; gap: 4px; margin: 8px 0 10px; overflow-x: auto;
  border-bottom: 2px solid var(--line); padding-bottom: 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.trk-tabs::-webkit-scrollbar { display: none; }
.trk-tab {
  flex: 1 1 auto; min-width: max-content; white-space: nowrap;
  border: none; background: transparent; cursor: pointer;
  padding: 8px 11px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  border-radius: 8px 8px 0 0; transition: color .15s, border-color .15s;
}
.trk-tab:hover { color: var(--text-1); background: var(--bg-soft); }
.trk-tab.active {
  color: var(--teal); border-bottom-color: var(--teal);
  font-weight: 700;
}
.trk-pane { animation: trkFade .16s ease-out; }
@keyframes trkFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .trk-pane { animation: none; } }

.trk-verdict:empty { display: none; }

.info-fold { border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.info-fold > summary {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
  font-size: 12px; color: var(--text-2); font-weight: 600; list-style: none; user-select: none;
  background: var(--bg-soft);
}
.info-fold > summary::-webkit-details-marker { display: none; }
.info-fold > summary::before {
  content: '▶'; font-size: 9px; color: var(--text-2); transition: transform .15s;
}
.info-fold[open] > summary::before { transform: rotate(90deg); }
.info-fold > summary:hover { color: var(--text); }
.info-fold > *:not(summary) { padding: 4px 12px; }

/* 买入分析弹层 */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-panel {
  background: #fff; width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px);
}
.sheet-loading { text-align: center; padding: 48px 10px; font-weight: 700; }
.gain-flash { background: #fff4e5 !important; border-radius: 8px; transition: background .3s; }
.gain-tap { background: rgba(5,150,105,.12); border-radius: 8px; }
/* 涨幅榜：第一行三下拉+刷新，第二行搜索+涨跌榜 */
.gain-filter-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.gain-filter-row select {
  flex: 1 1 0; min-width: 0; padding: 7px 4px;
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--text); background: #fff;
}
.gain-filter-row #gainRefresh { flex: none; padding: 7px 10px; font-size: 13px; }
.gain-action-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.gain-action-row #gainSearch {
  flex: 1 1 auto; min-width: 0; padding: 7px 10px;
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); background: #fff;
}
.gain-action-row .chip { flex: none; padding: 7px 9px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
/* 搜索定位：红框闪烁两轮 */
@keyframes gainLocateFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); outline: 2px solid rgba(220,38,38,0); }
  15%, 55% { box-shadow: 0 0 0 3px rgba(220,38,38,.45); outline: 2px solid rgba(220,38,38,.95); outline-offset: 1px; background: rgba(220,38,38,.08); border-radius: 6px; }
}
.gain-locate-flash { animation: gainLocateFlash 1.5s ease 2; }
.an-head { display: flex; justify-content: space-between; align-items: center; }
.an-name { font-size: 18px; font-weight: 800; }
.an-price { font-size: 15px; font-weight: 700; margin-top: 4px; }
.an-score { display: flex; align-items: baseline; gap: 2px; }
.an-score-num { font-size: 40px; font-weight: 900; line-height: 1; }
.an-score-max { font-size: 14px; color: var(--text-2); }
.an-level {
  border-radius: 12px; padding: 10px 12px; margin: 12px 0;
  display: flex; flex-direction: column; gap: 3px;
}
.an-level span { font-size: 13px; font-weight: 400; color: var(--text); }
.an-dim {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; background: #fff;
}
.an-dim.is-green { border-left-color: #16a34a; }
.an-dim.is-yellow { border-left-color: #d97706; }
.an-dim.is-red { border-left-color: #dc2626; }
.an-dim.is-gray { border-left-color: #94a3b8; }
.an-dim-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.an-dim-score { color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
/* v711：七维总览（自适应换行网格，非单行拥挤；每格=维度名+分+进度条，点击下方卡片看逐项依据） */
.an-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 8px 12px; margin: 2px 0 12px; padding: 10px 12px; background: rgba(15,118,110,0.05); border: 1px solid var(--line); border-radius: 10px; }
.an-ov { font-size: 12px; min-width: 0; }
.an-ov-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.an-ov-name { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-ov-score { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.an-ov-bar { height: 6px; background: rgba(0,0,0,0.08); border-radius: 4px; overflow: hidden; }
.an-ov-bar i { display: block; height: 100%; border-radius: 4px; transition: width .25s; }
.an-texts { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.an-texts li { margin: 3px 0; line-height: 1.45; }
/* v688：维度得分表格（分项/明细/得分/来源；紧凑单行排版，防换行溢出）
 *  · table-layout:fixed + 固定窄列（分项/得分/来源）→ 明细列占满剩余宽度
 *  · 所有单元格 nowrap + ellipsis：每行单行完整展示，不换行不溢出；
 *    被截断的完整文案通过 title 悬浮查看（dimTableHtml 已加 title）
 *  · 得分列 tabular-nums 等宽数字，同维度内各指标格式严格一致（一位小数裸分） */
.an-tbl { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 11.5px; table-layout: fixed; }
.an-tbl th { text-align: left; font-size: 10.5px; color: var(--text-2); font-weight: 600; padding: 2px 4px 3px 0; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-tbl td { padding: 3px 4px 3px 0; border-bottom: 1px dashed var(--line); line-height: 1.55; vertical-align: top; white-space: normal; word-break: break-word; }
.an-tbl tr:last-child td { border-bottom: none; }
.an-tbl-hit { width: auto; }
.an-tbl-name { font-weight: 600; }
/* ★v730：得分列 nowrap 必须压过 .an-tbl td 的「white-space:normal;word-break:break-word」
 *   （td 选择器特异性 0,1,1 高于 .an-tbl-score 的 0,1,0，原 nowrap 被覆盖 → "20.0" 的 ".0" 被折行）。
 *   改用 td.an-tbl-score 提升特异性，并把 /满分 一并锁 nowrap，彻底杜绝换行。 */
.an-tbl td.an-tbl-score { font-weight: 700; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; min-width: 54px; padding-right: 2px; }
.an-tbl-max { font-size: 9px; color: var(--text-2); font-weight: 600; margin-left: 1px; white-space: nowrap; }
.an-tbl-sum td { border-top: 1px solid var(--line); border-bottom: none; font-weight: 700; background: rgba(0, 0, 0, 0.03); }
.an-tbl-note { color: var(--text-2); font-size: 11px; white-space: normal; }
.an-tip { margin-top: 6px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
/* v713：所属板块标签云（维①后）+ 龙头标识徽标（维②后） */
/* ★v730：左侧 accent 强调「所属板块」与上方板块周期维度的归属关系，呼应「板块须正确关联板块周期」 */
.an-boards { margin: 8px 0 4px 2px; padding: 8px 10px; background: rgba(37,99,235,0.05); border: 1px solid var(--line); border-left: 3px solid var(--accent, #2563eb); border-radius: 10px; }
.an-boards-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.an-boards-n { display: inline-block; min-width: 16px; text-align: center; font-size: 11px; padding: 0 5px; border-radius: 8px; background: var(--accent, #2563eb); color: #fff; margin-left: 2px; }
.an-boards-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.an-board-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: default; }
.an-board-tag small { font-size: 10px; font-weight: 500; color: var(--text-2); }
.an-board-tag.an-board-main { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.an-board-tag.an-board-main small { color: #2563eb; }
.an-dragon-tag { margin: 8px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; border-radius: 999px; border: 1px solid transparent; }
.an-tag-leader { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
/* v727：候选龙头（维②得分达标但 5 日涨幅未进板块前 3）——橙色虚线，区别于实心金「龙头」 */
.an-tag-candidate { background: #fff7ed; border-color: #fdba74; border-style: dashed; color: #9a3412; }
.an-tag-follow { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.an-tag-other { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.an-tag-note { font-size: 11px; color: var(--text-2); }
/* v724：维度标题后的档位文案（分数区间与前端标签 → 标签 + 前端提示文案）+ 跨维度联动警示
 *   位置由用户指定：紧贴维度标题（标题行下方一行），维②龙头标识徽标也并入此行（原挂在维度块下方，位置不对）。 */
.an-dim-hint { margin: 3px 0 7px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; font-size: 12px; line-height: 1.55; color: var(--text-2); }
.an-dim-band { flex: none; display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(15,118,110,0.10); color: #0f766e; border: 1px solid rgba(15,118,110,0.22); }
.an-dim-band-prompt { flex: 1 1 200px; min-width: 0; word-break: break-word; }
.an-dim-hint-warn { font-weight: 600; color: #b45309; }
.an-dim-hint .an-dragon-tag { margin: 0; flex: none; }
/* v725：维②龙头辨识只展示「龙头标识」——其分数档位与龙头标识语义重叠，同屏会重复且可能矛盾 */
.an-dim-hint-dragon { align-items: center; }
/* ★v730：维② 龙头辨识 之后新增「板块内按当日涨幅排名」展示项 */
.an-dim-hint-rank { margin: 4px 0 8px; }
.an-dim-hint-rank .an-dim-band { background: rgba(37,99,235,0.10); color: #1d4ed8; border-color: rgba(37,99,235,0.22); }
.an-dim-hint-rank b { color: #1d4ed8; }
.an-dim-hint-rank-rest { margin: 0 0 8px; }
.an-dim-linkage { flex: 1 1 100%; margin-top: 2px; font-size: 11.5px; line-height: 1.55; color: #92400e; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 8px; padding: 4px 8px; }
/* v687：龙虎榜折叠模块（默认收起；强势股绿色描边 + 认证徽章） */
.an-toplist summary { cursor: pointer; font-weight: 700; user-select: none; list-style: none; }
.an-toplist summary::-webkit-details-marker { display: none; }
.an-toplist summary::after { content: '▾'; float: right; color: var(--text-2); font-weight: 400; }
.an-toplist[open] summary::after { content: '▴'; }
.an-toplist summary:hover { color: var(--accent, #2563eb); }
.an-toplist-strong { border-color: #86efac; background: #f0fdf4; }
.an-toplist-strong summary { color: #166534; }
.an-strong-tag { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 4px; background: #dcfce7; color: #166534; border: 1px solid #86efac; font-weight: 700; vertical-align: middle; }
/* v686：评分完整性横幅默认折叠（单行标题 + 点击下拉），不占初始界面 */
.an-miss-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer; user-select: none; }
.an-miss-head:hover { background: #fef3c7; }
.an-miss-head:active { background: #fde68a; }
.an-miss-body { padding: 6px 10px 8px; border-top: 1px dashed rgba(245, 158, 11, 0.4); font-size: 12px; line-height: 1.7; }
/* ★v726 数据口径横幅：开口先讲清「这些分数是哪一天的、什么口径、还差几项」 */
.an-data-bar { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0; padding: 6px 9px;
  border-radius: 8px; font-size: 12px; line-height: 1.5; color: var(--text-2);
  background: rgba(15, 118, 110, 0.08); border: 1px solid rgba(15, 118, 110, 0.20); }
.an-data-bar .an-data-ico { flex: none; }
.an-data-bar .an-data-txt { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.an-data-bar b { color: #0f766e; }
.an-data-bar.is-prev { background: #fffbeb; border-color: #fcd34d; }
.an-data-bar.is-prev b { color: #b45309; }
.an-meta { margin: 10px 2px; font-size: 12px; }
.an-disclaimer { margin: 8px 2px 12px; font-size: 12px; line-height: 1.5; }
.year-summary .mini-card { flex: 1; padding: 10px; }
.year-summary .mini-label { font-size: 11px; }

/* 股票投资账本 · 头部大数（激励风格：盈利暖色庆祝 / 亏损冷静蓄力） */
.sl-hero {
  --pnl: var(--red);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 18px 18px 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #f8fafc);
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.sl-hero.sl-win {
  background: linear-gradient(135deg, #fff7f0, #ffe7dc);
  border-color: #ffd3c0;
  box-shadow: 0 4px 16px rgba(219, 68, 55, 0.12);
}
.sl-hero.sl-lose {
  background: linear-gradient(135deg, #f0faf5, #e0f4ea);
  border-color: #c8ead6;
  box-shadow: 0 4px 16px rgba(16, 150, 100, 0.10);
}
.sl-hero::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--pnl); border-radius: 5px 0 0 5px;
}
.sl-hero-label {
  font-size: 15px; font-weight: 800; letter-spacing: 2px;
  color: var(--text-2);
}
.sl-hero-amt {
  font-size: clamp(32px, 10vw, 40px); font-weight: 900; line-height: 1;
  color: var(--pnl); white-space: nowrap; letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.sl-hero.sl-win .sl-hero-amt { text-shadow: 0 2px 12px rgba(219, 68, 55, 0.20); }
.sl-hero.sl-lose .sl-hero-amt { text-shadow: 0 2px 12px rgba(16, 150, 100, 0.16); }
/* 鼓励语：居中胶囊，柔和强调 */
.sl-boost {
  margin-top: 12px; text-align: center;
  font-size: 13.5px; font-weight: 700; color: #0f766e;
  padding: 9px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa, #e4f6f0);
  border: 1px dashed #99e0cf;
}
.sl-today {
  font-size: 13.5px; font-weight: 800; white-space: nowrap;
  padding: 4px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(120, 90, 40, 0.06);
}
.sl-today-idle { color: var(--text-2); background: #faf8f3; }
.year-summary .mini-value { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.year-months { display: flex; align-items: flex-end; gap: 3px; height: 100px; }
.year-months .ym-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; justify-content: flex-end; height: 100%; }
.year-months .ym-bar { width: 100%; background: linear-gradient(180deg, #2dd4bf, var(--teal)); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.year-months .ym-x { font-size: 9px; color: #9ca3af; }
.year-months .ym-val { font-size: 8px; color: var(--text-2); max-width: 100%; overflow: hidden; }
.year-section { margin-top: 14px; }
.year-section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }

/* 分析建议 */
.analysis-tip {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 0;
  font-size: 14px; line-height: 1.7; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.analysis-tip:last-child { border-bottom: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: rgba(17, 24, 39, .9); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 14px; z-index: 100; max-width: 84%; text-align: center;
}

/* 持仓五维评分与卖出建议 */
.pos-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.pos-good { background: #e3f4ed; color: #0f766e; border: 1px solid #9ed8c6; }
.pos-warn { background: #fdf3e0; color: #b45309; border: 1px solid #ecd39b; }
.pos-bad  { background: #fdebea; color: #b91c1c; border: 1px solid #f3b8b5; }
.pos-adv  { margin-top: 4px; font-size: 13px; color: #6b5d4f; line-height: 1.5; }
.pos-adv .chance-score-b { font-weight: 800; color: #4a3f33; }

/* 策略跟踪：四个操作按钮紧凑一行（等宽撑满，不改全局 .btn） */
.trk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.trk-actions .btn {
  flex: 1 1 0; min-width: 0;
  padding: 8px 4px; font-size: 13px; border-radius: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 策略跟踪：日期导航一行 + 说明文字下一行 */
.trk-daybar { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 10px 0 8px; }
.trk-day-row { display: flex; align-items: center; gap: 8px; }
.trk-day-row .btn { padding: 7px 14px; font-size: 13px; border-radius: 9px; white-space: nowrap; }
.trk-day-date {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-size: 14px; color: #4a3f33;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trk-day-note { font-size: 11px; text-align: center; }

/* 每日信号·模式筛选条 */
.trk-filter { display: flex; gap: 5px; flex-wrap: nowrap; margin: 8px 0 2px; overflow-x: auto; }
.trk-filter::-webkit-scrollbar { display: none; }
.trk-filter-chip {
  font-size: 10px; padding: 4px 8px; border-radius: 999px; flex: 1 1 0;
  border: 1px solid var(--line, #e0d8c8); background: #fff; color: #6b5f4e;
  white-space: nowrap;
}
.trk-filter-chip b { font-weight: 700; margin-left: 2px; }
.trk-filter-chip.active { background: #0f766e; border-color: #0f766e; color: #fff; }
.trk-filter-chip.zero { opacity: .5; }

/* 豆包持仓分析 */
.ai-result {
  white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: #3d3730;
  background: #fffaf2; border: 1px solid #ecd9b8; border-radius: 12px;
  padding: 12px 14px; margin: 10px 0; max-height: 52vh; overflow-y: auto;
}
#stockSheet textarea:focus { outline: none; border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }

/* 策略跟踪独立页：信号框占满整行宽度（卡片化后无需横滑，仅纵向滚动） */
#page-picktrack { min-width: 0; }
#page-picktrack > * { min-width: 0; }
#page-picktrack #pickTrackCover { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.trk-sig-box {
  width: 100%; max-width: 100%;
  background: #fff; border-radius: 14px;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.trk-sig-table { border-collapse: collapse; width: max-content; font-size: 11px; }
.trk-sig-table th, .trk-sig-table td { white-space: nowrap; padding: 3px 6px; }
.trk-sig-table thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.trk-sig-table thead th:first-child { border-top-left-radius: 14px; }
.trk-sig-table thead th:last-child { border-top-right-radius: 14px; }
.trk-sig-table th:nth-child(2),
.trk-sig-table td:nth-child(2) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* —— 策略跟踪：信号卡片（窄屏完整显示，不用再横滑找列；作用域 #page-picktrack） —— */
.trk-cards { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trk-card { border: 1px solid var(--line, #e8e2d4); border-radius: 10px; padding: 6px 8px; background: #fff; min-width: 0; }
.trk-card-top { display: flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; }
.trk-mode-badge { font-size: 10px; font-weight: 700; color: #0f766e; background: #e6f5f2; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.trk-lvs { display: inline-flex; gap: 3px; }
.trk-lv { font-size: 9px; white-space: nowrap; }
.trk-lv-done { color: #15803d; }
.trk-lv-pending { color: #b45309; }
.trk-lv-idle { color: #bbb; }
.trk-card-score { font-size: 12px; }
.trk-card-name { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.trk-name-link { cursor: pointer; }
.trk-name-link:active { opacity: .6; }
.trk-name-ico { font-size: 11px; font-weight: 400; }
.trk-card-flags { font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 1px; }
.trk-card-settle { display: flex; margin-top: 5px; padding-top: 4px; border-top: 1px dashed var(--line, #e8e2d4); }
.trk-set-cell { flex: 1 1 0; min-width: 0; text-align: center; padding: 0 1px; }
.trk-set-cell .k { display: block; font-size: 9px; color: var(--text-3, #9a9082); }
.trk-set-cell .v { display: block; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* —— 盈亏弹窗·月度总览（同花顺风格月历：日期下写当日金额） —— */
.m-ov-head { cursor: pointer; padding-top: 8px; font-weight: 700; font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; }
.m-ov-body { margin-top: 6px; }
.m-ov-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; }
.m-ov-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.m-ov-dow { text-align: center; font-size: 10px; color: var(--text-3, #9a9082); }
.m-cell { border-radius: 6px; padding: 3px 1px 4px; text-align: center; min-height: 37px; }
.m-cell .d { font-size: 11px; color: var(--text-2, #7b7063); }
.m-cell .a { display: block; font-size: 9.5px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.m-cell.up { background: rgba(220, 38, 38, .09); }
.m-cell.down { background: rgba(5, 150, 105, .09); }
.m-cell.rest .a { color: #c3bbae; font-weight: 400; }
.m-cell.future .d { color: #d8d2c6; }
.m-cell.today { outline: 1.5px solid #0f766e; }
.m-cell.clickable { cursor: pointer; }
.m-cell.clickable:active { opacity: .6; }

/* —— 选股共振提示条带：独立一行，胶囊左对齐自动换行（取代挤在标题行右侧的旧布局） —— */
.overlap-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 2px 12px; }
.overlap-bar:empty { display: none; margin: 0; }
.ov-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 4px 12px;
  font-size: 12px; font-weight: 800; line-height: 1.4; white-space: nowrap;
  cursor: default; max-width: 100%;
}
.ov-pill.ov-tri { color: #b91c1c; background: #fef2f2; border: 1.5px solid #fca5a5; }
.ov-pill.ov-duo { color: #111827; background: #fff; border: 1.5px solid #d1d5db; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ov-pill .ov-code { font-weight: 700; color: #9a9082; font-size: 11px; }
.ov-pill .ov-combo { font-size: 10.5px; font-weight: 700; opacity: .7; }
.ov-pill .ov-zone { color: #0f766e; font-weight: 800; }
.ov-pill.ov-tri .ov-zone { color: #b91c1c; }
/* 窄屏：胶囊允许内部信息压缩但不折行；单条过长时独占整行 */
@media (max-width: 480px) {
  .ov-pill { font-size: 11.5px; padding: 4px 10px; gap: 4px; }
  .ov-pill .ov-code { font-size: 10.5px; }
}

/* —— 三张选股列表卡片上的买入区间（与共振条带同口径：20日线 ~ 20日线×1.042） —— */
.buy-zone {
  display: inline-block; white-space: nowrap;
  font-size: 11px; font-weight: 800; color: #0f766e;
  background: #f0fdfa; border: 1px solid #5eead4; border-radius: 6px;
  padding: 1px 7px; margin-left: 5px;
}
.buy-zone[data-bz-pending] { display: none; }

/* ============================================================
 * 多端适配（v645）
 *
 * 此前布局是纯移动优先单列：.app 锁死 480px 居中，桌面/平板只是「拉宽的手机版」，
 * 两侧大片留白；且没有任何 min-width 断点，横屏平板体验明显是妥协方案。
 * manifest 曾锁 orientation:portrait，平板被强制竖屏，v645 起已解除。
 * ============================================================ */

/* 基准字号随系统字号设置缩放：原先全用固定 px，用户调大系统字体会直接撑破布局 */
:root { font-size: 16px; }

/* 平板：放宽内容区，避免大屏上字小行窄的「望远镜观感」 */
@media (min-width: 720px) {
  .app { max-width: 720px; }
  .tabbar { max-width: 720px; }
  .pages { padding: 18px 20px calc(env(safe-area-inset-bottom) + 100px); }
  .page { gap: 14px; }
  .tab { font-size: 12px; padding: 10px 0 9px; }
}

/* 桌面：转为「导航侧栏 + 内容区」的双栏，避免底部横条在鼠标操作下够不着 */
@media (min-width: 1024px) {
  body { background: #eef1f2; }
  .app { max-width: 1160px; }

  .tabbar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    transform: none;
    width: 208px; max-width: 208px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    padding: 84px 12px 20px;
    border-top: none;
    border-right: 1px solid var(--line);
    box-shadow: 1px 0 3px rgba(0, 0, 0, .04);
  }
  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
  }
  .tab span { font-size: 18px; filter: none; }
  .tab.active { background: var(--teal); color: #fff; }
  .tab.active span { filter: brightness(0) invert(1); }

  /* 内容区让出侧栏宽度 */
  .app { margin-left: 208px; }
  .pages { padding: 20px 24px 40px; }
  .topbar { padding-left: 24px; padding-right: 24px; }

  /* 顶栏原本是全宽吸顶，会被左侧栏压住 —— 让它只覆盖内容区 */
  .topbar { left: 208px; width: auto; }
}

/* 超宽屏：内容不至于无限拉长行长，影响可读性 */
@media (min-width: 1440px) {
  .pages > .page { max-width: 1000px; margin: 0 auto; }
}

/* 横屏手机：内容区留出底部导航高度，并防止顶栏遮挡 */
@media (max-height: 500px) and (orientation: landscape) {
  .pages { padding-top: 10px; }
  .tabbar { padding-top: 2px; }
  .tab { padding: 5px 0 4px; }
  .tab span { font-size: 17px; }
}

/* 无障碍：尊重「减少动态效果」的系统设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 七维评分体系页（v695） ===== */
/* 单元格文本允许换行，不限制单行；行列统一虚线分隔；层次分明 */
.seven-toc {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  background: #fff; border: 1px dashed var(--line-strong); border-radius: 12px;
  margin-bottom: 12px;
}
.seven-toc-link {
  font-size: 12px; color: var(--teal-dark); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
  background: #fafbfb; white-space: nowrap;
}
.seven-toc-link b { color: var(--teal); }
.seven-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.seven-section-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.seven-tbl {
  border-collapse: separate; border-spacing: 0;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: #fff; margin: 10px 0; width: 100%;
}
.seven-tbl th, .seven-tbl td {
  border: 1px dashed var(--line);
  padding: 10px 12px; vertical-align: top; text-align: left;
  /* 单元格文本换行：不限制单行 */
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  font-size: 13px; color: var(--text); line-height: 1.65;
}
.seven-tbl th { background: #f6f8fa; font-weight: 700; color: var(--text-2); }
.seven-tbl tbody tr:nth-child(even) td { background: #fcfdfe; }
.seven-tbl tbody tr:hover td { background: #f3f9f8; }
.seven-badge {
  display: inline-block; min-width: 22px; text-align: center; color: #fff;
  border-radius: 8px; padding: 2px 7px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.seven-chip {
  display: inline-block; margin: 2px 4px 2px 0; font-size: 11.5px;
  color: var(--teal-dark); background: var(--teal-light);
  border: 1px solid #9fe8d8; border-radius: 999px; padding: 2px 8px;
}
.seven-ind { margin-top: 6px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.seven-rule { margin: 3px 0; line-height: 1.6; }
.seven-rule .seven-badge { margin-right: 6px; }
.seven-note { color: var(--text-2); font-size: 12px; }
.seven-fallback {
  margin-top: 10px; border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: 10px 12px; background: #f3f6fb; color: #334155; font-size: 12.5px; line-height: 1.7;
}
.seven-band { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.seven-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.seven-dim {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 0; margin-bottom: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.seven-dim-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: #fff; }
.seven-dim-icon { font-size: 20px; }
.seven-dim-name { font-size: 15px; font-weight: 800; flex: 1; }
.seven-dim-max { font-size: 12px; background: rgba(255,255,255,.22); border-radius: 999px; padding: 2px 10px; }
.seven-dim-summary { padding: 10px 14px; font-size: 13px; color: var(--text-2); line-height: 1.8; }
.seven-sub-title { padding: 10px 14px 0; font-size: 13px; font-weight: 700; color: var(--teal-dark); }
.seven-dim .seven-tbl { margin: 8px 14px 12px; width: calc(100% - 28px); }
.seven-changelog {
  white-space: pre-wrap; word-break: break-word; font-size: 12px;
  color: var(--text-2); line-height: 1.7; background: #f6f8fa;
  border-radius: 10px; padding: 10px 12px; margin: 0;
}

/* 备案号页脚（工信部要求：备案号悬挂在网站底部，可点击跳转备案管理系统 beian.miit.gov.cn） */
.site-footer {
  text-align: center;
  padding: 12px 12px 4px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: calc(56px + env(safe-area-inset-bottom));
}
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
@media (min-width: 1024px) {
  .site-footer { margin-bottom: 24px; }
}
