/* 投放工作台 Ads Workbench — public site */
:root {
  --paper: #f4f2ea;
  --surface: #fbfaf5;
  --ink: #14201b;
  --ink-2: #2b3832;
  --muted: #56615b;
  --rule: #d8d5c9;
  --accent: #0d7a4e;          /* 只用来标「能点的」：按钮、链接 */
  --accent-ink: #f4f2ea;
  --accent-on-ink: #3fbf86;
  --panel: #14201b;           /* 深色面板（工作原理） */
  --panel-text: #e8ece5;
  --panel-muted: #9fb0a7;
  --panel-rule: #2c3a34;
  --tbd: #ffe58a;
  --font-sans: "Schibsted Grotesk", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1160px;
  --gutter: max(16px, 4vw);
  --radius: 10px;
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101614;
    --surface: #161e1b;
    --ink: #e9ece6;
    --ink-2: #cdd4ce;
    --muted: #a1aca6;
    --rule: #2a3430;
    --accent: #52d39c;
    --accent-ink: #0c1310;
    --accent-on-ink: #52d39c;
    --panel: #1a2420;
    --panel-text: #e8ece5;
    --panel-muted: #a1b2a9;
    --panel-rule: #31403a;
    --tbd: #6b5a12;
  }
}
:root[data-theme="dark"] {
  --paper: #101614; --surface: #161e1b; --ink: #e9ece6; --ink-2: #cdd4ce; --muted: #a1aca6; --rule: #2a3430;
  --accent: #52d39c; --accent-ink: #0c1310; --accent-on-ink: #52d39c; --panel: #1a2420; --panel-text: #e8ece5;
  --panel-muted: #a1b2a9; --panel-rule: #31403a; --tbd: #6b5a12;
}

/* 中英切换 */
html[data-lang="zh"] .en, html[data-lang="en"] .zh { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
mark.tbd { background: var(--tbd); color: inherit; padding: 0 0.2em; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 12px; }
.draft-bar { background: var(--tbd); color: #3a2f00; font-size: 0.85rem; text-align: center; padding: 6px var(--gutter); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font: inherit; font-weight: 600; line-height: 1.2;
  padding: 0.85em 1.35em; border-radius: 999px; border: 1.5px solid var(--accent);
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms, color 160ms, box-shadow 160ms;
}
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { box-shadow: 0 6px 18px -8px var(--accent); transform: translateY(-1px); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-sm { padding: 0.55em 1.05em; font-size: 0.92rem; }
.btn .arrow { transition: transform 160ms var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* 页头 */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand svg { width: 32px; height: 32px; color: var(--ink); flex: none; }
.brand-name { display: flex; flex-direction: column; font-weight: 700; font-size: 1.02rem; line-height: 1.1; letter-spacing: 0.02em; }
.brand-name small { font-family: var(--font-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; }
.nav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lang { font: 500 0.85rem var(--font-mono); color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; cursor: pointer; min-width: 52px; }
.lang:hover { border-color: var(--ink); }

/* 首屏 */
.hero { padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) var(--space-section); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.eyebrow { font: 500 0.78rem/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.2rem; }
.hero h1 { font-size: clamp(3rem, 1.6rem + 6vw, 6.2rem); font-weight: 700; letter-spacing: 0.01em; }
.hero h1 .sub { display: block; font-size: 0.34em; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 0.45em; }
.lead { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); line-height: 1.55; color: var(--ink-2); max-width: 34em; margin: 1.6rem 0 2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { list-style: none; padding: 0; margin: 2.4rem 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.92rem; color: var(--muted); }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: 0.55; }

.reveal { animation: rise 700ms var(--ease) both; }
.reveal-2 { animation-delay: 90ms; }
.reveal-3 { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 工作原理面板 */
.flow { background: var(--panel); color: var(--panel-text); border-radius: 18px; padding: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); box-shadow: 0 30px 60px -40px rgba(10, 20, 15, 0.55); position: relative; }
.flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 1.4rem; }
.flow-head h2 { font-size: 1.05rem; font-weight: 600; }
.flow-head span { font: 500 0.72rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--panel-muted); }
.flow ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.flow li { position: relative; padding: 0 0 1.35rem 3rem; counter-increment: step; }
.flow li:last-child { padding-bottom: 0; }
.flow li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border: 1px solid var(--panel-rule); border-radius: 50%; display: grid; place-items: center; font: 500 0.75rem var(--font-mono); color: var(--accent-on-ink); background: var(--panel); z-index: 1; }
.flow li::after { content: ""; position: absolute; left: 1.05rem; top: 2.1rem; bottom: 0; width: 1px; background: var(--panel-rule); }
.flow li:last-child::after { display: none; }
.flow h3 { font-size: 1rem; font-weight: 600; margin: 0.3rem 0 0.25rem; }
.flow p { margin: 0; color: var(--panel-muted); font-size: 0.93rem; line-height: 1.55; }

/* 分区 */
.section { padding-block: var(--space-section); border-top: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 2rem 4rem; align-items: end; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.section-head h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem); }
.section-head p { color: var(--ink-2); margin: 0; max-width: 38em; }
.kicker { font: 500 0.78rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.9rem; }

/* 功能：编号行 */
.rows { border-top: 1.5px solid var(--ink); }
.row { display: grid; grid-template-columns: 5rem minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1rem 2.5rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.row-no { font: 500 0.95rem var(--font-mono); color: var(--muted); padding-top: 0.3rem; }
.row h3 { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.8rem); }
.row p { color: var(--ink-2); }
.row ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
.row li { margin-bottom: 0.35em; }
.note { margin-top: 2rem; padding: 1.1rem 1.3rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink-2); font-size: 0.95rem; }

