:root {
  --ink: #17332d;
  --muted: #60716c;
  --paper: #fffdf7;
  --cream: #f4f0e5;
  --green: #286c5b;
  --green-dark: #174a3e;
  --mint: #dcebe2;
  --peach: #ef9f74;
  --yellow: #f4c95d;
  --line: rgba(23, 51, 45, .14);
  --shadow: 0 24px 70px rgba(39, 68, 60, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(239,159,116,.20), transparent 25rem),
    radial-gradient(circle at 92% 42%, rgba(123,177,146,.20), transparent 27rem),
    var(--cream);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; border-radius: 50%; filter: blur(4px); pointer-events: none; z-index: -1; }
.ambient-a { width: 12rem; height: 12rem; background: rgba(244,201,93,.23); left: -5rem; top: 34%; }
.ambient-b { width: 18rem; height: 18rem; background: rgba(239,159,116,.15); right: -7rem; bottom: 5%; }

.site-header, footer {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header { height: 76px; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--green); border-radius: 11px 11px 11px 4px; }
.header-note { color: var(--muted); font-size: 13px; }

.app-shell { width: min(1120px, calc(100% - 32px)); min-height: calc(100vh - 152px); margin: 0 auto; display: grid; place-items: center; }
.panel { width: 100%; background: rgba(255,253,247,.91); border: 1px solid rgba(255,255,255,.9); border-radius: 32px; box-shadow: var(--shadow); overflow: hidden; }

.login-panel { max-width: 980px; display: grid; grid-template-columns: 1.05fr .95fr; min-height: 610px; }
.login-story { padding: 58px; background: var(--green-dark); color: white; position: relative; overflow: hidden; }
.login-story::after { content: ""; position: absolute; width: 250px; height: 250px; border: 55px solid rgba(255,255,255,.06); border-radius: 50%; right: -95px; bottom: -80px; }
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: 12px; font-weight: 800; color: var(--peach); }
h1 { font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -.045em; margin: 20px 0 24px; }
.login-story p { max-width: 440px; color: rgba(255,255,255,.75); line-height: 1.8; }
.pet-orbit { margin-top: 62px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; position: relative; z-index: 1; }
.pet-orbit span { display: grid; place-items: center; aspect-ratio: 1; font-size: 32px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.13); border-radius: 20px; transform: rotate(var(--r)); }
.pet-orbit span:nth-child(1) { --r: -5deg; }.pet-orbit span:nth-child(2) { --r: 4deg; }.pet-orbit span:nth-child(3) { --r: -2deg; }.pet-orbit span:nth-child(4) { --r: 6deg; }

.login-form { padding: 58px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2, .intro-copy h2 { margin: 8px 0 12px; font-family: Georgia, "Noto Serif SC", serif; font-size: 34px; }
.login-form > p { color: var(--muted); line-height: 1.7; margin: 0 0 30px; }
label { font-weight: 750; font-size: 14px; }
.code-input { width: 100%; margin: 10px 0 12px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: white; outline: none; letter-spacing: .18em; font-size: 20px; transition: .2s; }
.code-input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(40,108,91,.10); }
.error { min-height: 22px; color: #a34133; font-size: 13px; margin-bottom: 12px; }
.primary, .secondary, .text-button { border: 0; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; }
.primary { padding: 15px 22px; border-radius: 14px; background: var(--green); color: white; font-weight: 800; box-shadow: 0 10px 22px rgba(40,108,91,.22); }
.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(40,108,91,.27); }
.primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.microcopy { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.intro-panel { max-width: 980px; padding: 58px; display: grid; grid-template-columns: 1fr 1fr; gap: 55px; align-items: center; }
.intro-copy p { color: var(--muted); line-height: 1.8; }
.meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 30px; }
.chip { padding: 8px 12px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: 13px; font-weight: 700; }
.principles { display: grid; gap: 12px; }
.principle { padding: 18px; border-radius: 18px; background: #f7f3e9; display: flex; gap: 14px; align-items: center; }
.principle b { display: block; margin-bottom: 3px; }.principle small { color: var(--muted); line-height: 1.5; }
.principle-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: white; font-size: 20px; }

