/* ==========================================================================
   网页版外壳 · 登录 + 控制台
   说明：本文件依赖同目录的 style.css（提供表格 .tbl、指标格 .kpi-row、
        图表 .chart、状态标 .chip 等基础件），必须在其之后加载。
   ========================================================================== */

/* ---------------------------------------------------------------- 全局底 */

body.is-login { background: #eef1f6; }
body.is-app   { background: var(--plane); }

/* ---------------------------------------------------------------- 登录页 */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(1000px 520px at 50% -8%, #dce7f8 0%, rgba(220, 231, 248, 0) 68%),
    #eef1f6;
}

.login-card {
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 36px 30px;
  box-shadow: 0 12px 40px rgba(11, 11, 11, 0.07);
}

.login-card .lg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.login-card .lg-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--series-1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex: none;
}

.login-card .lg-name { display: block; font-size: 15px; font-weight: 600; }
.login-card .lg-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.login-card .lg-lede {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--ink-2);
}

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(11, 11, 11, 0.16);
  border-radius: 9px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.field input:focus {
  border-color: var(--series-1);
  box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.15);
}

.login-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(208, 59, 59, 0.07);
  border: 1px solid rgba(208, 59, 59, 0.3);
  color: #a52a2a;
  font-size: 12.5px;
  font-weight: 600;
}
.login-error[hidden] { display: none; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, filter 120ms;
}

.btn-primary { background: var(--series-1); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }

.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border-color: rgba(11, 11, 11, 0.16);
}
.btn-ghost:hover { background: rgba(11, 11, 11, 0.03); }

.btn-block { width: 100%; }

.btn-sm {
  height: 32px;
  padding: 0 13px;
  font-size: 12.5px;
  border-radius: 7px;
}

/* ---------------------------------------------------------------- 控制台骨架 */

.console {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.console[hidden] { display: none; }
.login-wrap[hidden] { display: none; }

.topbar {
  flex: none;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .tb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
}

.topbar .tb-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--series-1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.topbar .tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--ink-2);
}

.topbar .tb-balance {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.topbar .tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 18px;
  border-left: 1px solid var(--border-soft);
}

.topbar .tb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(42, 120, 214, 0.12);
  color: var(--series-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.console-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  flex: none;
  width: 224px;
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: rgba(11, 11, 11, 0.035); }
.nav-item.on {
  background: rgba(42, 120, 214, 0.10);
  color: var(--series-1);
  font-weight: 600;
}
.nav-item svg { flex: none; }

.sidebar .sb-group {
  margin: 14px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 26px 32px 48px;
}

.view { display: none; }
.view.on { display: block; }

.inner { max-width: 1100px; margin: 0 auto; }

.page-head { margin-bottom: 20px; }
.page-head h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- 面板 */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head .ph-note { font-size: 12px; color: var(--muted); }

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------------------------------------------------------- 模型列表 */

.tbl-fixed { table-layout: fixed; }

.tbl .m-name { font-weight: 600; }
.tbl .m-desc { font-size: 12.5px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 支付页 */

.pay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.summary-row:first-of-type { border-top: 0; }
.summary-row .s-label { color: var(--ink-2); }
.summary-row .s-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pay-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--axis);
}
.pay-amount .pa-label { font-size: 13.5px; color: var(--ink-2); }
.pay-amount .pa-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.pay-wrap { max-width: 720px; }

.pay-actions {
  display: flex;
  justify-content: flex-end;
}
.pay-actions .btn {
  min-width: 184px;
  height: 46px;
  font-size: 15px;
}

/* ---------------------------------------------------------------- 弹窗 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal[hidden] { display: none; }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, 0.42);
}

.modal-card {
  position: relative;
  width: 344px;
  padding: 26px 26px 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(11, 11, 11, 0.20);
  text-align: center;
}

.modal-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(250, 178, 25, 0.16);
  color: #a9700a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-msg {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------------------------------------------------------------- 通用 */

.muted-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.stack { display: grid; gap: 18px; }
