:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-soft: #15171e;
  --surface: #1e2029;
  --surface-2: #252836;
  --ink: #f0f0f5;
  --ink-soft: #a0a3b1;
  --muted: #6b6f7e;
  --rule: #2a2d3a;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-3: #ec4899;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.theme-light {
  color-scheme: light;
  --bg: #f7f8fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2ff;
  --ink: #10131a;
  --ink-soft: #4d5566;
  --muted: #7a8498;
  --rule: #dde3ee;
  --accent: #6d5ef8;
  --accent-2: #00a7c2;
  --accent-3: #d946ef;
  --shadow: 0 24px 80px rgba(31, 41, 55, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(139, 92, 246, 0.2), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(6, 182, 212, 0.16), transparent 34%),
    linear-gradient(135deg, var(--bg), #05060a 70%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 390px;
  align-items: center;
  gap: 54px;
  padding: 32px 0;
}

.brand-panel {
  padding: 44px;
  background: color-mix(in srgb, var(--bg-soft) 84%, transparent);
  border: 1px solid color-mix(in srgb, var(--rule) 78%, transparent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: auto -18% -36% 24%;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 62%);
  pointer-events: none;
}

.logo-mark {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.18), rgba(6, 182, 212, 0.1));
  border: 1px solid var(--rule);
  margin-bottom: 28px;
}

.logo-mark svg {
  width: 68px;
  height: 68px;
}

.eyebrow,
.screen-kicker,
.section-title,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, var(--ink), var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  color: transparent;
}

.hero-text {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.wide-action {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.wide-action {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px rgba(139, 92, 246, 0.3);
}

.secondary-btn,
.ghost-btn {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.wide-action:hover,
.project-card:hover {
  transform: translateY(-2px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.stats-grid div {
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stats-grid strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.phone-frame {
  height: min(860px, calc(100vh - 44px));
  min-height: 720px;
  border-radius: 46px;
  border: 12px solid #191a20;
  background: var(--bg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  position: relative;
}

.phone-frame::before {
  content: "";
  position: absolute;
  z-index: 30;
  top: 0;
  left: 50%;
  width: 142px;
  height: 28px;
  transform: translateX(-50%);
  background: #191a20;
  border-radius: 0 0 18px 18px;
}

.status-bar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.screen {
  position: absolute;
  inset: 0;
  padding-top: 38px;
  display: none;
  flex-direction: column;
  background: var(--bg);
}

.screen.active {
  display: flex;
  animation: enter 0.26s ease both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.screen-header {
  flex: 0 0 auto;
  padding: 26px 18px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background:
    radial-gradient(circle at 80% 0, rgba(139, 92, 246, 0.28), transparent 44%),
    var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}

.screen-header.compact {
  justify-content: flex-start;
}

.screen-header h2 {
  margin: 2px 0 3px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.screen-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.icon-btn,
.back-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  margin-top: 3px;
}

.back-btn {
  width: auto;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.screen-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 98px;
  scrollbar-width: none;
}

.screen-content::-webkit-scrollbar {
  display: none;
}

.wide-action {
  width: 100%;
  margin-bottom: 18px;
}

.section-title,
.field-label {
  display: block;
  margin: 14px 0 8px;
}

.project-card,
.insight-card,
.detail-card,
.summary-card,
.prompt-card,
.tour-preview {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.project-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s ease;
}

.project-card.highlighted {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--rule));
}

.project-card h3,
.insight-card h3,
.detail-card h3,
.prompt-card h3,
.tour-preview h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.project-card p,
.insight-card p,
.detail-card p,
.prompt-card p,
.tour-preview p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.project-card span {
  align-self: flex-start;
  padding: 5px 10px;
  color: #fff;
  border-radius: 999px;
  background: var(--accent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.project-card .pink {
  background: var(--accent-3);
}

.project-card .cyan {
  background: var(--accent-2);
}

.insight-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.1)), var(--surface);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.type-option,
.style-card {
  min-height: 88px;
  padding: 10px;
  border-radius: 18px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule);
  font-weight: 800;
}

.type-option.active,
.style-card.active,
.tool-row button.active,
.chip-row button.active,
.pin.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.text-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.text-input:focus {
  border-color: var(--accent);
}

.textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.upload-box {
  min-height: 168px;
  margin-bottom: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 72%, var(--rule));
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.08)),
    var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 800;
}

.upload-box img {
  display: none;
  width: 100%;
  height: 168px;
  object-fit: cover;
}

.upload-box.has-image span {
  display: none;
}

.upload-box.has-image img {
  display: block;
}

.detail-card summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.progress-track {
  height: 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.progress-track span {
  display: block;
  width: 33%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
}

.mock-room,
.annotation-board,
.floor-plan {
  height: 250px;
  margin-bottom: 14px;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(6, 182, 212, 0.1)),
    var(--surface);
  position: relative;
  overflow: hidden;
}

.mock-room span {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.room-window {
  position: absolute;
  top: 30px;
  left: 34px;
  right: 34px;
  height: 78px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.24), rgba(255, 255, 255, 0.04));
}

.room-sofa {
  position: absolute;
  left: 46px;
  bottom: 60px;
  width: 170px;
  height: 58px;
  border-radius: 20px 20px 12px 12px;
  background: #d8d1c2;
  box-shadow: inset 0 -14px 0 rgba(0, 0, 0, 0.08);
}

.room-table {
  position: absolute;
  right: 52px;
  bottom: 48px;
  width: 78px;
  height: 36px;
  border-radius: 50%;
  background: #9b7653;
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.summary-card {
  display: grid;
  gap: 7px;
}

.summary-card span,
.summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  font-size: 20px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip-row button,
.tool-row button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
}

.prompt-card {
  border-color: color-mix(in srgb, var(--accent-2) 70%, var(--rule));
}

.list-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.space-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
}

