/* AI Agent Economics — single stylesheet */

:root {
  --paper:        #f7f6f2;
  --surface:      #fffefa;
  --ink:          #17283b;
  --muted:        #576273;
  --line:         #d9dde0;
  --line-soft:    #e7e9ea;
  --accent:       #9a642d;
  --accent-light: #ebdcc6;
  --deep:         #17283b;
  --deep-text:    #dce2e8;
  --deep-kicker:  #e3c393;
  --footer:       #122132;
  --footer-text:  #d1d7df;

  --serif: Georgia, "Noto Serif CJK SC", "Songti SC", "Times New Roman", serif;
  --sans:  Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono:  ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail: 230px;
  --gap:  80px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #141a22;
    --surface:      #1b222c;
    --ink:          #e8e4db;
    --muted:        #a8b1bf;
    --line:         #2c3542;
    --line-soft:    #222a35;
    --accent:       #d99d5e;
    --accent-light: #4a3a27;
    --deep:         #0f1620;
    --deep-text:    #ccd4dd;
    --deep-kicker:  #e3c393;
    --footer:       #0c121a;
    --footer-text:  #b9c2cd;
  }
}

:root[data-theme="dark"] {
  --paper:        #141a22;
  --surface:      #1b222c;
  --ink:          #e8e4db;
  --muted:        #a8b1bf;
  --line:         #2c3542;
  --line-soft:    #222a35;
  --accent:       #d99d5e;
  --accent-light: #4a3a27;
  --deep:         #0f1620;
  --deep-text:    #ccd4dd;
  --deep-kicker:  #e3c393;
  --footer:       #0c121a;
  --footer-text:  #b9c2cd;
}

/* ---------- language switching ---------- */
html[data-lang="en"] [data-lang="zh"] { display: none; }
html[data-lang="zh"] [data-lang="en"] { display: none; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
}

html[data-lang="zh"] body { line-height: 1.85; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

h1, h2, h3, p { margin-top: 0; }

.skip {
  position: absolute;
  top: -80px;
  left: 16px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }

.masthead-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { font: 700 17px/1.2 var(--serif); letter-spacing: .02em; }
.brand:hover { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 32px; font-size: 14px; font-weight: 600; }
.nav a:hover, .paper-link:hover, .text-link:hover { color: var(--accent); }

.language { display: flex; gap: 4px; border-left: 1px solid var(--line); padding-left: 20px; }

.langtoggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 13px var(--sans);
  padding: 5px 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.langtoggle { border-bottom-color: var(--accent-light); }
.langtoggle:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 70px 0 69px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: max(-140px, calc((100vw - 1360px) / 2));
  top: 45px;
  border: 1px solid var(--accent-light);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px var(--paper), 0 0 0 56px var(--accent-light),
    0 0 0 110px var(--paper), 0 0 0 111px var(--accent-light);
  opacity: .8;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 820px; }

.eyebrow {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  font: normal clamp(38px, 5vw, 66px)/1.14 var(--serif);
  letter-spacing: -.04em;
  margin-bottom: 25px;
  text-wrap: balance;
}

html[data-lang="zh"] h1 { letter-spacing: -.01em; }

.lead { max-width: 740px; font-size: 20px; line-height: 1.8; margin-bottom: 31px; }

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 11px 0;
  border-bottom: 2px solid var(--accent);
  font-size: 15px;
  font-weight: 700;
}
.hero-action:hover { color: var(--accent); }

/* ---------- shared section grid ---------- */
section { scroll-margin-top: 32px; }

.railed {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: var(--gap);
}

.intro { padding-top: 78px; padding-bottom: 78px; border-bottom: 1px solid var(--line); }

.section-kicker {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section-kicker .n { font: normal 25px/1 var(--serif); letter-spacing: 0; }

.intro-body { max-width: 725px; }

.intro h2, .section-head h2, .closing h2, .team h2 {
  font: normal clamp(28px, 3vw, 40px)/1.28 var(--serif);
  letter-spacing: -.025em;
  margin-bottom: 24px;
}

.intro p { margin-bottom: 19px; }
.intro p:last-child { margin-bottom: 0; }

.intro-body a {
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 4px;
}
.intro-body a:hover { color: var(--accent); }
.intro-body strong { font-weight: 700; }

/* ---------- papers ---------- */
.papers { padding-top: 77px; padding-bottom: 84px; }

.section-head { margin-bottom: 36px; }
.section-head p { color: var(--muted); max-width: 680px; margin-bottom: 0; }

.paper-list { border-top: 1px solid var(--line); }

.paper { padding: 35px 0 39px; border-bottom: 1px solid var(--line); }

.paper-index { display: flex; gap: 18px; align-items: flex-start; padding-top: 6px; }
.paper-index .num { color: var(--accent); font: normal 33px/1 var(--serif); }
.paper-index .theme {
  padding-top: 3px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.paper h3 {
  font: normal clamp(22px, 2.3vw, 29px)/1.35 var(--serif);
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.paper h3 a:hover { color: var(--accent); }

.paper .authors {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .01em;
  margin-bottom: 17px;
}

.abstract-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.paper .summary { max-width: 750px; margin-bottom: 19px; font-size: 16px; line-height: 1.82; }

.paper-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }

.paper-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}

/* ---------- news ---------- */
.news-section { padding-top: 62px; padding-bottom: 66px; border-top: 1px solid var(--line); }

.news { list-style: none; padding: 0; margin: 0; }

.news li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}
.news li:last-child { border-bottom: none; }

