/* ========== CSS Variables & Reset ========== */
:root {
  --primary: #8B4513;
  --primary-light: #A0522D;
  --primary-dark: #6B3410;
  --accent: #DAA520;
  --accent-light: #F0D060;
  --bg: #FFF8F0;
  --bg-card: #FFFFFF;
  --bg-dark: #2C1810;
  --text: #3C2415;
  --text-light: #7A6555;
  --text-muted: #A89585;
  --border: #E8D5C4;
  --shadow: 0 4px 20px rgba(139, 69, 19, 0.1);
  --shadow-hover: 0 8px 30px rgba(139, 69, 19, 0.18);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* ========== Header & Navigation ========== */
.site-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
  color: #FFF;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFF;
  letter-spacing: 2px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  color: rgba(255,255,255,0.8);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: #FFF;
  background: rgba(255,255,255,0.12);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #FFF;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.menu-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* ========== Hero Section ========== */
.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #FFF;
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(218,165,32,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(218,165,32,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: 4px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero h1 span {
  color: var(--accent-light);
}

.hero-desc {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  line-height: 1.9;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-tag {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.15);
}

/* ========== Container ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Section ========== */
.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  margin: 12px auto 0;
  border-radius: 2px;
}

.section-title p {
  color: var(--text-light);
  font-size: 1rem;
  margin-top: 8px;
}

/* ========== Divination Tool ========== */
.divination-section {
  background: linear-gradient(180deg, rgba(139,69,19,0.03) 0%, transparent 100%);
}

.divination-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 680px;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.input-group label .hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 6px;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  font-family: inherit;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}

.input-field::placeholder {
  color: var(--text-muted);
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B4513' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  box-shadow: 0 4px 15px rgba(139,69,19,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,69,19,0.4);
}

.btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(139,69,19,0.05);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--bg-dark);
  box-shadow: 0 4px 15px rgba(218,165,32,0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(218,165,32,0.4);
}

.btn-block {
  width: 100%;
  padding: 14px 28px;
  font-size: 1.05rem;
}

.divination-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.divination-actions .btn {
  flex: 1;
}

/* ========== Result ========== */
.result-area {
  margin-top: 32px;
  display: none;
}

.result-area.show {
  display: block;
  animation: fadeInUp 0.5s ease;
}

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

.result-header {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-dark), var(--primary-dark));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: #FFF;
}

.result-gua-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.result-gua-type {
  font-size: 0.95rem;
  color: var(--accent-light);
  letter-spacing: 2px;
}

.result-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 28px;
}

.result-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.result-step {
  text-align: center;
  padding: 16px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result-step-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-step-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

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

.result-detail h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-detail p {
  color: var(--text-light);
  line-height: 1.9;
  padding-left: 24px;
}

.result-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.result-fortune {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(218,165,32,0.08), rgba(139,69,19,0.05));
  border-radius: var(--radius);
  border: 1px solid rgba(218,165,32,0.2);
}

.fortune-level {
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.fortune-ji {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  color: #2E7D32;
}

.fortune-xiong {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  color: #C62828;
}

.fortune-zhong {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  color: #F57F17;
}

.fortune-text {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========== Six Stars Grid ========== */
.six-stars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.star-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: default;
}

.star-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.star-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.star-card:nth-child(1) .star-icon { background: linear-gradient(135deg, #E8F5E9, #A5D6A7); }
.star-card:nth-child(2) .star-icon { background: linear-gradient(135deg, #FFF8E1, #FFE082); }
.star-card:nth-child(3) .star-icon { background: linear-gradient(135deg, #FFEBEE, #EF9A9A); }
.star-card:nth-child(4) .star-icon { background: linear-gradient(135deg, #FCE4EC, #F48FB1); }
.star-card:nth-child(5) .star-icon { background: linear-gradient(135deg, #E8EAF6, #9FA8DA); }
.star-card:nth-child(6) .star-icon { background: linear-gradient(135deg, #EFEBE9, #BCAAA4); }

.star-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.star-nature {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.star-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ========== FAQ Section ========== */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  box-shadow: var(--shadow);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-arrow {
  transition: transform 0.3s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 24px 18px;
  color: var(--text-light);
  line-height: 1.9;
}

/* ========== Content Sections ========== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.content-card:hover {
  box-shadow: var(--shadow-hover);
}

.content-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-card p {
  color: var(--text-light);
  line-height: 1.9;
  font-size: 0.95rem;
}

/* ========== Page Content (About, Guide, Privacy) ========== */
.page-hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
  color: #FFF;
  text-align: center;
  padding: 60px 24px 40px;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.page-hero p {
  color: rgba(255,255,255,0.8);
  font-size: 1.05rem;
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin: 24px 0 10px;
}

.page-content p {
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.9;
}

.page-content ul, .page-content ol {
  color: var(--text-light);
  margin-bottom: 16px;
  padding-left: 24px;
  line-height: 2;
}

.page-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  background: rgba(218,165,32,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0;
  color: var(--text-light);
  font-style: italic;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.page-content table th,
.page-content table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.page-content table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

.page-content table td {
  color: var(--text-light);
}

/* ========== Footer ========== */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand h3 {
  color: #FFF;
  font-size: 1.2rem;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.55);
}

.footer-links h4 {
  color: #FFF;
  font-size: 0.95rem;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.6);
  padding: 4px 0;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-light);
  padding-left: 4px;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  padding: 12px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb span {
  margin: 0 6px;
}

/* ========== Ad Placeholder ========== */
.ad-slot {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 24px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .header-inner {
    height: 56px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 16px;
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 50px 20px 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .section {
    padding: 40px 0;
  }

  .section-title h2 {
    font-size: 1.4rem;
  }

  .divination-card {
    padding: 24px 18px;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .divination-actions {
    flex-direction: column;
  }

  .result-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .result-step {
    padding: 12px 8px;
  }

  .six-stars {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .star-card {
    padding: 20px 14px;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .page-hero h1 {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .six-stars {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .star-card {
    padding: 16px 10px;
  }

  .star-name {
    font-size: 1.05rem;
  }

  .result-gua-name {
    font-size: 1.6rem;
  }

  .quick-actions {
    flex-direction: column;
  }

  .quick-actions .btn {
    width: 100%;
  }
}

/* ========== Animations ========== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* ========== Scroll to top ========== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #FFF;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139,69,19,0.3);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}
