:root {
  color-scheme: light;
  --bg: #f3efe8;
  --paper: #fffdf8;
  --paper-soft: #fbf6ee;
  --text: #292724;
  --muted: #6e665f;
  --line: #ded2c2;
  --accent: #7f5f3c;
  --accent-dark: #5e472f;
  --green: #3f6f5e;
  --shadow: 0 22px 70px rgba(62, 48, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(120deg, rgba(127, 95, 60, 0.08), transparent 34%),
    linear-gradient(240deg, rgba(63, 111, 94, 0.1), transparent 38%),
    var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

.page {
  width: min(920px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.intro,
.panel,
.result {
  width: 100%;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(222, 210, 194, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 56px);
}

.intro {
  max-width: 760px;
}

.result {
  position: relative;
}

.result::after {
  content: "";
  position: absolute;
  right: clamp(20px, 5vw, 54px);
  bottom: 88px;
  width: min(420px, 62vw);
  height: 120px;
  background: url("../../assets/brand/daiyu-logo-watermark.svg") center / contain no-repeat;
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 28px;
  color: var(--accent-dark);
  text-decoration: none;
  user-select: none;
}

.logo:hover,
.logo:focus-visible {
  color: var(--accent);
}

.logo:focus-visible,
.copyright a:focus-visible {
  outline: 3px solid rgba(127, 95, 60, 0.2);
  outline-offset: 5px;
  border-radius: 8px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: block;
}

.logo-text {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0;
}

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

h1 {
  max-width: 9em;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 26px;
  font-size: clamp(30px, 4.8vw, 48px);
  line-height: 1.18;
  font-weight: 620;
}

h3 {
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 620;
}

.lead {
  max-width: 560px;
  margin-bottom: 10px;
  color: #3d3832;
  font-size: 22px;
  line-height: 1.7;
}

.scene-note {
  max-width: 640px;
  margin-bottom: 22px;
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1.7;
}

.note,
.risk,
.closing,
.method p {
  color: var(--muted);
  line-height: 1.8;
}

.method {
  max-width: 680px;
  margin: 28px 0 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 0 20px;
}

.method h2 {
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.35;
  font-weight: 620;
}

.method p {
  margin-bottom: 12px;
  font-size: 16px;
}

.method p:last-child {
  margin-bottom: 0;
}

mark {
  border-radius: 4px;
  background: #efe2cf;
  color: #4f3924;
  padding: 1px 4px;
}

.method-flow,
.result-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
}

.method-flow {
  margin-top: 18px;
}

.method-flow span,
.result-flow span {
  border: 1px solid rgba(127, 95, 60, 0.2);
  border-radius: 999px;
  background: #fbf6ee;
  padding: 7px 12px;
  font-size: 14px;
  line-height: 1;
  font-weight: 620;
}

.method-flow b,
.result-flow b {
  color: #a89176;
  font-weight: 600;
}

.note {
  max-width: 620px;
  margin-bottom: 34px;
  font-size: 15px;
}

.ai-hint {
  margin: 14px 0 0;
  border-left: 3px solid rgba(63, 111, 94, 0.35);
  color: var(--muted);
  padding-left: 12px;
  font-size: 15px;
  line-height: 1.75;
}

.hidden {
  display: none;
}

.progress {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 15px;
}

.bar {
  height: 6px;
  overflow: hidden;
  background: #e7ded2;
  border-radius: 999px;
}

.bar span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 220ms ease;
}

.question {
  display: none;
}

.question.active {
  display: block;
}

label {
  display: block;
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(26px, 4.2vw, 40px);
  line-height: 1.28;
  font-weight: 610;
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--text);
  outline: none;
  padding: 18px 20px;
  font-size: 18px;
  line-height: 1.7;
}

textarea:focus {
  border-color: rgba(127, 95, 60, 0.78);
  box-shadow: 0 0 0 4px rgba(127, 95, 60, 0.1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 0 22px;
  font-weight: 560;
}

.primary {
  background: var(--accent-dark);
  color: #fffdf8;
}

.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent-dark);
}

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

.result-flow {
  margin: -8px 0 24px;
}

.result-mode {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgba(127, 95, 60, 0.24);
  border-radius: 8px;
  background: #fbf6ee;
  color: var(--accent-dark);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
}

.result-mode.hidden {
  display: none;
}

article {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 22px;
}

article p {
  margin-bottom: 0;
  color: #38332d;
  line-height: 1.75;
  white-space: pre-line;
}

article:nth-of-type(4),
article:nth-of-type(5) {
  border-color: rgba(63, 111, 94, 0.26);
  background: #f3f7f1;
}

article:nth-of-type(4) h3,
article:nth-of-type(5) h3 {
  color: #365f50;
}

.wide {
  grid-column: 1 / -1;
  min-height: 130px;
}

.closing {
  margin: 24px 0 0;
  font-size: 16px;
}

.risk {
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 14px;
}

.copyright {
  margin: 22px 0 0;
  color: #8a8177;
  font-size: 13px;
  line-height: 1.6;
}

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

.copyright a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 920px);
    padding: 10px 0;
    place-items: start center;
  }

  .intro,
  .panel,
  .result {
    padding: 24px 18px;
  }

  .lead {
    font-size: 18px;
  }

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

  .method-flow,
  .result-flow {
    gap: 7px;
  }

  .method-flow b,
  .result-flow b {
    display: none;
  }

  .method-flow span,
  .result-flow span {
    padding: 7px 10px;
  }

  article {
    min-height: auto;
  }

  button {
    flex: 1 1 auto;
  }
}
