/* ==========================================
   命缘AI (mingyuanai.com) - 神秘宇宙主题
   ========================================== */

/* --- CSS Variables --- */
:root {
    --primary: #2d1b69;
    --primary-dark: #1a0f3e;
    --primary-light: #4a2d8f;
    --gold: #d4a843;
    --gold-light: #f0d68a;
    --gold-dark: #b8922e;
    --mystic-blue: #1e3a5f;
    --mystic-cyan: #00d4ff;
    --bg-dark: #0a0a1a;
    --bg-card: #1a1a2e;
    --bg-section: #12122a;
    --text-primary: #e8e6f0;
    --text-secondary: #a8a4c0;
    --text-gold: #d4a843;
    --border-gold: rgba(212, 168, 67, 0.3);
    --shadow-gold: rgba(212, 168, 67, 0.15);
    --grad-hero: linear-gradient(135deg, #0a0a1a 0%, #1a0f3e 40%, #2d1b69 100%);
    --grad-card: linear-gradient(145deg, #1a1a2e, #2d1b69);
    --grad-gold: linear-gradient(135deg, #d4a843, #f0d68a, #d4a843);
    --grad-button: linear-gradient(135deg, #d4a843 0%, #b8922e 100%);
    --font-display: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
    --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --max-width: 1200px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--gold-light);
}

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

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

/* --- Starfield Background --- */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.starfield::before,
.starfield::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    animation: twinkle 4s ease-in-out infinite alternate;
}

.starfield::before {
    box-shadow:
        50px 80px #fff, 200px 150px #fff, 400px 50px rgba(255,255,255,0.7),
        600px 200px #fff, 100px 300px rgba(255,255,255,0.5), 350px 400px #fff,
        750px 100px rgba(255,255,255,0.8), 900px 350px #fff, 150px 500px rgba(255,255,255,0.6),
        500px 550px #fff, 800px 450px rgba(255,255,255,0.7), 300px 250px #fff,
        650px 600px rgba(255,255,255,0.5), 950px 500px #fff, 50px 650px rgba(255,255,255,0.8),
        1100px 150px #fff, 1000px 600px rgba(255,255,255,0.6), 250px 700px #fff,
        450px 120px rgba(255,255,255,0.9), 700px 350px #fff, 850px 550px rgba(255,255,255,0.7),
        1050px 400px #fff, 550px 680px rgba(255,255,255,0.5), 1150px 250px #fff;
}

.starfield::after {
    box-shadow:
        120px 40px rgba(255,255,255,0.6), 280px 220px #fff, 480px 130px rgba(255,255,255,0.8),
        680px 280px #fff, 180px 380px rgba(255,255,255,0.4), 430px 480px #fff,
        830px 180px rgba(255,255,255,0.7), 980px 420px #fff, 230px 580px rgba(255,255,255,0.5),
        580px 630px #fff, 880px 530px rgba(255,255,255,0.6), 380px 320px #fff,
        730px 680px rgba(255,255,255,0.4), 1030px 580px #fff, 130px 730px rgba(255,255,255,0.7);
    animation-delay: 2s;
    animation-duration: 5s;
}

@keyframes twinkle {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-gold);
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    background: rgba(10, 10, 26, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gold);
    text-decoration: none;
}

.logo a:hover {
    opacity: 0.85;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    -webkit-text-fill-color: var(--text-secondary);
    letter-spacing: 2px;
}

/* --- Navigation --- */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu a {
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--gold);
    background: rgba(212, 168, 67, 0.1);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-gold);
    color: var(--gold);
    font-size: 24px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: rgba(212, 168, 67, 0.1);
}

/* --- Mobile Nav --- */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-gold);
    z-index: 999;
    padding: 10px 0;
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition);
}

.mobile-nav.open {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav a {
    display: block;
    padding: 14px 30px;
    color: var(--text-primary);
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--gold);
    background: rgba(212, 168, 67, 0.08);
    padding-left: 40px;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: var(--grad-hero);
    padding: 120px 20px 80px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.08) 0%, transparent 70%);
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 20px;
    border: 1px solid var(--border-gold);
    border-radius: 30px;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 24px;
    background: rgba(212, 168, 67, 0.05);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Page Hero (Smaller) --- */
.page-hero {
    padding: 140px 20px 60px;
    text-align: center;
    background: var(--grad-hero);
    position: relative;
}

.page-hero h1 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.page-hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-body);
    text-decoration: none;
}

