/* 流年小賣部 — 智慧擇日 */
:root {
  --ink: #1a1512;
  --parchment: #f5efe6;
  --warm-cream: #ede4d3;
  --gold: #c4975a;
  --gold-light: #dbb88a;
  --gold-dim: #8a6a3a;
  --ember: #b85c3b;
  --deep-navy: #0d1117;
  --mist: rgba(245, 239, 230, 0.08);
  --smoke: rgba(26, 21, 18, 0.6);
  --green: #5a9e6f;
  --red: #c45a5a;
  --card-bg: rgba(245, 239, 230, 0.03);
  --card-border: rgba(196, 151, 90, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--deep-navy);
  color: var(--parchment);
  line-height: 1.8;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--deep-navy); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ─── Navigation ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.5s ease;
  background: transparent;
}
nav.scrolled {
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(196, 151, 90, 0.15);
}
.nav-logo {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.15em;
}
.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}
.nav-links a {
  color: var(--parchment);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  opacity: 0.7;
  transition: all 0.3s;
}
.nav-links a:hover { opacity: 1; color: var(--gold); }
.nav-cta {
  padding: 0.5rem 1.5rem !important;
  border: 1px solid var(--gold) !important;
  color: var(--gold) !important;
  opacity: 1 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.15em !important;
  transition: all 0.3s !important;
}
.nav-cta:hover { background: var(--gold) !important; color: var(--deep-navy) !important; }
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--gold);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(196, 151, 90, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 20% 80%, rgba(184, 92, 59, 0.05) 0%, transparent 50%),
    var(--deep-navy);
  pointer-events: none;
}
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: float-up 8s infinite ease-in;
}
@keyframes float-up {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}
.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 800px;
  margin-bottom: 6rem;
}
.hero-symbol {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInDown 1.2s 0.3s forwards;
  display: block;
  letter-spacing: 1em;
}
.hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--parchment);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 1s 0.6s forwards;
  line-height: 1.3;
}
.hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-style: italic;
  color: var(--gold-light);
  max-width: 600px;
  margin: 0 auto 1rem;
  opacity: 0;
  animation: fadeInUp 1s 0.9s forwards;
  line-height: 2;
}
.hero-quote {
  font-family: 'Noto Serif TC', serif;
  font-size: 0.95rem;
  color: rgba(245, 239, 230, 0.5);
  max-width: 500px;
  margin: 0 auto 3rem;
  opacity: 0;
  animation: fadeInUp 1s 1.1s forwards;
  line-height: 2;
  letter-spacing: 0.05em;
}
.scroll-hint {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 2rem;
  margin-top: auto;
  opacity: 0;
  animation: fadeIn 1s 2s forwards;
}
.scroll-hint span {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: rgba(245, 239, 230, 0.3);
  writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
  animation: scroll-down 2s infinite;
}
@keyframes scroll-down {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ─── Divider ─── */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 0;
  opacity: 0.4;
}
.divider-line { width: 80px; height: 1px; background: linear-gradient(to right, transparent, var(--gold-dim), transparent); }
.divider-symbol { color: var(--gold-dim); font-size: 1.2rem; }

/* ─── Section Header ─── */
.section-header { text-align: center; margin-bottom: 4rem; }
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}
.section-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--parchment);
  margin-bottom: 1.5rem;
}
.section-quote {
  font-family: 'Noto Serif TC', serif;
  font-size: 1rem;
  color: var(--gold);
  font-style: italic;
  letter-spacing: 0.08em;
}
.section-quote cite {
  display: block;
  font-size: 0.8rem;
  color: var(--gold-dim);
  margin-top: 0.3rem;
  font-style: normal;
}

