/* 美股ETF期权决策台 · 静态版
   配色沿用原 Space：深色底、红涨绿跌（可切换为绿涨红跌）。
   纯 CSS，无构建步骤。移动端用底部导航，桌面端用顶部页签。 */
:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --surface: #12161f;
  --surface2: #171c27;
  --text: #e6eaf2;
  --dim: #8b94a5;
  --border: #232a36;
  --accent: #4c8dff;
  --up: #e5484d;   /* 红涨（默认） */
  --down: #2fbf71; /* 绿跌（默认） */
  --warn: #e8a13a;
  --radius: 10px;
}
body.green-up {
  --up: #2fbf71;
  --down: #e5484d;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--accent); }
.num {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1024px; margin: 0 auto; padding: 0 16px 96px; }
@media (min-width: 768px) { .wrap { padding-bottom: 40px; } }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
header.top .inner {
  max-width: 1024px; margin: 0 auto; padding: 12px 16px 8px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
h1 { font-size: 18px; line-height: 1.3; margin: 0; }
.subtitle { font-size: 12px; color: var(--dim); margin-top: 2px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.muted { color: var(--dim); font-size: 13px; }
.small { font-size: 12px; color: var(--dim); }
.warn-text { color: var(--warn); font-size: 13px; }
.danger-text { color: #ff8589; font-size: 13px; }
.up-text { color: var(--up); }
.down-text { color: var(--down); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-size: 14px; cursor: pointer;
}
.btn:active { opacity: .75; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-danger { color: #ff8589; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }

.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-size: 14px; font-family: inherit;
}
textarea.input { min-height: 72px; resize: vertical; }
label.field { display: block; font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(3, 1fr); } }
.form-grid .full { grid-column: 1 / -1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

.tag {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 999px; font-size: 11px; line-height: 18px;
  border: 1px solid var(--border); color: var(--dim); white-space: nowrap;
}
.tag-up { color: #fff; background: var(--up); border-color: var(--up); }
.tag-warn { color: var(--warn); border-color: #5a4517; background: rgba(232,161,58,.08); }
.tag-stale { color: #ff8589; border-color: #6e2733; background: rgba(229,72,77,.08); }
.tag-real { color: #7db4ff; border-color: #274a75; background: rgba(76,141,255,.08); }

.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--dim); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }

nav.desktop-tabs {
  display: none; max-width: 1024px; margin: 0 auto; padding: 10px 16px 4px;
  gap: 6px; flex-wrap: wrap;
}
@media (min-width: 768px) { nav.desktop-tabs { display: flex; } }
nav.mobile-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; overflow-x: auto;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) { nav.mobile-tabs { display: none; } }
.tabbtn {
  flex: 1 0 auto; min-width: 52px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--dim); cursor: pointer; background: none; border: none;
  padding: 0 4px; white-space: nowrap;
}
.tabbtn.active { color: var(--accent); font-weight: 600; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(4, 1fr); } }
.kv { background: var(--surface2); border-radius: 8px; padding: 10px 12px; }
.kv .k { font-size: 12px; color: var(--dim); }
.kv .v { font-size: 16px; font-weight: 600; margin-top: 2px; }
.kv .v small { font-size: 12px; color: var(--dim); font-weight: 400; }

.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-head .price { text-align: right; }
.card-head .price .p { font-size: 20px; font-weight: 600; }
.check-list { font-size: 13px; margin-top: 8px; }
.check-list div { margin-top: 3px; color: var(--dim); }
.divider { border-top: 1px solid var(--border); margin: 12px 0; }
.list-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.list-row:last-child { border-bottom: none; }

.tv-box { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tv-box .tradingview-widget-container { width: 100%; }
.chart-box { height: 480px; }
.chart-box .tradingview-widget-container,
.chart-box .tradingview-widget-container__widget { height: 100% !important; }
.tape-box { border-bottom: 1px solid var(--border); }
.tape-box .tradingview-widget-container { width: 100%; }

table.dtbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dtbl th { text-align: left; color: var(--dim); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.dtbl td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-scroll { overflow-x: auto; }

footer.site { font-size: 12px; color: var(--dim); line-height: 1.7; margin-top: 24px; }
.hidden { display: none !important; }

/* 美股指南正文 */
.guide-article h1 { font-size: 18px; margin: 0 0 12px; }
.guide-article h2 { font-size: 16px; margin: 20px 0 8px; }
.guide-article h3 { font-size: 15px; margin: 16px 0 8px; }
.guide-article p { margin: 0 0 10px; }
.guide-article ul, .guide-article ol { margin: 0 0 12px; padding-left: 20px; }
.guide-article li { margin-top: 4px; }
.guide-article blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); color: var(--dim); background: var(--surface2); border-radius: 0 8px 8px 0; }
.guide-article table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 12px; display: block; overflow-x: auto; }
.guide-article th { text-align: left; color: var(--dim); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.guide-article td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.guide-article img { max-width: 100%; height: auto; border-radius: 8px; }
.guide-article pre { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 13px; }
.guide-article code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.guide-article hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