/* 数据表 */
.access { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; margin-bottom: 2.5rem; }
.access div { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.access h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.access p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.data-table caption { text-align: left; font: 500 0.78rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-bottom: 0.8rem; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 1rem 1.2rem 1rem 0; border-bottom: 1px solid var(--rule); }
.data-table thead th { font-weight: 600; font-size: 0.85rem; color: var(--muted); border-bottom: 1.5px solid var(--ink); }
.data-table tbody th { font-weight: 600; width: 22%; }
.data-table td:nth-child(2) { width: 40%; color: var(--ink-2); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 3rem; margin-top: 3rem; }
.split h3 { font-size: 1.2rem; margin-bottom: 0.8rem; }
.split ul { margin: 0; padding: 0; list-style: none; }
.split li { padding: 0.75rem 0; border-top: 1px solid var(--rule); color: var(--ink-2); }
.split li strong { color: var(--ink); font-weight: 600; }
.more { margin-top: 2.5rem; }

/* 护栏 */
.guards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--surface); }
.guards div { padding: 1.4rem 1.5rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.guards div:nth-child(3n) { border-right: 0; }
.guards div:nth-last-child(-n+3) { border-bottom: 0; }
.guards h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.guards p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* 政策与联系 */
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 2rem 4rem; align-items: start; }
.contact h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.3rem); margin-bottom: 1rem; }
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.contact-list li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.contact-list .k { font: 500 0.8rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.contact-list a { word-break: break-word; }

/* 法律页 */
.doc-hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) 2rem; border-bottom: 1px solid var(--rule); }
.doc-hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.5vw, 4.2rem); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 1.2rem; color: var(--muted); font-size: 0.93rem; }
.doc-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 4rem; padding-block: 3rem var(--space-section); }
.toc { position: sticky; top: 90px; align-self: start; font-size: 0.92rem; }
.toc h2 { font: 500 0.75rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: block; padding: 0.35rem 0 0.35rem 2rem; color: var(--ink-2); text-decoration: none; position: relative; border-left: 1px solid var(--rule); }
.toc a::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0.6rem; font: 0.72rem var(--font-mono); color: var(--muted); top: 0.55rem; }
.toc a:hover { color: var(--accent); border-left-color: var(--accent); }
.doc { max-width: 46rem; }
.doc section { padding-bottom: 2.2rem; margin-bottom: 2.2rem; border-bottom: 1px solid var(--rule); }
.doc section:last-child { border-bottom: 0; }
.doc h2 { font-size: 1.45rem; margin-bottom: 1rem; display: flex; gap: 0.8rem; align-items: baseline; }
.doc h2 .n { font: 500 0.85rem var(--font-mono); color: var(--muted); }
.doc h3 { font-size: 1.08rem; margin: 1.4rem 0 0.6rem; }
.doc ul, .doc ol { padding-left: 1.2em; margin: 0 0 1em; }
.doc li { margin-bottom: 0.45em; }
.doc .data-table { margin: 0.5rem 0 1.2rem; font-size: 0.93rem; }
.callout { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--ink); border-radius: 6px; padding: 1rem 1.2rem; margin: 1rem 0 1.4rem; }
.callout p:last-child { margin-bottom: 0; }
.back { margin-top: 1rem; }

/* 404 */
.notfound { padding-block: 8rem; }
.notfound h1 { font-size: clamp(2.5rem, 2rem + 3vw, 4rem); margin-bottom: 1rem; }

/* 页脚 */
.foot { border-top: 1.5px solid var(--ink); background: var(--surface); padding-top: 3.5rem; margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 2rem; padding-bottom: 2.5rem; }
.foot-brand p { color: var(--muted); font-size: 0.93rem; margin-top: 1rem; max-width: 24em; }
.foot-h { font: 500 0.75rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.5rem; font-size: 0.95rem; }
.foot li a { color: var(--ink-2); text-decoration: none; }
.foot li a:hover { color: var(--accent); text-decoration: underline; }
.foot p { font-size: 0.95rem; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 2rem; border-top: 1px solid var(--rule); padding-block: 1.3rem 2rem; font-size: 0.82rem; color: var(--muted); }

/* 响应式 */
@media (max-width: 980px) {
  .nav { display: none; }
  .top-actions { margin-left: auto; }
  .hero-grid, .section-head, .contact { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .row > div:last-child { grid-column: 2; }
  .guards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guards div { border-right: 1px solid var(--rule) !important; border-bottom: 1px solid var(--rule) !important; }
  .guards div:nth-child(2n) { border-right: 0 !important; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .toc { position: static; }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .brand-name small { display: none; }
  .access, .split { grid-template-columns: minmax(0, 1fr); }
  .guards { grid-template-columns: minmax(0, 1fr); }
  .guards div { border-right: 0 !important; }
  .guards div:last-child { border-bottom: 0 !important; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table th, .data-table td { display: block; width: auto !important; }
  .data-table tr { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
  .data-table th, .data-table td { border: 0; padding: 0.2rem 0; }
  html[data-lang="zh"] .data-table td[data-label-zh]::before { content: attr(data-label-zh); }
  html[data-lang="en"] .data-table td[data-label-en]::before { content: attr(data-label-en); }
  .data-table td::before { display: block; font: 500 0.72rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 0.4rem; }
  .contact-list li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .btn { width: 100%; justify-content: center; }
  .top .btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
