:root {
  color-scheme: dark;
  --bg: #0c0f14;
  --panel: #141920;
  --panel-2: #1a2029;
  --line: #2a323e;
  --text: #f3f5f7;
  --muted: #8f9baa;
  --accent: #72e2a8;
  --accent-2: #5bbfef;
  --danger: #ff7b7b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(91, 191, 239, .14), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(114, 226, 168, .1), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  color: #07120d;
  background: var(--accent);
  cursor: pointer;
  font-weight: 750;
  transition: transform .16s ease, opacity .16s ease, border-color .16s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .42; }
button.ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}
.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 52px 0 80px; }
.topbar, .section-heading, .identity-head, .profile-title, .dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.055em; }
h2 { margin-bottom: 0; letter-spacing: -.025em; }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: .72rem; font-weight: 850; letter-spacing: .18em; }
.subtitle, .hint, .login-panel p, dialog p { color: var(--muted); }
.login-panel {
  margin-top: 64px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(20, 25, 32, .82);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  gap: 32px;
  align-items: center;
}
.login-panel form { display: flex; gap: 10px; }
input {
  min-width: 0;
  flex: 1;
  color: var(--text);
  background: #0b0e12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus { border-color: var(--accent-2); }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
.identity-card, .profile-card, .usage-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(26, 32, 41, .95), rgba(17, 22, 28, .95));
  box-shadow: var(--shadow);
}
.identity-card { border-radius: 24px; padding: 26px; }
.service, .pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 750; }
.service { color: var(--muted); background: #0e1217; }
.service i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.ready { color: var(--accent) !important; }
.danger { color: var(--danger) !important; }
.idle { color: var(--muted) !important; }
.current-account { margin: 30px 0 20px; display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); }
.current-account strong { color: var(--text); font-size: 1.65rem; letter-spacing: -.04em; }
.switch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch-button { text-align: left; color: var(--text); background: #0e1217; border-color: var(--line); }
.switch-button small { display: block; margin-top: 4px; color: var(--muted); font-weight: 550; }
.switch-button.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(114, 226, 168, .35); }
.process-meta { margin: 18px 0 0; color: #667180; font: .74rem ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.usage-section, .profiles-section { margin-top: 58px; }
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.usage-card { border-radius: 20px; padding: 24px; }
.usage-head, .quota-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.usage-head h3 { margin: 0; font-size: .95rem; font-weight: 650; color: #c6ced8; overflow-wrap: anywhere; }
.plan-badge { padding: 6px 10px; border-radius: 999px; color: #07120d; background: var(--accent); font-size: .76rem; font-weight: 900; letter-spacing: .08em; }
.quota-windows { display: grid; gap: 18px; margin-top: 24px; }
.quota-window + .quota-window { padding-top: 18px; border-top: 1px solid var(--line); }
.quota-row strong { font-size: .95rem; }
.quota-row span { color: #bcc7d2; font-size: .83rem; }
.meter { height: 9px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #090c10; border: 1px solid #252d37; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.quota-reset, .usage-meta, .usage-error { margin: 9px 0 0; color: var(--muted); font-size: .78rem; }
.usage-meta { margin-top: 20px; color: #657180; }
.usage-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.credits-list { display: grid; gap: 12px; margin-top: 18px; }
.credit-item { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #0b0e12; }
.credit-item-head, .credit-item-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.credit-item p { margin: 12px 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.credit-item-foot span { color: #7f8b99; font-size: .76rem; }
.credits-empty { padding: 24px 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.login-copy-panel { display: grid; gap: 12px; margin: 18px 0; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #0b0e12; }
.copy-field > span { grid-column: 1 / -1; color: var(--muted); font-size: .76rem; }
.copy-field code { min-width: 0; color: #d7e0e9; overflow-wrap: anywhere; }
.copy-field .device-code { color: var(--accent); font-size: 1.3rem; font-weight: 850; letter-spacing: .08em; }
.copy-actions { display: flex; gap: 8px; }
.compact, .button-link { padding: 8px 11px; font-size: .78rem; white-space: nowrap; }
.button-link { display: inline-flex; align-items: center; border-radius: 10px; color: #07120d; background: var(--accent); font-weight: 800; text-decoration: none; }
.profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.profile-card { border-radius: 18px; padding: 19px; }
.profile-title { align-items: flex-start; }
.pill { padding: 4px 8px; background: #0e1217; white-space: nowrap; }
dl { margin: 22px 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: .8rem; }
dt { color: #6f7a88; }
dd { margin: 0; color: #bac2cc; text-align: right; overflow-wrap: anywhere; }
.login-button { width: 100%; }
.notice { position: fixed; z-index: 20; top: 18px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: #17221c; box-shadow: var(--shadow); }
.notice.danger { background: #291717; }
.hidden { display: none !important; }
dialog { width: min(540px, calc(100% - 28px)); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(7px); }
.dialog-body { padding: 28px; }
.dialog-body.wide { width: 100%; }
.dialog-actions { justify-content: flex-end; margin-top: 26px; }
pre { min-height: 180px; max-height: 340px; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #080a0d; color: #cbd5df; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 28px; }
  .topbar, .section-heading { align-items: flex-start; }
  .identity-grid, .usage-grid, .profile-grid, .login-panel { grid-template-columns: 1fr; }
  .login-panel form { flex-direction: column; }
  .identity-grid { margin-top: 30px; }
  .hint { display: none; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-actions { flex-wrap: wrap; }
  .credit-item-foot { align-items: flex-start; flex-direction: column; }
}

/* Tencent single-admin layout; base design shared with the original console. */
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.top-actions, .account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.overview { margin-top: 36px; }
.overview .current-account { margin-bottom: 12px; }
.overview .subtitle { margin-bottom: 0; font-size: .85rem; line-height: 1.7; }
.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-card { padding: 24px; border-radius: 20px; }
.account-email { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; margin: 14px 0 22px; }
.profile-card.active { border-color: #487d62; }
.account-actions button { flex: 1; }
.usage-empty { color: var(--muted); font-size: .88rem; padding: 24px 0 8px; line-height: 1.7; }
.usage-head { flex-wrap: wrap; }
.usage-head h3 { color: var(--text); font-size: 1.1rem; }
.usage-card { min-width: 0; }
progress { display: block; width: 100%; height: 9px; margin-top: 12px; border: 0; border-radius: 99px; overflow: hidden; background: #090c10; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #090c10; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); }
#message { position: static; transform: none; margin-top: 24px; white-space: pre-wrap; }
#url { color: var(--accent-2); overflow-wrap: anywhere; }
#output { min-height: 80px; max-height: 160px; font-size: .8rem; }
details { margin-top: 20px; color: var(--muted); font-size: .85rem; }
summary { cursor: pointer; }
.footer-note { margin: 28px 0 0; text-align: center; font-size: .78rem; color: var(--muted); line-height: 1.8; }
.login-panel { margin-top: 40px; }
#auth h2 { margin-bottom: 10px; }
#auth p { margin-bottom: 0; font-size: .85rem; line-height: 1.7; }
#token-form button { white-space: nowrap; }
@media (max-width: 680px) {
 .topbar { flex-wrap: wrap; }
 .profile-grid { grid-template-columns: 1fr; }
 .overview, .usage-card, .profile-card { padding: 20px; }
 .usage-section, .profiles-section { margin-top: 34px; }
 .current-account { gap: 14px; flex-wrap: wrap; }
 .dialog-body { padding: 22px; }
 .account-actions button { min-width: 120px; }
 .login-panel { padding: 22px; gap: 22px; }
}
