/* Busly-specific pieces on top of the base design system (app.css). */
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--text-3); }

/* white-label site identity and agent lists */
.logo img { object-fit: contain; }
.agent-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agent-brand-logo { width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: var(--radius); }
.agent-brand-logo.sm { width: 28px; height: 28px; }

/* subscription cards */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .acct-grid { grid-template-columns: 1fr; } }
.acct .card-title h2 { word-break: break-all; }
.acct-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.quota { display: flex; flex-direction: column; gap: 6px; }
.quota + .quota { margin-top: 14px; }
.quota-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.quota-head strong { font-size: 13px; font-weight: 600; }
.quota .meter { height: 6px; }
.meter.is-mid > span { background: var(--warning); }
.meter.is-high > span { background: var(--danger); }
.meter.is-low > span { background: var(--success); }
.section-sep { border-top: 1px solid var(--border); margin: 16px -20px 14px; }
.reset-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.reset-count { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.reset-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.reset-list li { display: flex; justify-content: space-between; gap: 8px; }
.spark { display: flex; gap: 2px; align-items: flex-end; height: 34px; }
.spark i { flex: 1; min-height: 2px; border-radius: 2px; background: var(--surface-active); }
.spark i.has { background: var(--accent); opacity: .55; }
.spark i.fail { background: var(--danger); opacity: .7; }
.spark-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.acct .kv { font-size: 13px; }

/* overview subscription panel */
.sub-panel .balance-value { display: flex; align-items: baseline; gap: 6px; }
.sub-panel .balance-value small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.sub-email { font-size: 13px; color: var(--text-2); word-break: break-all; }

/* model chips */
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.model-chip { font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.model-chip:hover { border-color: var(--border-strong); color: var(--text); }

/* auth */
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.code-row .input:not(:placeholder-shown) { letter-spacing: .2em; }
.code-row .btn { flex: none; min-width: 112px; height: 40px; }

/* market */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.market-card .card-body { display: flex; flex-direction: column; }
.market-price { display: flex; align-items: baseline; gap: 6px; margin: 16px 0 10px; }
.market-price .num { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.market-price small { color: var(--text-3); font-size: 13px; }
.market-card .btn-block { margin-top: auto; }
.rent-box .kv { font-size: 13px; }
/* plan cards (brand logo = inline svg in currentColor, so it follows light / dark) */
.plan-logo { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.plan-logo svg { width: 22px; height: 22px; fill: currentColor; }
.plan-logo.brand-claude { color: #d97757; }
.plan-logo.sm { width: 28px; height: 28px; }
.plan-logo.sm svg { width: 16px; height: 16px; }
.plan-name { font-weight: 600; font-size: 15px; }
.plan-cell { display: flex; align-items: center; gap: 10px; }
.slots { font-size: 12.5px; color: var(--text-3); }
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.order-card .kv { font-size: 13px; }

.pay-method:disabled { opacity: .5; cursor: not-allowed; }

/* misc */
.status-cell { display: flex; align-items: center; gap: 6px; }
.table .mono { font-size: 12.5px; }
.inline-select { width: auto; min-width: 170px; height: 30px; }
.max-input { width: 64px; height: 30px; }
.page-tabs { margin-bottom: 14px; }
.side-badge { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* notifications */
.ntf-grid { display: flex; flex-direction: column; }
.ntf-row { display: grid; grid-template-columns: 1fr 88px 88px; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.ntf-row > span { display: flex; justify-content: center; }
.ntf-headrow { padding: 0 0 10px; border-top: 0; font-size: 12.5px; color: var(--text-3); }
.ntf-headrow > span:first-child { justify-content: flex-start; }
.ntf-title { font-size: 13.5px; font-weight: 500; }
.ntf-desc { font-size: 12.5px; margin-top: 2px; }
.ntf-line { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
@media (max-width: 560px) { .ntf-row { grid-template-columns: 1fr 64px 72px; } }

/* ---------- i18n: wallet custom amount prefix ---------- */
.amt-prefix { position: absolute; inset-inline-start: 10px; font-size: 13px; }
.input-group > .input.amt-input { padding-left: 22px; }
[dir='rtl'] .input-group > .input.amt-input { padding-left: 12px; padding-right: 22px; }

/* ---------- RTL (Persian) ---------- */
[dir='rtl'] .rtl-flip { transform: scaleX(-1); }
[dir='rtl'] .input-group > .icon { left: auto; right: 10px; }
[dir='rtl'] .input-group > .input { padding-left: 12px; padding-right: 32px; }
[dir='rtl'] .input-group > .input-suffix { right: auto; left: 4px; }
[dir='rtl'] .select { padding-right: 12px; padding-left: 28px; background-position: left 8px center; }
[dir='rtl'] .switch::after { left: auto; right: 2px; }
[dir='rtl'] .switch[aria-checked='true']::after { transform: translateX(-14px); }
[dir='rtl'] .table th, [dir='rtl'] .menu-item, [dir='rtl'] .copy-row,
[dir='rtl'] .amount-opt, [dir='rtl'] .pay-method { text-align: right; }
[dir='rtl'] .table .right { text-align: left; }
[dir='rtl'] .menu { right: auto; left: 0; }
[dir='rtl'] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir='rtl'] .side-link .side-ext, [dir='rtl'] .side-badge { margin-left: 0; margin-right: auto; }
[dir='rtl'] .notice-md ol { padding-left: 0; padding-right: 20px; }
[dir='rtl'] .notice-md blockquote { padding-left: 0; padding-right: 10px; border-left: none; border-right: 3px solid var(--border); }
[dir='rtl'] .topbar-nav { margin-right: 0; margin-left: 6px; }
@media (max-width: 860px) {
  [dir='rtl'] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  [dir='rtl'] .sidebar.is-open { transform: none; }
}
[dir='rtl'] .mono, [dir='rtl'] .num { unicode-bidi: isolate; }
/* Arabic script is cursive: letter-spacing breaks the joins */
html[lang='fa'] body, html[lang='fa'] body * { letter-spacing: normal !important; }
html[lang='fa'] .code-row .input:not(:placeholder-shown) { letter-spacing: .2em !important; }
html[lang='fa'] { --font-sans: 'Inter Variable', Vazirmatn, Tahoma, 'Segoe UI', 'Geeza Pro', 'Noto Sans Arabic', system-ui, sans-serif; }
.plan-feats { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.plan-feats li { display: flex; align-items: flex-start; gap: 8px; }
.plan-feats li .icon { flex: none; margin-top: 2px; color: var(--success); }
/* market as a list */
.plan-list { overflow: hidden; }
.plan-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); }
.plan-feats-inline { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 12.5px; }
.plan-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 120px; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.plan-list-head + .plan-row { border-top: 0; }
.plan-row:hover { background: var(--surface-hover, var(--surface-2)); }
.plan-note { font-size: 12.5px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; justify-content: flex-end; }
.plan-price .num { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.plan-price small { color: var(--text-3); font-size: 12.5px; }
.plan-buy { justify-self: end; min-width: 104px; }
@media (max-width: 640px) {
  .plan-row { grid-template-columns: minmax(0, 1fr) auto; }
  .plan-row .plan-buy { grid-column: 1 / -1; justify-self: stretch; }
}
/* Cloudflare Turnstile + legal pages */
.turnstile { margin-top: 14px; min-height: 0; }
.turnstile:empty { margin-top: 0; }
.legal-wrap { max-width: 780px; margin: 24px auto 48px; padding: 0 16px; width: 100%; }
.legal-md { line-height: 1.75; font-size: 14px; color: var(--text-2); }
.legal-md h1 { font-size: 22px; color: var(--text); margin: 0 0 8px; }
.legal-md h2 { font-size: 16px; color: var(--text); margin: 24px 0 8px; }
.legal-md ul { padding-inline-start: 20px; margin: 8px 0; }
.legal-md hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.legal-md p { margin: 8px 0; }

/* ---------------------------------------------------------------- landing page (/) */
.landing { min-height: 100vh; background: var(--bg); color: var(--text); }
.landing a:not(.btn):not(.logo) { color: inherit; text-decoration: none; }
.landing-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.landing-narrow { max-width: 760px; }
.landing-nav { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.landing-nav-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.landing-nav .row { gap: 6px; }
.landing-links { display: flex; gap: 28px; font-size: 13.5px; color: var(--text-2); }
.landing-links a:hover { color: var(--text); }

.landing-hero { position: relative; overflow: hidden; padding: 96px 0 88px; border-bottom: 1px solid var(--border); }
.landing-grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%); }
.landing-orbs { position: absolute; inset: 0; pointer-events: none; }
.landing-orbs i { position: absolute; border-radius: 50%; filter: blur(70px); animation: landing-float 18s var(--ease) infinite alternate; }
.landing-orbs i:nth-child(1) { width: 460px; height: 460px; left: 50%; top: -220px; margin-left: -330px; background: var(--hero-orb-1); }
.landing-orbs i:nth-child(2) { width: 380px; height: 380px; left: 50%; top: -120px; margin-left: 40px; background: var(--hero-orb-2); animation-delay: -6s; }
.landing-orbs i:nth-child(3) { width: 560px; height: 300px; left: 50%; top: 260px; margin-left: -280px; background: var(--hero-orb-3); animation-delay: -12s; }
@keyframes landing-float { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(30px, 24px, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .landing-orbs i { animation: none; } }
.landing-hero-in { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.landing-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); font-size: 12.5px; color: var(--text-2); box-shadow: var(--shadow-sm); }
.landing-pill .icon { color: var(--accent); }
.landing-hero h1 { margin: 22px 0 0; font-size: clamp(32px, 5.6vw, 56px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 650; }
.landing-accent { background: linear-gradient(100deg, var(--accent) 10%, #e9a27f 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-lead { margin: 20px 0 0; max-width: 620px; font-size: 16.5px; line-height: 1.65; color: var(--text-2); }
.landing-cta { display: flex; gap: 10px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }
.landing-cta .btn, .landing-final .btn { gap: 6px; }
.landing-code { width: 100%; max-width: 640px; margin-top: 56px; text-align: start; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.landing-code-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.landing-code-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.landing-code-bar span { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }
.landing-code pre { margin: 0; padding: 16px 18px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--text); overflow-x: auto; white-space: pre; }
.landing-code .c { color: var(--accent); user-select: none; }
.landing-code .s { color: var(--success); }

.landing-sec { padding: 88px 0; }
.landing-sec-alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-head { text-align: center; margin-bottom: 44px; }
.landing-head h2 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.025em; font-weight: 650; }
.landing-head p { margin: 10px 0 0; color: var(--text-2); font-size: 15px; }
.landing-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.landing-feat { background: var(--surface); padding: 26px 24px; }
.landing-feat-wide { grid-column: 1 / -1; }
.landing-feat h3 { margin: 14px 0 6px; font-size: 15px; font-weight: 600; }
.landing-feat p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.65; }
.landing-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }

.landing-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.landing-brand h3 { margin: 0; font-size: 16px; font-weight: 600; }
.landing-brand ~ .landing-brand { margin-top: 36px; }
.landing-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.landing-plan { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.landing-plan:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.landing-plan-name { font-weight: 600; font-size: 14.5px; }
.landing-plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 14px 0 6px; }
.landing-plan-price .num { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.landing-plan-price small { white-space: nowrap; color: var(--text-3); font-size: 12.5px; }
.landing-plan-note { margin: 0 0 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.55; flex: 1; }

.landing-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.landing-steps li { position: relative; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.landing-step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-size: 13px; font-weight: 600; }
.landing-steps h3 { margin: 14px 0 6px; font-size: 15px; font-weight: 600; }
.landing-steps p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

.landing-faq { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.landing-faq details + details { border-top: 1px solid var(--border); }
.landing-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; font-weight: 550; font-size: 14.5px; }
.landing-faq summary::-webkit-details-marker { display: none; }
.landing-faq summary:hover { background: var(--surface-hover); }
.landing-faq summary .icon { flex: none; color: var(--text-3); transition: transform var(--dur) var(--ease); }
.landing-faq details[open] summary .icon { transform: rotate(45deg); }
.landing-faq details p { margin: 0; padding: 0 22px 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }

.landing-final { text-align: center; padding: 56px 24px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); background-image: var(--glow); }
.landing-final h2 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.025em; font-weight: 650; }
.landing-final p { margin: 10px 0 26px; color: var(--text-2); }

.landing-foot { border-top: 1px solid var(--border); padding: 28px 0 36px; font-size: 13px; color: var(--text-3); }
.landing-foot-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.landing-foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.landing-foot-links a:hover { color: var(--text); }

@media (max-width: 900px) {
  .landing-feats { grid-template-columns: repeat(2, 1fr); }
  .landing-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .landing-wrap { padding: 0 16px; }
  .landing-hero { padding: 64px 0 56px; }
  .landing-lead { font-size: 15px; }
  .landing-code { margin-top: 40px; }
  .landing-code pre { font-size: 11.5px; padding: 14px; }
  .landing-sec { padding: 60px 0; }
  .landing-head { margin-bottom: 32px; }
  .landing-feats { grid-template-columns: 1fr; }
  .landing-plans { grid-template-columns: 1fr 1fr; gap: 10px; }
  .landing-plan { padding: 16px; }
  .landing-plan-price .num { font-size: 22px; }
  .landing-nav .lang-btn span { display: none; }
}
@media (max-width: 380px) { .landing-plans { grid-template-columns: 1fr; } }

/* ---------- 站内公告：铃铛、弹窗、时间线、后台编辑 ---------- */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 2px; inset-inline-end: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; pointer-events: none; }
.bell-count[hidden] { display: none; }
.notice-tabs { display: flex; width: 100%; margin-bottom: 12px; }
.notice-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.notice-tabs .badge { padding: 0 6px; min-height: 16px; font-size: 10.5px; }
.notice-body { max-height: min(52vh, 28rem); overflow: auto; padding-inline-end: 4px; }
.md-rich { font-size: 13.5px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.md-rich > :first-child { margin-top: 0; }
.md-rich > :last-child { margin-bottom: 0; }
.md-rich p { margin: 0 0 8px; }
.md-rich h1, .md-rich h2, .md-rich h3 { margin: 14px 0 6px; line-height: 1.35; }
.md-rich h1 { font-size: 18px; } .md-rich h2 { font-size: 16px; } .md-rich h3 { font-size: 14.5px; }
.md-rich ul, .md-rich ol { margin: 6px 0 8px; padding-inline-start: 20px; }
.md-rich li + li { margin-top: 2px; }
.md-rich hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.md-rich code { font-family: var(--font-mono); font-size: 0.9em; padding: 1px 5px; border-radius: var(--radius-xs); background: var(--bg-subtle); border: 1px solid var(--border); }
.md-rich blockquote { margin: 6px 0 8px; padding: 2px 12px; border-inline-start: 3px solid var(--border-strong); color: var(--text-2); }
.ann-list { display: flex; flex-direction: column; }
.ann-item { display: flex; gap: 12px; padding: 12px 0; }
.ann-item + .ann-item { border-top: 1px solid var(--border); }
.ann-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ann-extra { font-size: 12.5px; color: var(--text-2); }
.ann-time { font-size: 12px; color: var(--text-3); }
.ann-dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--text-3); }
.badge .ann-dot, .modal-head .ann-dot { margin-top: 0; vertical-align: middle; }
.ann-ongoing { background: var(--info); }
.ann-success { background: var(--success); }
.ann-warning { background: var(--warning); }
.ann-error { background: var(--danger); }
.ann-rows { display: flex; flex-direction: column; padding: 0 0 6px; }
.ann-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 20px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ann-row + .ann-row { border-top: 1px solid var(--border); }
.ann-row:hover { background: var(--surface-hover); }
.ann-row .ann-dot { margin-top: 0; }
.ann-row-text { flex: 1; min-width: 0; font-size: 13.5px; }
.ann-row-time { flex-shrink: 0; font-size: 12px; color: var(--text-3); }
.ann-cell { font-size: 13px; max-height: 7.5em; overflow: hidden; }
.notice-editor { min-height: 220px; font-size: 13px; line-height: 1.6; resize: vertical; }
.notice-preview { min-height: 220px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.popup-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.popup-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.popup-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.popup-opt input { margin-top: 3px; accent-color: var(--accent); }
.popup-opt strong { display: block; font-size: 13px; font-weight: 550; }
.popup-opt small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); line-height: 1.5; }
@media (max-width: 760px) { .popup-opts { grid-template-columns: 1fr; } }

/* 提现弹窗 / 热钱包 */
.wd-balance { background: var(--bg-subtle); border-radius: var(--radius-lg); padding: 16px 18px; }
.wd-balance .num { font-size: 28px; font-weight: 650; margin-top: 4px; }
.wd-nets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wd-net { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; text-align: start; font: inherit; color: inherit; }
.wd-net span { display: flex; flex-direction: column; line-height: 1.3; }
.wd-net small { color: var(--text-muted, #6b6b73); font-size: 12px; }
.wd-net.is-sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.wd-addr { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; }
.wd-addr .mono { flex: 1; font-size: 12.5px; word-break: break-all; }
.wd-addr.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.wd-hots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.wd-hot { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* 手机顶栏：390px 宽时头像被挤出屏幕，收紧间距、语言按钮只留图标 */
@media (max-width: 480px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-left { gap: 4px; min-width: 0; }
  .topbar-right { gap: 2px; flex-shrink: 0; }
  .topbar .lang-btn span { display: none; }
  .topbar .balance-chip { padding: 0 8px; }
}
/* iOS Safari 输入框字号小于 16px 时聚焦会自动放大页面 */
@media (max-width: 640px) { .input, .select, .textarea, .input-lg { font-size: 16px; } }
@media (max-width: 360px) { .topbar .balance-chip .icon, .topbar .logo span { display: none; } }
/* 公告页 Telegram 推送的勾选框跟主题色 */
#tp-btn, #tp-ann { accent-color: var(--accent); width: 16px; height: 16px; }

/* ------------------------------------------------------------ 工单 */
.side-badge { margin-inline-start: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.side-badge[hidden] { display: none; }
.tk-list { display: flex; flex-direction: column; }
.tk-row { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; transition: background var(--dur) var(--ease); }
.tk-row:last-child { border-bottom: 0; }
.tk-row:hover { background: var(--surface-hover); }
.tk-row.is-unread .tk-title { font-weight: 600; }
.tk-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.tk-id { font-weight: 600; color: var(--text); font-size: 13px; }
.tk-email { color: var(--text-2); }
.tk-time { margin-inline-start: auto; }
.tk-title { margin-top: 6px; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-last { margin-top: 2px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.tk-layout.has-side { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 1000px) { .tk-layout.has-side { grid-template-columns: minmax(0, 1fr); } }
.tk-thread { display: flex; flex-direction: column; gap: 16px; }
.tk-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.tk-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.tk-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.tk-bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; max-width: 100%; }
.tk-msg.is-staff .tk-bubble { background: var(--accent-soft); border-color: transparent; }
.tk-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; }
.tk-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-text + .tk-imgs { margin-top: 8px; }
.tk-imgs img { max-width: 220px; max-height: 180px; border-radius: var(--radius); border: 1px solid var(--border); display: block; object-fit: cover; }
.tk-files { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-thumb { position: relative; display: inline-block; }
.tk-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.tk-thumb-x { position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.tk-attach { cursor: pointer; }
.tk-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.tk-kv > span:last-child { word-break: break-word; }
.tk-ua { font-size: 12px; color: var(--text-2); }
.tk-msg.is-note .tk-bubble { background: var(--warning-soft); border: 1px dashed var(--warning); }

/* ---------------------------------------------------------------- landing: live stats (#stats) */
.landing-stats { position: relative; overflow: hidden; }
.landing-stats::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--glow); }
.landing-stats .landing-wrap { position: relative; }
.ls-live { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px; padding: 3px 11px 3px 9px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--success); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.ls-live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.ls-live i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--success); animation: ls-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ls-ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
.ls-card { position: relative; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: border-color var(--dur) var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease); }
.ls-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ls-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.ls-kpi { overflow: hidden; }
.ls-kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .0; transition: opacity .25s var(--ease); }
.ls-kpi:hover { transform: translateY(-2px); }
.ls-kpi:hover::after { opacity: 1; }
.ls-kpi-top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.ls-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.ls-kpi-val { margin: 14px 0 4px; font-size: 34px; line-height: 1.1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ls-kpi-sub { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-up { color: var(--success); font-weight: 600; }
.ls-down { color: var(--danger); font-weight: 600; }
.ls-charts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ls-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.ls-card-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.ls-muted { color: var(--text-3); font-size: 12px; }
.ls-foot { margin: 16px 0 0; text-align: center; color: var(--text-3); font-size: 12px; }

/* trend */
.ls-trend-box { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 200px auto; column-gap: 10px; row-gap: 8px; }
.ls-y { display: flex; flex-direction: column; justify-content: space-between; margin: -7px 0; color: var(--text-3); font-size: 11px; text-align: end; }
.ls-plot { position: relative; cursor: crosshair; }
.ls-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ls-gridl { stroke: var(--border); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.ls-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 8px var(--accent-ring)); }
.ls-stop1 { stop-color: var(--accent); stop-opacity: .3; }
.ls-stop2 { stop-color: var(--accent); stop-opacity: 0; }
.ls-area { opacity: 0; transition: opacity 1.2s var(--ease) .5s; }
.ls-area.in { opacity: 1; }
.ls-x { grid-column: 2; display: flex; justify-content: space-between; color: var(--text-3); font-size: 11px; }
.ls-dot, .ls-vline, .ls-tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity .15s var(--ease); }
.ls-plot.hover .ls-dot, .ls-plot.hover .ls-vline, .ls-plot.hover .ls-tip { opacity: 1; }
.ls-vline { top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.ls-dot { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ls-tip { top: 6px; margin-left: 12px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-lg); font-size: 12px; white-space: nowrap; color: var(--text-2); }
.ls-tip.flip { transform: translateX(calc(-100% - 24px)); }
.ls-tip b { color: var(--text); font-size: 14px; }
.ls-tip small { display: block; color: var(--text-3); font-size: 11px; }

/* donut */
.ls-donut { position: relative; width: 150px; height: 150px; margin: 0 auto 16px; }
.ls-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ls-track { fill: none; stroke: var(--surface-active); stroke-width: 16; stroke-linecap: round; }
.ls-donut .ls-track { stroke-linecap: butt; }
.ls-seg { fill: none; stroke-width: 16; transition: stroke-dasharray 1.1s cubic-bezier(.65, 0, .35, 1); }
.ls-seg:hover { stroke-width: 19; }
.ls-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ls-donut-c b { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.ls-donut-c span { color: var(--text-3); font-size: 11.5px; }
.ls-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; }
.ls-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; align-items: center; gap: 8px; color: var(--text-2); }
.ls-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ls-legend b { color: var(--text); font-weight: 600; }
.ls-legend em { font-style: normal; color: var(--text-3); text-align: end; }

/* ban-rate gauge */
.ls-gauge { position: relative; max-width: 220px; margin: 0 auto; }
.ls-gauge svg { display: block; width: 100%; overflow: visible; }
.ls-gauge .ls-track { stroke-width: 14; }
.ls-garc { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray 1.3s cubic-bezier(.65, 0, .35, 1); }
.ls-ok .ls-garc { stroke: var(--success); } .ls-ok .ls-gauge-c b { color: var(--success); }
.ls-warn .ls-garc { stroke: var(--warning); } .ls-warn .ls-gauge-c b { color: var(--warning); }
.ls-bad .ls-garc { stroke: var(--danger); } .ls-bad .ls-gauge-c b { color: var(--danger); }
.ls-gauge-c { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; flex-direction: column; align-items: center; }
.ls-gauge-c b { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.ls-gauge-c span { color: var(--text-3); font-size: 11.5px; }
.ls-gauge-ticks { display: flex; justify-content: space-between; padding: 4px 4px 0; color: var(--text-3); font-size: 10.5px; }
.ls-bar-row { display: flex; justify-content: space-between; margin: 22px 0 7px; font-size: 12.5px; color: var(--text-2); }
.ls-bar-row b { color: var(--text); }
.ls-bar { height: 8px; border-radius: 999px; background: var(--surface-active); overflow: hidden; }
.ls-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--success), #6fd6a4); transition: width 1.3s cubic-bezier(.65, 0, .35, 1) .2s; }

@media (max-width: 960px) {
  .ls-kpis { grid-template-columns: repeat(2, 1fr); }
  .ls-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ls-trend { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .ls-charts { grid-template-columns: minmax(0, 1fr); }
  .ls-kpi-val { font-size: 28px; }
  .ls-trend-box { grid-template-rows: 160px auto; }
}
@media (prefers-reduced-motion: reduce) { .ls-live i::after { animation: none; } }

