:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0; color: #fff7fd; background: #160818;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 15px; font-weight: 400; line-height: 1.7; letter-spacing: 0; font-synthesis: none;
}
.top, main { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; }
a { color: #00e8f6; }
.card { border: 1px solid rgba(178,50,159,.35); border-radius: 18px; padding: 16px; margin-bottom: 14px; background: rgba(46,16,52,.78); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.65; }
th, td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; font-weight: 400; vertical-align: top; }
th { color: #d7c3df; font-size: 13px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
button, .primary, input, select, textarea { font-family: inherit; letter-spacing: 0; }
button, .primary { min-height: 36px; border-radius: 999px; border: 0; padding: 0 14px; color: #160818; background: #00e8f6; cursor: pointer; font-size: 14px; font-weight: 700; }
nav button.active { outline: 2px solid #00e8f6; }
dialog { width: min(760px, calc(100% - 24px)); border: 0; border-radius: 20px; background: #241028; color: white; }
dialog::backdrop { background: rgba(0,0,0,.55); }
.ghost { background: transparent; color: #fff7fd; border: 1px solid rgba(255,255,255,.24); }
.panel { border: 1px solid rgba(178,50,159,.35); border-radius: 18px; padding: 16px; margin-bottom: 14px; background: rgba(46,16,52,.78); }
.top strong { font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.panel h2, dialog h2, #status h1 { margin: 0 0 12px; font-size: 22px; font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.muted { color: #d7c3df; font-size: 14px; font-weight: 400; line-height: 1.75; }
.error { color: #ffb4c8; }
.form-grid, .price-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide, .row-actions, .price-row { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 400; line-height: 1.45; }
input, select, textarea { width: 100%; min-height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(8,0,12,.45); color: white; padding: 8px 12px; font-size: 16px; font-weight: 400; }
textarea { min-height: 88px; }
.franchise-head, .order-line, .row-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.order-line { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.api-docs { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }
.api-docs code { color: #00e8f6; }
.credit-rule { grid-template-columns: auto 1fr 120px auto; align-items: center; }
.credit-rule em { font-style: normal; color: #d7c3df; }
.agent-reset { display: flex; gap: 6px; align-items: center; }
.agent-reset input { min-width: 120px; }
@media (max-width: 800px) { .cards, .form-grid, .price-row { grid-template-columns: 1fr; } }
