:root {
  --bg: #f2f3f5;
  --ink: #1d2129;
  --muted: #86909c;
  --text-2: #4e5969;
  --line: #e5e6eb;
  --card: #ffffff;
  --accent: #1664ff;
  --accent-ink: #ffffff;
  --accent-soft: #e8f3ff;
  --ok: #00b42a;
  --ok-soft: #e8ffea;
  --warn: #ff7d00;
  --warn-soft: #fff7e8;
  --danger: #f53f3f;
  --danger-soft: #ffece8;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
}
button, input, select { font: inherit; }
select {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  min-height: 36px;
}
button { cursor: pointer; }
a { color: inherit; }

.desk {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 22px;
}
h1 { font-size: 24px; line-height: 1.3; margin: 0 0 6px; font-weight: 600; }
.sub { margin: 0; color: var(--text-2); font-size: 14px; }
.primary, .ghost, .danger {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 16px;
  min-height: 36px;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:disabled, .ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
a.ghost { text-decoration: none; display: inline-flex; align-items: center; }
.danger { background: var(--card); color: var(--danger); border-color: #fdcdc5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.code-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.code {
  font-size: 40px;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin: 4px 0;
}
.links { margin: 8px 0 0; padding: 0; list-style: none; }
.links li { margin: 6px 0; word-break: break-all; font-size: 14px; }
.links a { text-decoration: none; border-bottom: 1px solid var(--line); }
.progress { color: var(--muted); font-size: 14px; }
.progress strong { color: var(--ok); }

.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}
.frame {
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0)),
    repeating-linear-gradient(135deg, #f7f8fa, #f7f8fa 10px, #f2f3f5 10px, #f2f3f5 20px);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { padding: 10px 12px 12px; }
.meta b { display: block; font-size: 14px; }
.meta span { color: var(--muted); font-size: 12px; }
.empty { padding: 28px; color: var(--muted); }

.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.steps {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.steps li {
  flex: 1;
  min-width: 0;
  padding: 6px 0 8px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.steps li.on { color: var(--accent); border-bottom-color: var(--accent); }
.steps li.ok { color: var(--ok); border-bottom-color: var(--ok); }
.steps li.bad { color: var(--danger); border-bottom-color: var(--danger); }
.kicker { margin: 0; color: var(--muted); font-size: 13px; }
.phone h1 { font-size: 26px; margin-top: 4px; }
.hint { color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.stage {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #1c1915;
  min-height: 320px;
  display: grid;
  place-items: center;
  color: #d9d0c4;
  position: relative;
}
.stage img,
.stage video { width: 100%; height: 100%; object-fit: contain; max-height: 62dvh; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions button, .actions label { flex: 1; text-align: center; }
.file {
  display: block;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 4px;
  padding: 10px 16px;
  min-height: 48px;
}
.file input { display: none; }
.gate { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.gate input {
  border: 1px solid var(--line);
  background: white;
  border-radius: 4px;
  padding: 14px 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 22px;
}
.done-mark { font-size: 18px; line-height: 1.6; }
.error { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.note {
  margin: 12px 0 0;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
  background: #f7f8fa;
}
.note.on { color: #0e42d2; background: var(--accent-soft); }
.note.ok { color: #009a29; background: var(--ok-soft); }
.note.warn { color: #d25f00; background: var(--warn-soft); }
.note.bad { color: #cb272d; background: var(--danger-soft); }

.gpy {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 16px;
  align-items: start;
}
.gpy-stage {
  min-height: 420px;
  border-radius: 8px;
  background: #1c1915;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.gpy-stage video,
.gpy-stage img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}
.gpy select,
.fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  background: white;
}
.fields { display: grid; gap: 8px; margin-top: 12px; }
.fields label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.portrait {
  width: 102px;
  height: 126px;
  object-fit: cover;
  border-radius: 4px;
  background: #f7f8fa;
  border: 1px solid var(--line);
}
.ocx { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .top { flex-direction: column; align-items: stretch; }
  .gpy { grid-template-columns: 1fr; }
}
