:root {
  --bg:#090b13;
  --side:#0d0f19;
  --panel:#10131f;
  --panel2:#151927;
  --line:#252a3c;
  --ink:#eff0f8;
  --muted:#9da6bd;
  --accent:#aa91ff;
  --accent2:#7552df;
  --soft:#1f1b35;
  --positive:#67ccab;
  --error:#f29298;
  --button-ink:#fff;
  --rank:#d5ae6d;
  --mark-end:#31939e;
  color-scheme:dark;
}
:root[data-project="rm"] {
  --bg:#f2f2f0;
  --side:#fafaf8;
  --panel:#fff;
  --panel2:#f7f6f3;
  --line:#dfddd6;
  --ink:#24231f;
  --muted:#66625b;
  --accent:#775518;
  --accent2:#523d22;
  --soft:#f2e9d6;
  --positive:#276953;
  --error:#a22e32;
  --rank:#7c581c;
  --mark-end:#7a5828;
  color-scheme:light;
}
* { box-sizing:border-box }
[hidden] { display:none !important }
body { margin:0; background:var(--bg); color:var(--ink); font:14px/1.6 "DM Sans","PingFang SC","Microsoft YaHei",system-ui,sans-serif }
h1,h2,h3,h4,p,dl,dd { margin:0 }
a { color:var(--accent); text-decoration:none }
button,input,select { font:inherit }
button,input,select,a { -webkit-tap-highlight-color:transparent }
button, a.outline { cursor:pointer }
button:disabled { opacity:.62; cursor:default }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid var(--accent); outline-offset:3px }
code { font:13px/1.5 "IBM Plex Mono",Consolas,monospace; overflow-wrap:anywhere }
input,select { background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:9px; min-height:44px; min-width:0; padding:10px 12px }
.sr-only { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; white-space:nowrap }
.sidebar { position:fixed; inset:0 auto 0 0; width:236px; background:var(--side); border-right:1px solid var(--line); padding:33px 22px; z-index:2 }
.brand { display:flex; align-items:center; gap:13px; color:var(--accent); font-size:22px; font-weight:760; line-height:1.13; letter-spacing:1px }
.brand-mark { font-size:36px; line-height:1; font-weight:600 }
.brand small { display:block; margin-top:5px; color:var(--muted); font-size:9px; letter-spacing:3px }
.side-label { margin:44px 0 12px; color:var(--muted); font-size:12px }
.project-nav { display:grid; gap:7px }
.project-nav a,.mobile-nav a { display:flex; align-items:center; gap:10px; min-height:46px; padding:8px 12px; border:1px solid transparent; border-radius:10px; color:var(--muted); font-weight:640 }
.project-nav a[aria-current],.mobile-nav a[aria-current] { background:var(--soft); color:var(--accent); border-color:var(--line) }
.project-letter { display:grid; place-items:center; width:25px; height:25px; border:1px solid currentColor; border-radius:7px; font:650 13px/1 "DM Sans",sans-serif }
.workspace { min-height:100vh; margin-left:236px }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; height:73px; padding:0 42px; border-bottom:1px solid var(--line) }
.topbar-name { display:flex; align-items:center; gap:12px; color:var(--muted) }
.topbar-name strong { color:var(--ink); font-weight:650 }
.chain-label { color:var(--muted); font-size:12px; white-space:nowrap }
main { max-width:1370px; margin:0 auto; padding:34px 42px 58px }
.intro { margin-bottom:22px }
.intro h1 { font-size:clamp(26px,4vw,42px); font-weight:750; line-height:1.24; letter-spacing:-.025em }
.intro h1 span { color:var(--accent) }
.intro p { margin-top:9px; color:var(--muted) }
.search { display:flex; align-items:stretch; gap:10px; padding:8px; border:1px solid var(--line); border-radius:12px; background:var(--panel) }
.address-field { display:flex; flex:1; gap:8px; align-items:center; min-width:0; padding-left:11px }
.address-field input { width:100%; min-width:0; flex:1; padding-left:5px; border:none; background:transparent; font-size:16px }
.address-field input:focus-visible { outline-offset:0 }
.search-icon { position:relative; width:14px; height:14px; flex:none; border:2px solid var(--muted); border-radius:100% }
.search-icon::after { content:""; position:absolute; right:-5px; bottom:-3px; width:6px; height:2px; background:var(--muted); transform:rotate(45deg); border-radius:1px }
.primary,.outline,.plain,.text-button { display:inline-flex; align-items:center; justify-content:center; border-radius:9px; min-height:44px; padding:8px 14px; white-space:nowrap; font-weight:650 }
.primary { background:var(--accent2); color:var(--button-ink); border:1px solid var(--accent2) }
.outline,.plain { border:1px solid var(--line); background:var(--panel2); color:var(--ink) }
.plain { background:transparent }
.compact { padding-inline:9px; min-height:38px; font-size:12px }
.text-button { padding:4px 0; color:var(--accent); border:0; background:transparent; font-family:Consolas,monospace }
.source-row { display:flex; gap:8px; align-items:center; margin:10px 0 0; color:var(--muted); font-size:12px }
.source-marker { width:7px; height:7px; flex:none; border-radius:50%; background:var(--muted) }
.source-row[data-ready="true"] .source-marker { background:var(--positive) }
#sourceStatus { flex:1; min-width:0 }
.feedback { margin-top:10px; color:var(--muted); overflow-wrap:anywhere }
.feedback[data-error="true"] { color:var(--error) }
.progress { display:grid; gap:6px; margin-top:13px; color:var(--muted); font-size:12px }
.progress-bar { display:block; position:relative; overflow:hidden; height:4px; background:var(--line); border-radius:8px }
.progress-bar::after { content:""; display:block; width:35%; height:100%; background:var(--accent2); border-radius:8px; animation:progress 1.2s ease-in-out infinite alternate }
@keyframes progress { from { transform:translateX(0) } to { transform:translateX(185%) } }
.identity { display:flex; align-items:center; gap:13px; margin:24px 0 17px }
.avatar { display:grid; place-items:center; flex:none; width:51px; height:51px; background:linear-gradient(145deg,var(--accent2),var(--mark-end)); color:#fff; border-radius:13px; font:700 17px/1 Consolas,monospace }
.identity-text { flex:1; min-width:0 }
.identity-title,.full-address { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px }
.identity-title h2 { font-size:21px; line-height:1.25 }
.full-address { color:var(--muted) }
.full-address code { max-width:100%; overflow-wrap:anywhere }
.identity-links { display:flex; flex:none; align-items:center; gap:6px; flex-wrap:wrap }
.identity-links .compact { min-height:36px }
.badge { display:inline-block; border:1px solid var(--line); border-radius:6px; padding:1px 7px; color:var(--accent); background:var(--soft); font-size:11px }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px }
.metrics > div { min-width:0; border:1px solid var(--line); border-radius:11px; background:var(--bg); padding:13px 15px }
.metrics dt { color:var(--muted); font-size:12px }
.metrics dd { font-size:clamp(18px,2.4vw,27px); line-height:1.25; font-weight:720; margin-top:6px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere }
.metrics dd small { display:inline-block; white-space:nowrap; font-size:11px; color:var(--muted); font-weight:630; margin-left:4px }
.metric-hint { display:block; margin-top:9px; color:var(--muted); font-size:12px; line-height:1.55; font-weight:450 }
.metrics dd.rank,.rank { color:var(--rank) }
.overview { gap:0; border:1px solid var(--line); border-radius:11px; overflow:hidden; background:var(--panel) }
.overview > div { border:0; border-radius:0; background:transparent }
.overview > div + div { border-left:1px solid var(--line) }
.referrer { display:flex; align-items:center; gap:8px; color:var(--muted); margin:6px 0 }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:12px; overflow:hidden }
.tabs { display:flex; align-items:stretch; gap:20px; padding:0 22px; overflow:auto; scrollbar-width:thin; border-bottom:1px solid var(--line) }
.tabs button { flex:none; min-height:52px; background:transparent; color:var(--muted); border:0; border-bottom:3px solid transparent; padding:10px 5px 8px; cursor:pointer; font-weight:650 }
.tabs button[aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent) }
.tab-body { padding:24px }
h3 { font-size:19px; line-height:1.4 }
h4 { margin:18px 0 8px; font-size:14px }
.muted { color:var(--muted); font-size:13px; margin-top:5px }
.section-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:14px }
.section-gap { margin-top:25px; padding-top:18px; border-top:1px solid var(--line) }
.daily-head { align-items:flex-end }
.daily-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:14px }
.daily-metrics > div { min-height:113px; padding:15px 16px }
.daily-metrics dd { margin-top:7px }
.daily-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px }
#daily[aria-busy="true"] .daily-actions { visibility:hidden }
.count-label { color:var(--muted); background:var(--bg); border:1px solid var(--line); border-radius:7px; padding:3px 8px; font-size:12px }
.date-control,.filters label { display:grid; align-content:start; gap:4px; color:var(--muted); font-size:12px }
.date-control input { min-width:153px }
.details { display:grid; gap:0; margin-top:10px }
.details > div { display:grid; grid-template-columns:minmax(95px,1fr) minmax(0,3fr); gap:10px; padding:9px 0; border-bottom:1px solid var(--line) }
.details dt { color:var(--muted) }
.details dd { overflow-wrap:anywhere; font-weight:640 }
.ranks { display:flex; flex-wrap:wrap; list-style:none; gap:6px; padding:0; margin:0 }
.ranks li { padding:3px 7px; border:1px solid var(--line); color:var(--rank); border-radius:6px; font-size:12px }
.lines { display:grid; gap:8px }
.line { display:flex; align-items:center; justify-content:space-between; gap:9px; padding:11px 14px; border:1px solid var(--line); border-radius:9px; background:var(--bg) }
.line-body { display:grid; gap:2px; min-width:0 }
.line-title { color:var(--ink); font-weight:650; overflow-wrap:anywhere }
.line-detail { display:flex; flex-wrap:wrap; column-gap:9px; row-gap:1px; color:var(--muted); font-size:12px }
.line-detail strong { color:var(--positive); font-weight:700 }
.line .outline { flex:none; padding-inline:10px }
.more { margin-top:11px }
.filters { display:grid; grid-template-columns:repeat(2,minmax(0,250px)); gap:10px; margin-bottom:10px }
.table-wrap { overflow:auto }
table { width:100%; border-collapse:collapse; text-align:left }
th,td { padding:9px 8px; border-bottom:1px solid var(--line); overflow-wrap:anywhere }
th { font-weight:650; font-size:12px; color:var(--muted); white-space:nowrap }
td { font-size:13px }
td code { color:var(--accent) }
.tree { margin-top:10px }
.tree details { border-left:1px solid var(--line); padding-left:12px; margin:3px 0 }
.tree summary { display:list-item; cursor:pointer; color:var(--ink); min-height:43px; padding:8px 0 }
.tree-list { list-style:none; margin:0; padding:0 0 0 8px }
.tree-count { margin-left:8px; color:var(--muted); font-size:12px }
.mobile-nav { display:none }
@media (max-width:1180px) {
  .sidebar { width:206px; padding-inline:17px }
  .workspace { margin-left:206px }
  main,.topbar { padding-inline:26px }
}
@media (max-width:900px) {
  .sidebar { width:176px; padding-inline:12px }
  .workspace { margin-left:176px }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)) }
  .overview > div:nth-child(3) { border-left:0 }
  .overview > div:nth-child(n+3) { border-top:1px solid var(--line) }
}
@media (max-width:680px) {
  .sidebar { display:none }
  .workspace { margin-left:0 }
  .topbar { height:54px; padding-inline:16px }
  main { padding:21px 16px calc(86px + env(safe-area-inset-bottom)) }
  .intro { margin-bottom:15px }
  .intro p { font-size:13px }
  .search { gap:6px; padding:6px }
  .address-field { gap:5px; padding-left:7px }
  .address-field input { padding-inline:4px }
  .search .primary { padding-inline:10px }
  .identity { display:grid; align-items:start; grid-template-columns:43px minmax(0,1fr); gap:9px; margin:19px 0 14px }
  .avatar { width:43px; height:43px }
  .identity-title h2 { font-size:18px }
  .full-address { margin-top:4px }
  .full-address code { font-size:11px }
  .identity-links { grid-column:1/-1; margin-top:2px }
  .identity-links .compact { min-height:44px }
  .export-all { font-size:13px; padding-inline:12px }
  .tabs { padding-inline:11px; gap:12px }
  .tabs button { font-size:13px; padding-inline:4px }
  .tab-body { padding:17px 13px }
  .metrics { gap:8px }
  .metrics > div { padding:11px 10px }
  .metric-hint { margin-top:6px; font-size:11px }
  .overview { gap:0 }
  .date-control { width:100%; gap:6px }
  .date-control input { width:100%; text-align:center }
  .daily-metrics > div { min-height:115px }
  .daily-actions { gap:6px }
  .daily-actions .outline { flex:1; padding-inline:8px; font-size:12px }
  .line { padding:10px }
  .line .outline { font-size:12px; padding-inline:8px }
  table,tbody { display:block }
  thead { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden }
  tbody tr { display:grid; gap:3px; border:1px solid var(--line); border-radius:8px; padding:7px 8px; margin:0 0 7px; background:var(--bg) }
  tbody td { display:grid; grid-template-columns:minmax(65px,1fr) minmax(0,3.8fr); gap:6px; border:0; padding:1px 0; min-width:0; font-size:12px }
  tbody td::before { content:attr(data-label); color:var(--muted) }
  tbody td code { font-size:11px }
  .mobile-nav { position:fixed; z-index:3; inset:auto 0 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:6px 12px calc(6px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--side) }
  .mobile-nav a { justify-content:center; min-height:45px }
}
@media (prefers-reduced-motion:reduce) {
  .progress-bar::after { animation:none }
}
