/* The member's look (next/js/theme.js): tokens for the four surfaces, the page ground, the switch's fade,
   and the look switch's own styles. Everything here keys on html[data-theme], which only theme.js and the
   early script in index.html set (PORTAL_CONFIG.themes with the redesign); without it nothing matches.
   Tokens sit on the root, for pop-ups placed in <body>, and again on .pt, whose own declaration in portal.css
   would otherwise win. A custom accent arrives as --p-acc*-u inline on <html>; each tone falls back to its own.
   --p-run is the running state (执行中): the tone's default blue, never the custom accent, so a green accent
   can't make running look like done (--p-pass). */

/* ---------------------------------------------------------------- tokens */
:root[data-theme][data-tone=night],:root[data-theme][data-tone=night] :is(body,.pt){
  --p-bg:#070A11; --p-bg-rgb:7,10,17; --p-card:rgba(255,255,255,.035); --p-bg2:rgba(0,0,0,.28); --p-raise:#11151D;
  --p-hover:rgba(255,255,255,.06); --p-glass:rgba(7,10,17,.78); --p-line:rgba(255,255,255,.09); --p-line2:rgba(255,255,255,.16);
  --p-ink:#EEF2F9; --p-ink-rgb:238,242,249; --p-ink2:#C9D1DF; --p-mut:#8B94A6; --p-faint:#5C6474;
  --p-acc:var(--p-acc-u,#7DA2FF); --p-acc2:var(--p-acc2-u,#3D6BF0); --p-acc-rgb:var(--p-acc-rgb-u,125,162,255); --p-acc2-rgb:var(--p-acc2-rgb-u,61,107,240); --p-on-acc:var(--p-on-acc-u,#fff);
  --p-pass:#4ADE9C; --p-pass-rgb:74,222,156; --p-fail:#FF8A7E; --p-fail-rgb:255,138,126; --p-wait:#F5B95C; --p-wait-rgb:245,185,92;
  --p-gold:#FFE2A8; --p-gold-rgb:255,200,110; --p-ai:#9CC8FF; --p-ai-rgb:156,200,255;
  --p-run:#7DA2FF; --p-run-rgb:125,162,255;
  --p-shadow:0 18px 48px rgba(0,0,0,.5);
}
:root[data-theme][data-tone=graphite],:root[data-theme][data-tone=graphite] :is(body,.pt){
  --p-bg:#0B0C0E; --p-bg-rgb:11,12,14; --p-card:rgba(255,255,255,.04); --p-bg2:rgba(0,0,0,.3); --p-raise:#16171A;
  --p-hover:rgba(255,255,255,.06); --p-glass:rgba(11,12,14,.8); --p-line:rgba(255,255,255,.09); --p-line2:rgba(255,255,255,.16);
  --p-ink:#EDEEF0; --p-ink-rgb:237,238,240; --p-ink2:#C8CBD1; --p-mut:#8E9299; --p-faint:#5E6168;
  --p-acc:var(--p-acc-u,#7DA2FF); --p-acc2:var(--p-acc2-u,#3D6BF0); --p-acc-rgb:var(--p-acc-rgb-u,125,162,255); --p-acc2-rgb:var(--p-acc2-rgb-u,61,107,240); --p-on-acc:var(--p-on-acc-u,#fff);
  --p-pass:#4ADE9C; --p-pass-rgb:74,222,156; --p-fail:#FF8A7E; --p-fail-rgb:255,138,126; --p-wait:#F5B95C; --p-wait-rgb:245,185,92;
  --p-gold:#FFE2A8; --p-gold-rgb:255,200,110; --p-ai:#9CC8FF; --p-ai-rgb:156,200,255;
  --p-run:#7DA2FF; --p-run-rgb:125,162,255;
  --p-shadow:0 18px 48px rgba(0,0,0,.5);
}
:root[data-theme][data-tone=white],:root[data-theme][data-tone=white] :is(body,.pt){
  --p-bg:#F6F7F9; --p-bg-rgb:246,247,249; --p-card:#FFFFFF; --p-bg2:#F1F3F6; --p-raise:#FFFFFF;
  --p-hover:rgba(15,23,42,.045); --p-glass:rgba(255,255,255,.82); --p-line:rgba(15,23,42,.09); --p-line2:rgba(15,23,42,.16);
  --p-ink:#0E1525; --p-ink-rgb:14,21,37; --p-ink2:#2F3A4F; --p-mut:#5B6578; --p-faint:#8A93A5;
  --p-acc:var(--p-acc-u,#2F55D4); --p-acc2:var(--p-acc2-u,#2F5FE0); --p-acc-rgb:var(--p-acc-rgb-u,47,85,212); --p-acc2-rgb:var(--p-acc2-rgb-u,47,95,224); --p-on-acc:var(--p-on-acc-u,#fff);
  --p-pass:#0B7A55; --p-pass-rgb:11,122,85; --p-fail:#C2372D; --p-fail-rgb:194,55,45; --p-wait:#A9570A; --p-wait-rgb:169,87,10;
  --p-gold:#9A6510; --p-gold-rgb:176,118,24; --p-ai:#2D5BB8; --p-ai-rgb:45,91,184;
  --p-run:#2F55D4; --p-run-rgb:47,85,212;
  --p-shadow:0 1px 2px rgba(15,23,42,.06),0 12px 32px rgba(15,23,42,.12);
  --p-logo:#0E1525;
}
:root[data-theme][data-tone=paper],:root[data-theme][data-tone=paper] :is(body,.pt){
  --p-bg:#F5F2EB; --p-bg-rgb:245,242,235; --p-card:#FFFDF8; --p-bg2:#EFEBE2; --p-raise:#FFFDF8;
  --p-hover:rgba(60,40,10,.05); --p-glass:rgba(250,248,242,.85); --p-line:rgba(60,45,20,.11); --p-line2:rgba(60,45,20,.19);
  --p-ink:#221C14; --p-ink-rgb:34,28,20; --p-ink2:#43392B; --p-mut:#6B604F; --p-faint:#9A8F7C;
  --p-acc:var(--p-acc-u,#2F55D4); --p-acc2:var(--p-acc2-u,#2F5FE0); --p-acc-rgb:var(--p-acc-rgb-u,47,85,212); --p-acc2-rgb:var(--p-acc2-rgb-u,47,95,224); --p-on-acc:var(--p-on-acc-u,#fff);
  --p-pass:#0B7A55; --p-pass-rgb:11,122,85; --p-fail:#B8362B; --p-fail-rgb:184,54,43; --p-wait:#A0560C; --p-wait-rgb:160,86,12;
  --p-gold:#946112; --p-gold-rgb:176,118,24; --p-ai:#2D5BB8; --p-ai-rgb:45,91,184;
  --p-run:#2F55D4; --p-run-rgb:47,85,212;
  --p-shadow:0 1px 2px rgba(60,40,10,.06),0 12px 32px rgba(60,40,10,.12);
  --p-logo:#221C14;
}

/* ---------------------------------------------------------------- the page's ground (portal.css 292-293, 962, 974, 1032) */
/* a page ends in its own ground when pulled past either end; the first meeting (.fm) stays dark in every look */
html[data-theme]:has(.pt):not(:has(.fm)),html[data-theme]:has(.pt):not(:has(.fm)) body{background:var(--p-bg)}
/* graphite: the landing (.lp) and the front door, sign-in and sign-up (.fh, landing.css 101-105, 180, 212-213)
   sit on the graphite ground, not the night navy-black */
html[data-theme][data-tone=graphite]:is(:has(.lp),:has(.fh)),html[data-theme][data-tone=graphite]:is(:has(.lp),:has(.fh)) body{background:#0B0C0E}
html[data-theme][data-tone=graphite] :is(.lp,.fh,.fh-gl,.lp .forest-wrap,.lp .forest-wrap iframe){background:#0B0C0E}
html[data-theme][data-tone=graphite] .lp{--dark:#0B0C0E;--dark2:#161719}
html[data-theme][data-tone=graphite] .fh-shade{background:radial-gradient(90% 70% at 0% 100%,rgba(11,12,14,.78),rgba(11,12,14,.35) 45%,rgba(11,12,14,0) 70%),
  linear-gradient(180deg,rgba(11,12,14,.55),rgba(11,12,14,0) 90px)}
html[data-theme][data-tone=graphite] .fh.top .fh-shade{background:linear-gradient(0deg,rgba(11,12,14,.96) calc(var(--copy-h,60%) + var(--copy-b,24px)),rgba(11,12,14,0) calc(var(--copy-h,60%) + var(--copy-b,24px) + 90px)),
  linear-gradient(180deg,rgba(11,12,14,.7),rgba(11,12,14,0) 90px)}
/* sign-in and sign-up: the shade and the fields (portal.css 97-98, 107, 110, 123) in the graphite ground, not navy rgba(2,4,10) */
html[data-theme][data-tone=graphite] .lg-shade{background:linear-gradient(90deg,rgba(var(--p-bg-rgb),.85) 0,rgba(var(--p-bg-rgb),.5) 28%,rgba(var(--p-bg-rgb),0) 50%),linear-gradient(180deg,rgba(var(--p-bg-rgb),.55),rgba(var(--p-bg-rgb),0) 90px)}
@media (max-width:760px), (orientation:portrait){
  html[data-theme][data-tone=graphite] .lg-shade{background:linear-gradient(0deg,rgba(var(--p-bg-rgb),.97) 62%,rgba(var(--p-bg-rgb),0) 82%),linear-gradient(180deg,rgba(var(--p-bg-rgb),.55),rgba(var(--p-bg-rgb),0) 90px)}
  html[data-theme][data-tone=graphite] .fh.login:has(.lg-panel input[autocomplete=nickname]) .lg-shade{background:linear-gradient(0deg,rgba(var(--p-bg-rgb),.98) 74%,rgba(var(--p-bg-rgb),0) 90%),linear-gradient(180deg,rgba(var(--p-bg-rgb),.55),rgba(var(--p-bg-rgb),0) 90px)}
}
html[data-theme][data-tone=graphite] .lg input:not([type=checkbox]){background:rgba(var(--p-bg-rgb),.55)}
html[data-theme][data-tone=graphite] .lg-google{background:rgba(var(--p-bg-rgb),.5)}
html[data-theme][data-tone=graphite] .lg-google:hover{background:rgba(255,255,255,.06)}
/* their type in graphite's neutral greys, not night's slate (portal.css 101, 104, 113-114, 117, 121, 1064; theme-a.css 99) */
html[data-theme=dark][data-tone=graphite] :is(.lg .pt-field .k,.lg-invited,.lg-alt){color:var(--p-mut)}
html[data-theme=dark][data-tone=graphite] :is(.lg .pt-or,.lg-alt .lg-sep~a,.lg-alt .lang-menu,.lg-tools .lang-menu){color:var(--p-faint)}
/* front hero pillar text and key row (landing.css 136, 164, 174) and the sign-in Esc hint (portal.css 1039-1040): graphite greys, not slate */
html[data-theme=dark][data-tone=graphite] .fh-f span{color:var(--p-mut)}
html[data-theme=dark][data-tone=graphite] :is(.fh-keys,.lg-esc){color:var(--p-faint)}
html[data-theme=dark][data-tone=graphite] :is(.fh-keys kbd,.lg-esc kbd){border-color:var(--p-line2)}
html[data-theme=dark][data-tone=graphite] .lg .pt-or::before,html[data-theme=dark][data-tone=graphite] .lg .pt-or::after{background:var(--p-line)}
html[data-theme=dark][data-tone=graphite] :is(.lg-alt .lg-sep~a:hover,.lg-alt .lang-menu:hover,.lg-alt .lang-menu.open,.lg-tools .lang-menu:hover,.lg-tools .lang-menu.open){color:var(--p-ink)}
html[data-theme=light]:has(.lp),html[data-theme=light]:has(.lp) body{background:var(--p-bg)}
/* the empty .pt.fm is only the pause the next page rises out of: in light it is the light page, not a dark box */
html[data-theme=light]:has(.pt.fm:empty),html[data-theme=light]:has(.pt.fm:empty) body,html[data-theme=light] .pt.fm:empty{background:var(--p-bg)}
/* signing in: in light the screen sinks into the light ground */
html[data-theme=light].ais-dim::after{background:var(--p-bg)}

/* ---------------------------------------------------------------- the switch's fade, 250 ms while theme.js holds the class */
html.ais-theming,html.ais-theming *,html.ais-theming *::before,html.ais-theming *::after{transition:background-color .25s,color .25s,border-color .25s}
@media (prefers-reduced-motion:reduce){html.ais-theming,html.ais-theming *,html.ais-theming *::before,html.ais-theming *::after{transition:none}}

/* ---------------------------------------------------------------- the look switch (next/js/theme-menu.js) */
/* the pill borrows .lang-menu (portal.css) so it sits, quiets and themes with the language picker; it shows only its glyph */
.thm-menu{padding:0 9px 0 8px}
.thm-menu svg{display:block}

.thm-pop{min-width:208px;padding:6px;border:1px solid var(--p-line2);border-radius:12px;background:var(--p-raise);color:var(--p-ink);
  box-shadow:var(--p-shadow);font-size:13px;animation:lang-in .14s ease-out}
.thm-opt{display:flex;align-items:center;gap:10px;width:100%;height:34px;padding:0 10px;border:0;border-radius:8px;background:transparent;
  color:var(--p-ink2);font:inherit;text-align:left;cursor:pointer;outline:none;transition:background .15s,color .15s}
.thm-opt span{flex:1}
.thm-opt svg{color:var(--p-mut);flex-shrink:0}
.thm-opt:hover,.thm-opt:focus-visible{background:var(--p-hover);color:var(--p-ink)}
/* the chosen mode reads as a soft fill + check (like the account card), never a ring; the row focused on open
   shows no UA ring, and a keyboard focus gets a quiet inset accent ring at .5 alpha */
.thm-opt.on{color:var(--p-ink);background:rgba(var(--p-acc-rgb),.1)} .thm-opt.on svg{color:var(--p-acc)}
.thm-pop .thm-opt:focus,.thm-pop .thm-opt:focus:not(:focus-visible){outline:none}
.thm-pop .thm-opt:focus-visible{outline:none;box-shadow:inset 0 0 0 2px rgba(var(--p-acc-rgb),.5)}
.thm-pop .thm-opt.on:hover{background:rgba(var(--p-acc-rgb),.14)}
.thm-opt b{font-weight:500;font-size:12px;color:var(--p-acc)}
.thm-pop hr{border:0;border-top:1px solid var(--p-line);margin:6px 4px}
.thm-sws{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.thm-pop .thm-sws{padding:6px 10px 4px}
.thm-sw{position:relative;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:var(--sw);cursor:pointer;flex-shrink:0;
  box-shadow:inset 0 0 0 1px rgba(var(--p-ink-rgb),.14);transition:box-shadow .15s,transform .15s}
.thm-sw:hover{transform:scale(1.1)}
.thm-sw.on{box-shadow:0 0 0 2px var(--p-raise),0 0 0 3.5px var(--sw)}
.thm-card .thm-sw.on{box-shadow:0 0 0 2px var(--p-bg),0 0 0 3.5px var(--sw)}
html[data-theme=light] .thm-card .thm-sw.on{box-shadow:0 0 0 2px var(--p-card),0 0 0 3.5px var(--sw)}
.thm-custom:focus-within{box-shadow:0 0 0 2px var(--p-bg),0 0 0 4px var(--p-acc)}
.thm-sw:focus-visible{outline:none;box-shadow:0 0 0 2px var(--p-raise),0 0 0 4px var(--p-acc)}
.thm-more{display:block;padding:8px 10px 4px;font-size:12.5px;color:var(--p-mut)!important}
.thm-more:hover{color:var(--p-ink)!important}

/* account menu row: 外观 and three glyphs */
.acc-look{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 6px 2px 0}
.acc-pop .acc-look .acc-look-k{flex:1}
.thm-mini{display:inline-flex;gap:2px;padding:2px;border:1px solid var(--p-line2);border-radius:999px}
.acc-pop .thm-mini button,.thm-mini button{display:grid;place-items:center;width:28px;height:24px;padding:0;border:0;border-radius:999px;
  background:transparent;color:var(--p-mut);cursor:pointer;transition:background .15s,color .15s}
.acc-pop .thm-mini button:hover,.thm-mini button:hover{background:var(--p-hover);color:var(--p-ink)}
.acc-pop .thm-mini button.on,.thm-mini button.on{background:rgba(var(--p-acc-rgb),.16);color:var(--p-ink)}

/* the account page's card */
#look{scroll-margin-top:76px}
.thm-card .thm-row .k{align-self:flex-start;padding-top:6px}
.thm-card .thm-row .v{display:flex;flex-wrap:wrap;align-items:center;gap:12px;white-space:normal;overflow:visible}
.thm-card .pt-seg{margin:0}
.thm-card .pt-seg button{display:inline-flex;align-items:center;gap:7px}
.thm-tile{display:flex;flex-direction:column;width:120px;padding:0;border:1px solid var(--p-line2);border-radius:10px;background:var(--p-card);
  overflow:hidden;cursor:pointer;text-align:left;font:inherit;transition:border-color .15s,box-shadow .15s}
.thm-tile:hover{border-color:rgba(var(--p-acc-rgb),.5)}
.thm-tile.on{border-color:var(--p-acc);box-shadow:0 0 0 3px rgba(var(--p-acc-rgb),.16)}
.thm-tile:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(var(--p-acc-rgb),.3)}
.thm-tile i{position:relative;display:block;height:60px;background:var(--tb);border-bottom:1px solid var(--p-line);overflow:hidden}
.thm-tile s{position:absolute;left:14px;top:14px;right:-1px;bottom:-1px;background:var(--tc);border:1px solid var(--tl);border-radius:6px 0 0 0}
.thm-tile u{position:absolute;left:24px;top:24px;width:44px;height:4px;border-radius:2px;background:var(--ti)}
.thm-tile u+u{top:33px;width:62px;background:var(--tm)}
.thm-tile b{position:absolute;left:24px;top:43px;width:26px;height:7px;border-radius:4px;background:var(--ta)}
.thm-tile span{padding:7px 10px;font-size:12.5px;color:var(--p-mut)}
.thm-tile.on span{color:var(--p-ink)}
.thm-custom{display:inline-block;overflow:hidden;background:conic-gradient(from 90deg,#E5484D,#F5A524,#3DB86B,#20A4C4,#4E6CF0,#9B59E0,#E5484D)}
/* the own colour in use shows as its own ringed swatch (theme-menu.js Swatches); the picker stays the rainbow */
.thm-own{cursor:default}
.thm-own:hover{transform:none}
.thm-custom input{position:absolute;inset:-6px;width:calc(100% + 12px);height:calc(100% + 12px);opacity:0;cursor:pointer;border:0;padding:0}
.thm-card .thm-reset{height:28px}
@media (max-width:600px){.thm-card .thm-row{flex-wrap:wrap}.thm-card .thm-row .k{width:100%;padding-top:0}.thm-tile{width:calc(50% - 6px)}}
