/* App Chart Archive 站点样式。
   无构建步骤：本文件与模板一起嵌入二进制（ADR-0005），开发环境直接读取磁盘文件。 */

/* ---------- 设计令牌 ---------- */
:root {
  color-scheme: light dark;

  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --surface-3: #e6e6e0;
  --ink: #121311;
  --ink-2: #3c3e3a;
  --muted: #6b6d67;
  --line: #e4e4de;
  --line-2: #cfcfc8;

  --accent: #ff5b2e;
  --accent-ink: #121311;
  --accent-soft: #ffe9e0;

  --up: #0b7a48;
  --up-soft: #e3f4ec;
  --down: #b4232f;
  --down-soft: #fbe7e8;
  --amber: #c98a12;
  --amber-ink: #7a5100;
  --amber-soft: #fff2cf;

  --chart-line: #121311;
  --chart-fill: rgba(18, 19, 17, .07);

  --font-ui: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d0b;
    --surface: #141513;
    --surface-2: #1b1c1a;
    --surface-3: #252723;
    --ink: #f3f2ee;
    --ink-2: #c9cac4;
    --muted: #8e9089;
    --line: #242622;
    --line-2: #383a35;

    --accent: #ff7b4f;
    --accent-ink: #121311;
    --accent-soft: #3a2119;

    --up: #4cd79a;
    --up-soft: #112a20;
    --down: #ff7d70;
    --down-soft: #351b1c;
    --amber: #f2b441;
    --amber-ink: #f6c76a;
    --amber-soft: #302711;

    --chart-line: #f3f2ee;
    --chart-fill: rgba(243, 242, 238, .08);
  }
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

img { display: block; max-width: 100%; }

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.45rem + 2.7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.02;
}

h2 { font-size: clamp(1.3rem, 1.14rem + .7vw, 1.65rem); }
h3 { font-size: 1.02rem; letter-spacing: -.01em; }

p { margin: 0; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

button,
input { font: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}

.skip-link:focus { transform: translateY(0); }

.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.mono,
code,
.rank,
.movement,
.row-value,
.market-code,
.coverage-day,
td.mono {
  font-family: var(--font-mono);
}

.mono,
.rank,
.movement,
.row-value,
td.mono {
  font-variant-numeric: tabular-nums;
}

code {
  padding: .1em .35em;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: .86em;
}

.muted,
.quiet {
  color: var(--muted);
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}

.mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.mark-body { fill: var(--ink); }
.mark-bar { fill: var(--bg); }
.mark-bar.lead { fill: var(--accent); }

.site-nav {
  display: flex;
  justify-self: end;
  gap: 2px;
}

.site-nav a,
.menu-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .94rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.site-nav a:hover,
.menu-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 650;
}

.header-search {
  position: relative;
  width: 100%;
  max-width: 380px;
  justify-self: center;
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .92rem;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.header-search input::placeholder { color: var(--muted); opacity: 1; }

.header-search input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.header-search button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}

.header-search button:hover { color: var(--ink); background: var(--surface-2); }

.menu { display: none; }

.menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.menu summary::-webkit-details-marker { display: none; }

.menu-panel {
  display: grid;
  gap: 12px;
  padding: 16px 0 8px;
}

.menu-nav {
  display: grid;
  gap: 2px;
}

.menu-nav a { min-height: 46px; font-size: 1rem; }

/* ---------- 页面骨架 ---------- */
main#main-content {
  min-height: 60vh;
  padding-bottom: clamp(56px, 8vw, 104px);
}

.page-head {
  display: grid;
  gap: 16px;
  padding: clamp(36px, 6vw, 68px) 0 clamp(24px, 3.5vw, 36px);
}

.page-head .lede { max-width: 62ch; }

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--muted);
  font-size: .92rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .88rem;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 4px;
  color: var(--line-2);
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover { color: var(--ink); }

.crumbs li[aria-current] { color: var(--ink-2); }

.lede {
  color: var(--ink-2);
  font-size: clamp(1.02rem, .96rem + .3vw, 1.18rem);
  line-height: 1.55;
}

.section { padding-top: clamp(44px, 6.5vw, 72px); }

.page-head + .section { padding-top: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 28px;
  margin-bottom: 20px;
}

.section-head > div { display: grid; gap: 6px; max-width: 64ch; }

.section-head p { color: var(--muted); font-size: .95rem; }

