/* =========================================================================
   Editorial Wall — install / onboarding surface
   单栏居中的精致卡片。与画廊/后台同一语言：纸 + 墨 + 单一赭石强调色、
   Bricolage / Hanken、胶囊控件、克制动效。小而美，不松散。
   ========================================================================= */

:root {
  --paper: #f4f4f1;
  --paper-2: #ecebe6;
  --ink: #16161a;
  --muted: #6c6c66;
  --line: #dcdcd5;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --accent: #c2552e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(194, 85, 46, 0.12);
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.10);
  --ok: #2f7d4f;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 18px;
  --radius-field: 11px;

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

/* shell --------------------------------------------------------------- */
.install {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vh, 72px) 20px;
}

.install-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 42px);
  box-shadow: 0 26px 70px -38px rgba(18, 18, 24, 0.35);
}

/* head (centered, quiet) ---------------------------------------------- */
.install-head {
  text-align: center;
  margin-bottom: 26px;
}

.eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.install-mark {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  display: grid;
  place-items: center;
}
.install-mark img { width: 26px; height: 26px; display: block; }

.install-poem {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 22px;
}

.install-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(25px, 6vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.install-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* step rail ----------------------------------------------------------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 4px 0 28px;
}

.steps-line {
  position: absolute;
  top: 16px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--line);
  z-index: 0;
}

.steps > div {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.steps > div b {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.steps > div span {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}

.steps > div.is-pending span { opacity: 0.7; }

.steps > div.is-active b {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.1);
}
.steps > div.is-active span { color: var(--ink); }

.steps > div.is-done b {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.steps > div.is-done span { color: var(--ink); }

/* notices ------------------------------------------------------------- */
.notice {
  position: relative;
  padding: 11px 15px;
  border-radius: var(--radius-field);
  font-size: 13.5px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.notice.success { background: rgba(47, 125, 79, 0.10); color: var(--ok); border-color: rgba(47, 125, 79, 0.25); }
.notice.error { background: var(--danger-soft); color: var(--danger); border-color: rgba(179, 38, 30, 0.22); }

/* panels -------------------------------------------------------------- */
.install-panels {
  position: relative;
  min-height: 232px;
}

.panel { display: none; }
.panel.is-visible { display: block; animation: panel-in 0.5s var(--ease) both; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* welcome ------------------------------------------------------------- */
.welcome-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.welcome-card strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
}
.welcome-card span { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* checks -------------------------------------------------------------- */
.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface);
  opacity: 0;
  transform: translateY(6px);
}
.check.is-visible { opacity: 1; transform: none; transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }

.check__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check__copy strong { font-weight: 600; font-size: 14px; }
.check__copy small { color: var(--muted); font-size: 12px; }

.check__status {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.check__status::after { content: "\00B7"; color: var(--muted); }
.check.is-checking .check__status { background: var(--accent-soft); }
.check.is-checking .check__status::after { content: "\2026"; color: var(--accent); }
.check.ok .check__status { background: rgba(47, 125, 79, 0.12); }
.check.ok .check__status::after { content: "\2713"; color: var(--ok); }
.check.bad { border-color: rgba(179, 38, 30, 0.3); }
.check.bad .check__status { background: var(--danger-soft); }
.check.bad .check__status::after { content: "!"; color: var(--danger); }

/* config form --------------------------------------------------------- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--wide { grid-column: 1 / -1; }

.field > span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface);
  font-size: 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

/* program / progress -------------------------------------------------- */
.program {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 14px 0 4px;
  text-align: center;
}
.ring {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--line) 0);
  display: grid;
  place-items: center;
  transition: background 0.5s var(--ease);
}
.ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: var(--surface);
}
.ring span {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.program-track {
  width: 100%;
  max-width: 300px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.program-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.45s var(--ease);
}
.program-task { color: var(--muted); font-size: 13.5px; }
.task-list { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.task-list li b { font-size: 13px; color: var(--muted); font-weight: 600; }
.task-list li b::after { content: ""; }
.task-list li.is-active { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.task-list li.is-active b::after { content: "\00B7"; color: var(--accent); }
.task-list li.is-done { color: var(--ink); }
.task-list li.is-done b { color: var(--ok); }
.task-list li.is-done b::after { content: "\2713"; }

/* complete ------------------------------------------------------------ */
.install-complete {
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 0 4px;
}
.install-complete.is-visible { display: flex; }
.complete-orb {
  width: 66px;
  height: 66px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 600;
  animation: orb-pop 0.6s var(--ease) both;
}
@keyframes orb-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.install-complete h3 { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.complete-list { list-style: none; display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 14px; }
.complete-actions { display: flex; gap: 10px; margin-top: 4px; }

/* footer / actions ---------------------------------------------------- */
.install-foot {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.install-note {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 7px;
  transition: opacity 0.3s var(--ease);
}
.install-note.is-changing { opacity: 0.4; }
.install-note__ver { font-size: 11.5px; opacity: 0.7; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.15s var(--ease), opacity 0.3s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #a8471f; }
.btn-accent:disabled { opacity: 0.55; cursor: default; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* responsive ---------------------------------------------------------- */
@media (max-width: 460px) {
  .install-card { padding: 26px 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .steps > div span { font-size: 10px; }
  .steps > div b { width: 28px; height: 28px; font-size: 12.5px; }
  .steps-line { top: 14px; }
  .install-foot { flex-direction: column; align-items: stretch; }
  .btn-accent { width: 100%; }
}

/* reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .panel.is-visible { animation: none; }
}

/* dark (follow system) ------------------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101012;
    --paper-2: #161619;
    --ink: #ededea;
    --muted: #9a9a93;
    --line: #27272c;
    --surface: #161618;
    --surface-2: #1c1c20;
    --accent: #e0703f;
    --accent-soft: rgba(224, 112, 63, 0.16);
  }
  .install-card { box-shadow: 0 26px 70px -40px rgba(0, 0, 0, 0.7); }
}
