:root {
  --bg: #f6efe6;
  --bg-accent: #eed6c1;
  --ink: #1f1a17;
  --muted: #6c5b50;
  --card: rgba(255, 249, 243, 0.88);
  --line: rgba(75, 52, 38, 0.12);
  --primary: #c7462b;
  --primary-dark: #922f1d;
  --secondary: #173f4e;
  --warn: #8e3a00;
  --ok: #1b5f43;
  --shadow: 0 20px 50px rgba(73, 44, 29, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(199, 70, 43, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(23, 63, 78, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #f7f4ef 100%);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: 0;
  border-radius: 50%;
  filter: blur(16px);
  pointer-events: none;
}

body::before {
  top: 64px;
  right: 6vw;
  width: 260px;
  height: 260px;
  background: rgba(199, 70, 43, 0.12);
}

body::after {
  left: 6vw;
  bottom: 48px;
  width: 220px;
  height: 220px;
  background: rgba(23, 63, 78, 0.12);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 52px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 249, 243, 0.7);
  border: 1px solid var(--line);
  color: var(--secondary);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 12px 0 10px;
  font-family: "Iowan Old Style", "Georgia", "STSong", serif;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.platform-pill,
.note-card,
.panel,
.preview-panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.platform-pill {
  justify-self: end;
  padding: 14px 18px;
  border-radius: 20px;
  color: var(--secondary);
  font-weight: 600;
}

.note-card {
  padding: 18px 20px;
  border-radius: 22px;
}

.note-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 24px;
}

.panel,
.preview-panel {
  padding: 22px;
  border-radius: var(--radius);
}

.panel h2,
.preview-panel h2 {
  margin: 0 0 8px;
  font-size: 1.14rem;
}

.panel-subtitle,
.preview-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.share-form {
  display: grid;
  gap: 12px;
}

.share-form label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--secondary);
}

.share-form textarea {
  width: 100%;
  min-height: 144px;
  resize: vertical;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(23, 63, 78, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
}

.share-form textarea:focus {
  outline: 2px solid rgba(199, 70, 43, 0.18);
  border-color: rgba(199, 70, 43, 0.42);
}

.button-row,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.ghost-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button {
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #e66939 100%);
  color: #fff9f4;
  box-shadow: 0 14px 26px rgba(199, 70, 43, 0.22);
}

.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid rgba(23, 63, 78, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: var(--secondary);
}

.status-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.status-panel h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.status-panel p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.status-panel[data-tone="warn"] {
  border-color: rgba(142, 58, 0, 0.16);
  background: rgba(255, 240, 228, 0.92);
}

.status-panel[data-tone="soft"] {
  border-color: rgba(23, 63, 78, 0.14);
  background: rgba(241, 248, 252, 0.86);
}

.result-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.fact-row {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.fact-row span {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-row strong,
.fact-row code {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.fact-row code,
.preview-meta code {
  font-family: "SFMono-Regular", "JetBrains Mono", monospace;
}

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

.preview-meta {
  display: grid;
  gap: 8px;
}

.preview-meta code {
  color: var(--secondary);
  overflow-wrap: anywhere;
}

.preview-state {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(241, 248, 252, 0.86);
  border: 1px solid rgba(23, 63, 78, 0.14);
  color: var(--secondary);
  line-height: 1.5;
}

.preview-state[data-tone="warn"] {
  background: rgba(255, 240, 228, 0.92);
  border-color: rgba(142, 58, 0, 0.16);
  color: var(--warn);
}

.phone-frame {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border-radius: 34px;
  border: 10px solid rgba(30, 26, 22, 0.94);
  background: #fff;
  box-shadow: 0 30px 60px rgba(31, 26, 23, 0.18);
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 34%;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.96);
  z-index: 2;
}

.phone-frame iframe {
  width: 100%;
  min-height: 620px;
  border: none;
  background: linear-gradient(180deg, #faf6f0 0%, #f0ece7 100%);
}

.footer {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .platform-pill {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    margin: 14px auto 24px;
  }

  .panel,
  .preview-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .phone-frame,
  .phone-frame iframe {
    min-height: 500px;
  }
}