.section-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--muted);
  font-size: .9rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 24px;
  align-items: start;
}

.side {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
}

.grid-3 {
  display: grid;
  gap: 16px;
}

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 面板 ---------- */
.panel {
  min-width: 0;
  padding: 20px 20px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 10px;
}

.panel-head > div { display: grid; gap: 4px; }

.panel-head p,
.panel-head small {
  color: var(--muted);
  font-size: .86rem;
}

.panel-foot {
  margin-top: 6px;
  padding: 12px 0 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}

/* ---------- 指标条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--ink);
}

.stat {
  min-width: 0;
  padding: 16px 20px 18px 0;
}

.stat + .stat {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.stat dt {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 500;
}

.stat dd { margin: 0; }

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.stat-value small {
  color: var(--muted);
  font-size: .5em;
  font-weight: 500;
  letter-spacing: -.01em;
}

.stat-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
}

/* ---------- 按钮、链接与分段控件 ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .96rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}

.button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button-quiet {
  border-color: var(--line-2);
  background: transparent;
  color: var(--ink);
}

.button-quiet:hover {
  border-color: var(--ink);
  background: var(--surface);
  filter: none;
}

.text-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: .28em;
  transition: text-decoration-color .2s var(--ease);
}

.text-link:hover { text-decoration-color: var(--accent); }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.segmented a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease);
}

.segmented a:hover { color: var(--ink); }

.segmented a[aria-current="page"],
.segmented a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / .06);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}

.chip:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}

/* ---------- 状态与变动标记 ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.good { background: var(--up-soft); color: var(--up); }
.status.warn { background: var(--amber-soft); color: var(--amber-ink); }
.status.bad { background: var(--down-soft); color: var(--down); }

.movement {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.1rem;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.movement.up { background: var(--up-soft); color: var(--up); }
.movement.down { background: var(--down-soft); color: var(--down); }
.movement.new { background: var(--accent); color: var(--accent-ink); }

/* ---------- 应用图标 ---------- */
.app-icon {
  position: relative;
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 23%;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
  transition: transform .25s var(--ease);
}

.app-icon-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.app-icon-image.is-loaded { opacity: 1; }

.app-icon-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 0;
}

.app-icon.placeholder { background: var(--surface-3); }

.app-hero-icon .app-icon {
  width: 104px;
  height: 104px;
  border-radius: 24%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent), 0 18px 40px -20px rgb(0 0 0 / .35);
}

.flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  flex: none;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent);
  vertical-align: -2px;
}

/* ---------- 应用列表行 ---------- */
.app-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-list > li {
  position: relative;
  min-width: 0;
}

.app-list > li + li::before {
  content: "";
  position: absolute;
  top: 0;
  right: 10px;
  left: 10px;
  height: 1px;
  background: var(--line);
}

.app-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.1rem 2.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 -10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  transition: background .18s var(--ease);
}

.app-row:hover {
  background: var(--surface-2);
}

.app-row:hover .app-icon { transform: scale(1.04); }

.app-row:hover .row-name { color: var(--accent); }

.rank {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 500;
  text-align: right;
}

.app-list > li:nth-child(-n+3) .rank { color: var(--ink); font-weight: 700; }

.row-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.row-name {
  overflow: hidden;
  font-weight: 620;
  letter-spacing: -.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s var(--ease);
}

.row-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-value {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.row-value small {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 500;
}

.bar {
  display: block;
  width: 96px;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.bar::before {
  content: "";
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.app-list.compact .app-row { grid-template-columns: 1.8rem 2.25rem minmax(0, 1fr); padding: 7px 10px; }
.app-list.compact .app-icon { width: 36px; height: 36px; }

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding: clamp(40px, 7vw, 84px) 0 clamp(40px, 6vw, 60px);
}

.hero-copy {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.hero-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .9rem;
}

.hero-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-copy h1 { max-width: 13ch; }

.hero-copy .lede { max-width: 50ch; }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .88rem;
}

.hero-tags > span { margin-right: 4px; }

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 20px 40px -28px rgb(0 0 0 / .3);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 12px 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  outline: none;
}

.search input::placeholder { color: var(--muted); opacity: 1; }

.search input::-webkit-search-cancel-button { cursor: pointer; }

.search .button { min-height: 50px; padding: 0 22px; }

