:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.13);
  --text: #111827;
  --muted: #64748b;
  --green: #00a86b;
  --green-bg: rgba(0, 168, 107, 0.12);
  --red: #e11d48;
  --red-bg: rgba(225, 29, 72, 0.11);
  --blue: #0075eb;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.tabular { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.sep { opacity: 0.4; margin: 0 4px; }

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 92px;
}

/* 顶部导航 - Revolut 风格 */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.brand-title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.live-tag {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(0, 117, 235, 0.12); color: var(--blue);
}
.conn-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.dot.ok { background: #00c853; box-shadow: 0 0 8px rgba(0, 200, 83, 0.5); }
.dot.err { background: var(--red); }

.btn {
  border: none; border-radius: 999px;
  padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-secondary { background: #111827; color: #fff; }
.btn-secondary:hover { opacity: 0.9; }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }

/* 卡片与纵向板块间距 — 全站统一深蓝 Revolut 卡片风格 */
.section-block { margin-bottom: 18px; }
.card {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 58%, #00449e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 22px 24px;
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}
.card .muted { color: rgba(255, 255, 255, 0.68); }
.card .pos { color: #34d399; }
.card .neg { color: #fb7185; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ex-head { display: flex; justify-content: space-between; align-items: center; }
.ex-name { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; color: #ffffff; }

/* 第一板块：Revolut 深蓝主资产卡 + 变动图 */
.hero-main {
  border: none;
}
.hero-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.hero-main .card-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.hero-number { font-size: 38px; font-weight: 800; letter-spacing: -0.035em; margin-bottom: 6px; color: #ffffff; }
.hero-sub { font-size: 13px; color: rgba(255, 255, 255, 0.8); }

.period-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  padding: 4px;
  border-radius: 999px;
  gap: 3px;
}
.ptab {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: none;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.ptab:hover { color: #ffffff; }
.ptab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: none;
}

.chart-box { width: 100%; }
.equity-svg { width: 100%; height: 170px; display: block; }
.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 6px;
}

/* 第二板块：风险提示 */
.alert-banner {
  background: rgba(225, 29, 72, 0.14);
  border: 1.5px solid rgba(255, 77, 109, 0.55);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.alert-title {
  font-weight: 800;
  color: #ff4d6d;
  font-size: 16px;
  margin-bottom: 6px;
}
.alert-list {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
  color: #ff4d6d;
}

.risk-bars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.risk-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
}
.risk-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 7px;
}
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
.fill-ok { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-danger { background: linear-gradient(90deg, #e11d48, #fb7185); }
.ex-stats { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255, 255, 255, 0.72); }

/* 第三板块：风控注意事项 */
.risk-notes {
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 12px 16px;
}

/* 第四板块：三平台分布横排 + 持仓表 */
.platforms-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.plat-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 12px 15px;
}
.plat-box-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.plat-box-val { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: #ffffff; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-long { background: rgba(52, 211, 153, 0.18); color: #34d399; }
.badge-short { background: rgba(251, 113, 133, 0.18); color: #fb7185; }
.badge-tier-s { background: rgba(251, 191, 36, 0.22); color: #fde68a; }
.badge-tier-a { background: rgba(56, 189, 248, 0.22); color: #bae6fd; }
.badge-tier-b { background: rgba(167, 139, 250, 0.24); color: #ddd6fe; }

.plat-chip {
  display: inline-block;
  padding: 3px 8px;
  margin-right: 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.filter-tabs, .view-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 999px;
  gap: 2px;
}
.tab {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: none;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  white-space: nowrap;
  color: #ffffff;
}
.data-table th { color: rgba(255, 255, 255, 0.68); font-weight: 600; font-size: 12px; background: rgba(255, 255, 255, 0.06); }
.data-table th.num, .data-table td.num { text-align: right; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.06); }

.mobile-cards { display: flex; flex-direction: column; gap: 10px; }
.pos-card { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; padding: 14px; }
.pos-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pos-card-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: #ffffff; }
.pos-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; font-size: 13px; }
.pos-card-grid .k { color: rgba(255, 255, 255, 0.65); margin-bottom: 2px; font-size: 11px; }
.pos-card-grid .v { font-weight: 700; color: #ffffff; }

.empty-state { text-align: center; color: rgba(255, 255, 255, 0.65); padding: 36px 16px; }

.mobile-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; z-index: 40;
}
.mobile-bottom-bar .btn { flex: 1; }

.toast-container { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; border-left: 4px solid var(--blue); padding: 11px 16px; border-radius: 14px; font-size: 13px; }
.toast.ok { border-left-color: #00c853; }
.toast.err { border-left-color: var(--red); }

.mobile-only { display: none; }
.desktop-only { display: block; }

@media (max-width: 768px) {
  .app-shell { padding: 14px 12px 32px; }
  .card { padding: 16px; border-radius: 20px; }
  .hero-number { font-size: 28px; }
  .risk-bars-grid, .platforms-strip { grid-template-columns: 1fr; }
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
}
