:root {
  --ink:#142937; --muted:#607481; --nav:#102d3b; --teal:#087a72; --teal-light:#e6f5f1;
  --paper:#fff; --bg:#f3f6f7; --line:#dce6ea; --red:#bc4350; --gold:#a46d17;
  font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  font-size:16px; color:var(--ink); background:var(--bg);
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; min-width:320px; min-height:100vh; background:linear-gradient(180deg,#e7f0f1 0,#f5f7f8 420px); }
button,input { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,input:focus-visible { outline:3px solid #22a78e; outline-offset:2px; }
h1,h2,h3,p { overflow-wrap:anywhere; }
h2 { font-size:22px; line-height:1.3; }
.topbar { height:68px; position:sticky; top:0; z-index:20; background:rgba(16,45,59,.97); color:#fff; display:flex; justify-content:space-between; align-items:center; padding:0 max(20px,env(safe-area-inset-left)); box-shadow:0 4px 16px #1533411a; }
.brand { color:#fff; text-decoration:none; display:flex; align-items:center; gap:12px; font-weight:800; font-size:18px; }
.brand-mark { display:grid; place-items:center; background:linear-gradient(135deg,#58d8b6,#edb35e); color:#102d3b; width:38px; height:38px; border-radius:12px; font-weight:900; }
.brand-mark.large { width:62px; height:62px; font-size:30px; border-radius:18px; }
.ghost,.secondary { min-height:44px; padding:8px 16px; border-radius:12px; cursor:pointer; }
.ghost { color:#fff; background:transparent; border:1px solid #738b97; }
.secondary { background:#fff; color:var(--teal); border:1px solid #98c7bc; font-weight:700; }
.secondary.saved { background:var(--teal); color:#fff; }
#app { width:min(100%,1320px); min-width:0; margin:auto; padding:30px 24px 110px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:22px; }
.page-head h1 { font-size:clamp(28px,3vw,34px); line-height:1.18; margin:6px 0 8px; letter-spacing:-.02em; }
.page-head p { margin:0; color:var(--muted); font-size:16px; }
.page-head .eyebrow { color:var(--teal); font-size:14px; }
.page-meta { color:var(--muted); font-size:15px; white-space:nowrap; }
.eyebrow { color:#43bfa5; font-size:14px; letter-spacing:.07em; font-weight:800; }
.search-entry { min-height:58px; display:flex; align-items:center; gap:14px; background:#fff; border:1px solid var(--line); border-radius:16px; padding:0 18px; color:var(--muted); text-decoration:none; box-shadow:0 8px 25px #102d3b0a; }
.search-entry span:first-child { font-size:26px; color:var(--teal); }
.search-entry b { margin-left:auto; color:var(--ink); font-size:24px; }
.freshness { color:var(--muted); font-size:14px; margin:13px 0 20px; }
.freshness.stale { color:#9f5b1b; font-weight:700; }
.market-card { background:radial-gradient(circle at 85% -40%,#2d7580 0,#133947 42%,#102d3b 100%); color:#fff; padding:30px 34px; border-radius:24px; display:flex; gap:24px; justify-content:space-between; align-items:center; }
.market-card h2 { font-size:38px; margin:12px 0; }
.market-card p { margin:0; color:#d4e6ea; }
.market-tags { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.pill { display:inline-flex; min-height:32px; align-items:center; border-radius:99px; padding:5px 12px; background:#edf2f4; color:#395360; font-weight:700; font-size:14px; }
.pill.good { background:#dff5ed; color:#0b7158; }
.pill.waiting { background:#fff1d8; color:#865b19; }
.pill.bad { background:#fee9e9; color:#a3383d; }
.section { margin-top:28px; min-width:0; }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.section-head h2,.section-head h3 { margin:0; }
.section-head h3 { font-size:20px; }
.section-head span { color:var(--muted); font-size:15px; }
.section-head a { color:var(--teal); text-decoration:none; font-weight:700; min-height:44px; display:inline-flex; align-items:center; }
.surface { background:var(--paper); border:1px solid var(--line); box-shadow:0 8px 26px #0c33400a; border-radius:20px; padding:24px; min-width:0; }
.signal-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.signal-tile { display:flex; flex-direction:column; gap:9px; padding:19px 20px; border-radius:17px; background:#fff; border:1px solid var(--line); }
.signal-tile span { color:var(--muted); font-size:15px; }
.signal-tile strong { font-size:34px; line-height:1; font-variant-numeric:tabular-nums; }
.candidate-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.empty,.loading { background:#fff; border:1px dashed #cbdadf; border-radius:18px; padding:30px 22px; text-align:center; color:var(--muted); }
.empty { display:flex; flex-direction:column; align-items:center; gap:8px; }
.empty span { display:grid; place-items:center; width:48px; height:48px; border-radius:50%; background:#edf5f4; color:var(--teal); font-size:27px; }
.empty strong { color:var(--ink); font-size:18px; }
.empty p { margin:0; font-size:15px; }
.retry { margin:15px auto; display:block; }
.section-summary { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:18px; }
.section-summary strong { font-size:26px; }
.section-summary span { font-size:14px; color:var(--muted); }
.checkpoint-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.checkpoint { display:flex; flex-direction:column; gap:7px; min-width:0; }
.checkpoint span { color:var(--muted); font-size:15px; }
.checkpoint strong { font-size:18px; }
progress { width:100%; height:10px; appearance:none; border:0; border-radius:10px; overflow:hidden; background:#e5edef; }
progress::-webkit-progress-bar { background:#e5edef; border-radius:10px; }
progress::-webkit-progress-value { background:var(--teal); border-radius:10px; }
progress::-moz-progress-bar { background:var(--teal); border-radius:10px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; }
.metric { min-width:0; padding:14px 16px; border-right:1px solid var(--line); }
.metric:last-child,.metric:nth-child(4n) { border-right:0; }
.metric span,.metric small { display:block; color:var(--muted); font-size:15px; }
.metric strong { display:block; margin:8px 0 4px; font-size:clamp(26px,2.5vw,36px); line-height:1.15; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.metric small { font-size:14px; }
.search-label { display:block; margin:6px 0 10px; font-weight:700; }
.searchbox { width:100%; height:58px; border:1px solid #bfd1d5; border-radius:14px; background:#fff; outline:none; padding:0 18px; margin-bottom:18px; font-size:17px; }
.searchbox:focus { border-color:var(--teal); box-shadow:0 0 0 3px #087a7226; }
.stock-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
.stock-row { display:flex; align-items:center; justify-content:space-between; min-height:72px; padding:14px 18px; gap:12px; color:var(--ink); text-decoration:none; background:#fff; border:1px solid var(--line); border-radius:15px; min-width:0; }
.stock-row strong,.stock-row small { display:block; }
.stock-row strong { font-size:18px; }
.stock-row small { font-size:14px; color:var(--muted); margin-top:5px; }
.stock-row b { font-size:25px; color:var(--teal); }
.back-link { display:inline-flex; align-items:center; min-height:44px; color:var(--teal); text-decoration:none; font-weight:700; }
.price-card { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; background:#fff; border:1px solid var(--line); border-radius:20px; padding:24px; }
.price-card div { display:flex; align-items:baseline; gap:17px; flex-wrap:wrap; }
.price-card .eyebrow { width:100%; color:var(--muted); }
.price-card strong { font-size:38px; line-height:1; font-variant-numeric:tabular-nums; }
.price-card>span { color:var(--muted); font-size:15px; }
.up { color:var(--red); font-weight:700; }.down { color:#087f69; font-weight:700; }
.chart-controls { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.chart-controls button { min-width:72px; min-height:44px; background:#fff; border:1px solid var(--line); border-radius:11px; cursor:pointer; }
.chart-controls button.active { background:var(--nav); color:#fff; }
.chart-wrap { width:100%; height:330px; position:relative; touch-action:pan-y; overflow:hidden; }
.chart-wrap canvas { display:block; width:100%; height:100%; }
.nav-chart { height:280px; }
.subtle { color:var(--muted); font-size:15px; line-height:1.6; }
.factor-list { display:grid; gap:10px; }
.factor-row { display:grid; grid-template-columns:90px minmax(0,1fr) 55px; align-items:center; gap:14px; min-height:40px; }
.factor-row strong { text-align:right; font-variant-numeric:tabular-nums; }
.factor-row progress { height:12px; }
.detail-grid,.horizon-grid,.strategy-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.detail-grid .section { margin-top:28px; }
.detail-grid h2 { margin-top:0; }
.horizon h3 { font-size:23px; }.horizon p { margin:10px 0 18px; }
.horizon-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; color:var(--muted); font-size:15px; }
.notice { margin-top:22px; padding:17px 20px; border-radius:14px; background:#fff5e6; color:#785522; }
.table-wrap { max-width:100%; overflow-x:auto; background:#fff; border:1px solid var(--line); border-radius:18px; }
table { width:100%; min-width:700px; border-collapse:collapse; }
th,td { text-align:left; padding:15px 17px; border-bottom:1px solid var(--line); white-space:nowrap; font-size:15px; }
th { color:var(--muted); font-weight:700; background:#f8fafb; }
td small { display:block; color:var(--muted); margin-top:4px; }
.definition { display:grid; grid-template-columns:1fr auto; gap:14px; margin:0; }
.definition dt { color:var(--muted); }.definition dd { margin:0; font-weight:700; text-align:right; overflow-wrap:anywhere; }
.menu { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.menu a { display:grid; grid-template-columns:1fr auto; gap:5px; min-height:92px; color:var(--ink); background:#fff; padding:20px; border:1px solid var(--line); border-radius:17px; text-decoration:none; }
.menu strong { font-size:19px; }.menu span { color:var(--muted); grid-column:1; }.menu b { color:var(--teal); grid-column:2; grid-row:1/3; font-size:25px; align-self:center; }
.bottom-nav { position:fixed; bottom:0; left:0; right:0; z-index:30; display:flex; justify-content:center; background:#fffffffa; border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); box-shadow:0 -5px 20px #102d3b0c; }
.bottom-nav a { width:min(20%,150px); min-height:64px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-decoration:none; color:var(--muted); font-size:14px; }
.bottom-nav b { font-size:22px; line-height:1.1; }.bottom-nav a.active { color:var(--teal); font-weight:800; }
.offline { position:fixed; left:12px; right:12px; bottom:77px; z-index:40; padding:12px; border-radius:12px; background:#8c3834; color:#fff; text-align:center; }
.hidden { display:none!important; }
.login-page { background:radial-gradient(circle at 75% 0,#20616b,#102d3b 55%); display:grid; place-items:center; min-height:100vh; padding:20px; }
.login-shell { width:min(100%,440px); }.login-card { background:#fff; border-radius:24px; padding:34px; box-shadow:0 25px 75px #071f2d55; }
.login-card h1 { font-size:32px; margin:20px 0 9px; }.login-card label { display:block; margin:20px 0 10px; font-weight:700; }
.login-card input { display:block; width:100%; min-height:52px; border:1px solid #c5d6da; border-radius:12px; padding:0 14px; margin-top:8px; }
.primary { width:100%; min-height:52px; border:0; border-radius:12px; background:var(--teal); color:#fff; font-weight:800; cursor:pointer; margin-top:20px; }
.error { color:var(--red); min-height:24px; }
@media(max-width:800px) {
  #app { padding:24px 18px 105px; }
  .signal-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric:nth-child(2n) { border-right:0; }
  .metric:nth-child(n+3) { border-top:1px solid var(--line); }
  .checkpoint-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  body { background:#f4f7f8; }
  .topbar { height:60px; padding:0 15px; }.brand { font-size:16px; gap:8px; }.brand-mark { width:34px; height:34px; }
  #app { padding:22px 14px 100px; }
  .page-head { display:block; }.page-head h1 { font-size:30px; }.page-meta { display:block; margin-top:7px; }
  .market-card { display:block; padding:24px; }.market-card h2 { font-size:34px; }.market-tags { justify-content:flex-start; margin-top:20px; }
  .signal-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.signal-tile { padding:17px; }.signal-tile strong { font-size:30px; }
  .surface { padding:18px; }.candidate-grid,.stock-list,.detail-grid,.horizon-grid,.strategy-list,.menu { grid-template-columns:1fr; }
  .metric { padding:13px 10px; }.metric strong { font-size:26px; }
  .section-summary { display:block; }.section-summary span { display:block; margin-top:6px; }
  .section-head { align-items:flex-start; }.section-head h2 { font-size:21px; }
  .price-card { display:block; padding:20px; }.price-card strong { font-size:34px; }.price-card>span { display:block; margin-top:12px; }
  .chart-wrap { height:280px; }.nav-chart { height:250px; }
  .bottom-nav a { flex:1; min-width:0; min-height:62px; }
  .login-card { padding:25px 20px; }.login-card h1 { font-size:29px; }
}
@media(max-width:380px) {
  .metric-grid { grid-template-columns:1fr; }.metric { border-right:0!important; border-top:1px solid var(--line); }.metric:first-child { border-top:0; }
  .factor-row { grid-template-columns:70px minmax(0,1fr) 48px; gap:7px; }
  .checkpoint-grid { gap:12px; }
}
@media(min-width:900px) { .bottom-nav { left:50%; right:auto; transform:translateX(-50%); width:760px; border:1px solid var(--line); border-bottom:0; border-radius:18px 18px 0 0; } }
@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; animation:none!important; } }
