/* 基础主题层：设计令牌（旧版）、元素基样式、登录页、应用壳、核心组件、早期响应式 */
/* 由 styles.css 按层切分（Phase 2a），层叠顺序与原文件一致，视觉不应变化。 */

:root {
  --ink: #17212b;
  --muted: #687583;
  --line: #dfe5e8;
  --canvas: #f4f6f7;
  --panel: #ffffff;
  --nav: #14262a;
  --nav-2: #1b3337;
  --accent: #0d806f;
  --accent-dark: #096658;
  --blue: #3274a8;
  --amber: #a66b15;
  --danger: #b4433a;
  --shadow: 0 12px 32px rgba(18, 38, 42, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; box-shadow: none; }
.hidden { display: none !important; }
.boot-splash { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; color: #9db2b5; background: #14282c; font-size: 13px; letter-spacing: .08em; }
.boot-splash.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: #72818a; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; }
.muted { color: var(--muted); }
.brand-mark { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); transform: rotate(45deg); }
.brand-mark span { position: absolute; width: 25px; height: 8px; border: 2px solid #60c6b4; border-left: 0; border-right: 0; }
.brand-mark span:first-child { transform: translateY(-8px); }
.brand-mark span:last-child { transform: translateY(8px); }
.brand-mark.small { width: 34px; height: 34px; border-color: rgba(255,255,255,.2); }
.brand-mark.small span { width: 16px; height: 6px; }
.brand-mark.small span:first-child { transform: translateY(-6px); }
.brand-mark.small span:last-child { transform: translateY(6px); }
.login-shell { display: grid; grid-template-columns: minmax(380px, 42%) 1fr; min-height: 100vh; }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 7vw, 110px); color: white; background: #14282c; }
.login-brand h1 { margin: 18px 0 10px; font-family: Georgia, serif; font-size: clamp(52px, 6vw, 84px); font-weight: 500; letter-spacing: 0; }
.login-brand .eyebrow { color: #67c8b7; }
.login-copy { margin: 0; color: #b9cacd; font-size: 18px; }
.trust-line { position: absolute; bottom: 44px; left: clamp(48px, 7vw, 110px); color: #9db2b5; font-size: 13px; }
.trust-line span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #55bea8; box-shadow: 0 0 0 5px rgba(85,190,168,.1); }
.login-panel { display: grid; place-items: center; padding: 32px; background: #f7f8f8; }
.login-form { width: min(100%, 400px); }
.login-form h2 { margin: 0; font-size: 34px; font-weight: 700; }
.login-form > .muted { margin: 10px 0 34px; font-size: 14px; }
label { display: grid; gap: 8px; margin-bottom: 18px; color: var(--ink); font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input, select { width: 100%; min-height: 44px; padding: 0 13px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; background: var(--panel); }
textarea { width: 100%; padding: 12px 13px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; resize: vertical; background: var(--bg-subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent); }
button { border: 0; }
.primary, .secondary { min-height: 40px; padding: 0 16px; border-radius: 5px; font-weight: 750; }
.primary { color: white; background: var(--accent); box-shadow: 0 3px 10px color-mix(in srgb, var(--green) 18%, transparent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: #34434c; border: 1px solid var(--line); background: var(--panel); }
.wide { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 0 18px; }
.login-help { margin-top: 24px; color: #829097; font-size: 12px; text-align: center; }
.inline-action { padding: 0; color: var(--accent); background: transparent; font-weight: 750; }
.mobile-brand { display: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 238px; display: flex; flex-direction: column; color: #d7e3e3; background: var(--nav); }
.app-brand { height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-brand strong { font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.sidebar nav { display: grid; gap: 5px; padding: 24px 14px; }
.sidebar nav button { height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 14px; color: #9fb1b4; text-align: left; border-radius: 5px; background: transparent; }
.sidebar nav button:hover, .sidebar nav button.active { color: white; background: var(--nav-2); }
.sidebar nav button.active { box-shadow: inset 3px 0 #55b8a7; }
.nav-icon { width: 20px; color: #75b9ad; font-size: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.connection { display: flex; gap: 9px; align-items: center; margin-bottom: 14px; color: #8ea4a7; font-size: 12px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #56ba8d; }
.logout { width: 100%; display: flex; justify-content: space-between; padding: 9px 0; color: #b7c7c9; background: transparent; text-align: left; }
.workspace { min-height: 100vh; margin-left: 238px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar h2 { margin: 0; font-size: 19px; }
.topbar .eyebrow { margin-bottom: 4px; letter-spacing: .6px; }
.account { display: flex; align-items: center; gap: 10px; }
.account > span { width: 36px; height: 36px; display: grid; place-items: center; color: white; border-radius: 50%; background: #2f6970; font-weight: 800; }
.account div { display: grid; }
.account strong { font-size: 13px; }.account small { color: var(--muted); font-size: 11px; }
.content { max-width: 1500px; margin: auto; padding: 30px 34px 50px; }
.view { display: none; }.view.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 23px; }
.section-head h3, .panel-head h3 { margin: 0 0 6px; font-size: 22px; }.section-head p, .panel-head p { margin: 0; color: var(--muted); font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.metric { min-height: 142px; display: flex; gap: 16px; align-items: flex-start; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.metric-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 4px; font-weight: 800; }
.metric-icon.green { color: #087563; background: #e5f3ef; }.metric-icon.blue { color: #266795; background: #e8f0f6; }.metric-icon.amber { color: #926015; background: #f6efe3; }
.metric small { display: block; color: var(--muted); font-size: 12px; }.metric strong { display: block; margin: 4px 0; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }.metric p { margin: 0; color: #89949a; font-size: 11px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16px; }
.text-button { color: var(--accent); background: transparent; font-size: 13px; font-weight: 700; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search { position: relative; width: min(360px, 100%); margin: 0; }.search span { position: absolute; left: 13px; top: 12px; color: #879399; font-size: 18px; }.search input { padding-left: 38px; }
.count-label { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 15px 20px; border-bottom: 1px solid #e8ecee; text-align: left; font-size: 13px; }
th { color: #78848b; background: #fafbfb; font-size: 11px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: var(--bg-subtle); }
td strong { display: block; color: #263740; } td small { color: var(--muted); }
.right { text-align: right; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; font-size: 11px; font-weight: 750; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { color: var(--green-ink); background: var(--green-bg); }.badge.off { color: #777f84; background: var(--gray-bg); }.badge.pending { color: var(--amber-ink); background: var(--amber-bg); }
.row-actions { display: inline-flex; gap: 6px; align-items: center; }.row-actions button { min-height: 30px; padding: 0 9px; color: #53636b; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font-size: 12px; }.row-actions button.danger { color: var(--danger); }
.qty-input { width: 64px; min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); font-size: 12px; }
.resource-tabs { display: flex; gap: 5px; margin-bottom: 14px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.resource-tabs button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; color: #617078; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font-size: 12px; font-weight: 700; }
.resource-tabs button.active { color: white; border-color: var(--accent); background: var(--accent); }
#dataTabs { display: grid !important; }
#adminBillingTabs { display: flex; }
.tenant-billing-pane.hidden { display: none !important; }
.data-pane { display: none; }.data-pane.active { display: block; }
.section-head.compact { align-items: center; margin-bottom: 12px; }
.section-head.compact h3 { font-size: 16px; margin: 0; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.segmented button { min-height: 32px; padding: 0 14px; color: var(--muted); border-radius: 3px; background: transparent; font-size: 12px; font-weight: 700; }
.segmented button.active { color: white; background: var(--nav-2); }
.query-panel { padding: 18px; margin-bottom: 14px; }
.query-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)) auto; gap: 12px; align-items: end; }
.query-grid label { margin: 0; }.query-grid button { min-height: 44px; }
.monitor-results { min-height: 320px; }
.billing-current { margin-bottom: 16px; }
.billing-section { margin-top: 16px; }
.redeem-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px; }
.redeem-panel h3 { margin: 0 0 5px; font-size: 16px; }.redeem-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.inline-form { width: min(500px, 100%); display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; }
.inline-form input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.recovery-claim-result { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid #cfe1f5; border-radius: 7px; background: #f6faff; }
.recovery-record-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.recovery-record-row > span { color: var(--muted); font-size: 11px; }
.recovery-record-row code { min-width: 0; padding: 8px 9px; overflow-wrap: anywhere; color: var(--ink); border: 1px solid #dbe7f4; border-radius: 5px; background: var(--panel); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.4; }
.recovery-record-row button { min-height: 34px; padding-inline: 10px; white-space: nowrap; }
.recovery-claim-result > small { color: var(--muted); font-size: 11px; }
.recovery-claim-result > small strong { color: var(--text-2); font-weight: 700; }
.account-panel { max-width: 620px; padding: 24px; }
.account-panel form { max-width: 460px; }
.quota-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quota-item { min-width: 0; padding: 22px; }
.quota-item + .quota-item { border-left: 1px solid var(--line); }
.quota-item-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.quota-item strong { display: block; margin: 7px 0 12px; font-size: 22px; }
.quota-track { height: 7px; overflow: hidden; border-radius: 3px; background: #e8edef; }
.quota-track i { display: block; height: 100%; max-width: 100%; background: var(--accent); }
.quota-item.over .quota-track i { background: var(--danger); }
.quota-warning { margin-bottom: 16px; padding: 14px 16px; color: #7d302b; border: 1px solid #e5b9b5; border-radius: 5px; background: #fff1ef; font-size: 13px; line-height: 1.6; }
.billing-admin-pane { display: none; }
.billing-admin-pane.active { display: block; }
.status-text { color: var(--muted); font-size: 12px; }
.empty { padding: 54px 20px; color: var(--muted); text-align: center; }.empty > span { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; color: var(--accent); border: 1px solid #b8d8d2; border-radius: 50%; font-size: 23px; }.empty h4 { margin: 0 0 7px; color: var(--ink); }.empty p { margin: 0 0 18px; font-size: 13px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font-size: 20px; }
.menu-button { display: grid; }
dialog { width: min(94vw, 570px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 0; border-radius: 7px; box-shadow: 0 25px 90px rgba(13,33,37,.28); }
dialog.wide-dialog { width: min(94vw, 720px); }
dialog::backdrop { background: rgba(10,28,32,.55); }
dialog form { padding: 25px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }.dialog-head h3 { margin: 0; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }.form-grid .full { grid-column: 1 / -1; }
.switch-list { margin: 4px 0 18px; border: 1px solid var(--line); border-radius: 5px; }
.switch-list label { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 0; padding: 13px; }.switch-list label + label { border-top: 1px solid var(--line); }.switch-list span { display: grid; gap: 3px; }.switch-list input { width: 36px; min-height: 20px; accent-color: var(--accent); }
.switch-list label.disabled { opacity: .55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.notice { padding: 12px; color: var(--text-2); border-left: 3px solid var(--amber); background: #faf6ed; font-size: 12px; line-height: 1.6; }
.check-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; }
.check-list label { display: flex; align-items: center; gap: 11px; margin: 0; padding: 13px; }
.check-list label + label { border-top: 1px solid var(--line); }
.check-list input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.check-list span { display: grid; gap: 3px; }.check-list strong { font-size: 13px; }.check-list small { color: var(--muted); }
.toast { position: fixed; z-index: 100; right: 24px; top: 68px; max-width: min(420px, calc(100vw - 48px)); padding: 13px 16px; color: white; border-radius: 5px; background: #263a3e; box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); pointer-events: none; transition: .2s; font-size: 13px; }.toast.show { opacity: 1; transform: none; }.toast.error { background: #9e3d37; }
@media (max-width: 1024px) {
  .login-shell { grid-template-columns: 1fr; }.login-brand { display: none; }.mobile-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 52px; color: var(--nav); font-family: Georgia, serif; font-size: 21px; }.mobile-brand .brand-mark { border-color: #8bacad; }.login-panel { min-height: 100vh; padding: 28px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }.sidebar.open { transform: none; }.workspace { margin-left: 0; }.menu-button { display: grid; }.topbar { justify-content: flex-start; gap: 15px; padding: 0 18px; }.topbar .account { margin-left: auto; }.content { padding: 24px 18px 45px; }.metrics { grid-template-columns: 1fr; }.metric { min-height: 112px; }.section-head { align-items: flex-start; }.account div { display: none; }
  .query-grid { grid-template-columns: 1fr 1fr; }
  .quota-grid { grid-template-columns: 1fr; }
  .quota-item + .quota-item { border-top: 1px solid var(--line); border-left: 0; }
  .redeem-panel { align-items: stretch; flex-direction: column; }
}
@media (max-width: 768px) {
  .section-head { flex-direction: column; }.section-head .primary { width: 100%; }.form-grid { grid-template-columns: 1fr; }.form-grid .full { grid-column: auto; }.topbar h2 { font-size: 16px; }.content { padding-inline: 12px; }.panel { border-radius: 4px; }.toolbar { align-items: stretch; flex-direction: column; }.row-actions { display: grid; grid-template-columns: 1fr 1fr; }.dialog-actions button { flex: 1; }
  .query-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }.inline-form button { min-height: 44px; }
}

