/* 登录、注册、团队、积分：顶栏右上角（积分胶囊 + 头像）、认证页、我的账户、团队页、我的积分、充值、首页空间标签、只读横幅。
   颜色只用 tokens.css 的变量，明暗两套自动跟着变；窄屏（< 760px）单列。 */

/* ───────── 小件 ───────── */
.tone-warn { color: var(--warn); }
.tone-bad { color: var(--bad); }
.form-err, .form-msg { font-size: var(--fs-sm); line-height: 1.6; color: var(--bad); padding: 8px 12px; border-radius: var(--r-sm); background: var(--bad-bg); margin: 4px 0 8px; overflow-wrap: anywhere; }
.form-msg:not(.is-bad) { color: var(--ok); background: var(--ok-bg); }
.field-hint--err { color: var(--bad); }
.field-hint--err.is-ok { color: var(--ok); }
.linkbtn { color: var(--accent); font-size: var(--fs-sm); padding: 4px 0; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.badge-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.select--sm { min-height: 28px; font-size: var(--fs-sm); padding-left: 8px; width: auto; min-width: 104px; }
.hide-s { }
.consq { margin: 8px 0 12px; padding-left: 20px; list-style: disc; color: var(--ink-2); line-height: 1.8; }
.consq li::marker { color: var(--muted); }

.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; font: 600 var(--fs-md)/1 var(--font-ui);
  background: color-mix(in srgb, var(--nc, var(--accent)) 16%, var(--panel)); color: var(--nc, var(--accent)); border: 1px solid color-mix(in srgb, var(--nc, var(--accent)) 30%, var(--line)); }
.avatar--lg { width: 44px; height: 44px; font-size: var(--fs-xl); }

