:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1f2937;
  background: #fff;
}

* { box-sizing: border-box; }
html, body, #userLayout { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; overflow: hidden; background: #fff; }

#userLayout { position: relative; height: 100vh; background: #fff; }

.banner-oblique {
  position: absolute;
  inset: 0 0 0 auto;
  width: 48%;
  overflow: hidden;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 4% 100%);
  background: #2264f2;
}

.banner-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 5rem;
  color: #fff;
  text-align: center;
}

.banner-eyebrow {
  padding-left: .5em;
  font-size: .75rem;
  letter-spacing: .5em;
  text-transform: uppercase;
  opacity: .75;
}
.banner-slogan { margin: 1.25rem 0; }
.slogan-line {
  padding-left: .18em;
  font-size: 3rem;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: .18em;
}
.banner-divider { width: 3rem; height: 1px; background: rgba(255,255,255,.55); }
.banner-divider-short { width: 1.5rem; margin-top: .25rem; }
.banner-tagline {
  margin-top: .5rem;
  padding-left: .45em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .7rem;
  letter-spacing: .45em;
  text-transform: uppercase;
  opacity: .6;
}

.entry-side { position: relative; z-index: 1; width: 58%; height: 100%; }
.entry-content {
  width: 680px;
  max-width: 90%;
  height: 100%;
  margin: 0 auto;
  padding: 16px 0 28px;
  overflow-x: hidden;
  overflow-y: auto;
}
.entry-brand { display: flex; flex-direction: column; align-items: center; max-width: 384px; margin: 0 auto 12px; }
.brand-logo {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1f2937;
  background: #d1d5db;
  font-size: 14px;
}
.entry-brand h1 {
  margin: 16px 0 0;
  color: #1f2937;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.view h2 { margin: 0 0 12px; color: #1f2937; font-size: 16px; font-weight: 700; line-height: 1.5; }
#introView, #formView { max-width: 384px; margin: 0 auto; }
.supporting { margin: -4px 0 12px; color: #6b7280; font-size: 12px; line-height: 1.6; }
.form-heading { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.form-heading h2 { margin: 0; }
#stepBadge { color: #2264f2; font-size: 11px; font-weight: 700; letter-spacing: .08em; }

.init-form { display: grid; gap: 4px; }
.init-form label { display: grid; gap: 4px; color: #606266; font-size: 12px; line-height: 1.4; }
.form-row { display: grid; gap: 8px; }
.split-7-3 { grid-template-columns: 7fr 3fr; }
.init-form input {
  width: 100%;
  height: 32px;
  padding: 0 11px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  outline: none;
  color: #303133;
  background: #fff;
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.init-form input::placeholder { color: #a8abb2; }
.init-form input:focus { border-color: #2264f2; box-shadow: 0 0 0 1px #2264f2 inset; }
.field-tip { margin: 2px 0 0; color: #909399; font-size: 11px; line-height: 1.5; }

.button {
  width: 100%;
  height: 32px;
  margin-top: 8px;
  padding: 0 15px;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { border: 1px solid #2264f2; color: #fff; background: #2264f2; }
.button-primary:hover:not(:disabled) { border-color: #6493f6; background: #6493f6; }
.button-danger { border: 1px solid #e5484d; color: #fff; background: #e5484d; }
.button-danger:hover:not(:disabled) { border-color: #c9363e; background: #c9363e; }
.button-plain { border: 1px solid #dcdfe6; color: #606266; background: #fff; }
.button-plain:hover:not(:disabled) { border-color: #b8bec8; color: #303133; background: #f5f7fa; }
.button-hollow { border: 1px solid #2264f2; color: #2264f2; background: transparent; }
.button-hollow:hover:not(:disabled) { border-color: #2264f2; color: #2264f2; background: #e9f0fe; }
.button-compact { width: auto; min-width: 88px; margin-top: 0; white-space: nowrap; }

.status-view { width: 100%; }
.status-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.status-heading h2 { margin: 2px 0 0; font-size: 18px; }
.status-eyebrow { color: #2264f2; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.status-card, .orm-card {
  border: 1px solid #e4e7ed;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 41, 55, .05);
}
.status-card { padding: 13px 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #1f2937; font-size: 14px; font-weight: 700; }
.state-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.state-badge.ok { color: #1b8f55; background: #e9f8f0; }
.state-badge.warning { color: #b88230; background: #fdf6ec; }
.state-badge.error { color: #e45656; background: #fef0f0; }
.status-card dl { margin: 0; }
.status-card dl > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px dashed #ebeef5; font-size: 11px; line-height: 1.45; }
.status-card dl > div:last-child { border-bottom: 0; }
.status-card dt { color: #909399; }
.status-card dd { margin: 0; overflow-wrap: anywhere; color: #303133; text-align: right; }
.status-card .button { margin-top: 10px; }

.orm-card { margin-top: 12px; padding: 13px 14px; }
.orm-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.orm-head h3 { margin: 0; color: #1f2937; font-size: 14px; }
.orm-head p { margin: 3px 0 0; color: #909399; font-size: 10px; }
.orm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.backup-summary { margin-top: 10px; padding: 8px 10px; border-radius: 4px; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.backup-summary.success { color: #1b8f55; background: #e9f8f0; }
.backup-summary.error { color: #e5484d; background: #fef0f0; }
.orm-summary { margin-top: 10px; padding: 8px 10px; border-radius: 4px; font-size: 11px; }
.orm-summary.neutral { color: #606266; background: #f4f4f5; }
.orm-summary.success { color: #1b8f55; background: #e9f8f0; }
.orm-summary.warning { color: #b88230; background: #fdf6ec; }
.orm-summary.error { color: #e45656; background: #fef0f0; }
.difference-list, .warning-list { display: grid; gap: 6px; max-height: 220px; margin-top: 8px; overflow-y: auto; }
.difference-item { display: grid; gap: 4px; padding: 8px 10px; border-left: 3px solid #2264f2; background: #f5f8ff; font-size: 10px; }
.difference-item.destructive { border-left-color: #f56c6c; background: #fef0f0; }
.difference-item strong { color: #303133; }
.difference-item code { overflow-wrap: anywhere; color: #606266; white-space: pre-wrap; }
.warning-list { color: #b88230; font-size: 10px; line-height: 1.5; }

.notice { margin-top: 8px; padding: 8px 10px; border-radius: 4px; color: #b88230; background: #fdf6ec; font-size: 12px; line-height: 1.5; }
.notice.error { color: #f56c6c; background: #fef0f0; }
.notice.success { color: #67c23a; background: #f0f9eb; }

.loading-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  background: rgba(0,0,0,.7);
  font-size: 14px;
}
.loading-overlay[hidden], [hidden] { display: none !important; }
.runtime-mode-switch { display: flex; gap: 8px; margin: 10px 0 6px; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dialog-open { overflow: hidden; }
.decision-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
}
.decision-dialog {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid #e4e7ed;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .24);
  animation: dialog-enter .18s ease-out both;
}
.decision-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2264f2;
  background: #e9f0fe;
  font-size: 18px;
  font-weight: 800;
}
.decision-overlay.danger .decision-icon { color: #e5484d; background: #fef0f0; }
.decision-content h3 { margin: 1px 0 7px; color: #1f2937; font-size: 16px; }
.decision-content p { margin: 0; color: #606266; font-size: 12px; line-height: 1.7; }
.decision-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.decision-actions .button { min-width: 92px; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.anim-fade-up { animation: anim-fade-up .45s cubic-bezier(.22,.61,.36,1) both; }
@keyframes anim-fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 767px) {
  body { overflow: auto; }
  .banner-oblique { display: none; }
  .entry-side { width: 100%; }
  .entry-content { max-width: 90%; padding-top: 24px; }
  .status-grid { grid-template-columns: 1fr; }
  .orm-head { align-items: flex-start; flex-direction: column; }
}

@media (max-height: 680px) {
  .brand-logo { width: 72px; height: 72px; }
  .entry-brand h1 { margin-top: 10px; }
  .entry-brand { margin-bottom: 8px; }
}
