:root {
  color-scheme: light;
  --bg: #f2f5f3;
  --text: #192823;
  --muted: #53665f;
  --line: #d9e2dd;
  --accent: #125b48;
  --soft: #e8f3ee;
  font: 16px/1.5 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button {
  min-height: 42px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; white-space: nowrap;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #68ab95; outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.quiet { background: transparent; border-color: transparent; }
button.danger { color: #a62d28; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(21px, 4vw, 27px); line-height: 1.3; }
h2 { font-size: 19px; line-height: 1.35; }
h3 { font-size: 16px; line-height: 1.4; }
small { display: block; font-size: 12px; color: var(--muted); }
.muted, .hint { color: var(--muted); font-size: 14px; }
.hint { margin-top: -5px; }
.hint:empty { display: none; }
.error { color: #a62d28; font-size: 14px; }
.error:empty { display: none; }
.layout { width: min(1040px, 100% - 32px); margin-inline: auto; }
.bar { background: #fff; border-bottom: 1px solid var(--line); }
.bar-inner, .brand, .section-head, .card-head, .dialog-head, .dialog-actions, .search, .filters {
  display: flex; align-items: center; gap: 12px;
}
.bar-inner { min-height: 67px; justify-content: space-between; }
.brand strong { font-size: 15px; }
.mark {
  background: var(--accent); color: #fff; border-radius: 10px; display: inline-grid;
  width: 39px; height: 39px; flex: none; place-items: center; font-weight: 700;
}
.environment { padding: 19px 0 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.scope { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: #e6ece9; }
.scope button { border: 0; min-height: 36px; font-size: 14px; background: transparent; }
.scope [aria-pressed="true"] { background: #fff; color: var(--accent); font-weight: 700; }
.seller-switch { display: flex; gap: 6px; max-width: 100%; }
.seller-switch select { max-width: min(275px, 64vw); }
#account-alert-list { margin-top: 12px; }
#account-alert-list h3 { margin-bottom: 6px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 21px; }
.tabs button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 9px 3px; }
.tabs [aria-current] { color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 700; }
.section-head { justify-content: space-between; align-items: start; margin-bottom: 16px; }
.section-head p { margin-top: 5px; }
.panel, .card, .empty {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
}
.cards { display: grid; gap: 12px; }
.card-head { align-items: start; justify-content: space-between; }
.card h2 { font-size: 17px; overflow-wrap: anywhere; }
.rule-card { box-shadow: 0 3px 10px #1b433908; }
.overview {
  position: relative; align-items: center; padding: 22px; color: #fff; border-radius: 15px;
  background: radial-gradient(ellipse at 100% 20%, #2b7960 0%, transparent 57%), #164c3d;
}
.overview .eyebrow { margin-bottom: 6px; color: #c0e5d4; font-size: 12px; letter-spacing: .12em; }
.overview p { color: #deefe6; font-size: 14px; }
.overview button.primary { background: #fff; border-color: #fff; color: #154c3a; }
.last-run { margin-top: 9px; color: var(--muted); font-size: 13px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 3px 16px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.metrics { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; font-size: 14px; }
.metrics strong { display: block; font-variant-numeric: tabular-nums; }
.metrics div:nth-child(4) strong, .metrics div:nth-child(5) strong { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; align-items: center; }
.actions button { min-height: 40px; font-size: 14px; }
.pill { border-radius: 999px; background: #edf0ee; padding: 3px 9px; font-size: 12px; flex: none; }
.pill.on, .pill.changed, .pill.ready { background: var(--soft); color: var(--accent); }
.pill.error { background: #ffefeb; }
.pill.skip { background: #fff4df; color: #6a4e11; }
.notice { background: var(--soft); border: 1px solid #cee3d7; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.notice.bad { background: #fff0ed; border-color: #f4ccc6; color: #942923; }
.archive { margin: 14px 0; }
.archive summary { cursor: pointer; color: var(--muted); padding: 9px 0; }
.account-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-form, .login-card, #rule-form { display: grid; gap: 13px; align-content: start; }
.login { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); padding: 25px; }
.login-card h1 { margin-top: 4px; }
label { display: grid; gap: 5px; font-size: 14px; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 43px; color: inherit; border: 1px solid #cbd7d0;
  border-radius: 8px; padding: 9px 10px; background: #fff; font-size: 16px;
}
textarea { resize: vertical; }
.check { display: flex; align-items: start; gap: 8px; }
.check input { min-height: 0; width: 17px; height: 17px; margin: 2px 0; flex: none; accent-color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filters { margin-bottom: 12px; flex-wrap: wrap; align-items: end; }
.filters label { flex: 1; min-width: 130px; }
dialog {
  width: min(560px, 100% - 24px); max-height: 90dvh; padding: 18px; border: 1px solid var(--line);
  border-radius: 14px; color: var(--text); box-shadow: 0 16px 50px #10281e26;
}
dialog::backdrop { background: #14251d77; }
.dialog-head { justify-content: space-between; align-items: start; margin-bottom: 3px; }
.dialog-head button { min-height: 35px; padding: 3px 10px; }
.dialog-actions { justify-content: end; margin-top: 4px; }
.search { gap: 6px; margin-top: 5px; }
.search-results:not(:empty) { display: grid; gap: 5px; margin-top: 7px; max-height: 175px; overflow: auto; }
.search-results button { text-align: left; white-space: normal; }
.selection { background: var(--soft); padding: 9px; border-radius: 8px; overflow-wrap: anywhere; }
#preview-list { margin: 12px 0; }
#more-logs { margin: 12px 0 20px; }
section { padding-bottom: 26px; }
@media (max-width: 560px) {
  .layout { width: calc(100% - 24px); }
  .account-grid { grid-template-columns: 1fr; }
  .section-head { gap: 7px; }
  .section-head button { font-size: 13px; padding-inline: 9px; }
  .overview { padding: 16px 13px; }
  .overview p { font-size: 12px; }
  .panel, .card, .empty { padding: 13px; }
  .login-card { padding: 22px; }
}