.hero-panel {
  box-shadow: 0 30px 60px -44px rgb(0 0 0 / .35);
}

.hero-panel .app-list > li { animation-delay: calc(var(--i, 0) * 30ms); }

.market-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-strip a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}

.market-strip a:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  gap: 10px;
  padding: 22px 28px 0 0;
  border-top: 1px solid var(--ink);
}

.steps li + li { padding-left: 28px; border-left: 1px solid var(--line); }

.steps li + li { border-top-color: var(--ink); }

.steps h3 { font-size: 1.12rem; }

.steps p { color: var(--ink-2); font-size: .96rem; }

.steps .step-index {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .82rem;
}

/* ---------- 发现页 ---------- */
.signal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.empty {
  padding: 22px 0 14px;
  color: var(--muted);
  font-size: .94rem;
}

/* ---------- 市场目录 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.field {
  height: 44px;
  min-width: min(100%, 300px);
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.field:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.field::placeholder { color: var(--muted); opacity: 1; }

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.market-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.market-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-head h2 {
  font-size: 1.12rem;
  letter-spacing: -.02em;
}

.market-code {
  margin-left: auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
}

.market-charts {
  display: grid;
  gap: 6px;
}

.market-chart {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s var(--ease);
}

.market-chart:hover { background: var(--surface-3); }

.market-chart small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
}

.market-chart.pending { color: var(--muted); font-weight: 500; }

/* ---------- 图表与覆盖日历 ---------- */
.chart {
  position: relative;
  height: 320px;
  margin-top: 8px;
}

.coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 14px;
}

.coverage-day {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--surface-3);
}

.coverage-day.final { background: var(--ink); }
.coverage-day.provisional { background: var(--amber); }
.coverage-day.partial { background: var(--accent); }
.coverage-day.snapshot-missing,
.coverage-day.missing { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  font-size: .86rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-swatch.final { background: var(--ink); }
.legend-swatch.provisional { background: var(--amber); }
.legend-swatch.partial { background: var(--accent); }
.legend-swatch.missing { box-shadow: inset 0 0 0 1px var(--line-2); }

.date-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.date-jump input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.date-jump button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.date-jump button:hover { border-color: var(--ink); }

.trend-empty {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 26px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .92rem;
}

.trend-empty strong { color: var(--ink); font-size: 1rem; }

/* ---------- 应用页 ---------- */
.app-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px 32px;
  align-items: start;
  padding: clamp(36px, 6vw, 64px) 0 clamp(16px, 3vw, 28px);
}

.app-hero-copy {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.app-hero h1 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.2rem); }

.app-hero .lede { font-size: 1.08rem; }

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
}

.app-facts > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: .86rem;
}

.app-facts dt { color: var(--muted); }
.app-facts dd { margin: 0; font-weight: 600; }

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
}

.series-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}

.series-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.series-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.series-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.series-country {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: .95rem;
  font-weight: 620;
}

.series-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-chart {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
}

.series-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: .9rem;
}

.series-rank {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.series-rank small {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: -.01em;
}

.series-meta {
  color: var(--muted);
  font-size: .8rem;
}

.series-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 28px 0 12px;
}

.series-head h3 { font-size: 1.05rem; }

.series-head p { color: var(--muted); font-size: .9rem; }

.results-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: .9rem;
}

.results { margin-top: 14px; }

.flag-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-tight { padding-top: 28px; }

#market-trend {
  display: grid;
  gap: 22px;
}

#market-trend > .section-head { margin-bottom: 0; }

#global-overview,
#market-trend { scroll-margin-top: 88px; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom-color: var(--line-2);
}

tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--surface-2); }

td.mono { font-size: .86rem; }

td .text-link { font-weight: 600; }

/* ---------- 分页、提示与广告 ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: .9rem;
}

.pagination-links {
  display: flex;
  gap: 8px;
}

.pagination-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.pagination-links a:hover { border-color: var(--ink); }

.notice {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .94rem;
}

.notice strong { font-weight: 650; }

.ad-placement {
  display: grid;
  gap: 8px;
  min-height: 110px;
  margin: 40px 0 0;
}

.ad-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.side .panel,
.side .notice { font-size: .94rem; }

.facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.facts > div {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.facts > div:first-child { border-top: 0; padding-top: 6px; }

.facts dt {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 500;
}

.facts dd {
  margin: 0;
  color: var(--ink-2);
  font-size: .94rem;
}

.facts ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
}

.facts li + li { margin-top: 4px; }

/* ---------- 法务与说明页 ---------- */
.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 56px;
  align-items: start;
}