.btn-primary {
    background: var(--grad-button);
    color: #1a0f3e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-gold);
    color: #1a0f3e;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background: rgba(212, 168, 67, 0.1);
    transform: translateY(-2px);
    color: var(--gold-light);
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
    border-radius: 14px;
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* --- Sections --- */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-alt {
    background: var(--bg-section);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    padding: 4px 16px;
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    font-size: 13px;
    color: var(--gold);
    margin-bottom: 16px;
    background: rgba(212, 168, 67, 0.05);
}

/* --- Grid --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

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

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* --- Fortune Cards (Homepage Feature Cards) --- */
.fortune-card {
    background: var(--grad-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.fortune-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-gold);
    opacity: 0;
    transition: var(--transition);
}

.fortune-card:hover {
    transform: translateY(-8px);
    border-color: var(--gold);
    box-shadow: 0 20px 60px var(--shadow-gold), 0 0 40px rgba(212, 168, 67, 0.08);
}

.fortune-card:hover::before {
    opacity: 1;
}

.fortune-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: var(--transition);
}

.fortune-card:hover .fortune-card-icon {
    background: rgba(212, 168, 67, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--shadow-gold);
}

.fortune-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.fortune-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.fortune-card .btn {
    margin-top: auto;
}

/* --- Result Card --- */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
}

.result-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 168, 67, 0.15);
}

/* --- How It Works --- */
.steps {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.step {
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--grad-button);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.step-arrow {
    position: absolute;
    right: -30px;
    top: 30px;
    color: var(--gold);
    font-size: 24px;
    opacity: 0.5;
}

/* --- Form Styles --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label span {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-body);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: rgba(168, 164, 192, 0.5);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a8a4c0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

/* --- Tool Input Area --- */
.tool-input {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
}

.tool-input h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 8px;
}

.tool-input .desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* --- Tool Result Area --- */
.tool-result {
    display: none;
    animation: fadeInUp 0.6s ease;
}

.tool-result.show {
    display: block;
}

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

/* --- BaZi Pillars Display --- */
.pillars-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.pillar {
    text-align: center;
    min-width: 100px;
}

.pillar-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.pillar-box {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 16px 12px;
    position: relative;
    overflow: hidden;
}

.pillar-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grad-gold);
}

.pillar-gan {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--gold);
    font-weight: 700;
    line-height: 1.3;
}

