/* BuyToken public site.
   Light "paper" surface, hairline borders, one deep-green accent, generous
   vertical rhythm. Everything is plain CSS on purpose — no build step, so the
   page ships inside the relay binary as-is. */

/* Inter for Latin letters and figures, JetBrains Mono for keys and code. Both
   are SIL OFL 1.1 (licences beside the files in fonts/) and self-hosted, since
   Google Fonts is unreliable from mainland China. Chinese text falls through to
   the system face: PingFang on macOS / iOS, Microsoft YaHei on Windows. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1c1f23;
  --ink-2: #4a4f55;
  --ink-3: #80868b;

  --green: #047857;
  --green-d: #065f46;
  --green-l: #34d399;
  --tint: #f6faf7;
  --tint-2: #ecfdf3;

  --line: #eaecef;
  --line-2: #e5e7eb;
  --line-3: #dadce0;

  --panel: #0f1115;
  --panel-2: #1a1d23;

  --wrap: none;
  /* Side gutter shared by the header, the console and public pages. Phones keep 14px (see the
     max-width: 899.98px block). 3.2vw is 46px at 1440 and caps at 56px on large screens. */
  --pad: clamp(20px, 3.2vw, 56px);

  /* Right-edge fade for the horizontal chip strips phones fall back to. */
  --strip-fade: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;

  --sh-card: 0 8px 30px rgba(15, 23, 42, .06);
  --sh-hero: 0 20px 60px rgba(15, 23, 42, .08);

  --font: "Inter", -apple-system, system-ui, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
}

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

/* scrollbar-gutter: where scrollbars take space (Windows, or a Mac set to always show them), a page
   that scrolls loses 15px on the right and one that does not keeps it, so the right edge jumped
   between 令牌管理 (scrolls) and 用量日志 (fixed height, never scrolls). Reserving the gutter on
   every page keeps the header and content edges in one place. No effect with overlay scrollbars. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
/* Light text on a dark fill reads better with grayscale antialiasing; dark
   text on white (everything else) keeps the platform's own, which is what
   makes New API's text look crisp next to ours. */
.code, .brand-note, .signup-story, .hp-hero-card, .hp-hero-main, .ccs-hero,
.ccs-modal[data-page="0"] .ccs-nav, .ccs-tile-bt, .ccs-go, .ccs-step-no {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Short public pages should still finish at the bottom of the viewport instead
   of leaving their footer floating halfway up a tall monitor. */
body > main,
body > .app { flex: 1 0 auto; }
body > .foot { margin-top: auto; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 600; }

p { margin: 0; }

code {
  font-family: var(--mono);
  font-size: .92em;
}

/* Horizontal longhands, not the `padding` shorthand: these container classes
   get composed with others that set vertical padding (e.g. `wrap-wide hdr-in`),
   and a shorthand would silently zero that out depending on source order. */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- header ---------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.hdr-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px; /* floor, so the bar keeps its shape whatever it holds */
  padding-top: 14px;
  padding-bottom: 14px;
}

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

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.brand-domain {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--green-d);
  line-height: 1.2;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 148px;
  height: 34px;
  flex: 0 0 auto;
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.005em;
}

.nav {
  display: none;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: var(--ink-2);
}

.nav a { transition: color .15s ease; }
.nav a:hover { color: var(--ink); }

.hdr-cta { display: flex; align-items: center; gap: 12px; }

/* Header account balance. Sits left of the language switch, where the QQ group
   pop-over used to be. The label shows on wider screens and collapses to the
   wallet glyph plus the amount on a phone, so the account block and 退出 keep
   their room. Colours follow the wallet page: under ¥5 is low, below zero is
   overdrawn. */
.hdr-bal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hdr-bal-ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Unclaimed trial credit: a pill left of the balance. It is the one warm-coloured
   control in a header of green and white ones, with a gift glyph, the amount in
   a white chip and a slow halo, so a new account cannot miss it. The halo stops
   while the claim is running and for anyone who asks for reduced motion. The
   long label gives way to a short one on a phone so the header keeps one line. */
