:root {
  --ink: #17201d;
  --muted: #69736f;
  --paper: #f5f3ed;
  --card: rgba(255, 255, 252, 0.88);
  --line: rgba(23, 32, 29, 0.12);
  --accent: #e9ff70;
  --accent-strong: #d6f23e;
  --green: #164f3f;
  --green-soft: #d9eee5;
  --danger: #a63d33;
  --danger-bg: #fff0ed;
  --shadow: 0 28px 80px rgba(33, 44, 39, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(23, 32, 29, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 29, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 440px;
  height: 440px;
  top: -220px;
  right: -120px;
  background: rgba(226, 255, 89, 0.46);
}

.ambient-two {
  width: 320px;
  height: 320px;
  bottom: -180px;
  left: -120px;
  background: rgba(157, 208, 187, 0.25);
}

.shell { min-height: 100vh; }

.login-layout {
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 52px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: center;
  gap: 96px;
}

.brand-panel { max-width: 650px; }

.brand-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 54px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 13px;
  border-radius: 18px;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(23, 32, 29, 0.2);
}

.brand-mark span {
  width: 7px;
  border-radius: 8px;
  background: var(--accent);
  transform: skew(-8deg);
}

.brand-mark span:nth-child(1) { height: 19px; }
.brand-mark span:nth-child(2) { height: 31px; }
.brand-mark span:nth-child(3) { height: 24px; }

.brand-mark.small {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 8px;
  border-radius: 11px;
  gap: 3px;
}

.brand-mark.small span { width: 4px; }
.brand-mark.small span:nth-child(1) { height: 12px; }
.brand-mark.small span:nth-child(2) { height: 19px; }
.brand-mark.small span:nth-child(3) { height: 15px; }

.eyebrow, .step-label {
  margin: 0 0 20px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.052em;
}

.lead {
  max-width: 570px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 42px;
}

.feature-row span {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4d5854;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.42);
}

.auth-card, .upload-card, .result-card, .result-placeholder {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.auth-card { border-radius: 28px; overflow: hidden; }

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #65b46f;
  box-shadow: 0 0 0 4px rgba(101, 180, 111, 0.12);
}

