:root {
  font-family: Inter, "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  color: #1e2d44;
  background: #eef3fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #1e2d44;
  --ink-secondary: #4a5b73;
  --muted: #7c8b9f;
  --line: #e2e9f3;
  --line-soft: #eef2f8;
  --surface: #ffffff;
  --canvas: #eef3fa;
  --primary: #2f6fe4;
  --primary-dark: #1f56c0;
  --primary-light: #5b93f0;
  --primary-soft: #eaf2ff;
  --teal: #2d82a8;
  --teal-dark: #216b8d;
  --teal-soft: #eaf6fb;
  --blue: #2f6fe4;
  --blue-soft: #eaf2ff;
  --green: #16a37a;
  --green-soft: #eaf8f3;
  --amber: #c88720;
  --amber-soft: #fff6e7;
  --violet: #7857cf;
  --violet-soft: #f2edff;
  --red: #cf5660;
  --red-soft: #fff0f1;
  /* 玻璃拟态：与后台（/）共用同一套令牌 */
  --glass-strong: rgb(255 255 255 / 86%);
  --glass: rgb(255 255 255 / 72%);
  --glass-line: rgb(255 255 255 / 78%);
  --glass-blur: blur(20px) saturate(170%);
  --glass-blur-sm: blur(14px) saturate(150%);
  --glass-sheen: inset 0 1px 0 rgb(255 255 255 / 92%);
  --shadow-sm: 0 2px 10px -4px rgb(23 43 77 / 12%), 0 1px 2px rgb(23 43 77 / 5%);
  --shadow: 0 6px 18px -10px rgb(23 43 77 / 20%), 0 1px 3px rgb(23 43 77 / 6%);
  --shadow-md: 0 14px 30px -16px rgb(23 43 77 / 24%), 0 2px 6px rgb(23 43 77 / 6%);
  --shadow-lg: 0 20px 44px -22px rgb(19 41 79 / 30%), 0 4px 12px -6px rgb(19 41 79 / 12%);
  --shadow-xl: 0 34px 74px -30px rgb(19 41 79 / 36%), 0 10px 24px -14px rgb(19 41 79 / 18%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --ring: 0 0 0 3px rgb(47 111 228 / 16%);
  --sidebar-width: 176px;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--canvas);
  background-image:
    radial-gradient(1120px 620px at 4% -8%, #dbe8ff 0%, rgb(219 232 255 / 0%) 62%),
    radial-gradient(920px 540px at 102% -6%, #e4efff 0%, rgb(228 239 255 / 0%) 58%),
    radial-gradient(820px 660px at 94% 108%, #e6efff 0%, rgb(230 239 255 / 0%) 60%),
    linear-gradient(180deg, #f4f8ff 0%, #eef3fa 46%, #e9f0f9 100%);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { color: inherit; transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.hidden, [hidden] { display: none !important; }

.boot-screen { display: none; min-height: 100vh; place-items: center; color: var(--muted); font-size: 14px; }
body.auth-loading #auth-screen,
body.auth-loading #app { display: none !important; }
body.auth-loading .boot-screen { display: grid; }

/* ── 登录/注册页：蓝白渐变 + 玻璃拟态 ─────────────────────── */
.auth-screen {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px 24px 56px;
  background:
    radial-gradient(880px 560px at 10% 4%, rgb(64 124 240 / 26%) 0%, rgb(64 124 240 / 0%) 62%),
    radial-gradient(760px 520px at 92% 96%, rgb(96 165 250 / 24%) 0%, rgb(96 165 250 / 0%) 64%),
    linear-gradient(158deg, #e9f1ff 0%, #f6f9ff 46%, #e2ecfb 100%);
}
.auth-backdrop { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(52px); opacity: .5; }
.auth-orb.orb-a { top: -160px; left: -140px; width: 460px; height: 460px; background: radial-gradient(circle at 32% 30%, #7fb0ff, #2563eb 72%); animation: orb-float 18s ease-in-out infinite; }
.auth-orb.orb-b { right: -170px; bottom: -150px; width: 440px; height: 440px; background: radial-gradient(circle at 40% 40%, #9cc8ff, #3b82f6 74%); animation: orb-float 22s ease-in-out -6s infinite reverse; }
.auth-orb.orb-c { top: 36%; right: 16%; width: 260px; height: 260px; background: radial-gradient(circle at 50% 50%, #dbeafe 0%, rgb(219 234 254 / 0%) 70%); opacity: .7; }
@keyframes orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(26px, -32px, 0) scale(1.07); }
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 424px);
  padding: 34px 34px 30px;
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  background: linear-gradient(160deg, rgb(255 255 255 / 88%) 0%, rgb(255 255 255 / 68%) 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-xl), var(--glass-sheen);
  animation: auth-panel-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-panel::before { position: absolute; inset: 0 0 auto; height: 3px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, #2563eb 0%, #60a5fa 42%, rgb(96 165 250 / 0%) 100%); content: ""; }
@keyframes auth-panel-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.auth-panel.is-submitting { pointer-events: none; }
.auth-panel.is-submitting .button.primary { opacity: .72; }

.brand-mark { display: block; width: 46px; height: 46px; padding: 9px; border: 1px solid rgb(255 255 255 / 90%); border-radius: 14px; background: linear-gradient(158deg, #fff 0%, #e6efff 100%); object-fit: contain; box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / 95%); }
.eyebrow { margin-top: 18px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-panel h1 { margin: 7px 0 24px; color: var(--ink); font-size: 24px; font-weight: 680; letter-spacing: -.01em; }
label { display: block; margin: 0 0 8px; color: #4f6076; font-size: 13px; font-weight: 600; }
input, select { width: 100%; min-height: 40px; margin: 0 0 14px; padding: 9px 12px; border: 1px solid #dbe4f0; border-radius: 10px; outline: 0; background: rgb(255 255 255 / 92%); color: var(--ink); box-shadow: inset 0 1px 2px rgb(23 43 77 / 4%); transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
input:hover, select:hover { border-color: #c6d5e8; }
input:focus, select:focus { border-color: var(--primary); background: #fff; box-shadow: var(--ring), inset 0 1px 2px rgb(23 43 77 / 3%); }
input::placeholder { color: #a7b3c4; }
.auth-panel input { min-height: 46px; font-size: 15px; }
.auth-panel input[type="password"] { letter-spacing: .12em; }
.auth-panel .button.primary { min-height: 46px; border-radius: 11px; font-size: 15px; }
.auth-captcha-field { margin-bottom: 14px; }
.auth-captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 10px; align-items: stretch; }
.auth-captcha-row input { margin-bottom: 0; }
.auth-captcha-media { display: grid; width: 142px; min-height: 46px; place-items: center; overflow: hidden; padding: 0; border: 1px solid #dbe4f0; border-radius: 10px; background: #fff; color: #8b9bb0; }
.auth-captcha-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-captcha-media audio { display: block; width: 132px; height: 38px; }
.auth-captcha-refresh { margin-top: 7px; font-size: 12px; }
.form-error { min-height: 20px; margin: 0 0 12px; color: var(--red); font-size: 13px; font-weight: 500; }

.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid #dbe4f0; border-radius: 10px; background: rgb(255 255 255 / 92%); color: var(--ink-secondary); cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 600; box-shadow: 0 1px 2px rgb(23 43 77 / 6%); }
.button:hover { border-color: #b9cbe4; background: #fff; color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button:active { transform: none; }
.button:focus-visible { outline: 0; border-color: var(--primary); box-shadow: var(--ring); }
.button.primary { border-color: transparent; background: linear-gradient(135deg, #3b7cf0 0%, var(--primary) 52%, var(--primary-dark) 100%); color: #fff; box-shadow: 0 6px 16px -8px rgb(47 111 228 / 65%), inset 0 1px 0 rgb(255 255 255 / 22%); }
.button.primary:hover { border-color: transparent; background: linear-gradient(135deg, #4a86f2 0%, #2a67db 52%, #1b4dae 100%); color: #fff; box-shadow: 0 10px 22px -8px rgb(47 111 228 / 70%), inset 0 1px 0 rgb(255 255 255 / 24%); }
.button.danger { border-color: #f0d6d8; background: rgb(255 255 255 / 92%); color: var(--red); }
.button.danger:hover { border-color: #e8bcc0; background: var(--red-soft); color: #b8464f; }
.button.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.button.full { width: 100%; }
.button:disabled { opacity: .5; cursor: default; }
.button:disabled:hover { border-color: #dbe4f0; background: rgb(255 255 255 / 92%); transform: none; box-shadow: 0 1px 2px rgb(23 43 77 / 6%); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 14px; font-weight: 600; transition: color .18s ease; }
.text-button:hover { color: var(--primary-dark); text-decoration: underline; }
.auth-switch { display: block; margin: 18px auto 0; }

.app-shell { min-height: 100vh; padding-top: 64px; }
.topbar { position: fixed; z-index: 10; inset: 0 0 auto; display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--glass-line); background: var(--glass-strong); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: 0 1px 0 rgb(23 43 77 / 4%), 0 10px 26px -24px rgb(23 43 77 / 45%); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.brand:hover { color: var(--primary); }
.brand img { width: 32px; height: 32px; padding: 6px; border: 1px solid rgb(255 255 255 / 90%); border-radius: 10px; background: linear-gradient(158deg, #fff 0%, #e6efff 100%); object-fit: contain; box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / 95%); }
.account-bar { display: flex; align-items: center; gap: 10px; }
.account-menu { position: relative; }
.account-trigger { display: flex; min-width: 168px; min-height: 42px; align-items: center; gap: 9px; padding: 4px 7px 4px 5px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: #d9e4f2; background: rgb(255 255 255 / 82%); }
.account-trigger:focus-visible { outline: 0; border-color: var(--primary); box-shadow: var(--ring); }
.account-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(158deg, #eef4ff 0%, #dbe8ff 100%); color: var(--primary); }
.account-avatar-icon { display: block; width: 32px; height: 32px; }
.account-identity { display: grid; min-width: 0; flex: 1; gap: 1px; }
.account-name { max-width: 160px; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.account-balance { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600; }
.account-chevron { display: grid; width: 14px; height: 14px; flex: 0 0 14px; place-items: center; color: var(--muted); }
.account-chevron-icon { display: block; width: 12px; height: 12px; fill: currentColor; }
.account-menu-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; display: grid; width: 224px; padding: 8px; border: 1px solid var(--glass-line); border-radius: 14px; background: linear-gradient(160deg, rgb(255 255 255 / 96%) 0%, rgb(250 252 255 / 92%) 100%); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: var(--shadow-lg); }
.account-menu-heading { display: grid; gap: 1px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); }
.account-menu-heading span { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-heading small { color: var(--muted); font-size: 11px; }
.account-menu-item { display: flex; min-height: 38px; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-secondary); cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; }
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--primary-soft); color: var(--primary); outline: 0; }
.account-menu-item.danger { color: var(--red); }
.account-menu-item.danger:hover, .account-menu-item.danger:focus-visible { background: var(--red-soft); color: var(--red); }
.menu-icon { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; color: currentColor; }
.menu-icon svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.menu-icon .wallet-menu-icon { width: 20px; height: 20px; overflow: visible; }
.account-menu-divider { height: 1px; margin: 5px 2px; background: #edf0f4; }
.refresh-button { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #64748a; cursor: pointer; }
.refresh-button:hover { border-color: #d9e4f2; background: rgb(255 255 255 / 82%); color: var(--primary); transform: translateY(-1px); }
.refresh-button:active { transform: none; }
.refresh-button:focus-visible { outline: 0; border-color: var(--primary); box-shadow: var(--ring); }
.refresh-icon { display: block; width: 24px; height: 24px; fill: currentColor; }
.logout-button { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #64748a; cursor: pointer; }
.logout-button:hover { border-color: #d9e4f2; background: rgb(255 255 255 / 82%); color: var(--primary); transform: translateY(-1px); }
.logout-button:focus-visible { outline: 0; border-color: var(--primary); box-shadow: var(--ring); }
.logout-icon { display: block; width: 24px; height: 24px; }
.app-layout { min-height: calc(100vh - 64px); }
.sidebar { position: fixed; z-index: 5; inset: 64px auto 0 0; width: var(--sidebar-width); padding: 18px 10px 14px; border-right: 1px solid var(--glass-line); background: linear-gradient(180deg, rgb(255 255 255 / 78%) 0%, rgb(246 250 255 / 84%) 100%); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: 1px 0 0 rgb(23 43 77 / 4%), 14px 0 30px -28px rgb(23 43 77 / 45%); }
.nav-label { padding: 3px 12px 12px; color: #9ba6b4; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
#navigation { display: grid; gap: 4px; }
.nav-item { display: flex; min-height: 40px; align-items: center; gap: 11px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #66758b; text-align: left; cursor: pointer; font-size: 15px; }
.nav-icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; align-items: center; justify-content: center; color: #7e8da2; }
.nav-icon svg { display: block; width: 17px; height: 17px; fill: currentColor; }
.nav-icon svg path { fill: currentColor; }
.nav-item:hover { background: rgb(255 255 255 / 80%); color: var(--primary); box-shadow: var(--shadow-sm); }
.nav-item.active { padding-left: 7px; border-left: 3px solid var(--primary); border-radius: 10px; background: linear-gradient(135deg, #eaf2ff 0%, #dceaff 100%); color: var(--primary); box-shadow: inset 0 0 0 1px rgb(47 111 228 / 14%); }
.nav-item:focus-visible { outline: 0; box-shadow: var(--ring); }
.main-content { min-height: calc(100vh - 64px); margin-left: var(--sidebar-width); padding: 28px 36px 44px; }
.page-wrap { width: min(100%, 1400px); margin: 0 auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.25; }
.heading-note { margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { --metric-color: var(--primary); --metric-soft: var(--primary-soft); position: relative; min-width: 0; min-height: 112px; overflow: hidden; padding: 15px 16px 14px; border: 1px solid var(--glass-line); border-top: 3px solid var(--metric-color); border-radius: var(--radius); background: linear-gradient(160deg, rgb(255 255 255 / 90%) 0%, rgb(255 255 255 / 72%) 100%); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: var(--shadow-sm), var(--glass-sheen); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.metric:hover { border-color: var(--glass-line); box-shadow: var(--shadow-md), var(--glass-sheen); transform: translateY(-2px); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: var(--metric-soft); color: var(--metric-color); font-size: 14px; font-weight: 800; box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%); }
.metric-icon-svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.metric-value { margin-top: 10px; overflow-wrap: anywhere; color: var(--ink); font-size: 25px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric-note { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.metric-breakdown { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.consumption-details { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.consumption-details span { min-width: 0; overflow-wrap: anywhere; }
.performance-values { display: grid; gap: 2px; margin-top: 10px; }
.performance-stat { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.performance-stat strong { color: var(--metric-color); font-size: 19px; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.performance-stat:first-child strong { color: var(--ink); }
.performance-stat:last-child strong { color: var(--violet); }
.performance-stat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.performance-metric { grid-column: span 1; }
.tone-blue { --metric-color: var(--blue); --metric-soft: var(--blue-soft); }
.tone-green { --metric-color: var(--green); --metric-soft: var(--green-soft); }
.tone-teal { --metric-color: var(--teal); --metric-soft: var(--teal-soft); }
.tone-violet { --metric-color: var(--violet); --metric-soft: var(--violet-soft); }
.tone-amber { --metric-color: var(--amber); --metric-soft: var(--amber-soft); }
.metric.primary-metric { border-color: rgb(47 111 228 / 18%); border-top-color: var(--metric-color); background: linear-gradient(145deg, rgb(233 242 255 / 92%) 0%, rgb(255 255 255 / 78%) 88%); box-shadow: var(--shadow-sm), var(--glass-sheen); }
.metric.primary-metric .metric-top { color: #5d7198; }
.metric.primary-metric .metric-value { color: var(--primary-dark); font-size: 29px; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 16px; align-items: start; }
.section-grid > .panel { overflow: hidden; }
.section-grid .panel-header { background: linear-gradient(180deg, rgb(247 251 255 / 88%) 0%, rgb(255 255 255 / 58%) 100%); }
.activity-panel { overflow: hidden; margin-bottom: 16px; }
.activity-panel .panel-header { background: linear-gradient(180deg, rgb(247 251 255 / 88%) 0%, rgb(255 255 255 / 58%) 100%); }
.chart-summary { display: flex; align-items: center; gap: 28px; padding: 9px 12px 11px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 10px; background: rgb(238 244 253 / 72%); }
.chart-stat { min-width: 104px; }
.chart-stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.chart-stat strong { display: block; overflow: hidden; margin-top: 4px; color: var(--ink); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.chart { display: grid; height: 190px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 8px; padding: 18px 9px 0; border-bottom: 1px solid var(--line); }
.chart-column { display: flex; min-width: 0; height: 100%; flex-direction: column; align-items: center; justify-content: end; gap: 6px; }
.chart-value { display: block; width: 100%; height: 15px; color: #8290a3; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.chart-bar-wrap { display: flex; width: 100%; height: 126px; align-items: end; justify-content: center; }
.chart-bar { width: min(100%, 30px); min-height: 3px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #6fa2f4 0%, var(--primary) 78%, #2a63cf 100%); box-shadow: 0 2px 8px -4px rgb(47 111 228 / 55%); transition: height .2s ease, opacity .2s ease; }
.chart-bar.is-empty { opacity: .48; }
.chart-time { height: 16px; color: #8290a3; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.panel-caption { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.panel { min-width: 0; border: 1px solid var(--glass-line); border-radius: var(--radius); background: linear-gradient(160deg, rgb(255 255 255 / 90%) 0%, rgb(255 255 255 / 74%) 100%); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: var(--shadow-sm), var(--glass-sheen); }
.panel:hover { border-color: var(--glass-line); box-shadow: var(--shadow-md), var(--glass-sheen); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.model-stat-tools { display: flex; min-width: 0; flex: 0 1 auto; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.model-stat-select { width: auto; min-width: 88px; min-height: 32px; margin: 0; padding: 5px 28px 5px 10px; cursor: pointer; font-size: 13px; }
.model-stat-footer { margin: 0 -20px -16px; }
.panel-body { padding: 0 20px 16px; }
.profile-card { width: min(100%, 760px); overflow: hidden; }
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 26px 28px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(135deg, rgb(238 245 255 / 88%) 0%, rgb(255 255 255 / 62%) 72%); }
.profile-avatar { display: grid; width: 68px; height: 68px; flex: 0 0 68px; place-items: center; overflow: hidden; border: 5px solid rgb(255 255 255 / 92%); border-radius: 50%; background: linear-gradient(158deg, #eef4ff 0%, #dbe8ff 100%); box-shadow: var(--shadow-sm); }
.profile-avatar-icon { display: block; width: 68px; height: 68px; }
.profile-identity { min-width: 0; flex: 1; }
.profile-identity h2 { margin: 0; overflow: hidden; color: var(--ink); font-size: 21px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.profile-hero .status-pill { align-self: flex-start; }
.profile-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 8px 28px 18px; }
.profile-detail { min-width: 0; padding: 16px 14px 12px 0; border-bottom: 1px solid var(--line-soft); }
.profile-detail:nth-last-child(-n + 2) { border-bottom: 0; }
.profile-detail-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.profile-detail-value { display: block; margin-top: 5px; overflow-wrap: anywhere; color: var(--ink); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-detail-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.table-panel { overflow: hidden; margin-top: 14px; border: 1px solid var(--glass-line); border-radius: var(--radius); background: rgb(255 255 255 / 94%); box-shadow: var(--shadow-sm), var(--glass-sheen); }
.table-panel:hover { border-color: var(--glass-line); box-shadow: var(--shadow-md), var(--glass-sheen); }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgb(241 246 253 / 88%); color: #6b7b92; font-size: 12px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
td { height: 54px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-secondary); font-size: 13px; white-space: nowrap; transition: background .15s ease; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgb(238 244 253 / 62%); }
.td-primary { color: var(--ink); font-weight: 600; }
.td-muted { margin-top: 4px; color: var(--muted); font-size: 12px; }
.mono { color: var(--ink-secondary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; background: rgb(238 244 253 / 82%); padding: 3px 7px; border-radius: 7px; }
.key-cell { display: flex; max-width: 460px; align-items: center; gap: 8px; white-space: normal; }
.key-value { min-width: 180px; overflow-wrap: anywhere; color: var(--ink-secondary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: normal; }
.key-quota { display: grid; gap: 2px; min-width: 120px; white-space: normal; }
.quota-summary { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.key-quota strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.key-quota small, .key-quota > span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.quota-meter { height: 4px; margin-top: 3px; overflow: hidden; border-radius: 99px; background: #e9eef5; }
.quota-meter span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.key-model-access { max-width: 220px; overflow: hidden; color: var(--ink-secondary); text-overflow: ellipsis; white-space: nowrap; }
.key-model-editor { position: relative; padding: 5px 8px; border: 1px solid #dbe4f0; border-radius: 8px; background: #fff; cursor: text; transition: border-color .16s ease, box-shadow .16s ease; }
.key-model-editor:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.key-model-editor-list { min-height: 29px; align-content: center; }
.key-model-input { width: auto; min-width: 110px; flex: 1 1 110px; min-height: 28px; margin: 0; padding: 3px 2px; border: 0; outline: 0; background: transparent; box-shadow: none; }
.key-model-input:focus { border: 0; box-shadow: none; }
.key-model-item { display: inline-flex; max-width: 100%; min-height: 26px; align-items: center; gap: 4px; padding: 2px 5px 2px 8px; border: 1px solid #d9d5f7; border-radius: 5px; background: var(--violet-soft); color: #6d55b8; font-size: 12px; line-height: 20px; }
.key-model-item-text { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-model-item-remove { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 3px; background: transparent; color: currentColor; cursor: pointer; font-size: 16px; line-height: 1; }
.key-model-item-remove:hover { background: rgb(255 255 255 / 58%); }
.key-model-menu { position: absolute; z-index: 25; top: calc(100% + 5px); right: 0; left: 0; max-height: 286px; overflow: auto; padding: 4px; border: 1px solid #d8e1ed; border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgb(38 57 80 / 18%); }
.key-model-option { display: flex; width: 100%; min-height: 38px; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-secondary); cursor: pointer; font-size: 13px; line-height: 1.4; text-align: left; }
.key-model-option:hover { background: #f5f8fc; }
.key-model-option.selected { background: var(--primary-soft); color: var(--primary-dark); }
.key-model-option-check { display: inline-flex; width: 17px; height: 17px; flex: 0 0 17px; align-items: center; justify-content: center; border: 1px solid #cbd6e4; border-radius: 3px; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.key-model-option.selected .key-model-option-check { border-color: var(--primary); background: var(--primary); }
.key-model-empty { padding: 14px 9px; color: var(--muted); font-size: 13px; text-align: center; }
.key-model-picker.open .key-model-menu { position: fixed; z-index: 1000; top: var(--key-model-menu-top, 0px); right: auto; left: var(--key-model-menu-left, 0px); width: var(--key-model-menu-width, auto); }
.price-list { display: grid; gap: 6px; min-width: 250px; white-space: normal; }
.price-list span { color: var(--ink-secondary); font-size: 13px; line-height: 1.6; }
.price-list small { color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex; min-height: 24px; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 600; }
.status-pill.off { background: #f0f2f5; color: var(--muted); }
.status-code { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 650; }
.status-code.bad { color: var(--red); background: var(--red-soft); }
.latency-cell { min-width: 112px; line-height: 1.45; }
.latency-cell div { white-space: nowrap; }
.latency-cell span { color: var(--muted); font-size: 12px; }
.latency-cell strong { color: var(--green); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.spend-cell { min-width: 132px; white-space: nowrap; }
.log-detail-button { display: inline-flex; width: 26px; min-width: 26px; min-height: 26px; align-items: center; justify-content: center; margin-left: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--primary); cursor: pointer; vertical-align: middle; }
.log-detail-button:hover { background: transparent; color: var(--primary-dark); }
.log-detail-button:focus-visible { outline: 0; box-shadow: none; }
.log-detail-button:focus-visible .log-detail-icon { box-shadow: 0 0 0 2px rgb(47 111 228 / 22%); }
.log-detail-icon { display: inline-grid; width: 15px; height: 15px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-size: 11px; font-style: normal; font-weight: 700; line-height: 1; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 16px; border: 1px solid var(--glass-line); border-radius: var(--radius); background: var(--glass-strong); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: var(--shadow-sm), var(--glass-sheen); }
.filter-field { min-width: 150px; }
.filter-field label { margin-bottom: 6px; color: var(--ink-secondary); font-size: 13px; font-weight: 600; }
.filter-field input { min-height: 38px; margin: 0; padding: 8px 11px; font-size: 13px; border-radius: 6px; }
.filter-spacer { flex: 1; }
.table-footer { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; font-weight: 500; }
.pagination { display: inline-flex; max-width: 100%; align-items: stretch; overflow: hidden; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
.pagination-button, .pagination-ellipsis { display: inline-flex; width: 36px; min-width: 36px; height: 32px; align-items: center; justify-content: center; padding: 0; border: 0; border-right: 1px solid #dbe3ee; background: #fff; color: var(--ink-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.pagination-button { cursor: pointer; transition: background-color .16s ease, color .16s ease, box-shadow .16s ease; }
.pagination-button:last-child { border-right: 0; }
.pagination-button:hover:not(:disabled):not(.active) { background: #f5f8fc; color: var(--primary-dark); }
.pagination-button.active { background: #effaf9; color: #079b93; box-shadow: inset 0 0 0 1px #2ac4bc; }
.pagination-button.pagination-control { color: #78879a; font-size: 22px; line-height: 1; }
.pagination-button:disabled { color: #b8c1cd; cursor: default; }
.pagination-button:focus-visible { outline: 0; position: relative; z-index: 1; box-shadow: inset 0 0 0 2px var(--primary); }
.pagination-ellipsis { color: var(--muted); user-select: none; }
@media (max-width: 520px) { .pagination-button, .pagination-ellipsis { width: 32px; min-width: 32px; } }
.model-pagination-footer { margin-top: 12px; border: 1px solid var(--glass-line); border-radius: var(--radius); background: rgb(255 255 255 / 94%); box-shadow: var(--shadow-sm), var(--glass-sheen); }
.empty-state { padding: 40px 16px; color: var(--muted); text-align: center; font-size: 14px; font-weight: 500; }
.form-panel { width: min(100%, 560px); padding: 22px; }
.form-row { display: flex; align-items: end; gap: 12px; }
.form-row > div { flex: 1; }
.form-row input { margin-bottom: 0; }
.field-hint { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.action-row { display: flex; align-items: center; gap: 10px; }

.recharge-center { display: grid; gap: 16px; width: min(100%, 1200px); margin: 0 auto; }
.recharge-center.has-subscriptions { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); align-items: start; }
.recharge-main { display: grid; min-width: 0; gap: 16px; }
.payment-create-panel { width: 100%; }
.payment-create-panel .panel-body { padding-top: 18px; }
.payment-order-panel { width: min(100%, 900px); }
.payment-order-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: center; padding-top: 20px; }
.payment-qr-wrap { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.payment-qr { display: block; width: 240px; height: 240px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; object-fit: contain; }
.payment-link-wrap { display: grid; justify-items: center; gap: 10px; min-width: 0; padding: 26px 16px; border: 1px solid rgb(255 255 255 / 72%); border-radius: var(--radius); background: linear-gradient(160deg, rgb(240 246 255 / 88%) 0%, rgb(255 255 255 / 70%) 100%); color: var(--ink); text-align: center; }
.payment-link-wrap strong { font-size: 18px; }
.payment-link-mark { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 16px; background: #1677ff; color: #fff; font-size: 13px; font-weight: 800; }
.payment-order-meta { display: grid; gap: 14px; min-width: 0; }
.payment-order-meta > div { display: grid; gap: 4px; min-width: 0; }
.payment-order-meta span { color: var(--muted); font-size: 12px; font-weight: 600; }
.payment-order-meta strong { color: var(--ink); font-size: 24px; font-variant-numeric: tabular-nums; }
.payment-order-meta code { display: block; overflow-wrap: anywhere; padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgb(238 244 253 / 62%); color: var(--ink-secondary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.payment-qr-content { max-height: 84px; overflow: auto; }
.payment-disabled { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid #f0ddb3; border-radius: 6px; background: var(--amber-soft); color: #785317; }
.payment-disabled strong { color: #92400e; font-size: 14px; }
.payment-disabled span { color: #9a6b24; font-size: 13px; }
.payment-method-badge { display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px; border: 1px solid #ffd4d4; border-radius: 5px; background: #fff4f4; color: #e12f36; font-size: 12px; font-weight: 700; }
.recharge-payment-form { display: grid; gap: 10px; width: 100%; max-width: none; }
.payment-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 1px 0 4px; }
.payment-method-option { min-height: 42px; border: 1px solid #dbe4f0; border-radius: 10px; background: rgb(255 255 255 / 92%); color: var(--ink-secondary); cursor: pointer; font-weight: 650; }
.payment-method-option:hover { border-color: var(--primary-light); background: var(--primary-soft); color: var(--primary-dark); }
.payment-method-option.active { border-color: var(--primary); background: linear-gradient(135deg, #eaf2ff 0%, #dceaff 100%); color: var(--primary-dark); box-shadow: inset 0 0 0 1px var(--primary); }
.quick-amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 1px 0 4px; }
.amount-option { min-height: 42px; border: 1px solid #dbe4f0; border-radius: 10px; background: rgb(255 255 255 / 92%); color: var(--ink-secondary); cursor: pointer; font-weight: 650; }
.amount-option:hover { border-color: var(--primary-light); background: var(--primary-soft); color: var(--primary-dark); }
.amount-option.active { border-color: var(--primary); background: linear-gradient(135deg, #eaf2ff 0%, #dceaff 100%); color: var(--primary-dark); box-shadow: inset 0 0 0 1px var(--primary); }
.recharge-card-panel { width: 100%; }
.recharge-card-form { width: 100%; max-width: none; }
.subscription-panel { min-width: 0; }
.subscription-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding-top: 16px; }
.subscription-card { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgb(250 252 255 / 82%); }
.subscription-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.subscription-card-head strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; }
.subscription-card-head span { flex: 0 0 auto; color: var(--primary-dark); font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 750; }
.subscription-card-meta { display: grid; gap: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.subscription-card-remark { padding: 8px 9px; border-radius: 5px; background: #f1f5fb; color: var(--ink-secondary); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-code-row { display: flex; align-items: center; gap: 10px; }
.card-code-row input { min-width: 0; flex: 1; margin-bottom: 0; }
.card-code-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.card-code-actions > :only-child { min-width: 128px; }

/* Model Cards */
.model-list-page { width: min(100%, 1400px); }
.model-browser-tools { display: grid; gap: 10px; margin: -4px 0 12px; }
.model-search-control { display: flex; min-height: 42px; align-items: center; gap: 9px; margin: 0; padding: 0 13px; border: 1px solid #dbe4f0; border-radius: 12px; background: rgb(255 255 255 / 88%); color: var(--muted); box-shadow: inset 0 1px 2px rgb(23 43 77 / 4%); cursor: text; }
.model-search-control:focus-within { border-color: var(--primary); background: #fff; box-shadow: var(--ring), inset 0 1px 2px rgb(23 43 77 / 3%); }
.model-search-control svg { display: block; width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.model-search-control input { min-width: 0; min-height: 38px; flex: 1 1 auto; margin: 0; padding: 7px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.model-search-control input:focus { border: 0; box-shadow: none; }
.model-filter-group { display: flex; min-width: 0; align-items: flex-start; gap: 10px; }
.model-filter-label { flex: 0 0 52px; padding-top: 8px; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.3; }
.model-provider-filters, .model-billing-filters { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 7px; }
.model-provider-filter, .model-billing-filter { display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #dbe4f0; border-radius: 999px; background: rgb(255 255 255 / 88%); color: var(--ink-secondary); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.model-provider-filter span, .model-billing-filter span { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: #eef2f8; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.model-provider-filter:hover, .model-billing-filter:hover { border-color: #b9cbe4; background: #fff; color: var(--primary); }
.model-provider-filter.active, .model-billing-filter.active { border-color: #c8daf8; background: var(--primary-soft); color: var(--primary-dark); box-shadow: inset 0 0 0 1px rgb(47 111 228 / 8%); }
.model-provider-filter.active span, .model-billing-filter.active span { background: #fff; color: var(--primary); }
.model-provider-filter:focus-visible, .model-billing-filter:focus-visible { outline: 0; box-shadow: var(--ring); }
.model-filter-summary { min-height: 18px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.model-list-page .model-grid { column-width: 440px; column-gap: 12px; max-width: none; margin: 0; }
.model-card { min-width: 0; margin-bottom: 12px; overflow: hidden; position: relative; break-inside: avoid; border: 1px solid var(--glass-line); border-radius: var(--radius); background: linear-gradient(160deg, rgb(255 255 255 / 90%) 0%, rgb(255 255 255 / 74%) 100%); backdrop-filter: var(--glass-blur-sm); -webkit-backdrop-filter: var(--glass-blur-sm); box-shadow: var(--shadow-sm), var(--glass-sheen); transition: border-color .18s ease, box-shadow .18s ease; }
.model-card::before { display: none; }
.model-card:hover { border-color: var(--glass-line); box-shadow: var(--shadow-md), var(--glass-sheen); }
.model-card-header { padding: 14px 16px 12px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, rgb(247 251 255 / 80%) 0%, rgb(255 255 255 / 52%) 100%); }
.model-card-title { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.model-card-name-wrap { display: grid; min-width: 0; gap: 2px; }
.model-card-provider { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.model-badges { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.model-card-title h3, .model-card-title .model-name { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; line-height: 1.35; }
.model-name { padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; font-family: inherit; }
.model-name:hover { color: var(--primary); text-decoration: underline; }
.model-name:focus-visible { outline: 3px solid rgb(53 106 230 / 24%); outline-offset: 2px; border-radius: 3px; }
.model-badge { display: inline-flex; flex: 0 0 auto; min-height: 23px; align-items: center; padding: 0 9px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-blue { border-color: #d6e2fb; background: var(--blue-soft); color: #3564c9; }
.badge-amber { border-color: #f0ddb3; background: var(--amber-soft); color: #a96700; }
.badge-gold { border-color: #f0d28a; background: #fff7df; color: #9a6500; }
.model-health { display: grid; gap: 4px; margin-top: 8px; }
.model-health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.model-health-head strong { color: var(--ink-secondary); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.model-health-bars { display: grid; grid-template-columns: repeat(20, minmax(3px, 1fr)); align-items: center; gap: 3px; min-height: 12px; }
.model-health-bar { display: block; width: 100%; height: 8px; border-radius: 2px; background: #d9d9d9; }
.model-health-bar.is-empty { background: #d9d9d9; }
.model-health-bar.is-success { background: #00c853; }
.model-health-bar.is-error { background: #ff4d4f; }
.model-health-axis { display: flex; justify-content: space-between; color: #a0aaba; font-size: 10px; line-height: 1; }
.model-card-body { padding: 10px 14px 12px; background: rgb(255 255 255 / 58%); }
.model-label-section { display: grid; gap: 6px; margin-top: 9px; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgb(246 250 254 / 86%); }
.model-label-list { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 5px; }
.model-label-tag { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border: 1px solid #d9d5f7; border-radius: 999px; background: var(--violet-soft); color: #6d55b8; font-size: 11px; font-weight: 700; line-height: 1.2; }
.model-label-tone-blue { border-color: #c8daf8; background: #eef4ff; color: #3869ae; }
.model-label-tone-teal { border-color: #bfe5df; background: #eaf8f5; color: #277f73; }
.model-label-tone-amber { border-color: #f0ddb3; background: #fff6e7; color: #a96700; }
.model-label-tone-violet { border-color: #d9d5f7; background: var(--violet-soft); color: #6d55b8; }
.model-label-tone-rose { border-color: #f2ced7; background: #fff0f3; color: #b34f69; }
.model-label-tone-green { border-color: #bfe6d5; background: #eaf8f1; color: #23815e; }
.price-summary { display: grid; gap: 7px; min-width: 0; }
.pricing-option + .pricing-option { padding-top: 8px; border-top: 1px solid #edf0f4; }
.pricing-option-heading { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--ink-secondary); font-size: 12px; font-weight: 700; line-height: 1.35; }
.pricing-option-heading span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pricing-option-groups { display: grid; gap: 7px; min-width: 0; }
.schedule-price-summary { min-width: 0; }
.price-unit-caption { margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.schedule-price-list { display: grid; gap: 5px; }
.schedule-price-row { min-width: 0; padding: 6px 7px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgb(246 250 254 / 86%); }
.schedule-price-row.is-secondary { margin-left: 10px; border-style: dashed; background: #fbfcfe; }
.schedule-price-head { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--ink-secondary); font-size: 11px; line-height: 1.35; }
.schedule-price-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.schedule-price-head span { flex: 0 0 auto; max-width: 72%; overflow: hidden; color: var(--muted); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.compact-price-values { display: flex; min-width: 0; flex-wrap: wrap; align-items: stretch; gap: 4px; margin-top: 4px; }
.compact-price-value { display: flex; min-width: 0; flex: 1 1 0; align-items: baseline; gap: 3px; padding: 4px 5px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgb(255 255 255 / 92%); color: var(--ink-secondary); font-size: 11px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; }
.compact-price-value em { margin-right: 1px; color: var(--muted); font-style: normal; font-weight: 500; }
.compact-price-value.is-secondary { color: #536782; font-size: 10px; font-weight: 550; }
.compact-price-empty { flex: 1 1 auto; color: var(--muted); font-size: 11px; }
.price-group { min-width: 0; }
.price-group-heading { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--ink-secondary); font-size: 12px; font-weight: 700; line-height: 1.35; }
.price-group-heading span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-group-heading small { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }

.announcement-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(20 34 56 / 42%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .15s ease; }
.announcement-modal { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(100%, 620px); max-height: min(88vh, 760px); min-height: 0; overflow: hidden; border: 1px solid var(--glass-line); border-radius: var(--radius-lg); background: linear-gradient(160deg, rgb(255 255 255 / 97%) 0%, rgb(250 252 255 / 94%) 100%); box-shadow: var(--shadow-xl); animation: slideUp .2s ease; }
.announcement-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.announcement-head-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 20px; }
.announcement-head-icon::before { content: "!"; display: block; width: 19px; height: 19px; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 800; line-height: 16px; text-align: center; }
.announcement-head-copy { min-width: 0; flex: 1; }
.announcement-head-copy strong { display: block; color: var(--ink); font-size: 18px; line-height: 1.3; }
.announcement-head-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.announcement-close { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; line-height: 1; }
.announcement-close:hover { background: rgb(238 244 253 / 82%); color: var(--ink); }
.announcement-list { display: grid; gap: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 22px; }
.announcement-item { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 11px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.announcement-item:last-child { border-bottom: 0; }
.announcement-item-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.announcement-item.important .announcement-item-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.announcement-item-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.announcement-item-title strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; line-height: 1.45; }
.announcement-item-title span { flex: 0 0 auto; padding: 2px 6px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-dark); font-size: 10px; font-weight: 700; }
.announcement-item.important .announcement-item-title span { background: var(--red-soft); color: var(--red); }
.announcement-item-content { margin: 7px 0 0; color: var(--ink-secondary); font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-item-images { display: grid; gap: 8px; margin-top: 10px; }
.announcement-image-button { display: block; width: 100%; padding: 0; border: 0; border-radius: 7px; background: transparent; cursor: zoom-in; }
.announcement-image-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.announcement-item-images img { display: block; width: 100%; max-height: 280px; border: 1px solid var(--line-soft); border-radius: 7px; object-fit: contain; background: #fafbfc; }
.announcement-image-preview-backdrop { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(8 15 28 / 82%); animation: fadeIn .15s ease; }
.announcement-image-preview-dialog { position: relative; display: flex; width: min(100%, 1440px); height: min(100%, 900px); align-items: center; justify-content: center; }
.announcement-image-preview-dialog img { display: block; max-width: 100%; max-height: 100%; border-radius: 7px; background: #fff; box-shadow: 0 18px 55px rgb(0 0 0 / 35%); object-fit: contain; }
.announcement-image-preview-close { position: absolute; z-index: 1; top: 4px; right: 4px; display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid rgb(255 255 255 / 30%); border-radius: 7px; background: rgb(0 0 0 / 42%); color: #fff; cursor: pointer; font-size: 26px; line-height: 1; }
.announcement-image-preview-close:hover, .announcement-image-preview-close:focus-visible { background: rgb(0 0 0 / 68%); outline: 2px solid #fff; outline-offset: 2px; }
.announcement-item-time { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.announcement-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.announcement-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line-soft); background: rgb(241 246 253 / 62%); }
.announcement-foot-actions { display: flex; gap: 8px; margin-left: auto; }
.announcement-foot .button { min-height: 34px; }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(20 34 56 / 38%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(100%, 540px); max-height: min(88vh, 720px); overflow: auto; border: 1px solid var(--glass-line); border-radius: var(--radius-lg); background: linear-gradient(160deg, rgb(255 255 255 / 97%) 0%, rgb(250 252 255 / 94%) 100%); box-shadow: var(--shadow-xl); animation: slideUp .2s ease; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; }
.modal-body { display: grid; gap: 15px; padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--line-soft); background: rgb(241 246 253 / 62%); }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-close:hover { background: rgb(238 244 253 / 82%); color: var(--ink); }
.billing-detail-modal { width: min(100%, 620px); }
.billing-detail-body { gap: 16px; }
.billing-detail-summary { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 15px 16px; border: 1px solid #dce7f4; border-radius: 8px; background: linear-gradient(135deg, #f5f9ff 0%, #fff 100%); }
.billing-detail-summary div { display: grid; gap: 4px; }
.billing-detail-summary span, .billing-detail-context span, .billing-detail-factors span { color: var(--muted); font-size: 12px; }
.billing-detail-summary strong { color: var(--primary-dark); font-size: 24px; font-variant-numeric: tabular-nums; }
.billing-detail-summary > span { color: var(--ink-secondary); font-size: 12px; white-space: nowrap; }
.billing-detail-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; padding: 13px; border: 1px solid #dce7f4; border-radius: 8px; background: linear-gradient(135deg, #f8fbff 0%, #fff 100%); }
.billing-detail-context > div { display: grid; gap: 4px; min-width: 0; }
.billing-detail-context > div + div { padding-left: 13px; border-left: 1px solid var(--line-soft); }
.billing-detail-context strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.billing-detail-section { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.billing-detail-section-title { padding: 10px 13px; border-bottom: 1px solid var(--line-soft); background: #f7f9fc; color: var(--ink-secondary); font-size: 12px; font-weight: 700; }
.billing-detail-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border-bottom: 1px solid var(--line-soft); }
.billing-detail-line:last-child { border-bottom: 0; }
.billing-detail-line div { display: grid; gap: 4px; min-width: 0; }
.billing-detail-line strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.billing-detail-line > strong { color: var(--green); white-space: nowrap; }
.billing-detail-line small { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.4; }
.billing-detail-empty { padding: 18px 13px; color: var(--muted); font-size: 13px; text-align: center; }
.billing-detail-factors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.billing-detail-factors > div { display: grid; gap: 4px; min-width: 0; padding: 10px 11px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fbfcfe; }
.billing-detail-factors strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.payment-qr-modal { width: min(100%, 390px); }
.payment-qr-modal-body { display: grid; justify-items: center; gap: 12px; padding: 22px 24px 26px; text-align: center; }
.payment-qr-modal-image { display: block; width: min(280px, 78vw); height: auto; aspect-ratio: 1; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; object-fit: contain; }
.payment-qr-modal-amount { color: var(--ink); font-size: 24px; font-variant-numeric: tabular-nums; }
.payment-qr-countdown { color: var(--red); font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 700; }
.payment-qr-modal-hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.payment-qr-modal-hint.payment-status-success { color: var(--green); font-weight: 700; }
.payment-qr-modal-hint.payment-status-error { color: var(--red); font-weight: 700; }
.secret-box { padding: 16px; border: 1px solid #edd8a1; border-radius: 7px; background: #fff9e9; }
.secret-box strong { color: #92400e; font-size: 14px; }
.secret-box code { display: block; margin-top: 10px; overflow-wrap: anywhere; color: #785317; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; line-height: 1.6; font-weight: 600; }
.toast-region { position: fixed; z-index: 100; top: max(72px, calc(env(safe-area-inset-top) + 14px)); right: 20px; display: grid; width: min(400px, calc(100vw - 32px)); justify-items: stretch; gap: 10px; pointer-events: none; }
.toast { --toast-accent: var(--green); --toast-accent-soft: var(--green-soft); --toast-icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); position: relative; isolation: isolate; display: grid; width: 100%; max-width: 100%; min-height: 58px; grid-template-columns: 34px minmax(0, 1fr) 28px; align-items: center; gap: 12px; overflow: hidden; padding: 13px 13px 15px 17px; border: 1px solid color-mix(in srgb, var(--toast-accent) 24%, #dfe5ee); border-radius: 14px; background: radial-gradient(120% 155% at 0% 0%, color-mix(in srgb, var(--toast-accent-soft) 90%, transparent) 0%, transparent 60%), linear-gradient(135deg, rgb(255 255 255 / 95%) 0%, color-mix(in srgb, var(--toast-accent-soft) 40%, rgb(255 255 255 / 92%)) 100%); color: var(--ink); box-shadow: var(--shadow-sm), 0 12px 28px -16px rgb(24 39 75 / 28%), 0 24px 46px -26px rgb(24 39 75 / 26%), inset 0 1px 0 rgb(255 255 255 / 92%); font-size: 13.5px; font-weight: 550; line-height: 1.5; text-align: left; overflow-wrap: anywhere; pointer-events: auto; backdrop-filter: blur(14px) saturate(145%); -webkit-backdrop-filter: blur(14px) saturate(145%); animation: toastIn .34s cubic-bezier(.2,.8,.2,1); transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, border-color .22s ease; }
.toast:hover, .toast:focus-within { border-color: color-mix(in srgb, var(--toast-accent) 42%, #dfe5ee); transform: translateY(-2px); box-shadow: var(--shadow-md), 0 18px 34px -16px rgb(24 39 75 / 30%), 0 32px 56px -28px rgb(24 39 75 / 30%), inset 0 1px 0 rgb(255 255 255 / 96%); }
.toast::before { position: absolute; top: 11px; bottom: 11px; left: 0; width: 4px; border-radius: 0 999px 999px 0; background: linear-gradient(180deg, color-mix(in srgb, var(--toast-accent) 55%, #fff) 0%, var(--toast-accent) 52%, color-mix(in srgb, var(--toast-accent) 84%, #000) 100%); content: ""; box-shadow: 0 0 0 1px color-mix(in srgb, var(--toast-accent) 14%, transparent), 0 2px 10px color-mix(in srgb, var(--toast-accent) 42%, transparent); }
.toast::after { position: absolute; top: -60%; right: -14%; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--toast-accent) 24%, transparent) 0%, transparent 68%); content: ""; opacity: .45; pointer-events: none; }
.toast.toast-out { animation: toastOut .24s ease-in forwards; }
@keyframes toastIn { from { transform: translateY(-14px) scale(.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes toastOut { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(-10px) scale(.97); opacity: 0; } }
.toast-icon { position: relative; z-index: 1; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid color-mix(in srgb, var(--toast-accent) 22%, transparent); border-radius: 11px; background: linear-gradient(158deg, color-mix(in srgb, var(--toast-accent-soft) 55%, #fff) 0%, color-mix(in srgb, var(--toast-accent) 15%, #fff) 100%); color: var(--toast-accent); box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--toast-accent) 65%, transparent), inset 0 1px 0 rgb(255 255 255 / 80%); animation: toastIconPop .42s cubic-bezier(.2,.8,.2,1) .06s backwards; }
.toast-icon::before { width: 16px; height: 16px; background: currentColor; content: ""; -webkit-mask: var(--toast-icon-mask) center / contain no-repeat; mask: var(--toast-icon-mask) center / contain no-repeat; }
@keyframes toastIconPop { 0% { transform: scale(.5) rotate(-12deg); opacity: 0; } 55% { transform: scale(1.1) rotate(3deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.toast-message { position: relative; z-index: 1; min-width: 0; color: var(--ink); font-weight: 550; letter-spacing: .002em; }
.toast-close { position: relative; z-index: 1; display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #94a3b8; cursor: pointer; font-size: 17px; line-height: 1; transition: background .18s ease, color .18s ease, transform .22s cubic-bezier(.2,.8,.2,1); }
.toast-close:hover { background: color-mix(in srgb, var(--toast-accent) 12%, transparent); color: color-mix(in srgb, var(--toast-accent) 70%, #334155); transform: rotate(90deg); }
.toast-close:active { transform: rotate(90deg) scale(.9); }
.toast-close:focus-visible { outline: 2px solid color-mix(in srgb, var(--toast-accent) 55%, transparent); outline-offset: 2px; }
.toast-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; transform-origin: left center; background: linear-gradient(90deg, color-mix(in srgb, var(--toast-accent) 90%, #fff) 0%, var(--toast-accent) 42%, color-mix(in srgb, var(--toast-accent) 36%, transparent) 100%); opacity: .45; animation: toastProgress 3.5s linear forwards; transition: opacity .2s ease; }
.toast:hover .toast-progress { opacity: .85; }
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.error { --toast-accent: var(--red); --toast-accent-soft: var(--red-soft); --toast-icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6'/%3E%3Cpath d='M12 17.4h.01'/%3E%3C/svg%3E"); }
.toast.warning { --toast-accent: var(--amber); --toast-accent-soft: var(--amber-soft); --toast-icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E"); }
.toast.info { --toast-accent: var(--blue); --toast-accent-soft: var(--blue-soft); --toast-icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E"); }
.toast.success { --toast-accent: var(--green); --toast-accent-soft: var(--green-soft); }

@media (max-width: 640px) { .toast-region { top: max(60px, calc(env(safe-area-inset-top) + 10px)); right: 10px; width: calc(100vw - 20px); } .toast { grid-template-columns: 30px minmax(0, 1fr) 28px; gap: 10px; padding: 11px 11px 13px 13px; border-radius: 12px; } .toast-icon { width: 30px; height: 30px; border-radius: 9px; } .toast-icon::before { width: 15px; height: 15px; } .toast::before { top: 9px; bottom: 9px; width: 3px; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast-icon, .toast-progress { animation-duration: .01ms !important; } .toast, .toast-close { transition-duration: .01ms !important; } }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .recharge-center.has-subscriptions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .model-list-page .model-grid { column-count: 1; column-width: auto; }
  .sidebar { position: fixed; inset: 58px 0 auto; width: auto; height: 47px; padding: 4px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-label { display: none; }
  #navigation { display: flex; height: 100%; gap: 3px; overflow-x: auto; }
  .nav-item { min-width: max-content; min-height: 37px; padding: 0 10px; font-size: 12px; }
  .main-content { min-height: calc(100vh - 105px); margin: 47px 0 0; padding: 17px 12px 24px; }
}
@media (max-width: 520px) {
  .topbar { height: 54px; padding: 0 11px; }
  .app-shell { padding-top: 54px; }
  .brand span { display: none; }
  .account-bar { gap: 6px; }
  .account-trigger { min-width: 0; padding-right: 3px; }
  .account-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .account-name { max-width: 92px; font-size: 12px; }
  .account-balance { font-size: 10px; }
  .account-menu-panel { right: -3px; width: min(224px, calc(100vw - 22px)); }
  .sidebar { top: 54px; }
  .main-content { margin-top: 47px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 86px; padding: 11px; }
  .metric-value { margin-top: 8px; font-size: 18px; }
  .token-metric { min-height: 104px; }
  .metric-breakdown { gap: 1px 5px; font-size: 10px; }
  .consumption-details { gap: 1px 5px; font-size: 10px; }
  .performance-values { margin-top: 8px; }
  .activity-panel { margin-bottom: 10px; }
  .chart-summary { gap: 12px; padding-right: 8px; padding-left: 8px; }
  .chart-stat { min-width: 0; }
  .chart-stat strong { font-size: 14px; }
  .chart { gap: 4px; padding-right: 0; padding-left: 0; }
  .chart-bar { width: min(100%, 22px); }
  .chart-time { font-size: 10px; transform: scaleX(.8); }
  .page-heading h1 { font-size: 19px; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .table-footer .pagination { align-self: flex-end; }
  .billing-detail-modal { max-height: 92vh; }
  .billing-detail-body { padding: 18px 16px 20px; }
  .billing-detail-context { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .billing-detail-context > div + div { padding-top: 10px; padding-left: 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .billing-detail-factors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { align-items: stretch; flex-direction: column; }
  .card-code-row { align-items: stretch; flex-direction: column; }
  .card-code-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-code-actions > :only-child { grid-column: 1 / -1; }
  .payment-order-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .payment-qr { width: min(240px, 80vw); height: auto; aspect-ratio: 1; }
  .payment-order-meta strong { font-size: 20px; }
  .filters { gap: 7px; }
  .announcement-backdrop { padding: 10px; }
  .announcement-modal { max-height: 92vh; }
  .announcement-head, .announcement-list { padding-right: 16px; padding-left: 16px; }
  .announcement-foot { align-items: stretch; flex-direction: column; padding-right: 16px; padding-left: 16px; }
  .announcement-foot-actions { margin-left: 0; }
  .announcement-foot-actions .button { flex: 1; }
  .filter-field { min-width: calc(50% - 5px); flex: 1 1 calc(50% - 5px); }
  table { min-width: 700px; }
  .log-table { min-width: 860px; }
  .auth-panel { padding: 27px 22px 24px; border-radius: 18px; }
  .auth-panel::before { border-radius: 18px 18px 0 0; }
  .auth-screen { gap: 16px; padding: 32px 18px 40px; }
  .auth-orb.orb-c { display: none; }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; padding: 21px 18px; }
  .profile-hero .status-pill { margin-left: 84px; }
  .profile-details { grid-template-columns: minmax(0, 1fr); padding: 4px 18px 15px; }
  .profile-detail, .profile-detail:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line-soft); }
  .profile-detail:last-child { border-bottom: 0; }
}

/* Centered SMS-style toast */
.toast-region { top: max(78px, calc(env(safe-area-inset-top) + 20px)); right: auto; left: 50%; width: min(560px, calc(100vw - 28px)); justify-items: center; gap: 8px; transform: translateX(-50%); }
.toast { display: flex; width: fit-content; min-width: 0; min-height: 46px; max-width: 100%; align-items: center; gap: 9px; padding: 8px 10px 10px; border-radius: 999px; background: linear-gradient(135deg, rgb(255 255 255 / 98%), color-mix(in srgb, var(--toast-accent-soft) 32%, #fff)); box-shadow: 0 8px 18px rgb(28 45 70 / 10%), 0 2px 5px rgb(28 45 70 / 8%), inset 0 1px 0 rgb(255 255 255 / 98%); font-size: 13px; font-weight: 600; line-height: 1.4; animation: toastIn .28s cubic-bezier(.2,.8,.2,1); }
.toast:hover, .toast:focus-within { transform: translateY(-1px); box-shadow: 0 12px 24px rgb(28 45 70 / 13%), 0 3px 7px rgb(28 45 70 / 9%), inset 0 1px 0 rgb(255 255 255 / 98%); }
.toast::before { top: 50%; right: auto; bottom: auto; left: 10px; width: 5px; height: 5px; border: 0; border-radius: 50%; background: var(--toast-accent); transform: translateY(-50%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--toast-accent) 12%, transparent); }
.toast::after { top: -76px; right: -42px; width: 150px; height: 150px; opacity: .28; }
.toast-icon { width: 28px; height: 28px; flex: 0 0 28px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--toast-accent-soft) 84%, #fff); box-shadow: inset 0 1px 0 rgb(255 255 255 / 95%); }
.toast-icon::before { width: 14px; height: 14px; }
.toast-message { min-width: 0; flex: 1 1 auto; padding: 0 3px 0 1px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.toast-close { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; font-size: 15px; }
.toast-close:hover { transform: none; }
.toast-close:active { transform: scale(.9); }
.toast-progress { right: 14px; bottom: 3px; left: 14px; height: 2px; border-radius: 999px; opacity: .5; }
@keyframes toastIn { from { transform: translateY(-10px) scale(.94); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes toastOut { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(-7px) scale(.96); opacity: 0; } }
@media (max-width: 640px) {
  .toast-region { top: max(68px, calc(env(safe-area-inset-top) + 12px)); width: calc(100vw - 20px); }
  .toast { width: fit-content; max-width: 100%; min-height: 42px; gap: 8px; padding: 7px 8px 9px; }
  .toast-icon { width: 26px; height: 26px; flex-basis: 26px; }
  .toast-icon::before { width: 13px; height: 13px; }
  .toast-message { font-size: 12.5px; }
  .toast-close { width: 22px; height: 22px; flex-basis: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel, .auth-orb { animation: none !important; }
  .metric, .button, .nav-item, .panel, .model-card, tbody tr { transition: none !important; }
  .metric:hover, .button:hover, .refresh-button:hover, .logout-button:hover { transform: none !important; }
}
