:root {
  color-scheme: light;
  --bg: #f4f7f5; --surface: #fff; --line: #d3dfd8;
  --text: #19352b; --muted: #526b60; --mint: #146b45;
  --amber: #855709; --danger: #b33342;
  --font: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { padding: 30px 18px; background: #edf4ef; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; font-size: 21px; font-weight: 700; margin: 0 10px 38px; }
.brand-icon { font-size: 34px; color: var(--mint); }
.brand-en { display: block; font-size: 14px; letter-spacing: 1px; color: var(--muted); }
.side-label { font-size: 14px; color: var(--muted); margin: 0 14px 12px; }
.nav { background: none; border: 0; color: var(--muted); width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 13px 12px; border-radius: 9px; margin-bottom: 6px; min-height: 48px; }
.nav > span:first-child { font-size: 22px; }
.nav.selected { background: #dcece1; color: #125637; font-weight: 650; }
.nav-badge { margin-left: auto; background: #c7e1d1; padding: 0 8px; border-radius: 5px; font-size: 14px; }
.side-note { margin: 30px 10px 0; border-top: 1px solid var(--line); padding-top: 24px; font-size: 15px; }
.side-note p { color: var(--muted); margin-top: 10px; font-size: 14px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 8px; }
.sidebar-bottom { margin-top: auto; padding: 30px 10px 0; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
main { min-width: 0; padding: 0 32px; max-width: 1800px; width: 100%; margin: 0 auto; }
header { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.breadcrumb { color: var(--muted); }
.breadcrumb span { margin: 0 10px; }
.server-state { display: flex; align-items: center; color: var(--muted); }
.server-state time { margin-left: 20px; font-variant-numeric: tabular-nums; font-size: 14px; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 36px 0 28px; }
.eyebrow { font-size: 14px; letter-spacing: 1.5px; color: var(--mint); font-weight: 650; }
h1 { font-size: 36px; letter-spacing: -.5px; font-weight: 700; margin: 9px 0; line-height: 1.4; }
.title-dot { color: var(--mint); padding-left: 3px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.heading-actions { display: flex; gap: 10px; }
.button { min-height: 44px; padding: 10px 17px; border-radius: 8px; border: 1px solid transparent; font-size: 15px; font-weight: 650; white-space: nowrap; }
.button.primary { background: var(--mint); color: #fff; }
.button.primary:hover { background: #105436; }
.button.secondary { background: #fff; border-color: #bacfc1; color: var(--text); }
.button.secondary:hover { background: #edf5ef; border-color: #719780; }
.button.danger { color: var(--danger); background: #fff1f2; border-color: #e8c4c9; }
.button.compact { padding: 8px 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 28px; box-shadow: 0 2px 8px #183e2710; }
.stat { padding: 20px 24px; position: relative; }
.stat + .stat:before { position: absolute; content: ""; height: 64%; width: 1px; background: var(--line); left: 0; top: 18%; }
.stat > span { color: var(--muted); font-size: 16px; }
.stat > div { font-size: 38px; line-height: 1.5; font-variant-numeric: tabular-nums; font-weight: 700; }
.stat > small { font-size: 14px; color: var(--muted); }
.mint { color: var(--mint); }
.amber { color: var(--amber); }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.filter-tabs { display: flex; gap: 22px; }
.filter { background: none; border: 0; min-height: 44px; padding: 10px 0; color: var(--muted); font-size: 16px; border-bottom: 3px solid transparent; }
.filter.active { color: var(--mint); border-bottom-color: var(--mint); font-weight: 650; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tools input { width: 180px; }
.tools input, .tools select { min-height: 44px; padding: 9px 11px; border: 1px solid #bacfc1; background: #fff; border-radius: 7px; font-size: 14px; color: var(--text); }
input::placeholder { color: #607568; opacity: 1; }
.cards { --card-columns: 2; --card-gap: 22px; display: grid; grid-template-columns: repeat(var(--card-columns), minmax(0, 1fr)); gap: var(--card-gap); align-items: start; position: relative; }
.cards.masonry-ready { display: block; }
.cards.masonry-ready > .quota-card { position: absolute; width: calc((100% - (var(--card-columns) - 1) * var(--card-gap)) / var(--card-columns)); }
.quota-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; position: relative; box-shadow: 0 3px 12px #183e2708; }
.quota-card.connected:before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: #63a57c; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 22px 16px; gap: 12px; }
.provider-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.provider-mark { width: 44px; height: 44px; border-radius: 10px; border: 1px solid #cce0d2; display: grid; place-items: center; font-size: 22px; color: var(--mint); background: #e4f2e9; font-weight: 700; flex-shrink: 0; }
.provider-mark.claude { background: #fff0e6; color: #8b4b20; border-color: #eed4c0; }
.provider-mark.cursor { background: #e9f0fa; color: #35567e; border-color: #ccd8e9; }
.provider-mark.openaiapi { background: #f1edfb; color: #665093; border-color: #dcd4ed; }
.provider-title h2 { font-size: 20px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.account-name { font-size: 14px; color: var(--muted); margin-top: 4px; }
.status-chip { font-size: 14px; padding: 4px 10px; border-radius: 20px; background: #e3f2e7; color: #125d38; white-space: nowrap; }
.status-chip.warning { background: #fff0d2; color: #7d5007; }
.status-chip.error { background: #fde9ec; color: #a52838; }
.status-chip.muted { background: #eaf0ed; color: #496356; }
.card-content { padding: 0 22px 20px; }
.plan-line { font-size: 14px; color: var(--muted); margin-bottom: 14px; overflow-wrap: anywhere; }
.plan-line b { display: inline-block; font-size: 14px; border: 1px solid #c7d9cd; background: #f2f7f3; padding: 2px 8px; border-radius: 5px; font-weight: 600; color: #2e5740; margin: 0 7px 4px 0; }
.quota-window { padding: 18px 0; border-top: 1px solid var(--line); }
.window-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 16px; }
.window-heading > span { color: var(--text); }
.remaining { font-size: 30px; font-weight: 700; color: var(--mint); line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.remaining small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.remaining.low { color: var(--amber); }
.remaining.critical { color: var(--danger); }
.remaining.unknown { font-size: 17px; color: var(--muted); }
.progress { height: 8px; background: #e0eae3; border-radius: 10px; overflow: hidden; margin-top: 14px; }
.progress > i { height: 100%; display: block; background: #218450; border-radius: 10px; }
.progress > i.low { background: #b47715; }
.progress > i.critical { background: #c14350; }
.progress.unknown { background: repeating-linear-gradient(135deg, #dbe6df, #dbe6df 7px, #f0f5f1 7px, #f0f5f1 14px); }
.window-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.countdown { color: #345b45; white-space: nowrap; }
.balance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 15px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.balance > span { flex: 1 1 120px; min-width: 0; }
.balance-value { min-width: 0; max-width: 100%; margin-left: auto; color: var(--text); text-align: right; font-size: 32px; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.balance-value small { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); font-weight: 400; }
.notice { background: #f0f6f2; border: 1px solid #d4e3d8; border-radius: 7px; color: #3d614b; padding: 11px 13px; margin-top: 12px; font-size: 14px; }
.pending-panel { border: 1px dashed #b6cdbd; border-radius: 8px; padding: 23px 17px; margin: 15px 0 8px; display: flex; gap: 13px; align-items: flex-start; color: var(--muted); min-height: 140px; background: #fafcfb; }
.pending-panel > span { font-size: 24px; color: #627a50; }
.pending-panel b { color: var(--text); font-size: 16px; }
.pending-panel p { font-size: 14px; color: var(--muted); margin: 7px 0 0; }
.card-error { font-size: 14px; color: var(--danger); margin-top: 10px; overflow-wrap: anywhere; }
.card-bottom { border-top: 1px solid var(--line); padding: 12px 22px; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #f7faf8; font-size: 14px; color: var(--muted); }
.card-controls { display: flex; gap: 13px; align-items: center; flex-wrap: wrap; }
.text-button { min-height: 36px; padding: 3px 2px; border: 0; background: none; color: var(--mint); font-size: 14px; font-weight: 600; }
.text-button:hover { color: #0b4c2c; text-decoration: underline; }
.card-controls a { font-size: 14px; padding: 3px 0; }
.trend { height: 36px; margin-top: 10px; width: 100%; }
.trend-label { font-size: 14px; color: var(--muted); }
.skeleton, .empty { grid-column: 1/-1; padding: 60px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.coverage-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 26px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 14px; background: #edf5ef; }
.coverage-note > span:first-child { font-size: 20px; color: var(--mint); }
.coverage-note p { margin: 0; flex: 1; }
.coverage-note b { color: var(--text); }
.coverage-note > span:last-child { white-space: nowrap; color: var(--mint); font-size: 14px; padding-top: 3px; }
footer { padding: 24px 0 32px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 14px; }
footer button { color: var(--mint); background: none; border: 0; font-size: 14px; white-space: nowrap; }
dialog { background: #fff; color: var(--text); border: 1px solid #b9d0c0; border-radius: 14px; padding: 28px; width: min(720px, 94vw); max-height: 90vh; box-shadow: 0 30px 100px #19352b33; }
dialog::backdrop { background: #19352b55; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 23px; }
.dialog-heading h2 { font-size: 25px; margin: 7px 0 0; }
.icon-button { border: 0; background: none; color: var(--muted); font-size: 28px; line-height: 1; min-width: 40px; min-height: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: flex; flex-direction: column; font-size: 16px; gap: 8px; margin-bottom: 18px; color: var(--text); }
label input, label select { width: 100%; min-height: 46px; padding: 11px 12px; background: #f8fbf9; border: 1px solid #b5cbbd; border-radius: 7px; color: var(--text); font-size: 16px; }
label small { font-size: 14px; color: var(--muted); }
.form-help { border-left: 3px solid #6f9d7d; padding: 12px 14px; background: #eff6f1; color: #36583f; font-size: 15px; margin: 10px 0 20px; }
.form-help ol { padding-left: 22px; margin: 7px 0; }
.checkbox { flex-direction: row; align-items: center; gap: 10px; margin-top: 20px; }
.checkbox input { min-height: 0; width: 18px; height: 18px; accent-color: var(--mint); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.dialog-actions > span { flex: 1; }
.form-error { font-size: 15px; color: var(--danger); min-height: 20px; }
.manual-heading { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 12px; }
.manual-heading button { background: none; border: 0; color: var(--mint); font-size: 15px; }
.manual-row { display: grid; grid-template-columns: 1fr 96px 185px 30px; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.manual-row input { min-width: 0; width: 100%; padding: 9px; background: #f8fbf9; border: 1px solid #b5cbbd; border-radius: 5px; color: var(--text); font-size: 14px; }
.manual-row button { border: 0; background: none; color: var(--danger); font-size: 20px; }
[hidden] { display: none !important; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 13px 24px; border-radius: 8px; background: #e6f3eb; border: 1px solid #75a486; color: #16472a; box-shadow: 0 10px 40px #19352b26; z-index: 20; font-size: 16px; }
.error-banner { padding: 13px; color: var(--danger); border: 1px solid #e0afb7; background: #fff3f4; border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.stale-watermark { color: var(--amber); font-size: 14px; margin-top: 10px; }
.disabled-card { border-style: dashed; }
@media (min-width: 1900px) { .cards { --card-columns: 3; } }
@media (max-width: 1250px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding: 24px 12px; }
  .brand { font-size: 19px; margin: 0 5px 32px; }
  main { padding: 0 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stat { padding: 18px; }
}
@media (max-width: 1050px) { .cards { --card-columns: 1; } }
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { display: none; }
  main { padding: 0 18px; }
  header { min-height: 60px; }
  .cards { --card-columns: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3):before { display: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tools input { width: 170px; }
  .server-state time { display: none; }
  .coverage-note > span:last-child { display: none; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .manual-row { grid-template-columns: 1fr 85px 30px; }
  .manual-row input[type=datetime-local] { grid-column: 1/3; grid-row: 2; }
  .manual-row button { grid-column: 3; grid-row: 1; }
  h1 { font-size: 29px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .page-heading { padding-top: 28px; }
  .dialog-actions { flex-wrap: wrap; }
}
:root { --package-table-text: #243d30; }
.package-details { margin-top: 22px; border-top: 1px solid #d6e2da; padding-top: 16px; }
.package-details summary { cursor: pointer; font-size: 16px; font-weight: 650; color: #146b45; padding: 8px 0; }
.package-details p { font-size: 14px; line-height: 1.65; color: #526b60; margin: 8px 0 14px; }
.package-table-wrap { overflow-x: auto; }
.package-details table { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 16px; color: var(--package-table-text); }
.package-details th,.package-details td { text-align: left; vertical-align: top; border-bottom: 1px solid #d6e2da; padding: 12px 8px; line-height: 1.6; }
.package-details th { background: #f4f7f5; }
.package-details td small { display: block; font-size: 14px; color: #526b60; }
.quota-amounts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 16px; margin: 8px 0; }

.login-page{display:grid;place-items:center;min-height:100vh;background:#f3f6f9}.login-card{width:min(520px,calc(100% - 32px));padding:36px;background:white;border:1px solid #d7e0e9;border-radius:20px;box-shadow:0 16px 60px #263d5410}.login-card h1{font-size:32px}.login-card p{font-size:18px}.login-card form{display:grid;gap:18px;margin:24px 0}.login-card input{font-size:18px}.login-card small{font-size:14px;color:#536a7c}
[hidden] { display: none !important; }
.resource-list { margin: 18px 0; padding: 16px; border: 1px solid var(--border, #dce6df); border-radius: 12px; }
.resource-list > b { display: block; font-size: 16px; overflow-wrap: anywhere; }
.resource-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 16px; }
.resource-row > span { min-width: 0; overflow-wrap: anywhere; }
.resource-row small { display: block; margin-top: 5px; color: #65756b; font-size: 14px; }
.resource-row strong { flex-shrink: 0; font-size: 15px; }