/* ─── Picker Section ─── */
.picker-section {
  padding: 0 2rem 6rem;
  max-width: 900px;
  margin: 0 auto;
}
.picker-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
}
.picker-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.picker-field { margin-bottom: 2rem; }
.picker-field:last-of-type { margin-bottom: 2rem; }
.picker-field-label {
  display: block;
  font-family: 'Noto Serif TC', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.picker-hot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.picker-hot-label {
  font-size: 0.65rem;
  color: var(--ember);
  letter-spacing: 0.1em;
  font-weight: 600;
  padding-right: 0.3rem;
}
.hot-tag {
  background: rgba(184, 92, 59, 0.08);
  border: 1px solid rgba(184, 92, 59, 0.25);
  color: var(--ember);
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.4s ease;
  letter-spacing: 0.08em;
  font-family: 'Noto Sans TC', sans-serif;
}
.hot-tag:hover { background: rgba(184, 92, 59, 0.15); border-color: var(--ember); }
.hot-tag.active { background: rgba(184, 92, 59, 0.2); border-color: var(--ember); font-weight: 600; }
.picker-events { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.event-btn {
  background: var(--card-bg);
  border: 1px solid rgba(196, 151, 90, 0.12);
  color: rgba(245, 239, 230, 0.55);
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.4s ease;
  letter-spacing: 0.08em;
  font-family: 'Noto Sans TC', sans-serif;
}
.event-btn:hover {
  border-color: rgba(196, 151, 90, 0.3);
  color: var(--parchment);
  background: rgba(196, 151, 90, 0.06);
  transform: translateY(-1px);
}
.event-btn.active {
  background: rgba(196, 151, 90, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.picker-range-btns { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.range-btn {
  background: var(--card-bg);
  border: 1px solid rgba(196, 151, 90, 0.12);
  color: rgba(245, 239, 230, 0.5);
  padding: 0.4rem 1.2rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.4s ease;
  letter-spacing: 0.1em;
  font-family: 'Noto Sans TC', sans-serif;
}
.range-btn:hover { border-color: rgba(196, 151, 90, 0.3); color: var(--parchment); }
.range-btn.active {
  background: rgba(196, 151, 90, 0.1);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}
.picker-options { display: flex; align-items: center; }
.picker-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: rgba(245, 239, 230, 0.55);
  cursor: pointer;
  letter-spacing: 0.03em;
}
.picker-checkbox input { display: none; }
.checkbox-custom {
  width: 18px; height: 18px;
  border: 1px solid rgba(196, 151, 90, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}
.picker-checkbox input:checked ~ .checkbox-custom { background: var(--gold); border-color: var(--gold); }
.picker-checkbox input:checked ~ .checkbox-custom::after {
  content: '';
  width: 5px; height: 9px;
  border: solid var(--deep-navy);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}
.picker-submit {
  display: inline-block;
  width: 100%;
  padding: 0.9rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0, 0, 1);
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.picker-submit:hover { background: var(--gold); color: var(--deep-navy); }

/* ─── Results ─── */
.picker-results { margin-top: 2.5rem; }
.result-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: rgba(245, 239, 230, 0.35);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border: 1px dashed rgba(196, 151, 90, 0.15);
}
.result-count {
  font-size: 0.85rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
  text-align: center;
}
.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.5rem 2rem;
  margin-bottom: 0.8rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.5s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.5s;
}
.result-card:hover {
  background: rgba(245, 239, 230, 0.05);
  border-color: rgba(196, 151, 90, 0.25);
  transform: translateY(-2px);
}
.result-card:hover::before { opacity: 1; }
.result-date-box { text-align: center; min-width: 55px; }
.result-day { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.result-weekday { font-size: 0.7rem; color: var(--gold-dim); letter-spacing: 0.1em; margin-top: 0.3rem; }
.result-info { min-width: 0; }
.result-solar { font-size: 0.8rem; color: rgba(245, 239, 230, 0.45); letter-spacing: 0.03em; }
.result-lunar { font-family: 'Noto Serif TC', serif; font-size: 0.9rem; color: var(--parchment); letter-spacing: 0.08em; margin-top: 0.15rem; }
.result-ganzhi { font-size: 0.75rem; color: var(--gold-dim); letter-spacing: 0.05em; margin-top: 0.2rem; }
.result-yi { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; align-items: center; }
.result-yi-tag { font-size: 0.7rem; padding: 0.2rem 0.55rem; background: rgba(90,158,111,0.08); border: 1px solid rgba(90,158,111,0.18); color: rgba(90,158,111,0.8); }
.result-yi-match { background: rgba(90,158,111,0.15); border-color: rgba(90,158,111,0.35); color: var(--green); font-weight: 600; }
.result-holiday-badge { font-size: 0.6rem; padding: 0.15rem 0.4rem; background: rgba(184,92,59,0.1); border: 1px solid rgba(184,92,59,0.2); color: var(--ember); letter-spacing: 0.05em; }

/* ─── Detail Panel ─── */
.detail-panel { max-width: 900px; margin: 0 auto; padding: 0 2rem; }
.detail-card {
  background: var(--card-bg);
  border: 1px solid rgba(196,151,90,0.15);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  display: none;
}
.detail-card.active { display: block; }
.detail-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.detail-header { display: flex; align-items: flex-start; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.detail-date-box { text-align: center; min-width: 90px; }
.detail-day { font-family: 'Cormorant Garamond', serif; font-size: 4rem; font-weight: 700; line-height: 1; color: var(--gold); }
.detail-weekday { font-size: 0.8rem; letter-spacing: 0.15em; color: var(--gold-dim); margin-top: 0.3rem; }
.detail-info { flex: 1; min-width: 200px; }
.detail-solar { font-size: 0.85rem; color: rgba(245,239,230,0.5); letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.detail-lunar { font-family: 'Noto Serif TC', serif; font-size: 1.1rem; font-weight: 700; color: var(--parchment); letter-spacing: 0.1em; margin-bottom: 0.2rem; }
.detail-ganzhi { font-family: 'Noto Serif TC', serif; font-size: 0.95rem; color: var(--gold); letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; font-size: 0.78rem; color: rgba(245,239,230,0.4); }
.detail-meta-item { display: flex; gap: 0.3rem; align-items: center; }
.detail-meta-label { color: var(--gold-dim); }
.detail-close {
  position: absolute;
  top: 1rem; right: 1.2rem;
  background: none;
  border: 1px solid rgba(196,151,90,0.2);
  color: var(--gold-dim);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.1rem;
}
.detail-close:hover { border-color: var(--gold); color: var(--gold); background: rgba(196,151,90,0.08); }
.yi-ji-section { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.yi-box, .ji-box { padding: 1.2rem; border: 1px solid rgba(196,151,90,0.08); }
.yi-box { background: rgba(90,158,111,0.04); border-color: rgba(90,158,111,0.15); }
.ji-box { background: rgba(196,90,90,0.04); border-color: rgba(196,90,90,0.15); }
.yi-label, .ji-label { font-family: 'Noto Serif TC', serif; font-size: 1rem; font-weight: 700; letter-spacing: 0.2em; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.yi-label { color: var(--green); } .ji-label { color: var(--red); }
.yi-label::before, .ji-label::before { content: ''; width: 3px; height: 1em; display: block; }
.yi-label::before { background: var(--green); } .ji-label::before { background: var(--red); }
.yi-tags, .ji-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.yi-tag, .ji-tag { font-size: 0.75rem; padding: 0.25rem 0.6rem; letter-spacing: 0.05em; }
.yi-tag { background: rgba(90,158,111,0.1); border: 1px solid rgba(90,158,111,0.2); color: rgba(90,158,111,0.85); }
.ji-tag { background: rgba(196,90,90,0.1); border: 1px solid rgba(196,90,90,0.2); color: rgba(196,90,90,0.85); }
.detail-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding-top: 1.5rem; border-top: 1px solid rgba(196,151,90,0.08); }
.extra-item { font-size: 0.78rem; }
.extra-label { color: var(--gold-dim); letter-spacing: 0.08em; margin-bottom: 0.2rem; font-size: 0.7rem; }
.extra-value { color: rgba(245,239,230,0.6); letter-spacing: 0.03em; }

/* ─── Footer ─── */
.footer-quote {
  text-align: center;
  padding: 6rem 2rem 3rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: rgba(245, 239, 230, 0.35);
  letter-spacing: 0.05em;
  max-width: 600px;
  margin: 0 auto;
}
footer {
  text-align: center;
  padding: 3rem 2rem 4rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(245, 239, 230, 0.2);
}
footer a { color: var(--gold-dim); text-decoration: none; transition: color 0.3s; }
footer a:hover { color: var(--gold); }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 0, 0, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 17, 23, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 99;
    overflow-y: auto;
    padding: 5rem 2rem 3rem;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.1rem; letter-spacing: 0.2em; }
  .nav-links .nav-cta { font-size: 0.85rem !important; padding: 0.6rem 1.8rem !important; white-space: nowrap; max-width: 90vw; text-align: center; }
  .mobile-toggle { display: block; z-index: 101; }

  .hero { padding: 5rem 1.5rem 0; }
  .hero-content { margin-bottom: 3rem; padding: 1.5rem; }
  .hero-symbol { letter-spacing: 0.5em; font-size: 2rem; }
  .hero-title { font-size: clamp(2rem, 8vw, 3rem); letter-spacing: 0.15em; }
  .hero-subtitle { font-size: 0.95rem; line-height: 1.9; }
  .hero-quote { font-size: 0.85rem; margin-bottom: 2rem; }

  .divider { padding: 3rem 0; }
  .section-header { margin-bottom: 2.5rem; }

  .picker-section { padding: 0 1.5rem 4rem; }
  .picker-form { padding: 1.5rem; }
  .picker-range-btns { gap: 0.4rem; }
  .range-btn { padding: 0.35rem 0.8rem; font-size: 0.72rem; }
  .event-btn { padding: 0.3rem 0.65rem; font-size: 0.72rem; }

  .result-card { grid-template-columns: auto 1fr; gap: 1rem; padding: 1.2rem; }
  .result-yi { justify-content: flex-start; margin-top: 0.5rem; grid-column: 1 / -1; }

  .detail-card { padding: 1.5rem; }
  .detail-header { gap: 1rem; }
  .detail-day { font-size: 3rem; }
  .yi-ji-section { grid-template-columns: 1fr; }
  .detail-extra { grid-template-columns: 1fr 1fr; }

  .footer-quote { padding: 4rem 2rem 2rem; font-size: 1rem; }
}

@media (max-width: 400px) {
  .hero-content { padding: 1rem; }
  .hero-symbol { font-size: 1.6rem; letter-spacing: 0.3em; margin-bottom: 1.5rem; }
  .hero-title { margin-bottom: 1rem; }
  .picker-form { padding: 1.2rem; }
  .event-btn { padding: 0.25rem 0.55rem; font-size: 0.68rem; }
  .hot-tag { padding: 0.25rem 0.6rem; font-size: 0.68rem; }
  .range-btn { padding: 0.3rem 0.6rem; font-size: 0.68rem; }
}