.space-item strong {
  display: block;
  font-size: 14px;
}

.space-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.space-item em {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-2);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.annotation-board::before {
  content: "";
  position: absolute;
  inset: 36px 24px 58px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
}

.anno-box {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  color: white;
  background: rgba(139, 92, 246, 0.14);
  font-size: 12px;
  font-weight: 800;
}

.anno-box.sofa {
  left: 54px;
  top: 86px;
  width: 160px;
  height: 70px;
}

.anno-box.table {
  right: 52px;
  bottom: 50px;
  width: 86px;
  height: 50px;
  border-color: var(--accent-2);
  background: rgba(6, 182, 212, 0.12);
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.ref-item {
  aspect-ratio: 1;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1)), var(--surface);
  border: 1px solid var(--rule);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

.ref-item.done {
  color: white;
  border-color: var(--accent);
}

.settings-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.setting-group {
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
}

.setting-group h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.setting-group p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

code {
  padding: 2px 6px;
  border-radius: 7px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-stat-grid article {
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--surface);
}

.admin-stat-grid strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.admin-stat-grid span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-list article {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
}

.admin-list strong,
.admin-list small {
  display: block;
}

.admin-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--muted) 18%, transparent);
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 18%, transparent);
}

.status-dot.running {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-2) 18%, transparent);
}

.status-dot.warn {
  background: var(--warning);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 20%, transparent);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.result-card {
  min-height: 150px;
  padding: 12px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background:
    linear-gradient(140deg, rgba(238, 232, 220, 0.92), rgba(170, 151, 132, 0.72)),
    var(--surface);
  overflow: hidden;
}

.result-card.warm {
  background: linear-gradient(140deg, #f6d8aa, #b48765);
}

.result-card.dark {
  background: linear-gradient(140deg, #21242f, #75624a);
}

.result-card.garden {
  background: linear-gradient(140deg, #bfe5c6, #567a57);
}

.result-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.16);
}

.result-card span {
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.34);
  font-size: 12px;
  font-weight: 800;
}

.floor-plan {
  height: 320px;
  background: var(--surface);
}

.room {
  position: absolute;
  border: 2px solid var(--rule);
  border-radius: 14px;
}

.room.r1 {
  left: 22px;
  top: 34px;
  width: 128px;
  height: 96px;
}

.room.r2 {
  right: 22px;
  top: 34px;
  width: 154px;
  height: 96px;
}

.room.r3 {
  left: 22px;
  right: 22px;
  bottom: 34px;
  height: 142px;
}

.pin {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.46);
  font-weight: 900;
}

.pin.living {
  left: 42%;
  top: 62%;
}

.pin.bedroom {
  left: 22%;
  top: 22%;
  background: var(--accent-2);
}

.pin.kitchen {
  right: 25%;
  top: 22%;
  background: var(--accent-3);
}

.bottom-bar,
.tab-bar {
  position: absolute;
  z-index: 15;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
  border-top: 1px solid var(--rule);
  backdrop-filter: blur(18px);
}

.bottom-bar {
  bottom: 62px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  padding: 10px 14px;
}

.tab-bar {
  bottom: 0;
  height: 62px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px 8px;
}

.tab-bar button {
  color: var(--muted);
  background: transparent;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
}

.tab-bar button.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 999;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--rule));
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 16px;
  }

  .brand-panel {
    padding: 28px;
  }

  .phone-frame {
    width: min(390px, calc(100vw - 32px));
    height: 760px;
    margin: 0 auto;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 0;
  }

  .brand-panel {
    border-radius: 0 0 28px 28px;
  }

  .phone-frame {
    width: 100vw;
    height: 100vh;
    min-height: 700px;
    border: 0;
    border-radius: 0;
  }

  .phone-frame::before {
    display: none;
  }
}
