:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  --page: #f2f5f1; --paper: #fbfcf9; --ink: #182920; --muted: #51665a;
  --line: #d8e3da; --green: #1b5c43; --green-deep: #114432; --green-wash: #e5f0e8;
  --rail: #132b21; --rail-text: #d1dfd4; --lime: #d3e891; --bad: #9d302e; --bad-wash: #f9ebea;
  --radius: 13px; --mono: "Cascadia Code", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: .9375rem; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
a { color: var(--green); text-underline-offset: .23em; }
button, a.action { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #55a77b; outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 2rem; letter-spacing: -.04em; line-height: 1.2; }
h2 { font-size: 1.15rem; line-height: 1.35; }
h3 { font-size: 1.02rem; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }
.mono, code, pre { font-family: var(--mono); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.rail { background: var(--rail); color: var(--rail-text); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 19px 20px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; }
.brand-mark { background: var(--lime); color: var(--rail); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; flex: 0 0 auto; font-family: var(--mono); font-size: .93rem; font-weight: 800; }
.rail .brand { color: var(--paper); padding-left: 7px; }
.rail-heading { color: #a4bcab; font-size: .75rem; margin: 35px 10px 9px; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a { color: var(--rail-text); text-decoration: none; display: flex; gap: 12px; align-items: center; padding: 10px 11px; border-radius: 8px; }
nav a:hover { background: #234534; color: var(--paper); }
nav a[aria-current="page"] { color: var(--paper); background: #315a44; font-weight: 680; }
nav a[aria-current="page"] .nav-icon { color: var(--lime); }
.nav-icon { color: #b3cdb9; font-family: var(--mono); width: 1.1rem; text-align: center; }
.rail-foot { padding: 14px 8px 0; border-top: 1px solid #375447; margin-top: auto; overflow-wrap: anywhere; }
.rail-foot small { color: #a7c1af; display: block; }
.workspace { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding: 12px clamp(18px, 3.4vw, 48px); background: var(--paper); }
.top strong { font-size: .83rem; color: var(--muted); font-weight: 620; }
.top-actions, .actions, .filterbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.filterbar { align-items: end; }
.main { padding: 30px clamp(16px, 3.4vw, 48px) 54px; max-width: 1560px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; flex-wrap: wrap; margin-bottom: 23px; }
.page-heading p { margin-top: 7px; color: var(--muted); }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; gap: 7px; padding: 7px 13px; border-radius: 8px; border: 1px solid #c7d8cc; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 620; }
button:hover, .button:hover { background: #e9f1eb; border-color: #a6c2ae; }
.primary { background: var(--green); color: var(--paper); border-color: var(--green); }
.primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.danger { color: var(--bad); }
.subtle { border-color: transparent; background: transparent; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel > header, .section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 14px; }
.panel > header p, .section-head p { color: var(--muted); margin-top: 4px; }
.stack { display: grid; gap: 16px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 16px; align-items: start; }
.wallet-strip { color: var(--paper); background: var(--green-deep); padding: 22px 25px; border-radius: var(--radius); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px; }
.wallet-strip h2 { font-size: .90rem; color: #cfdfd1; }
.wallet-strip p { color: #bbd0c1; font-size: .84rem; }
.wallet-strip .money { font-variant-numeric: tabular-nums; font-size: 2.1rem; font-weight: 720; letter-spacing: -.045em; }
.wallet-strip .button { background: var(--lime); border-color: var(--lime); color: var(--rail); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.stat { background: var(--paper); padding: 15px 17px; border-radius: var(--radius); border: 1px solid var(--line); }
.stat span { color: var(--muted); }
.stat strong { display: block; margin-top: 4px; font-size: 1.43rem; font-variant-numeric: tabular-nums; }
.filterbar select, .filterbar input { width: auto; min-width: 110px; }
.plot { display: flex; min-height: 110px; border-bottom: 1px solid var(--line); align-items: end; gap: 5px; overflow-x: auto; padding: 9px 5px 0; }
.bar { display: grid; align-content: end; justify-items: center; min-width: 39px; flex: 1; height: 104px; font-size: .68rem; color: var(--muted); }
.bar i { display: block; width: min(20px, 85%); background: #519671; border-radius: 3px 3px 0 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; text-align: left; }
th { font-weight: 650; color: var(--muted); background: #edf3ee; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td small { display: block; }
td .actions { flex-wrap: nowrap; }
td button { min-height: 32px; padding: 4px 9px; white-space: nowrap; }
td code { overflow-wrap: anywhere; }
.pill { display: inline-block; border-radius: 100px; padding: 2px 9px; color: #1e583e; background: var(--green-wash); white-space: nowrap; font-size: .75rem; }
.pill.off { background: var(--bad-wash); color: var(--bad); }
.empty { text-align: center; padding: 21px 12px; color: var(--muted); }
.product { border-top: 1px solid var(--line); padding: 13px 0; display: grid; gap: 7px; }
.product:last-child { padding-bottom: 0; }
.product-top { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.product p { color: var(--muted); font-size: .85rem; }
.product code { font-size: .76rem; color: #28503c; overflow-wrap: anywhere; }
.price { font-size: .89rem; font-weight: 700; white-space: nowrap; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; min-width: 0; }
label span { font-weight: 630; font-size: .86rem; }
input, select, textarea { width: 100%; min-width: 0; color: var(--ink); background: #f7faf6; border: 1px solid #c5d6c9; border-radius: 8px; padding: 8px 10px; min-height: 39px; }
input[type=file] { font-size: .82rem; }
textarea { resize: vertical; min-height: 102px; }
textarea.code-field { font-family: var(--mono); font-size: .86rem; }
input[type=checkbox] { width: 16px; min-height: 16px; accent-color: var(--green); }
.check { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 9px 11px; min-width: 0; }
fieldset legend { padding: 0 5px; font-size: .84rem; }
.scopes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.alert { border: 1px solid #e8c0bf; background: var(--bad-wash); color: var(--bad); padding: 9px 12px; border-radius: 8px; font-size: .88rem; }
.note { background: var(--green-wash); color: #254737; padding: 10px 12px; border-radius: 8px; font-size: .86rem; }
.billing-rules { margin: 0; }
.billing-rules > div { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 8px 16px; padding: 10px 0; }
.billing-rules > div + div { border-top: 1px solid var(--line); }
.billing-rules dt { font-weight: 650; }
.billing-rules dd { margin: 0; color: var(--muted); }
pre { margin: 0; padding: 13px; background: #eaf0ea; border-radius: 8px; overflow: auto; max-height: 490px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; }
details { padding: 10px 0; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 620; }
details pre, details p { margin-top: 8px; }
dialog { color: var(--ink); border: 1px solid var(--line); background: var(--paper); border-radius: 14px; max-height: 90vh; width: min(570px, calc(100vw - 24px)); padding: 20px; box-shadow: 0 19px 74px #132b2142; }
dialog::backdrop { background: #132b2166; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
#toast { position: fixed; z-index: 5; bottom: 18px; right: 18px; color: var(--paper); background: var(--green-deep); border-radius: 8px; padding: 10px 16px; box-shadow: 0 6px 22px #132b2130; }
.auth { display: grid; grid-template-columns: minmax(0,1.04fr) minmax(0,1fr); min-height: 100vh; }
.auth-side { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; background: var(--rail); color: var(--paper); padding: clamp(24px, 6vw, 90px); }
.auth-side h1 { font-size: 2.55rem; line-height: 1.2; }
.auth-side p { color: #c3d4c8; max-width: 37ch; margin-top: 12px; }
.auth-list { border-top: 1px solid #476453; padding-top: 14px; color: #bbd5c1; }
.auth-main { display: grid; place-items: center; padding: 28px; }
.auth-form { width: min(100%, 410px); }
.auth-form > p { margin: 8px 0 21px; }
.auth-form .actions { margin-top: 16px; justify-content: space-between; }
.auth-form form .primary { margin-top: 3px; }
.public-nav { display: flex; justify-content: space-between; align-items: center; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px max(20px, 5vw); }
.public-content { max-width: 1060px; padding: 28px 20px; margin: 0 auto; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .rail { position: static; height: auto; padding: 9px 12px; }
  .rail .brand, .rail-foot, .rail-heading { display: none; }
  nav { flex-direction: row; flex-wrap: wrap; }
  nav a { flex-shrink: 0; padding: 7px 8px; gap: 5px; font-size: .82rem; }
  .top { padding: 10px 13px; }
  .main { padding-top: 20px; }
  .two { grid-template-columns: 1fr; }
  .billing-rules > div { grid-template-columns: 1fr; gap: 4px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth { grid-template-columns: 1fr; min-height: auto; }
  .auth-side { padding: 25px; gap: 18px; }
  .auth-side h1 { font-size: 1.65rem; }
  .auth-list { display: none; }
}

