/* ============================================================
   FollowmePlus · 中国红主题
   ============================================================ */
:root {
  --red:        #C8102E;   /* 中国红 */
  --red-deep:   #8f0f22;
  --red-darker: #6d0a19;
  --gold:       #E6C068;
  --gold-deep:  #C9A24B;
  --ivory:      #FAF6F0;
  --card:       #FFFFFF;
  --ink:        #2b2320;
  --muted:      #9a8f88;
  --line:       #eee3d8;
  --up:         #D6382C;   /* 红涨 */
  --down:       #1F9D6D;   /* 绿跌 */
  --shadow:     0 2px 14px rgba(140, 20, 35, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--ivory);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; outline: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

/* ---------------- 顶部 ---------------- */
.topbar {
  background:
    radial-gradient(1200px 300px at 15% -80px, rgba(230,192,104,.22), transparent 60%),
    linear-gradient(135deg, var(--red-darker) 0%, var(--red-deep) 45%, var(--red) 100%);
  color: #fff;
  box-shadow: 0 3px 18px rgba(109, 10, 25, .35);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 24px 10px;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-seal {
  width: 44px; height: 44px; border-radius: 9px;
  background: linear-gradient(160deg, #fff 0%, #f7ecd8 100%);
  color: var(--red);
  font-size: 26px; font-weight: 800;
  font-family: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px var(--red), 0 2px 8px rgba(0,0,0,.25);
}
.brand-name {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 20px; font-weight: 700; letter-spacing: .5px;
  color: #fff;
}
.brand-sub { font-size: 10px; letter-spacing: 4px; color: var(--gold); margin-top: 1px; }

.mainnav { display: flex; gap: 4px; }
.nav-btn {
  color: rgba(255,255,255,.82); font-size: 15px;
  padding: 9px 18px; border-radius: 8px; position: relative;
  transition: all .18s;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,.10); }
.nav-btn.active { color: var(--gold); font-weight: 600; }
.nav-btn.active::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px;
  height: 2px; background: var(--gold); border-radius: 2px;
}

.top-search { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.top-search input {
  width: 100%; padding: 9px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.14); color: #fff; font-size: 13px;
}
.top-search input::placeholder { color: rgba(255,255,255,.55); }
.top-search input:focus { background: #fff; color: var(--ink); border-color: var(--gold); }
.search-drop {
  position: absolute; top: 44px; left: 0; right: 0;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 32px rgba(0,0,0,.18);
  max-height: 320px; overflow: auto; z-index: 99;
}
.search-item {
  display: flex; justify-content: space-between; padding: 10px 14px;
  cursor: pointer; color: var(--ink); border-bottom: 1px solid #f6efe6;
}
.search-item:hover { background: #fdf3ee; }
.search-item .c { color: var(--muted); font-size: 12px; }

.btn-outline-gold {
  color: var(--gold); border: 1px solid var(--gold);
  padding: 8px 18px; border-radius: 20px; font-size: 13px; transition: all .18s;
}
.btn-outline-gold:hover { background: var(--gold); color: var(--red-deep); }
.user-chip {
  display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px;
  background: rgba(255,255,255,.12); padding: 7px 14px; border-radius: 20px; cursor: pointer;
}
.user-chip b { color: var(--gold); }

/* 指数条 */
.index-strip {
  display: flex; gap: 26px; align-items: center;
  max-width: 1440px; margin: 0 auto; padding: 8px 24px 10px;
  border-top: 1px solid rgba(255,255,255,.12);
  overflow-x: auto; scrollbar-width: none;
}
.idx-item { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 13px; }
.idx-item .n { color: rgba(255,255,255,.75); }
.idx-item .p { font-weight: 700; font-size: 15px; }
.idx-item .c { font-size: 12px; }
.c-up   { color: #FFB3A7; }
.c-down { color: #9be3c3; }

/* ---------------- 布局/卡片 ---------------- */
#main { max-width: 1440px; margin: 18px auto; padding: 0 24px; min-height: 70vh; }
.card {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  border: 1px solid #f3e8dc; padding: 16px 18px; margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px; flex-wrap: wrap;
}
.card-title {
  font-size: 16px; font-weight: 700;
  padding-left: 10px; border-left: 4px solid var(--red);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
}
.card-tag { font-size: 11px; padding: 3px 10px; border-radius: 12px; }
.up-tag   { background: #fdeae7; color: var(--up); }
.down-tag { background: #e6f6ef; color: var(--down); }
.gold-tag { background: #f9f1de; color: var(--gold-deep); }

/* ---------------- 行情中心 ---------------- */
.market-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item {
  display: grid; grid-template-columns: 22px 1fr auto auto 26px;
  align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px dashed #f3e8dc; cursor: pointer;
}
.rank-item:hover { background: #fdf6ef; }
.rank-no { font-size: 12px; color: var(--muted); font-style: italic; }
.rank-no.top { color: var(--red); font-weight: 700; }
.rank-name { line-height: 1.25; }
.rank-name .nm { font-weight: 600; }
.rank-name .cd { font-size: 11px; color: var(--muted); }
.rank-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-chg { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; min-width: 64px; text-align: center; }
.chg-up   { background: var(--up);   color: #fff; }
.chg-down { background: var(--down); color: #fff; }
.chg-flat { background: #eee; color: #888; }
.star { color: #d9c9a8; font-size: 16px; }
.star.on { color: var(--gold-deep); }
.empty-hint { color: var(--muted); text-align: center; padding: 26px 0; font-size: 13px; }

.hot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.hot-cell {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: all .15s;
}
.hot-cell:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.hot-cell .nm { font-weight: 600; font-size: 13px; }
.hot-cell .cd { font-size: 11px; color: var(--muted); }
.hot-cell .pr { font-size: 17px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hot-cell .ch { font-size: 12px; font-weight: 600; }
.t-up { color: var(--up); } .t-down { color: var(--down); }

/* ---------------- K线页 ---------------- */
.chart-layout { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.side-panel { position: sticky; top: 118px; padding: 12px; }
.side-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.side-tab {
  flex: 1; padding: 7px 0; border-radius: 8px; font-size: 13px;
  background: #f7efe4; color: var(--muted);
}
.side-tab.active { background: var(--red); color: #fff; }
.side-search {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; margin-bottom: 8px;
}
.side-list { max-height: 60vh; overflow: auto; }
.side-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 6px; border-radius: 8px; cursor: pointer; gap: 6px;
}
.side-item:hover { background: #fdf3ee; }
.side-item.cur { background: #fdeae7; }
.side-item .l .nm { font-size: 13px; font-weight: 600; }
.side-item .l .cd { font-size: 11px; color: var(--muted); }
.side-item .r { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

.quote-card { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.quote-left { display: flex; align-items: center; gap: 10px; }
.quote-name { font-size: 22px; font-weight: 800; font-family: Georgia, "Noto Serif SC", serif; }
.quote-code { color: var(--muted); font-size: 13px; margin-top: 2px; }
.star-btn { font-size: 22px; color: #d9c9a8; }
.star-btn.on { color: var(--gold-deep); }
.quote-price { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.quote-chg { font-size: 14px; font-weight: 600; margin-top: 4px; }
.quote-right { display: flex; gap: 18px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.quote-right b { display: block; color: var(--ink); font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.signal-badge {
  margin-left: auto; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--red), var(--red-deep)); color: var(--gold);
  box-shadow: 0 3px 12px rgba(200,16,46,.35);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.04);} }

.chart-card { padding: 12px 14px 8px; }
.chart-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.bar-group, .ind-group, .sub-group, .tool-right { display: flex; gap: 4px; flex-wrap: wrap; }
.chart-toolbar button {
  font-size: 12px; padding: 6px 11px; border-radius: 7px;
  color: #7a6f68; background: #f8f1e7; transition: all .15s;
}
.chart-toolbar button:hover { color: var(--red); }
.bar-group button.active { background: var(--red); color: #fff; font-weight: 600; }
.ind-group button.active, .sub-group button.active { background: #fdeae7; color: var(--red); font-weight: 600; }
.tool-right { margin-left: auto; }
.ai-btn {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%) !important;
  color: var(--gold) !important; font-weight: 700 !important;
  padding: 6px 16px !important;
  box-shadow: 0 3px 10px rgba(200,16,46,.3);
}
.ai-btn:disabled { opacity: .55; cursor: not-allowed; }
#klineChart { width: 100%; height: 560px; }
.chart-card.fs {
  position: fixed; inset: 0; z-index: 200; border-radius: 0; margin: 0;
}
.chart-card.fs #klineChart { height: calc(100vh - 110px); }
.chart-note { font-size: 11px; color: var(--muted); padding: 6px 2px 4px; }

.ai-card { border: 1px solid #f0d9b8; background: linear-gradient(180deg, #fffdf8, #fff); }
.ai-result { display: grid; grid-template-columns: repeat(3, minmax(120px, auto)) 1fr; gap: 14px; align-items: start; }
.ai-kv .k { font-size: 12px; color: var(--muted); }
.ai-kv .v { font-size: 20px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ai-reason { grid-column: 1 / -1; font-size: 13px; line-height: 1.75; color: #574d47; background: #fbf5ea; border-radius: 8px; padding: 12px 14px; }
.dir-long  { color: var(--up); }
.dir-short { color: var(--down); }

.stat-row { display: flex; gap: 26px; flex-wrap: wrap; }
.stat-item .k { font-size: 12px; color: var(--muted); }
.stat-item .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------------- 条件选股 ---------------- */
.scan-conds { display: flex; gap: 10px 22px; flex-wrap: wrap; padding: 4px 0 12px; }
.cond {
  display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer;
  color: #574d47; user-select: none;
}
.cond input { accent-color: var(--red); width: 15px; height: 15px; cursor: pointer; }
.scan-opts {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  border-top: 1px dashed var(--line); padding-top: 14px;
}
.scan-lbl { font-size: 12px; color: var(--muted); }
.scan-opts select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  background: #fff;
}
.scan-opts .btn-red { padding: 9px 26px; margin-left: auto; }
.scan-opts .btn-red.stop { background: linear-gradient(135deg, #4a3f39, #2b2320); }
.scan-progress { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.scan-bar {
  flex: 1; height: 10px; background: #f3ede4; border-radius: 6px; overflow: hidden;
}
.scan-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--red));
  border-radius: 6px; transition: width .2s;
}
.cond-pill {
  display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 10px;
  background: #fdeae7; color: var(--red); margin: 1px 3px 1px 0; white-space: nowrap;
}
.cond-pill.green { background: #e6f6ef; color: var(--down); }
.cond-pill.gray  { background: #f3ede4; color: #9a8f88; }

/* ---------------- AI 信号中心 ---------------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  border-radius: 12px; padding: 18px; color: #fff;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  box-shadow: 0 4px 16px rgba(200,16,46,.25);
}
.stat-card.alt  { background: linear-gradient(135deg, #b98a2e, var(--gold-deep)); box-shadow: 0 4px 16px rgba(201,162,75,.3); }
.stat-card.dark { background: linear-gradient(135deg, #4a3f39, #2b2320); box-shadow: 0 4px 16px rgba(43,35,32,.3); }
.stat-card .k { font-size: 12px; opacity: .85; }
.stat-card .v { font-size: 30px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .s { font-size: 11px; opacity: .75; margin-top: 4px; }

.signals-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12px;
  padding: 8px 8px; border-bottom: 2px solid var(--line);
}
.tbl td { padding: 9px 8px; border-bottom: 1px solid #f6efe6; font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: #fdf8f1; }
.tbl .sym-link { color: var(--red); cursor: pointer; font-weight: 600; }
.res-pill { font-size: 11px; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.res-correct { background: #fdeae7; color: var(--up); }
.res-wrong   { background: #e6f6ef; color: var(--down); }
.res-none    { background: #f3ede4; color: #9a8f88; }

.filter-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-group input, .filter-group select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12px;
}
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px 0 4px; flex-wrap: wrap; }
.pager button {
  min-width: 32px; padding: 6px 10px; border-radius: 7px; font-size: 12px;
  background: #f8f1e7; color: #7a6f68;
}
.pager button.cur { background: var(--red); color: #fff; }

/* ---------------- 我的 ---------------- */
.me-guest { text-align: center; padding: 60px 20px; }
.me-guest-seal {
  width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: var(--gold); font-size: 40px; font-weight: 800;
  font-family: Georgia, "Noto Serif SC", serif;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 22px rgba(200,16,46,.35);
}
.me-guest h2 { font-family: Georgia, "Noto Serif SC", serif; margin-bottom: 8px; }
.me-guest .btn-red { margin-top: 20px; }

.me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.profile-kv { display: grid; grid-template-columns: 90px 1fr; row-gap: 10px; font-size: 13px; }
.profile-kv .k { color: var(--muted); }
.quota-bar { height: 8px; background: #f3ede4; border-radius: 5px; overflow: hidden; margin-top: 4px; }
.quota-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 5px; }

.plan-row { display: flex; gap: 14px; }
.plan {
  flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-align: center;
  position: relative;
}
.plan-hot { border: 2px solid var(--gold-deep); background: linear-gradient(180deg, #fffbf2, #fff); }
.plan-flag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--gold-deep); color: #fff; font-size: 11px; padding: 3px 14px; border-radius: 10px;
}
.plan-name { font-weight: 700; font-size: 15px; }
.plan-price { font-size: 26px; font-weight: 800; color: var(--red); margin: 8px 0 2px; }
.plan-price span { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan-desc { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.redeem-row, .recharge-row, .invite-link-row { display: flex; gap: 10px; margin-top: 14px; }
.redeem-row input, .recharge-row input, .invite-link-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
.rc-result {
  margin-top: 14px; background: #fbf5ea; border: 1px dashed var(--gold-deep);
  border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.9;
}
.rc-result .addr { font-family: monospace; word-break: break-all; background: #fff; padding: 6px 10px; border-radius: 6px; display: block; }
.rc-result .amt { color: var(--red); font-size: 20px; font-weight: 800; }

/* ---------------- 按钮 ---------------- */
.btn-red {
  background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff;
  padding: 11px 30px; border-radius: 24px; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(200,16,46,.3); transition: all .18s;
}
.btn-red:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(200,16,46,.4); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #5c3d00;
  padding: 11px 30px; border-radius: 24px; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(201,162,75,.35);
}
.btn-red-sm {
  background: var(--red); color: #fff; padding: 8px 18px; border-radius: 8px; font-size: 13px;
}
.btn-plain-sm { color: var(--muted); font-size: 12px; }
.btn-plain-sm:hover { color: var(--red); }
.btn-block { width: 100%; }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(43,35,32,.55); z-index: 300;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
.modal {
  width: 360px; background: #fff; border-radius: 16px; padding: 26px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border-top: 4px solid var(--red);
}
.modal-x { position: absolute; top: 12px; right: 16px; font-size: 22px; color: #bbb; }
.modal-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.modal-tabs button {
  flex: 1; padding: 10px 0; border-radius: 10px; font-size: 15px;
  background: #f7efe4; color: var(--muted);
}
.modal-tabs button.active { background: var(--red); color: #fff; font-weight: 600; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-body input {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px;
}
.modal-body input:focus { border-color: var(--red); }
.modal-err { color: var(--red); font-size: 12px; }

.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(43,35,32,.92); color: #fff; padding: 11px 22px;
  border-radius: 24px; font-size: 13px; z-index: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.toast.ok  { background: linear-gradient(135deg, var(--red), var(--red-deep)); color: var(--gold); }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 0 34px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .market-grid { grid-template-columns: 1fr; }
  .chart-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .signals-grid { grid-template-columns: 1fr; }
  .me-grid { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .top-search { order: 3; max-width: none; width: 100%; }
  #klineChart { height: 420px; }
}
