/* SkyValue 光遇账号性价比分析站 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b1026; --bg2: #131a3a; --card: #1a2347; --card2: #222d5c;
  --line: #2c3a6e; --text: #e8ecff; --muted: #9aa4d0; --accent: #ffb45e;
  --accent2: #7fb5ff; --good: #5ee6a8; --warn: #ffd166; --bad: #ff7b7b;
  --radius: 14px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  background: linear-gradient(180deg, #0b1026 0%, #101736 40%, #0b1026 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
.app { max-width: 560px; margin: 0 auto; padding: 0 14px calc(40px + env(safe-area-inset-bottom)); }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11,16,38,.92); backdrop-filter: blur(8px); padding: 10px 0 8px; }
.logo { font-size: 19px; font-weight: 700; letter-spacing: .5px; color: var(--accent); }
.logo-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.tabs { display: flex; gap: 6px; margin-top: 10px; }
.tab {
  flex: 1; padding: 9px 0; text-align: center; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--muted); font-size: 14px; cursor: pointer;
  transition: all .15s;
}
.tab.active { background: linear-gradient(135deg, #ffb45e, #ff9a3c); color: #231a06; border-color: transparent; font-weight: 600; }

/* 面板 */
.panel { display: none; margin-top: 12px; }
.panel.active { display: block; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.card h2 { font-size: 18px; margin-bottom: 6px; }
.card h3 { font-size: 15px; margin-bottom: 10px; color: var(--accent2); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.small { font-size: 12px; }
.intro h2 { color: var(--accent); }
.hidden { display: none !important; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-size: 12.5px; color: var(--muted); }
input, select {
  width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 15px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent2); }
input[type=password] { letter-spacing: 2px; }
.form-block { margin-top: 12px; }
.block-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.rare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rare-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); cursor: pointer; user-select: none; transition: all .15s;
}
.rare-item.selected { border-color: var(--accent); background: rgba(255,180,94,.12); }
.rare-name { font-size: 13px; color: var(--text); }
.rare-tag { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: rgba(255,180,94,.15); color: var(--accent); }

/* 按钮 */
.btn {
  display: inline-block; text-align: center; padding: 12px 18px; border-radius: 12px;
  border: none; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.btn.primary { background: linear-gradient(135deg, #ffb45e, #ff9a3c); color: #231a06; width: 100%; margin-top: 14px; }
.btn.secondary { background: var(--accent2); color: #0b1026; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 400; font-size: 13px; padding: 9px 14px; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.big { font-size: 16px; padding: 14px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-row .btn { margin-top: 0; flex: 1; min-width: 130px; }

/* 评分卡 */
.score-card { background: linear-gradient(135deg, #1a2347, #22306b); }
.score-row { display: flex; align-items: center; gap: 18px; }
.score-ring {
  width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), #2c3a6e 0);
  position: relative;
}
.score-ring::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #1a2347;
}
.score-ring span { position: relative; font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1; }
.score-ring small { position: relative; font-size: 12px; color: var(--muted); margin-top: 2px; }
.grade { font-size: 26px; font-weight: 800; }
.score-info .muted { margin-top: 4px; }
.score-bars { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar-track { flex: 1; height: 8px; border-radius: 4px; background: #2c3a6e; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent2), var(--accent)); width: 0; transition: width .6s; }

/* 明细表 */
.detail-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.detail-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.detail-table td:first-child { color: var(--muted); width: 42%; }
.detail-table td:last-child { text-align: right; font-weight: 600; }
.detail-table tr:last-child td { border-bottom: none; }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }

/* 参考价 */
.ref-price { display: flex; flex-direction: column; gap: 8px; }
.ref-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ref-row .lbl { color: var(--muted); width: 90px; flex-shrink: 0; }
.ref-bar { flex: 1; height: 10px; border-radius: 5px; background: #2c3a6e; position: relative; }
.ref-bar .lo, .ref-bar .hi { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--accent2); }
.ref-bar .lo { left: var(--lo); } .ref-bar .hi { left: var(--hi); }
.ref-bar .cur { position: absolute; top: -5px; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; left: var(--cur); }
.ref-val { font-size: 12px; color: var(--text); width: 110px; text-align: right; flex-shrink: 0; }

/* AI */
.ai-config { display: grid; gap: 10px; margin-top: 12px; }
.ai-report {
  margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg2);
  border: 1px solid var(--line); font-size: 13.5px; line-height: 1.8; white-space: pre-wrap;
  max-height: 420px; overflow-y: auto;
}
#ai-status { margin-top: 8px; min-height: 18px; }

/* 精选库 */
.lib-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.lib-filters input { grid-column: 1 / -1; }
.lib-list { display: flex; flex-direction: column; gap: 10px; }
.lib-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg2);
}
.lib-top { display: flex; justify-content: space-between; align-items: baseline; }
.lib-season { font-size: 16px; font-weight: 700; color: var(--accent); }
.lib-price { font-size: 18px; font-weight: 800; color: var(--text); }
.lib-price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.lib-meta { display: flex; gap: 14px; margin-top: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.lib-note { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.lib-eid { margin-top: 8px; font-size: 10.5px; color: #5d6aa0; word-break: break-all; font-family: monospace; }
.lib-score { font-size: 12px; padding: 3px 8px; border-radius: 8px; font-weight: 600; }
.lib-score.high { background: rgba(94,230,168,.15); color: var(--good); }
.lib-score.mid { background: rgba(255,209,102,.15); color: var(--warn); }
.lib-score.low { background: rgba(255,123,123,.15); color: var(--bad); }
.lib-btns { display: flex; gap: 8px; margin-top: 10px; }

/* 行情 */
.market-bars { display: flex; flex-direction: column; gap: 7px; }
.mbar-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.mbar-row .lbl { width: 62px; color: var(--muted); flex-shrink: 0; text-align: right; }
.mbar-track { flex: 1; height: 14px; border-radius: 4px; background: #2c3a6e; overflow: hidden; }
.mbar-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 4px; min-width: 2px; }
.mbar-row .cnt { width: 52px; text-align: right; color: var(--text); font-weight: 600; flex-shrink: 0; }
.rare-market { display: flex; flex-direction: column; gap: 9px; }
.rare-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rare-tier { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.rare-tier.S { background: rgba(255,123,123,.2); color: var(--bad); }
.rare-tier.A { background: rgba(255,209,102,.2); color: var(--warn); }
.rare-tier.B { background: rgba(127,181,255,.2); color: var(--accent2); }
.rare-tier.C { background: rgba(154,164,208,.2); color: var(--muted); }
.rare-row .info { flex: 1; }
.rare-row .info .n { font-weight: 600; }
.rare-row .info .d { font-size: 11.5px; color: var(--muted); }
.rare-row .min { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.tips { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.7; color: var(--text); }
.tips li::marker { color: var(--accent); }

/* 藏宝阁 */
.cbg-frame-wrap {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; height: 78vh; position: relative;
}
#cbg-frame { width: 100%; height: 100%; border: none; }
.cbg-tips { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }

/* 链接分析 */
.code { font-family: monospace; font-size: 12px; background: var(--bg2); padding: 1px 5px; border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.grad-chip, .rare-chip {
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px;
  background: rgba(127,181,255,.12); border: 1px solid rgba(127,181,255,.3); color: var(--accent2);
}
.rare-chip { background: rgba(255,180,94,.12); border-color: rgba(255,180,94,.35); color: var(--accent); }

/* 页脚 */
.foot { text-align: center; padding: 18px 0 8px; }

@media (max-width: 380px) {
  .form-grid { grid-template-columns: 1fr; }
}