/* ───────── 顶栏右上角：积分胶囊 + 头像 ───────── */
.acct { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.credit-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 10px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.credit-chip:hover { background: var(--hover-2); border-color: var(--muted); }
.credit-chip .ic { font-size: 16px; color: var(--accent); }
.credit-chip__n { font-weight: 600; color: var(--ink); }
.credit-chip.is-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.credit-chip.is-warn .ic, .credit-chip.is-warn .credit-chip__n { color: var(--warn); }
.credit-chip.is-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.credit-chip.is-bad .ic, .credit-chip.is-bad .credit-chip__n { color: var(--bad); }
.avatar-btn { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font: 600 var(--fs-md)/1 var(--font-ui); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); transition: box-shadow var(--t-fast) var(--ease); }
.avatar-btn:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar__dot { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid var(--panel); }
.credit-pop { width: 280px; }
.cc { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.cc__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cc__k { color: var(--note); font-size: var(--fs-sm); }
.cc__v { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.cc__v small { font-size: var(--fs-xs); font-weight: 400; color: var(--note); }
.cc__where { font-size: var(--fs-xs); color: var(--note); }
.cc__foot { display: flex; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.cc__foot .btn { flex: 1; text-decoration: none; }
.acct-menu { min-width: 232px; }
.acct-menu__head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 8px; }
.acct-menu__who { display: flex; flex-direction: column; min-width: 0; }
.acct-menu__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu__who span { color: var(--note); font-size: var(--fs-xs); }
.acct-menu .menu__item { height: 34px; }
.acct-menu .menu__t { flex: 1; }

/* 「积分不够」窗 */
.lc__text { line-height: 1.7; color: var(--ink-2); }
.lc__rows { margin: 14px 0 4px; padding: 12px 16px; border-radius: var(--r-md); background: var(--hover); display: flex; flex-direction: column; gap: 8px; }
.lc__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lc__k { color: var(--note); font-size: var(--fs-sm); }
.lc__v { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.lc__v small { font-size: var(--fs-xs); font-weight: 400; color: var(--note); }
.lc__hint { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-soft); border: 1px solid var(--warn-line); font-size: var(--fs-sm); }

/* ───────── 认证页（登录、注册、重置、邀请） ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) minmax(360px, 6fr); background: var(--bg); }
.auth__intro { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 32px; background: var(--paper); border-right: 1px solid var(--line); }
.auth__intro .brand { align-self: flex-start; }
.auth__slogan { font: 600 clamp(28px, 3.4vw, 40px)/1.3 var(--font-read); letter-spacing: .02em; max-width: 14em; }
.auth__points { display: flex; flex-direction: column; gap: 18px; max-width: 28em; }
.auth__points li { display: flex; gap: 14px; align-items: flex-start; }
.auth__points .ic { margin-top: 3px; color: var(--accent); font-size: 20px; }
.auth__points b { display: block; font-weight: 600; }
.auth__points span:not(.ic) { color: var(--note); font-size: var(--fs-sm); }
.auth__panel { display: grid; place-items: center; padding: 32px 24px; }
.auth__card { width: 100%; max-width: 400px; padding: 32px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-2); }
.auth__title { font: 600 var(--fs-2xl)/1.3 var(--font-read); }
.auth__sub { margin: 6px 0 20px; color: var(--note); }
.auth__submit { width: 100%; margin-top: 4px; text-decoration: none; }
.auth__submit:hover { text-decoration: none; }
.auth__remember { margin: 0 0 12px; }
.auth__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: var(--fs-sm); color: var(--note); }
.auth__forgot { margin-top: 16px; }
.auth__btns { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth__alt { display: block; margin-top: 14px; text-align: center; font-size: var(--fs-sm); color: var(--note); }
.pw { position: relative; }
.pw .input { padding-right: 40px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--note); }
.pw-eye:hover { background: var(--hover-2); color: var(--ink); }
.pw-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: var(--fs-xs); color: var(--note); }
.pw-checks li { display: inline-flex; align-items: center; gap: 4px; }
.pw-checks li.is-ok { color: var(--ok); }
.pw-checks li.is-bad { color: var(--bad); }

/* ───────── 我的账户 ───────── */
.acc-card__sub { margin: -4px 0 12px; font-size: var(--fs-sm); }
.acc-who { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dev-list { display: flex; flex-direction: column; }
.dev { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev > .ic { color: var(--note); }
.dev__main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.acc-danger { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad-bg) 40%, var(--panel)); }
.acc-danger .sec-title { color: var(--bad); }
.acc-list { margin: 4px 0 16px; padding-left: 20px; list-style: disc; color: var(--ink-2); line-height: 1.8; }

/* ───────── 我的积分、充值 ───────── */
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wcard { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.wcard--flat { box-shadow: none; flex: 1; }
.wcard.tone-warn { background: var(--warn-bg); border-color: var(--warn-line); color: inherit; }
.wcard.tone-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: inherit; }
.wcard__k { display: flex; align-items: center; gap: 8px; color: var(--note); font-size: var(--fs-sm); }
.wcard__v { font: 600 32px/1.2 var(--font-read); font-variant-numeric: tabular-nums; }
.wcard.tone-warn .wcard__v { color: var(--warn); }
.wcard.tone-bad .wcard__v { color: var(--bad); }
.wcard__v small { font: 400 var(--fs-sm)/1 var(--font-ui); color: var(--note); }
.wcard__warn { font-size: var(--fs-sm); color: var(--ink-2); }
.wcard__foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.wcard__foot .btn { text-decoration: none; }
.credits__bar { margin-bottom: 4px; }
.credits__bar .select { width: auto; min-width: 140px; }
.credits__month { width: 150px; }
.credits__note { margin: 4px 0 12px; }

.recharge { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.recharge__text { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.recharge__qr { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.recharge__qr img { width: 220px; max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; padding: 8px; }
.recharge__targets { display: flex; flex-direction: column; gap: 8px; }
.rtarget { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--panel);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.rtarget:hover { border-color: var(--line-2); }
.rtarget.is-on { border-color: var(--accent); background: var(--accent-soft); }
.rtarget__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rtarget__main small { color: var(--note); }
.rtarget__check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.rtarget.is-on .rtarget__check { opacity: 1; }
.recharge__code { font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; min-height: 44px; font-size: var(--fs-lg); }
.recharge__code::placeholder { text-transform: none; letter-spacing: 0; }

/* 流水 */
.ledger__list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--panel); }
.ledger__list[aria-busy="true"] { opacity: .6; }
.ledger__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; color: var(--note); text-align: center; }
.ledger__empty .ic { color: var(--muted); margin-bottom: 4px; }
.ledger__empty b { color: var(--ink-2); font-weight: 500; }
.ledger__pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.lrow { border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow__head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; transition: background var(--t-fast) var(--ease); }
button.lrow__head:hover { background: var(--hover); }
.lrow__head.is-static { cursor: default; }
.lrow__head > .ic { color: var(--muted); transition: transform var(--t-fast) var(--ease); }
.lrow__head[aria-expanded="true"] > .ic { transform: rotate(90deg); }
.lrow__ic { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--hover-2); color: var(--note); flex: none; }
.lrow__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lrow__title { font-weight: 500; overflow-wrap: anywhere; }
.lrow__meta { color: var(--note); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.lrow__calls { color: var(--note); font-size: var(--fs-sm); white-space: nowrap; }
.lrow__amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 84px; text-align: right; }
.lrow__amt small { font-weight: 400; color: var(--note); }
.lrow__amt.is-in { color: var(--ok); }
.lrow__amt.is-free { color: var(--note); text-decoration: line-through; text-decoration-color: var(--line-2); }
.lrow__who { color: var(--note); font-size: var(--fs-xs); white-space: nowrap; }
.lrow__bal { color: var(--note); font-size: var(--fs-xs); white-space: nowrap; }
.lrow__detail { padding: 0 16px 14px 44px; }
.tbl--calls { font-size: var(--fs-sm); }
.tbl--calls td, .tbl--calls th { padding: 6px 10px; }
.tbl--calls tr.is-failed td { color: var(--note); }

/* ───────── 团队 ───────── */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tgrid__empty { grid-column: 1 / -1; }
.tcard { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; color: var(--ink); text-decoration: none; }
.tcard:hover { text-decoration: none; }
.tcard__top { display: flex; align-items: center; gap: 12px; }
.tcard__name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tcard__name h3 { font: 600 var(--fs-xl)/1.3 var(--font-read); overflow-wrap: anywhere; }
.tcard__meta { display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-size: var(--fs-sm); }
.tcard__meta span { display: inline-flex; align-items: center; gap: 6px; }
.tcard__bal.tone-warn { color: var(--warn); } .tcard__bal.tone-bad { color: var(--bad); }
.tinv .sec-title { gap: 10px; align-items: center; }
.tinv__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tinv__row > .ic { color: var(--accent); }
.tinv__main { flex: 1; min-width: 200px; }

.team-page { gap: 20px; }
.team-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.team-head__main { display: flex; align-items: center; gap: 14px; }
.team-head__main .avatar { width: 48px; height: 48px; font-size: var(--fs-xl); }
.team-head__sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; color: var(--note); font-size: var(--fs-md); white-space: nowrap; border-radius: var(--r-sm) var(--r-sm) 0 0; transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.tab:hover { color: var(--ink); background: var(--hover); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 500; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 1px; }
.tab__n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.team-body { display: flex; flex-direction: column; gap: 16px; }
.team-body > .card { box-shadow: var(--sh-1); }

.tbl--members td { vertical-align: middle; }
.tbl--members tr.is-off { opacity: .6; }
.mcell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mcell__t { display: flex; flex-direction: column; min-width: 0; }
.mcell__t b { font-weight: 500; overflow-wrap: anywhere; }
.mcell__u { display: none; font-size: var(--fs-xs); color: var(--note); }
.usage { font-variant-numeric: tabular-nums; }
.usage.is-over { color: var(--bad); font-weight: 500; }
.inv-url { font-family: var(--font-mono); font-size: var(--fs-sm); }
.inv-user .input { flex: 1 1 200px; width: auto; }
.inv-user .select { width: auto; min-width: 110px; }
.inv-more { margin-top: 16px; padding: 16px 16px 0; border-radius: var(--r-md); background: var(--hover); }
.team-bal { display: flex; align-items: stretch; gap: 16px; flex-wrap: wrap; }
.team-bal__side { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.team-bal__used { font: 600 var(--fs-xl)/1.3 var(--font-read); font-variant-numeric: tabular-nums; }
.team-bal__used small { font: 400 var(--fs-sm)/1 var(--font-ui); color: var(--note); }

/* ───────── 首页：空间标签、卡片上的空间和建的人、引导卡 ───────── */
.spacetabs { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.stab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: var(--fs-md); white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.stab:hover { background: var(--hover-2); border-color: var(--muted); }
.stab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.stab__r { font-size: var(--fs-xs); opacity: .8; }
.stab--add { border-style: dashed; color: var(--note); background: transparent; }
.stab--add:hover { color: var(--accent); border-color: var(--accent); }
.pcard__by { margin-top: 8px; font-size: var(--fs-xs); color: var(--note); }
.onboard { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.onboard > .ic { color: var(--accent); }
.onboard__t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-sm); color: var(--ink-2); }
.onboard__t b { color: var(--ink); font-size: var(--fs-md); }
.wstep__where { margin-top: 28px; max-width: 520px; }
p.wstep__where { display: flex; align-items: center; gap: 8px; color: var(--note); }

/* ───────── 工作台：剧名旁的空间标签、只读横幅 ───────── */
.wstop__space { flex: 0 1 auto; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 20px; }
.wstop .wstop__title { min-width: 6em; }
.robar { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 1040px; margin: 0 auto 12px; padding: 8px 14px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink-2); font-size: var(--fs-sm); }
.robar .ic { color: var(--warn); flex: none; }
.center:has(> .paper--bare) > .robar { margin: 12px auto; width: calc(100% - 24px); }
.is-readonly [data-ai], .is-readonly [data-ro] { opacity: .45; pointer-events: none; filter: saturate(.6); }
.is-readonly textarea[data-ro] { opacity: 1; pointer-events: auto; filter: none; cursor: default; }
.chat-readonly { padding: 12px 14px; border-radius: var(--r-md); background: var(--hover); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; text-align: center; }

/* ───────── 窄屏 ───────── */
@media (max-width: 899px) {
  .credit-chip__k { display: none; }
}
@media (max-width: 759px) {
  .auth { grid-template-columns: 1fr; }
  .auth__intro { padding: 24px 20px 20px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth__slogan { font-size: 24px; }
  .auth__points { display: none; }
  .auth__panel { padding: 20px 16px 40px; align-items: start; }
  .auth__card { padding: 24px 20px; box-shadow: var(--sh-1); }
  .recharge { grid-template-columns: 1fr; }
  .hide-s { display: none; }
  .mcell__u { display: block; }
  .lrow__head { flex-wrap: wrap; row-gap: 4px; }
  .lrow__calls, .lrow__bal { order: 5; }
  .lrow__detail { padding-left: 16px; }
  .acct { order: 4; gap: 6px; }
  .credit-chip { padding: 0 10px 0 8px; }
  .team-head__main .avatar { width: 40px; height: 40px; }
  .tab { padding: 0 12px; }
  .onboard { flex-wrap: wrap; }
  .credit-pop { width: min(280px, calc(100vw - 16px)); }
}
.est-line { margin-top: 4px; }
.pal__item.is-disabled { opacity: .45; cursor: not-allowed; }
.pal__item.is-disabled .pal__hint { color: var(--warn); opacity: 1; }
