:root {
  --bg: #f4f6fc;
  --card: #ffffff;
  --ink: #16203a;
  --muted: #6b7488;
  --line: #e9edf5;
  --accent: #ff6a3d;
  --accent2: #4f7cff;
  --red: #e2433b;
  --amber: #f0a020;
  --green: #1faa6b;
  --shadow: 0 8px 24px rgba(22, 32, 58, 0.07);
  --shadow-h: 0 12px 30px rgba(79, 124, 255, 0.18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 400px at 80% -120px, rgba(106, 92, 255, 0.10), transparent),
    radial-gradient(900px 360px at 0% -120px, rgba(255, 106, 61, 0.12), transparent),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(120deg, #ff7a4d, #ff5a7a 52%, #6a5cff);
  color: #fff; box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.25);
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.brand h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; font-size: 12px; opacity: 0.92; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.pill {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); color: #fff; white-space: nowrap;
}
.btn {
  border: none; border-radius: 10px; cursor: pointer; font-size: 13px;
  padding: 9px 14px; font-weight: 700; transition: transform .08s ease, box-shadow .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { box-shadow: var(--shadow-h); }
.btn.ghost { background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.ghost.small { background: #eef1f7; color: var(--muted); border: 1px solid var(--line); }

.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  padding: 18px 22px 4px; max-width: 1120px; margin: 0 auto; width: 100%;
}
.stat {
  background: var(--card); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line);
}
.stat .num { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat .lbl { font-size: 12px; color: var(--muted); }

main { max-width: 1120px; margin: 0 auto; padding: 14px 22px 40px; width: 100%; }
.card-block {
  background: var(--card); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); margin-top: 16px; border: 1px solid var(--line);
}
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.block-head h2 { margin: 0; font-size: 16px; }
.block-head .hint { font-size: 12px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert {
  display: flex; gap: 14px; border-radius: 14px; padding: 12px 14px;
  border-left: 5px solid var(--accent2); background: #fbfcff; position: relative;
}
.alert.surge { border-left-color: #ff3b30; background: #fff1ef; }
.alert.rise  { border-left-color: var(--amber); background: #fffaf0; }
.alert.deep  { border-left-color: var(--green); background: #eefaf3; } /* 深跌捡漏=好deal，绿色 */
.alert.mid   { border-left-color: var(--amber); background: #fffaf0; }
.alert img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: #eef; flex: none; }
.alert .body { flex: 1; min-width: 0; }
.alert .title { font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.alert .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #eef1f7; color: var(--muted); white-space: nowrap;
}
.tag.price { background: #fdeee9; color: var(--accent); font-weight: 800; }
.tag.gap { background: #fdeceb; color: var(--red); font-weight: 800; }
.tag.time { background: #e9f3ff; color: var(--accent2); font-weight: 800; }
.tag.src { background: #eafaf1; color: var(--green); }
.tag.conf { background: #efeaff; color: #6a5cff; font-weight: 700; }
.tag.conf.high { background: #eafaf1; color: var(--green); }
.tag.conf.med { background: #fffaf0; color: var(--amber); }
.tag.conf.low { background: #f0f1f5; color: var(--muted); }
.tag.tier { font-weight: 800; color: #fff; }
.tag.tier.surge { background: #ff3b30; }
.tag.tier.rise  { background: var(--amber); color: #3a2c00; }
.tag.tier.drop  { background: var(--green); }
.tag.tier.mid   { background: var(--muted); }
.alert a { color: var(--accent2); font-size: 12px; text-decoration: none; font-weight: 600; }
.gapbar { height: 6px; border-radius: 999px; background: #eef1f7; margin: 8px 0 2px; overflow: hidden; }
.gapbar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb15a, var(--red)); }

.disc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.disc {
  border-radius: 14px; padding: 12px 14px; background: #f8f9fc; border-left: 4px solid var(--accent2);
  display: flex; flex-direction: column; gap: 6px;
}
.disc-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.disc-title { font-weight: 600; font-size: 13px; }
.disc-img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; background: #eef; flex: none; }
.disc .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.disc.ebay-bargain { border-left-color: var(--green); background: #eefaf3; }

.list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px; background: #f8f9fc; font-size: 13px;
}
.list li .meta { color: var(--muted); font-size: 12px; }
.list li button { border: none; background: transparent; color: var(--red); cursor: pointer; font-size: 12px; font-weight: 600; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.inline-form input, .inline-form select {
  flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 13px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td .fp { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.settings-grid input, .settings-grid select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--ink);
}
.settings-grid button { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 760px) { .settings-grid { grid-template-columns: 1fr; } }

.empty { text-align: center; color: var(--muted); padding: 22px; font-size: 13px; }
.example { border-style: dashed; opacity: 0.85; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; box-shadow: var(--shadow-h);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 会员 / 积分钱包 UI ===== */
.hidden { display: none !important; }
.user-box { display: flex; align-items: center; gap: 8px; }
.bal {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); color: #fff; white-space: nowrap;
}
.bal b { color: #fff; }
.modal {
  position: fixed; inset: 0; background: rgba(16, 20, 32, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 18px; padding: 22px; width: min(360px, 92vw);
  box-shadow: 0 20px 60px rgba(16, 20, 32, 0.3); display: flex; flex-direction: column; gap: 12px;
}
.modal-card h3 { margin: 0; font-size: 18px; }
.modal-card .hint { font-size: 12px; color: var(--muted); margin: 0; }
.modal-card input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; width: 100%;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
.modal-card a { color: var(--accent2); }
