:root {
  color-scheme: light;
  --bg: #f7f0e8;
  --paper: #fffaf2;
  --paper-strong: #fff4df;
  --ink: #241b18;
  --muted: #776b62;
  --line: #ead9c4;
  --night: #27334f;
  --plum: #7e4d6c;
  --gold: #c98d3f;
  --rose: #b75d5b;
  --green: #55745f;
  --shadow: 0 18px 42px rgba(63, 42, 25, 0.12);
  --soft-shadow: 0 10px 26px rgba(63, 42, 25, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(126, 77, 108, 0.14), transparent 30%),
    radial-gradient(circle at 80% 8%, rgba(201, 141, 63, 0.16), transparent 26%),
    linear-gradient(180deg, #f2e5d6 0%, #fffaf2 48%, #eef3ee 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 42px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.9), rgba(255, 250, 242, 0.76)),
    repeating-linear-gradient(90deg, rgba(126, 77, 108, 0.04) 0 1px, transparent 1px 24px);
  box-shadow: 0 0 0 1px rgba(234, 217, 196, 0.55);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero {
  padding: 8px 2px 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--plum);
  font-size: 12px;
  font-weight: 900;
}

.hero h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
}

.hero p:last-child {
  margin: 14px 0 0;
  max-width: 320px;
  color: var(--muted);
  line-height: 1.7;
}

.panel,
.report-card,
.notice,
.history-block,
.share-preview {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.86);
  box-shadow: var(--shadow);
}

.input-panel {
  margin-top: 12px;
  padding: 18px;
}

.input-panel label {
  display: block;
  font-size: 19px;
  font-weight: 900;
}

textarea {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #ead7bf;
  border-radius: 16px;
  background: #fffdf8;
  color: var(--ink);
  padding: 15px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

textarea:focus {
  border-color: rgba(126, 77, 108, 0.42);
  box-shadow: 0 0 0 3px rgba(126, 77, 108, 0.12);
}

.input-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.input-meta strong {
  color: var(--plum);
  white-space: nowrap;
}

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

.style-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  padding: 15px;
  text-align: left;
  box-shadow: var(--soft-shadow);
}

.style-card strong,
.style-card span {
  display: block;
}

.style-card strong {
  font-size: 17px;
}

.style-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.style-card.selected {
  border-color: rgba(126, 77, 108, 0.58);
  background: linear-gradient(180deg, #fff6e8, #fffdf8);
}

.example-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.example-strip button,
.ghost-button,
.section-heading button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  height: 58px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--night), var(--plum));
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(39, 51, 79, 0.22);
}

.primary-action:disabled {
  opacity: 0.68;
  cursor: wait;
  box-shadow: none;
}

.notice {
  margin-top: 14px;
  padding: 13px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  box-shadow: none;
}

.history-block,
.share-preview {
  margin-top: 18px;
  padding: 16px;
}

.section-heading,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h2,
.topbar h1 {
  margin: 0;
  font-size: 18px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  padding: 12px;
  text-align: left;
}

.history-item strong {
  display: block;
  color: var(--ink);
}

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

.topbar {
  min-height: 52px;
}

.report-card {
  margin-top: 14px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.95), rgba(255, 245, 226, 0.92)),
    linear-gradient(90deg, rgba(201, 141, 63, 0.08), transparent);
}

.report-card h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
}

.summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span {
  border-radius: 999px;
  background: #f1e4d7;
  color: var(--plum);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.report-section {
  margin-top: 18px;
}

.report-section h3 {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 15px;
}

.report-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.symbol-list {
  display: grid;
  gap: 9px;
}

.symbol-item {
  border-left: 3px solid var(--gold);
  padding-left: 11px;
  color: var(--muted);
  line-height: 1.65;
}

.symbol-item strong {
  color: var(--ink);
}

.advice-box {
  margin-top: 18px;
  border-radius: 16px;
  background: #fff0dc;
  padding: 14px;
}

.advice-box span {
  color: var(--rose);
  font-size: 12px;
  font-weight: 900;
}

.advice-box p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.5;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.score-grid div {
  border: 1px solid #ead7bf;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  padding: 13px;
}

.score-grid strong {
  display: block;
  color: var(--night);
  font-size: 28px;
}

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

blockquote {
  margin: 18px 0 0;
  border-left: 4px solid var(--plum);
  padding: 3px 0 3px 12px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.5;
}

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

.action-grid button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font-weight: 900;
}

.action-grid button:nth-child(2) {
  background: var(--plum);
}

.action-grid button:nth-child(3) {
  background: #746b62;
}

.share-preview img {
  display: block;
  width: 100%;
  margin-top: 12px;
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 26px;
  left: 20px;
  z-index: 5;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 14px;
  background: rgba(36, 27, 24, 0.92);
  color: #fff;
  padding: 12px 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 370px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .style-grid {
    grid-template-columns: 1fr;
  }
}
