:root {
  --bg: #0c0f14;
  --bg-elev: #141a22;
  --bg-soft: #1a222d;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f7;
  --muted: #9aa7b8;
  --accent: #6ee7b7;
  --accent-2: #60a5fa;
  --danger: #fb7185;
  --warn: #fbbf24;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(96, 165, 250, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(110, 231, 183, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand span { color: var(--muted); font-size: 0.85rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}
.pill.ok { color: var(--accent); border-color: rgba(110, 231, 183, 0.35); }
.pill.warn { color: var(--warn); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.scene {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.2rem;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  min-height: 160px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.scene:hover { border-color: rgba(110, 231, 183, 0.35); transform: translateY(-1px); }
.scene.disabled { opacity: 0.65; }
.scene.disabled:hover { transform: none; border-color: var(--line); }
.scene h2 { margin: 0; font-size: 1.15rem; }
.scene p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }
.scene .badge {
  align-self: flex-start;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(110, 231, 183, 0.12);
  color: var(--accent);
  border: 1px solid rgba(110, 231, 183, 0.25);
}
.scene .badge.soon {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.25);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, var(--accent), #34d399);
  color: #062016;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.4rem 0.6rem;
}
.btn.block { width: 100%; }

.gate {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.85rem;
}
.gate label { font-size: 0.9rem; color: var(--muted); }
.gate .row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.input, .textarea, .select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #0d1218;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}
.textarea { min-height: 120px; resize: vertical; }
.select { cursor: pointer; }

.form {
  display: grid;
  gap: 1rem;
}
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.9rem; color: var(--muted); }
.field .hint { font-size: 0.78rem; color: var(--muted); opacity: 0.85; }

.size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (min-width: 640px) {
  .size-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.size-opt {
  border: 1px solid var(--line);
  background: #0d1218;
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
}
.size-opt strong { display: block; font-size: 0.95rem; }
.size-opt span { color: var(--muted); font-size: 0.78rem; }
.size-opt.active {
  border-color: rgba(110, 231, 183, 0.55);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.06);
}

.layout-poster {
  display: grid;
  gap: 1rem;
}
@media (min-width: 880px) {
  .layout-poster {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.result {
  display: grid;
  gap: 0.85rem;
  min-height: 280px;
}
.result-frame {
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: #0a0e13;
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.result-frame img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}
.placeholder {
  color: var(--muted);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.92rem;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.alert {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.alert.error {
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.08);
}
.alert.info {
  border-color: rgba(96, 165, 250, 0.35);
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.08);
}

.cost-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--warn);
}

.hidden { display: none !important; }
.loading-dot::after {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.wrap-wide { width: min(1200px, calc(100% - 2rem)); }

.estimate-box {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(110, 231, 183, 0.06);
  border: 1px solid rgba(110, 231, 183, 0.28);
}
.estimate-main {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}
.estimate-avg {
  font-size: 0.88rem;
  color: var(--muted);
}
.estimate-tiers {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.9;
}

.settlement-summary {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.28);
  font-size: 0.85rem;
  color: #bfdbfe;
}
.settlement-summary .warn-text,
.warn-text {
  color: var(--warn);
}
.ok-text { color: var(--accent); }

.membership-banner {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 0.9rem;
}
.membership-banner .btn {
  justify-self: start;
  background: linear-gradient(135deg, var(--warn), #f59e0b);
  color: #1c1408;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.settle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.settle-table th,
.settle-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}
.settle-table th {
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg-elev);
}
.settle-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.a.btn, a.btn {
  text-decoration: none;
}
