:root {
  color-scheme: light;
  --ink: #142824;
  --muted: #4d635d;
  --accent: #13574b;
  --line: #d6e1dc;
  --paper: #fff;
  --page: #f1f5f2;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
.wrap { width: min(1140px, calc(100% - 44px)); margin-inline: auto; }
.masthead { background: #173a34; color: #fff; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brand { font-size: 1.1rem; font-weight: 720; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #e8f2ee; font-size: .82rem; font-weight: 600; }
.hero { padding-block: 24px 32px; }
.hero h1 { font-size: clamp(1.85rem, 5vw, 3rem); margin: 0; line-height: 1.15; }
.hero p { color: #cce1d9; margin: 13px 0 0; }
.workspace { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.8fr); align-items: start; gap: 18px; margin-block: 20px 44px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 22px; min-width: 0; }
h2, h3 { line-height: 1.3; margin: 0 0 14px; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
.queue button { width: 100%; }
.queue-item { appearance: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); text-align: start; margin-bottom: 8px; cursor: pointer; }
.queue-item[aria-current="true"] { border-color: var(--accent); background: #e8f2ee; }
.queue-item span { display: block; color: var(--muted); font-size: .85rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 7px; padding: 8px 13px; background: var(--accent); color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; min-inline-size: 24px; min-block-size: 24px; }
.button.secondary { background: #e8f2ee; color: var(--accent); border-color: #c9ddd5; }
.button.quiet { background: transparent; border-color: #6c9389; color: #fff; }
.dialog-actions .button.quiet, .panel .button.quiet { color: var(--ink); border-color: #a9bdb5; }
.button:disabled { opacity: .55; cursor: wait; }
.detail-header { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2, .section-head h3 { margin-bottom: 0; }
.status { font-size: .85rem; font-weight: 680; color: var(--accent); background: #e8f2ee; padding: 4px 9px; border-radius: 5px; white-space: nowrap; }
.status[data-status="paused"], .fail, .notice.error { color: #8b3024; background: #fff0e9; }
.muted, dt { color: var(--muted); }
.notice { margin: 18px 0 0; padding: 10px 14px; border-radius: 7px; background: #e5f0e9; }
.banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; border: 1px solid #c9ddd5; background: #e8f2ee; color: var(--ink); font-size: .92rem; }
.banner.sandbox { border-color: #d8c08a; background: #fbf4e4; }
.section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.facts div { background: #f1f5f2; border-radius: 6px; padding: 9px 12px; overflow-wrap: anywhere; }
.facts dt { font-size: .8rem; }
.facts dd { margin: 2px 0 0; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 10px; }
.checks span { padding: 3px 8px; border-radius: 5px; }
.pass { background: #e5f3e9; color: #1f5636; }
details { margin-block: 10px; }
summary { cursor: pointer; font-weight: 650; }
.history { padding-inline-start: 20px; margin-bottom: 0; }
.history li { padding: 4px 0; overflow-wrap: anywhere; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 12px; }
.field { display: grid; gap: 4px; font-size: .9rem; }
.field.note { grid-column: 1 / -1; }
input, textarea, select { color: var(--ink); font: inherit; background: #fff; border: 1px solid #a9bdb5; border-radius: 6px; padding: 7px 9px; width: 100%; }
textarea { min-height: 62px; resize: vertical; }
input[type="checkbox"] { width: auto; justify-self: start; }
.lock-card { display: grid; gap: 10px; }
.lock-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.password-row { display: flex; gap: 8px; align-items: stretch; margin-top: 4px; }
.password-row input { flex: 1; min-width: 0; }
.password-row button { flex: none; white-space: nowrap; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(640px, calc(100% - 28px)); max-height: min(88dvh, 760px); overflow: auto; color: var(--ink); background: var(--paper); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; background-color: rgba(20, 40, 36, 0.48); backdrop-filter: blur(2px); }
dialog h1 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.prompt-box { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbf9; }
.prompt-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.copy { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.copy-button { min-inline-size: 24px; min-block-size: 24px; }
.tip { opacity: 0; transition: opacity .15s; font-size: .85rem; color: var(--accent); font-weight: 600; }
.copy-button[data-copied] + .tip, .copy-button[data-failed] + .tip { opacity: 1; }
.copy-button[data-failed] + .tip { color: #8b3024; }
pre { background: #f1f5f2; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: .82rem; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #d99628; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .tip { transition: none; }
}
@media (max-width: 660px) {
  .wrap { width: calc(100% - 28px); }
  .workspace { grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
  .panel { padding: 16px; }
  .hero { padding-block: 15px 24px; }
  .fields { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
}