.prose {
  max-width: 70ch;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.7;
}

.prose h2 {
  margin: 2.4em 0 .6em;
  padding-top: .2em;
  color: var(--ink);
  font-size: clamp(1.3rem, 1.1rem + .6vw, 1.55rem);
  scroll-margin-top: 92px;
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  margin: 2em 0 .5em;
  color: var(--ink);
}

.prose p,
.prose li { margin: 0 0 1em; }

.prose li { margin-bottom: .5em; }

.prose a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
}

.prose strong { color: var(--ink); font-weight: 650; }

.prose .table-wrap { margin: 1.4em -4px 1.6em; }

.toc {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: .9rem;
}

.toc a {
  padding: 5px 0;
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover { color: var(--ink); }

/* ---------- 错误页 ---------- */
.error-page {
  display: grid;
  justify-items: start;
  gap: 18px;
  max-width: 640px;
  padding: clamp(48px, 10vw, 120px) 0 0;
}

.error-code {
  margin: 0;
  color: var(--ink);
  font-size: clamp(4.5rem, 3rem + 8vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -.07em;
  line-height: .9;
  font-variant-numeric: tabular-nums;
}

.error-page .lede { max-width: 46ch; }

.error-page .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 6px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  padding: 36px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px 40px;
}

.footer-about {
  display: grid;
  gap: 10px;
  max-width: 62ch;
}

.footer-about strong { color: var(--ink); font-weight: 650; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent); }

/* 局部替换区域（窗口、分页、系列切换）：加载期间淡化；锚点滚动时避开顶部导航。 */
.is-loading { opacity: .5; transition: opacity .2s var(--ease); }

[data-partial-anchor] { scroll-margin-top: 96px; }

/* ---------- 动效：页面切换与入场，遵循减少动态效果偏好 ---------- */
@view-transition {
  navigation: auto;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-copy > * { animation: rise .6s var(--ease) both; }
.hero-copy > *:nth-child(2) { animation-delay: 40ms; }
.hero-copy > *:nth-child(3) { animation-delay: 80ms; }
.hero-copy > *:nth-child(4) { animation-delay: 120ms; }

.hero-panel { animation: rise .7s var(--ease) 140ms both; }

.app-list > li,
.market-grid > *,
.series-grid > * {
  animation: rise .55s var(--ease) both;
  animation-delay: min(calc(var(--i, 0) * 24ms), 320ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy h1 { max-width: 16ch; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .toc {
    position: static;
    border-left: 0;
    padding-left: 0;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li,
  .steps li + li {
    padding: 18px 0 20px;
    border-left: 0;
  }
  .steps li + li { border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .signal-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .site-nav,
  .header-search,
  .header-spacer { display: none; }
  .menu { display: block; justify-self: end; }
  .menu[open] .menu-panel { animation: rise .25s var(--ease) both; }
  .menu-panel .search { box-shadow: none; }
  .app-row { grid-template-columns: 1.7rem 2.5rem minmax(0, 1fr) auto; gap: 10px; }
  .app-icon { width: 40px; height: 40px; }
  .bar { width: 72px; }
  .row-value small { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat { padding: 14px 14px 16px 0; }
  .stat + .stat { padding-left: 14px; }
  .stat-value { font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.7rem); }
  .side { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .search { flex-wrap: wrap; border-radius: 16px; }
  .search input { flex-basis: 100%; height: 48px; }
  .search .button { flex: 1; min-height: 46px; }
  .app-hero { grid-template-columns: minmax(0, 1fr); }
  .app-hero-icon .app-icon { width: 88px; height: 88px; }
  .signal-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .signal-nav .segmented { flex-wrap: nowrap; }
  .page-head { gap: 14px; }
  .segmented a { padding: 0 11px; }
  .chart { height: 260px; }
}

@media (max-width: 480px) {
  .app-list .app-row { gap: 9px; }
  .app-list .rank { font-size: .78rem; }
  .movement { min-width: 2.6rem; padding: 0 7px; }
  .market-grid { grid-template-columns: minmax(0, 1fr); }
  .error-page .actions .button { width: 100%; }
}
