:root {
    --bg-dark: #05050a;
    --accent-purple: #a855f7;
    --accent-violet: #d946ef;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --card-bg: rgba(15, 15, 25, 0.9);
    --accent-gold: #d4a957;
    --accent-gold-dim: rgba(212, 169, 87, 0.3);
}

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

body {
    background: radial-gradient(circle at 50% 50%, #16082a 0%, #05050a 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif; /* Default to sans-serif for legibility */
    min-height: 100vh;
    overflow-x: hidden;
}

/* 动态星辰闪烁效果 - 调暗使其更深邃 */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.3), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.2), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.1), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.2), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 250px 250px;
    opacity: 0.3; /* 降低透明度 */
    animation: twinkle 6s infinite alternate;
    pointer-events: none;
    z-index: -1;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 1.5rem 2rem; /* 增加顶部内边距，确保背景星座不被切掉 */
    position: relative;
    z-index: 1;
}

/* ========== Header & Nav ========== */
header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-purple);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}

.brand-logo {
    width: 48px; /* 稍微放大 Logo */
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    border: 1.5px solid var(--accent-gold); /* 改为金边 */
    box-shadow: 0 0 15px rgba(212, 169, 87, 0.3);
}

.main-title { display: none; }
.subtitle { display: none; }

.divination-menu {
    display: flex;
    gap: 3rem;
    background: transparent;
    padding: 0;
    border: none;
    backdrop-filter: none;
}

.divination-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s;
    position: relative;
    padding: 0.5rem 0;
}

.divination-menu a.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gold); /* 统一使用金色激活线，更显高级 */
    box-shadow: 0 0 10px var(--accent-gold);
}