.quiz-wrap { width: min(820px, 100%); padding: 12px 0 38px; }
.progress-top { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.progress-label { font-size: 13px; font-weight: 800; color: var(--green); }
.progress-count { color: var(--muted); font-size: 13px; }
.progress-track { height: 8px; border-radius: 99px; background: rgba(40,108,91,.12); overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--peach), var(--yellow)); border-radius: inherit; transition: width .35s ease; }
.question-card { padding: clamp(28px, 6vw, 54px); min-height: 560px; display: flex; flex-direction: column; }
.section-tag { color: var(--peach); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.question-card h2 { font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(27px, 4vw, 38px); line-height: 1.35; margin: 15px 0 10px; }
.hint { color: var(--muted); font-size: 14px; min-height: 24px; margin-bottom: 24px; }
.options { display: grid; gap: 11px; }
.option { display: flex; gap: 14px; align-items: center; width: 100%; padding: 16px 18px; background: white; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; text-align: left; line-height: 1.5; transition: .16s; }
.option:hover { border-color: rgba(40,108,91,.45); transform: translateX(3px); }
.option.selected { border-color: var(--green); background: #f0f7f3; box-shadow: 0 0 0 3px rgba(40,108,91,.09); }
.option-key { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 10px; background: var(--cream); font-size: 12px; font-weight: 900; }
.option.selected .option-key { background: var(--green); color: white; }
.quiz-actions { position: sticky; bottom: 12px; z-index: 2; display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.94); box-shadow: 0 10px 28px rgba(31,64,53,.12); backdrop-filter: blur(10px); }
.quiz-actions .primary, .quiz-actions .secondary { min-width: 132px; }
.secondary { padding: 13px 19px; border-radius: 13px; background: transparent; font-weight: 800; color: var(--muted); }
.secondary:hover { background: var(--cream); }

.result-page { width: min(1040px, 100%); padding: 20px 0 54px; }
.result-hero { padding: clamp(32px, 6vw, 58px); display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; background: var(--green-dark); color: white; }
.result-kicker { color: var(--yellow); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.result-hero h1 { margin: 15px 0 18px; font-size: clamp(38px, 6vw, 62px); }
.result-hero p { color: rgba(255,255,255,.77); line-height: 1.8; max-width: 620px; }
.match-pill { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; font-size: 13px; }
.pet-portrait { display: grid; place-items: center; align-self: center; justify-self: end; width: min(250px, 100%); aspect-ratio: 1; border-radius: 42% 58% 54% 46% / 48% 45% 55% 52%; background: var(--peach); font-size: clamp(82px, 13vw, 135px); box-shadow: inset 0 0 0 16px rgba(255,255,255,.12); }
.result-body { padding: clamp(28px, 5vw, 50px); }
.result-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px; }
.profile-card, .why-card, .scenario { border: 1px solid var(--line); border-radius: 22px; background: white; }
.profile-card, .why-card { padding: 25px; }
.profile-card h3, .why-card h3, .scenes h3 { margin: 0 0 18px; font-size: 18px; }
.bar-row { margin: 14px 0; }.bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 7px; background: var(--cream); border-radius: 99px; overflow: hidden; }.bar span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.reason-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.reason-list li { display: flex; gap: 11px; line-height: 1.6; color: var(--muted); }
.reason-list li::before { content: "✓"; flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: var(--green); background: var(--mint); font-weight: 900; }
.scenes { margin-top: 34px; }
.breeds { margin-top: 38px; padding-top: 34px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 18px; }
.section-heading h3 { margin: 7px 0 0; font-size: 22px; }
.section-heading > p { max-width: 460px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.breed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.breed-grid.single { grid-template-columns: minmax(0, 1fr); }
.breed-card { position: relative; min-height: 170px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #fff, #faf6eb); }
.breed-card:first-child { background: var(--mint); border-color: transparent; }
.breed-no { position: absolute; right: 16px; top: 10px; color: rgba(40,108,91,.13); font: 800 42px/1 Georgia, serif; }
.breed-card h4 { position: relative; margin: 15px 0 9px; font-size: 16px; }
.breed-card p { position: relative; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.alternatives { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.alternative-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.alternative-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.alternative-rank { position: absolute; right: 12px; top: 8px; color: rgba(40,108,91,.1); font: 800 32px/1 Georgia,serif; }
.alternative-emoji { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--cream); font-size: 24px; }
.alternative-card small { color: var(--muted); font-size: 11px; }
.alternative-card h4 { margin: 4px 0 0; font-size: 15px; }
.alternative-card strong { position: relative; color: var(--green); font-size: 18px; }
.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scenario { padding: 22px; }
.scenario .time { color: var(--peach); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.scenario h4 { margin: 10px 0 8px; }.scenario p { color: var(--muted); line-height: 1.65; margin: 0; font-size: 14px; }
.notice { margin-top: 22px; padding: 18px 20px; border-radius: 16px; background: #fff5de; color: #705526; font-size: 13px; line-height: 1.65; }
.result-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.text-button { padding: 12px 3px; background: transparent; color: var(--green); font-weight: 800; }

footer { min-height: 76px; gap: 20px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .header-note { display: none; }
  .login-panel, .intro-panel, .result-hero, .result-grid { grid-template-columns: 1fr; }
  .login-story { padding: 38px 28px; min-height: 330px; }
  .login-form, .intro-panel { padding: 34px 27px; }
  .pet-orbit { margin-top: 30px; }
  .result-hero { text-align: center; }
  .pet-portrait { justify-self: center; width: 180px; }
  .scene-grid { grid-template-columns: 1fr; }
  .breed-grid { grid-template-columns: 1fr; }
  .alternative-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 10px; }
  .question-card { min-height: 610px; }
  .quiz-actions { bottom: 8px; }
  .quiz-actions .primary, .quiz-actions .secondary { min-width: 0; flex: 1; }
  footer { flex-direction: column; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
