﻿:root {
  --bg: #080c18;
  --surface: #0f1528;
  --surface2: #1a2140;
  --gold: #d4a853;
  --gold-light: #e8c46a;
  --gold-glow: rgba(212,168,83,0.2);
  --text: #f0ece4;
  --text2: #9a94a8;
  --text3: #6a6480;
  --jade: #5bba7a;
  --rose: #d47a8a;
  --blue: #7ab8d4;
  --border: #262d4a;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.gold { color: var(--gold); }
.hidden { display: none !important; }

/* ===== NAV ===== */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 16px 20px; background: rgba(8,12,24,0.8); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(38,45,74,0.5); }
.nav-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 18px; font-weight: 700; color: var(--gold); letter-spacing: 2px; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text2); text-decoration: none; font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--gold); }
/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 40px; border: none; border-radius: 50px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #080c18; font-size: 17px; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
  box-shadow: 0 4px 24px var(--gold-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px var(--gold-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-arrow { transition: transform .3s; display: inline-block; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: 1px solid var(--border); border-radius: 50px;
  background: transparent; color: var(--text2); font-size: 13px; cursor: pointer;
  transition: all 0.3s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,168,83,0.08); }
.btn-outline.active { border-color: var(--gold); color: var(--gold); background: rgba(212,168,83,0.12); }

.btn-text {
  display: inline-block; margin-top: 12px;
  background: none; border: none; color: var(--text3); font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.btn-text:hover { color: var(--gold); }
/* ===== HERO ===== */
#hero {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 100px 20px 60px;
}
#starCanvas { position: absolute; inset: 0; z-index: 0; }
.hero-bg-glow {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,168,83,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(90,60,180,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(212,168,83,0.04) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 600px; }
.bagua-badge { margin-bottom: 16px; }
.bagua-badge svg { animation: rotateSlow 12s linear infinite; filter: drop-shadow(0 0 16px rgba(212,168,83,0.2)); }
@keyframes rotateSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.hero-badge {
  display: inline-block; padding: 8px 20px; border-radius: 50px;
  background: rgba(212,168,83,0.1); border: 1px solid rgba(212,168,83,0.2);
  color: var(--gold-light); font-size: 14px; letter-spacing: 3px; margin-bottom: 24px;
}
.hero-title { font-size: 52px; font-weight: 800; line-height: 1.1; margin-bottom: 16px; letter-spacing: 4px; }
.hero-sub { color: var(--text2); font-size: 17px; margin-bottom: 8px; }
.hero-desc { color: var(--text3); font-size: 14px; margin-bottom: 36px; letter-spacing: 6px; }
.hero-stats { display: flex; justify-content: center; gap: 32px; margin-top: 40px; }
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-item strong { font-size: 22px; color: var(--gold); font-weight: 700; }
.stat-item span { font-size: 12px; color: var(--text3); }
/* ===== SECTION HEADER ===== */
.section-header { text-align: center; max-width: 600px; margin: 0 auto 40px; padding: 0 20px; }
.section-badge {
  display: inline-block; padding: 6px 16px; border-radius: 50px;
  background: rgba(212,168,83,0.1); border: 1px solid rgba(212,168,83,0.2);
  color: var(--gold); font-size: 12px; letter-spacing: 2px; margin-bottom: 16px;
}
.section-header h2 { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.section-header p { color: var(--text2); font-size: 14px; }
/* ===== CASE CAROUSEL ===== */
#cases { padding: 80px 20px; background: var(--surface); overflow: hidden; }
.carousel-container { position: relative; max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.carousel-track-wrap { overflow: hidden; flex: 1; border-radius: var(--radius); }
.carousel-track { display: flex; gap: 16px; transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); padding: 8px 4px; }
.carousel-track .case-card {
  min-width: calc((100% - 32px) / 3); flex-shrink: 0;
  display: flex; gap: 14px; padding: 18px;
  background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border);
  transition: all 0.3s; cursor: default;
}
.carousel-track .case-card:hover { border-color: rgba(212,168,83,0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.carousel-track .case-face { width: 60px; height: 60px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.carousel-track .case-emoji { font-size: 28px; }
.carousel-track .case-info { flex: 1; min-width: 0; }
.carousel-track .case-tag {
  display: inline-block; padding: 2px 10px; border-radius: 50px;
  background: color-mix(in srgb, var(--tag-clr,#5bba7a) 15%, transparent);
  color: var(--tag-clr,#5bba7a); font-size: 11px; font-weight: 600; margin-bottom: 6px;
}
.carousel-track .case-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.carousel-track .case-quote { font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 8px; font-style: italic; }
.carousel-track .case-scores { display: flex; gap: 10px; font-size: 11px; color: var(--text3); }
.carousel-track .case-scores span { background: var(--surface2); padding: 2px 8px; border-radius: 4px; }

.carousel-arrow {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--gold); font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s; flex-shrink: 0; z-index: 2;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.carousel-arrow:hover { background: var(--surface2); border-color: var(--gold); transform: scale(1.1); }
.carousel-arrow:active { transform: scale(0.95); }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none;
  background: var(--border); cursor: pointer; transition: all 0.3s; padding: 0;
}
.carousel-dot.active { background: var(--gold); width: 24px; border-radius: 4px; }
.carousel-dot:hover { background: var(--text3); }

@media (max-width: 900px) {
  .carousel-track .case-card { min-width: calc((100% - 16px) / 2); }
}
@media (max-width: 600px) {
  .carousel-track .case-card { min-width: calc(100% - 8px); }
  .carousel-container { gap: 6px; }
  .carousel-arrow { width: 36px; height: 36px; font-size: 22px; }
}

/* ===== FEATURES ===== */
#features { padding: 80px 20px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; max-width: 960px; margin: 0 auto; }
.feature-card { padding: 28px 24px; text-align: center; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); transition: all .3s; }
.feature-card:hover { border-color: rgba(212,168,83,0.2); }
.feature-icon { font-size: 36px; margin-bottom: 14px; }
.feature-card h3 { font-size: 16px; margin-bottom: 10px; color: var(--gold); }
.feature-card p { font-size: 13px; color: var(--text2); line-height: 1.7; }

/* ===== FAQ ===== */
#faq { padding: 80px 20px; background: var(--surface); }
.faq-list { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; cursor: pointer; transition: border-color .3s; }
.faq-item:hover { border-color: rgba(212,168,83,0.2); }
.faq-q { padding: 16px 20px; font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.faq-toggle { color: var(--gold); font-size: 18px; font-weight: 300; transition: transform .3s; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-a { padding: 0 20px; max-height: 0; overflow: hidden; font-size: 13px; color: var(--text2); line-height: 1.7; transition: all .3s; }
.faq-item.open .faq-a { padding: 0 20px 16px; max-height: 200px; }

/* ===== SECTIONS (app tools) ===== */
.section { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 80px 20px 60px; }
.section-inner { width: 100%; max-width: 520px; }
.section-inner.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; }
.section-title { text-align: center; font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.section-desc { text-align: center; color: var(--text2); font-size: 14px; margin-bottom: 28px; }

/* ===== DROPZONE ===== */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.3s; background: var(--surface); }
.dropzone:hover { border-color: var(--gold); background: rgba(212,168,83,0.04); }
.dropzone.dragover { border-color: var(--gold); background: rgba(212,168,83,0.08); }
.dropzone-icon { color: var(--text3); margin-bottom: 12px; }
.dropzone-text { color: var(--text2); font-size: 15px; margin-bottom: 4px; }
.dropzone-hint { color: var(--text3); font-size: 12px; margin-bottom: 16px; }
.preview-mode-select { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }

/* ===== PREVIEW ===== */
#preview-area { text-align: center; margin-top: 24px; }
.preview-container { width: 240px; height: 280px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.preview-container canvas { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== ANALYZING ===== */
.scan-container { position: relative; width: 160px; height: 190px; margin-bottom: 28px; }
.scan-face { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.scan-line { position: absolute; left: 5%; right: 5%; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: scanMove 1.8s ease-in-out infinite; box-shadow: 0 0 12px var(--gold-glow); }
@keyframes scanMove { 0% { top: 10%; opacity: 0.3; } 50% { top: 80%; opacity: 1; } 100% { top: 10%; opacity: 0.3; } }
.analyzing-text { color: var(--text2); font-size: 16px; margin-bottom: 12px; }
.analyzing-mode { color: var(--text3); font-size: 12px; margin-top: 8px; }
.loading-dots { display: flex; gap: 6px; }
.loading-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: dotBounce 1.2s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce { 0%, 100% { transform: translateY(0); opacity: 0.3; } 50% { transform: translateY(-8px); opacity: 1; } }

/* ===== SUMMARY ===== */
.score-overview { display: flex; justify-content: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.score-item { text-align: center; padding: 14px 18px; min-width: 90px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.score-item .label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.score-item .value { font-size: 20px; font-weight: 700; }
.summary-blur { position: relative; }
.summary-items { padding-bottom: 80px; }
.summary-item { padding: 16px; margin-bottom: 10px; background: var(--surface); border-radius: var(--radius); border-left: 3px solid var(--gold); }
.summary-item .title { font-size: 14px; font-weight: 600; color: var(--gold); margin-bottom: 4px; }
.summary-item .text { font-size: 13px; color: var(--text2); }
.blur-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 20px 20px; background: linear-gradient(transparent, var(--bg) 40%); text-align: center; }
.blur-overlay p { color: var(--text2); font-size: 14px; margin-bottom: 4px; }
.blur-hint { font-size: 12px !important; color: var(--text3) !important; }
.summary-blur .summary-items { filter: blur(5px); pointer-events: none; user-select: none; }

/* ===== REPORT ===== */
.report-section-item { margin-bottom: 24px; padding: 20px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.report-section-item .report-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.report-section-item .report-header .icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.report-section-item .report-header h3 { font-size: 17px; font-weight: 600; }
.report-section-item .feature-line { font-size: 13px; color: var(--text3); margin-bottom: 8px; padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: 8px; }
.report-section-item .interpretation { font-size: 14px; color: var(--text2); line-height: 1.8; }
.report-section-item .advice { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: rgba(212,168,83,0.08); border: 1px solid rgba(212,168,83,0.15); font-size: 13px; color: var(--gold-light); line-height: 1.7; }
.report-footer { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { position: relative; width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; border: 1px solid var(--border); padding: 40px 28px 28px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text3); font-size: 28px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-icon { color: var(--gold); margin-bottom: 16px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-desc { font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.modal-tabs { display: flex; gap: 0; margin-bottom: 16px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.modal-tabs .tab { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text3); font-size: 14px; cursor: pointer; transition: all 0.2s; }
.modal-tabs .tab.active { background: var(--gold); color: #080c18; font-weight: 600; }
.modal-tabs .tab:not(.active):hover { color: var(--text); }
.modal-input { width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 15px; outline: none; transition: border 0.2s; }
.modal-input:focus { border-color: var(--gold); }
.modal-submit { width: 100%; margin-top: 16px; }
.modal-note { font-size: 11px; color: var(--text3); margin-top: 12px; }
.modal-error { font-size: 13px; color: var(--rose); margin-top: 8px; }

/* ===== RESPONSIVE OVERRIDES ===== */
@media (max-width: 480px) {
  .hero-title { font-size: 34px; }
  .section { padding: 60px 16px 40px; }
  .preview-container { width: 200px; height: 240px; }
  .score-item { min-width: 75px; padding: 10px 12px; }
  .score-item .value { font-size: 17px; }
  .modal { padding: 32px 20px 24px; }
  .hero-stats { gap: 20px; }
  .nav-links { display: none; }
  .features-grid { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
  .hero-title { font-size: 62px; }
  .section-inner { max-width: 600px; }
}

/* ===== TOOLS GRID ===== */
#tools-section { padding: 80px 20px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; max-width: 960px; margin: 0 auto; }
.tool-card {
  padding: 28px 20px; text-align: center; cursor: pointer;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  transition: all 0.3s; position: relative;
}
.tool-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
.tool-icon-wrap { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.tool-emoji { font-size: 28px; }
.tool-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.tool-card p { font-size: 12px; color: var(--text2); line-height: 1.6; }
.tool-tag { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 50px; background: var(--gold); color: #080c18; font-size: 10px; font-weight: 700; }

/* ===== BACK BUTTON ===== */
.input-back { margin-bottom: 16px; }

/* ===== INPUT LABELS ===== */
.input-label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; text-align: left; }

/* ===== GENDER SELECT ===== */
.gender-select { display: flex; gap: 8px; }
.gender-btn { flex: 1; }
.gender-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(212,168,83,0.12); }

/* ===== TAROT ===== */
.tarot-shuffle-hint { text-align: center; color: var(--text2); font-size: 14px; margin-bottom: 20px; padding: 12px; background: rgba(212,168,83,0.06); border-radius: 10px; border: 1px solid rgba(212,168,83,0.1); }
.tarot-cards { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tarot-card {
  width: 90px; height: 140px; border-radius: 10px; cursor: pointer;
  background: var(--surface2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; transition: all 0.3s; user-select: none;
  position: relative;
}
.tarot-card:hover { border-color: var(--text3); transform: translateY(-4px); }
.tarot-card.selected { border-color: var(--gold); background: rgba(212,168,83,0.08); box-shadow: 0 0 20px var(--gold-glow); transform: translateY(-8px); }
.tarot-card .card-label { position: absolute; bottom: 8px; font-size: 9px; color: var(--text3); }
.tarot-card.revealed { background: var(--surface); }
.tarot-card .card-content { display: none; }
.tarot-card.revealed .card-content { display: block; }

/* ===== MODAL FIELDS ===== */
.modal-field { text-align: left; }

/* ===== RESPONSIVE OVERRIDES ===== */
@media (max-width: 600px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 20px 14px; }
  .tarot-card { width: 75px; height: 120px; font-size: 22px; }
}