.news .date {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
}

.news .entry { font-size: 16px; color: var(--ink); }
.news .entry a { color: var(--accent); border-bottom: 1px solid var(--accent-light); }
.news .entry a:hover { border-bottom-color: var(--accent); }

/* ---------- team ---------- */
.team { padding-top: 62px; padding-bottom: 66px; border-top: 1px solid var(--line); }
.team h2 { margin-bottom: 14px; }
.team .lead-note { max-width: 740px; color: var(--muted); margin-bottom: 32px; }

.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.person .name { font: 700 16px/1.4 var(--sans); margin-bottom: 4px; }
.person .affil { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.person .mail { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.person .mail a { color: var(--accent); }

/* ---------- closing ---------- */
.closing-wrap { background: var(--deep); color: #f3f0e9; }
.closing { padding-top: 75px; padding-bottom: 78px; }
.closing .section-kicker { color: var(--deep-kicker); }
.closing h2 { color: #f3f0e9; }
.closing p { max-width: 720px; margin-bottom: 0; color: var(--deep-text); }

/* ---------- footer ---------- */
.footer { background: var(--footer); color: var(--footer-text); }
.footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 25px;
  padding-bottom: 25px;
  font-size: 13px;
}
.footer a { text-decoration: underline; text-underline-offset: 4px; }

/* ================= article pages ================= */
.article { padding-top: 58px; padding-bottom: 20px; }
.article-shell { width: min(760px, calc(100% - 64px)); margin-inline: auto; }

.article-header { margin-bottom: 40px; }

.article-header h1 {
  font: normal clamp(27px, 3.4vw, 40px)/1.24 var(--serif);
  letter-spacing: -.028em;
  margin-bottom: 18px;
}

.article-header .authors { font-size: 15px; color: var(--muted); margin: 0 0 6px; }
.article-header .venue { font-size: 13px; color: var(--muted); margin: 0; }
.article-header .links { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }

.article h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 26px;
}

.article section { margin-bottom: 58px; }

.abstract { font-size: 17px; color: var(--ink); border-left: 2px solid var(--accent-light); padding-left: 24px; }
.abstract p { margin-bottom: 1.1em; }
.abstract p:last-child { margin-bottom: 0; }

.findings { list-style: none; padding: 0; margin: 0; counter-reset: f; }

.findings li { position: relative; padding-left: 42px; margin-bottom: 22px; counter-increment: f; }

.findings li::before {
  content: counter(f, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font: normal 19px/1.3 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

figure { margin: 0 0 40px; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
}

figcaption { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin-top: 11px; }
figcaption b { color: var(--ink); font-weight: 700; }

.figure-hero { margin-bottom: 46px; }

details.bib { border: 1px solid var(--line); }

details.bib summary {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
details.bib summary::-webkit-details-marker { display: none; }
details.bib summary:hover { color: var(--accent); }

details.bib pre {
  margin: 0;
  padding: 0 18px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  overflow-x: auto;
}

.copybtn {
  font: 700 11px var(--sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 4px 10px;
  cursor: pointer;
}
.copybtn:hover, .copybtn[data-copied="1"] { border-color: var(--accent); color: var(--accent); }

.pagenav { border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; margin-bottom: 40px; }
.pagenav a { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .shell { width: min(100% - 36px, 620px); }
  .article-shell { width: min(100% - 36px, 620px); }
  .masthead-inner { min-height: 68px; }
  .brand { font-size: 16px; }
  .nav { gap: 14px; }
  .nav > a { display: none; }
  .language { border-left: 0; padding-left: 0; }
  .hero { padding: 59px 0 61px; }
  .hero::after { width: 245px; height: 245px; right: -195px; top: 35px; }
  .eyebrow { font-size: 12px; margin-bottom: 20px; }
  .lead { font-size: 18px; }
  .railed { grid-template-columns: 1fr; gap: 20px; }
  .intro { padding-top: 58px; padding-bottom: 59px; }
  .papers { padding-top: 58px; padding-bottom: 60px; }
  .section-head { margin-bottom: 27px; }
  .paper { gap: 12px; padding: 29px 0 33px; }
  .paper-index { padding-top: 0; }
  .paper-index .num { font-size: 27px; }
  .paper-index .theme { padding-top: 1px; }
  .news li { grid-template-columns: 1fr; gap: 5px; }
  .people { grid-template-columns: 1fr; gap: 24px; }
  .closing { padding-top: 57px; padding-bottom: 61px; }
  .footer .shell { flex-direction: column; gap: 6px; }
  .abstract { padding-left: 16px; }
  figure img { padding: 6px; }
}

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

@media print {
  :root { --paper: #fff; --ink: #111; }
  body { color: #111; }
  .hero::after, .language, .hero-action, .masthead, .pagenav { display: none; }
  a { text-decoration: none; }
  .closing-wrap, .footer { background: #fff; color: #111; }
  .closing p, .closing h2 { color: #111; }
}