.nav-utilities {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.login-btn {
    background: var(--accent-purple);
    color: #fff;
    padding: 0.5rem 1.8rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600; /* 加粗文字 */
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: var(--accent-violet);
    box-shadow: 0 0 15px var(--accent-glow);
}

.divination-menu a:hover, .divination-menu a.active {
    color: var(--accent-gold);
    /* 激活状态下增加更厚的阴影，对抗背景金色干扰 */
    text-shadow: 0 0 10px rgba(0,0,0,1), 0 2px 4px rgba(0,0,0,1);
    transform: translateY(-2px);
}

.hero-section {
    text-align: center;
    margin-bottom: 5rem;
    padding-left: 35px; /* 同步右移，保持中轴线一致 */
    animation: fadeIn 1.2s ease-out;
}

.selected-card-container {
    text-align: center;
    margin-bottom: 2rem;
    flex: 1;
    max-width: 240px; /* 限制宽度，确保三张牌能并排显示 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-pos-label {
    display: inline-block;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    padding: 0.4rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(168, 85, 247, 0.4);
    text-transform: uppercase;
}

.card-name-label {
    margin-top: 1.2rem;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}

.card-status-label {
    font-size: 0.9rem;
    color: var(--accent-purple);
    opacity: 0.8;
    margin-top: 0.4rem;
}

.interpretation-panel strong, 
.interpretation-panel h4 {
    color: var(--accent-purple);
    font-size: 1.2rem;
    display: block;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
    letter-spacing: 5px;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.2rem;
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

/* ========== Interactive Deck Area ========== */
#card-picker-area {
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
}

.interactive-deck {
    height: 280px; /* 固定高度，重新改为堆叠感 */
    position: relative;
    margin: 2rem auto;
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    overflow: visible; /* 允许悬停时卡片突出 */
}

.deck-card {
    width: 70px;
    height: 125px;
    background-image: url('../assets/home-images-001-sm.webp');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    position: absolute; /* 恢复绝对定位实现堆叠 */
    top: 50%;
    transform: translateY(-50%);
}

.deck-card:hover {
    transform: translateY(-80%) scale(1.1); /* 悬浮时显著向上方突出 */
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px var(--accent-glow);
    z-index: 1000 !important;
}

/* 展示架增强 */
.picked-shelf {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    min-height: 150px;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px dashed rgba(212, 169, 87, 0.2);
}

.deck-card.picked-to-shelf {
    position: relative !important;
    left: auto !important;
    margin-left: 0 !important;
    transform: none !important;
    width: 75px;
    height: 125px;
    z-index: 50 !important;
    animation: shelfPop 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ========== Spread Gallery ========== */
.spread-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.spread-feature-card {
    background: radial-gradient(circle at center, rgba(80, 40, 120, 0.15) 0%, rgba(20, 10, 30, 0.8) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 32px;
    padding: 1.2rem;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: breathingGlow 8s ease-in-out infinite;
}

.spread-feature-card:hover {
    transform: translateY(-4px); /* 悬浮稍微提升 */
    border-color: rgba(255, 215, 0, 0.5); /* 增加金边透明度 */
    box-shadow: 0 15px 50px rgba(168, 85, 247, 0.3); /* 强化紫色光晕 */
}

@keyframes breathingGlow {
    0%, 100% { box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 15px rgba(168, 85, 247, 0.1); }
    50% { box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 30px rgba(168, 85, 247, 0.2); }
}

.spread-feature-card:hover {
    transform: translateY(-8px);
    background: rgba(25, 25, 40, 0.95);
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 20px 45px rgba(0,0,0,0.6);
}

.card-inner-border {
    border: 1px solid rgba(212, 169, 87, 0.15); /* 调淡内边框 */
    border-radius: 24px; /* 统一圆角风格 */
    height: 100%;
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

/* 装饰性边角 (SVG 模拟) */
.card-inner-border::before, .card-inner-border::after {
    content: "✦";
    position: absolute;
    color: var(--accent-gold);
    font-size: 0.8rem;
}
.card-inner-border::before { top: 5px; left: 5px; }
.card-inner-border::after { bottom: 5px; right: 5px; }

.feature-title {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem; /* 微调字号防止单字换行 */
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    height: 3.5rem; /* 稍微缩减高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 5px rgba(212, 169, 87, 0.3);
}

.feature-preview {
    height: 220px; /* 统一固定高度，确保下方对齐 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
}

/* 单牌预览 - 统一使用迷你尺寸 */
.preview-card-single {
    height: 140px;
    width: 80px;
    background-image: url('../assets/home-images-001-sm.webp');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
    /* 为卡片本身添加魔法光晕 */
    filter: drop-shadow(0 0 15px rgba(180, 120, 255, 0.35));
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spread-feature-card:hover .preview-card-single {
    transform: scale(1.1) translateY(-5px);
}

.preview-img-single { 
    width: 90px; 
    /* 强制去除可能存在的背景色 */
    background: transparent !important; 
}

/* 三牌阵预览 - 使用背景图模式防止变形 */
.mini-card-preview {
    width: 65px;
    height: 110px;
    background-image: url('../assets/home-images-001-sm.webp');
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    filter: drop-shadow(0 0 10px rgba(180, 120, 255, 0.3));
}

.three-card-row { 
    display: flex; 
    gap: 10px; 
    background: transparent; 
}
.three-labels, .single-label { display: flex; gap: 15px; margin-top: 10px; color: var(--text-muted); font-size: 0.7rem; justify-content: center; }

.celtic-mini-diagram {
    position: relative;
    width: 150px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 用微型卡片代替空心框 */
.mini-card-back {
    width: 30px;
    height: 52px;
    background-image: url('../assets/home-images-001-sm.webp');
    background-size: cover;
    background-position: center;
    border: 0.5px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    filter: drop-shadow(0 0 5px rgba(180, 120, 255, 0.25));
    position: absolute;
}

.m-c-1 { transform: translate(0, 0); z-index: 5; }
.m-c-2 { transform: translate(0, 0) rotate(90deg); z-index: 6; }
.m-c-3 { transform: translate(0, -60px); }
.m-c-4 { transform: translate(0, 60px); }
.m-c-5 { transform: translate(-40px, 0); }
.m-c-6 { transform: translate(40px, 0); }
/* 右侧竖排 */
.m-c-7 { transform: translate(65px, 45px); }
.m-c-8 { transform: translate(65px, 15px); }
.m-c-9 { transform: translate(65px, -15px); }
.m-c-10 { transform: translate(65px, -45px); }

.feature-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-family: 'Outfit', sans-serif; /* Ensure sans-serif */
    min-height: auto;
    text-align: center;
}

/* ========== Pill Button ========== */
.pill-btn {
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.4); /* 金色边框 */
    color: var(--accent-gold); /* 金色文字 */
    padding: 0.8rem 0;
    width: 100%;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-top: auto;
    display: block;
    letter-spacing: 2px;
}

.pill-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-gold);
    color: #fff;
    text-shadow: 0 0 8px var(--accent-purple); /* 文字发光 */
    box-shadow: 0 0 20px rgba(212, 169, 87, 0.3);
}

/* ========== Question & Ritual ========== */
.question-section {
    max-width: 900px;
    margin: 4rem auto;
    text-align: center;
    background: rgba(15, 15, 25, 0.7); /* 保护背景色 */
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 32px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    animation: slideUp 0.8s ease-out;
}

#user-question {
    width: 100%;
    height: 140px;
    background: rgba(0, 0, 0, 0.5); /* 输入框深色底 */
    border: 1.5px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    color: #fff;
    padding: 1.5rem;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    resize: none;
    transition: all 0.3s;
}

#user-question:focus {
    border-color: var(--accent-purple);
    outline: none;
    box-shadow: 0 0 20px var(--accent-glow);
}

#user-question::placeholder {
    color: rgba(255, 255, 255, 0.4); /* 显著提亮占位符 */
}

