:root {
  --navy: #102a4a;
  --blue: #176bcb;
  --blue-hover: #0e58ad;
  --blue-pale: #edf6ff;
  --ink: #162235;
  --muted: #6b7788;
  --border: #dce5ee;
  --page: #f5f8fb;
  --danger: #b3261e;
  --shadow: 0 12px 30px rgba(20, 48, 83, .08);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); color: var(--ink); font: 15px/1.6 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(70, 147, 235, .48); outline-offset: 2px; }
.portal-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 28px; background: var(--navy); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
.portal-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; font-weight: 650; text-decoration: none; letter-spacing: .02em; }
.portal-brand span { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 7px; color: #cfe7ff; font-family: Georgia, serif; font-size: 16px; }
.portal-back, .portal-nav a { color: #cfe1f3; font-size: 13px; text-decoration: none; }
.portal-back:hover, .portal-nav a:hover { color: #fff; }
.portal-nav { display: flex; gap: 18px; }
.account-page, .admin-page { width: min(100% - 40px, 1000px); margin: 0 auto; padding: 56px 0 70px; }
.account-page { width: min(100% - 40px, 560px); }
.page-intro { margin-bottom: 24px; }
.eyebrow { margin: 0 0 4px; color: #5b88ad; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
h1 { margin: 0; color: #1c3551; font-size: clamp(26px, 5vw, 32px); line-height: 1.25; }
.page-intro > p:last-child { margin: 8px 0 0; color: var(--muted); }
.panel, .filter-panel, .usage-panel { border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.panel { padding: 28px; }
.panel.loading { color: var(--muted); text-align: center; }
.panel h2, .usage-heading h2 { margin: 0; color: #203b58; font-size: 20px; }
.panel-description { margin: 6px 0 22px; color: var(--muted); font-size: 13px; }
.account-form { display: grid; gap: 16px; }
.account-form label, .filter-panel label { display: grid; gap: 6px; color: #40576f; font-size: 13px; font-weight: 600; }
input, select { min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd9e7; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: #6fa7df; box-shadow: 0 0 0 3px rgba(75,148,222,.12); outline: 0; }
.button { min-height: 38px; border: 1px solid transparent; border-radius: 8px; padding: 7px 13px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .16s ease, border-color .16s ease; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--blue-hover); }
.button-secondary { border-color: #cbd9e7; background: #fff; color: #315474; }
.button-secondary:hover:not(:disabled) { border-color: #8db1d3; background: #f7fbff; }
.button-danger { border-color: #efc7c3; background: #fff7f6; color: var(--danger); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.form-status { margin: 0; padding: 8px 10px; border: 1px solid #f2c6c4; border-radius: 8px; background: #fff7f6; color: #9d2924; font-size: 13px; }
.identity-list { display: grid; gap: 11px; margin: 22px 0; }
.identity-list div { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #edf1f5; }
.identity-list dt { color: var(--muted); font-size: 13px; }
.identity-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #294866; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-panel { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(190px, 1.45fr) auto; align-items: end; gap: 14px; padding: 18px; }
.filter-search { min-width: 0; }
.filter-actions { display: flex; gap: 8px; }
.admin-status { margin: 16px 0; }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.summary-grid article { display: grid; gap: 5px; min-height: 100px; padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(20,48,83,.04); }
.summary-grid span { color: var(--muted); font-size: 12px; }
.summary-grid strong { color: #213f5d; font-size: clamp(17px, 2vw, 21px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pending-summary { border-color: #efd8a3 !important; background: #fffdf7 !important; }
.usage-panel { overflow: hidden; }
.usage-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 20px 15px; }
.usage-heading span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
table { width: 100%; min-width: 1050px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: top; }
th { background: #f8fbfd; color: #4f6478; font-size: 12px; font-weight: 700; white-space: nowrap; }
td { color: #263c51; overflow-wrap: anywhere; }
.muted-cell { color: var(--muted); }
.cost-cell { color: #164f88; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pending-cell { color: #8a641a; white-space: nowrap; }
.empty-cell { padding: 32px; color: var(--muted); text-align: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 11px; padding: 15px 20px; }
.pagination span { color: var(--muted); font-size: 13px; }

@media (max-width: 850px) {
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: span 2; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .portal-topbar { padding: 0 16px; }
  .account-page, .admin-page { width: min(100% - 28px, 1000px); padding-top: 35px; }
  .portal-nav { gap: 12px; }
  .panel { padding: 21px; }
  .filter-panel { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid article { min-height: 88px; padding: 13px; }
  .pagination { justify-content: center; padding: 14px; }
}
