:root {
  color-scheme: light;
  --bg: #f4f2ea;
  --panel: rgba(255, 251, 245, 0.88);
  --line: rgba(28, 39, 31, 0.1);
  --line-strong: rgba(23, 39, 28, 0.18);
  --text: #11251a;
  --muted: #5f6e64;
  --green: #1a6d49;
  --green-strong: #0e5a3b;
  --shadow: 0 24px 60px rgba(15, 28, 20, 0.1);
  --shadow-soft: 0 14px 35px rgba(18, 32, 23, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(244, 242, 234, 0.96)),
    #f4f2ea;
}

button,
input,
textarea {
  font: inherit;
}

code {
  font-family: "Cascadia Code", "JetBrains Mono", "Consolas", monospace;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.58;
  pointer-events: none;
  z-index: 0;
}

.ambient-a {
  top: -40px;
  left: -60px;
  width: 320px;
  height: 320px;
  background: rgba(78, 157, 116, 0.18);
}

.ambient-b {
  right: -30px;
  top: 80px;
  width: 340px;
  height: 340px;
  background: rgba(212, 191, 140, 0.2);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1340px, calc(100vw - 28px));
  margin: 18px auto 36px;
  display: grid;
  gap: 18px;
}

.panel,
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.hero-copy h1,
.section-head h2,
.card-topline h3 {
  margin: 0;
}

.eyebrow,
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 0.98;
  max-width: 11ch;
}

.hero-desc,
.section-desc,
.card-topline p,
.status-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-status {
  display: grid;
  align-content: start;
  gap: 12px;
}

.status-pill,
.mini-badge,
.tiny-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.status-pill {
  min-height: 52px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #184f38, #267555);
  color: #fff;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
}

.status-note {
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(23, 39, 28, 0.08);
}

.panel {
  padding: 22px;
}

.section-head,
.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-head.compact {
  align-items: center;
}

.action-row,
.size-pills,
.stat-row,
.info-metrics,
.tips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn,
.size-pill {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 18px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.btn:hover,
.size-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(17, 31, 21, 0.08);
}

.size-pill.active,
.btn.strong {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green-strong), #2f8760);
  color: #fff;
  box-shadow: 0 16px 28px rgba(19, 82, 57, 0.2);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.42);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.field-grid,
.stream-grid {
  display: grid;
  gap: 18px;
}

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

.field-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.field-card,
.preview-card,
.tip-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 37, 29, 0.08);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.field-card {
  display: grid;
  gap: 10px;
}

.field-card span,
.tip-card span {
  color: var(--muted);
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(18, 36, 26, 0.12);
  border-radius: 18px;
  padding: 14px 16px;
  background: #fffdfa;
  color: var(--text);
}

input {
  min-height: 54px;
  font-size: 18px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(22, 98, 67, 0.45);
  box-shadow: 0 0 0 5px rgba(27, 107, 74, 0.08);
}

.sender-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mini-stat,
.metric,
.tip-card {
  border: 1px solid rgba(18, 35, 25, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 16px;
}

.mini-stat span,
.metric span,
.tip-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-stat strong,
.metric strong,
.tip-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.tip-card {
  min-width: 180px;
  flex: 1 1 220px;
}

.stream-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
}

.card-topline {
  margin-bottom: 14px;
}

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stage.dark {
  background:
    radial-gradient(circle at top, rgba(50, 82, 63, 0.2), transparent 34%),
    #09110d;
}

.stage.soft {
  background:
    radial-gradient(circle at 20% 0%, rgba(29, 95, 67, 0.14), transparent 30%),
    linear-gradient(180deg, #101813, #0c120f);
}

video,
.preview-canvas {
  display: block;
  width: 100%;
  min-height: 420px;
  max-height: 72vh;
  object-fit: contain;
  background: transparent;
}

.crop-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.28),
    0 0 0 8px rgba(13, 26, 18, 0.16);
  pointer-events: none;
}

.preview-canvas {
  aspect-ratio: 1;
}

.metric.tall {
  min-height: 112px;
  display: grid;
  align-content: center;
  min-width: 180px;
  flex: 1 1 220px;
}

.mini-badge,
.tiny-pill {
  min-height: 40px;
  padding: 10px 14px;
  background: rgba(20, 92, 62, 0.08);
  color: var(--green-strong);
}

.log-panel {
  margin-bottom: 8px;
}

.log-box {
  margin: 14px 0 0;
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 0 0, rgba(45, 92, 65, 0.14), transparent 24%),
    linear-gradient(180deg, #111a15, #0c130f);
  color: #dfece3;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-family: "Cascadia Code", "JetBrains Mono", "Consolas", monospace;
}

@media (max-width: 1180px) {
  .hero,
  .field-grid,
  .field-grid-5,
  .stream-grid {
    grid-template-columns: 1fr;
  }

  .sender-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 16px, 1340px);
    margin-top: 10px;
  }

  .hero,
  .section-head,
  .card-topline {
    flex-direction: column;
  }

  .panel,
  .hero {
    padding: 16px;
    border-radius: 24px;
  }

  video,
  .preview-canvas {
    min-height: 260px;
  }

  .sender-stats {
    grid-template-columns: 1fr;
  }
}
