* { box-sizing: border-box; }

html { overflow-x: hidden; }

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --green: #16a34a;
  --amber: #d97706;
  --violet: #7c3aed;
  --red: #dc2626;
  --text: #1f2937;
  --text-soft: #6b7280;
  --border: #e5e7eb;
  --bg: #f1f5f9;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ============ 顶栏 ============ */
header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(30, 64, 175, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-inner {
  max-width: none;
  margin: 0 auto;
  padding: 18px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.brand p { margin: 4px 0 0; font-size: 13px; opacity: 0.85; }
.settings { display: flex; gap: 10px; flex-wrap: wrap; }
.settings button {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s;
}
.settings button:hover { background: rgba(255, 255, 255, 0.25); }
.settings button.primary { background: #fff; color: var(--primary-dark); border-color: #fff; font-weight: 600; }
.settings button.primary:hover { background: #f0f5ff; }
.statusbar { max-width: none; margin: 0 auto; padding: 0 24px 10px; }
.muted { color: rgba(255, 255, 255, 0.8); font-size: 12px; }

/* ============ 主区 ============ */
main { max-width: none; margin: 24px auto; padding: 0 24px 60px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============ 计划单设置 ============ */
.planconfig { padding: 18px 20px; margin-bottom: 18px; }
.planconfig h2 { margin: 0 0 14px; font-size: 16px; color: var(--primary-dark); }
.planconfig-row { display: flex; gap: 20px; flex-wrap: wrap; }
.planconfig-row label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.planconfig-row input {
  width: 140px;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: 0.15s;
}
.planconfig-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.planconfig-row select { padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); }
.planconfig-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.seg-group { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 9px; overflow: hidden; background: #fff; }
.seg-opt { display: inline-flex; align-items: center; padding: 8px 16px; cursor: pointer; font-size: 14px; color: var(--text-soft); transition: 0.15s; }
.seg-opt + .seg-opt { border-left: 1px solid #d1d5db; }
.seg-opt input { display: none; }
.seg-opt:has(input:checked) { background: var(--primary); color: #fff; font-weight: 600; }
.seg-opt:hover:not(:has(input:checked)) { background: var(--primary-light); }
.seg-expand, .seg-back { display: inline-flex; align-items: center; padding: 8px 16px; cursor: pointer; font-size: 14px; color: var(--text-soft); background: #fff; border: none; transition: 0.15s; }
.seg-expand + .seg-opt, .seg-back + .seg-opt, .seg-opt + .seg-expand, .seg-opt + .seg-back { border-left: 1px solid #d1d5db; }
.seg-back { color: var(--primary); font-weight: 600; }

/* ============ 轮次卡片 ============ */
.round {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.round-2 { border-left-color: var(--green); }
.round-3 { border-left-color: var(--amber); }
.round-4 { border-left-color: var(--violet); }
.round-5 { border-left-color: var(--red); }

.round-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.round-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; padding: 5px 14px;
  border-radius: 8px;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 14px;
}
.round-2 .round-badge { background: var(--green); }
.round-3 .round-badge { background: var(--amber); }
.round-4 .round-badge { background: var(--violet); }
.round-5 .round-badge { background: var(--red); }

.tag {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.round-2 .tag { color: var(--green); background: #f0fdf4; }
.round-3 .tag { color: var(--amber); background: #fffbeb; }
.round-4 .tag { color: var(--violet); background: #f5f3ff; }
.round-5 .tag { color: var(--red); background: #fef2f2; }

.row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.field { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.row select {
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  min-width: 300px;
  background: #fff;
  color: var(--text);
}
.row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.match-info { color: var(--text); font-size: 14px; font-weight: 500; }

/* ============ 结果选择 chips ============ */
.outcomes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.outcome {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: 0.15s;
}
.outcome input { display: none; }
.outcome span { color: var(--text); }
.outcome em { font-style: normal; font-weight: 700; color: var(--primary); font-size: 14px; }
.outcome:hover { border-color: #93c5fd; }
.outcome:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.outcome:has(input:checked) span { color: var(--primary-dark); }
.outcome.disabled { opacity: 0.35; cursor: not-allowed; }

/* ============ 每轮结果 ============ */
.result {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  font-size: 14px;
  line-height: 2;
}
.result .r { margin-right: 16px; white-space: nowrap; }
.result .r b { color: var(--primary-dark); }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); }
.warn {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}

/* ============ 计划单 ============ */
#summary { margin-bottom: 18px; }
#summary.open { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); padding: 20px; }
.sheet-head { position: relative; margin-bottom: 16px; }
.sheet-head h2 { margin: 0 0 6px; font-size: 18px; color: var(--primary-dark); }
.sheet-head .meta { color: var(--text-soft); font-size: 14px; padding-right: 110px; }
.sheet-head .btn-sm {
  position: absolute; top: 0; right: 0;
  padding: 6px 14px; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--primary); color: var(--primary);
  background: #fff; border-radius: 6px; cursor: pointer;
}
.sheet-head .btn-sm:hover { background: #eff6ff; }
#summary table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#summary th, #summary td { border: 1px solid var(--border); padding: 9px 8px; text-align: center; }
#summary th { background: #eff6ff; color: var(--primary-dark); font-weight: 600; }
#summary tbody tr:nth-child(even) { background: #fafafa; }
#summary tbody tr:hover { background: #f0f7ff; }
#summary tr.warn td { color: #92400e; }
#summary td.left { text-align: left; }
#summary p { color: var(--text-soft); font-size: 13px; margin-top: 14px; }
#summary table.mini { width: 100%; border-collapse: collapse; margin: 0; }
#summary table.mini td { border: 1px solid #cbd5e1; text-align: center; padding: 4px 6px; white-space: nowrap; }
#summary table.mini td.code { background: #f8fafc; color: var(--text-soft); font-size: 12px; }
#summary table.mini td.odds { background: #fff; color: var(--primary-dark); font-weight: 600; font-size: 14px; }
#summary table.mini td.amt { background: #fff; color: var(--red); font-weight: 700; font-size: 15px; }
.grand { margin-top: 16px; font-size: 17px; font-weight: 600; text-align: right; }
.grand b { color: var(--red); font-size: 20px; }

/* ============ 已保存计划 ============ */
#saved { padding: 0; }
#viewPlan { padding-left: 0 !important; padding-right: 0 !important; }
#saved h2 { margin: 0 0 12px; font-size: 16px; color: var(--primary-dark); display: flex; align-items: center; gap: 12px; }
.saved-filter {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.saved-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 15px;
}
.si-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; cursor: pointer; }
.si-num { font-weight: 700; color: var(--primary-dark); font-size: 14px; white-space: nowrap; }
.si-teams { display: block; font-weight: 600; color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; max-width: 100%; }
.si-score { color: var(--primary); font-weight: 700; font-size: 14px; white-space: nowrap; }
.si-score.si-pending { color: var(--text-soft); font-weight: 500; }
.si-btns { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; }
.si-icon { display: inline-flex; align-items: center; justify-content: center; padding: 5px; -webkit-appearance: none; appearance: none; border: none; background: none; color: #94a3b8; cursor: pointer; }
.si-icon:hover { color: var(--red); }
.si-icon svg { width: 20px; height: 20px; }
.saved-hit { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--primary-dark); background: rgba(37, 99, 235, 0.08); border: 1px solid rgba(37, 99, 235, 0.22); white-space: nowrap; }
.saved-result { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #047857; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35); white-space: nowrap; }
.strat-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; white-space: nowrap; }
.strat-tag.play { background: #eef4ff; color: #2563eb; border-color: #c7d8fe; }
.si-main .strat-tag { margin-right: 16px; }

/* 查看下拉框：投注明细 */
.saved-detail {
  margin: 0 0 16px 24px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.saved-detail-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.saved-detail-head b { font-size: 15px; color: var(--primary-dark); }
.saved-detail-meta { color: var(--text-soft); font-size: 13px; }
.saved-detail-loading { color: var(--text-soft); text-align: center; padding: 16px; }
.saved-detail table { width: 100%; border-collapse: collapse; font-size: 13px; }
.saved-detail th, .saved-detail td { border: 1px solid var(--border); padding: 8px 7px; text-align: center; }
.saved-detail th { background: #eff6ff; color: var(--primary-dark); font-weight: 600; }
.saved-detail tbody tr:nth-child(even) { background: #fafafa; }
.saved-detail tbody tr:hover { background: #f0f7ff; }
.saved-detail tr.warn td { color: #92400e; }
.saved-detail td.left { text-align: left; }
.saved-detail td.res { white-space: nowrap; }
.saved-detail table.mini { width: 100%; border-collapse: collapse; margin: 0; }
.saved-detail table.mini td { border: 1px solid #cbd5e1; text-align: center; padding: 3px 5px; white-space: nowrap; }
.saved-detail table.mini td.code { background: #f8fafc; color: var(--text-soft); font-size: 12px; }
.saved-detail table.mini td.odds { background: #fff; color: var(--primary-dark); font-weight: 600; font-size: 13px; }
.saved-detail table.mini td.amt { background: #fff; color: var(--red); font-weight: 700; font-size: 14px; }
.saved-detail .grand { margin-top: 12px; font-size: 15px; font-weight: 600; text-align: right; }
.saved-detail .grand b { color: var(--red); font-size: 17px; }
.res-score { margin-left: 6px; font-size: 13px; font-weight: 600; vertical-align: middle; }
.res-pend { color: #94a3b8; font-weight: 400; }

/* ============ 场次搜索选择器 ============ */
.match-picker { position: relative; flex: 1; min-width: 300px; }
.match-search {
  width: 100%; padding: 9px 52px 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; color: var(--text);
}
.match-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.match-search::-webkit-search-cancel-button,
.match-search::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.match-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 30;
}
.match-dropdown.open { display: block; }
.match-dd-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.match-dd-item:hover { background: var(--primary-light); }
.match-dd-item .dd-main { color: var(--text); font-weight: 500; }
.match-dd-item .dd-time { color: var(--text-soft); white-space: nowrap; }
.match-dd-empty { padding: 12px; color: var(--text-soft); text-align: center; font-size: 13px; }
.match-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 3px 8px; border: none; border-radius: 5px; background: #f1f5f9; color: var(--text-soft); cursor: pointer; font-size: 12px; }
.match-clear:hover { background: #fee2e2; color: var(--red); }

/* ============ 轮次卡片：选择场次 + 微调进球（合并界面） ============ */
.matchpick { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 4px 0 18px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.play-switch { margin-bottom: 10px; position: sticky; top: 42px; z-index: 15; background: var(--bg); padding: 4px 0; }
.play-switch .seg { display: flex; width: 100%; }
.play-switch .seg-opt, .play-switch .seg-expand { flex: 1; justify-content: center; text-align: center; }
.play-switch .seg-back { flex: 0 0 auto; justify-content: center; padding: 8px 12px; font-size: 13px; }
.follow-pick { width: 100%; padding: 13px; font-size: 16px; margin: 4px 0 14px; border-radius: 10px; border: none; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.follow-pick:hover { background: var(--primary-dark); }
.matchpick h2 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.round-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: #fbfdff; }
.round-card:last-child { margin-bottom: 0; }
.round-card-head { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; }
.match-block { margin-bottom: 12px; }
.match-block:last-child { margin-bottom: 0; }
.match-block-search { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.match-block-label { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--primary-dark); min-width: 40px; }
.match-block-info { font-size: 13.5px; font-weight: 600; color: #94a3b8; min-height: 18px; margin-bottom: 8px; }
.match-block-info.on { color: var(--green); }
.hit-rate { margin-left: 8px; color: var(--primary); font-weight: 700; }
.novalue { margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; color: #94a3b8; font-size: 11px; font-weight: 600; white-space: nowrap; }
.match-search:disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }
.match-clear:disabled { opacity: 0.4; cursor: not-allowed; }

/* 计划单里可编辑的「本轮总额」输入框 */
.total-edit { width: 82px; padding: 5px 8px; border: 1px solid #93c5fd; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--primary-dark); text-align: center; background: #fff; }
.total-edit:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }

/* ============ 底部操作栏 ============ */
.action-bar { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); flex-wrap: wrap; }
.action-bar label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.action-bar select { padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); }
.action-bar input { padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; width: 140px; background: #fff; color: var(--text); }
.action-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.action-bar .hint { font-size: 12px; color: var(--text-soft); }
.action-bar button { padding: 10px 22px; border-radius: 9px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text); transition: 0.15s; }
.action-bar button:hover { border-color: var(--primary); color: var(--primary); }
.action-bar button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.action-bar button.primary:hover { background: var(--primary-dark); }

/* 胜平负自动推荐组合 */
.recommend-panel { margin: 0 0 18px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.recommend-panel h2 { margin: 0 0 12px; font-size: 16px; color: var(--primary-dark); }
.recommend-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rc-sec-title { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; }
.rc-sec-title:not(:first-child) { margin-top: 18px; }
.rc-refresh { padding: 4px 12px; border: 1px solid var(--primary); border-radius: 6px; background: #fff; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.recommend-combo { padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.recommend-combo .rc-title { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.rc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.recommend-combo .rc-leg { font-size: 13px; color: var(--text); margin: 3px 0; }
.recommend-combo .rc-leg b { color: var(--primary-dark); }
.recommend-combo .rc-prob { font-size: 12px; color: #16a34a; font-weight: 600; }
.rc-save { padding: 5px 12px; border: none; border-radius: 6px; background: #16a34a; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.rc-save:hover { background: #15803d; }
.recommend-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.recommend-actions button { padding: 10px 22px; border-radius: 9px; border: 1px solid #16a34a; cursor: pointer; font-size: 14px; font-weight: 600; }
.recommend-actions button.primary { background: #16a34a; border-color: #16a34a; color: #fff; }
.recommend-actions button.primary:hover { background: #15803d; }
.matchpick-tools { display: flex; gap: 8px; margin: 0 0 12px; }
.matchpick-tools button { padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; font-size: 13px; }
.matchpick-tools button:hover { border-color: var(--primary); color: var(--primary); }
.round-card-head { display: flex; align-items: center; }
.tier-badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.5; margin-left: 8px; white-space: nowrap; }
.tier-badge.tier-major { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tier-badge.tier-minor { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.summary-filter { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.summary-filter .muted { font-size: 12px; color: #9ca3af; }
.sum-league { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.sum-league .tier-badge { margin-left: 4px; }
.round-del { margin-left: auto; padding: 3px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: var(--text-soft); cursor: pointer; font-size: 12px; }
.round-del:hover { border-color: var(--red); color: var(--red); }
.flat-warn { margin: 12px 0; padding: 10px 14px; border-left: 3px solid #f59e0b; background: #fffbeb; color: #92400e; font-size: 13px; line-height: 1.6; border-radius: 6px; }
#flatTest.open { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); padding: 20px; margin-bottom: 18px; }

/* ============ 计划单操作 ============ */
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.sheet-actions button { padding: 9px 20px; border-radius: 9px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); transition: 0.15s; }
.sheet-actions button:hover { border-color: var(--primary); color: var(--primary); }
.sheet-actions button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.sheet-actions button.primary:hover { background: #15803d; }

/* ============ AI 分析结论 ============ */
.ai-notes { margin: 14px 0; border: 1px solid #dbeafe; background: #eff6ff; border-radius: 10px; padding: 12px 16px; }
.ai-notes .ai-note { font-size: 13.5px; line-height: 1.9; color: #1e3a8a; }
.ai-notes .ai-note b { color: var(--primary-dark); }
.ai-notes .ai-total { font-weight: 700; border-bottom: 1px solid #dbeafe; padding-bottom: 6px; margin-bottom: 6px; }

/* ============ 顶部导航 ============ */
.settings .nav.active { background: #fff; color: var(--primary-dark); border-color: #fff; font-weight: 700; }

/* ============ 数据看板（深色金融风） ============ */
body.dash-mode { background: #0a0f1e; }
body.dash-mode .statusbar .muted { color: rgba(255, 255, 255, 0.55); }
.dash { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; color: #e2e8f0; }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-title h2 { margin: 0; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.dash-sub { font-size: 13px; color: #64748b; }
.dash-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.dash .seg { background: #0f1a2e; border-color: #1e2a3f; }
.dash .seg-opt { color: #94a3b8; }
.dash .seg-opt + .seg-opt { border-left-color: #1e2a3f; }
.dash .seg-opt:has(input:checked) { background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff; }
.dash .seg-opt:hover:not(:has(input:checked)) { background: #16233b; }

#dashRefresh, #btnVbRefresh, #btnSmRefresh { padding: 9px 18px; border-radius: 9px; border: 1px solid #1e2a3f; background: #0f1a2e; color: #7dd3fc; cursor: pointer; font-size: 14px; font-weight: 600; transition: 0.15s; }
#dashRefresh:hover, #btnVbRefresh:hover, #btnSmRefresh:hover { border-color: #22d3ee; color: #22d3ee; }
#btnSmSave { padding: 9px 18px; border-radius: 9px; border: 1px solid #10b981; background: #10b981; color: #052e1b; cursor: pointer; font-size: 14px; font-weight: 700; transition: 0.15s; }
#btnSmSave:hover { background: #34d399; }
.dash-filter-wrap { display: inline-flex; align-items: center; gap: 6px; }
.dash-confirm { padding: 9px 16px; border-radius: 9px; border: 1px solid #1e2a3f; background: #0f1a2e; color: #94a3b8; cursor: pointer; font-size: 14px; font-weight: 600; transition: 0.15s; }
.dash-confirm:hover { border-color: #22d3ee; color: #7dd3fc; }
/* 日期选择器：只显示日历图标按钮，隐藏原生输入覆盖在按钮上（showPicker 锚定到按钮位置） */
.date-pick { position: relative; display: inline-block; vertical-align: middle; }
.date-pick input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* 自定义日期弹出面板 */
.date-popup { position: absolute; z-index: 9990; width: 264px; background: #fff; border: 1px solid #d1d5db; border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); padding: 10px; }
.date-popup[hidden] { display: none; }
.date-popup-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.date-popup-head button { border: 1px solid #d1d5db; background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1; color: #475569; }
.date-popup-head button:hover { background: #f1f5f9; }
.date-popup-head span { font-size: 14px; font-weight: 600; color: #1e293b; }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-dow { font-size: 12px; color: #94a3b8; text-align: center; padding: 4px 0; }
.date-day { font-size: 13px; color: #1e293b; text-align: center; padding: 6px 0; border-radius: 6px; cursor: pointer; }
.date-day:hover { background: #eff6ff; }
.date-day.sel { background: var(--primary); color: #fff; font-weight: 700; }
.date-day.today { color: var(--primary); font-weight: 700; }
.date-day.sel.today { color: #fff; }
.date-popup-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f1f5f9; }
.date-popup-foot button { border: 1px solid #d1d5db; background: #fff; border-radius: 7px; padding: 4px 12px; font-size: 12px; cursor: pointer; color: #475569; }
.date-popup-foot button:hover { background: #f1f5f9; }
.date-popup-foot button.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.date-popup-foot button.primary:hover { background: var(--primary-dark); }

.dash-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #111a2c 0%, #0d1524 100%);
  border: 1px solid #1e2a3f; border-radius: 14px; padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: linear-gradient(180deg, #38bdf8, #2563eb); opacity: 0.6; }
.kpi.accent-cyan::before { background: linear-gradient(180deg, #22d3ee, #0ea5e9); }
.kpi.accent-emerald::before { background: linear-gradient(180deg, #34d399, #10b981); }
.kpi.accent-violet::before { background: linear-gradient(180deg, #a78bfa, #8b5cf6); }
.kpi-label { font-size: 12.5px; color: #64748b; letter-spacing: 0.5px; }
.kpi-val { font-size: 30px; font-weight: 800; color: #f8fafc; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: #64748b; }
.kpi-sub b { color: #94a3b8; font-weight: 600; }
.kpi.accent-cyan .kpi-val { color: #67e8f9; }
.kpi.accent-emerald .kpi-val { color: #6ee7b7; }
.kpi.accent-violet .kpi-val { color: #c4b5fd; }

.dash-panel { background: #0d1524; border: 1px solid #1e2a3f; border-radius: 14px; padding: 18px 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); }
.dash-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dash-panel-head h3 { margin: 0; font-size: 16px; color: #f1f5f9; font-weight: 700; }
.dash-updated { font-size: 12px; color: #64748b; }
.sim-banner { margin: 12px 0; padding: 10px 14px; border: 1px solid #b45309; border-radius: 10px; background: rgba(217, 119, 6, 0.14); color: #fbbf24; font-size: 13px; font-weight: 600; }
.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { text-align: left; padding: 10px 10px; color: #64748b; font-weight: 600; font-size: 12px; border-bottom: 1px solid #1e2a3f; white-space: nowrap; }
.dash-table td { padding: 11px 10px; border-bottom: 1px solid #16233b; color: #cbd5e1; white-space: nowrap; }
.dash-table tbody tr:hover { background: #111a2c; }
.dash-table td.left { color: #f1f5f9; font-weight: 600; }
.dash-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.dash-table th.num { text-align: right; }
.dash-table .pos { color: #ff6b6b; }
.dash-table .neg { color: #94a3b8; }
.dash-loading, .dash-empty { text-align: center; color: #64748b; padding: 30px 0; font-size: 14px; }
.dash-table td .sub { color: #64748b; font-size: 11px; }

.st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.st-won { background: #e5484d; color: #fff; border: 1px solid #e5484d; }
.st-lost { background: rgba(0, 0, 0, 0.45); color: #9aa3b2; border: 1px solid #3a4353; }
.st-pending { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.35); }
.sim-toggle { cursor: pointer; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.sim-toggle.won { background: #e5484d; border: 1px solid #e5484d; }
.sim-toggle.lost { background: rgba(0, 0, 0, 0.45); color: #9aa3b2; border: 1px solid #3a4353; }
.sim-toggle:hover { filter: brightness(1.2); }

.rchip { display: inline-block; width: 26px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; margin-right: 4px; font-size: 12px; font-weight: 700; }
.r-hit { background: #e5484d; color: #fff; }
.r-miss { background: #1b2029; color: #8a93a3; }
.r-pend { background: rgba(100, 116, 139, 0.15); color: #64748b; }

.dash-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.chart-panel .dash-panel-head { margin-bottom: 6px; }
.chart-legend { display: flex; gap: 14px; align-items: center; }
.chart-legend .lg { font-size: 12px; color: #94a3b8; display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

.viz { width: 100%; height: auto; display: block; }
.viz .gline { stroke: #1e2a3f; stroke-width: 1; }
.viz .axl { fill: #64748b; font-size: 11px; font-family: inherit; }
.viz .sline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .s1 { stroke: #38bdf8; }
.viz .s2 { stroke: #22d3ee; }
.viz .crosshair { stroke: #64748b; stroke-width: 1; stroke-dasharray: 3 3; visibility: hidden; }
.viz .crosshair.on { visibility: visible; }
.viz .bar { fill: #38bdf8; opacity: 0.9; transition: opacity 0.12s; }
.viz .bar:hover { opacity: 1; fill: #22d3ee; }
.viz .bar.up { fill: #10b981; }
.viz .bar.up:hover { fill: #34d399; }
.viz .bar.down { fill: #ef4444; }
.viz .bar.down:hover { fill: #f87171; }
.viz .zeroline { stroke: #475569; stroke-width: 1; }
.viz .dot { fill: #38bdf8; }
.viz .dot.d2 { fill: #22d3ee; }
.chart-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg-mini .seg-opt { padding: 5px 12px; font-size: 12px; }
.seg-confirm { border: none; background: #fff; padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--primary); font-weight: 600; border-left: 1px solid #d1d5db; }
.seg-confirm:hover { background: var(--primary-light); }

.chart-tip { position: fixed; z-index: 50; background: #0f1a2e; border: 1px solid #2c3a52; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; line-height: 1.6; color: #cbd5e1; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); max-width: 260px; }
.chart-tip b { color: #f1f5f9; }
.chart-tip .c1 { color: #38bdf8; }
.chart-tip .c2 { color: #22d3ee; }
.chart-tip .cp { color: #10b981; }
.chart-tip .cn { color: #ef4444; }

@media (max-width: 1400px) { .dash-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .dash-charts { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ============ 庄家思维 · 价值面板 ============ */
.value-panel { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); padding: 16px 18px; margin: 0 0 18px; }
.value-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.value-head h2 { margin: 0; font-size: 16px; }
.value-head .muted { color: var(--text-soft); font-size: 12px; flex: 1; min-width: 200px; }
.value-head button.ghost { padding: 7px 16px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; color: var(--text); transition: 0.15s; }
.value-head button.ghost:hover { border-color: var(--primary); color: var(--primary); }
.value-body { font-size: 13px; }
.value-body .muted { color: var(--text-soft); }
.value-body .err { color: var(--red); }
.value-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.value-table th { text-align: left; padding: 8px 10px; color: #64748b; font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.value-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.value-table tbody tr:hover { background: #f8fafc; }
.value-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.value-table td .sub { color: var(--text-soft); font-size: 11px; }
.value-table td b { color: var(--primary-dark); }
.val { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.val.pos { color: #fff; background: var(--red); }
.val.neg { color: var(--text-soft); background: #f1f5f9; }
.value-panel.collapsed .value-body { display: none; }
.value-head { cursor: pointer; }
.value-caret { font-size: 14px; color: var(--text-soft); user-select: none; flex: 0 0 auto; }
.val-mark { font-style: normal; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: #fef2f2; color: var(--red); font-size: 11px; font-weight: 600; white-space: nowrap; }
.val-mark.hot { background: var(--red); color: #fff; }
.lambda { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 4px; background: var(--primary-light); color: var(--primary-dark); font-size: 11px; font-weight: 600; }

/* ============ 场次解析弹窗（AI 思考风格，独立窗口：可拖动/缩放/双击最大化） ============ */
.ai-modal { position: fixed; top: 64px; left: 40px; width: 720px; max-width: 94vw; height: 76vh; max-height: 92vh; background: #fff; border-radius: 14px; border: 1px solid #e2e8f0; box-sizing: border-box; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35); z-index: 9999; display: flex; flex-direction: column; overflow: hidden; cursor: move; }
.ai-modal .muted { color: #475569; }
.ai-modal[hidden] { display: none !important; }
.ai-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); color: #fff; cursor: move; user-select: none; flex: 0 0 auto; }
.ai-modal-title { font-size: 16px; font-weight: 700; flex: 1; }
.ai-title-time { display: block; font-size: 12px; font-weight: 400; opacity: 0.85; margin-top: 2px; }
.ai-close { border: none; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 6px; opacity: 0.85; }
.ai-close:hover { opacity: 1; }
.ai-spark { font-size: 22px; line-height: 1; color: #ffd166; display: inline-block; }
.ai-spark.thinking { animation: ai-blink 1s ease-in-out infinite; color: #fbbf24; text-shadow: 0 0 12px rgba(255, 209, 102, 0.9); }
@keyframes ai-blink {
  0%, 100% { opacity: 0.15; transform: scale(0.82) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.12) rotate(24deg); }
}
.ai-modal-body { padding: 16px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; word-wrap: break-word; overflow-wrap: break-word; background: #f1f5f9; }
.chat-time { text-align: center; color: #94a3b8; font-size: 12px; margin: 2px 0 12px; }
.chat-msg { display: flex; align-items: flex-start; gap: 10px; }
.chat-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35); }
.chat-main { flex: 1; min-width: 0; }
.chat-name { font-size: 12px; color: #64748b; margin: 0 0 4px 2px; }
.chat-bubble { background: #fff; border-radius: 4px 14px 14px 14px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06); word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll table { min-width: max-content; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg.user .chat-avatar { background: linear-gradient(135deg, #3b82f6, #2563eb); font-size: 13px; }
.chat-msg.user .chat-bubble { background: #dbeafe; border-radius: 14px 4px 14px 14px; }
.chat-msg.user .chat-name { text-align: right; margin: 0 2px 4px 0; }
.ai-chat-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: none; background: #f1f5f9; flex: 0 0 auto; }
.chat-quick { flex-basis: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chat-quick .quick-q { width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-chat-bar .quick-q { border: 1px solid var(--border); background: #fff; color: #475569; padding: 6px 8px; border-radius: 14px; font-size: 12px; }
.ai-chat-bar .quick-q:hover:not(:disabled) { background: #e2e8f0; }
.ai-chat-bar .quick-q.quick-support { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
/* λ 语义表格（渲染在聊天对话框内） */
.chat-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; background: #fff; border-radius: 8px; overflow: hidden; }
.chat-table th, .chat-table td { border: 1px solid #eef2f7; padding: 7px 9px; text-align: center; }
.chat-table th { background: #f8fafc; color: #475569; font-weight: 600; }
.chat-table tbody tr:nth-child(even) { background: #fafcff; }
.chat-table .lbl { text-align: left; font-weight: 600; color: #334155; white-space: nowrap; }
.chat-table td.pick { color: #dc2626; font-weight: 700; }
.chat-table td.hot { color: #dc2626; font-weight: 700; background: #fef2f2; }
.chat-table td.pos { color: var(--green); font-weight: 700; }
.chat-table td.neg { color: var(--red); font-weight: 700; }
.chat-table td.num { font-variant-numeric: tabular-nums; }
.chat-table-note { font-size: 12px; color: #64748b; margin-top: 6px; }
.chat-table-note b.pos { color: var(--green); }
.chat-table-note b.neg { color: var(--red); }
.review-group-title { margin: 10px 0 4px; font-size: 13px; color: #334155; }
.review-group-title b { color: var(--primary-dark); }
.review-group-title .pos { color: var(--green); font-weight: 700; }
.review-group-title .neg { color: var(--red); font-weight: 700; }
.ai-head-btn { border: 1px solid rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.ai-head-btn:hover { background: rgba(255, 255, 255, 0.26); }
.ai-chat-bar input { flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 16px; outline: none; background: #f8fafc; cursor: text; }
.ai-chat-bar input:focus { border-color: var(--primary); background: #fff; }
.ai-chat-bar button { border: none; background: var(--primary); color: #fff; padding: 0 20px; border-radius: 20px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.ai-chat-bar button:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-chat-bar button:hover:not(:disabled) { background: var(--primary-dark); }
.chat-bubble .ai-step { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.chat-bubble .ai-step:last-child { border-bottom: none; }
.ai-modal-foot { padding: 10px 18px; border-top: 1px solid var(--border); background: #f8fafc; font-size: 12px; flex: 0 0 auto; }
.ai-resize { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 0%, transparent 50%, #cbd5e1 50%, #cbd5e1 100%); }
.ai-step { padding: 12px 0; border-bottom: 1px dashed #eef2f7; animation: ai-in 0.4s ease; }
.ai-step:last-child { border-bottom: none; }
@keyframes ai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.ai-step-title { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin: 12px 0 6px; }
.ai-line { font-size: 13px; color: var(--text); margin: 3px 0; min-height: 20px; }
.ai-line b { color: var(--primary-dark); }
.ai-note { font-size: 12px; color: var(--text-soft); margin: 6px 0 4px; }
.ai-caret { display: inline-block; width: 2px; height: 14px; margin-left: 2px; background: var(--primary); vertical-align: -2px; animation: caret-blink 0.8s steps(1) infinite; }
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.ai-note .pos { color: var(--green); font-weight: 700; }

/* ===== 登录 / 账户 ===== */
body.logged-out header, body.logged-out main { display: none; }
.login-view {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(900px 520px at 108% 108%, rgba(37, 99, 235, 0.24), transparent 60%),
    linear-gradient(152deg, #060b16 0%, #0b1a33 45%, #123052 100%);
  overflow: hidden;
}
.login-view[hidden] { display: none; }
.login-view::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.09) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse at center, #000 18%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 18%, transparent 78%);
  pointer-events: none;
}
.login-view::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.login-ball {
  position: absolute;
  right: -100px; bottom: -110px;
  width: 460px; height: 460px;
  opacity: 0.10;
  pointer-events: none;
  filter: drop-shadow(0 0 42px rgba(56, 189, 248, 0.45));
  animation: ballFloat 9s ease-in-out infinite;
}
@keyframes ballFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(14deg); }
}
.login-tech {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.5;
  pointer-events: none;
}
.login-scan {
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.7), transparent);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
  pointer-events: none;
  animation: scanMove 7s linear infinite;
}
@keyframes scanMove {
  0% { top: -2px; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.login-box {
  position: relative;
  width: 360px; max-width: 92vw;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(37, 99, 235, 0.06);
}
.login-box::before {
  content: '';
  position: absolute; top: 0; left: 18%; right: 18%; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #2563eb, transparent);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 {
  font-size: 22px; margin: 0 0 6px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(92deg, #1e40af 0%, #2563eb 45%, #0891b2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.login-brand p { font-size: 13px; color: var(--text-soft); margin: 0; letter-spacing: 1px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box form[hidden] { display: none; }
.login-box label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text); }
.login-box input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.login-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.pwd-box { position: relative; display: block; }
.pwd-box input { width: 100%; padding-right: 38px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 4px; color: var(--text-soft); }
.login-forgot { text-align: center; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.login-forgot button { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0; }
.login-forgot button:hover { text-decoration: underline; }
.login-box .primary {
  padding: 12px; font-size: 16px; border-radius: 10px;
  border: none; color: #fff; font-weight: 600;
  background: linear-gradient(92deg, #2563eb 0%, #0891b2 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: 0.15s;
}
.login-box .primary:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(37, 99, 235, 0.45); }
.login-error { min-height: 16px; font-size: 12px; color: #dc2626; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-soft); }
.user-info { font-size: 12px; color: var(--text-soft); margin-left: 8px; white-space: nowrap; }
.nav.logout { border-color: #e5e7eb; color: #dc2626; }
.role-banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; }
.user-form { display: flex; flex-direction: column; gap: 12px; }
.user-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text); }
.user-form input, .user-form select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; background: #fff; }
.user-form input:focus, .user-form select:focus { border-color: var(--primary); }
#userFormMsg { font-size: 12px; margin-top: 4px; }
#userListBody .ghost { padding: 4px 10px; font-size: 12px; margin-right: 4px; }
.ai-note .neg { color: var(--red); font-weight: 700; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.ai-table th { text-align: left; padding: 6px 8px; color: #64748b; font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ai-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; color: var(--text); white-space: nowrap; }
.ai-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.ai-table .pos { color: var(--green); font-weight: 700; }
.ai-table .neg { color: var(--red); font-weight: 700; }
.ai-combo { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 6px 0; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; font-size: 13px; flex-wrap: wrap; }
.ai-combo b { color: var(--primary-dark); }
.ai-combo.ai-reco { border-color: #c7d2fe; background: #eef2ff; }
.ai-rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.ai-reco .ai-rank { background: var(--violet); }
/* 庄家动向配色：降赔=红色提醒、升赔=绿色 */
.tg-red { color: #dc2626; font-weight: 700; }
.tg-green { color: #16a34a; font-weight: 700; }
/* AI 对话轻量 markdown 排版 */
.chat-bubble .chat-md { line-height: 1.85; font-size: 14px; color: #334155; }
.chat-bubble .ai-md-line { margin: 4px 0; }
.chat-bubble .ai-md-line strong { color: var(--primary-dark); font-weight: 600; }
.chat-bubble .ai-li { margin: 4px 0 4px 18px; position: relative; color: #475569; }
.chat-bubble .ai-li::before { content: '•'; position: absolute; left: -15px; color: var(--primary); font-weight: 700; }
.chat-bubble .ai-h { font-weight: 700; margin: 12px 0 4px; color: var(--primary-dark); }
/* 小节标题：一、二、… 或整行加粗 */
.chat-bubble .ai-sec { font-size: 15px; font-weight: 700; color: var(--primary-dark); margin: 16px 0 8px; padding: 2px 0 2px 10px; border-left: 3px solid var(--primary); line-height: 1.5; }
.chat-bubble .ai-sec strong { font-weight: 700; color: var(--primary-dark); }
.chat-bubble .tg-red { color: #dc2626; font-weight: 600; }
.chat-bubble .tg-green { color: #16a34a; font-weight: 600; }
.dash-table button.ghost { padding: 4px 10px; border: 1px solid #c7d2fe; border-radius: 7px; background: #eef2ff; color: var(--primary-dark); cursor: pointer; font-size: 12px; white-space: nowrap; }
.dash-table button.ghost:hover { background: #e0e7ff; }
.round-analyze { padding: 3px 10px; border: 1px solid #bfdbfe; border-radius: 7px; background: #eff6ff; color: var(--primary-dark); cursor: pointer; font-size: 12px; margin-left: 10px; }
.round-analyze:hover { background: #dbeafe; }

/* 全局「小贝」悬浮入口 */
.xiaobei-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 9000;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.xiaobei-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(37, 99, 235, 0.48); }
@media print { .xiaobei-fab { display: none !important; } }

/* ============ 打印 ============ */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  header, #rounds, .planconfig, #saved, .action-bar, .sheet-actions, .value-panel, .summary-filter, .sheet-head .btn-sm { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  #summary { border: none; box-shadow: none; }
  #summary.open { padding: 0; }
  #summary table { width: 100%; font-size: 12px; }
  #summary th, #summary td { padding: 6px 6px; }
  body { background: #fff; }
}

/* ============ 移动端（用户端）适配 ============ */
@media (max-width: 640px) {
  .header-inner { padding: 12px 14px 10px; gap: 10px; }
  .brand h1 { font-size: 17px; }
  .brand p { font-size: 11px; }
  .settings { gap: 6px; }
  .settings button { padding: 7px 10px; font-size: 12px; }
  .statusbar { padding: 0 14px 8px; }

  main { margin: 6px auto 14px; padding: 0 12px 76px; }

  .login-box { width: 100%; max-width: 92vw; padding: 24px 20px; border-radius: 16px; max-height: 94vh; overflow-y: auto; }
  .login-brand h1 { font-size: 19px; }
  .login-brand p { font-size: 12px; letter-spacing: 0.5px; }
  .login-box input { font-size: 16px; padding: 12px; } /* 16px 防 iOS 聚焦缩放 */
  .login-box label { font-size: 14px; }
  .login-box .primary { padding: 13px; font-size: 16px; }
  .login-forgot { gap: 8px 16px; }
  .login-ball { width: 320px; height: 320px; right: -80px; bottom: -80px; opacity: 0.08; }

  .matchpick { padding: 12px; border-radius: 12px; }
  .matchpick-tools { flex-wrap: wrap; }
  .matchpick-tools button { flex: 1 1 auto; font-size: 13px; min-height: 40px; }

  .action-bar button, .recommend-actions button, .sheet-actions button { min-height: 40px; }

  /* 小贝：移动端全屏（顶部到底部导航上方），不遮挡底部菜单栏 */
  #analysisModal.ai-modal, #planDetailModal.ai-modal, #subscribeModal.ai-modal { top: 0 !important; left: 0 !important; right: 0 !important; bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; height: auto !important; max-width: none !important; max-height: none !important; border-radius: 0 !important; transform: none !important; }
  .xiaobei-fab { bottom: 74px; right: 14px; }
}

/* ============ 移动端底部导航 + 我的 + 计划tab ============ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06); padding-bottom: env(safe-area-inset-bottom, 0);
}
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border: none; background: none; color: #94a3b8; cursor: pointer; font-size: 11px; }
.bn-item .bn-icon { font-size: 20px; line-height: 1; }
.bn-item.active { color: var(--primary); font-weight: 700; }
body.logged-out .bottom-nav { display: none; }

.plan-tabs { display: flex; gap: 8px; margin: 4px 0 14px; }
.plan-tab { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text-soft); cursor: pointer; font-size: 15px; font-weight: 600; }
.plan-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.me-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.me-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.me-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.me-account { font-size: 18px; font-weight: 700; color: var(--text); }
.me-role { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.me-referral { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #166534; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-referral-left { flex: 1; }
.me-referral .code { font-weight: 800; letter-spacing: 1px; color: #15803d; }
.me-referral-sub { margin-top: 4px; font-size: 12px; }
.me-qr { width: 80px; height: 80px; flex: 0 0 auto; border-radius: 6px; }
.me-list { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.me-item { display: block; width: 100%; text-align: left; padding: 15px 18px; border: none; border-bottom: 1px solid var(--border); background: none; color: var(--text); cursor: pointer; font-size: 15px; }
.me-item:last-child { border-bottom: none; }
.me-item:active { background: #f1f5f9; }
.me-about-card h3 { margin: 0 0 10px; font-size: 16px; color: var(--primary-dark); }
.me-about-card p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--text-soft); }
.page-title { margin: 0; padding: 8px 16px 8px; text-align: center; font-size: 17px; font-weight: 700; color: #fff; }
.page-h2 { text-align: center; font-size: 18px; font-weight: 800; color: var(--text); margin: 4px 0 14px; }
.me-invite-btn { margin-top: 10px; padding: 8px 14px; border: none; border-radius: 8px; background: #22c55e; color: #fff; font-size: 13px; cursor: pointer; font-weight: 600; }
.me-logout-list { margin-top: 14px; }
.me-logout { color: #dc2626; text-align: center; font-weight: 600; }
.saved-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin-bottom: 10px; position: sticky; top: 42px; z-index: 15; background: var(--bg); padding: 4px 0; }
.saved-toolbar .seg { display: flex; flex: 1; min-width: 0; }
.saved-toolbar .seg-opt, .saved-toolbar .seg-expand { flex: 1; justify-content: center; text-align: center; padding: 8px 16px; }
.saved-toolbar .seg-back { flex: 0 0 auto; justify-content: center; padding: 8px 12px; font-size: 13px; }
.saved-date-wrap { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.saved-date-wrap .date-pick button { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; max-width: 44px; height: 37px; padding: 0; -webkit-appearance: none; appearance: none; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.saved-date-wrap .date-pick button:hover { background: var(--primary-light); }
.cell-time { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.plan-cards { display: flex; flex-direction: column; gap: 10px; }
.plan-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.pc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pc-num { font-weight: 800; color: var(--primary-dark); font-size: 14px; }
.pc-time { font-size: 12px; color: var(--text-soft); }
.pc-hit { margin-left: auto; font-size: 12px; color: var(--primary); font-weight: 700; }
.pc-teams { font-weight: 700; color: var(--text); font-size: 14px; }
.pc-league { font-size: 12px; color: var(--text-soft); margin-bottom: 6px; }
.pc-outcomes-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-oc { padding: 4px 10px; border: 1px solid #c7d2fe; border-radius: 6px; background: #eef2ff; color: var(--primary-dark); font-size: 13px; }
.pc-oc em { font-style: normal; color: var(--primary); font-weight: 700; }
.pc-save { flex: 0 0 auto; padding: 7px 16px; border: none; border-radius: 8px; background: #16a34a; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.pc-save:hover { background: #15803d; }
.plan-warn { border-color: #fde68a; background: #fffbeb; color: #92400e; font-size: 13px; }
.trend-cards { display: flex; flex-direction: column; gap: 10px; }
.trend-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.tc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tc-num { font-weight: 800; color: var(--primary-dark); font-size: 14px; }
.tc-teams { font-weight: 700; color: var(--text); flex: 1; font-size: 15px; }
.tc-lambda { font-size: 13px; color: var(--primary); font-weight: 700; white-space: nowrap; }
.tc-league { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.tc-row { display: flex; gap: 8px; margin: 4px 0; align-items: flex-start; }
.tc-label { flex: 0 0 auto; width: 62px; font-size: 12px; font-weight: 700; color: var(--text-soft); padding-top: 3px; }
.tc-val { flex: 1; font-size: 13px; color: var(--text); }
.tc-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.tc-verdict { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; color: #fff; font-weight: 700; }
.tc-vtext { flex: 1; font-size: 12px; color: var(--text-soft); }

/* ============ 代理后台（PC，左侧栏布局） ============ */
.agent-app { display: flex; min-height: 100vh; }
.agent-sidebar {
  width: 220px; flex: 0 0 auto; background: linear-gradient(180deg, #0b1a33 0%, #123052 100%);
  color: #e2e8f0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.agent-logo { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.agent-logo-title { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.agent-logo-sub { font-size: 12px; color: #7dd3fc; margin-top: 2px; }
.agent-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; flex: 1; }
.side-nav {
  text-align: left; padding: 12px 16px; border: none; border-radius: 8px; background: transparent;
  color: #cbd5e1; cursor: pointer; font-size: 15px; transition: 0.15s;
}
.side-nav:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-nav.active { background: #2563eb; color: #fff; font-weight: 700; }
.side-nav[hidden] { display: none; }
.agent-sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.agent-user { font-size: 13px; color: #e2e8f0; word-break: break-all; margin-bottom: 10px; }
.side-logout { width: 100%; padding: 9px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #fca5a5; cursor: pointer; font-size: 14px; }
.side-logout:hover { background: rgba(255, 255, 255, 0.16); }

.agent-main { flex: 1; min-width: 0; padding: 24px 28px 60px; background: var(--bg); }
.view-panel { max-width: 1500px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 22px; color: #1e293b; font-weight: 800; }
.panel-head .primary { padding: 10px 20px; font-size: 15px; border-radius: 9px; }
.filter-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-soft); font-weight: 600; }
.filter-bar select, .filter-bar input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px; min-width: 120px; }
.order-table { font-size: 14px; }
.nowrap { white-space: nowrap; }

/* 做计划弹窗 */
.make-plan-modal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 560px; max-width: 94vw; height: auto; max-height: 92vh; cursor: default; }
.make-plan-modal .ai-modal-head { cursor: default; }
.make-plan-modal .ai-modal-body { background: #fff; }
.mp-outcomes-label { font-size: 13px; color: var(--text-soft); font-weight: 600; margin-bottom: 8px; }
.mp-outcomes { display: flex; flex-wrap: wrap; gap: 8px; }
.outcome-check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.outcome-check:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.outcome-check em { font-style: normal; color: var(--primary); font-weight: 700; margin-left: 4px; }

.pricing-row { display: flex; align-items: center; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pricing-name { font-weight: 700; min-width: 140px; color: var(--text); font-size: 15px; }
.pricing-row label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-soft); }
.pricing-row input { width: 100px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.balance-big { font-size: 34px; font-weight: 800; color: var(--primary-dark); padding: 6px 0 16px; }

/* PC 端：放大正文字号，去掉移动端压缩感 */
.agent-body { font-size: 15px; }
.agent-body .dash-table { font-size: 14px; }
.agent-body .dash-table th { font-size: 14px; }
.agent-body .dash-panel h3 { font-size: 17px; font-weight: 800; color: #1e293b; }
.agent-body .dash-head h2 { font-size: 20px; }
.agent-body .dash-sub { font-size: 13px; }
.agent-body .user-form label { font-size: 14px; }
.agent-body .user-form input, .agent-body .user-form select { font-size: 14px; padding: 8px 10px; }

/* 代理后台浅色主题：面板白底、表格深色字（覆盖深色看板样式，解决「字太淡」） */
.agent-body .dash-panel { background: #fff; border-color: var(--border); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.agent-body .dash-table th { color: #475569; border-bottom-color: var(--border); }
.agent-body .dash-table td { color: var(--text); border-bottom-color: #f1f5f9; }
.agent-body .dash-table tbody tr:hover { background: #f8fafc; }
.agent-body .dash-table td.left { color: var(--text); }
.agent-body .dash-table .pos { color: var(--green); }
.agent-body .dash-table .neg { color: var(--red); }
.agent-body .dash-loading, .agent-body .dash-empty { color: var(--text-soft); }

.settings-panels { display: flex; flex-direction: column; gap: 16px; }

/* 侧边栏菜单角标（客服工单红点） */
.side-nav .badge-dot { display: inline-block; margin-left: 8px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle; }

/* 客服工单聊天弹窗：居中 */
#chatModal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 760px; cursor: default; }
#chatModal .ai-modal-head { cursor: default; }
#chatModal .chat-bubble { margin-bottom: 12px; }
#chatModal .chat-bubble.user { background: #dbeafe; border-radius: 14px 4px 14px 14px; }
#chatModal .chat-bubble.ai { background: #fff; border-radius: 4px 14px 14px 14px; }

/* ============ 用户端订阅 ============ */
.nav.subscribe { border-color: #f59e0b; color: #fde68a; background: rgba(245, 158, 11, 0.18); }
.nav.subscribe.locked { border-color: #f59e0b; color: #fff; background: #f59e0b; font-weight: 700; animation: subPulse 2s ease-in-out infinite; }
@keyframes subPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); } }
.link-btn { background: none; border: none; color: #b45309; cursor: pointer; text-decoration: underline; font-size: 13px; padding: 0; }

.subscribe-modal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 430px; max-width: 94vw; height: auto; max-height: 92vh; cursor: default; }
.subscribe-modal .ai-modal-head { cursor: default; }
.subscribe-modal .ai-modal-body { background: #f1f5f9; }
.sub-status { background: #eff6ff; border: 1px solid #dbeafe; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; color: #1e40af; }
.sub-referral { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #166534; }
.sub-referral .code { font-weight: 800; letter-spacing: 1px; color: #15803d; }
.sub-plans { display: flex; flex-direction: column; gap: 10px; }
.sub-plan { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: 0.15s; gap: 10px; background: #fff; }
.sub-plan:hover { border-color: var(--primary); background: var(--primary-light); }
.sub-plan .plan-name { font-weight: 700; color: var(--text); }
.sub-plan .plan-desc { font-size: 12px; color: var(--text-soft); }
.sub-plan .plan-price { font-weight: 800; color: var(--primary); font-size: 16px; white-space: nowrap; }
.sub-plan .plan-tag { background: #f59e0b; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.sub-note { margin-top: 12px; font-size: 12px; color: var(--text-soft); line-height: 1.6; }