.btn.hdr-claim {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px 8px 14px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 4px 14px rgba(234, 88, 12, .38);
  animation: hdr-claim-halo 2.6s ease-out infinite;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn.hdr-claim:hover {
  background: linear-gradient(135deg, #c2410c, #9a3412);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(194, 65, 12, .45);
}
.btn.hdr-claim:focus-visible { outline-color: rgba(234, 88, 12, .5); }
.btn.hdr-claim:disabled { opacity: .7; cursor: default; animation: none; transform: none; }
.hdr-claim .hdr-claim-ico {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hdr-claim .hdr-claim-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #c2410c;
  background: #fff;
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.35;
}
@keyframes hdr-claim-halo {
  0% { box-shadow: 0 4px 14px rgba(234, 88, 12, .38), 0 0 0 0 rgba(249, 115, 22, .5); }
  70% { box-shadow: 0 4px 14px rgba(234, 88, 12, .38), 0 0 0 11px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 4px 14px rgba(234, 88, 12, .38), 0 0 0 0 rgba(249, 115, 22, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .btn.hdr-claim { animation: none; }
}
.hdr-claim .hdr-claim-short { display: none; }
@media (max-width: 520px) {
  .hdr-claim .hdr-claim-full { display: none; }
  .hdr-claim .hdr-claim-short { display: inline; }
  .hdr-claim .hdr-claim-ico { display: none; }
  .btn.hdr-claim { gap: 5px; padding: 7px 7px 7px 12px; }
  .hdr-claim .hdr-claim-amt { padding: 1px 8px; }
}
.hdr-bal-label { color: var(--ink-2); }
.hdr-bal-amt { font-weight: 600; color: var(--green-d); }
.hdr-bal-low .hdr-bal-amt { color: #b45309; }
.hdr-bal-neg .hdr-bal-amt { color: #e5484d; }
/* Only on a narrow phone does the label go: the wallet glyph beside the amount
   still says what the number is. */
@media (max-width: 520px) {
  .hdr-bal-label { display: none; }
  .hdr-bal { padding-left: 10px; padding-right: 10px; }
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 13px;
  white-space: nowrap;
}

.lang-switch a { color: var(--ink-2); }
.lang-switch a:hover,
.lang-switch a[aria-current="true"] { color: var(--green); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn:focus-visible {
  outline: 2px solid rgba(4, 120, 87, .35);
  outline-offset: 2px;
}

.btn-solid { background: var(--green); color: #fff; }
.btn-solid:hover { background: var(--green-d); }

.btn-ghost {
  border: 1px solid var(--line-3);
  color: var(--green);
  background: #fff;
}
.btn-ghost:hover { background: var(--tint); border-color: #c7d9d0; }

.btn-lg { padding: 12px 26px; }

/* ---------- shared section furniture ---------- */

.sec {
  border-top: 1px solid var(--line);
  padding: 88px 0;
  /* keep anchor targets clear of the sticky header */
  scroll-margin-top: 64px;
}

.sec-head {
  display: grid;
  gap: 20px;
  margin-bottom: 44px;
}

.eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 12px;
}

.sec-head h2 {
  font-size: clamp(27px, 3.4vw, 40px);
  line-height: 1.2;
  letter-spacing: -.01em;
}

.sec-note {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 460px;
}

.sec-note code {
  background: var(--tint-2);
  color: var(--green-d);
  padding: 2px 6px;
  border-radius: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.pill-g { background: var(--tint-2); border-color: #c6f0da; color: var(--green-d); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
}

.ico {
  width: 22px;
  height: 22px;
  /* Icons live next to text that wraps on a phone; without this they get
     squashed off their viewBox ratio instead of holding their size. */
  flex: none;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- hero ---------- */

/* Launch strip above the hero. Amber rather than the brand green so it reads as
   news instead of another call to action, and compact enough on a phone that it
   does not push the ¥ gift chip out of the first screen. */
.deal-strip {
  display: flex;
  /* The callout is operator copy and can be a whole sentence, not just a
     「4 折」 chip. Wrapping lets a long one drop to its own row instead of
     crushing the title into a one-word column and widening the page. */
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  padding: 14px 20px;
  border: 1px solid #f0c98a;
  border-left: 5px solid #d97706;
  border-radius: 14px;
  background: linear-gradient(90deg, #fff8ec, #fffdf8);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}

.deal-strip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(217, 119, 6, .18);
  color: var(--ink);
}

.deal-flag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: #d97706;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.deal-main {
  display: flex;
  /* Grows into the row but claims at least 14em before the callout may sit
     beside it; below that the callout wraps under it. */
  flex: 1 1 14em;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.deal-title {
  font-size: clamp(17px, 2.1vw, 23px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.deal-note { font-size: 13px; color: var(--ink-2); }

.deal-off {
  flex: 0 1 auto;
  min-width: 0;
  /* Beside the title it never takes more than ~half the row; a longer
     callout wraps inside the chip. Alone on its own row it may use it all. */
  max-width: 48%;
  padding: 6px 14px;
  /* Half the one-line height: a pill on one line, a rounded box on two. */
  border-radius: 18px;
  background: #d97706;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.deal-arw { flex: none; font-size: 17px; font-weight: 700; color: #d97706; }

@media (max-width: 900px) {
  /* Too narrow for the title and a sentence-long callout side by side: the
     callout takes the row under the title, and the → follows it. */
  .deal-off { max-width: 100%; }
}

@media (max-width: 620px) {
  .deal-strip { gap: 8px 9px; padding: 12px 14px; border-radius: 12px; }
  /* Narrower floor on a phone so a short 「官方 4 折」 still shares the row
     at 360px; anything much longer goes to the row below. */
  .deal-main { flex-basis: 7em; }
  .deal-title { font-size: 16px; line-height: 1.45; }
  /* The note is the first thing to go: the headline and the 折 are what make
     this worth a row of the first screen. */
  .deal-note { display: none; }
  .deal-off { padding: 5px 11px; border-radius: 14px; font-size: 13px; }
  .deal-arw { display: none; }
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 72px 0 88px;
}

.hero-copy { display: flex; flex-direction: column; }

.hero h1 {
  margin-top: 24px;
  max-width: 640px;
  font-size: clamp(31px, 4.6vw, 50px);
  line-height: 1.16;
  letter-spacing: -.02em;
}

.hero h1 .g { color: var(--green); }

.lead {
  margin-top: 24px;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-2);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .8);
  padding: 16px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.mini:hover {
  transform: translateY(-1px);
  border-color: #d2e7dc;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .05);
}

.mini h3 { margin-top: 10px; font-size: 14px; }

.mini p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}

.ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-2);
}

.ticks li { display: flex; align-items: center; gap: 7px; }

.ticks li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 999px;
  background: var(--tint-2);
  /* check mark */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.2 4.8 8.4 9.4 3.8' fill='none' stroke='%23047857' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

/* first-screen invoice banner, links to the invoice section */

.hero-inv {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 20px;
  border: 1px solid #fecaca;
  border-radius: var(--r);
  background: #fef2f2;
  padding: 14px 18px;
  color: #b91c1c;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.hero-inv:hover {
  border-color: rgba(185, 28, 28, .45);
  box-shadow: var(--sh-card);
}

.hero-inv .ico { width: 20px; height: 20px; flex: none; stroke: #dc2626; }

.hero-inv-t { font-size: 15px; font-weight: 600; white-space: nowrap; }

.hero-inv-d {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: var(--ink-2);
}

.hero-inv-arw { flex: none; font-size: 15px; transition: transform .15s ease; }

.hero-inv:hover .hero-inv-arw { transform: translateX(3px); }

/* ---------- hero card ---------- */

/* The hero's default second column. A campaign replaces it while one runs;
   with neither, the copy stretches the full width and the right half of the
   first screen is empty. */
.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-self: start;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 28px;
  box-shadow: var(--sh-hero);
}

.glow {
  position: absolute;
  top: -120px;
  right: -100px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(4, 120, 87, .12), transparent 68%);
  pointer-events: none;
}

.card-title {
  position: relative;
  margin-top: 18px;
  font-size: 22px;
  letter-spacing: -.02em;
}

.card-sub {
  position: relative;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}

.kv {
  position: relative;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}

.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.kv dt { font-size: 12px; color: var(--ink-3); }

.kv dd {
  margin: 0;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.card-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
}

.card-link:hover { color: var(--green-d); }
.card-link .arw { transition: transform .15s ease; }
.card-link:hover .arw { transform: translateX(3px); }

/* ---------- hero ad slot ---------- */

/* Artwork is desktop-only. On a phone the 3:2 poster used to lead the hero
   (order: -1) and pushed 注册立得 ¥1 below the fold; the compact chip next
   to the gift is the campaign on that width. */
.hero-ad {
  display: none;
}

/* Solid, not outlined: on a phone this chip is the whole campaign, so it has
   to read as loudly as the ¥1 gift it sits under rather than as a quiet tag. */
.hero-ad-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ea580c, #b45309);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(234, 88, 12, .34);
  transition: transform .15s ease, box-shadow .15s ease;
  /* Two lines on a phone, and CJK breaks between any two characters: without
     this the wrap lands mid-word and leaves 方 6 折 dangling. Breaks are then
     only allowed at the spaces, and the discount itself is spelled with
     non-breaking ones. */
  word-break: keep-all;
}

.hero-ad-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(234, 88, 12, .42);
  color: #fff;
}

.hero-ad-new {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: #fff;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.hero-ad-link {
  display: block;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-hero);
  transition: transform .15s ease, box-shadow .15s ease;
}

.hero-ad-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(15, 23, 42, .14);
}

.hero-ad-link img {
  display: block;
  width: 100%;
  height: auto;
}

.code {
  position: relative;
  margin-top: 20px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--panel);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.code-name {
  font-family: var(--mono);
  font-size: 11px;
  color: #8a8f98;
}

.copy {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: transparent;
  color: #c9cdd4;
  font-family: inherit;
  font-size: 11px;
  padding: 3px 11px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.copy:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.copy.ok { background: var(--green-l); border-color: var(--green-l); color: #06281c; }

.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  color: #e8e8ec;
}

.code .cm { color: #6b7280; }
.code .kw { color: #7dd3fc; }
.code .st { color: var(--green-l); }

/* ---------- feature grid ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 8px 0 28px;
}
.vendor-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 22px 24px;
}
.vendor-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.02em;
}
.vendor-card p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 13px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 24px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.card:hover {
  border-color: rgba(4, 120, 87, .3);
  box-shadow: var(--sh-card);
}

.card h3 { margin-top: 14px; font-size: 18px; }

.card p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}

.chips-label {
  font-size: 13px;
  color: var(--ink-3);
  margin-right: 4px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--tint);
}

/* ---------- invoice ---------- */

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.inv-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 24px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.inv-card:hover {
  border-color: rgba(4, 120, 87, .3);
  box-shadow: var(--sh-card);
}

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

.inv-head h3 { font-size: 18px; }

.inv-head .tag {
  margin-left: auto;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--green-d);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
}

.inv-card > p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

.inv-list {
  margin: 14px 0 0;
  padding: 14px 0 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  border-top: 1px dashed var(--line);
}

.inv-list li { display: flex; align-items: center; gap: 7px; }

.inv-list li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 999px;
  background: var(--tint-2);
  /* check mark */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.2 4.8 8.4 9.4 3.8' fill='none' stroke='%23047857' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- contact page ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.contact-ico { width: 28px; height: 28px; flex: none; }

.contact-label { font-size: 13px; color: var(--ink-3); }

.contact-num {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-num code {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}

.contact-num .key-btn { font-size: 12px; padding: 5px 14px; }

.contact-hint { font-size: 13px; color: var(--ink-2); }

.contact-qr {
  width: min(240px, 100%);
  height: auto;
  display: block;
  border-radius: 18px;
}

/* Join button inside a centred contact card: the card's own gap is tuned for
   text rows, so the button needs its own breathing room above it. */
.contact-cta { margin-top: 6px; }

/* Home page QQ community block. Horizontal on desktop so the join button sits
   on the same line as the number, stacked below 620px. */
.qq-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.qq-ico { width: 28px; height: 28px; flex: none; }

.qq-qr {
  width: 176px;
  flex: none;
  margin: 0;
  text-align: center;
}

.qq-qr img {
  width: 176px;
  height: 176px;
  display: block;
  border-radius: 14px;
}

.qq-qr figcaption {
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-3);
}

.qq-body { flex: 1; min-width: 0; }

.qq-label { font-size: 13px; color: var(--ink-3); }

.qq-num {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.qq-num code {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}

.qq-num .key-btn { font-size: 12px; padding: 5px 14px; }

.qq-hint { margin-top: 8px; font-size: 13px; color: var(--ink-2); }

.qq-join { flex: none; }

@media (max-width: 620px) {
  .qq-card { flex-direction: column; align-items: center; padding: 24px; text-align: center; }
  .qq-body { width: 100%; }
  .qq-num { justify-content: center; }
  .qq-num code { font-size: 22px; }
  .qq-join { width: 100%; justify-content: center; }
}

.contact-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ---------- tables ---------- */

.tbl-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
}

.tbl-card + .tbl-card { margin-top: 16px; }

.tbl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--tint);
}

.tbl-head h3 { font-size: 16px; }

.tag {
  font-size: 12px;
  color: var(--ink-2);
}

.tbl-scroll { overflow-x: auto; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th,
.tbl td {
  padding: 13px 24px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl thead th {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  background: #fff;
}

.tbl tbody tr:last-child th,
.tbl tbody tr:last-child td { border-bottom: none; }

.tbl tbody tr { transition: background-color .12s ease; }
.tbl tbody tr:hover { background: var(--tint); }

.tbl .r { text-align: right; }
.tbl .muted { color: var(--ink-2); font-weight: 400; }

.tbl .num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.tbl code { color: var(--ink); }

.tbl-kv th {
  width: 128px;
  font-weight: 500;
  color: var(--ink);
  vertical-align: top;
}

.tbl-kv td { white-space: normal; line-height: 1.7; }

.badge {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--green-d);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  vertical-align: 1px;
}

.peak-p {
  font-size: 11px;
  font-weight: 400;
  color: #b25a1b;
  line-height: 1.4;
}

.tbl-price td.note {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.tbl-price td.note-discount {
  color: var(--green-d);
  font-weight: 500;
}

/* ---------- home pricing teaser ---------- */

/* The band under the hero: live headline prices so a first-time visitor —
   especially on a phone — sees what models cost without opening /pricing. */
.pt {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.pt:hover { border-color: var(--green-l); box-shadow: 0 8px 24px rgba(15, 76, 92, .08); }

.pt-head { flex: 0 0 auto; }

.pt-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.pt-unit {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.pt-items {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pt-item {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 0;
}

.pt-item code {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-price {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 650;
  color: var(--green-d);
  white-space: nowrap;
}

.pt-sep { color: var(--ink-3); font-weight: 400; margin: 0 2px; }

.pt-more {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--green-d);
  white-space: nowrap;
}

.pt-more .arw { margin-left: 4px; }

@media (max-width: 899.98px) {
  .pt { flex-direction: column; align-items: stretch; gap: 12px; }
  .pt-head { display: flex; align-items: baseline; justify-content: space-between; }
  .pt-items { grid-template-columns: 1fr 1fr; }
  .pt-more { text-align: center; padding-top: 2px; }
}

/* ---------- steps ---------- */

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  gap: 18px;
  /* Same reason as `.doc-body section > *`: a grid item's automatic minimum is
     min-content, so an unwrappable code sample inside a step would widen the
     whole page instead of scrolling inside its own block. */
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 22px 24px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.steps li:hover {
  border-color: rgba(4, 120, 87, .3);
  box-shadow: var(--sh-card);
}

.step-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--green-d);
  font-size: 13px;
  font-weight: 600;
}

.steps h3 { font-size: 17px; }

.steps p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* ---------- faq ---------- */

.faq { display: grid; gap: 10px; }

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  transition: border-color .15s ease;
}

.faq details[open] { border-color: #d2e7dc; }
.faq details:hover { border-color: #d2e7dc; }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

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

.chev {
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .18s ease;
}

.faq details[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }

.faq p {
  padding: 0 24px 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------- closing cta ---------- */

.sec-cta { padding-bottom: 96px; }

.cta {
  display: grid;
  gap: 28px;
  border: 1px solid #d7ebe2;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--tint-2), var(--tint) 70%);
  padding: 40px;
}

.cta-h {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.015em;
  line-height: 1.25;
}

.cta-p {
  margin-top: 12px;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

.cta-btns { display: flex; flex-wrap: wrap; gap: 12px; }

.cta-act { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.cta-gift {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 6px 18px rgba(22, 163, 74, .38);
}

.cta-gift b { font-size: 20px; font-weight: 700; }

/* hero 第一屏的营销胶囊：注册礼金（绿）+ 首充折扣（橙），可直接点击。 */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
}

.hero-gift,
.hero-deal {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.hero-gift {
  background: var(--green);
  box-shadow: 0 6px 18px rgba(22, 163, 74, .38);
}

.hero-gift:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(22, 163, 74, .45);
  color: #fff;
}

.hero-deal {
  background: #d97706;
  box-shadow: 0 6px 18px rgba(217, 119, 6, .35);
}

.hero-deal:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(217, 119, 6, .45);
  color: #fff;
}

.hero-gift b,
.hero-deal b { font-size: 24px; font-weight: 700; }

.hero-gift-arw { font-weight: 700; }

/* The strip already supplies the space above the headline, so the hero drops
   most of its own top padding rather than opening a gap under the strip. */
.deal-strip + .hero { padding-top: 34px; }

@media (max-width: 620px) {
  /* Full-width so the gift is unmissable on the first screen instead of a
     small pill competing with the headline. */
  .hero-gift,
  .hero-deal {
    width: 100%;
    justify-content: center;
    padding: 13px 18px;
  }
  .hero-gift b,
  .hero-deal b { font-size: 22px; }
  .deal-strip + .hero { padding-top: 24px; }
}

/* 钱包页首充提示与实付价 */
.topup-deal {
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid #fcd9a8;
  border-radius: var(--r-md, 10px);
  background: #fff7ed;
  color: #9a5b0b;
  font-size: 14px;
  line-height: 1.6;
}

.topup-deal b { color: #d97706; }

.topup-sub .topup-pay { color: #d97706; font-weight: 600; }
/* First-top-up offer: a banner above the amount picker and a flag on every
   discounted amount. It exists only while the account can still use the offer. */
.first-offer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid #f3c26b;
  border-radius: 14px;
  background: linear-gradient(110deg, #fff7d6 0%, #fde68a 100%);
  color: #7a4a05;
  box-shadow: 0 6px 18px rgba(217, 119, 6, .14);
}
.first-offer-badge {
  flex: none;
  padding: 5px 13px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.first-offer-body { min-width: 0; }
.first-offer-t { display: block; font-size: 17px; font-weight: 700; color: #7a3f00; }
.first-offer-t b { font-size: 24px; color: #b45309; font-variant-numeric: tabular-nums; }
.first-offer-d { display: block; margin-top: 2px; font-size: 13px; line-height: 1.6; }
.topup-flag {
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff1cf;
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
@media (max-width: 560px) {
  .first-offer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

.topup-paid { font-size: 12px; }
/* ---------- wallet: 充值记录 ----------
   A statement: date, method, the whole order number, amount. The order number is
   never shortened: it wraps instead. */
.tr-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f1f3f4;
  color: var(--ink-2);
}
.tr-mark svg { width: 19px; height: 19px; fill: currentColor; }
.tr-mark-wechat { background: #e6f7ed; color: #07c160; }
.tr-mark-stripe { background: #ecebfd; color: #635bff; }
.tr-mark-redeem { background: #fff4e0; color: #d97706; }
/* The Alipay mark is a filled blue square with the 支 cut out; it carries its own shape. */
.tr-mark-alipay { background: transparent; color: #1677ff; }
.tr-mark-alipay svg { width: 34px; height: 34px; }
.tr-kind { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.tr-mhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.tr-mt { font-weight: 700; color: var(--ink); }
.tr-ms { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tr code {
  font: 500 13px/1.45 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
  background: #f6f7f8;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
}
.tr-note { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.tr-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.tr-copy:hover { color: var(--green-d); border-color: #bfe3d2; background: var(--tint); }
.tr-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tr-copy .tr-copy-ok { display: none; }
.tr-copy.is-done { color: var(--green); border-color: #bfe3d2; background: var(--tint-2); }
.tr-copy.is-done svg { display: none; }
.tr-copy.is-done .tr-copy-ok { display: block; }
.tr-none { color: var(--ink-3); font-weight: 500; }

.tr-sheet {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
}
.tr-head,
.tr-row {
  display: grid;
  grid-template-columns: 104px 172px minmax(0, 1fr) 116px;
  align-items: center;
  column-gap: 18px;
  padding-left: 24px;
  padding-right: 24px;
}
.tr-head {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: .02em;
}
.tr-head span:last-child { text-align: right; }
.tr-sheet .tr-mhead {
  padding: 10px 24px;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.tr-sheet .tr-mhead:not(:first-of-type) { border-top: 1px solid var(--line); }
.tr-row {
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  transition: background-color .12s ease;
}
.tr-row:last-child { border-bottom: none; }
.tr-row:hover { background: #fbfdfc; }
.tr-when b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tr-when time { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tr-how { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-ref { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-sheet .tr-amt { text-align: right; font-variant-numeric: tabular-nums; }
.tr-sheet .tr-amt b { display: block; font-size: 17px; font-weight: 700; color: var(--green-d); line-height: 1.3; }
.tr-sheet .tr-amt small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-3); }
.tr-sheet .tr-amt .tr-none { color: var(--ink-3); font-weight: 500; }

.tr-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
}
.tr-pinfo { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tr-pages { display: inline-flex; align-items: center; gap: 6px; }
.tr-pg {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
a.tr-pg:hover { color: var(--green-d); border-color: #bfe3d2; background: var(--tint); }
.tr-pg.on { border-color: var(--green); background: var(--green); color: #fff; font-weight: 600; }
.tr-pg.off { color: var(--ink-3); background: var(--tint); cursor: default; opacity: .6; }
.tr-pg svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tr-gap { padding: 0 2px; color: var(--ink-3); font-size: 14px; }
@media (max-width: 720px) {
  .tr-head { display: none; }
  .tr-sheet .tr-mhead { padding: 10px 16px; }
  .tr-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "how amt" "when amt" "ref ref";
    row-gap: 7px;
    padding: 13px 16px;
  }
  .tr-how { grid-area: how; }
  .tr-when { grid-area: when; display: flex; align-items: baseline; gap: 8px; }
  .tr-when b { font-size: 13.5px; }
  .tr-when time { margin: 0; }
  .tr-sheet .tr-amt { grid-area: amt; align-self: start; }
  .tr-ref { grid-area: ref; }
  .tr-ref:empty { display: none; }
  .tr-pager { justify-content: center; }
  .tr-pinfo { width: 100%; text-align: center; }
  .tr-pages { flex-wrap: wrap; justify-content: center; }
  .tr-pg { min-width: 36px; height: 36px; }
}
/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  font-size: 13px;
  color: var(--ink-2);
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.foot-copy { color: var(--ink-2); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-nav a:hover { color: var(--ink); }
.foot-icp { color: var(--ink-3); }
.foot-icp:hover { color: var(--ink-2); }

/* ============================================================
   Console
   Same tokens as the marketing pages, different furniture:
   sidebar shell, stat cards, dense tables, forms.
   ============================================================ */

/* Same max-width as .wrap: the console used to run 1400px while public pages
   ran 1280px, so the header's logo visibly jumped when crossing between them. */
.wrap-wide {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.brand-tag {
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  color: var(--ink-2);
}

/* The rename note sits next to the wordmark on the public header and auth
   pages, where a returning GimmitkAPI user is deciding whether they landed
   on the right site. It has to read at a glance, so it gets the brand
   gradient and white text rather than the muted tag treatment. */
.brand-note {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0f4c5c, #14b8a6);
}

.inline-form { display: inline-flex; }

.acct { display: flex; align-items: center; gap: 9px; }

/* Names are often e-mail addresses: cap the width so a long one cannot push the
   header past the screen edge. */
.acct-name { display: inline-block; max-width: 12em; overflow: hidden; color: var(--ink-2); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
/* The header row runs out of room before the console does: between the desktop
   breakpoint and 1280px the logo plus six controls plus a full e-mail address is
   wider than the screen. Drop the name there (the avatar stays, the full name is
   its tooltip) and let the row wrap as a last resort rather than spill off. */
.hdr-in > .hdr-cta { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; min-width: 0; }
@media (min-width: 900px) and (max-width: 1279.98px) {
  .acct-name.only-lg { display: none; }
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--green-d);
  font-size: 13px;
  font-weight: 600;
}

.avatar-sm {
  width: 20px;
  height: 20px;
  margin-right: 7px;
  font-size: 11px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

/* ---------- shell ---------- */

.app {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  /* keeps .wrap-wide's gutter: a bare `0` here would let the sidebar's
     negative margin escape the viewport on mobile */
  padding: 28px var(--pad) 72px;
  align-items: start;
}

.side { display: flex; flex-direction: column; gap: 16px; }

.side nav { display: grid; gap: 2px; }

/* Group card under the nav: name, purpose, the number (click to copy) and a
   small QR that opens at full size beside the rail on hover or focus. The rail
   is sticky, so it is lifted above the main column for that pop-up. */
.side { z-index: 20; }
.side-qq { position: relative; margin: 4px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.side-qq-top { display: flex; align-items: center; gap: 8px; }
.side-qq-top strong { font-size: 13px; color: var(--ink); line-height: 1.3; }
.side-qq-mark { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: linear-gradient(150deg, #3ec8ff, #1a8cff); }
.side-qq-mark svg { width: 15px; height: 15px; fill: #fff; }
.side-qq-mid { display: grid; grid-template-columns: minmax(0, 1fr) 58px; gap: 10px; align-items: center; margin-top: 8px; }
.side-qq-text { display: grid; gap: 6px; min-width: 0; }
.side-qq-text > span { color: var(--ink-2); font-size: 11.5px; line-height: 1.5; }
.side-qq-num { display: inline-flex; align-items: center; gap: 4px; justify-self: start; border: 0; padding: 0; background: none; color: var(--ink-3); font: 500 12px/1.4 var(--mono); letter-spacing: .01em; cursor: pointer; }
.side-qq-num svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.side-qq-num:hover, .side-qq-num.ok { color: var(--green); }
.side-qq-thumb { position: relative; display: block; width: 58px; height: 58px; border: 1px solid #eef0f2; border-radius: 8px; cursor: zoom-in; }
.side-qq-thumb > img { display: block; width: 100%; height: 100%; border-radius: 7px; }
.side-qq-thumb:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.side-qq-pop { position: absolute; top: 50%; left: calc(100% + 26px); z-index: 30; display: none; width: 236px; padding: 14px; transform: translateY(-50%);
  border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(15, 23, 42, .16); text-align: center; cursor: default; }
.side-qq-thumb:hover .side-qq-pop, .side-qq-thumb:focus .side-qq-pop { display: block; }
.side-qq-pop img { display: block; width: 100%; height: auto; border-radius: 10px; }
.side-qq-pop b { display: block; margin-top: 8px; font-size: 13px; color: var(--ink); }
.side-qq-pop small { display: block; color: var(--ink-3); font: 500 12px/1.5 var(--mono); }
.side-qq-join { width: 100%; margin-top: 10px; }

.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background-color .12s ease, color .12s ease;
}

.side-item:hover { background: var(--tint); color: var(--ink); }

.side-badge {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  line-height: 1;
  letter-spacing: .04em;
  box-shadow: 0 2px 6px rgba(229, 72, 77, .24);
}

.side-item.on {
  background: var(--tint-2);
  color: var(--green-d);
  font-weight: 500;
}

/* A badged console feature is a deliberate discovery point, not another
   same-weight menu row. Keep it static and high-contrast so HOT is noticeable
   without a distracting idle animation. */
.side-item-featured {
  position: relative;
  margin: 5px 0 7px;
  border: 1px solid #b9e5d0;
  background: linear-gradient(135deg, #ecfdf3 0%, #f4fbf7 62%, #fff5f5 100%);
  color: #086343;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16, 122, 83, .12);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}

.side-item-featured:hover {
  border-color: #7fd3ac;
  background: linear-gradient(135deg, #def8e9 0%, #eefaf4 62%, #fff0f0 100%);
  color: #064e36;
  box-shadow: 0 10px 24px rgba(16, 122, 83, .17);
  transform: translateY(-1px);
}

.side-item-featured .side-ico {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  opacity: 1;
  box-shadow: 0 4px 10px rgba(16, 122, 83, .22);
}

.side-item-featured .side-badge {
  min-height: 18px;
  margin-left: auto;
  padding: 2px 6px;
  box-shadow: 0 3px 8px rgba(229, 72, 77, .3);
}

.side-item-featured.on {
  border-color: #67c99c;
  background: linear-gradient(135deg, #d9f7e6 0%, #ebf9f2 65%, #ffeded 100%);
  color: #064e36;
  box-shadow: 0 10px 24px rgba(16, 122, 83, .16);
}

.side-ico {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .8;
}

.app-main { min-width: 0; }

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

.page-h {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.015em;
  line-height: 1.25;
  margin-top: 10px;
}

/* Invoicing reminder beside a page heading. Red because it asks the user to do
   something (contact support), not just to know something — but a tinted pill
   rather than a full alert box, so it does not outshout the balance figure the
   page exists to show. */
.head-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* The row owns the gap above the heading; a second margin on the h1 would
   double it and push the pill off the heading's baseline. */
.head-title-row .page-h { margin-top: 0; }

.head-invoice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 11px 5px 5px;
  border: 1px solid #f5c9c9;
  border-radius: 999px;
  background: #fef4f4;
  color: #a33a3a;
  font-size: 13px;
  line-height: 1.35;
}


.head-invoice a {
  color: #a33a3a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-variant-numeric: tabular-nums;
}

.head-invoice a:hover { color: #7d2b2b; }

.head-invoice-copy {
  border: 1px solid #e7b4b4;
  border-radius: 999px;
  background: #fff;
  color: #a33a3a;
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 4px 9px;
  cursor: pointer;
}

.head-invoice-copy:hover { background: #fbe4e4; }
.head-invoice-copy.ok { background: #e5484d; border-color: #e5484d; color: #fff; }
/* The conditions for an invoice, one line under the heading. */
.head-invoice-rule {
  margin: 8px 0 0;
  color: #a33a3a;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- stat cards ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 20px 22px;
}

.stat-warn { border-color: #f5d9a8; background: #fffbf2; }

.stat-label { font-size: 13px; color: var(--ink-2); }

.stat-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-warn .stat-value { color: #b45309; }

.stat-note { font-size: 12px; color: var(--ink-3); }

/* ---------- content blocks ---------- */

.block { margin-bottom: 32px; }

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

.block-head h2 { font-size: 17px; }

.block-note { font-size: 12px; color: var(--ink-3); }
.block-note code { color: var(--ink-2); }

.block-link { font-size: 13px; color: var(--green); }
.block-link:hover { color: var(--green-d); }

/* minmax(0,…) rather than 1fr: the track's auto minimum would otherwise be the
   table's min-content, widening the column instead of letting .tbl-scroll scroll */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }

.empty {
  border: 1px dashed var(--line-3);
  border-radius: var(--r);
  padding: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
  background: var(--tint);
}

/* ---------- api keys ---------- */

.keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.key {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 18px 20px;
}

.key-off { opacity: .6; }

.key-top {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.key-id {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.key-name { font-size: 15px; font-weight: 500; }

.badge-off { background: #f1f3f5; color: var(--ink-2); }
.badge-warn { background: #fef3c7; color: #92400e; }

.key-val {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--tint);
  padding: 8px 10px;
}

.key-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.key-btn {
  flex: none;
  border: 1px solid var(--line-3);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11px;
  padding: 3px 11px;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}

.key-btn:hover { color: var(--green-d); border-color: #c7d9d0; background: var(--tint-2); }
.key-btn.ok { background: var(--green); border-color: var(--green); color: #fff; }

.key-btn-danger:hover { color: #a33a3a; border-color: #e8c4c4; background: #fef4f4; }

/* Per-image pricing cell on the pricing table: one inline tier list instead
   of four per-token columns. */
.tbl-price td.img-tier { white-space: nowrap; font-size: 13px; }
.tbl-price td.img-tier .sep { color: var(--ink-3); margin: 0 6px; }

.key-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.key-meta code { color: var(--ink-2); }

/* A per-key cap is invisible until it bites, so the two states that actually
   break requests get colour rather than another grey line of metadata. */
.key-meta .key-bad { color: #b42318; font-weight: 500; }
.key-meta .key-warn { color: #b45309; font-weight: 500; }

.key-alert {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid #f5d9a8;
  border-radius: var(--r-sm);
  background: #fffbf2;
  font-size: 12.5px;
  line-height: 1.7;
  color: #92400e;
}

/* ---------- usage bars ---------- */

.bars { display: grid; gap: 16px; }

.bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar-val { font-variant-numeric: tabular-nums; font-weight: 500; }

.bar-track {
  height: 6px;
  margin-top: 7px;
  border-radius: 999px;
  background: #eef1f0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

.bar-foot { margin-top: 6px; font-size: 12px; color: var(--ink-3); }

.tbl-tight th, .tbl-tight td { padding: 10px 16px; }
.nowrap { white-space: nowrap; }

/* ---------- alerts ---------- */

.alert {
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-bad {
  border: 1px solid #f3c7c7;
  background: #fef4f4;
  color: #a33a3a;
}

.alert-good {
  border: 1px solid #c3e0d1;
  background: var(--tint-2);
  color: var(--green-d);
}

.hint {
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-3);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 22px;
}

.block-top { margin-top: 8px; }

/* ---------- keys page ---------- */

.keys-wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

.key-new {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .08);
}

/* Card actions sit with the name they act on, in the same pill style as
   显示/复制 — they're secondary to the key itself and shouldn't outweigh it. */
.key-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

/* Opened on demand by the 重命名 button; rendered open when JS is off. */
.key-rename {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.key-rename .input { flex: 1; min-width: 0; }

/* A class selector outranks the UA stylesheet's [hidden], so restate it. */
.key-rename[hidden] { display: none; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger { color: #a33a3a; }
.btn-danger:hover { color: #8b2f2f; border-color: #e8c4c4; background: #fef4f4; }

.input-sm { padding: 7px 11px; font-size: 13px; }

.row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 20px 22px;
}

.row-form .field { flex: 1; min-width: 180px; }

/* ---------- 令牌管理 (/console/keys) ----------
   One table: a switch, then what each key is, what it cost over the last week
   and when it was last used. On a phone each row turns into a card. A neutral
   scale with one accent; hairlines instead of boxes. */
.app[data-page="keys"] { padding-bottom: 24px; }
.kx {
  --k-ink: #0d1117;
  --k-ink2: #4a525c;
  --k-ink3: #848c95;
  --k-line: rgba(15, 23, 42, .08);
  --k-line2: rgba(15, 23, 42, .14);
  --k-soft: #f5f6f7;
  --k-soft2: #eef0f2;
  color: var(--k-ink);
}
.kx-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.kx .i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kx .i.sm { width: 14px; height: 14px; }

/* title row */
.keys-topline.kx-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.kx-top .dash-greeting { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.keys-topline-note {
  overflow: hidden;
  margin: 0 auto 0 0;
  color: var(--k-ink3);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kx-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 38px; margin-left: auto; padding: 0 16px 0 13px;
  border: 0; border-radius: 11px; background: var(--green); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(4, 120, 87, .35), 0 4px 12px -4px rgba(4, 120, 87, .45);
  transition: background-color .12s ease;
}
.kx-btn:hover { background: var(--green-d); }
.kx-btn .i { width: 17px; height: 17px; stroke-width: 2.2; }

/* summary strip: same rhythm as the usage-log summary bar */
.kx-sum {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
  border: 1px solid var(--k-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.kx-sum > div { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; padding: 16px 22px; }
.kx-sum > div + div::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--k-line); }
.kx-sum .lbl { color: var(--k-ink3); font-size: 12.5px; line-height: 16px; }
.kx-sum b { font-size: 22px; font-weight: 650; line-height: 26px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kx-sum b small { color: var(--k-ink3); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.kx-sum b em, .kc-spend em { margin-right: 1px; font-size: .68em; font-style: normal; font-weight: 600; letter-spacing: 0; }
.kx-sum b.g { color: var(--green); }
.kx-warn { position: absolute; top: 15px; right: 16px; padding: 0 7px; border-radius: 6px; background: #fff7e6; color: #a15c07; font-size: 11.5px; font-weight: 500; line-height: 19px; }
.kx-api-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kx-api-row code { overflow: hidden; color: var(--k-ink); font-size: 15px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.kx-api-tag { flex: none; min-width: 38px; padding: 0 7px; white-space: nowrap; border-radius: 6px; background: var(--tint-2); color: var(--green-d); font-size: 11.5px; font-style: normal; font-weight: 500; line-height: 19px; text-align: center; }
.kx-api-tag.bak { background: var(--k-soft); color: var(--k-ink3); }
.kx-sum .kx-api { gap: 5px; }
.kx-copy {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 28px; padding: 0 10px 0 8px;
  border: 1px solid var(--k-line2); border-radius: 8px; background: #fff; color: var(--k-ink2);
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.kx-copy:hover { background: var(--k-soft); color: var(--k-ink); }
.kx-copy.ok { border-color: #bfe6d3; background: var(--tint-2); color: var(--green-d); }
.kx-copy .i { width: 14px; height: 14px; }

/* toolbar */
/* Wraps when the filters do not fit (a long group name widens the select), rather
   than push the view switch past the right edge. */
.kx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.kx-search {
  display: inline-flex; align-items: center; gap: 9px;
  width: 280px; height: 36px; padding: 0 8px 0 12px;
  border: 1px solid transparent; border-radius: 10px; background: var(--k-soft); color: var(--k-ink3);
  transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.kx-search:focus-within { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px rgba(4, 120, 87, .14); }
.kx-search input {
  flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: none;
  color: var(--k-ink); font: inherit; font-size: 13.5px; outline: none;
}
.kx-search input::placeholder { color: var(--k-ink3); opacity: 1; }
.kx-search input::-webkit-search-cancel-button { cursor: pointer; }
.kx-search kbd {
  display: grid; place-items: center; flex: none; width: 20px; height: 20px;
  border: 1px solid var(--k-line2); border-radius: 5px; background: #fff;
  color: var(--k-ink3); font: 500 11px/1 var(--mono);
}
.kx-search:focus-within kbd { display: none; }
.kx-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--k-soft); }
.kx-seg a {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 8px; color: var(--k-ink2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.kx-seg a:hover { color: var(--k-ink); }
.kx-seg a i { color: var(--k-ink3); font-size: 11.5px; font-style: normal; font-variant-numeric: tabular-nums; }
.kx-seg a.on { background: #fff; color: var(--k-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px rgba(15, 23, 42, .04); }
.kx-seg a.on i { color: var(--k-ink2); }
.kx-sel {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 10px 0 11px; border: 1px solid transparent; border-radius: 10px;
  background: var(--k-soft); color: var(--k-ink3);
}
.kx-sel select {
  max-width: 180px; height: 100%; padding: 0 18px 0 0; margin-right: -18px;
  border: 0; background: none; color: var(--k-ink2);
  font: inherit; font-size: 13px; font-weight: 500;
  -webkit-appearance: none; appearance: none; cursor: pointer; outline: none;
}
.kx-sel .i.sm { pointer-events: none; }
.kx-sel:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(4, 120, 87, .14); }
.kx-sel.is-set { background: var(--tint-2); color: var(--green-d); }
.kx-sel.is-set select { color: var(--green-d); font-weight: 600; }
.kx-clear { color: var(--k-ink3); font-size: 13px; text-decoration: none; white-space: nowrap; }
.kx-clear:hover { color: var(--green-d); }

/* one key: a table row */
.av {
  position: relative; grid-row: 1 / 3; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  font-size: 15px; font-weight: 650; letter-spacing: -.02em;
}
.sd { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2.5px solid #fff; border-radius: 50%; }
.sd-ok { background: #12b981; }
.sd-off { background: #b4bac1; }
.sd-drained { background: #e3a008; }
.sd-expired { background: #e5484d; }
.kc-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kc-name strong { overflow: hidden; font-size: 14.5px; font-weight: 600; line-height: 19px; text-overflow: ellipsis; white-space: nowrap; }
.kc-badge { flex: none; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; line-height: 18px; }
.kc-badge.is-off { background: var(--k-soft2); color: var(--k-ink2); }
.kc-badge.is-drained { background: #fff7e6; color: #a15c07; }
.kc-badge.is-expired { background: #fff0f0; color: #c4262c; }
.kc-grp { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--k-ink2); font-size: 12.5px; line-height: 16px; white-space: nowrap; }
.kc-grp-name { overflow: hidden; min-width: 0; text-overflow: ellipsis; }
.gd { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; }
.gd-stack { display: inline-flex; flex: none; }
.gd-stack .gd { width: 8px; height: 8px; box-shadow: 0 0 0 1.5px #fff; }
.gd-stack .gd + .gd { margin-left: -3px; }
.kc-more { flex: none; padding: 0 5px; border-radius: 5px; background: var(--k-soft2); color: var(--k-ink2); font-size: 11px; font-weight: 600; line-height: 16px; }

/* Avatar and group-dot colours follow tagHue, the same hash the usage log uses. */
.av-amber { background: #fff3e0; color: #b25d05; }      .gd-amber { background: #f0a020; }
.av-blue { background: #eaf1ff; color: #2856c7; }       .gd-blue { background: #4f7ff0; }
.av-cyan { background: #e3f7fa; color: #0b7285; }       .gd-cyan { background: #15aabf; }
.av-green { background: #e6f6ee; color: #0f7a4a; }      .gd-green { background: #12b981; }
.av-grey { background: #eff1f4; color: #4a525c; }       .gd-grey { background: #9aa2ab; }
.av-indigo { background: #eef0ff; color: #4a46c8; }     .gd-indigo { background: #6d68e8; }
.av-light-blue { background: #e5f4fd; color: #0369a1; } .gd-light-blue { background: #38a3e0; }
.av-lime { background: #f0f7e0; color: #4d7c0f; }       .gd-lime { background: #84cc16; }
.av-orange { background: #fff0e5; color: #c2410c; }     .gd-orange { background: #f97316; }
.av-pink { background: #ffeef6; color: #be185d; }       .gd-pink { background: #ec4899; }
.av-purple { background: #f5edff; color: #7e22ce; }     .gd-purple { background: #a855f7; }
.av-red { background: #ffefef; color: #c4262c; }        .gd-red { background: #ef4444; }
.av-teal { background: #e3f6f2; color: #0d7a6c; }       .gd-teal { background: #1aa592; }
.av-violet { background: #f3edff; color: #7041c9; }     .gd-violet { background: #9466e8; }
.av-yellow { background: #fff8db; color: #946200; }     .gd-yellow { background: #eab308; }

.kc-key {
  position: relative; display: inline-flex; align-items: center; justify-self: start; gap: 1px;
  max-width: 100%; height: 30px; padding: 0 3px 0 10px;
  border: 1px solid var(--k-line); border-radius: 9px; background: var(--k-soft);
}
.kc-key code { overflow: hidden; margin-right: 6px; color: var(--k-ink2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.kc-key.is-revealed code { color: var(--k-ink); user-select: all; }
.kx .ib {
  position: relative; display: grid; place-items: center; flex: none;
  width: 26px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--k-ink3); cursor: pointer; list-style: none;
}
.kx .ib:hover { background: rgba(15, 23, 42, .06); color: var(--k-ink); }
.kx .ib .i { width: 15px; height: 15px; }
.kc-key .i-hide, .kc-key .i-done { display: none; }
.kc-key.is-revealed .i-show { display: none; }
.kc-key.is-revealed .i-hide { display: block; }
.kc-key.is-copied { border-color: #bfe6d3; background: var(--tint-2); }
.kc-key.is-copied .i-copy { display: none; }
.kc-key.is-copied .i-done { display: block; color: var(--green); stroke-width: 2.4; }
.kc-key .tip { display: none; }
.kc-key.is-copied .tip {
  position: absolute; bottom: calc(100% + 7px); left: 50%; z-index: 2; display: block;
  padding: 3px 8px; border-radius: 6px; background: var(--k-ink); color: #fff;
  font-size: 11.5px; font-weight: 500; line-height: 16px; white-space: nowrap; transform: translateX(-50%); pointer-events: none;
}
.kc-key.is-copied .tip::before { content: attr(data-tip); }
.kc-key.is-copied .tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--k-ink); }

.kc-use { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; text-align: right; }
.kc-spend { color: var(--k-ink); font-size: 15px; font-weight: 650; line-height: 20px; letter-spacing: -.015em; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
.kc-spend em { font-size: .8em; }
.kc-spend:hover { color: var(--green-d); text-decoration: underline; text-underline-offset: 3px; }
.kc-req { color: var(--k-ink3); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-quota { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-top: 5px; }
.kc-quota .bar { display: block; width: 96px; height: 4px; overflow: hidden; border-radius: 99px; background: var(--k-soft2); }
.kc-quota .bar i { display: block; height: 100%; border-radius: 99px; background: #12b981; }
.kc-quota.is-low .bar i { background: #e3a008; }
.kc-quota.is-drained .bar i { background: #e5484d; }
.kc-quota .q { color: var(--k-ink2); font-size: 11.5px; line-height: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kc-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.kc-last { color: var(--k-ink2); font-size: 13px; line-height: 17px; white-space: nowrap; }
.kc-created { color: var(--k-ink3); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-exp { padding: 0 6px; border-radius: 5px; background: #fff7e6; color: #a15c07; font-size: 11.5px; font-weight: 500; line-height: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-exp.is-past { background: #fff0f0; color: #c4262c; }

/* actions: one ⋯ that opens a menu */
.kc-act { position: relative; justify-self: end; }
.kc-act > summary::-webkit-details-marker { display: none; }
.kc-act > summary::marker { content: ""; }
.kx .ib-more { width: 32px; height: 32px; border-radius: 8px; }
.kx .ib-more .i { width: 18px; height: 18px; stroke-width: 2.4; }
.kc-act[open] > .ib-more { background: var(--k-soft2); color: var(--k-ink); }
.kc-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  width: 176px; padding: 5px;
  border: 1px solid var(--k-line); border-radius: 12px; background: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 16px 40px -8px rgba(15, 23, 42, .22);
}
/* Opens downward by default; site.js adds .is-up when the rest of the window
   below the button is shorter than the menu, so the last card's menu is never cut
   off by the bottom of the screen. */
.kc-act.is-up > .kc-menu { top: auto; bottom: calc(100% + 6px); }
.kc-menu .inline-form { display: block; margin: 0; }
.kc-mi {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; color: var(--k-ink);
  font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer;
}
.kc-mi:hover, .kc-mi:focus-visible { background: var(--k-soft); outline: none; }
.kc-mi .i { color: var(--k-ink3); }
.kc-mi.is-bad, .kc-mi.is-bad .i { color: #d1343a; }
.kc-mi.is-bad:hover { background: #fff1f1; }
.kc-menu hr { height: 1px; margin: 4px 6px; border: 0; background: var(--k-line); }

/* The status badge in 最近使用: the switch flips .is-disabled in place
   (site.js), so both states are in the markup and CSS shows one. */
.kt-row:not(.is-disabled) .kt-when-off,
.kt-row.is-disabled .kt-when-on { display: none !important; }
.kt-tgl[aria-busy="true"] { opacity: .6; cursor: progress; }
.kx-toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: #111827; color: #fff; font-size: 13.5px; line-height: 1.45; box-shadow: 0 10px 30px rgba(15, 23, 42, .25); opacity: 0; transform: translate(-50%, 8px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.kx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.kx-toast.is-bad { background: #b42318; }
/* a key that cannot serve a request: quiet, the badge says why */
.kt-row.is-off > td { background: #fcfcfd; }
.kt-row.is-off .kt-name strong, .kt-row.is-off .kc-spend { color: var(--k-ink3); }
.kt-row.is-off .kt-chain, .kt-row.is-off .kc-key, .kt-row.is-off .kt-spark { opacity: .6; }
/* the table */
.kt-wrap { border: 1px solid var(--k-line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
.kt { width: 100%; border-collapse: separate; border-spacing: 0; }
.kt th { padding: 10px 10px 9px; border-bottom: 1px solid var(--k-line); background: #fafbfb; color: var(--k-ink3); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
.kt th:first-child { border-top-left-radius: 14px; padding-left: 18px; }
.kt th:last-child { border-top-right-radius: 14px; }
.kt td { padding: 11px 10px; border-bottom: 1px solid var(--k-line); vertical-align: middle; }
.kt tbody tr:last-child td { border-bottom: 0; }
.kt tbody tr:last-child td:first-child { border-bottom-left-radius: 14px; }
.kt tbody tr:last-child td:last-child { border-bottom-right-radius: 14px; }
.kt-row:hover > td { background: #fbfcfc; }
.kt-row:has(.kc-act[open]) { position: relative; z-index: 5; }
.kt-row.is-new > td { background: #f1faf6; }
.kt-row.is-new > td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.kt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kt-on, .kt-c-on { width: 44px; }
.kt td.kt-on { padding-left: 18px; }
.kt-c-act { width: 40px; }
.kt-act { text-align: right; }
/* the switch: a submit button, so it works without script */
.kt-tgl { position: relative; display: block; width: 34px; height: 20px; padding: 0; border: 0; border-radius: 99px; background: #d5dbd8; cursor: pointer; transition: background-color .15s ease; }
.kt-tgl i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s ease; }
.kt-tgl.on { background: var(--green); }
.kt-tgl.on i { left: 16px; }
.kt-tgl:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.kt-name strong { display: block; overflow: hidden; max-width: 180px; color: var(--k-ink); font-size: 14px; font-weight: 600; line-height: 19px; text-overflow: ellipsis; white-space: nowrap; }
.kt-name small { color: var(--k-ink3); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kt-key .kc-key { white-space: nowrap; }
/* the counters a call walks, left to right */
.kt-chain { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.kt-arw { color: #b4bcb8; font-size: 13px; font-weight: 500; }
.kt-g.ntag { display: inline-flex; align-items: center; gap: 5px; max-width: 200px; margin: 0; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 550; line-height: 18px; }
.kt-g img { flex: none; width: 13px; height: 13px; }
.kt-g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the week: a line of the last seven days, the total, the calls */
.kt-use-in { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.kt-use-in:hover .kc-spend { color: var(--green-d); text-decoration: underline; text-underline-offset: 3px; }
.kt-spark { flex: none; overflow: visible; }
.kt-spark path { fill: var(--green); opacity: .12; }
.kt-spark polyline { fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.kt-spark line { stroke: #d6ddda; stroke-width: 1; stroke-dasharray: 3 3; }
.kt-use-n { display: grid; }
.kt-use-n .kc-spend { font-size: 14px; line-height: 18px; }
.kt-use-n small { color: var(--k-ink3); font-size: 11.5px; line-height: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kt-quota .kc-quota, .kt-use-q .kc-quota { align-items: stretch; margin-top: 0; text-align: left; }
.kt-quota .kc-quota .bar { width: 110px; }
.kt-muted { color: var(--k-ink3); font-size: 12.5px; white-space: nowrap; }
.kt-last { white-space: nowrap; }
.kt-last .kc-last { display: block; }
.kt-last .kc-badge, .kt-last .kc-exp { display: inline-block; margin-top: 3px; }
.kx-sub { color: var(--k-ink3); font-size: 12px; font-style: normal; line-height: 16px; white-space: nowrap; }
.kx-sum.is-short { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); }
.kt-use-q { display: none; }
/* Below this the quota gets no column of its own: a capped key shows its bar
   under the week instead, and the chips give up some width. */
@media (max-width: 1520px) {
  .kt-c-quota, .kt-quota { display: none; }
  .kt-use-q { display: block; margin-top: 6px; }
  .kt-use-q .kc-quota .bar { width: 100%; }
  .kt-g.ntag { max-width: 150px; }
  .kt th, .kt td { padding-left: 8px; padding-right: 8px; }
  .kt-spark { width: 52px; }
}
/* Narrow windows and phones: each key a card, two abreast until a phone. */
@media (max-width: 1180px) {
  /* each key a card: name and switch, the key, its groups, then the week,
     the quota and the last call */
  .kt thead { display: none; }
  .kt, .kt tbody { display: block; }
  .kt-wrap { border: 0; background: none; box-shadow: none; }
  .kt tbody { display: grid; gap: 10px; }
  .kt-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name on act" "key key key" "grp grp grp" "use use use" "last last last";
    align-items: center; gap: 10px 10px; padding: 14px 14px 12px 16px;
    border: 1px solid var(--k-line); border-radius: 14px; background: #fff;
  }
  .kt-row.is-off { background: #fcfcfd; }
  .kt-row.is-new { border-color: var(--green); box-shadow: 0 0 0 3px rgba(4, 120, 87, .10); }
  .kt-row > td { display: block; padding: 0; border: 0; background: none !important; }
  .kt-row > td.kt-quota { display: none; }
  .kt-row:hover > td { background: none; }
  .kt-name { grid-area: name; }
  .kt-on { grid-area: on; }
  .kt-act { grid-area: act; margin: -4px -6px 0 0; }
  .kt-key { grid-area: key; }
  .kt-key .kc-key { display: flex; width: 100%; }
  .kt-key .kc-key code { flex: 1; }
  .kt-grp { grid-area: grp; }
  .kt-use { grid-area: use; }
  .kt-last { grid-area: last; display: flex !important; align-items: center; gap: 8px; padding-top: 10px !important; border-top: 1px solid var(--k-line) !important; }
  .kt-last .kc-last { color: var(--k-ink3); font-size: 12px; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  .kt tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the addresses get a row of their own, so neither is cut */
  .kx-sum, .kx-sum.is-short { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kx-sum.is-short { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kx-sum > .kx-api { grid-column: 1 / -1; border-bottom: 1px solid var(--k-line); }
  .kx-sum > .kx-stat:nth-child(2)::before { display: none; }
}
/* edit dialog (the create dialog is .key-modal too) */
.key-modal-edit { width: min(560px, calc(100vw - 32px)); }
.key-modal-edit .key-modal-head h2 { overflow: hidden; max-width: 420px; text-overflow: ellipsis; white-space: nowrap; }
.key-modal-edit .key-modal-body { max-height: calc(100dvh - 230px); overflow-y: auto; }
.key-edit-form .field { display: grid; gap: 7px; }
.key-edit-form textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }
.key-edit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.key-check { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.key-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }

@media (max-width: 1100px) {
  .kx-sum { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); }
  .kx-search { width: 220px; }
}

@media (max-width: 899.98px) {
  .keys-topline-note { display: none; }
}

/* phones and narrow windows: always cards, one per row */
@media (max-width: 760px) {
  .keys-topline.kx-top { flex-wrap: wrap; gap: 6px 10px; margin-bottom: 14px; }
  .kx-top .dash-greeting { margin-right: auto; font-size: 21px; }
  .kx-btn { height: 36px; padding: 0 13px 0 11px; font-size: 13.5px; }
  .kx-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
  .kx-sum > div { padding: 12px 14px; }
  .kx-sum > .kx-api { grid-column: 1 / -1; border-bottom: 1px solid var(--k-line); }
  .kx-sum > div + div::before { top: 14px; bottom: 14px; }
  .kx-sum > .kx-stat:nth-child(2)::before { display: none; }
  .kx-sum b { font-size: 18px; line-height: 22px; }
  .kx-sum b small { font-size: 13px; }
  .kx-warn { position: static; align-self: flex-start; }
  .kx-api-row code { font-size: 13.5px; }
  .kx-bar { flex-wrap: wrap; gap: 8px; }
  .kx-search { width: 100%; height: 40px; }
  .kx-search input { font-size: 16px; }   /* 16px: iOS does not zoom on focus */
  .kx-search kbd { display: none; }
  .kx-seg { flex: 1 1 auto; }
  .kx-seg a { flex: 1 1 auto; justify-content: center; height: 32px; padding: 0 6px; font-size: 12.5px; }
  .kx-sel { height: 38px; }
  .kx-sel select { max-width: 120px; }
  .key-edit-pair { grid-template-columns: 1fr; }
}
/* the region tags are long ("大陆【海外调用很慢】"): on a phone the tag takes its own line so the address is not cut */
@media (max-width: 480px) {
  .kx-api-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .kx-api-tag { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 380px) {
  /* Three stats in a 320px row: the spend total ("¥12,345.67") is the widest and ran past the edge. */
  .kx-sum > .kx-stat { padding-left: 10px; padding-right: 10px; }
  .kx-sum b { font-size: 16px; }
  .kx-api-row { gap: 4px 8px; }
  .kx-api-row code { font-size: 12.5px; }
}

.key-modal {
  width: min(480px, calc(100vw - 32px));
  border: 0;
  border-radius: 15px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
}
.key-modal::backdrop { background: rgba(15, 23, 42, .44); backdrop-filter: blur(2px); }
.key-modal-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eceef0;
  padding: 0 22px;
}
.key-modal-head h2 { margin-top: 2px; font-size: 18px; }
.key-modal-head .eyebrow { margin: 0; }
.key-modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7a7f84;
  font-size: 24px;
  cursor: pointer;
}
.key-modal-close:hover { background: #f3f4f6; color: #1f2328; }
.key-modal-body { display: grid; gap: 16px; padding: 22px; }
.key-modal-body .field { display: grid; gap: 7px; }
.key-modal-body .block-note { margin: 0; color: #7a7f84; font-size: 12px; }
.key-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #eceef0;
  padding: 14px 22px;
  background: #fafbfc;
}

/* Ordered counter list on the key forms. The number is the priority. */
.kg { display: grid; gap: 8px; min-width: 0; }
.kg-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: kg; }
.kg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 4px 0 6px;
  border: 1px solid #dfe5e2;
  border-radius: 999px;
  background: #f7faf8;
  color: var(--ink-2);
  font-size: 12px;
  counter-increment: kg;
}
.kg-chip::before {
  content: counter(kg);
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1f6f54;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
}
.kg-name { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.kg-x {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8a9290;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.kg-x:hover, .kg-x:focus-visible { background: #e9eeec; color: #b42318; }
.kg-add { justify-self: start; width: auto; min-width: 160px; }
.kg-empty { margin: 0; color: #b42318; font-size: 12px; }
/* In the add-key dialog the list starts empty on purpose, so the line is a
   hint (grey) until a submit with nothing chosen turns it into the error. */
.kg-empty.is-hint { color: var(--ink-3, #848c95); }
.kg-empty.is-hint.is-error { color: #b42318; font-weight: 500; }
.kg-overlap { margin: 0; color: #8a5a00; font-size: 12px; line-height: 1.5; }
/* The add menu replaces the native select (site.js kgMenuInit), because a select
   option has no room for the operator's note under the counter's name. The list
   sits in the flow rather than floating: the key forms are inside a <dialog>,
   which would clip or scroll a popup. */
.kg-add.kg-native-off { display: none; }
.kg-menu { display: grid; gap: 6px; min-width: 0; }
.kg-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.kg-menu-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 8px;
  border-right: 1.5px solid #6b7672;
  border-bottom: 1.5px solid #6b7672;
  transform: rotate(45deg);
  transition: transform .15s;
}
.kg-menu.is-open .kg-menu-btn { border-color: #1f6f54; }
.kg-menu.is-open .kg-menu-btn::after { margin-top: 3px; transform: rotate(-135deg); }
.kg-menu-list {
  max-height: min(340px, 46vh);
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid #dfe5e2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}
.kg-menu-list[hidden] { display: none; }
.kg-opt {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.kg-opt:hover, .kg-opt:focus-visible { background: #eef6f2; outline: none; }
.kg-opt-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.kg-opt-note { color: #8a5a00; font-size: 12.5px; line-height: 1.5; }
.kg-opt.is-taken { cursor: default; }
.kg-opt.is-taken .kg-opt-name { color: #8a9290; }
.kg-opt.is-taken .kg-opt-note { opacity: .75; }
.kg-opt-tag { padding: 1px 7px; border-radius: 999px; background: #e9eeec; color: #5d6a66; font-size: 11px; font-style: normal; font-weight: 500; }
.kg-field { display: grid; gap: 5px; color: var(--ink-2); }
.key-group-multi { color: #1f6f54; }

.usage-estimated {
  margin-left: 5px;
  color: #b45309;
  font-size: 9px;
  font-weight: 500;
}

@media (max-width: 520px) {
  .key-modal-foot .btn { flex: 1; }
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.4' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  cursor: pointer;
}

/* ---------- logs page ---------- */

/* The usage log reproduces New API's own usage-log page, which the users know
   from the legacy console. Colours, sizes and radii below were read off that
   page rendered in Chrome (New API web/, default theme) rather than guessed,
   and are scoped to this page: the rest of the console keeps BuyToken's. */
.logs-page {
  --lg-fg: #0a0a0a;
  --lg-muted: #4f5459;
  --lg-faint: rgba(96, 96, 96, .6);
  --lg-fainter: rgba(96, 96, 96, .4);
  --lg-line: #e8e8e8;
  --lg-hover: #f5f5f5;
  --lg-primary: var(--green);
  --lg-primary-d: var(--green-d);
  --lg-ok: #009767;
  --lg-warn: #cd8900;
  --lg-bad: #e40014;
  --lg-info: #0084cc;
  min-width: 0;
  color: var(--lg-fg);
  /* The site's own system face (PingFang / SF on macOS). The page used to
     copy New API's Helvetica so its eight columns fit; the table is seven
     columns now and scrolls sideways when the window is narrower. */
  font-family: var(--font);
}
.app[data-page="logs"] { padding-bottom: 16px; }

/* One card above the table: the range's totals and time presets on the first
   row, the real start and end, the drop-downs and the actions on the second
   (laid out under "汇总栏" below). */
.logs-head {
  position: relative;
  z-index: 5;
  margin-bottom: 0;
}

.logs-filter { display: block; }
/* Every field is New API's 32px rounded input. */
.lf-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: var(--lg-fg);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.lf-field::placeholder { color: var(--lg-muted); opacity: 1; }
.lf-field:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .16);
}

.lf-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--lg-muted);
}

/* The range is a button that opens the two time fields, like New API's
   compact range picker. A <details> keeps it working without script; site.js
   only closes it on an outside click and fills in the quick ranges. */
.lf-range { position: relative; min-width: 0; }
.lf-range-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-range-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(520px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}
.lf-range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
}
.lf-range-field { display: grid; gap: 6px; min-width: 0; }
.lf-range-field > span { color: var(--lg-muted); font-size: 12px; line-height: 16px; }
.lf-range-field .lf-field { font-variant-numeric: tabular-nums; }
.lf-dash { padding-bottom: 7px; color: var(--lg-muted); font-size: 12px; }
.lf-quick {
  flex: 1 1 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--lg-line);
  border-radius: 12.8px;
  background: #fff;
  color: var(--lg-fg);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.lf-quick:hover { background: var(--lg-hover); }
/* The date-time picker behind the two range fields. The browser's own
   datetime-local popup has no way to say "done", so the fields are a hidden
   input plus this button and picker, which end in 取消 / 确认. */
.lf-dt-trigger { display: flex; align-items: center; width: 100%; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.dt-pop {
  position: absolute;
  z-index: 40;
  width: 292px;
  padding: 12px;
  border: 1px solid var(--lg-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
  color: var(--lg-fg);
  font-size: 13px;
}
.dt-pop[hidden] { display: none; }
.dt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dt-title { font-size: 14px; font-weight: 600; }
.dt-nav {
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--lg-line); border-radius: 8px;
  background: #fff; color: var(--lg-fg); font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
}
.dt-nav:hover { background: var(--lg-hover); }
.dt-week, .dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dt-week span { padding: 4px 0; color: var(--lg-muted); font-size: 12px; }
.dt-day {
  height: 32px; padding: 0;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--lg-fg); font: inherit; cursor: pointer;
}
.dt-day:hover { background: var(--lg-hover); }
.dt-day.is-other { color: var(--lg-muted); opacity: .55; }
.dt-day.is-today { box-shadow: inset 0 0 0 1px var(--lg-primary); }
.dt-day.is-selected { background: var(--lg-primary); color: #fff; opacity: 1; box-shadow: none; }
.dt-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--lg-line); }
.dt-time-label { margin-right: auto; color: var(--lg-muted); font-size: 12px; }
.dt-time select {
  height: 30px; padding: 0 8px;
  border: 1px solid var(--lg-line); border-radius: 8px;
  background: #fff; color: var(--lg-fg); font: inherit; font-variant-numeric: tabular-nums;
}
.dt-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.dt-spacer { flex: 1; }
.dt-link { padding: 0; border: 0; background: none; color: var(--lg-primary-d); font: inherit; cursor: pointer; }
.dt-link:hover { text-decoration: underline; }

.lf-combo-icon,
.lf-select-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  pointer-events: none;
}

.lf-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  justify-content: flex-end;
  gap: 8px;
}
/* New API's RPM / TPM pills, as one quiet chip by the buttons: the last 60
   seconds of the account (under the key / model / group filters), whatever the
   time range says. */
.lf-rate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: var(--lf-h);
  padding: 0 2px;
  margin-right: 2px;
  color: var(--lf-note);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: default;
}
.lf-rate::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: -3px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}
.lf-rate.is-idle::before { background: #c4c9ce; box-shadow: none; }
.lf-rate b { margin-left: 4px; color: var(--lg-fg); font-weight: 500; }
.lf-rate.is-idle b { color: var(--lf-note); font-weight: 400; }
.lf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: #fff;
  color: var(--lg-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.lf-btn:hover { background: var(--lg-hover); color: var(--lg-fg); }
.lf-btn-primary { border-color: transparent; background: var(--lg-primary); color: #fff; }
.lf-btn-primary:hover { background: var(--lg-primary-d); color: #fff; }

/* ---------- usage log header: stats cards + toolbar ---------- */
.logs-page {
  --lf-h: 30px;                       /* 控件高度，与 .lf-btn 保持一致 */
  --lf-note: #565c62;                 /* 次要文字：白底 6.6:1 */
  --lf-soft: #f0f0f0;                 /* 行内分隔线，比 --lg-line 更轻 */
  --lf-cap: #fafafa;                  /* 标签格底色，与表头 #fbfbfb 同一档 */
  --lf-set-line: #b8e3cd;             /* 「已选中」描边 */
  --lf-ring: 0 0 0 3px rgba(4, 120, 87, .16);
  --lf-focus: 2px solid rgba(4, 120, 87, .6);
}

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


/* ---------- 汇总：不再是卡片 ---------- */
/* 第一行：所选范围的统计（左）+ 时间快捷与真实起止（右），直接放在页面上；
   第二行夹在两道细线之间：密钥 / 模型 / 分组 + 实时 RPM/TPM + 请求 ID。 */
.logs-head { padding: 0; background: none; }
.lf-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.lf-row-top { align-items: flex-end; gap: 14px 24px; padding: 4px 2px 18px; }
.lf-row-filters {
  /* shrink the boxes rather than wrap: the bar is one line on a laptop */
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--lg-line);
  border-bottom: 1px solid var(--lg-line);
}

/* 统计：大号数字横排，标签在上 */
.logs-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 44px;
  min-width: 0;
}
.lstat { position: relative; min-width: 0; }
.lstat-label {
  margin: 0 0 4px;
  color: var(--lf-note);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
}
.lstat-value {
  margin: 0;
  color: var(--lg-fg);
  font-size: 26px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* the figures in ink; only the hit rate, a good number, is brand green */
.lstat-req .lstat-value,
.lstat-tok .lstat-value,
.lstat-cost .lstat-value { color: #18181b; }
.lstat-hit .lstat-value { color: #047857; }
.lstat-split b, .lstat-foot b { font-weight: 600; }
.lstat-value .cur { margin-right: 1px; color: var(--lf-note); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.lstat-foot,
.lstat-split {
  margin: 2px 0 0;
  color: var(--lf-note);
  font-size: 11.5px;
  line-height: 15px;
  white-space: nowrap;
}
.lstat-foot b,
.lstat-split b { color: #3f4448; font-weight: 600; font-variant-numeric: tabular-nums; }
.lstat-split span { white-space: nowrap; }

/* 空数据：数字退成灰 */
.lstat.is-empty .lstat-value { color: #8b9095; }
.lstat.is-empty .lstat-foot b,
.lstat.is-empty .lstat-split b { color: var(--lf-note); font-weight: 500; }

/* ---------- 时间快捷：一条灰色分段条，选中的是白色标签；其余预设和自定义在「更多」里 ---------- */
.lf-time { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; margin-left: auto; }
.lf-seg { display: flex; align-items: center; gap: 0; padding: 3px; border-radius: 9px; background: #f3f4f6; }
.lf-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #6b7280;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 28px;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.lf-seg-btn:hover,
.lf-seg-btn.is-hover { background: rgba(255, 255, 255, .6); color: var(--lg-fg); }
.lf-seg-btn:focus-visible,
.lf-seg-btn.is-focus { outline: var(--lf-focus); outline-offset: 1px; }
.lf-seg-btn.on {
  background: #fff;
  color: var(--lg-fg);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.lf-seg .lf-range { position: static; display: block; }
.lf-seg .lf-range-trigger::-webkit-details-marker { display: none; }
.lf-seg .lf-range-trigger::marker { content: ""; }
.logs-head .lf-range[open] > .lf-range-trigger,
.logs-head .lf-range-trigger.is-open {
  background: #fff;
  color: var(--lg-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.lf-seg .lf-icon { width: 14px; height: 14px; color: currentColor; transition: transform .15s ease; }
.lf-range[open] .lf-range-chev { transform: rotate(180deg); }

/* 当前范围的真实起止时间 —— 近 24 小时是滚动的，所以必须写出来；放在分段条下面 */
.lf-span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-right: 2px;
  color: #9aa1a9;
  font-size: 11.5px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lf-span .lf-icon { width: 12px; height: 12px; color: #b4b9be; }
.lf-span .lf-range-text { overflow: visible; }

/* 展开面板：8 个预设（最近 / 日历两组）+ 自定义起止 + 应用；贴着时间胶囊右对齐 */
.lf-range-pop {
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 468px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .05);
}
.lf-pop-head { display: none; }
.lf-pop-sec { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; }
.lf-pop-sec + .lf-pop-sec { margin-top: 8px; }
.lf-pop-cap { color: var(--lf-note); font-size: 12px; line-height: 16px; }
.lf-pop-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lf-quick {
  flex: none;
  height: var(--lf-h);
  padding: 0 4px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: #fff;
  color: var(--lg-fg);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .12s ease, border-color .12s ease;
}
.lf-quick:hover,
.lf-quick.is-hover { background: var(--lg-hover); border-color: #d2d6d9; }
.lf-quick:focus-visible { outline: var(--lf-focus); outline-offset: 1px; }
.lf-quick.on {
  border-color: var(--lf-set-line);
  background: var(--tint-2);
  color: var(--green-d);
  font-weight: 600;
}
.lf-pop-custom {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--lf-soft);
}
.lf-pop-custom > .lf-pop-cap { display: block; margin-bottom: 8px; }
.lf-range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.lf-range-field > span { color: var(--lf-note); font-size: 12px; line-height: 16px; }
.lf-range-fields .lf-dash { padding: 0; line-height: var(--lf-h); text-align: center; color: #8b9095; }
.lf-range-fields .lf-dt-trigger {
  gap: 6px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 13px;
  background: #fff;
}
.lf-range-fields .lf-dt-trigger:hover { border-color: #d2d6d9; }
.lf-range-fields .lf-dt-trigger:focus-visible,
.lf-range-fields .lf-dt-trigger.is-focus { border-color: var(--green); box-shadow: var(--lf-ring); }
.lf-range-fields .lf-dt-trigger .lf-icon { margin-left: auto; width: 14px; height: 14px; }

/* ---------- 筛选：虚线小标签「名称 值 ⌄」，原生 <select> 按内容取宽；选中后转成实线绿 ---------- */
.lf-group {
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: var(--lf-h);
  border: 1px dashed #d4d8dc;
  border-radius: 7px;
  background: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.lf-group:hover,
.lf-group.is-hover { border-color: #b9bfc5; }
.lf-cap {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
  padding: 0 0 0 10px;
  color: var(--lf-note);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  cursor: default;
}
.lf-cap .lf-icon { display: none; width: 14px; height: 14px; color: currentColor; }
/* The filter boxes take their width from the window, never from what they
   hold: they share the free room in the bar (up to 280px each) and shrink to
   160px on a laptop so the bar stays on one line. A long choice ends in "…". */
.lf-sel { flex: 1 1 260px; min-width: 160px; max-width: 280px; }
.lf-sel-ctl { position: relative; display: flex; flex: 1 1 auto; min-width: 0; }
.lf-sel select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 24px 0 6px;
  border: 0;
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: var(--lg-fg);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.lf-sel .lf-combo-icon { right: 7px; width: 12px; height: 12px; }
/* the operator's 用户 filter is a text box in the same frame as the selects */
.lf-sel.lf-user { flex-basis: 320px; max-width: 340px; }
/* the model box's suggestions (site.js, input[data-suggest]) */
.lf-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: -6px;
  z-index: 30;
  min-width: calc(100% + 12px);
  max-height: 300px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
  list-style: none;
}
.lf-suggest[hidden] { display: none; }
.lf-suggest li {
  padding: 6px 10px;
  border-radius: 5px;
  color: #27272a;
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}
.lf-suggest li:hover,
.lf-suggest li.is-active { background: #f4f4f5; }
.lf-sel input[type="text"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 8px 0 6px;
  border: 0;
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: var(--lg-fg);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  outline: none;
}
.lf-sel.is-set input[type="text"] { color: var(--green-d); font-weight: 600; }
.lf-sel:focus-within,
.lf-sel.is-focus { border-color: var(--green); box-shadow: var(--lf-ring); }

/* 已选中：描边、名称、值全部转绿，一眼看出「现在带着条件」 */
.lf-sel.is-set,
.lf-sel:has(option:checked:not([value=""])) { border-style: solid; border-color: #cfe7dc; background: #f2faf6; }
.lf-sel.is-set .lf-cap,
.lf-sel:has(option:checked:not([value=""])) .lf-cap { color: var(--green-d); }
.lf-sel.is-set select,
.lf-sel:has(option:checked:not([value=""])) select { color: var(--green-d); font-weight: 600; }
.lf-sel.is-set .lf-combo-icon,
.lf-sel:has(option:checked:not([value=""])) .lf-combo-icon { color: var(--green-d); }
.lf-sel.is-set:focus-within,
.lf-sel:has(option:checked:not([value=""])):focus-within { border-color: var(--green); }

/* ---------- 右侧：实时 RPM/TPM、请求 ID 搜索框、重置（有条件时才出现） ---------- */
.logs-head .lf-actions { flex: none; margin-left: auto; gap: 10px; }
/* Narrower than a laptop window (a phone showing the desktop site, a tablet):
   the boxes are already at their 160px floor and the bar still does not fit,
   so instead of pushing the page wider than the window the right-hand group
   takes its own line, right-aligned. The boxes start at that floor here and
   grow into the room. From 1280px up the bar stays one line, as above. */
@media (max-width: 1279px) {
  .lf-row-filters { flex-wrap: wrap; }
  .lf-sel { flex-basis: 160px; }
  .lf-sel.lf-user { flex: 1.5 1 180px; }
  .logs-head .lf-actions { flex: 0 1 auto; min-width: 0; }
}
.logs-head .lf-btn {
  gap: 6px;
  height: var(--lf-h);
  padding: 0 12px;
  border-color: #e3e6e5;
  border-radius: 7px;
  font-size: 12.5px;
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.logs-head .lf-btn:focus-visible,
.logs-head .lf-btn.is-focus { outline: var(--lf-focus); outline-offset: 2px; }
.logs-head .lf-btn-primary { border-color: transparent; background: var(--green); padding: 0 18px; font-weight: 600; }
.logs-head .lf-btn-primary:hover,
.logs-head .lf-btn-primary.is-hover { background: var(--green-d); }
/* 重置：没有条件时是灰的、不可点；带着条件时变成可用态 */
.logs-head .lf-reset { color: var(--green-d); border-color: var(--lf-set-line); }
.logs-head .lf-reset:hover,
.logs-head .lf-reset.is-hover { background: var(--tint-2); color: var(--green-d); }
.logs-head .lf-reset[aria-disabled="true"] { display: none; }

/* Single-key scope (?token_id=): the key drop-down is replaced by a read-only chip. */
.lf-scope { cursor: default; border-style: solid; border-color: #cfe7dc; background: #f2faf6; }
.lf-scope .lf-cap { color: var(--green-d); }
.lf-scope-val { display: flex; align-items: center; padding: 0 12px 0 8px; color: var(--green-d); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 手机（沿用站点 logs 页的 700px 断点） ---------- */
@media (max-width: 700px) {
  .logs-page { --lf-h: 40px; }              /* 触控目标 */

  /* 统计：两列两行，去掉竖线 */
  .lf-row-top { gap: 14px; padding: 14px; }
  .logs-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; width: 100%; }
  .lstat-req { order: 1; }
  .lstat-cost { order: 2; }
  .lstat-tok { order: 3; }
  .lstat-hit { order: 4; gap: 9px; }
  .lstat-value { font-size: 22px; line-height: 26px; }
  .lstat-foot,
  .lstat-split { white-space: normal; }

  /* 时间：整行一条分段条 */
  .lf-time { flex: 1 1 100%; align-items: stretch; margin-left: 0; }
  .lf-seg { height: var(--lf-h); padding: 3px; gap: 2px; border-radius: 12px; }
  .lf-seg-btn { flex: 1 1 auto; height: 34px; padding: 0 4px; border-radius: 9px; line-height: 34px; font-size: 13px; }
  .lf-seg .lf-range { flex: 1 1 auto; }
  .lf-seg .lf-range-trigger { width: 100%; }

  /* 筛选：起止时间一整行，下面两列；名称变成控件上方的小标题 */
  .lf-row-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; padding: 12px 14px 14px; }
  .lf-group { flex-direction: column; height: auto; border: 0; border-radius: 0; background: none !important; box-shadow: none !important; }
  .lf-group:hover { border-color: transparent; }
  .lf-cap { padding: 0 0 4px; font-size: 12px; line-height: 16px; color: var(--lf-note) !important; }
  .lf-cap .lf-icon { display: inline; }
  .lf-sel { flex: none; width: auto; min-width: 0; max-width: none; }
  .lf-sel-ctl { height: var(--lf-h); border: 1px solid #e3e6e5; border-radius: 12px; background: #fff; }
  .lf-sel select { border-radius: 12px; font-size: 16px; padding-left: 12px; }   /* 16px：iOS 聚焦不缩放 */
  .lf-sel.lf-user { width: auto; max-width: none; }
  .lf-sel:focus-within,
  .lf-sel.is-focus { border-color: transparent; box-shadow: none; }
  .lf-sel:focus-within .lf-sel-ctl,
  .lf-sel.is-focus .lf-sel-ctl { border-color: var(--green); box-shadow: var(--lf-ring); }
  .lf-sel.is-set,
  .lf-sel:has(option:checked:not([value=""])) { border-color: transparent; }
  .lf-sel.is-set .lf-sel-ctl,
  .lf-sel:has(option:checked:not([value=""])) .lf-sel-ctl { border-color: var(--lf-set-line); background: var(--tint-2); }
  .lf-sel.is-set .lf-cap,
  .lf-sel:has(option:checked:not([value=""])) .lf-cap { color: var(--green-d) !important; }
  .lf-sel.is-set:focus-within .lf-sel-ctl,
  .lf-sel:has(option:checked:not([value=""])):focus-within .lf-sel-ctl { border-color: var(--green); }
  .lf-sel .lf-combo-icon { right: 12px; }
  .lf-scope-val { height: var(--lf-h); padding: 0 12px; border: 1px solid var(--lf-set-line); border-radius: 12px; background: var(--tint-2); }
  .logs-head .lf-actions { display: flex; grid-column: 1 / -1; align-self: end; flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }
  .logs-head .lf-actions .lf-btn { flex: 1 1 0; justify-content: center; border-radius: 12px; padding: 0 8px; }

  /* 展开面板：手机上做成底部抽屉（纯 CSS，fixed + ::before 遮罩），
     不会再被折叠线以下的内容顶到屏幕外；点遮罩 / × / Esc 关闭（site.js 已有 closeDetailsPopovers，
     遮罩点击只需多认一个 details 自身作为 target，见 NOTES） */
  /* 抽屉打开时，把工具栏的层叠上下文抬到顶栏(30)之上，遮罩才会盖住顶栏；
     只在打开时抬，否则滚动时工具栏会盖到粘性顶栏上面 */
  .logs-head:has(.lf-range[open]) { z-index: 35; }
  .lf-range[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(15, 23, 42, .4);
  }
  .lf-range-pop {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 31;
    width: auto;
    max-width: none;
    max-height: min(86dvh, 560px);
    overflow: auto;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .22);
  }
  .lf-range-pop::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 2px;
    background: #d6d9dc;
  }
  .lf-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .lf-pop-head strong { font-size: 16px; font-weight: 600; }
  .lf-pop-close {
    display: grid; place-items: center;
    width: 32px; height: 32px; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--lg-hover); color: var(--lg-muted);
    font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
  }
  .lf-pop-close:focus-visible { outline: var(--lf-focus); outline-offset: 2px; }
  .lf-pop-sec { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lf-pop-chips { gap: 8px; }
  .lf-quick { height: 36px; border-radius: 18px; font-size: 13px; }
  .lf-pop-custom { margin-top: 16px; padding-top: 14px; }
  .lf-range-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lf-range-fields .lf-dash { display: none; }
  .lf-range-fields .lf-dt-trigger { height: var(--lf-h); border-radius: 20px; padding: 0 12px; font-size: 14px; }
  .lf-range-fields .lf-btn { grid-column: 1 / -1; width: 100%; height: var(--lf-h); border-radius: 20px; justify-content: center; margin-top: 4px; }
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line-3);
  border-radius: var(--r-sm);
  background: #fff;
  overflow: hidden;
}

.seg-btn {
  display: block;
  border: 0;
  border-right: 1px solid var(--line-3);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
  padding: 7px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}

.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--tint); color: var(--ink); }
.seg-btn.on { background: var(--green); color: #fff; }

.cache-hit {
  color: var(--green-d);
  font-weight: 500;
}

/* The page itself stays still: rows scroll inside this card, while the column
   labels stay pinned at its top and the pager sits right under it. */
.logs-frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Content-sized but allowed to shrink: a short page ends the card at its last
   row with the pager right under it, as in New API; a long one fills the
   frame and scrolls. */
.logs-scroll {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  transition: opacity .14s ease;
}

/* New API keeps the pager mounted while it loads another page. Only the rows
   soften briefly, so controls do not vanish or jump around during the request. */
.logs-frame.is-loading .logs-scroll { opacity: .48; }
.logs-frame.is-loading .logs-pager { cursor: progress; }
.logs-frame.is-loading .pager-total::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid #d4e9fa;
  border-top-color: var(--lg-primary);
  border-radius: 50%;
  vertical-align: -2px;
  animation: log-page-spin .65s linear infinite;
}

.logs-page-error {
  flex-basis: 100%;
  color: #b45309;
  font-size: 12px;
  text-align: right;
}

@keyframes log-page-spin { to { transform: rotate(360deg); } }

/* The frame has to end exactly at the viewport bottom, or the pager sits just
   below the fold: you scroll to click it, the click loads a new page at scroll
   top, and the bar appears to vanish until you scroll again. Sizing the frame
   as `100dvh - 196px` guessed the distance from the viewport top down to the
   frame, and the guess was 27px short — 75px once the filter row wrapped to two
   lines. Nothing here may assume that distance: the body takes the viewport
   height and each link in the chain hands the remainder down, so the frame
   ends where the padding does no matter how tall the header or filters grow. */
@media (min-width: 900px) {
  body:has(.app[data-page="logs"]) {
    height: 100dvh;
    /* auto rather than hidden: below the min-height floor the frame stops
       shrinking, and then the page still has to be able to scroll to the pager */
    overflow: auto;
  }

  /* `body > .app` ships flex: 1 0 auto; a shrink factor of 0 would let a
     hundred rows push the pager back off the bottom edge. */
  body:has(.app[data-page="logs"]) > .app { flex: 1 1 auto; min-height: 0; }

  /* Every other console page wants align-items: start. This grid row has to
     stretch instead, or the main column is only as tall as its content and the
     frame inherits no height to fill. */
  .app[data-page="logs"] { align-items: stretch; }
  .app[data-page="logs"] > .side { align-self: start; }

  .logs-page { display: flex; flex-direction: column; min-height: 0; }
  .logs-frame { flex: 1 1 auto; min-height: 300px; }
}

/* ---------- log table ---------- */

/* The usage log reads like New API's: the system UI face (SF Pro on a Mac,
   Segoe UI on Windows, PingFang / YaHei for Chinese) in regular to medium
   weights, not the site's Inter at semibold. Form controls inside the page
   follow it. */
.logs-page {
  --font-log: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-family: var(--font-log);
}
.logs-page button,
.logs-page input,
.logs-page select,
.logs-page textarea { font-family: inherit; }

/* One line per call, nine columns, no pills or second lines. Colour only where
   it means something: the status dot, a slow wait, cache reads (cheap) and
   writes (dear), a ratio below or above list price, and a billing line that is
   not a plain charge. Time, the numbers and the cost have fixed widths sized
   to their content; model, key · group and billing split the rest, and any of
   them that runs out of room ends in "…" with its whole text in the cell's
   title. A narrower window scrolls the table sideways inside .logs-scroll.
   `separate` rather than the shared `collapse` so the sticky header keeps its
   bottom rule while the rows scroll under it. */
.tbl.tbl-logs {
  table-layout: fixed;
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--lg-fg);
  font-size: 12.5px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.tbl.tbl-logs th,
.tbl.tbl-logs td {
  padding: 0 8px;
  border-bottom: 1px solid #f3f4f5;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbl.tbl-logs thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  border-bottom-color: var(--lg-line);
  background: #fff;
  color: #6b727a;
  cursor: grab;
  user-select: none;
  font-size: 11.5px;
  font-weight: 500;
}
.tbl.tbl-logs .num { text-align: right; font-weight: inherit; }
/* Column widths follow what each column holds. The key cell has two lines
   (key above, group and ratio below), so it needs the width of one of them,
   not both. On a laptop the numbers, time and cost keep the width their
   content needs and model, key and billing share the rest; once the window is
   wide enough for every column to show whole, each column takes a share in
   proportion to its content (measured on real rows), so the row is evenly
   balanced instead of one column swallowing the slack. The group line is
   not sized for the longest counter name: the key column is as wide as a
   usual cell needs (「deepseek-advanced 0.4×」 measured at 189px), and a
   longer group name ends in "…" with the whole of it in the cell's title.
   The room it frees goes to the model and billing columns. */
.tbl-logs .col-ts { width: 146px; }
.tbl-logs .col-model { width: 13.5%; }
.tbl-logs .col-stream { width: 68px; }
.tbl-logs .col-key { width: 176px; }
.tbl-logs .col-in { width: 62px; }
.tbl-logs .col-out { width: 54px; }
.tbl-logs .col-cache { width: 112px; }
.tbl-logs .col-hit { width: 56px; }
.tbl-logs .col-lat { width: 98px; }
.tbl-logs .col-cost { width: 92px; }
/* From 1600px every column, 计费 included, has a share of the row, so the
   room past what the content needs is spread across all of them rather than
   piling up in 计费 (the one column without a width) as a blank block at the
   right. The shares follow each column's content width (measured on real
   rows), so at 1600px no column is cut and a wider window widens all of them
   in step. */
@media (min-width: 1600px) {
  .tbl-logs .col-ts { width: 11%; }
  .tbl-logs .col-key { width: 14.5%; }
  .tbl-logs .col-model { width: 15.5%; }
  .tbl-logs .col-stream { width: 5.5%; }
  .tbl-logs .col-in { width: 6%; }
  .tbl-logs .col-out { width: 5%; }
  .tbl-logs .col-cache { width: 9%; }
  .tbl-logs .col-hit { width: 4.5%; }
  .tbl-logs .col-cost { width: 7%; }
  .tbl-logs .col-lat { width: 8%; }
  .tbl-logs .col-detail { width: 14%; }
}
/* The operator's table adds 用户, shows 渠道 as the time cell's second line, and
   folds 首字 / 总计 over 花费 into one two-line column (the customer's table
   keeps them apart). It keeps a floor width and scrolls sideways below it
   (it fits a 1,660px window; route names run to 25 characters, so squeezing
   it further would clip the model and the route on most rows). These rules
   outrank the customer table's shares. */
.tbl.tbl-logs.has-user { min-width: 1372px; }
/* Never narrower than that floor, so every column, 计费 included, is a share
   of the row: the widths at the floor, scaled with the window, so a wider
   window spreads its room over all of them instead of into 计费. */
.tbl-logs.has-user .col-ts { width: 14.14%; }
.tbl-logs.has-user .col-user { width: 9.91%; }
.tbl-logs.has-user .col-key { width: 16.25%; }
.tbl-logs.has-user .col-model { width: 14.14%; }
.tbl-logs.has-user .col-stream { width: 4.96%; }
.tbl-logs.has-user .col-in { width: 4.96%; }
.tbl-logs.has-user .col-out { width: 4.3%; }
.tbl-logs.has-user .col-cache { width: 8.53%; }
.tbl-logs.has-user .col-hit { width: 3.94%; }
.tbl-logs.has-user .col-lc { width: 7.58%; }
.tbl-logs.has-user .col-detail { width: 11.29%; }
/* From 1920px the row is wide enough for every column's content (measured
   on real rows: 1,460px), so the shares follow the content instead, numbers
   with a few px to spare; past that every column widens in step. */
@media (min-width: 1920px) {
  .tbl-logs.has-user .col-ts { width: 11.67%; }
  .tbl-logs.has-user .col-user { width: 15.79%; }
  .tbl-logs.has-user .col-key { width: 14.07%; }
  .tbl-logs.has-user .col-model { width: 14.86%; }
  .tbl-logs.has-user .col-stream { width: 4.05%; }
  .tbl-logs.has-user .col-in { width: 4.3%; }
  .tbl-logs.has-user .col-out { width: 3.81%; }
  .tbl-logs.has-user .col-cache { width: 7.49%; }
  .tbl-logs.has-user .col-hit { width: 3.26%; }
  .tbl-logs.has-user .col-lc { width: 6.51%; }
  .tbl-logs.has-user .col-detail { width: 14.19%; }
}
/* A text column after another text column gets a wider gutter, so a name cut
   short with "…" still stands clear of the next one. Before the first-child
   rule, which wins if one of them is dragged to the front. */
.tbl.tbl-logs th.col-user, .tbl.tbl-logs td.log-user,
.tbl.tbl-logs th.col-key, .tbl.tbl-logs td.log-key,
.tbl.tbl-logs th.col-model, .tbl.tbl-logs td.log-model,
.tbl.tbl-logs th.col-stream, .tbl.tbl-logs td.log-stream,
.tbl.tbl-logs th.col-detail, .tbl.tbl-logs td.log-detail-action { padding-left: 18px; }
.tbl.tbl-logs td { height: 50px; }
.tbl.tbl-logs th:first-child, .tbl.tbl-logs td:first-child { padding-left: 12px; }
.tbl.tbl-logs th:last-child, .tbl.tbl-logs td:last-child { padding-right: 12px; }
.tbl.tbl-logs tbody tr:hover { background: none; }
.tbl.tbl-logs tbody tr:hover > td { background: #fafbfb; }
/* Unbilled and cut-short rows: a red line down the left edge beside the red dot. */
.tbl.tbl-logs .log-row.is-abnormal > td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.tbl-logs .muted { color: #8a9198; font-weight: 400; }
/* dragging a heading: the column being moved fades, a bar marks where it lands */
.tbl.tbl-logs thead th.is-dragging { opacity: .45; cursor: grabbing; }
.tbl.tbl-logs thead th.drop-before { box-shadow: inset 3px 0 0 #2563eb; }
.tbl.tbl-logs thead th.drop-after { box-shadow: inset -3px 0 0 #2563eb; }
.log-cols-reset {
  margin-right: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.log-cols-reset:hover { text-decoration: underline; text-underline-offset: 2px; }
/* Icons are lucide's (ISC), the set New API's usage-log table draws, kept in
   a sprite at the top of the page so each row only carries a <use>. */
.log-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.tbl-logs .li {
  display: inline-block;
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}
/* operator only: a backup (兜底) answer carries New API's GitBranch mark in amber */
.tbl-logs .log-fb { margin-right: 5px; color: #d97706; }
/* the username opens the account card; the avatar is New API's: the first
   letter on the name's hash hue */
.log-user-btn {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: #3f3f46;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.log-user-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.log-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}
/* dark like the rest of the row, not link blue; the underline on hover says it opens */
.log-user-btn:hover .log-user-text { color: #18181b; text-decoration: underline; text-underline-offset: 2px; }
.log-user-btn .log-uid { color: var(--lc-faint); }
.log-user-empty { margin: 18px 4px; color: var(--ink-2); font-size: 13px; }
.log-user-hd { display: flex; align-items: center; gap: 12px; }
.log-user-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 17px;
  font-weight: 600;
  text-transform: uppercase;
}
.log-user-id { min-width: 0; flex: 1 1 auto; }
.log-user-name { margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.log-user-dn { color: var(--ink-2); font-weight: 400; }
.log-user-meta { margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }
.log-user-meta .lu-st { color: #16a34a; font-weight: 500; }
.log-user-meta .lu-st.is-off { color: #dc2626; }
.log-user-link { flex: none; color: #2563eb; font-size: 12.5px; }
.log-user-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.log-user-sub { color: var(--ink-3); }
.lu-none { color: var(--ink-3); }
.log-user-topups { margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed #e5e7eb; list-style: none; font-size: 12px; }
.log-user-topups li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 2px 0; color: var(--ink-2); }
.log-user-topups b { color: #16a34a; font-weight: 600; }

/* Status: a dot ahead of the time. The word stays in the markup for screen
   readers and the English pass, but takes no room. */
.log-kind-tag {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 50%;
  background: #10b981;
  color: transparent;
  font-size: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.log-kind-tag.is-warn { background: #ef4444; }
/* A client cancel is not a fault: amber. */
.log-kind-tag.is-neutral { background: #f59e0b; }
/* Colour: the text is greyscale in four steps (ink for what is read first:
   token, model, figures, cost; body grey for the route and the user; muted
   for the group and the date; faint for labels, ratios and empty cells).
   Colour is kept for what has to stand out: a group is a soft chip in its New
   API hash hue, so counters tell apart at a glance; a high cache hit is the
   brand green; 首字 / 总计 take New API's green / yellow / red; a backup answer amber, a failure
   red. A model's colour is its vendor icon, not its text. */
.tbl-logs { --lc-ink: #18181b; --lc-sub: #52525b; --lc-faint: #a1a1aa; }
.log-time { color: #27272a; }
.log-date { margin-right: 6px; color: var(--lc-faint); }
.log-uid { color: var(--lc-faint); }
.log-user { color: #3f3f46; }

.log-model-name { display: inline-flex; max-width: 100%; align-items: center; gap: 8px; vertical-align: middle; }
.log-model-icon { display: block; width: 15px; height: 15px; flex: none; }
.log-model-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lc-ink); font-weight: 500; }
/* 流: 流 or 非流 above, a stream's output speed below, like New API's column */
.log-stream .ls-kind,
.log-stream .ls-tps { display: block; white-space: nowrap; }
.log-stream .ls-kind { color: #a1a1aa; font-size: 12px; line-height: 17px; }
.log-stream .ls-kind.is-stream { color: #3f3f46; font-weight: 500; }
.log-stream .ls-tps { margin-top: 2px; color: #71717a; font-size: 11.5px; line-height: 16px; font-variant-numeric: tabular-nums; }

.log-token { color: var(--lc-ink); font-weight: 500; }
.log-key .lk-1,
.log-key .lk-2 { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.log-key .lk-2 { margin-top: 3px; font-size: 11.5px; line-height: 17px; }
/* New API's KeyRound ahead of the token name */
.log-key .log-key-icon { width: 12px; height: 12px; margin-right: 5px; color: #a1a1aa; }
.log-key .log-token { flex: 0 1 auto; min-width: 3em; overflow: hidden; text-overflow: ellipsis; }
.log-key .log-dot { flex: none; white-space: pre; }
.log-key .log-group { flex: 0 1 auto; min-width: 0; max-width: 250px; overflow: hidden; padding: 0 6px; border-radius: 4px; text-overflow: ellipsis; }
.log-key .log-ratio { flex: none; margin-left: 6px; }
/* operator only: the route that answered; a backup (兜底) is amber */
/* The operator's time cell: the time, then the route under it, lined up
   with the date (past the status dot). A long route name ends in "…"; the
   line's title carries the whole of it and the failover walk. */
.log-ts .lt-2 { display: block; margin-top: 3px; padding-left: 16px; overflow: hidden; font-size: 11.5px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.log-up-name { color: #3f3f46; }
.log-up.is-fb .log-up-name { color: #b45309; font-weight: 500; }
.col-sub { color: #9aa1a9; font-weight: 400; }
.log-dot { color: #c2c7cc; }
/* a group is a soft chip in New API's hashed hue: a pale fill, the text a
   dark shade of the same hue */
.log-group { background: #f1f1f3; color: #52525b; }
.log-group.log-hue-purple { background: #f3edfd; color: #6b3fb8; }
.log-group.log-hue-violet { background: #efecfd; color: #5a3fb5; }
.log-group.log-hue-indigo { background: #eceffd; color: #3f4aa8; }
.log-group.log-hue-blue { background: #e9f0fd; color: #2a55a3; }
.log-group.log-hue-light-blue { background: #e6f2fb; color: #1f629c; }
.log-group.log-hue-cyan { background: #e3f4f7; color: #146a7d; }
.log-group.log-hue-teal { background: #e2f4f0; color: #116b5e; }
.log-group.log-hue-green { background: #e5f5ec; color: #18703f; }
.log-group.log-hue-lime { background: #eef5df; color: #4b6a15; }
.log-group.log-hue-yellow,
.log-group.log-hue-amber { background: #fbf2de; color: #8a5b0c; }
.log-group.log-hue-orange { background: #fcede3; color: #a2461b; }
.log-group.log-hue-red { background: #fcebed; color: #b2263c; }
.log-group.log-hue-pink { background: #fcebf3; color: #a32b66; }
.log-group.log-hue-grey { background: #f1f1f3; color: #52525b; }
.log-ratio { margin-left: 4px; color: var(--lc-faint); }
/* above the list price: amber; at or below it the ratio stays grey */
.log-ratio.is-up { color: #b45309; }

/* Figures in ink; a cache write is the faint "↑" after the read. */
.tok-in, .tok-out, .tok-img { color: #27272a; }
.log-cache .cache-r { color: #3f3f46; }
.log-cache .cache-w { margin-left: 5px; color: #a1a1aa; }
.log-hit .hit-hi { color: #047857; font-weight: 600; }
.log-hit .hit-mid { color: #3f3f46; font-weight: 500; }
.log-hit .hit-lo { color: #71717a; }
/* 首字 / 总计 in New API's three status colours (its light theme's success,
   warning and destructive), on its thresholds: see LogEntry.ElapsedTier. */
.log-lat .lat-fast,
.log-lc .lat-fast { color: #009966; }
.lat-mid { color: #d08700; }
.lat-slow { color: #e7000b; }
.lat-sep { color: #d4d4d8; }
.log-cost-v { color: #18181b; font-weight: 600; }
/* operator: 首字 / 总计 above, 花费 below, both right-aligned */
.log-lc .lc-1,
.log-lc .lc-2 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-lc .lc-2 { margin-top: 2px; font-size: 12.5px; line-height: 17px; }
.cost-zero { color: var(--lc-faint); font-weight: 400; }

/* Billing: the formula's first term, then "+N" for the rest (cache, peak,
   discount), the way New API previews its billing segments. Grey until the
   row is hovered; a fault is red, a client cancel amber. The whole line is in
   the tooltip and the dialog. */
.log-detail-btn {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #71717a;
  font: inherit;
  font-size: 12.5px;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
}
.log-detail-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Hovering anywhere on a row underlines its billing text, the way New API
   does, so the one clickable thing in the row announces itself. */
.log-detail-btn:hover .log-detail-text,
.tbl.tbl-logs tbody tr:hover .log-detail-btn .log-detail-text,
.tbl.tbl-logs tbody tr:focus-within .log-detail-btn .log-detail-text { text-decoration: underline; text-underline-offset: 2px; }
.tbl.tbl-logs tbody tr:hover .log-detail-btn:not(.is-warn):not(.is-neutral) { color: #047857; }
.log-detail-btn.is-warn { color: #dc2626; }
.log-detail-btn.is-neutral { color: #b45309; }
.log-detail-more { flex: none; color: #a1a1aa; font-size: 11.5px; }
/* a failed call leads with New API's CircleAlert */
.log-detail-btn .log-alert { align-self: center; }
.log-detail-btn:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(4, 120, 87, .45);
  outline-offset: 2px;
}
/* Prefix, not a badge: a rare estimate flag should not widen the column for
   every row. */
.tok-est { margin-right: 2px; color: var(--lg-muted); font-weight: 400; cursor: help; }

.note-bad { color: #b45309; }

.log-bill-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: #f6f7f8;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
}
.log-bill-modal::backdrop { background: rgba(15, 23, 42, .44); }
/* One scrollbar, not two. The dialog caps its own height and its body used to
   cap itself separately (86vh - a guessed header height); on a screen taller
   than ~950px the dialog's cap (820px) came first, so the dialog scrolled and
   the body inside it scrolled too. Now the dialog is a column that clips, the
   header keeps its size and the body takes what is left and scrolls alone. */
.log-bill-modal[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.log-bill-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid #eceef0;
}
.log-bill-model {
  margin: 0;
  color: #727a82;
  font-size: 12px;
  font-family: var(--mono);
}
.log-bill-head h2 { margin: 2px 0 0; font-size: 16px; }
.log-bill-body {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
}
.log-bill-card {
  padding: 4px 14px 8px;
  border: 1px solid #eceef0;
  border-radius: 12px;
  background: #fff;
}
.log-bill-card h3 {
  margin: 12px 0 2px;
  font-size: 13px;
}
.log-bill-card dl { margin: 0; }
.log-bill-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #f2f3f5;
  font-size: 13px;
}
.log-bill-row:last-child { border-bottom: 0; }
.log-bill-row dt { color: #727a82; }
.log-bill-row dd {
  margin: 0;
  color: #1f2328;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.log-bill-row.is-strong dd { font-weight: 600; }
.log-bill-surcharge {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.log-bill-surcharge.is-quiet {
  border-color: #dbe7fb;
  background: #f3f7ff;
  color: #1e3a8a;
}
.log-bill-note {
  margin: 4px 2px 8px;
  color: #727a82;
  font-size: 12px;
  line-height: 1.6;
}
.log-bill-reqid {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 0;
  color: #727a82;
  font-size: 11.5px;
  line-height: 1.6;
}
.log-bill-reqid code { color: #4b5560; font-size: 11.5px; overflow-wrap: anywhere; user-select: all; }
.log-bill-copy {
  padding: 1px 8px;
  border: 1px solid #dfe3e2;
  border-radius: 6px;
  background: #fff;
  color: #4b5560;
  font: inherit;
  font-size: 11.5px;
  line-height: 1.6;
  cursor: pointer;
}
.log-bill-copy:hover { border-color: var(--green); color: var(--green-d); }

/* ---------- label tags ---------- */

/* One pill for every categorical value, coloured by hashing the name. The hue
   assignment reproduces the legacy console's, so a model or group keeps the
   colour the users already associate with it. */
.ntag {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.ntag + .ntag { margin-left: 3px; }
.ntag-mono { font-family: var(--mono); font-size: 11.5px; }

/* Latency reads as a bare number behind a coloured bar: it is a measurement,
   not a category, so it does not get a pill of its own. */
.ntag-plain {
  padding: 1px 0 1px 7px;
  border-left: 3px solid var(--line-3);
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.lat-fast { border-left-color: var(--green-l); }
.lat-mid { border-left-color: #f0a92a; }
.lat-slow { border-left-color: #e05656; }

/* The bar grades total duration; time to first token is graded on its own
   scale, so it carries the colour as text instead of a second bar. */
.lat-frt { color: var(--ink-3); }
.lat-frt.t-mid { color: #b5730f; }
.lat-frt.t-slow { color: #c0392b; }

.ntag-amber { background: #fff1db; color: #8f5100; }
.ntag-blue { background: #e6f1fe; color: #0b4fbf; }
.ntag-cyan { background: #dff4f7; color: #00707f; }
.ntag-green { background: #e4f7ec; color: #0a7a46; }
.ntag-grey { background: #f0f1f3; color: #575d66; }
.ntag-indigo { background: #e9ebfb; color: #303ba8; }
.ntag-light-blue { background: #e1f3fd; color: #00648f; }
.ntag-lime { background: #eef7da; color: #4f7a00; }
.ntag-orange { background: #ffeee0; color: #9c4a00; }
.ntag-pink { background: #fde9f3; color: #a82269; }
.ntag-purple { background: #f2e9fc; color: #6329b8; }
.ntag-red { background: #fde9e9; color: #b01b1b; }
.ntag-teal { background: #def4f1; color: #007566; }
.ntag-violet { background: #eee8fc; color: #5227c4; }
.ntag-yellow { background: #fff6d9; color: #7e6000; }

/* Exact timestamps in log tables: date above, time below, so full precision
   fits without widening the column. */
.ts { line-height: 1.35; }
.ts-d { display: block; font-size: 11.5px; color: var(--ink-3); }
.ts-t { display: block; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* New API's pager, right under the table card: total, page size, then
   « ‹ pages › » as 32px round buttons with the current page filled. */
.logs-pager {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  margin: 0;
  padding: 12px 0 0;
}

.pager-total {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(96, 96, 96, .8);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.pager-total b { color: var(--lg-fg); font-weight: 500; font-variant-numeric: tabular-nums; }

.pager-size {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(96, 96, 96, .8);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.lf-select {
  width: 70px;
  padding: 0 28px 0 10px;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pager-size .lf-select-icon { right: 8px; }

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

.page-btn {
  display: inline-flex;
  /* A circle for up to three digits; a longer number (page 8972) stretches the
     button into a pill instead of spilling out of a fixed 32px. */
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid var(--lg-line);
  border-radius: 16px;
  background: #fff;
  color: var(--lg-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color .12s ease, color .12s ease;
}
.page-btn.page-arrow { width: 32px; padding: 0; }
a.page-btn:hover { background: var(--lg-hover); color: var(--lg-fg); }
.page-btn.on { border-color: transparent; background: var(--lg-primary); color: #fff; font-weight: 600; }
/* Rendered as a span, not a link, so the row keeps its shape at either end. */
.page-btn.off { color: rgba(96, 96, 96, .5); cursor: default; }
.page-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.page-gap { padding: 0 2px; color: rgba(96, 96, 96, .6); font-size: 14px; }

@media (max-width: 899.98px) {
  .app[data-page="logs"] { padding-bottom: 40px; }
}

@media (max-width: 700px) {
  .dt-pop { width: auto; left: 0; right: 0; }
  .logs-pager { justify-content: flex-start; }
  .pages { gap: 4px; }
  /* « and » go first, as on New API's narrow pager; ‹ › stay. */
  .pages > .page-arrow:first-child,
  .pages > .page-arrow:last-child { display: none; }
}

/* ---------- wallet page ---------- */

/* Stripe settles in USD while the wallet stays CNY-denominated; keep that
   conversion rule visible beside the balance. */
.rate-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 22px;
  padding: 12px 16px;
  border: 1px solid #cfe7dc;
  border-radius: var(--r-sm);
  background: #f2fbf7;
  color: #14614a;
  font-size: 13px;
  line-height: 1.7;
}

.rate-eq {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--green-d);
}

.rate-txt { flex: 1; min-width: 240px; }
.rate-note b { color: var(--green-d); }

.pay-pick { margin-bottom: 22px; }

.pay-pick-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pay-pick-step {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.pay-pick-t { font-size: 14px; font-weight: 600; color: var(--ink); }
.pay-pick-note { font-size: 12px; color: var(--ink-3); }

/* Both methods are equal choices, so they get card-sized weight rather than the
   pair of 13px pills this used to be — nobody noticed a card option was there. */
.pay-choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* WeChat, Alipay and Stripe side by side. The card body wraps, so three fit. */
.pay-choice.pay-choice-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 700px) {
  .pay-choice,
  .pay-choice.pay-choice-3 { grid-template-columns: 1fr; }
}

.pay-choice-card {
  /* Each method carries its own accent so the two cards stay distinguishable
     when one is selected; a shared green made them read as one control. */
  --pm: var(--green);
  --pm-glow: rgba(4, 120, 87, .10);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 46px 14px 16px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-sm);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.pay-choice-card[data-method="alipay"] {
  --pm: #1677ff;
  --pm-glow: rgba(22, 119, 255, .14);
}

.pay-choice-card[data-method="stripe"] {
  --pm: #635bff;
  --pm-glow: rgba(99, 91, 255, .14);
}

.pay-choice-card:hover { border-color: var(--pm); transform: translateY(-1px); }

.pay-choice-card.is-on {
  border-color: var(--pm);
  box-shadow: inset 0 0 0 1px var(--pm), 0 6px 18px var(--pm-glow);
}

/* With one method configured there is nothing to choose, so the card drops the
   radio affordances and reads as a statement of what checkout will do. */
.pay-choice-card.is-solo {
  padding-right: 16px;
  cursor: default;
}

.pay-choice-card.is-solo:hover { border-color: var(--line-3); transform: none; }
.pay-choice-card.is-solo .pay-choice-tick { display: none; }

.pay-choice-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.mark-wechat { background: #e6f7ed; color: #07c160; }
.mark-card { background: #ecebfd; color: #635bff; }
/* The mark is a filled blue square with the 支 cut out, so it carries its own colour. */
.mark-alipay { background: transparent; color: #1677ff; }
[data-pay-for][hidden] { display: none; }

.pay-choice-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pay-choice-t {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.pay-choice-d { font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.pay-choice-d b { color: var(--ink-2); font-weight: 600; }
/* The handling fee on a payment card has to be unmissable: it changes what the
   payer is charged, so it is a badge next to the name and not only a clause in
   the description. */
.pay-fee-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 1px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

/* Same treatment for "this payment cannot be invoiced": it decides whether the
   payer can claim the money back, so it sits on the option, not in the fine
   print. Grey-red, quieter than the fee tag (which changes the price). */
.pay-noinv-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 1px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.tr-noinv {
  flex: none;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 17px;
  color: #b91c1c;
  background: #fef2f2;
  white-space: nowrap;
}

/* Which cards actually work is the first question this option raises, so the
   networks are named on the option itself rather than in the fine print. */
.pay-brands {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}

.pay-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
}

.pay-brand-ico { display: block; flex: none; width: 25px; height: 15px; }

.pay-brand-wm {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink-2);
  white-space: nowrap;
}

/* Visa is distributed as a wordmark, so the styled text is the mark. */
.brand-visa {
  font-size: 14px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #1434cb;
}

/* Alipay's mark is its blue wordmark; the Chinese name is what users look for. */
.brand-alipay {
  font-size: 11.5px;
  font-weight: 700;
  color: #1677ff;
}

.pay-choice-tick {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}

.pay-choice-card.is-on .pay-choice-tick {
  border-color: var(--pm);
  background: var(--pm);
}

.pay-choice-card.is-on .pay-choice-tick::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Three fixed columns so the six tiers read as 3 + 3. Sizing the tracks by
   min-width instead packed five into a wide panel and orphaned the sixth on a
   row of its own. */
.topup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* Three 150px-plus cards don't fit a phone; two rows of three become three
   rows of two. */
@media (max-width: 560px) {
  .topup-grid { grid-template-columns: repeat(2, 1fr); }
}

.topup-grid form { margin: 0; }

.topup-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}

.topup-opt:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.topup-amt {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.topup-sub {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Stripe Checkout rejects anything under $0.50 after conversion, so obviously
   tiny admin test amounts go flat instead of failing after a request. */
.topup-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-3);
}

/* The typed amount: label, ¥ field, button and the live note on one row, the
   note wrapping under them on a phone. */
.topup-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 6px;
}
.topup-custom-t { font-size: 14px; font-weight: 600; }
.topup-custom-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}
.topup-custom-field b { color: var(--ink-3); font-weight: 600; }
.topup-custom-field .input {
  width: 150px;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.topup-custom-field:focus-within { border-color: var(--green); }
.topup-custom-go:disabled { cursor: not-allowed; opacity: .45; }
.topup-custom-sub {
  flex: 1 1 220px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.topup-custom-sub.is-error { color: #b42318; }
.topup-custom-note { margin: 0 0 16px; font-size: 12px; line-height: 1.5; }
.topup-opt:disabled { cursor: not-allowed; opacity: .45; }
.topup-opt:disabled:hover { border-color: var(--line); transform: none; }

/* The 1-fen admin button sits in the same grid as the real amounts; dashed and
   muted so it reads as a tool rather than an offer. */
.topup-test {
  border-style: dashed;
  border-color: var(--line-3);
}

.topup-test .topup-amt { color: var(--ink-2); }

/* Sized to the QR rather than to the column: a checkout stretched across a
   1200px console reads as a broken embed. */
.pay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  margin: 0 auto;
}

/* The checkout is a third-party page, so its height is fixed here rather than
   negotiated — a cross-origin frame can't report its own content size. */
.pay-frame {
  width: 100%;
  max-width: 340px;
  height: 420px;
  border: 0;
}

.pay-tip { margin-top: 12px; text-align: center; }

.pay-done {
  padding: 48px 24px;
  text-align: center;
}

.pay-done-t {
  font-size: 20px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 8px;
}

.pay-done-d {
  font-size: 14px;
  color: var(--ink-3);
}

/* Picking an amount opens this straight away and swaps in the QR when the
   provider answers, so the wait happens over the amount grid instead of on a
   page that has nothing else on it. */
.pay-modal {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 15px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
}

.pay-modal::backdrop { background: rgba(15, 23, 42, .44); backdrop-filter: blur(2px); }

.pay-modal-body { padding: 18px 22px 22px; }

.pay-modal-sub {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  min-height: 20px;
}

/* Fixed to the frame's height so swapping between spinner, QR and receipt
   doesn't resize the dialog under the pointer. */
.pay-modal-stage {
  display: grid;
  place-items: center;
  min-height: 420px;
}

.pay-modal-load {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-3);
}

.pay-spin {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line-2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: pay-spin .7s linear infinite;
}

@keyframes pay-spin { to { transform: rotate(360deg); } }

.pay-modal-err {
  margin: 0;
  max-width: 280px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: #a33a3a;
}

/* Class selectors outrank the UA stylesheet's [hidden], so restate it for the
   stage's three swappable states. */
.pay-modal [hidden] { display: none; }

.pay-modal-tip { margin: 14px 0 0; text-align: center; }

@media (max-width: 480px) {
  .pay-modal-stage { min-height: 380px; }
}

/* ---------- settings page ---------- */

.field-hint {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}

.deflist { display: grid; gap: 1px; background: var(--line); }

.deflist > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  background: #fff;
  padding: 10px 0;
}

.deflist dt { font-size: 13px; color: var(--ink-2); }

.deflist dd {
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.deflist + .field-hint { margin-top: 16px; }
/* Live invite-code hint on the sign-up form. */
.field-hint.aff-ok { color: var(--green); }
.field-hint.aff-warn { color: #b45309; }

/* ---------- auth page ---------- */

body.plain { background: var(--tint); }

.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 20px;
}

.auth-brand { justify-content: center; }
.auth > .lang-switch { justify-content: center; margin-top: -24px; }

.auth-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 32px;
  box-shadow: var(--sh-hero);
}

.auth-h { font-size: 22px; letter-spacing: -.02em; }

.auth-sub {
  margin-top: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.form { display: grid; gap: 16px; }

.oauth-entry { display: grid; gap: 10px; margin-bottom: 18px; }
.oauth-entry .auth-divider { margin-top: 6px; }

/* The OAuth actions (Google, GitHub) are form controls, not one of the site's pill CTAs. Keep
   its geometry and interaction local so shared buttons remain untouched. */
.btn-google,
.btn-github {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid #d6ddda;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 0 48px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.005em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 76, 92, .05);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.btn-google:hover,
.btn-github:hover {
  border-color: #b6c5bf;
  background: #fbfcfc;
  box-shadow: 0 3px 10px rgba(15, 76, 92, .08);
}

.btn-google:active,
.btn-github:active {
  background: var(--tint);
  box-shadow: 0 1px 2px rgba(15, 76, 92, .04);
}

.btn-google:focus-visible,
.btn-github:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .1);
}

.google-mark {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
}

.google-mark svg { display: block; width: 100%; height: 100%; }
.google-label { overflow: hidden; text-overflow: ellipsis; }

/* The masked address on the link-account page: shown, not editable. */
.bind-email {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--tint);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
}

.auth-divider span { padding: 0 2px; white-space: nowrap; }

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2));
}

.auth-divider::after { transform: scaleX(-1); }

/* Submit buttons size to their label; the auth page opts back into full
   width with .btn-block. */
.form > .btn { justify-self: start; }
.form > .btn-block { justify-self: stretch; }

.field { display: grid; gap: 7px; }

.field-code { display: flex; gap: 8px; }
.field-code .input { flex: 1; min-width: 0; }
.field-code .btn { flex-shrink: 0; white-space: nowrap; }

/* 阿里云验证码是弹窗模式，占位元素本身不占高；无痕验证时完全不可见 */
.captcha-slot { margin: 0; }

.field-edit { font-size: 12px; font-weight: 400; margin-left: 6px; }
.input[readonly] { background: var(--tint); color: var(--ink-2); }

.field-label { font-size: 13px; color: var(--ink-2); }

.input {
  width: 100%;
  border: 1px solid var(--line-3);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .1);
}

.btn-block { width: 100%; padding: 12px; margin-top: 4px; }

/* Keep the two sign-in actions in one visual system without changing shared
   auth buttons on registration, password reset, or account pages. */
.auth-sign-in .form > .btn-block {
  min-height: 48px;
  border: 1px solid var(--green);
}

/* ---------- attributed signup landing ---------- */

/* The campaign strip is shared with the home page, where it spans the content
   width. On the auth page it has to track the card instead: 400px normally,
   and the wider two-column grid on an attributed visit. */
.signup-deal {
  width: 100%;
  max-width: 400px;
  margin: 0;
}

.auth-source .signup-deal { max-width: 980px; }

@media (max-width: 800px) {
  .auth-source .signup-deal { max-width: 520px; }
}

/* The ordinary /sign-up card stays exactly as-is. These rules only activate
   when utm_source/source turns the page into an acquisition landing surface. */
.auth-source {
  justify-content: flex-start;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 32px;
}

.auth-source > .lang-switch { margin-top: -16px; }

.signup-hvoy-title,
.signup-lead-gift,
.signup-lead-grid {
  width: min(100%, 980px);
}

.signup-hvoy-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.signup-lead-gift {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(4, 120, 87, .2);
  border-radius: var(--r-lg);
  background: linear-gradient(115deg, var(--green), #066b52);
  color: #fff;
  padding: 16px 22px;
  box-shadow: 0 10px 30px rgba(4, 120, 87, .16);
}

.signup-gift-amount {
  flex: 0 0 auto;
  min-width: 84px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.signup-gift-copy { display: grid; gap: 3px; }
.signup-gift-copy strong { font-size: 17px; letter-spacing: -.01em; }
.signup-gift-copy small { color: rgba(255, 255, 255, .82); font-size: 12px; line-height: 1.5; }

.signup-lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  grid-template-areas: "story form";
  gap: 18px;
  align-items: start;
}

@media (max-width: 800px) {
  .auth-source { padding-top: 24px; }

  .signup-hvoy-title,
  .signup-lead-gift,
  .signup-lead-grid { max-width: 520px; }

  .signup-lead-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "story"
      "form";
  }

  .signup-lead-form { position: static; }
}

@media (max-width: 520px) {
  .auth-source { padding-inline: 14px; }

  .signup-lead-gift {
    gap: 12px;
    padding: 14px 16px;
  }

  .signup-gift-amount { min-width: 67px; font-size: 29px; }
  .signup-gift-copy strong { font-size: 15px; }

}

.auth-sign-in .form > .btn-block {
  border-radius: 12px;
  padding: 0 16px;
  margin-top: 2px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.auth-sign-in .form > .btn-block:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .14);
}

.auth-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

/* The footer's action links (注册 / 找回密码) are the page's secondary
   conversions — plain muted links read as decoration, so give them weight,
   brand color, and an underline. */
.auth-act { display: block; }
.auth-act + .auth-act { margin-top: 10px; }
.auth-link {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--green-l);
  text-underline-offset: 3px;
}
.auth-link:hover { color: var(--green-d); text-decoration-color: var(--green-d); }

.auth-alt { font-size: 13px; color: var(--ink-3); }
.auth-alt a { color: var(--ink-2); }
.auth-alt a:hover { color: var(--ink); }
.auth-alt .sep { margin: 0 8px; }

/* ---------- error page ---------- */

.err { padding: 100px 0 120px; text-align: center; }

.err-code {
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: .08em;
}

.err-h {
  margin-top: 12px;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -.02em;
}

.err-p {
  margin: 14px auto 28px;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
}

.err .cta-btns { justify-content: center; }

/* ---------- responsive ---------- */

@media (max-width: 899.98px) {
  :root { --pad: 14px; }

  .sec { padding: 60px 0; }
  .sec-head { margin-bottom: 32px; }
  /* Tighter than the desktop 48px: with the ad leading the hero, the default
     gap pushed the headline itself off a phone's first screen. */
  .hero { padding: 32px 0 60px; gap: 26px; }
  .hero-card { padding: 20px; }
  /* The signup credit is the primary phone CTA. Keep it before the campaign
     even if future template edits or translations make the row wrap. */
  .hero-gift { order: 0; }

  /* Full width rather than a pill: the announcement is longer than a 390px
     line, and a wrapped 999px capsule reads as a layout accident. As its own
     row it also cannot squeeze the gift off the first screen. */
  .hero-ad-compact {
    order: 1;
    width: 100%;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
  }

  .hero-ad-compact .hero-gift-arw { margin-left: auto; padding-left: 8px; }
  .cta { padding: 28px 24px; }
  .only-lg { display: none; }
  .tbl th, .tbl td { padding: 12px 16px; }
  .tbl-head { padding: 16px; }
  .faq summary { padding: 16px 18px; }
  .faq p { padding: 0 18px 16px; }
  .steps li { padding: 18px; }

  /* The sidebar becomes a scrollable chip strip — a stacked seven-row nav
     would push the actual page content below the fold. */
  .side {
    margin: 0 calc(var(--pad) * -1);
    padding: 0 var(--pad);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* A chip cut flat by the viewport edge reads as a broken layout; fading it
       is what tells a touch user the strip keeps going. */
    -webkit-mask-image: var(--strip-fade);
    mask-image: var(--strip-fade);
  }

  .side::-webkit-scrollbar { display: none; }

  .side nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 7px;
  }

  .side-item {
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .side-item.on { border-color: transparent; }
  .side-item-featured { margin: 0; box-shadow: 0 4px 12px rgba(16, 122, 83, .13); }
  .side-item-featured:hover { transform: none; }
  .side-item-featured .side-badge { min-height: 16px; padding: 1px 5px; }
  .side-ico { display: none; }
  .side-qq { display: none; }

  .page-head { margin-bottom: 22px; }
  /* Phones get the reminder as one unbroken line: the copy button is a
     convenience for a number that is right there, so it is the first thing to
     go rather than letting the pill wrap to two rows. */
  .head-invoice { padding-right: 10px; }
  .head-invoice-copy { display: none; }
  .stat { padding: 16px 18px; }
  .stat-value { font-size: 26px; }
  .app { padding-top: 22px; gap: 24px; }

  /* The public nav has no hamburger menu; hiding it below the desktop
     breakpoint left phone users with no way to reach pricing/docs/contact.
     Wrap the header and lay the links out as a scrollable chip strip, the
     same pattern the console sidebar already uses on narrow screens. */
  .hdr-in { flex-wrap: wrap; row-gap: 10px; }

  .hdr .nav {
    display: flex;
    order: 3;
    width: calc(100% + (var(--pad) * 2));
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin: 0 calc(var(--pad) * -1);
    padding: 0 var(--pad) 2px;
    -webkit-mask-image: var(--strip-fade);
    mask-image: var(--strip-fade);
  }

  .hdr .nav::-webkit-scrollbar { display: none; }

  .hdr .nav a {
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* 13x20 of glyph is not a touch target: pad the hit area out to the row
     height and pull the box back so the header keeps its measured height. */
  .lang-switch a {
    padding: 10px 3px;
    margin: -10px 0;
  }

  .code-name { font-size: 12px; }
  .copy { padding: 8px 14px; font-size: 12px; }

  /* `code { font-size: .92em }` compounds inside the block and lands the
     shell samples near 10px on a phone. */
  .code pre { font-size: 12.5px; }
  .code pre code { font-size: 1em; }
}

@media (max-width: 520px) {
  /* On a phone the rename note goes away — the domain under the logo already
     tells a returning user which site they're on, and the header needs the
     room. The secondary login action is available on the signup page, so the
     header can privilege the primary CTA without overflowing a 390px phone. */
  .hdr .brand { gap: 7px; }
  .hdr .brand-mark { width: 118px; height: 28px; }
  .hdr .brand-note { display: none; }
  /* Not zero: at gap 0 the language switch sits flush against the primary
     pill and the two read as one broken control. */
  .hdr-cta { gap: 9px; }
  .hdr-cta .btn { padding: 8px 14px; }
  /* Direct children only. The console's sign-out button is a ghost button
     nested in a form, and hiding it left phone users with no way out. */
  .hdr-cta > .btn-ghost { display: none; }
  /* The console no longer lists the setup guide in its rail, so on a phone
     this top-bar button is the only way to it; keep it, just smaller. */
  .hdr-cta > .btn-ghost.hdr-docs { display: inline-flex; padding: 8px 10px; font-size: 13px; }
  /* The balance stays visible even when direct ghost links are hidden. */
  .hdr-cta .hdr-bal { display: inline-flex; padding: 7px 9px; }
  /* space-between does nothing once the strip overflows, and spreads the chips
     unevenly when it doesn't — keep one rhythm at every width. */
  .hdr .nav { gap: 7px; }
  .hdr .nav a { padding: 8px 10px; font-size: 12.5px; }
}

/* Below this the logo plus the CTA row no longer fit on one line, and the
   header spills onto a third row. The language separator is decorative, so
   it is the first thing to give up. */
@media (max-width: 360px) {
  /* The avatar is not a control; dropping it keeps 余额 / 语言 / 文档 / 退出 on one
     row under the logo instead of a third row for 退出 alone. */
  .hdr-cta > .acct { display: none; }
  .lang-switch { gap: 8px; }
  .lang-switch span[aria-hidden] { display: none; }
  .hdr-cta { gap: 8px; }
  .hdr-cta .btn { padding: 8px 12px; }
}

/* ---------- docs & pricing pages ---------- */

.page-hero {
  padding: 56px 0 8px;
  max-width: 760px;
}

.page-hero h1 {
  margin: 6px 0 14px;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.02em;
}

.page-hero .lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
}

.note-box {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--tint);
  padding: 22px 24px;
}

.note-box h3 { font-size: 15px; margin-bottom: 6px; }

.note-box p, .callout p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}

.note-box a, .callout a, .doc-body p a, .sec-note a {
  color: var(--green-d);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tbl-price .cache-hit { color: var(--green-d); }

/* The header is sticky, so anchored sections need to clear it. */
.sec[id] { scroll-margin-top: 90px; }

/* Docs and pricing inside the console shell: the page already has a sidebar,
   so drop the second one and shrink the marketing-sized hero. */
.app-doc .page-hero { padding: 4px 0 0; }
.app-doc .page-hero h1 { font-size: 28px; margin: 4px 0 10px; }
.app-doc .page-hero .lead { font-size: 14.5px; }
.app-doc .doc { padding-top: 24px; }

/* docs page: sticky table of contents beside the article */

.doc { display: grid; gap: 32px; padding: 32px 0 72px; }

.doc-toc { display: none; }

.doc-toc-title {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.doc-toc a {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--line-2);
  font-size: 13.5px;
  color: var(--ink-2);
  transition: color .12s ease, border-color .12s ease;
}

.doc-toc a:hover { color: var(--green-d); border-left-color: var(--green-l); }

.doc-toc-out {
  margin-top: 8px;
  border-left-color: transparent !important;
  color: var(--green-d) !important;
}

/* Editorial copy keeps a readable measure even though the site shell itself
   is full width. The table of contents remains anchored to the left. */
.doc-body { width: 100%; max-width: 900px; min-width: 0; display: grid; gap: 52px; }

/* Grid items default to min-width:auto, so a long URL or path in a <code>
   would widen the whole column instead of wrapping inside it. */
.doc-body section, .doc-body section > * { min-width: 0; }

.doc-body section { display: grid; gap: 14px; scroll-margin-top: 90px; }

/* Sits after the two 90px rules on purpose — same later-wins tiebreak as the
   640px docs block below. On a phone the header wraps to two rows (~122px), so
   the desktop offset would drop an anchored heading behind it. */
@media (max-width: 899.98px) {
  .sec[id], .doc-body section{ scroll-margin-top: 130px; }
}

.doc-body h2 {
  font-size: 24px;
  letter-spacing: -.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.doc-body h3 { font-size: 16px; margin-top: 6px; }
/* Screenshots in the docs: fit the column, keep the aspect ratio from the
   width/height attributes so the page does not jump while they load. */
.doc-shot { margin: 12px 0 0; }
.doc-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
}

/* A few install screenshots are small (about 500px wide). Stretching them to
   the column would blur them, so they stop at their own width. */
.doc-shot-native img { width: auto; max-width: 100%; }
.doc-body > section > p, .qa-body p {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink-2);
}

.doc-body code, .note-box code, .callout code, .deflist-doc code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--tint-2);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--green-d);
  /* model IDs and URLs have no break opportunities of their own */
  overflow-wrap: anywhere;
}

.doc-body .code code { background: none; padding: 0; color: inherit; }

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--r-sm);
  background: var(--tint);
  padding: 18px 22px;
  display: grid;
  gap: 6px;
}

.callout h3 { font-size: 15px; margin: 0; }
.callout-warn { border-left-color: #d97706; background: #fffbeb; }

.deflist-doc {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

/* The console's deflist is a right-aligned label/value row; in prose the
   value is a sentence, so it starts right after the term and wraps normally. */
.deflist-doc > div { justify-content: flex-start; padding: 12px 18px; }
.deflist-doc dt { flex: none; min-width: 104px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
/* Rows whose labels are field names from another program ("Gateway auth scheme") need a wider label column so the values still line up. */
.deflist-wide dt { min-width: 168px; }

.deflist-doc dd {
  margin: 0;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.8;
  text-align: left;
  color: var(--ink-2);
}
.deflist-doc a { color: var(--green-d); text-decoration: underline; text-underline-offset: 2px; }

/* .steps is a flex row built around the .step-n badge; the docs variant
   numbers itself with a counter so the copy can stay plain markup. */
.steps-doc { counter-reset: dstep; gap: 14px; }

.steps-doc li {
  display: block;
  position: relative;
  padding: 20px 24px 22px 62px;
  counter-increment: dstep;
}

.steps-doc li::before {
  content: counter(dstep);
  position: absolute;
  left: 22px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--tint-2);
  color: var(--green-d);
  font-size: 13px;
  font-weight: 600;
}

.steps-doc li > * + * { margin-top: 10px; }
.steps-doc p { margin-top: 8px; }
.steps-doc .muted { color: var(--ink-3); font-size: 13.5px; }

.qa-body { padding: 0 24px 20px; display: grid; gap: 12px; }
.qa-body p { padding: 0; }
.qa-body .code { margin: 0; }

/* Sits after the docs rules on purpose: an override in the shared
   max-width:900px block higher up would lose the later-wins tiebreak. */
@media (max-width: 640px) {
  .qa-body { padding: 0 18px 16px; }
  .steps-doc li { padding: 18px 18px 20px 52px; }
  .steps-doc li::before { left: 16px; top: 18px; }

  /* term over definition — 104px of label leaves too little for the value */
  .deflist-doc > div { display: block; padding: 12px 16px; }
  .deflist-doc dt { min-width: 0; margin-bottom: 2px; }
}

@media (min-width: 900px) {
  .nav { display: flex; }

  .doc { grid-template-columns: 200px minmax(0, 1fr); gap: 56px; align-items: start; }

  .doc-toc {
    display: block;
    position: sticky;
    top: 92px;
  }

  /* One sidebar per screen — the console nav already fills that role — so the
     contents list lies down above the article instead of stacking beside it. */
  .app-doc .doc { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .app-doc .doc-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
  }

  .app-doc .doc-toc-title { margin: 0 6px 0 0; }

  .app-doc .doc-toc a {
    padding: 5px 12px;
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
  }

  .app-doc .doc-toc a:hover { border-color: var(--green-l); }
  .app-doc .doc-toc-out { margin-top: 0; border-color: #bfe3d1 !important; }

  /* full-width prose runs ~120 characters a line inside the console */
  .app-doc .doc-body { max-width: 900px; }

  /* six feature cards read better as 3+3 than as the 4+2 auto-fit produces */
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .app { grid-template-columns: 208px minmax(0, 1fr); gap: 44px; }
  .side { position: sticky; top: 84px; }
  .cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

  .sec-head {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    align-items: end;
    gap: 48px;
  }

  .sec-note { justify-self: end; }

  .cta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 40px;
  }

  .cta-act { align-items: flex-end; }
}

/* The rail is taller now that it carries the group QR (about 730px, stuck 84px
   below the top). In a window shorter than that a sticky rail would cut the QR
   off with no way to scroll it into view, so there it scrolls with the page. */
@media (min-width: 900px) and (max-height: 819px) {
  .side { position: static; }
}
@media (min-width: 1024px) {
  .hero-split {
    grid-template-columns: 1.1fr .9fr;
    gap: 64px;
    align-items: start;
  }

  .hero-ad-compact { display: none; }

  .hero-ad {
    display: block;
    min-width: 0;
    margin-top: 8px;
  }
}

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

/* ---------- console overview dashboard ---------- */

.app[data-page="console-home"] { padding-bottom: 24px; }
.console-home { min-width: 0; }

.dash-topline {
  display: grid;
  /* The greeting column can shrink (ellipsis) so a long name never pushes the
     range tabs past the right edge; the refresh button stays at the far right. */
  grid-template-columns: minmax(0, max-content) max-content minmax(36px, 1fr);
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
}

.dash-greeting {
  min-width: 0;
  overflow: hidden;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-ranges {
  display: inline-flex;
  justify-self: start;
  padding: 4px;
  border-radius: 8px;
  background: #f3f4f6;
}

.dash-range {
  min-width: 72px;
  border-radius: 5px;
  padding: 7px 14px;
  color: var(--ink-2);
  font-size: 13px;
  text-align: center;
}

.dash-range:hover { color: var(--ink); }
.dash-range.on { background: #fff; color: #2563eb; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }

.dash-refresh {
  justify-self: end;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #f1f3f4;
  color: #4b5563;
  font-size: 22px;
  line-height: 1;
}

.dash-refresh:hover { background: #e8ebed; color: var(--ink); }

/* While a range or chart tab loads in place (site.js), the parts about to be
   replaced fade a little so the click reads as taken. */
.console-home.is-switching .dash-cards,
.console-home.is-switching .dash-analysis { opacity: .55; transition: opacity .15s ease; }

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

.dash-card,
.dash-analysis,
.dash-api {
  border: 1px solid #e5e7eb;
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
}

.dash-card > header,
.dash-panel-head {
  display: flex;
  align-items: center;
  min-height: 47px;
  border-bottom: 1px solid #eceef0;
  padding: 0 15px;
}

.dash-card > header {
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
}

.dash-head-ico { width: 18px; color: #24292f; font-size: 16px; text-align: center; }
.dash-card-body { padding: 3px 14px 9px; }

.dash-stat-row {
  position: relative;
  display: flex;
  min-height: 67px;
  align-items: center;
  gap: 13px;
}

.dash-stat-row + .dash-stat-row { border-top: 1px solid #f0f1f2; }

.dash-round {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.dash-blue { background: #63b3ff; }
.dash-purple { background: #c56ed4; }
.dash-green { background: #71d280; }
.dash-cyan { background: #4bc3cf; }
.dash-yellow { background: #ffdd57; }
.dash-pink { background: #ef719b; }
.dash-indigo { background: #7d8bd7; }
.dash-orange { background: #ffbd5c; }

.dash-stat-copy { min-width: 0; }
.dash-stat-copy small { display: block; color: #72777d; font-size: 12px; }
.dash-stat-copy strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #4b4f54;
  font-size: 20px;
  line-height: 1.15;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.dash-mini-btn {
  margin-left: auto;
  border: 1px solid #d9dcdf;
  border-radius: 999px;
  padding: 4px 10px;
  color: #4b4f54;
  font-size: 12px;
}

.dash-mini-btn:hover { background: #f6f7f8; }

.dash-spark {
  width: 72px;
  height: 36px;
  margin-left: auto;
  overflow: visible;
  fill: none;
  stroke-width: 2;
}

.dash-spark-cyan { stroke: #08a5b5; }
.dash-spark-yellow { stroke: #f59e0b; }
.dash-spark-pink { stroke: #ec4899; }
.dash-spark-indigo { stroke: #6366f1; }
.dash-spark-orange { stroke: #f97316; }

.dash-lower {
  display: grid;
  grid-template-columns: minmax(0, 3.05fr) minmax(280px, .95fr);
  gap: 16px;
  margin-top: 16px;
}

.dash-panel-head { justify-content: space-between; gap: 18px; }
.dash-panel-head h2 { font-size: 15px; font-weight: 500; white-space: nowrap; }
.dash-panel-head h2 span { display: inline-block; width: 19px; text-align: center; }

.dash-view-tabs { display: flex; align-items: center; gap: 0; }
.dash-view-tabs a { color: #8b9095; font-size: 13px; white-space: nowrap; }
.dash-view-tabs a:hover,
.dash-view-tabs a.on { color: #1f2328; font-weight: 600; }
.dash-view-tabs a + a::before { content: "/"; margin: 0 14px; color: #aeb2b6; font-weight: 400; }

.dash-analysis-body { min-height: 390px; padding: 48px 40px 22px; }
.dash-analysis-body h3 { font-size: 16px; }
.dash-analysis-body > p { margin-top: 5px; color: #7a7f84; font-size: 13px; }

.dash-chart-wrap { position: relative; height: 250px; margin-top: 16px; padding: 0 0 26px 32px; }
.dash-grid-lines {
  position: absolute;
  inset: 0 0 26px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.dash-grid-lines i { display: block; border-top: 1px solid #e8eaec; }

.dash-chart-bars {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  align-items: flex-end;
  gap: 3px;
  border-bottom: 1px solid #60656a;
}

.dash-chart-col {
  display: flex;
  height: 100%;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}

.dash-chart-stack {
  display: flex;
  height: calc(100% - 24px);
  flex-direction: column-reverse;
  justify-content: flex-start;
}
.dash-chart-stack > span { display: block; min-height: 0; }
/* The hover card (focus too, so a keyboard or a tap opens it). It sits at the
   top of the chart beside the bar, not over it, opening to the right of bars
   on the left half and to the left of the rest so it stays inside the panel. */
.dash-chart-col { position: relative; outline: none; }
.dash-chart-col:hover .dash-chart-stack,
.dash-chart-col:focus-visible .dash-chart-stack { filter: brightness(.92); }
.dash-chart-col:hover::before,
.dash-chart-col:focus-visible::before {
  content: "";
  position: absolute;
  inset: 0 -1.5px 24px;
  z-index: -1;
  border-radius: 3px;
  background: rgba(15, 23, 42, .045);
}
.dash-tip {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  z-index: 5;
  display: none;
  width: max-content;
  min-width: 170px;
  max-width: 280px;
  padding: 9px 11px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
  color: #3f3f46;
  font-size: 12px;
  line-height: 18px;
  pointer-events: none;
}
.dash-chart-col.tip-left .dash-tip { right: calc(100% + 8px); left: auto; }
.dash-chart-col:hover .dash-tip,
.dash-chart-col:focus .dash-tip { display: block; }
.dash-tip-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 4px; padding-bottom: 5px; border-bottom: 1px solid #f0f0f2; color: #71717a; white-space: nowrap; }
.dash-tip-head strong { color: #18181b; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-tip small { margin-left: 2px; color: #a1a1aa; font-size: 11px; font-weight: 400; }
.dash-tip-row { display: flex; align-items: center; gap: 0; white-space: nowrap; }
.dash-tip-row .dash-legend-dot { flex: none; width: 8px; height: 8px; margin-right: 7px; border-radius: 2px; vertical-align: 0; }
.dash-tip-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dash-tip-row b { flex: none; margin-left: auto; padding-left: 14px; color: #18181b; font-weight: 500; font-variant-numeric: tabular-nums; }
.c0 { background: #c4c4cc; }
.dash-chart-col > small {
  height: 22px;
  margin-top: 4px;
  color: #656b70;
  font-size: 8px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.dash-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; color: #62686d; font-size: 11px; }
.dash-legend > span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-legend-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

.c1 { background: #f4b400; }
.c2 { background: #a67fe0; }
.c3 { background: #0f9d84; }
.c4 { background: #a9e5c0; }
.c5 { background: #df72ca; }
.c6 { background: #2467eb; }
.c7 { background: #36b4c5; }
.c8 { background: #7040d8; }

.dash-chart-empty { display: grid; min-height: 235px; place-items: center; color: var(--ink-3); font-size: 13px; }

.dash-rank-list { display: grid; gap: 17px; margin-top: 25px; }
.dash-rank-row > div:first-child { display: flex; align-items: center; gap: 6px; }
.dash-rank-row code { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.dash-rank-row strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.dash-rank-track { height: 8px; margin-top: 7px; border-radius: 99px; background: #f0f1f2; overflow: hidden; }
.dash-rank-track span { display: block; height: 100%; border-radius: inherit; }

.dash-api-body { padding: 0 13px; }
.dash-endpoint { position: relative; padding: 18px 46px 17px 47px; }
.dash-endpoint + .dash-endpoint { border-top: 1px solid #e8eaec; }
.dash-endpoint > div { display: flex; align-items: center; gap: 8px; }
.dash-endpoint-badge {
  position: absolute;
  left: 2px;
  top: 19px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #5ab6ff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.dash-endpoint strong { font-size: 14px; }
.dash-endpoint code {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: #165dff;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-endpoint p { margin-top: 5px; color: var(--ink-2); font-size: 12px; }
.dash-endpoint > .key-btn { position: absolute; right: 0; top: 18px; padding: 3px 9px; }

.dash-notices .dash-panel-head small { color: #8b9095; font-size: 11px; font-weight: 400; }
.dash-notice-list {
  max-height: 390px;
  overflow-y: auto;
  padding: 0 15px;
}
.dash-notice-item {
  display: block;
  width: 100%;
  border: 0;
  padding: 17px 2px 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dash-notice-item + .dash-notice-item { border-top: 1px solid #eceef0; }
.dash-notice-item:hover h3,
.dash-notice-item:hover .dash-notice-more { color: #2563eb; }
.dash-notice-item:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.dash-notice-item[data-notice-unread="1"] h3 { font-weight: 700; }
.dash-notice-item[data-notice-unread="1"] h3::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #2563eb;
  content: "";
  vertical-align: 1px;
}
.dash-notice-more { display: inline-block; margin-top: 9px; color: var(--ink-3); font-size: 11px; }
.dash-notice-more::after { content: " ›"; }
.dash-notice-item time { color: var(--ink-3); font-size: 10px; }
.dash-notice-item h3 {
  overflow: hidden;
  margin-top: 5px;
  color: #31353a;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-notice-item p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: #6b7075;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.dash-notice-empty { display: grid; min-height: 250px; place-items: center; align-content: center; gap: 8px; color: #a2a7ac; }
.dash-notice-empty span { font-size: 26px; }
.dash-notice-empty p { font-size: 12px; }

.announcement-modal {
  width: min(540px, calc(100vw - 32px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .25);
}
.announcement-modal::backdrop { background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
.announcement-modal-head {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eceef0;
  padding: 20px 22px;
}
.announcement-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #e8f2ff;
  color: #2563eb;
  font-size: 18px;
  font-weight: 700;
}
.announcement-modal-head p { color: #2563eb; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.announcement-modal-head h2 { overflow: hidden; margin-top: 3px; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.announcement-modal-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7a7f84;
  font-size: 22px;
  cursor: pointer;
}
.announcement-modal-head button:hover { background: #f3f4f6; color: #1f2328; }
.announcement-modal-body {
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding: 24px 26px;
  color: #4b5055;
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
}
.announcement-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #eceef0;
  padding: 14px 22px;
  background: #fafbfc;
}
.announcement-modal-meta { display: grid; min-width: 0; gap: 3px; }
.announcement-modal-foot time { color: var(--ink-3); font-size: 11px; }
.announcement-modal-meta [data-announcement-reminder] { color: #7a7f84; font-size: 11px; }
.announcement-modal-meta [data-announcement-error] { color: #c2413a; font-size: 12px; font-weight: 600; }
.announcement-modal-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.announcement-modal-actions .btn { min-width: 82px; }
.announcement-modal-actions .btn:disabled { cursor: wait; opacity: .58; }

/* Usage calendar (console overview): 26 weeks of squares, four figures beside
   them, and one hover card filled by site.js from the square's data-*. A square
   plus its gap is 16px; usage_calendar.go places the month labels on that. */
.ach { position: relative; margin-top: 16px; border: 1px solid #e5e7eb; border-radius: 15px; background: #fff; }
.ach > header { display: flex; align-items: center; gap: 10px; min-height: 47px; border-bottom: 1px solid #eceef0; padding: 0 15px; }
.ach > header h2 { font-size: 15px; font-weight: 500; white-space: nowrap; }
.ach > header h2 span { display: inline-block; width: 19px; text-align: center; }
.ach-sub { color: #8b9095; font-size: 12.5px; }
.ach-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; padding: 18px 20px 20px; }
.ach-heat { min-width: 0; }
.ach-heat-months { position: relative; height: 16px; margin-left: 28px; color: #8b9095; font-size: 11px; }
.ach-heat-months b { position: absolute; top: 0; font-weight: 400; white-space: nowrap; }
.ach-heat-body { display: flex; gap: 6px; }
.ach-heat-days { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; width: 22px; color: #9aa0a6; font-size: 10px; line-height: 13px; }
.ach-heat-days i { font-style: normal; white-space: nowrap; }
.ach-heat-grid { display: flex; gap: 3px; }
.ach-col { display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; }
.ach-cell { display: block; width: 13px; height: 13px; border-radius: 3px; background: #eef0f2; }
.ach-cell.l1 { background: #d1f0df; }
.ach-cell.l2 { background: #9fe0bd; }
.ach-cell.l3 { background: #4fc28a; }
.ach-cell.l4 { background: #16a06a; }
.ach-cell.l5 { background: #066e4a; }
.ach-cell.is-future { background: transparent; }
.ach-cell.is-today { outline: 2px solid #f59e0b; outline-offset: 1px; }
.ach-cell[data-d]:hover,
.ach-cell.is-on { outline: 2px solid #1f2328; outline-offset: 1px; }
.ach-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ach-stat { min-width: 0; border: 1px solid #eef0f2; border-radius: 12px; padding: 12px 14px; background: #fbfcfb; }
.ach-stat small { display: block; color: #72777d; font-size: 12px; }
.ach-stat strong { display: block; margin-top: 4px; color: #1f2328; font-size: 22px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ach-stat strong em { margin-left: 3px; color: #72777d; font-size: 13px; font-style: normal; font-weight: 500; }
.ach-stat p { margin: 4px 0 0; color: #8b9095; font-size: 12px; }
.ach-stat p .up { color: #047857; }
.ach-stat p .down { color: #b91c1c; }
.ach-stat.hot { border-color: #fde7c7; background: #fffaf2; }
.ach-stat.hot strong { color: #c2410c; }
.ach-tip { position: fixed; z-index: 60; min-width: 190px; max-width: 280px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .14); color: #4b5563; font-size: 12.5px; pointer-events: none; }
.ach-tip[hidden] { display: none; }
.ach-tip h5 { margin: 0 0 6px; color: #1f2328; font-size: 13px; font-weight: 600; }
.ach-tip div { display: flex; justify-content: space-between; gap: 16px; line-height: 1.75; }
.ach-tip b { overflow: hidden; color: #1f2328; font-weight: 600; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.ach-tip .ach-tip-none { color: #9aa0a6; }

@media (max-width: 1180px) {
  .ach-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ach-heat { overflow-x: auto; }
  .ach-heat-months, .ach-heat-body { width: max-content; }
  /* The grid scrolls sideways under the weekday labels. */
  .ach-heat-days { position: sticky; left: 0; z-index: 1; background: #fff; }
}

@media (max-width: 560px) {
  .ach > header { flex-wrap: wrap; row-gap: 2px; padding: 10px 14px; }
  .ach-sub { width: 100%; }
  .ach-body { padding: 14px; }
  .ach-stats { gap: 10px; }
  .ach-stat { padding: 10px 12px; }
  .ach-stat strong { font-size: 19px; }
}

@media (max-width: 1250px) {
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-lower { grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); }
}

@media (max-width: 899.98px) {
  .dash-topline { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .dash-greeting { font-size: 22px; }
  .dash-ranges { grid-column: 1 / -1; grid-row: 2; max-width: 100%; overflow-x: auto; }
  .dash-range { min-width: 68px; }
  .dash-lower { grid-template-columns: minmax(0, 1fr); }
  .dash-analysis-body { min-height: 320px; padding: 28px 18px 20px; }
  .dash-panel-head { align-items: flex-start; flex-direction: column; padding-top: 13px; padding-bottom: 10px; }
  .dash-view-tabs { width: 100%; overflow-x: auto; }
}

@media (max-width: 560px) {
  .app[data-page="console-home"] { padding-bottom: 40px; }
  .dash-greeting { font-size: 20px; }
  .dash-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dash-card-body { padding-left: 13px; padding-right: 13px; }
  .dash-analysis-body { padding-left: 12px; padding-right: 12px; }
  .dash-chart-wrap { height: 220px; padding-left: 0; overflow-x: auto; }
  .dash-chart-bars { min-width: 720px; }
  .dash-grid-lines { left: 0; min-width: 720px; }
  .dash-legend { font-size: 10px; }
  .announcement-modal-head { padding: 17px 18px; }
  .announcement-modal-body { padding: 20px; }
  .announcement-modal-foot { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 18px; }
  .announcement-modal-actions { width: 100%; }
  .announcement-modal-actions .btn { flex: 1 1 0; min-width: 0; }
}

/* 推荐有礼 —— 邀请链接行在窄屏换行，复制按钮不被挤成一条竖线 */
/* 未开启态既不是成功也不是错误，.alert 基类本身没有边框和底色，
   不给它一个中性容器就会浮成一行无主的文字 */
.referral-terms-off {
  border: 1px solid var(--line);
  background: var(--bg-soft, #fafafa);
  color: var(--ink-2, #555);
}
.referral-terms { margin-bottom: 18px; }
.referral-link-card { margin-bottom: 18px; }
.referral-link-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}
.referral-link-input {
  flex: 1 1 320px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.referral-link-row .btn { flex: 0 0 auto; }
/* 「已达上限」是解释，不是警告，所以用弱化的琥珀色而不是报错红 */
.referral-capped {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- enterprise signup experience ---------- */

/* Both the plain and attributed signup routes use the same trust-first shell.
   The attributed route adds pricing without becoming a visually separate app.

   The page is built to be read without scrolling on a laptop (about 1440x800):
   one thin header row, a one-line campaign strip, a story panel whose pieces are
   each a single compact row, and a form whose paired controls (OAuth buttons,
   the two password boxes) share a line. Spacing is tight on purpose; do not
   loosen it without checking the form still fits one screen. */
.auth-signup {
  position: relative;
  justify-content: flex-start;
  gap: 12px;
  min-height: 100vh;
  padding: 14px 20px 16px;
  background:
    radial-gradient(circle at 15% 8%, rgba(4, 120, 87, .09), transparent 30%),
    radial-gradient(circle at 88% 22%, rgba(14, 116, 144, .07), transparent 27%),
    var(--tint);
}

/* 商务合作 and the language switch ride on the brand's row instead of taking
   one of their own. */
.auth-signup > .auth-tools {
  position: absolute;
  top: 18px;
  right: 28px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
}

.auth-signup .signup-deal,
.auth-source .signup-deal {
  width: min(100%, 1360px);
  max-width: none;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 12px;
}

.auth-signup .signup-deal .deal-title { font-size: 16px; }
.auth-signup .signup-deal .deal-note { font-size: 12px; }
.auth-signup .signup-deal .deal-off { padding: 3px 12px; font-size: 13px; }

.signup-main {
  width: min(100%, 1360px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 440px);
  grid-template-areas: "story form";
  gap: 16px;
  align-items: stretch;
}

.signup-main-source.signup-lead-grid {
  width: min(100%, 1360px);
  grid-template-columns: minmax(0, 1fr) minmax(400px, 440px);
  grid-template-areas: "story form";
  gap: 16px;
  align-items: stretch;
}

.signup-story {
  grid-area: story;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  /* The form decides the height; leftover room is shared between the rows. */
  align-content: space-between;
  min-width: 0;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-lg);
  background: linear-gradient(145deg, #073f37 0%, #075b4b 58%, #0b5160 100%);
  color: #fff;
  padding: 24px 30px;
  box-shadow: 0 20px 50px rgba(5, 64, 55, .18);
}

.signup-story::after {
  content: "";
  position: absolute;
  right: -96px;
  bottom: -130px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, .035), 0 0 0 84px rgba(255, 255, 255, .025);
  pointer-events: none;
}

.signup-story-copy,
.signup-proof,
.signup-rates,
.signup-story .signup-lead-gift { position: relative; z-index: 1; }

.signup-story-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  padding: 5px 10px;
  color: rgba(255, 255, 255, .88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.signup-hvoy-title {
  display: block;
  width: auto;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.signup-hvoy-title strong { color: #fff; font-weight: 720; }

.signup-story h1 {
  max-width: 620px;
  margin-top: 10px;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.04em;
}

.signup-story-copy > p {
  max-width: 630px;
  margin-top: 8px;
  color: rgba(255, 255, 255, .74);
  font-size: 13px;
  line-height: 1.65;
}

.signup-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.signup-proof-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .095);
  padding: 12px 16px;
  backdrop-filter: blur(4px);
}

.signup-proof-item dt {
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.signup-proof-item dd {
  margin: 5px 0 3px;
  color: #fff;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.signup-proof-live dd { color: #a7f3d0; }
.signup-proof-days dd { color: #a7f3d0; }
.signup-proof-unit {
  margin-left: 4px;
  color: rgba(167, 243, 208, .82);
  font-size: .6em;
  font-weight: 700;
  letter-spacing: 0;
}

.signup-proof-item small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  line-height: 1.4;
}

.signup-live-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, .14);
}

#signup-activity.is-updated { animation: signup-metric-pop .35s ease-out; }

@keyframes signup-metric-pop {
  0% { opacity: .55; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* The gift is one row: chip, amount, then the sentence. */
.signup-story .signup-lead-gift {
  width: auto;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: "badge amount copy";
  align-items: center;
  gap: 14px;
  margin: 0;
  border: 1px solid rgba(253, 230, 138, .86);
  border-radius: 14px;
  background: linear-gradient(110deg, #fff7d6 0%, #fde68a 100%);
  padding: 12px 18px;
  color: #713f12;
  box-shadow: 0 12px 28px rgba(3, 31, 27, .18);
}

.signup-gift-badge {
  grid-area: badge;
  width: fit-content;
  border-radius: 999px;
  background: #b45309;
  padding: 4px 9px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.signup-story .signup-gift-amount {
  grid-area: amount;
  min-width: 0;
  color: #92400e;
  font-size: 34px;
}

.signup-story .signup-gift-copy { grid-area: copy; gap: 2px; }
.signup-story .signup-gift-copy strong { color: #78350f; font-size: 16px; }
.signup-story .signup-gift-copy small { color: rgba(120, 53, 15, .78); font-size: 11px; }

.signup-main .signup-lead-form {
  grid-area: form;
  width: 100%;
  max-width: none;
  height: 100%;
  align-self: stretch;
  position: sticky;
  top: 18px;
  border-color: rgba(15, 76, 92, .12);
  box-shadow: 0 18px 42px rgba(15, 76, 92, .11);
}

/* ---- the form card ---- */

.signup-main .auth-card { padding: 20px 26px 16px; }
.signup-main .auth-h { font-size: 21px; }
.signup-main .auth-sub { margin: 4px 0 12px; font-size: 12px; line-height: 1.55; }

.signup-main .form { gap: 9px; }
.signup-main .field { gap: 4px; }
.signup-main .field-label { font-size: 12px; }
.signup-main .input { padding: 9px 12px; font-size: 14px; }
.signup-main .field-hint { font-size: 11px; line-height: 1.45; }
.signup-main .btn-block { padding: 11px; margin-top: 2px; }
.signup-main .auth-foot { margin-top: 10px; padding-top: 10px; }

/* Google and GitHub share a line; the divider spans both. */
.signup-main .oauth-entry { gap: 8px; margin-bottom: 8px; }
.signup-main .oauth-entry .auth-divider { margin-top: 2px; }
.signup-main .oauth-entry-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.signup-main .oauth-entry-pair .auth-divider { grid-column: 1 / -1; }
.signup-main .btn-google,
.signup-main .btn-github {
  min-height: 40px;
  padding: 0 10px 0 38px;
  font-size: 13px;
}
.signup-main .google-mark { left: 12px; }

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

/* The invite-code hint only speaks when it has something to say (the code is
   valid, or matches nobody); its idle sentence just costs a line. */
#aff-hint:not(.aff-ok):not(.aff-warn) { display: none; }

.auth-signup .auth-alt { margin-top: 0; }

/* A shorter window gives up the redundant extras before anything scrolls. */
@media (min-width: 901px) and (max-height: 820px) {
  .auth-signup .auth-alt { display: none; }
}

@media (min-width: 901px) and (max-height: 740px) {
  .signup-main .auth-sub { display: none; }
  .signup-main .auth-h { margin-bottom: 10px; }
  .signup-main .auth-card { padding-top: 16px; }
}

/* A 1366x768 laptop leaves about 650px under the browser's own chrome. */
@media (min-width: 901px) and (max-height: 700px) {
  .auth-signup { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .auth-signup > .auth-tools { top: 14px; }
  .signup-main .auth-card { padding: 12px 24px 10px; }
  .signup-main .auth-h { margin-bottom: 8px; }
  .signup-main .form { gap: 7px; }
  .signup-main .input { padding: 7px 12px; }
  .signup-main .btn-block { padding: 9px; }
  .signup-main .btn-google,
  .signup-main .btn-github { min-height: 36px; }
  .signup-main .auth-foot { margin-top: 8px; padding-top: 8px; }
}

@media (max-width: 900px) {
  .auth-signup .signup-deal,
  .auth-source .signup-deal,
  .signup-main,
  .signup-main-source.signup-lead-grid { width: min(100%, 560px); }

  /* Stacked, the form comes first: it is what the visitor came for, and the
     price board is the supporting argument underneath it. */
  .signup-main,
  .signup-main-source.signup-lead-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "story";
  }

  .signup-story { height: auto; gap: 12px; padding: 18px 20px; }
  .signup-story-copy > p { display: none; }
  .signup-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signup-main .signup-lead-form { height: auto; position: static; }
}

@media (max-width: 600px) {
  .auth-signup { gap: 10px; padding: 12px 12px 18px; }
  .auth-signup > .auth-tools { top: 16px; right: 14px; gap: 10px; }
  .signup-story h1 { font-size: 24px; }

  /* Three small tiles in a row rather than a column of big ones. */
  .signup-proof { gap: 8px; }
  .signup-proof-item { padding: 9px 10px; border-radius: 12px; }
  .signup-proof-item dt { font-size: 11px; white-space: normal; }
  .signup-proof-item dd { margin: 4px 0 0; font-size: 20px; }
  .signup-proof-item small { display: none; }

  .signup-story .signup-lead-gift { gap: 10px; padding: 10px 14px; }
  .signup-story .signup-gift-amount { font-size: 28px; }
  .signup-story .signup-gift-copy strong { font-size: 14px; }
  .signup-story .signup-gift-copy small { display: none; }

  .signup-main .auth-card { padding: 18px 16px 14px; }
}


/* ---------- price board (home + sign-up) ----------
   One tile per token group (倍率 and 折) and one row per vendor's headline
   model. The home page shows it on paper, the sign-up page inside the dark
   story card; the dark variant only recolours the same markup. */
.rate-toggle { position: absolute; opacity: 0; pointer-events: none; }
.rate-expand { display: none; }
.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.rate-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}
.rate-top, .rate-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.rate-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.rate-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.rate-dot-amber { background: #f59e0b; } .rate-dot-blue { background: #3b82f6; }
.rate-dot-cyan { background: #06b6d4; } .rate-dot-green { background: #10b981; }
.rate-dot-grey { background: #9ca3af; } .rate-dot-indigo { background: #6366f1; }
.rate-dot-light-blue { background: #38bdf8; } .rate-dot-lime { background: #84cc16; }
.rate-dot-orange { background: #f97316; } .rate-dot-pink { background: #ec4899; }
.rate-dot-purple { background: #a855f7; } .rate-dot-red { background: #ef4444; }
.rate-dot-teal { background: #14b8a6; } .rate-dot-violet { background: #8b5cf6; }
.rate-dot-yellow { background: #eab308; }
.rate-mult {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.rate-mult-text { color: var(--ink-2); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.rate-models {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
}
.rate-off {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff3d6;
  padding: 2px 9px;
  color: #92400e;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

/* Headline models: name | group | input / output | 折. */
.mrows { border: 1px solid var(--line-2); border-radius: 16px; background: #fff; overflow: hidden; }
.mrow {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.mrow:first-child { border-top: 0; }
.mrow-head { background: var(--tint); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.mrow-name { display: grid; gap: 1px; min-width: 0; }
.mrow-name code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.mrow-name small { color: var(--ink-3); font-size: 11.5px; }
.mrow-grp { min-width: 0; }
.mrow-grp .ntag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow-price b { font-weight: 700; }
.mrow-price i { margin: 0 5px; color: var(--ink-3); font-style: normal; }
.mrow-head .mrow-price { font-variant-numeric: normal; }
.mrow-off { text-align: right; color: #92400e; font-weight: 700; white-space: nowrap; }
.mrow-head .mrow-off { color: var(--ink-2); font-weight: 600; }

/* ---------- home page ---------- */
.hp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}
/* Without a campaign poster the hero is one dark card holding the text and the
   vendor comparison; with one, the text card and the poster stay separate. */
.hp-hero-card {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 40px;
  align-items: center;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 8% 0%, rgba(110, 231, 183, .24), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, .2), transparent 46%),
    linear-gradient(145deg, #073f37 0%, #075b4b 58%, #0b5160 100%);
  color: #fff;
  padding: 40px 44px;
  box-shadow: 0 20px 50px rgba(5, 64, 55, .18);
}
.hp-hero-card::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -150px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(255, 255, 255, .03), 0 0 0 88px rgba(255, 255, 255, .02);
  pointer-events: none;
}
.hp-hero-card > * { position: relative; z-index: 1; }
.hp-hero:not(.hp-hero-card) .hp-hero-main {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(145deg, #073f37 0%, #075b4b 58%, #0b5160 100%);
  color: #fff;
  padding: 32px 36px;
  box-shadow: 0 20px 50px rgba(5, 64, 55, .18);
}
.hp-hero-main { display: grid; align-content: center; justify-items: start; gap: 20px; min-width: 0; }
.hp-hero h1 {
  margin: 0;
  font-size: clamp(28px, 3.3vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.hp-hero h1 .g { color: #a7f3d0; }
.hp-h1-sub {
  display: block;
  margin-top: 12px;
  color: #a7f3d0;
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 600;
  letter-spacing: 0;
}
.hp-hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hp-gift {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: linear-gradient(110deg, #fff7d6 0%, #fde68a 100%);
  padding: 14px 26px;
  color: #78350f;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(3, 31, 27, .26);
}
.hp-gift b { color: #92400e; font-size: 21px; font-weight: 800; }
.hp-gift:hover { filter: brightness(1.03); }
.hp-ghost {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  padding: 13px 22px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.hp-ghost:hover { background: rgba(255, 255, 255, .1); }
.hp-ticks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.hp-ticks li { position: relative; padding-left: 18px; color: rgba(255, 255, 255, .74); font-size: 12.5px; }
.hp-ticks li::before { content: "✓"; position: absolute; left: 0; color: #a7f3d0; font-weight: 800; }

/* Vendor comparison: the bar is our price as a share of the official price. */
.hp-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  padding: 20px 22px;
  backdrop-filter: blur(6px);
}
.hp-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hp-panel-head b { font-size: 14.5px; }
.hp-panel-head span { color: rgba(255, 255, 255, .6); font-size: 11.5px; }
.hp-vendors { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.hp-vendors li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
}
.hp-v-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.hp-v-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
}
.hp-v-ico img { width: 15px; height: 15px; }
.hp-v-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.hp-v-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6ee7b7, #34d399);
}
.hp-v-off { color: #fde68a; font-size: 12.5px; font-weight: 700; text-align: right; white-space: nowrap; }

.hp-urlbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  padding: 10px 16px;
}
.hp-url-label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.hp-urlbar code { border-radius: 8px; background: var(--tint); padding: 4px 10px; font-family: var(--mono); font-size: 13px; }
.hp-urlbar a { margin-left: auto; color: var(--green); font-size: 14px; font-weight: 600; }
.hp-urlbar .copy {
  border: 1px solid var(--line-3);
  border-radius: 8px;
  background: #fff;
  padding: 4px 12px;
  color: var(--green);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.hp-urlbar .copy:hover { background: var(--tint-2); }

.hp-sec { margin-top: 40px; }
.hp-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.hp-sec-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hp-sec-head p { margin: 0; color: var(--ink-2); font-size: 13px; }
.hp-sec-head a { margin-left: auto; color: var(--green); font-size: 14px; font-weight: 600; }
.hp-service { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hp-service:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.svc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: #fff;
  padding: 16px 18px;
}
.svc-card > .ico { flex: 0 0 auto; width: 28px; height: 28px; stroke: var(--green); }
.svc-qr { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 8px; }
.svc-body { flex: 1 1 auto; min-width: 0; }
.svc-body h3 { margin: 0; font-size: 15px; }
.svc-body h3 code { margin-left: 4px; font-size: 13px; }
.svc-body p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }

/* ---------- sign-up story card ---------- */
.signup-rates { display: grid; gap: 10px; }
.signup-rates-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.signup-rates-head h2 { margin: 0; color: #fff; font-size: 15px; font-weight: 700; }
.signup-rates-head span { color: rgba(255, 255, 255, .6); font-size: 12px; }
.signup-rates-head a { margin-left: auto; color: #a7f3d0; font-size: 12.5px; font-weight: 600; }
.signup-rates .rate-grid { gap: 8px; }
.signup-rates .rate-card {
  gap: 4px;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .095);
  padding: 9px 12px;
}
.signup-rates .rate-name { color: #fff; font-size: 13px; }
.signup-rates .rate-mult { color: #a7f3d0; font-size: 18px; }
.signup-rates .rate-mult-text { color: rgba(255, 255, 255, .75); font-size: 11.5px; }
.signup-rates .rate-models { color: rgba(255, 255, 255, .55); font-size: 11px; }
.signup-rates .rate-off { background: rgba(253, 230, 138, .18); color: #fde68a; font-size: 11px; padding: 1px 8px; }
.signup-rates .rate-expand { color: #a7f3d0; }
/* The tile is narrow once the 折 pill is on the same line: one model name. */
.signup-rates .rate-m2 { display: none; }

@media (max-width: 899.98px) {
  .hp-hero, .hp-hero-card { grid-template-columns: minmax(0, 1fr); }
  .hp-hero-card { gap: 28px; }
  .rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hp-hero-card { padding: 26px 20px; }
  .hp-hero:not(.hp-hero-card) .hp-hero-main { padding: 24px 20px; }
  .hp-hero h1 { font-size: 28px; }
  .hp-panel { padding: 16px; }
  .hp-vendors li { grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; }
  .hp-urlbar a { margin-left: 0; }
  .hp-gift { padding: 11px 18px; font-size: 14px; }
  .hp-sec { margin-top: 30px; }
  .hp-sec-head h2 { font-size: 19px; }
  .hp-service { grid-template-columns: minmax(0, 1fr); }
  .rate-grid { grid-template-columns: minmax(0, 1fr); }
  .rate-more { display: none; }
  .rate-toggle:checked ~ .rate-grid .rate-more { display: grid; }
  .rate-expand {
    display: block;
    margin-top: 8px;
    border: 1px dashed var(--line-3);
    border-radius: 12px;
    padding: 9px;
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
  }
  .rate-toggle:checked ~ .rate-expand { display: none; }
  .mrow-head { display: none; }
  .mrow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name price" "grp off";
    row-gap: 6px;
    padding: 12px 14px;
  }
  .mrow-name { grid-area: name; }
  .mrow-price { grid-area: price; text-align: right; }
  .mrow-grp { grid-area: grp; }
  .mrow-off { grid-area: off; }
}

@media (prefers-reduced-motion: reduce) {
  #signup-activity.is-updated { animation: none; }
}


/* The proof strip sits under the price board as a footnote-sized row. */
.signup-story .signup-proof { gap: 8px; }
.signup-story .signup-proof-item { padding: 8px 12px; border-radius: 12px; }
.signup-story .signup-proof-item dt { font-size: 11px; }
.signup-story .signup-proof-item dd { margin: 3px 0 2px; font-size: clamp(18px, 1.7vw, 22px); }
.signup-story .signup-proof-item small { font-size: 10px; }

/* ---------- BuyToken x CC Switch guide (templates/ccs_guide.html) ---------- */

/* Header entry. Same row as the balance and language switch; on a phone only the
   CC Switch glyph is left so the header keeps one line. The orange dot marks
   "not opened yet" and is cleared by site.js once the guide has been shown. */
.hdr-ccs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line-3);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 500 13.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.hdr-ccs img { width: 20px; height: 20px; flex: none; display: block; }
.hdr-ccs:hover { border-color: #f1c7a8; background: #fffaf5; box-shadow: 0 4px 14px rgba(232, 137, 90, .16); }
.hdr-ccs:focus-visible { outline: 2px solid rgba(232, 137, 90, .5); outline-offset: 2px; }
.hdr-ccs-new {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 0 2px #fff;
}
.hdr-ccs.is-seen .hdr-ccs-new { display: none; }
/* The guide is a desktop and tablet thing: no button on a phone. */
@media (max-width: 640px) {
  .hdr-ccs { display: none; }
}

.ccs-modal {
  /* Page one is a small card so it does not cover the home page; the dialog grows
     (width and height ease) when the visitor asks for the tutorial, because the
     screenshots need the room. */
  --ccs-hero-h: 492px;
  --ccs-h: clamp(420px, 66dvh, 540px);
  width: min(500px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 16px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(8, 12, 18, .45);
  transition: width .42s cubic-bezier(.22, .8, .24, 1);
}
.ccs-modal:not([data-page="0"]) { width: min(860px, calc(100vw - 24px)); }
.ccs-modal[open] { animation: ccs-pop .32s cubic-bezier(.2, .8, .2, 1); }
.ccs-modal::backdrop { background: rgba(8, 11, 15, .5); backdrop-filter: blur(2px); }
@keyframes ccs-pop { from { opacity: 0; transform: translateY(14px) scale(.975); } }

.ccs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 17, 21, .06);
  color: #5f6368;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.ccs-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ccs-close:hover { background: rgba(15, 17, 21, .12); color: #1f1f1f; }
.ccs-modal[data-page="0"] .ccs-close { background: rgba(255, 255, 255, .1); color: #c3cad3; }
.ccs-modal[data-page="0"] .ccs-close:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.ccs-viewport {
  overflow: hidden;
  touch-action: pan-y;
  height: var(--ccs-h);
  transition: height .42s cubic-bezier(.22, .8, .24, 1);
}
.ccs-modal[data-page="0"] .ccs-viewport { height: var(--ccs-hero-h); }
.ccs-track {
  display: flex;
  height: 100%;
  transition: transform .42s cubic-bezier(.22, .8, .24, 1);
  will-change: transform;
}
.ccs-slide { flex: 0 0 100%; min-width: 0; }

/* Page one: dark, with the two brands' colours glowing behind their tiles. */
.ccs-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 28px 18px;
  overflow: hidden;
  background: #0d1014;
  color: #fff;
  text-align: center;
}
.ccs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 38%, #000 20%, transparent 78%);
}
.ccs-hero > * { position: relative; }
.ccs-glow { position: absolute !important; width: 360px; height: 360px; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.ccs-glow-a { left: calc(50% - 279px); top: -78px; background: radial-gradient(circle, #f08a54 0%, rgba(240, 138, 84, 0) 68%); animation: ccs-breathe 7s ease-in-out infinite; }
.ccs-glow-b { left: calc(50% - 81px); top: -78px; background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 68%); animation: ccs-breathe 7s ease-in-out -3.5s infinite; }
@keyframes ccs-breathe { 50% { opacity: .78; transform: scale(1.08); } }

.ccs-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px 7px 12px;
  border: 1px solid rgba(251, 191, 59, .32);
  border-radius: 999px;
  background: rgba(251, 191, 59, .09);
  color: #f6dfa3;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
}
.ccs-badge svg { width: 14px; height: 14px; fill: #fbbf3b; }
.ccs-badge i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.ccs-pair { display: flex; align-items: flex-start; justify-content: center; gap: 0; margin-top: 2px; }
.ccs-logo { display: grid; justify-items: center; gap: 8px; width: 96px; }
.ccs-logo b { color: #aab2bd; font-size: 13px; font-weight: 550; letter-spacing: .01em; }
.ccs-tile {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 23px;
}
.ccs-tile-ccs { background: #fff; box-shadow: 0 14px 40px rgba(240, 138, 84, .38), inset 0 0 0 1px rgba(255, 255, 255, .6); }
.ccs-tile-ccs img { width: 58px; height: 58px; display: block; }
.ccs-tile-bt { background: linear-gradient(145deg, #0fae8f 0%, #087f6a 55%, #065f50 100%); box-shadow: 0 14px 40px rgba(16, 185, 129, .4), inset 0 1px 0 rgba(255, 255, 255, .22); }
/* The BuyToken tile is set in letters: BT. */
.ccs-bt {
  color: #fff;
  font: 800 34px/1 var(--font);
  letter-spacing: -.045em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  user-select: none;
}
.ccs-link { display: flex; align-items: center; height: 80px; }
.ccs-link i { display: block; width: 34px; height: 2px; border-radius: 2px; }
.ccs-link i:first-child { background: linear-gradient(90deg, rgba(240, 138, 84, 0), rgba(240, 138, 84, .85)); }
.ccs-link i:last-child { background: linear-gradient(90deg, rgba(16, 185, 129, .85), rgba(16, 185, 129, 0)); }
.ccs-link span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 19px;
  line-height: 1;
}

.ccs-hero h2 {
  max-width: 640px;
  font-size: clamp(24px, 3.2vw, 30px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.ccs-hero h2 b {
  font-weight: inherit;
  background: linear-gradient(90deg, #5eead4, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ccs-hero h2 em {
  font-style: normal;
  white-space: nowrap;
  background: linear-gradient(90deg, #ff9d6c, #fbbf3b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ccs-lead { max-width: 440px; color: #a9b1bc; font-size: 14px; line-height: 1.7; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }


.ccs-cta { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
.ccs-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #12c192 0%, #047857 100%);
  color: #fff;
  font: 650 15px/1.2 var(--font);
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(16, 185, 129, .38), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ccs-go:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(16, 185, 129, .5), inset 0 1px 0 rgba(255, 255, 255, .25); }
.ccs-go:focus-visible, .ccs-skip:focus-visible { outline: 2px solid rgba(94, 234, 212, .6); outline-offset: 3px; }
.ccs-skip { padding: 8px 4px; border: 0; background: none; color: #8d96a3; font: 500 14px/1 var(--font); cursor: pointer; }
.ccs-skip:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.ccs-meta { max-width: 400px; color: #6c7683; font-size: 12px; line-height: 1.6; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }

/* Pages two to five: one step each. The title says what to do, the screenshot
   (red marks are part of the picture) shows where. */
.ccs-step { display: flex; flex-direction: column; background: #fff; }
.ccs-step-head { display: flex; align-items: center; gap: 14px; padding: 22px 70px 14px 28px; }
.ccs-step-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #12c192, #047857);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(4, 120, 87, .28);
}
.ccs-step-head h3 { font-size: 18px; line-height: 1.35; letter-spacing: -.01em; }
.ccs-step-head p { margin-top: 2px; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.ccs-shot {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  margin: 0 28px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f3f5f4;
  overflow: hidden;
  cursor: zoom-in;
}
/* Absolute + contain: the whole picture always fits the frame, whatever its
   aspect ratio. In flow, max-height: 100% resolves against an auto-height flex
   item and the bottom of the screenshot (the 添加 button) got clipped. */
.ccs-shot img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; display: block; }

/* Bottom-left: the corner that is empty or sidebar in all four screenshots,
   while bottom-right holds the 添加 button of the last one. */
.ccs-zoom {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 17, 21, .72);
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.ccs-shot:hover .ccs-zoom, .ccs-shot:focus-visible .ccs-zoom { opacity: 1; }

.ccs-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ccs-modal[data-page="0"] .ccs-nav { border-top-color: rgba(255, 255, 255, .07); background: #0d1014; }
.ccs-prev, .ccs-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 550 14px/1.2 var(--font);
  white-space: nowrap;
  cursor: pointer;
}
.ccs-prev { justify-self: start; background: none; color: var(--ink-2); }
.ccs-prev:hover { background: var(--tint); color: var(--ink); }
.ccs-fwd { justify-self: end; display: flex; }
.ccs-next { background: var(--green); color: #fff; transition: background-color .15s ease; }
.ccs-next:hover { background: var(--green-d); }
.ccs-final { display: none; }
.ccs-modal[data-last="1"] .ccs-final { display: inline-flex; }
.ccs-modal[data-last="1"] [data-ccs-next] { display: none; }
.ccs-modal[data-page="0"] .ccs-prev,
.ccs-modal[data-page="0"] .ccs-fwd { visibility: hidden; }
.ccs-prev:focus-visible, .ccs-next:focus-visible, .ccs-dot:focus-visible, .ccs-close:focus-visible {
  outline: 2px solid rgba(4, 120, 87, .45);
  outline-offset: 2px;
}

.ccs-dots { display: flex; align-items: center; gap: 8px; }
.ccs-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d3d8dc;
  cursor: pointer;
  transition: width .25s ease, background-color .25s ease;
}
.ccs-dot[aria-current="true"] { width: 24px; background: var(--green); }
.ccs-modal[data-page="0"] .ccs-dot { background: rgba(255, 255, 255, .22); }
.ccs-modal[data-page="0"] .ccs-dot[aria-current="true"] { background: #34d399; }

@media (prefers-reduced-motion: reduce) {
  .ccs-modal[open], .ccs-glow { animation: none; }
  .ccs-modal, .ccs-viewport, .ccs-track, .ccs-dot, .ccs-go { transition: none; }
}

/* ---- 分组状态 (/console/status) ---------------------------------------- */
.app[data-page="status"], .gs-tip {
  --gs-ok: #10a36d;
  --gs-fair: #8fd16c;
  --gs-warn: #f5c400;
  --gs-deep: #e58600;
  --gs-bad: #e5262b;
}
.gs-head { margin-bottom: 22px; align-items: center; }
.gs-seg { display: inline-flex; background: #eef1f3; border-radius: 999px; padding: 3px; }
.gs-seg a { font-size: 13.5px; font-weight: 600; color: #5b6168; padding: 7px 16px; border-radius: 999px; text-decoration: none; }
.gs-seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.gs-updated { margin: 0; font-size: 13px; color: #8a9097; }
.gs-ok { background: var(--gs-ok); }
.gs-fair { background: var(--gs-fair); }
.gs-warn { background: var(--gs-warn); }
.gs-deep { background: var(--gs-deep); }
.gs-bad { background: var(--gs-bad); }
.gs-t-ok { color: #0b8457; }
.gs-t-fair { color: #4a8a1c; }
.gs-t-warn { color: #a07c00; }
.gs-t-deep { color: #c46f00; }
.gs-t-bad { color: var(--gs-bad); }
.gs-name { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; min-width: 0; }
.gs-gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gs-mult { flex: none; font-style: normal; font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--green); background: #ecf8f2; border-radius: 999px; padding: 1px 7px; }
.gs-ico { width: 24px; height: 24px; border-radius: 7px; background: #f3f5f6; display: inline-grid; place-items: center; flex: none; }
/* four figures */
.gs-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.gs-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.gs-k { font-size: 12.5px; font-weight: 600; color: #5b6168; }
.gs-v { margin-top: 10px; font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gs-v small { margin-left: 3px; font-size: 15px; font-weight: 600; letter-spacing: 0; color: #8a9097; }
.gs-s { margin-top: 8px; font-size: 12.5px; color: #8a9097; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-s b { font-weight: 600; margin-left: 2px; }
/* one small card with a strip per counter */
.gs-fine { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-bottom: 30px; }
.gs-f { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.gs-f1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gs-f1 .gs-name { font-size: 13.5px; font-weight: 600; }
.gs-f1 b { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gs-strip { display: flex; gap: 2px; margin-top: 10px; }
.gs-sq { flex: 1; height: 8px; border-radius: 2px; cursor: default; outline: none; }
.gs-sq.gs-cur { opacity: .5; }
.gs-sq:hover, .gs-sq:focus-visible { box-shadow: 0 0 0 1px #fff, 0 0 0 2.5px rgba(28, 31, 35, .55); }
.gs-note { margin: 0; max-width: 820px; color: #8a9097; font-size: 12.5px; line-height: 1.7; }
/* hover tip */
.gs-tip { position: fixed; z-index: 60; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(15, 23, 42, .16); padding: 12px 14px; font-size: 13px; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .1s, transform .1s; left: -9999px; top: 0; }
.gs-tip.show { opacity: 1; transform: none; }
.gs-tip .gs-tg { font-weight: 700; font-size: 13.5px; }
.gs-tip .gs-tt { color: #8a9097; font-family: var(--mono); font-size: 11.5px; margin-top: 2px; }
.gs-tip .gs-tr { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; }
.gs-tip .gs-tr b { font-size: 20px; letter-spacing: -.01em; }
.gs-tip .gs-tr i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.gs-tip .gs-tr span { color: #5b6168; font-size: 12px; }
.gs-tip .gs-th { margin: 10px 0 6px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: #5b6168; font-weight: 600; }
.gs-tip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.gs-tip li { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 12px; }
.gs-tip li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-tip li em { font-style: normal; font-family: var(--font); font-weight: 600; white-space: nowrap; }
.gs-tip .gs-tn { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: #5b6168; font-size: 12.5px; }
.gs-tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; width: 10px; height: 10px; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.gs-tip.below::after { bottom: auto; top: -6px; transform: translateX(-50%) rotate(225deg); }
@media (max-width: 1100px) {
  .gs-kpi .gs-s { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}
@media (max-width: 760px) {
  .gs-kpis { grid-template-columns: minmax(0, 1fr); }
  .gs-v { font-size: 26px; }
}

/* ---------- 商务合作 (header pill + card) ---------- */
.biz { position: relative; display: inline-flex; }
.hdr-biz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--line-3);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 500 13.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.hdr-biz-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--green); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.biz:hover .hdr-biz,
.biz.is-open .hdr-biz,
.hdr-biz:focus-visible { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 3px rgba(4, 120, 87, .08); }
.hdr-biz:focus-visible { outline: none; }
/* The card hangs under the pill, right-aligned; its top padding is the bridge
   the pointer crosses without the card closing. */
.biz-pop { position: absolute; top: 100%; right: 0; z-index: 40; display: none; padding-top: 10px; }
.biz:hover .biz-pop,
.biz:focus-within .biz-pop,
.biz.is-open .biz-pop { display: block; }
.biz-card {
  display: grid;
  gap: 6px;
  width: 316px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
  text-align: left;
}
.biz-title { color: var(--ink); font-size: 14.5px; font-weight: 650; }
.biz-note { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; white-space: normal; }
.biz-qq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #cfe9dc;
  border-radius: 10px;
  background: #f1faf5;
  color: var(--green);
  font: 650 14px/1.2 var(--mono);
  cursor: pointer;
}
.biz-qq-k { color: var(--ink-3); font: 600 12px/1 var(--font); }
.biz-qq svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.biz-qq:hover, .biz-qq.ok { border-color: var(--green); }
/* QR on the left, the two buttons stacked beside it at its height. */
.biz-body { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 6px; }
.biz-qr { display: block; width: 124px; height: 124px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; image-rendering: pixelated; }
.biz-acts { display: grid; gap: 8px; }
.biz-scan { color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.biz-add { width: 100%; }
/* On a phone the pill keeps only its mark, so the header row still fits. */
@media (max-width: 560px) {
  .hdr-biz { width: 36px; padding: 0; justify-content: center; }
  .hdr-biz-text { display: none; }
  .biz-card { width: min(316px, calc(100vw - 24px)); }
}
/* Header fit with the 商务合作 pill (checked in a browser, 320-1440px). The logo
   never shrinks: squeezed, "控制台" broke onto three lines. Between the desktop
   breakpoint and 1280px the pill keeps only its mark, the way phones show it, so
   the row fits instead of dropping 退出 onto a second line. On the smallest
   phones it goes (the contact page and the sign-up page still carry it), so the
   controls stay on one row under the logo. */
.hdr .brand { flex-shrink: 0; }
.brand-tag { white-space: nowrap; }
@media (min-width: 900px) and (max-width: 1279.98px) {
  .hdr-biz { width: 36px; padding: 0; justify-content: center; }
  .hdr-biz-text { display: none; }
  .hdr-in > .hdr-cta { gap: 8px; }
}
@media (max-width: 360px) {
  .hdr-cta > .biz { display: none; }
}
/* 推荐有礼's records table had a wrapper with no rule, so on a phone its 576px
   of columns widened the whole page. It scrolls inside its own box instead. */
.tbl-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* ---------- wallet: cashier layout (2026-12 redesign, option A) ----------
   Amounts and methods on the left, a sticky order summary on the right: the
   balance after the top-up, the first-top-up discount, any Stripe fee and the
   total sit beside one pay button. Picking only updates the summary. */
.wc-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfcfc);
}
.wc-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 18px 22px; }
.wc-stat + .wc-stat { border-left: 1px solid var(--line); }
.wc-k { color: var(--ink-3); font-size: 12.5px; }
.wc-v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wc-v small { margin-right: 2px; font-size: .58em; font-weight: 600; }
.wc-n { color: var(--ink-3); font-size: 12px; opacity: .85; }
.wc-stat-main .wc-v { font-size: 30px; color: var(--green-d); }
.wc-stat-main.is-low .wc-v { color: #b45309; }
.wc-stat-main.is-low .wc-n { color: #b45309; opacity: 1; }

.wc { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.wc-pick { padding: 22px; }
.wc-pick > .pay-pick-head:first-child { margin-top: 0; }
.wc .first-offer {
  gap: 12px; margin: 0 0 16px; padding: 10px 14px; border: 0; border-radius: 11px;
  background: linear-gradient(90deg, #fff4dc, #fffaf0); box-shadow: none;
}
.wc .first-offer-badge { padding: 3px 10px; background: #f59e0b; font-size: 12px; }
.wc .first-offer-t { display: inline; font-size: 14px; }
.wc .first-offer-t b { font-size: 16px; }
.wc .first-offer-d { display: inline; margin: 0 0 0 6px; color: #92400e; font-size: 12.5px; }
.wc .topup-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.wc .topup-opt {
  position: relative; align-items: flex-start; gap: 2px; padding: 15px 14px 13px;
  border: 1.5px solid var(--line-2); border-radius: 12px; text-align: left;
}
.wc .topup-opt:hover { border-color: #b7c9c1; transform: none; }
.wc .topup-opt.is-picked { border-color: var(--green); background: #fbfefc; box-shadow: 0 0 0 3px rgba(4, 120, 87, .12); }
.wc .topup-opt:disabled { cursor: not-allowed; opacity: .5; }
.wc .topup-amt { font-size: 22px; font-weight: 750; }
.wc .topup-flag, .wc .topup-note { position: absolute; top: -9px; right: 10px; margin: 0; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 18px; }
.wc .topup-note { background: var(--tint-2); color: var(--green-d); font-weight: 600; }
.wc .topup-custom {
  margin: 0 0 4px; padding: 10px 14px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wc .topup-custom.is-picked { border-style: solid; border-color: var(--green); box-shadow: 0 0 0 3px rgba(4, 120, 87, .12); }
.wc .topup-custom-t { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.wc .topup-custom-field { padding-left: 0; border: 0; background: none; }
.wc .topup-custom-field .input { width: 160px; padding-left: 0; font-size: 16px; font-weight: 650; }
.wc .topup-custom-sub { text-align: right; }
.wc .topup-custom-sub.is-error { color: #b42318; }
.wc .topup-custom-note { margin: 6px 2px 0; font-size: 12px; }
.wc-methods { margin: 24px 0 0; }
.wc .pay-choice, .wc .pay-choice.pay-choice-3 { grid-template-columns: 1fr; gap: 10px; }
.wc .pay-choice-card { padding: 12px 46px 12px 14px; border-width: 1.5px; border-color: var(--line-2); }
.wc .pay-choice-card:hover { transform: none; }
.wc .pay-choice-card.is-on { box-shadow: 0 0 0 3px var(--pm-glow); }
.wc .pay-brands { margin-top: 6px; }

.wc-sum {
  position: sticky; top: 20px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, .35);
}
.wc-sum-top { display: flex; flex-direction: column; gap: 2px; padding: 20px 22px; color: #fff; background: linear-gradient(135deg, #065f46, #047857 60%, #0e9f6e); }
.wc-sum-top .wc-k { color: rgba(255, 255, 255, .75); }
.wc-sum-top .wc-v { font-size: 30px; font-weight: 750; }
.wc-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: rgba(255, 255, 255, .9); font-variant-numeric: tabular-nums; }
.wc-flow span[aria-hidden] { opacity: .7; }
.wc-sum-body { padding: 16px 22px 20px; }
.wc-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; color: var(--ink-2); font-size: 13.5px; }
.wc-line[hidden] { display: none; }
.wc-line b { font-weight: 600; font-variant-numeric: tabular-nums; }
.wc-off b { color: #b45309; }
.wc-total { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line-2); color: var(--ink); font-weight: 650; }
.wc-total b { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.wc-err { margin: 6px 0 0; color: #b42318; font-size: 12.5px; }
.wc-go {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; margin-top: 14px;
  border: 0; border-radius: 12px; background: var(--green); color: #fff; font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: pointer; box-shadow: 0 6px 18px -8px rgba(4, 120, 87, .6);
  transition: background .15s ease;
}
.wc-go:hover { background: var(--green-d); }
.wc-go:disabled { background: #c9d6d0; box-shadow: none; cursor: not-allowed; }
.wc-fine { margin: 12px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.6; }

@media (max-width: 1100px) {
  .wc { grid-template-columns: minmax(0, 1fr) 300px; }
  .wc .topup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899.98px) {
  .wc-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wc-stat-main { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .wc-stat-main + .wc-stat { border-left: 0; }
  .wc-stat { padding: 14px 16px; }
  .wc-v { font-size: 18px; }
  .wc { grid-template-columns: minmax(0, 1fr); }
  .wc-sum { position: static; }
  .wc .first-offer-d { display: block; margin: 2px 0 0; }
}
@media (max-width: 560px) {
  .wc-pick { padding: 16px; }
  .wc .topup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wc .topup-custom-sub { text-align: left; }
  .wc-stat { padding: 12px; }
  .wc-v { font-size: 16px; }
  .wc-stat-main .wc-v { font-size: 26px; }
}
/* The banner above already says every amount is discounted, and the summary
   names the method: the per-card 首充优惠 flags and the head note were noise. */
.wc .topup-flag { display: none; }
.wc-block > .block-head .block-note { display: none; }
.wc .topup-custom-field .input::placeholder { color: var(--ink-3); font-weight: 400; }