.pillar-zhi {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

.pillar-wuxing {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.pillar-nayin {
    font-size: 11px;
    color: rgba(168, 164, 192, 0.6);
    margin-top: 4px;
}

/* --- Five Elements Chart --- */
.wuxing-chart {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 24px;
    margin: 30px 0;
    height: 180px;
}

.wuxing-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wuxing-bar .bar {
    width: 50px;
    border-radius: 6px 6px 0 0;
    transition: height 1s ease;
    min-height: 8px;
    position: relative;
}

.wuxing-bar .bar-count {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.wuxing-bar .label {
    font-size: 15px;
    font-weight: 600;
}

.wuxing-jin .bar { background: linear-gradient(180deg, #e8e8e8, #c0c0c0); }
.wuxing-jin .label { color: #c0c0c0; }
.wuxing-mu .bar { background: linear-gradient(180deg, #4ade80, #22c55e); }
.wuxing-mu .label { color: #4ade80; }
.wuxing-shui .bar { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.wuxing-shui .label { color: #60a5fa; }
.wuxing-huo .bar { background: linear-gradient(180deg, #f87171, #ef4444); }
.wuxing-huo .label { color: #f87171; }
.wuxing-tu .bar { background: linear-gradient(180deg, #fbbf24, #d4a843); }
.wuxing-tu .label { color: #fbbf24; }

/* --- Zodiac Signs Grid --- */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.zodiac-item {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.zodiac-item:hover,
.zodiac-item.active {
    border-color: var(--gold);
    background: rgba(212, 168, 67, 0.08);
    transform: translateY(-4px);
}

.zodiac-item .icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.zodiac-item .name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.zodiac-item .date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Star Rating --- */
.star-rating {
    display: inline-flex;
    gap: 4px;
}

.star-rating .star {
    color: rgba(212, 168, 67, 0.2);
    font-size: 18px;
}

.star-rating .star.filled {
    color: var(--gold);
}

/* --- Name Score Circle --- */
.score-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    position: relative;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle .bg-ring {
    fill: none;
    stroke: rgba(212, 168, 67, 0.15);
    stroke-width: 10;
}

.score-circle .progress-ring {
    fill: none;
    stroke: var(--gold);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value .number {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.score-value .label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Five Grid Display --- */
.wuge-display {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.wuge-item {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    transition: var(--transition);
}

.wuge-item.jixiong-daji {
    border-color: rgba(74, 222, 128, 0.3);
}

.wuge-item.jixiong-ji {
    border-color: rgba(96, 165, 250, 0.3);
}

.wuge-item.jixiong-banji {
    border-color: rgba(251, 191, 36, 0.3);
}

.wuge-item.jixiong-xiong {
    border-color: rgba(248, 113, 113, 0.3);
}

.wuge-item .wuge-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.wuge-item .wuge-number {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 6px;
}

.wuge-item .wuge-fortune {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
}

.wuge-fortune.daji { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.wuge-fortune.ji { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.wuge-fortune.banji { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.wuge-fortune.xiong { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.wuge-fortune.daxiong { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* --- Tarot Cards --- */
.tarot-spread {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 40px 0;
    perspective: 1000px;
}

.tarot-card {
    width: 130px;
    height: 220px;
    cursor: pointer;
    perspective: 1000px;
}

.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.tarot-card.flipped .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card.reversed.flipped .tarot-card-inner {
    transform: rotateY(180deg) rotate(180deg);
}

.tarot-card-front,
.tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tarot-card-back {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: 2px solid var(--gold);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(212, 168, 67, 0.08) 8px,
        rgba(212, 168, 67, 0.08) 16px
    );
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tarot-card-back::after {
    content: '✦';
    font-size: 48px;
    color: var(--gold);
    opacity: 0.5;
}

.tarot-card-front {
    transform: rotateY(180deg);
    background: var(--bg-card);
    border: 2px solid var(--gold);
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tarot-card-front .card-number {
    font-size: 14px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 4px;
}

.tarot-card-front .card-symbol {
    font-size: 48px;
    margin: 8px 0;
}

.tarot-card-front .card-name {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--gold);
    font-weight: 600;
    text-align: center;
}

.tarot-card-front .card-reversed-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border-radius: 8px;
    margin-top: 6px;
}

.tarot-card-position {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
}

.tarot-card:hover .tarot-card-inner {
    transform: translateY(-8px);
}

.tarot-card.flipped:hover .tarot-card-inner {
    transform: rotateY(180deg) translateY(-8px);
}

/* --- Spread Type Selector --- */
.spread-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.spread-option {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.spread-option:hover,
.spread-option.active {
    border-color: var(--gold);
    background: rgba(212, 168, 67, 0.08);
}

.spread-option .spread-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.spread-option .spread-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 4px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-family: var(--font-body);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--gold);
    background: rgba(212, 168, 67, 0.12);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

/* --- FAQ Accordion --- */
.faq-item {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--border-gold);
}

.faq-question {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    transition: var(--transition);
}

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

.faq-question .faq-toggle {
    font-size: 20px;
    color: var(--gold);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item.open .faq-toggle {
    transform: rotate(45deg);
}

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

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 24px 20px;
}

.faq-answer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* --- Testimonials --- */
.testimonial-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 30px;
}

.testimonial-card .stars {
    color: var(--gold);
    font-size: 16px;
    margin-bottom: 16px;
}

.testimonial-card .quote {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-card .author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.testimonial-card .author-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Compatibility --- */
.compatibility-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.compatibility-vs {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: 700;
}

.compatibility-score {
    text-align: center;
    margin: 30px 0;
}

.compatibility-score .score-number {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.compatibility-score .score-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* --- Reading Content --- */
.reading-section {
    margin-bottom: 24px;
}

.reading-section h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reading-section p {
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: 0.95rem;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-info-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-info-item .icon-box {
    width: 48px;
    height: 48px;
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-info-item .icon-box i {
    font-size: 20px;
    color: var(--gold);
}

.contact-info-item h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.contact-info-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
    background: #060610;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 60px 0 30px;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .footer-logo {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.footer-column h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: var(--gold);
    padding-left: 4px;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-contact-item i {
    color: var(--gold);
    width: 18px;
    text-align: center;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-bottom a {
    color: var(--gold);
}

/* --- Mobile Bottom Bar --- */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-gold);
    z-index: 1000;
    padding: 8px 0;
}

.mobile-bottom-bar-inner {
    display: flex;
    justify-content: space-around;
}

.mobile-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 11px;
    text-decoration: none;
    transition: var(--transition);
}

.mobile-bar-btn i {
    font-size: 18px;
}

.mobile-bar-btn:hover,
.mobile-bar-btn.active {
    color: var(--gold);
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.hidden { display: none !important; }

/* --- Loading Animation --- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--gold);
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: loadingDot 1.4s infinite both;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zodiac-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .nav-menu {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        display: block;
    }

    .mobile-bottom-bar {
        display: block;
    }

    .hero {
        min-height: 85vh;
        padding: 100px 20px 60px;
    }

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

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

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

    .section {
        padding: 60px 0;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .tool-input {
        padding: 24px;
    }

    .pillars-display {
        gap: 10px;
    }

    .pillar {
        min-width: 70px;
    }

    .pillar-gan,
    .pillar-zhi {
        font-size: 1.5rem;
    }

    .wuge-display {
        grid-template-columns: repeat(3, 1fr);
    }

    .zodiac-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .tarot-card {
        width: 100px;
        height: 170px;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }

    .step-arrow {
        display: none;
    }

    .compatibility-form {
        flex-direction: column;
    }

    body {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

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

    .wuge-display {
        grid-template-columns: repeat(2, 1fr);
    }

    .zodiac-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tarot-card {
        width: 80px;
        height: 140px;
    }

    .tarot-card-front .card-symbol {
        font-size: 32px;
    }

    .tarot-card-front .card-name {
        font-size: 11px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .btn-large {
        padding: 14px 28px;
        font-size: 16px;
    }
}