.ritual-hint {
    color: #cbd5e1;
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 3.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,1);
}

/* 升级主动作按钮 */
#shuffle-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-violet));
    color: #fff;
    border: none;
    padding: 1.2rem 6rem;
    border-radius: 100px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.4rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
    display: inline-block;
}

#shuffle-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 50px var(--accent-glow);
    filter: brightness(1.1);
}

#shuffle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333;
}

/* ========== Results & Layout ========== */
#result-screen {
    animation: fadeIn 1s ease-in;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
    padding: 2rem;
    border-radius: 20px;
}

.result-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.cards-panel {
    background: rgba(20, 20, 32, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 32px;
    padding: 3rem;
    width: 100%;
}

.cards-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.interpretation-panel {
    background: rgba(20, 20, 32, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 32px;
    padding: 3.5rem;
    width: 100%;
    min-height: auto;
}

/* ========== 凯尔特十字布局 (唯一规则集) ========== */
.celtic-layout {
    display: grid;
    grid-template-columns: 140px 140px 140px 60px 140px;
    grid-template-rows: repeat(4, auto);
    gap: 10px;
    justify-content: center;
    padding: 4rem 1rem 2rem; /* 增加顶部内边距，防止被导航栏遮挡 */
}

/* 1号牌(现状)的网格单元需要 position:relative, 让2号牌可以叠加 */
.celtic-pos-1 { grid-area: 2 / 2 / 3 / 3; z-index: 1; position: relative; }
.celtic-pos-2 { 
    grid-area: 2 / 2 / 3 / 3; 
    z-index: 2; 
    /* 关键：让2号牌容器居中对齐到1号牌的中心，而不是从顶部开始堆叠 */
    place-self: center; 
    pointer-events: none; 
}
.celtic-pos-3 { grid-area: 1 / 2 / 2 / 3; }
.celtic-pos-4 { grid-area: 3 / 2 / 4 / 3; }
.celtic-pos-5 { grid-area: 2 / 1 / 3 / 2; }
.celtic-pos-6 { grid-area: 2 / 3 / 3 / 4; }
.celtic-pos-7  { grid-area: 4 / 5 / 5 / 6; }
.celtic-pos-8  { grid-area: 3 / 5 / 4 / 6; }
.celtic-pos-9  { grid-area: 2 / 5 / 3 / 6; }
.celtic-pos-10 { grid-area: 1 / 5 / 2 / 6; }

/* 凯尔特模式下的卡牌容器 */
.celtic-layout .selected-card-container {
    width: 140px;
    margin: 0 auto;
    flex: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 凯尔特模式下的卡牌尺寸 */
.celtic-layout .card-display {
    width: 90px;
    height: 150px;
    background-size: cover;
    background-position: center;
}

/* 凯尔特模式下的位置标签 */
.celtic-layout .card-pos-label {
    display: inline-block;
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(168, 85, 247, 0.4);
    white-space: nowrap;
}

/* 凯尔特模式下的卡牌名称 */
.celtic-layout .card-name-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #fff;
}

.celtic-layout .card-status-label {
    font-size: 0.8rem;
    color: var(--accent-purple);
}

/* === 2号牌（挑战牌）特殊处理 === */
/* 2号牌的卡牌图片旋转90度, 覆盖在1号牌上 */
.celtic-pos-2 .card-display {
    transform: rotate(90deg) !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.celtic-pos-2 .card-display.reversed {
    transform: rotate(270deg) !important;
}

/* 隐藏2号牌的位置标签(勋章), 但保留名字和状态 */
.celtic-pos-2 .card-pos-label {
    display: none;
}

/* 2号牌的名字用紫色区分, 表示这是"挑战牌" */
.celtic-pos-2 .card-name-label {
    color: var(--accent-purple);
    font-size: 0.8rem;
    font-weight: 500;
}

.celtic-pos-2 .card-status-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

.card-display {
    width: 140px;
    height: 240px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    /* 玻璃拟态效果 */
    background-color: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* 极细金边 */
    border: 1px solid rgba(212, 169, 87, 0.3);
    /* 紫色柔光投影 */
    box-shadow: 0 8px 32px 0 rgba(168, 85, 247, 0.25), 
                inset 0 0 15px rgba(168, 85, 247, 0.1);
    margin: 0 auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-display:hover {
    border-color: rgba(212, 169, 87, 0.8);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
    transform: translateY(-10px) scale(1.05);
}

.card-display.reversed {
    transform: rotate(180deg);
}

.card-display.reversed:hover {
    transform: rotate(180deg) translateY(10px) scale(1.05);
}

.interpretation-box {
    border-left: 3px solid var(--accent-purple);
    padding-left: 1.5rem;
}

.result-question-display {
    font-size: 1.1rem;
    color: var(--accent-purple);
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.6;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 1.5rem;
    text-align: center;
}

.interpretation-box h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-purple);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

#interpretation-text {
    line-height: 1.8;
    color: #e2e8f0;
    text-align: left;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.5s;
    word-break: break-word;
}

.result-actions {
    display: flex;
    flex-direction: row; /* 在全宽下可以恢复并排 */
    gap: 2rem;
    width: 100%;
    max-width: 600px;
    margin: 4rem auto 0;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    flex: 1;
    max-width: 250px;
}

/* ========== Utils ========== */
.btn-primary {
    background: var(--accent-purple);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    width: 100%; /* 占据全宽 */
    white-space: nowrap; /* 核心修改：强制文字横向 */
    text-align: center;
}

.btn-primary:hover {
    background: var(--accent-violet);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-purple);
    border: 1.5px solid var(--accent-purple);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    width: 100%; /* 占据全宽，防止文字被挤压 */
    white-space: nowrap; /* 核心修改：强制文字横向 */
    text-align: center;
}

.privacy-toggle {
    margin-bottom: 0.8rem;
    color: var(--accent-purple);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    background: rgba(168, 85, 247, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: 0.3s;
}

.privacy-toggle:hover {
    background: rgba(168, 85, 247, 0.2);
}

.privacy-toggle input {
    cursor: pointer;
    accent-color: var(--accent-purple);
}

.btn-secondary:hover {
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

/* 海报预览遮罩层 */
.poster-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.poster-overlay.active { display: flex; }

.poster-preview-container {
    width: 100%;
    max-width: 450px; /* 缩减宽度，使其更像书签/卡片 */
    max-height: 70vh; /* 限制高度，为上下按钮和提示留出空间 */
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow-y: auto; /* 内容过多时内部滚动，不撑破全屏 */
    background: #05050a;
}

.poster-preview-container img {
    width: 100%;
    display: block;
}

.poster-hint {
    color: var(--accent-purple);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.loading-spinner { display: none; text-align: center; margin-top: 4rem; }
.loading-spinner.active { display: block; }
.spinner { width: 50px; height: 50px; border: 3px solid rgba(168, 85, 247, 0.2); border-top-color: var(--accent-purple); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Mobile Responsiveness & Immersion ========== */
@media (max-width: 768px) {
    :root {
        --app-padding: 1rem;
    }

    header {
        flex-direction: column; /* 手机端改为垂直堆叠，防止挤压 */
        padding: 0.6rem 1rem;
        gap: 0.8rem;
        height: auto;
    }

    .logo-area {
        font-size: 1.2rem;
    }
    
    .logo-area span {
        white-space: nowrap; /* 核心修改：防止“知了”文字换行 */
    }

    .brand-logo {
        width: 36px;
        height: 36px;
    }

    .divination-menu {
        width: 100%;
        justify-content: space-around; /* 均匀分布菜单项 */
        gap: 0.5rem;
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 0.8rem;
    }

    .divination-menu a {
        font-size: 0.85rem;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .nav-utilities {
        position: absolute;
        right: 1rem;
        top: 0.8rem;
        gap: 0.8rem;
    }

    .login-btn {
        padding: 0.3rem 1rem;
        font-size: 0.8rem;
    }

    #app {
        padding: 5rem 1rem 2rem; /* 调整顶部间距以适应加高的 Header */
    }

    .hero-title {
        font-size: 1.4rem;
        padding: 0 1rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        padding: 0 1rem;
    }

    /* 牌阵选择卡片优化 */
    .spread-gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card-inner-border {
        padding: 1.5rem 1rem;
    }

    .feature-preview {
        height: 120px;
    }

    .preview-img-single {
        width: 60px;
    }

    .three-card-row img {
        width: 45px;
    }

    /* 选牌区移动端适配 */
    .interactive-deck {
        height: 200px;
        width: 95%;
    }

    .deck-card {
        width: 50px;
        height: 90px;
    }

    .picked-shelf {
        min-height: 120px;
        gap: 8px;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 10px;
    }

    .deck-card.picked-to-shelf {
        width: 55px;
        height: 95px;
        flex-shrink: 0;
    }

    /* 结果页移动端适配 */
    .result-layout {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .cards-panel {
        padding: 1.5rem 1rem;
    }

    /* 海报预览遮罩层移动端优化 */
    .poster-overlay {
        padding: 1rem;
    }

    .poster-preview-container {
        max-width: 100%;
        max-height: 65vh;
        margin-bottom: 1.5rem;
    }

    #close-poster-btn {
        width: auto !important;
        padding: 0.7rem 2rem;
        font-size: 0.9rem;
        min-width: 150px;
    }

    .poster-hint {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

/* 针对极小屏幕 */
@media (max-width: 380px) {
    .main-title { font-size: 1.5rem; }
    .divination-menu a { font-size: 0.75rem; }
}

/* ========== 登录/注册弹窗 ========== */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.auth-modal {
    background: rgba(15, 15, 30, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 360px;
    max-width: 90vw;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.15);
}

.auth-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.auth-close:hover { color: #fff; }

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.8rem 0;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
    font-weight: 600;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.auth-field input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-error {
    color: #f87171;
    font-size: 0.85rem;
    min-height: 1.2rem;
    margin: 0.5rem 0;
}

.auth-submit {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-violet));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
}

.auth-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 用户信息区 */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    font-size: 1.3rem;
}

.user-nickname {
    color: var(--accent-purple);
    font-weight: 500;
    font-size: 0.9rem;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
