:root {
  color-scheme: light;
  --bg: #f4efe6;
  --paper: #fffdf8;
  --paper-soft: #fbf4ea;
  --ink: #292724;
  --muted: #71675d;
  --line: #dfd1bf;
  --brown: #6a5035;
  --brown-dark: #493624;
  --green: #2f6b59;
  --orange: #d57537;
  --gold: #c99a4e;
  --blue: #4f6475;
  --shadow: 0 22px 64px rgba(68, 51, 32, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(213, 117, 55, 0.12), transparent 34%),
    linear-gradient(300deg, rgba(47, 107, 89, 0.1), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(222, 210, 194, 0.86);
  background: rgba(244, 239, 230, 0.93);
  padding: 14px clamp(18px, 5vw, 56px);
  backdrop-filter: blur(18px);
}

.brand,
.site-header nav {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 9px;
  color: var(--brown-dark);
  font-weight: 760;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-header nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-header nav a {
  border-radius: 999px;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 650;
}

.site-header nav a:hover {
  background: rgba(106, 80, 53, 0.08);
  color: var(--brown-dark);
}

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px) 0 54px;
}

.hero,
.result,
.chosen-paper,
.boundary {
  border: 1px solid rgba(222, 210, 194, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(28px, 6vw, 58px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 14px;
  font-weight: 760;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--brown-dark);
  font-size: clamp(48px, 8vw, 86px);
  line-height: 1.03;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  color: var(--brown-dark);
  font-size: clamp(30px, 4.8vw, 48px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  color: var(--brown-dark);
  font-size: 20px;
}

.lead {
  max-width: 780px;
  margin-bottom: 12px;
  color: #443f39;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.78;
}

.note,
.boundary p,
.takeaway p,
.result-head p {
  color: var(--muted);
  line-height: 1.78;
}

.mode-note {
  width: fit-content;
  margin: 10px 0 0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 680;
}

.mode-note.ai {
  background: rgba(47, 107, 89, 0.1);
  color: var(--green);
}

.mode-note.fallback {
  background: rgba(213, 117, 55, 0.12);
  color: #8d5732;
}

.note {
  max-width: 780px;
  margin-bottom: 28px;
}

.trouble-card {
  display: grid;
  gap: 12px;
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 18px;
}

.trouble-card label {
  color: var(--brown-dark);
  font-size: 18px;
  font-weight: 720;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(106, 80, 53, 0.18);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  padding: 14px;
  line-height: 1.7;
  outline: none;
}

textarea:focus {
  border-color: rgba(213, 117, 55, 0.55);
  box-shadow: 0 0 0 4px rgba(213, 117, 55, 0.12);
}

.form-foot,
.result-head,
.chosen-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-foot span {
  color: var(--muted);
  font-size: 13px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 720;
}

.primary-button {
  border: 1px solid var(--brown-dark);
  background: var(--brown-dark);
  color: #fffdf8;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--brown-dark);
}

.result,
.chosen,
.boundary {
  margin-top: 20px;
}

.result {
  padding: clamp(22px, 4vw, 34px);
}

.result-head {
  margin-bottom: 20px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
}

.result-card p {
  margin-bottom: 0;
  color: #433c35;
  font-size: 17px;
  line-height: 1.82;
}

.result-card.laugh {
  border-color: rgba(213, 117, 55, 0.32);
  background: #fff4e8;
}

.result-card.soft {
  border-color: rgba(79, 100, 117, 0.28);
  background: #f4f7f7;
}

.result-card.dayu {
  border-color: rgba(47, 107, 89, 0.28);
  background: #f3f7f1;
}

.result-card.care {
  border-color: rgba(106, 80, 53, 0.28);
  background: #f8f1e8;
}

.takeaway {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.takeaway-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.takeaway-buttons button {
  min-height: 42px;
  border: 1px solid rgba(73, 54, 36, 0.22);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--brown-dark);
  padding: 0 16px;
  font-weight: 700;
}

.takeaway-buttons button:hover {
  border-color: rgba(213, 117, 55, 0.58);
  background: #fff4e8;
}

.chosen-paper,
.boundary {
  padding: clamp(22px, 4vw, 34px);
}

.chosen-paper {
  background:
    linear-gradient(135deg, rgba(213, 117, 55, 0.1), transparent 38%),
    #fffdf8;
}

#chosenText {
  max-width: 800px;
  color: #433c35;
  font-size: 20px;
  line-height: 1.85;
}

.share-box {
  max-width: 620px;
  border: 1px dashed rgba(106, 80, 53, 0.3);
  border-radius: 8px;
  background: #fbf4ea;
  padding: 14px 16px;
  margin: 18px 0;
}

.share-box strong {
  color: var(--brown-dark);
}

.share-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.icp-footer {
  padding: 4px 24px 28px;
  text-align: center;
  font-size: 13px;
}

.icp-footer a {
  color: var(--muted);
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    justify-content: flex-start;
  }

  .form-foot,
  .result-head,
  .chosen-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

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

  .result-card {
    min-height: auto;
  }
}
