/* Coffee Preference Fingerprint — 样式表 */
:root {
  --ink: #2c1810;
  --ink-2: #4a3228;
  --cream: #d4a574;
  --crema: #c8956c;
  --crema-deep: #a07050;
  --espresso: #3d1f0a;
  --parchment: #f5ebe0;
  --line: #e0d0bc;
  --line-strong: #b89578;
  --accent: #c4734a;
  --accent-2: #8b5e3c;
  --gold: #c9a050;
  --bg: #faf6f0;
  --card: #ffffff;
  --shadow: 0 4px 24px rgba(60, 30, 15, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.bg-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.bg-orb.a {
  width: 400px; height: 400px;
  background: var(--crema);
  top: -100px; left: -100px;
}

.bg-orb.b {
  width: 300px; height: 300px;
  background: var(--accent);
  bottom: -50px; right: -50px;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand svg { color: var(--accent); }

/* Screens */
.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home */
.hero {
  text-align: center;
  padding: 2rem 0;
}

.kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--line-strong);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tick { color: var(--accent); }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--ink);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-cup {
  margin: 1.5rem auto;
  max-width: 200px;
}

.hero-cup svg { width: 100%; height: auto; }

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 1rem 2.2rem;
  border-radius: 60px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(196, 115, 74, 0.3);
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(196, 115, 74, 0.4);
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2.5rem 0 1rem;
}

.cell {
  text-align: center;
}

.cell .n {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.cell .k {
  font-size: 0.75rem;
  color: var(--ink-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Axes Teaser */
.axes-teaser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
  margin: 2rem 0;
}

.axis-chip {
  display: flex;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.axis-chip .ic {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--parchment);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.axis-chip .poles {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.axis-chip .bl {
  font-size: 0.8rem;
  color: var(--ink-2);
}

.sca-ref {
  font-size: 0.7rem;
  color: var(--accent-2);
  margin-top: 0.3rem;
  font-style: italic;
}

/* Types Grid */
.types-strip {
  margin: 2rem 0;
}

.types-strip .h {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  margin-bottom: 0.8rem;
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.type-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
}

.type-mini .ic {
  flex-shrink: 0;
  color: var(--accent);
}

.type-mini .cd {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--ink-2);
  font-family: monospace;
}

/* Quiz */
.quiz {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: background 0.2s;
}

.quiz-back:hover { background: var(--parchment); }

.q-prog {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.q-prog i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.q-cup { color: var(--accent); }

.q-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-2);
}

.q-stage {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.q-num {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.q-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.q-opts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.q-opt {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}

.q-opt:hover {
  border-color: var(--accent);
  background: var(--parchment);
}

.q-opt.sel {
  border-color: var(--accent);
  background: var(--parchment);
}

.q-opt .mk {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: border-color 0.2s, color 0.2s;
}

.q-opt.sel .mk {
  border-color: var(--accent);
  color: var(--accent);
}

/* Result */
.result {
  max-width: 700px;
  margin: 0 auto;
}

.result-reveal {
  text-align: center;
  margin-bottom: 2rem;
}

.r-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}

.r-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--parchment);
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
  color: var(--accent);
}

.r-code {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-bottom: 0.3rem;
}

.r-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.r-en {
  font-size: 0.9rem;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.r-tag {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
}

.r-desc {
  font-size: 1rem;
  color: var(--ink-2);
  margin: 1.5rem 0;
  text-align: center;
  line-height: 1.7;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.card-h {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Traits */
.trait {
  margin-bottom: 0.8rem;
}

.trait .tl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.trait .lft, .trait .rgt {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink-2);
}

.trait .lft.on, .trait .rgt.on {
  color: var(--accent);
  font-weight: 700;
}

.pole-ic {
  display: inline-flex;
  align-items: center;
}

.track {
  position: relative;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.track .fill {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 4px;
  transition: left 0.6s ease, right 0.6s ease;
}

.pctlab {
  font-size: 0.75rem;
  color: var(--ink-2);
  text-align: center;
  margin-top: 0.2rem;
}

/* Passport Card */
#passportCard {
  background: linear-gradient(135deg, var(--ink) 0%, var(--espresso) 100%);
  color: var(--parchment);
  border: none;
}

#passportCard .card-h {
  color: var(--gold);
}

.pp-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.pp-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.pp-title {
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}

.pp-code {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--gold);
  padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.pp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.pp-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pp-item.pp-wide {
  grid-column: 1 / -1;
}

.pp-k {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pp-v {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Buttons */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.6rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(196, 115, 74, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(196, 115, 74, 0.4);
}

.btn-ghost {
  background: var(--parchment);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--line);
}

/* Share card old */
.share-card {
  display: none;
}

/* Footer */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-2);
  padding: 2rem 0;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

/* Art animations */
@media (prefers-reduced-motion: no-preference) {
  .art-anim .art-steam {
    animation: steam 3s ease-in-out infinite;
  }
  .art-anim .art-steam.s2 { animation-delay: 0.5s; }
  .art-anim .art-steam.s3 { animation-delay: 1s; }
  .art-anim .art-pour {
    animation: pour 2s ease-in-out infinite;
  }
  .art-anim .art-orbit {
    animation: orbit 20s linear infinite;
  }
  .art-burst .burst-bean {
    animation: burst 1.2s ease-out forwards;
    transform-origin: center;
  }
}

@keyframes steam {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(-6px); }
}

@keyframes pour {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes burst {
  0% { transform: translate(0, 0) scale(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; }
}

.burst-bean {
  transform-origin: center;
}

.art-burst.no-anim { display: none; }

/* Responsive */
@media (max-width: 640px) {
  .wrap { padding: 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-meta { gap: 1rem; }
  .cell .n { font-size: 1.4rem; }
  .types-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .q-stage { padding: 1.5rem; }
  .q-text { font-size: 1.1rem; }
  .btn-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .pp-grid { grid-template-columns: 1fr; }
}