.auth-card-body { padding: 44px 38px 36px; }
.auth-card h2 { margin: 0; font-size: 30px; letter-spacing: -0.035em; }
.muted { margin: 12px 0 30px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-footnote { margin: 0; padding: 18px; border-top: 1px solid var(--line); color: #87908c; text-align: center; font-size: 11px; }

.stack-form, .form-fields { display: flex; flex-direction: column; }
.stack-form { gap: 12px; }
.stack-form label, .form-fields label { color: #3f4b47; font-size: 13px; font-weight: 600; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input, select { height: 48px; padding: 0 14px; }
textarea { min-height: 104px; padding: 13px 14px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #79943f; box-shadow: 0 0 0 4px rgba(214, 242, 62, 0.22); background: #fff; }
input::placeholder, textarea::placeholder { color: #a2aaa7; }

.password-field { position: relative; margin-bottom: 8px; }
.password-field input { padding-right: 68px; }
.text-button { position: absolute; right: 8px; top: 8px; height: 32px; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }

.primary-button, .secondary-button, .quiet-button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  min-height: 50px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 13px;
  color: #17201d;
  background: var(--accent);
  box-shadow: 0 9px 22px rgba(174, 200, 46, 0.2);
  text-decoration: none;
}

.primary-button:hover { transform: translateY(-1px); background: var(--accent-strong); box-shadow: 0 12px 28px rgba(174, 200, 46, 0.28); }
.primary-button:disabled { opacity: .58; cursor: wait; transform: none; }
.alert { padding: 11px 13px; border: 1px solid rgba(166, 61, 51, .16); border-radius: 10px; color: var(--danger); background: var(--danger-bg); font-size: 13px; line-height: 1.5; }

.topbar {
  height: 76px;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 237, .72);
  backdrop-filter: blur(16px);
}

.brand-inline { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: .04em; text-decoration: none; }
.brand-inline b { font-weight: 500; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 13px; }
.topbar-actions a { text-decoration: none; }
.topbar-actions form { margin: 0; }
.quiet-button { padding: 8px 12px; border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.6); }

.workspace { max-width: 1240px; margin: 0 auto; padding: 64px 28px 90px; }
.workspace-heading { margin-bottom: 34px; }
.workspace-heading .eyebrow { margin-bottom: 12px; }
.workspace-heading h1 { margin: 0; font-size: clamp(36px, 4vw, 52px); letter-spacing: -.045em; }
.workspace-heading > p:last-child { margin: 12px 0 0; color: var(--muted); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 24px; align-items: start; }

.upload-card { padding: 34px; border-radius: 24px; }
.form-section { display: grid; grid-template-columns: 42px 1fr; gap: 14px; }
.section-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; }
.section-content { min-width: 0; }
.section-title { display: block; margin: 5px 0 18px; font-size: 16px; font-weight: 700; }
.form-divider { height: 1px; margin: 30px 0; background: var(--line); }

.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.platform-option input { position: absolute; opacity: 0; pointer-events: none; }
.platform-card { min-height: 76px; padding: 14px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: rgba(255,255,255,.54); }
.platform-logo { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; color: white; background: #24a45d; font-size: 20px; font-weight: 700; }
.platform-card b, .platform-card small { display: block; }
.platform-card b { font-size: 14px; }
.platform-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.radio-mark { width: 16px; height: 16px; margin-left: auto; border: 1px solid #aab2ae; border-radius: 50%; }
.platform-option input:checked + .platform-card { border-color: #8da647; box-shadow: inset 0 0 0 1px #8da647; background: rgba(233,255,112,.12); }
.platform-option input:checked + .platform-card .radio-mark { border: 5px solid var(--green); }

.drop-zone { min-height: 166px; padding: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #a9b1ad; border-radius: 16px; cursor: pointer; text-align: center; background: rgba(255,255,255,.38); transition: border .18s ease, background .18s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: #748b39; background: rgba(233,255,112,.12); }
.drop-zone.has-file { border-style: solid; border-color: #7a996d; background: rgba(217,238,229,.45); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 42px; height: 42px; margin-bottom: 13px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 20px; font-weight: 700; }
.drop-zone strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.drop-zone > span:last-child { margin-top: 6px; color: var(--muted); font-size: 12px; }

.form-fields { gap: 10px; }
.form-fields .section-title { margin-bottom: 8px; }
.form-fields label { margin-top: 5px; }
.form-fields label span { color: #939c98; font-weight: 400; }
.two-columns { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-columns > div { display: flex; flex-direction: column; gap: 10px; }
.hidden-field { display: none; margin-top: 8px; }
.hidden-field.visible { display: flex; flex-direction: column; gap: 10px; }

.progress-panel { margin: 28px 0 0 56px; padding: 15px; border-radius: 13px; background: rgba(217,238,229,.48); }
.progress-copy { margin-bottom: 9px; display: flex; justify-content: space-between; color: var(--green); font-size: 12px; font-weight: 600; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(22,79,63,.12); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.progress-panel.waiting .progress-copy { margin-bottom: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.progress-panel.waiting .progress-copy::before { content: ''; width: 12px; height: 12px; border: 2px solid rgba(22,79,63,.2); border-top-color: var(--green); border-radius: 50%; animation: progress-spin .75s linear infinite; }
.progress-panel.waiting .progress-track { display: none; }
@keyframes progress-spin { to { transform: rotate(360deg); } }
.upload-card > .alert { margin: 18px 0 0 56px; }
.publish-button { width: calc(100% - 56px); margin: 24px 0 0 56px; }

.result-column { position: sticky; top: 24px; }
.result-placeholder, .result-card { min-height: 430px; padding: 34px; border-radius: 24px; }
.result-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.result-placeholder h2 { margin: 28px 0 8px; font-size: 19px; }
.result-placeholder p { max-width: 270px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.radar { position: relative; width: 112px; height: 112px; display: grid; place-items: center; border: 1px solid rgba(22,79,63,.13); border-radius: 50%; }
.radar::before { content: ''; position: absolute; inset: 17px; border: 1px solid rgba(22,79,63,.16); border-radius: 50%; }
.radar::after { content: ''; position: absolute; width: 1px; height: 100%; background: rgba(22,79,63,.1); }
.radar i:first-child { position: absolute; width: 100%; height: 1px; background: rgba(22,79,63,.1); }
.radar i:last-child { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 7px rgba(214,242,62,.21); }
.radar span { position: absolute; inset: 5px 50% 50% 5px; border-radius: 100% 0 0 0; background: linear-gradient(45deg, rgba(22,79,63,.14), transparent); transform-origin: 100% 100%; animation: sweep 3s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }

.result-card { min-height: auto; }
.success-kicker { display: flex; align-items: center; gap: 8px; color: #3d725c; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.success-kicker span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--accent); }
.result-card h2 { margin: 20px 0 4px; font-size: 25px; letter-spacing: -.03em; }
.mono { margin: 0; overflow-wrap: anywhere; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.result-facts { margin: 26px 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.result-facts div { padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-facts dt { color: var(--muted); font-size: 10px; }
.result-facts dd { margin: 5px 0 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.qr-code { width: 146px; height: 146px; margin: 0 auto 20px; display: block; border: 8px solid white; border-radius: 12px; object-fit: contain; box-shadow: 0 8px 24px rgba(23,32,29,.08); }
.install-button { margin-bottom: 9px; font-size: 13px; }
.secondary-button { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.6); font-size: 12px; }
.result-json { max-height: 260px; margin: 14px 0 0; padding: 14px; overflow: auto; border-radius: 11px; color: #dbe7e2; background: #1b2521; font-size: 10px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; gap: 52px; padding: 48px 28px; }
  .brand-panel { max-width: none; }
  .brand-mark { margin-bottom: 36px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .result-column { position: static; }
  .result-placeholder { min-height: 320px; }
}

@media (max-width: 600px) {
  .login-layout { padding: 34px 18px; }
  .brand-panel h1 { font-size: 42px; }
  .lead { font-size: 16px; }
  .auth-card-body { padding: 34px 24px 28px; }
  .topbar { height: 66px; padding: 0 18px; }
  .topbar-actions { gap: 12px; }
  .workspace { padding: 42px 16px 68px; }
  .upload-card { padding: 24px 18px; }
  .form-section { grid-template-columns: 1fr; }
  .section-number { margin-bottom: -2px; }
  .two-columns, .platform-grid { grid-template-columns: 1fr; }
  .progress-panel, .upload-card > .alert { margin-left: 0; }
  .publish-button { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
