:root {
  --bg: #050607;
  --bg-soft: #0c0d10;
  --bg-elevated: rgba(255, 255, 255, 0.045);
  --bg-elevated-strong: rgba(255, 255, 255, 0.075);
  --ink: #fff;
  --muted: #b9bcc4;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --page-width: min(1120px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.05), transparent 22%),
    linear-gradient(180deg, #090a0b 0%, #050607 42%, #030405 100%);
  filter: grayscale(100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: none;
}

.page {
  width: var(--page-width);
  margin: 0 auto;
}

.hero-band {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  min-height: 320px;
  background-image: url("/images/header.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-band-image {
  display: none;
}

.hero-band-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 7, 0.12) 0%, rgba(5, 6, 7, 0.58) 62%, rgba(5, 6, 7, 0.92) 100%);
  display: flex;
  align-items: flex-end;
}

.hero-band-copy {
  padding-bottom: 46px;
}

.hero-band-copy.compact {
  padding-bottom: 28px;
}

.eyebrow,
.section-kicker,
.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.status-pill,
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.section-kicker {
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 10px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin: 14px 0 16px;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 18px;
}

.hero-lead,
.muted,
.field-hint,
.saved-meta,
.saved-entry-body p,
.data-list dt,
.meta-block span {
  color: var(--muted);
  line-height: 1.7;
}

.item-hero-name {
  margin-bottom: 6px;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
}

.site-flow,
.item-flow,
.result-flow {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding: 34px 0 56px;
}

.flow-strip,
.workspace-grid,
.item-layout,
.result-overview,
.result-grid-layout {
  display: grid;
  gap: 24px;
}

.flow-strip {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.flow-step,
.surface {
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.flow-step {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.flow-step strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.flow-step p {
  margin-bottom: 0;
  color: var(--muted);
}

.flow-index {
  display: inline-block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.workspace-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.workspace-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.surface {
  padding: 26px;
  border-radius: var(--radius-xl);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.stack-form,
.auth-form,
.create-form,
.camera-panel,
.saved-list,
.meta-stack,
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.two-col-form,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.two-col-form > * {
  flex: 1 1 240px;
}

.submit-row {
  padding-top: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  padding: 16px 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: var(--radius-md);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

input:focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.08);
}

textarea {
  resize: vertical;
}

.primary-btn,
.ghost-btn,
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease;
}

.primary-btn {
  background: #fff;
  color: #090a0b;
  font-weight: 700;
}

.ghost-btn,
.nav-link {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.primary-btn:hover,
.ghost-btn:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.saved-entry {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
}

.saved-entry-image {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 18px;
}

.saved-entry-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-entry-body p {
  margin-bottom: 0;
}

.saved-entry-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.camera-preview,
.camera-shot,
.detail-image,
.result-image {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.camera-preview,
.camera-shot,
.detail-image {
  aspect-ratio: 1 / 1;
}

.result-image {
  aspect-ratio: 4 / 3;
}

.item-layout {
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
}

.result-overview {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.result-grid-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-list {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px 16px;
}

.data-list dd {
  margin: 0;
}

.qr-surface {
  align-content: start;
}

.qr-image {
  width: min(100%, 220px);
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background: #fff;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 420px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 8px;
}

.bubble {
  max-width: min(78%, 640px);
  padding: 14px 16px;
  border-radius: 22px;
  line-height: 1.65;
}

.bubble.user {
  align-self: flex-end;
  background: #fff;
  color: #050607;
}

.bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
}

.meta-block {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.top-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .flow-strip,
  .workspace-grid,
  .item-layout,
  .result-overview,
  .result-grid-layout {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: 1fr;
  }

  .saved-entry {
    grid-template-columns: 1fr;
  }

  .saved-entry-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .saved-entry-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 100%);
  }

  .hero-band {
    min-height: 360px;
  }

  .hero-band-copy {
    padding-bottom: 24px;
  }

  .surface,
  .flow-step {
    padding: 20px;
    border-radius: 22px;
  }

  .button-row,
  .saved-entry-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .ghost-btn,
  .nav-link {
    width: 100%;
  }

  .chat-log {
    min-height: 320px;
  }
}
