:root {
  --ink: #111a2d;
  --muted: #8b97ac;
  --line: #e6e9f0;
  --surface: #f6f7f9;
  --green: #08b769;
  --red: #f0443c;
  --orange: #f39318;
  --shadow: 0 24px 80px rgba(15, 23, 42, .14);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: #eef0f4;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; }

.shell {
  width: min(880px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 30px 56px;
  background: #fff;
  border-inline: 1px solid #dfe3ea;
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 28px; font-weight: 850; text-decoration: none; letter-spacing: -.04em; }
.brand-bars { display: flex; align-items: end; gap: 3px; height: 30px; }
.brand-bars i { width: 6px; display: block; border-radius: 1px 1px 0 0; }
.brand-bars i:nth-child(1) { height: 18px; background: var(--green); }
.brand-bars i:nth-child(2) { height: 27px; background: #17213a; }
.brand-bars i:nth-child(3) { height: 13px; background: var(--red); }
.stream-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.stream-status span { width: 8px; height: 8px; border-radius: 50%; background: #aab2c0; box-shadow: 0 0 0 4px #edf0f4; }
.stream-status.live span { background: var(--green); box-shadow: 0 0 0 4px #d9f7e8; }
.stream-status.offline span { background: var(--orange); box-shadow: 0 0 0 4px #fff0d9; }

.notice { padding: 20px 24px; border-radius: 22px; color: var(--muted); background: var(--surface); font-size: 17px; line-height: 1.55; }
.notice span { color: var(--orange); font-weight: 750; white-space: nowrap; }

.search-box { height: 82px; margin: 24px 0; padding: 0 26px; display: flex; align-items: center; gap: 20px; border: 2px solid var(--line); background: #fafbfc; border-radius: 24px; transition: border .2s, box-shadow .2s; }
.search-box:focus-within { border-color: #a8b2c3; box-shadow: 0 0 0 4px #f2f4f7; }
.search-box svg { width: 34px; height: 34px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 25px; }
.search-box input::placeholder { color: #9299a5; }
.search-box button { display: none; width: 34px; height: 34px; padding: 0; border: 0; background: #e9ecf1; border-radius: 50%; cursor: pointer; color: #7e8797; font-size: 24px; line-height: 1; }
.search-box.has-value button { display: block; }

.chain-tabs { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px 4px 28px; }
.chain-tabs::-webkit-scrollbar { display: none; }
.chain-tabs button { flex: 0 0 auto; padding: 14px 25px; border: 1px solid #e1e5ec; border-radius: 999px; background: #f7f8fa; color: #596477; font-size: 17px; font-weight: 760; cursor: pointer; transition: .2s ease; }
.chain-tabs button:hover { transform: translateY(-1px); border-color: #cbd2dc; }
.chain-tabs button.active { color: #fff; background: var(--ink); border-color: var(--ink); }

.market-card { overflow: hidden; border: 2px solid var(--line); border-radius: 28px; background: #fff; }
.table-head { display: none; }
.token-list { padding: 10px 30px; }
.token-row { min-height: 121px; display: grid; grid-template-columns: minmax(260px, 1fr) minmax(120px, auto); align-items: center; gap: 24px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .18s; }
.token-row:last-child { border-bottom: 0; }
.token-row:hover { margin-inline: -20px; padding-inline: 20px; background: #fafbfc; }
.token-main { min-width: 0; display: flex; align-items: center; gap: 20px; }
.token-avatar { position: relative; width: 68px; height: 68px; flex: 0 0 68px; display: grid; place-items: center; overflow: visible; border-radius: 50%; color: #fff; font-size: 24px; font-weight: 850; background: var(--avatar, #8190a5); }
.token-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.chain-badge { position: absolute; right: -3px; bottom: -2px; width: 24px; height: 24px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--badge, #695cff); font-size: 11px; }
.token-copy { min-width: 0; }
.symbol-line { display: flex; align-items: center; gap: 9px; }
.symbol-line strong { font-size: 24px; letter-spacing: .02em; }
.risk { padding: 3px 7px; border-radius: 6px; background: #ffe3e6; color: #fb4054; font-size: 12px; font-weight: 800; }
.token-meta { overflow: hidden; margin-top: 7px; color: var(--muted); font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.price-cell { text-align: right; font-variant-numeric: tabular-nums; }
.token-price { position: relative; display: grid; min-height: 1.18em; overflow: hidden; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; font-weight: 800; line-height: 1.18; letter-spacing: -.04em; white-space: nowrap; }
.token-price > span { grid-area: 1 / 1; justify-self: end; will-change: transform, opacity; }
.token-price.rolling-up .price-old { animation: price-roll-up-old .34s cubic-bezier(.22, .8, .28, 1) both; }
.token-price.rolling-up .price-new { animation: price-roll-up-new .34s cubic-bezier(.22, .8, .28, 1) both; }
.token-price.rolling-down .price-old { animation: price-roll-down-old .34s cubic-bezier(.22, .8, .28, 1) both; }
.token-price.rolling-down .price-new { animation: price-roll-down-new .34s cubic-bezier(.22, .8, .28, 1) both; }
@keyframes price-roll-up-old { to { opacity: 0; transform: translateY(-110%); } }
@keyframes price-roll-up-new { from { opacity: 0; transform: translateY(110%); } to { opacity: 1; transform: translateY(0); } }
@keyframes price-roll-down-old { to { opacity: 0; transform: translateY(110%); } }
@keyframes price-roll-down-new { from { opacity: 0; transform: translateY(-110%); } to { opacity: 1; transform: translateY(0); } }
.change { margin-top: 5px; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; font-weight: 850; }
.change.down { color: var(--red); }

.loading-row { height: 121px; display: grid; grid-template-columns: 70px 1fr 120px; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.loading-row span { height: 22px; border-radius: 9px; background: linear-gradient(90deg, #f0f2f5, #fafafa, #f0f2f5); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.loading-row span:first-child { width: 68px; height: 68px; border-radius: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { padding: 72px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state div { font-size: 42px; }
.empty-state strong { color: var(--ink); font-size: 18px; }

.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 42, .32); backdrop-filter: blur(3px); }
.detail-panel { position: fixed; z-index: 30; top: 0; right: 0; width: min(520px, 100%); height: 100vh; overflow-y: auto; padding: 26px 24px 50px; background: #fff; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .28s cubic-bezier(.22,.9,.3,1); }
.detail-panel.open { transform: translateX(0); }
.close-detail { position: absolute; z-index: 2; top: 21px; right: 20px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--surface); color: #748095; font-size: 25px; line-height: 1; cursor: pointer; }
.detail-title { display: flex; align-items: center; gap: 13px; padding-right: 45px; }
.detail-title .token-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 16px; }
.detail-title .chain-badge { width: 17px; height: 17px; border-width: 2px; font-size: 8px; }
.detail-title h2 { margin: 0; font-size: 20px; }
.detail-title p { margin: 3px 0 0; color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }
.detail-price-line { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.detail-price { font-size: 34px; font-weight: 880; letter-spacing: -.04em; }
.gain-pill { padding: 4px 7px; border-radius: 8px; color: #079757; background: #dff8eb; font-size: 13px; font-weight: 800; }
.gain-pill.down { color: #d8332d; background: #ffe6e3; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-tags span { padding: 5px 8px; border: 1px solid #e7eaf0; border-radius: 7px; color: #788398; background: #fafbfc; font-size: 11px; }
.detail-tags span:last-child { border: 0; color: #098e55; background: #e3f7ec; }
.time-tabs { display: flex; gap: 4px; margin: 10px 0 7px; }
.time-tabs button { flex: 1; min-height: 34px; padding: 7px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease; }
.time-tabs button:hover { color: var(--ink); background: #eef1f5; }
.time-tabs button:focus-visible { outline: 2px solid #7058f5; outline-offset: 2px; }
.time-tabs button:active { transform: scale(.97); }
.time-tabs button.active { color: #fff; background: var(--ink); }
.time-tabs button.active:hover { color: #fff; background: var(--ink); }
.chart-box { position: relative; height: 216px; overflow: hidden; border: 1px solid #dfe4eb; border-radius: 18px; background: #f7f8fa; }
.chart-box.loading { display: grid; place-items: center; }
.chart-box svg { width: 100%; height: 100%; }
.chart-box .grid { stroke: #e1e5eb; stroke-width: 1; }
.chart-box .wick { stroke-width: 1.3; }
.chart-box .current-line { stroke: #11b66b; stroke-width: 1; stroke-dasharray: 4 4; opacity: .65; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.chart-loading { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.chart-loading span { width: 16px; height: 16px; border: 2px solid #dfe4eb; border-top-color: var(--ink); border-radius: 50%; animation: chart-spin .7s linear infinite; }
@keyframes chart-spin { to { transform: rotate(360deg); } }
.section-label { margin: 16px 0 9px; font-size: 14px; font-weight: 850; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.metric { min-height: 64px; padding: 11px 12px; border: 1px solid #e2e6ec; border-radius: 13px; background: #f8f9fb; }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 7px; font-family: ui-monospace, monospace; font-size: 15px; }
.contract-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 13px; border: 1px solid #e1e5eb; border-radius: 13px; background: #f8f9fb; color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; }
.contract-row span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.contract-row button { border: 1px solid #dfe4eb; border-radius: 7px; background: #fff; color: #68748a; cursor: pointer; }
.pressure { display: flex; height: 9px; overflow: hidden; border-radius: 99px; background: #eee; }
.pressure i:first-child { width: 59%; background: var(--green); }
.pressure i:last-child { flex: 1; background: var(--red); }
.pressure-labels { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11px; }
.pressure-labels span:first-child { color: var(--green); }.pressure-labels span:last-child { color: var(--red); }
.trade-row { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 9px; min-height: 43px; border-bottom: 1px solid var(--line); font-size: 12px; }
.trade-row .buy { color: var(--green); }.trade-row .sell { color: var(--red); }
.trade-row .wallet, .trade-row time { color: var(--muted); }
.trade-row strong { font-family: ui-monospace, monospace; }

@media (max-width: 720px) {
  .shell { width: 100%; padding: 24px 16px 40px; border: 0; }
  .brand { font-size: 23px; }
  .notice { padding: 16px 18px; border-radius: 18px; font-size: 14px; }
  .search-box { height: 66px; padding: 0 18px; border-radius: 19px; }
  .search-box svg { width: 27px; height: 27px; }
  .search-box input { font-size: 19px; }
  .chain-tabs { padding-bottom: 20px; }
  .chain-tabs button { padding: 11px 19px; font-size: 15px; }
  .market-card { border-radius: 22px; }
  .token-list { padding: 6px 18px; }
  .token-row { min-height: 102px; grid-template-columns: minmax(170px, 1fr) 102px; gap: 10px; }
  .token-main { gap: 12px; }
  .token-avatar { width: 54px; height: 54px; flex-basis: 54px; font-size: 19px; }
  .chain-badge { width: 20px; height: 20px; }
  .symbol-line strong { font-size: 19px; }
  .token-meta { font-size: 13px; }
  .token-price { font-size: 17px; }
  .change { font-size: 14px; }
  .detail-panel { top: 4vh; width: 100%; height: 96vh; border-radius: 24px 24px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .token-price.rolling-up .price-old,
  .token-price.rolling-up .price-new,
  .token-price.rolling-down .price-old,
  .token-price.rolling-down .price-new { animation: none; }
}
