:root {
  color-scheme: light;
  --page: #ecf0f5;
  --surface: #fff;
  --text: #333;
  --muted: #62676e;
  --border: #d2d6de;
  --line: #e8e9ec;
  --primary: #605ca8;
  --error-bg: #fff2f0;
  --error-text: #a12622;
}
.theme-dark {
  color-scheme: dark;
  --page: #1e202b;
  --surface: #262837;
  --text: #e2e3e8;
  --muted: #b3b6c2;
  --border: #505362;
  --line: #3a3d4d;
  --primary: #9c98e4;
  --error-bg: #492526;
  --error-text: #ffb9b4;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.5 Arial, "Microsoft YaHei", sans-serif; }
.setup-shell { max-width: 688px; margin: 0 auto; padding: 28px 20px 40px; }
.setup-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.setup-brand { font-size: 18px; font-weight: 600; }
.setup-header select { width: auto; max-width: 155px; min-height: 36px; padding: 6px 10px; font-size: 14px; }
.setup-panel { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid #605ca8; border-radius: 3px; }
.setup-heading { padding: 22px 28px 16px; border-bottom: 1px solid var(--line); }
h1 { font-size: 24px; line-height: 1.4; font-weight: 500; margin: 0 0 6px; }
.setup-heading p, .section-help, .field-help { color: var(--muted); }
.setup-heading p { margin: 0; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 22px 28px 18px; }
fieldset + fieldset { border-top: 1px solid var(--line); }
legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; font-size: 16px; font-weight: 600; }
legend + * { clear: both; }
.section-help { margin: 0 0 16px; font-size: 13px; }
.form-field { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 14px; margin-bottom: 14px; }
.form-field:last-child { margin-bottom: 0; }
.form-field label { padding-top: 9px; font-weight: 400; overflow-wrap: anywhere; }
.form-field > div { min-width: 0; }
input:not([type="checkbox"]), select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 2px; color: var(--text); background: var(--surface); font: inherit; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.field-help { margin: 5px 0 0; font-size: 12px; }
.seed-choice { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 5px; cursor: pointer; }
.seed-choice input { flex-shrink: 0; width: 17px; height: 17px; margin: 0; accent-color: #605ca8; }
#basics-help { margin-bottom: 18px; }
#basics-note { margin-top: 16px; }
.setup-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding: 16px 28px; }
.setup-submit { min-width: 118px; min-height: 40px; padding: 9px 18px; border: 1px solid #555299; border-radius: 3px; background: #605ca8; color: #fff; font: inherit; cursor: pointer; }
.setup-submit:hover { background: #514d93; }
.setup-submit:disabled { opacity: .65; cursor: wait; }
.setup-error { margin: 16px 28px 0; padding: 10px 12px; border: 1px solid var(--error-text); color: var(--error-text); background: var(--error-bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 540px) {
  .setup-shell { padding: 16px 12px 24px; }
  .setup-header { gap: 12px; margin-bottom: 14px; }
  .setup-brand { font-size: 16px; }
  .setup-header select { max-width: 128px; min-height: 44px; }
  .setup-heading { padding: 18px 18px 14px; }
  h1 { font-size: 22px; }
  fieldset { padding: 18px; }
  .form-field { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .form-field label { padding-top: 0; }
  input:not([type="checkbox"]), select { min-height: 44px; font-size: 16px; }
  .seed-choice { min-height: 44px; }
  .setup-actions { padding: 14px 18px; }
  .setup-submit { min-height: 44px; }
  .setup-error { margin: 14px 18px 0; }
}
