:root {
  color-scheme: light;
  --canvas: #f6f5f3;
  --paper: #fff;
  --ink: #292321;
  --muted: #635b57;
  --line: #e6e0dc;
  --red: #832e26;
  --red-dark: #67211b;
  --red-pale: #f7eae7;
  --green: #255e44;
  --green-pale: #e7f2ea;
  --amber: #80551a;
  --amber-pale: #f9f0dd;
  --sidebar: 232px;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button {
  padding: 7px 12px;
  min-height: 34px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #d9d1cc;
  border-radius: 5px;
  white-space: nowrap;
}
button:hover { background: #f8f5f2; }
button:disabled { opacity: .52; cursor: not-allowed; }
button.primary { background: var(--red); color: #fff; border-color: var(--red); font-weight: 600; }
button.primary:hover { background: var(--red-dark); }
button.text-button { padding: 2px 5px; min-height: 28px; background: transparent; border: 0; color: var(--red); }
button.text-button:hover { background: var(--red-pale); }
a { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
input, select, textarea {
  width: 100%;
  min-height: 37px;
  border: 1px solid #d8ceca;
  border-radius: 5px;
  padding: 7px 10px;
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 76px; resize: vertical; }
label { color: var(--muted); font-weight: 550; display: grid; align-content: start; gap: 6px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
code, pre { font: .94em ui-monospace, "SFMono-Regular", Consolas, monospace; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.login-page { display: grid; align-items: center; justify-items: center; min-height: 100vh; padding: 24px; background: #f5f1ee; }
.login-panel {
  width: min(100%,440px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 6px;
  padding: 36px 36px 40px;
  box-shadow: 0 16px 55px #37231d0b;
}
.login-panel h1 { margin: 0 0 27px; font-size: 23px; }
.login-panel h1 span { color: var(--red); }
.login-panel form { display: grid; gap: 17px; }
.login-submit { width: 100%; min-height: 41px; }
.admin-shell { min-width: 860px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #fbfaf9; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 88px; padding: 0 18px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; }
.brand strong { font-weight: 600; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.brand-seal { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 5px; background: var(--red); color: white; }
#main-nav { display: grid; gap: 4px; padding: 14px 11px; }
#main-nav button { text-align: left; width: 100%; min-height: 42px; padding-left: 14px; border: 0; background: transparent; border-radius: 4px; }
#main-nav button:hover { background: #f0ebe8; }
#main-nav button[aria-current] { background: var(--red-pale); color: var(--red-dark); font-weight: 650; box-shadow: inset 3px 0 var(--red); }
.workspace { margin-left: var(--sidebar); }
.topbar {
  height: 63px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px;
  position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); }
.slash { color: #8d837d; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; }
.account-menu summary::after { content: " ▾"; }
.popover { position: absolute; top: 41px; right: 0; display: grid; min-width: 146px; padding: 6px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 8px 22px #32251d1a; z-index: 10; }
.popover button { border: 0; text-align: left; }
.main-content { max-width: 1700px; padding: 25px 30px 52px; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.tabs { display: flex; gap: 5px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs:empty { display: none; }
.tabs button { background: transparent; border: 0; border-radius: 3px 3px 0 0; min-height: 42px; padding: 6px 14px; }
.tabs button[aria-current] { box-shadow: inset 0 -2px var(--red); color: var(--red-dark); font-weight: 650; }
.notice:empty { display: none; }
.notice { margin-bottom: 13px; color: var(--muted); }
.notice[data-tone="error"] { color: var(--red-dark); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 16px; }
.panel > h2, .panel > h3 { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 16px; }
.table-toolbar, .action-line, .pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-toolbar { padding: 12px; border-bottom: 1px solid var(--line); }
.table-toolbar input { width: 210px; }
.table-toolbar select { width: auto; min-width: 110px; }
.table-toolbar details { position: relative; }
.table-toolbar summary { padding: 7px 9px; color: var(--muted); }
.table-toolbar details div { min-width: 120px; box-shadow: 0 6px 14px #37231d19; position: absolute; right: 0; z-index: 2; padding: 9px; border: 1px solid var(--line); background: white; }
.table-toolbar details label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.table-toolbar details input[type=checkbox] { min-height: 0; width: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 12px; white-space: nowrap; vertical-align: middle; text-align: left; }
th { color: var(--muted); background: #f9f7f5; }
th button { color: inherit; border: 0; padding: 0; min-height: 0; background: transparent; font-weight: 600; }
td { font-variant-numeric: tabular-nums; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffdfb; }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.pagination { justify-content: flex-end; padding: 10px 12px; color: var(--muted); border-top: 1px solid var(--line); }
.badge { border-radius: 4px; padding: 2px 7px; background: #eeeae6; color: #5c504a; display: inline-block; }
.badge[data-status="published"], .badge[data-status="paid"], .badge[data-status="active"], .badge[data-status="normal"] { background: var(--green-pale); color: var(--green); }
.badge[data-status="draft"], .badge[data-status="pending"], .badge[data-status="processing"], .badge[data-status="degraded"] { background: var(--amber-pale); color: var(--amber); }
.badge[data-status="error"], .badge[data-status="refunded"] { background: var(--red-pale); color: var(--red-dark); }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; margin-bottom: 16px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; }
.metric { background: var(--paper); padding: 14px 16px; color: var(--muted); }
.metric strong { color: var(--ink); display: block; font-size: 29px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.detail-panel { width: min(650px,98vw); max-width: 100%; height: 100%; max-height: 100%; border: 0; border-left: 1px solid var(--line); margin: 0 0 0 auto; padding: 0; background: var(--paper); }
.detail-panel::backdrop { background: #27211d4d; }
.detail-panel > header { background: var(--paper); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 15px 20px; position: sticky; top: 0; z-index: 1; }
#detail-body { padding: 16px 20px 24px; }
.detail-data { display: grid; grid-template-columns: minmax(110px,150px) 1fr; margin: 13px 0 18px; }
.detail-data dt, .detail-data dd { margin: 0; padding: 6px 0; min-width: 0; border-bottom: 1px solid var(--line); }
.detail-data dt { color: var(--muted); padding-right: 10px; }
.detail-data dd { overflow-wrap: anywhere; }
.detail-image { width: 140px; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .confirmation { margin-top: 5px; padding-top: 14px; border-top: 1px solid var(--line); }
.product-section { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.product-section legend { padding: 0 6px; font-weight: 600; }
.product-section h3 { margin: 0 0 6px; font-size: inherit; }
.product-section p { margin: 0; }
.product-wizard [hidden] { display: none !important; }
.product-steps { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0 0 0 24px; color: var(--muted); }
.product-steps [aria-current="step"] { color: var(--ink); font-weight: 700; }
.product-items { display: grid; gap: 8px; margin-bottom: 6px; }
.product-item { display: flex; align-items: start; gap: 8px; }
.product-item textarea { flex: 1; min-width: 0; }
.product-section .product-checkbox { display: flex; align-items: center; gap: 8px; }
.product-checkbox input { width: auto; }
.runtime-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.version-row { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.version-row:last-child { border-bottom: 0; }
.feature-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--line); }
.feature { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--paper); padding: 12px 16px; }
.muted { color: var(--muted); }
@media (max-width: 1280px) {
  :root { --sidebar: 220px; }
  .topbar, .main-content { padding-left: 22px; padding-right: 22px; }
}
