:root {
  color-scheme: light;
  --primary: #409eff;
  --primary-hover: #337ecc;
  --primary-soft: #ecf5ff;
  --success: #00b42a;
  --danger: #d03050;
  --text-strong: #1f2937;
  --text: #475569;
  --muted: #64748b;
  --line: #e6eaf0;
  --line-strong: #dcdfe6;
  --surface: #fff;
  --canvas: #f6f7f9;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--canvas);
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

/* 沿用后台表单的留白、边框和蓝色；步骤固定在内容区上方。 */
.app-shell { min-height: 100vh; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  display: block;
  width: 132px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-copy strong { color: var(--text-strong); font-size: 16px; font-weight: 600; }
.step-nav { display: flex; margin: 28px 0 30px; }
.step-nav__item {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  color: var(--muted);
  text-align: center;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.step-nav__item:not(:last-child)::after { position: absolute; top: 14px; left: calc(50% + 22px); width: calc(100% - 44px); height: 1px; content: ''; background: var(--line-strong); }
.step-nav__item span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  font-size: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}
.step-nav__item b { font-size: 14px; font-weight: 400; }
.step-nav__item:hover:not(:disabled), .step-nav__item.is-done { color: var(--primary); }
.step-nav__item.is-done span { border-color: var(--primary); }
.step-nav__item.is-done::after { background: var(--primary); }
.step-nav__item.is-active { color: var(--primary); }
.step-nav__item.is-active span { border-color: var(--primary); background: var(--primary); color: #fff; }
.step-nav__item.is-active b { font-weight: 600; }
.step-nav__item:disabled { cursor: default; }
.main { min-width: 0; }
.topbar {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-note { color: var(--muted); font-size: 13px; }
.content { max-width: 1008px; margin: 0 auto; padding: 44px 24px 48px; }
.content--success { display: grid; justify-items: center; padding-top: 64px; }
.page-heading { color: var(--muted); font-size: 14px; line-height: 1.7; }
.page-heading h1 { margin: 0 0 8px; color: var(--text-strong); font-size: 24px; font-weight: 600; }
.page-heading p { margin: 0; }

.install-form { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.section { padding: 28px 32px 32px; scroll-margin-top: 24px; }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin: 0; color: var(--text-strong); font-size: 17px; font-weight: 600; line-height: 1.6; outline: 0; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 22px 24px; }
.field { display: grid; min-width: 0; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field > span:first-child { color: var(--text-strong); font-size: 13px; }
.field:has(input:required) > span:first-child::before { margin-right: 4px; color: var(--danger); content: '*'; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.7; }
input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 11px;
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: 0;
}
input:hover { border-color: #c0c4cc; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
input::placeholder { color: #909399; }
.password-control, .path-control { position: relative; display: block; }
.password-control input { padding-right: 58px; }
.password-control button {
  position: absolute;
  top: 1px;
  right: 1px;
  height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  border: 0;
  border-radius: 2px;
}
.password-control button:hover { color: var(--primary); }
.path-control > span {
  position: absolute;
  top: 1px;
  left: 1px;
  display: grid;
  width: 32px;
  height: 34px;
  place-items: center;
  color: var(--muted);
  background: #f7f8fa;
  border-right: 1px solid var(--line-strong);
}
.path-control input { padding-left: 44px; }
.check-row, .confirm-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check-row { margin-top: 22px; }
.check-row span { display: grid; gap: 4px; }
.check-row strong { color: var(--text-strong); font-size: 13px; font-weight: 400; }
.check-row small { color: var(--muted); font-size: 12px; }
.check-row input, .confirm-row input, .mode-option input { width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0 0; accent-color: var(--primary); }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.mode-option { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); cursor: pointer; }
.mode-option:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.mode-option span { display: grid; gap: 4px; }
.mode-option strong { color: var(--text-strong); font-size: 13px; font-weight: 500; }
.mode-option small { color: var(--muted); font-size: 12px; }
.migration-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.migration-flow > div { position: relative; display: grid; align-content: start; gap: 5px; padding-left: 32px; }
.migration-flow > div > span { position: absolute; top: 0; left: 0; display: grid; width: 22px; height: 22px; place-items: center; color: var(--primary); border: 1px solid var(--line); font-size: 12px; }
.migration-flow strong { color: var(--text-strong); font-size: 13px; font-weight: 500; }
.migration-flow small, .migration-flow em { color: var(--muted); font-size: 12px; font-style: normal; line-height: 1.7; }
.migration-flow a { width: fit-content; color: var(--primary); font-size: 12px; text-decoration: none; }
.notice { margin: 0 0 14px; padding: 12px 16px; font-size: 13px; line-height: 1.7; border: 1px solid var(--line); }
.notice--error { color: #b42318; background: #fff2f0; border-color: #ffccc7; }
.notice--info { color: #165dbe; background: #f0f5ff; border-color: #d6e4ff; }
.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.submit-actions { display: flex; gap: 12px; }
.step-status { margin: 0; color: var(--muted); font-size: 13px; }
.confirm-row { margin-top: 24px; font-size: 13px; line-height: 1.7; }
.button { display: inline-flex; height: 36px; min-width: 100px; align-items: center; justify-content: center; padding: 0 18px; white-space: nowrap; text-decoration: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.button--default { color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.button--default:hover { color: var(--primary); border-color: var(--primary); }
.button--primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.button--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button:disabled { cursor: wait; opacity: 0.6; }
.success-panel { width: min(620px, 100%); padding: 32px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.success-mark { display: grid; width: 48px; height: 48px; margin: 0 auto 16px; place-items: center; color: var(--success); border: 2px solid var(--success); border-radius: 50%; font-size: 24px; }
.success-panel h2 { margin: 0 0 8px; color: var(--text-strong); font-size: 20px; font-weight: 600; }
.success-panel > p { margin: 0 0 20px; color: var(--muted); line-height: 1.7; }
.success-panel dl { margin: 0 0 20px; text-align: left; border-top: 1px solid var(--line); }
.success-panel dl div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.success-panel dt { color: var(--muted); }
.success-panel dd { margin: 0; color: var(--text-strong); overflow-wrap: anywhere; }
.success-panel .switch-status { margin: 12px 0 0; font-size: 12px; }
.install-summary { margin: 0 0 24px; padding: 4px 16px; background: var(--canvas); border-radius: 4px; }
.install-summary div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 10px 0; }
.install-summary dt { color: var(--muted); }
.install-summary dd { margin: 0; overflow-wrap: anywhere; color: var(--text-strong); }

@media (max-width: 900px) {
  .migration-flow { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .content { padding: 28px 16px; }
  .page-heading h1 { font-size: 21px; }
  .step-nav { margin: 24px 0; }
  .step-nav__item { gap: 8px; padding: 0 2px; }
  .step-nav__item b { font-size: 11px; }
  .step-nav__item:not(:last-child)::after { left: calc(50% + 18px); width: calc(100% - 36px); }
  .section { padding: 22px 20px; }
  .form-grid, .mode-grid { grid-template-columns: minmax(0, 1fr); }
  .submit-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 20px; }
  .submit-actions { justify-content: flex-end; }
  .submit-actions .button { flex: 1; min-width: 0; padding: 0 12px; }
  .success-panel { padding: 24px 16px; }
  .install-summary div { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
}
