/* --- 基础设置 --- */
:root {
    --ink: #1A1A1A;
    --paper: #F2F0E9;
    --seal: #B43C3C;
    --gold: #C5A468;
    --font-main: 'Noto Serif SC', serif;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-main);
    overflow: hidden;
    touch-action: none;
    width: 100vw;
    height: 100vh;
    /* 解决移动端 100vh 问题 */
    height: -webkit-fill-available; 
}

/* 修复移动端 Safari 100vh */
html {
    height: -webkit-fill-available;
}

/* 宣纸纹理 */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* 漂浮微尘 */
.dust-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.dust {
    position: absolute;
    background: #000;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite linear;
}
@keyframes float {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    50% { opacity: 0.2; }
    100% { transform: translateY(-100px) translateX(20px); opacity: 0; }
}

/* --- 阶段容器 --- */
#stage-void, #stage-flow, #stage-revelation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transition: opacity 1.2s ease-in-out;
}

#stage-flow { opacity: 0; pointer-events: none; z-index: 20; }
#stage-revelation { opacity: 0; pointer-events: none; z-index: 30; display: flex; justify-content: center; align-items: center; flex-direction: column; }

/* --- Void 阶段动效 --- */
.void-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.title-text {
    font-size: 2rem;
    letter-spacing: 0.8rem;
    writing-mode: vertical-rl;
    text-orientation: upright;
    opacity: 0.8;
    animation: textBreathe 5s infinite ease-in-out;
}

@keyframes textBreathe {
    0%, 100% { opacity: 0.6; text-shadow: 0 0 5px rgba(0,0,0,0); }
    50% { opacity: 1; text-shadow: 0 0 15px rgba(0,0,0,0.1); }
}

.guide-hand {
    position: absolute;
    bottom: 20%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
    animation: handMove 2s infinite ease-in-out;
    opacity: 0;
    transition: opacity 1s;
}
.guide-hand::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@keyframes handMove {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    20% { opacity: 1; }
    80% { transform: translateY(-30px) scale(0.9); opacity: 0; }
    100% { transform: translateY(-30px) scale(0.9); opacity: 0; }
}

/* --- Flow 阶段 Canvas --- */
canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* --- Revelation 阶段卡片 --- */
.card-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card-container {
    perspective: 1000px;
    width: 85vw; /* 稍微收窄一点 */
    height: auto;
    aspect-ratio: 3/5; /* 固定比例，类似书签/卡片 */
    max-width: 360px;
    max-height: 640px;
    position: relative;
    margin-bottom: 20px; /* 给按钮留空间 */
}

.oracle-card {
    width: 100%;
    height: 100%;
    background: #fff;
    position: relative;
    box-shadow: 
        0 4px 20px rgba(0,0,0,0.08),
        0 10px 40px rgba(0,0,0,0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column; /* 此时改回垂直堆叠布局，以支持横排文字 */
    padding: 2rem 1.5rem; /* 增加内边距 */
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 4px;
}

.oracle-card::before { /* 纸张纹理叠加 */
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.oracle-card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- 卡片内部布局 --- */
.card-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* 1. 类别与日期 (顶) */
.col-meta {
    flex-direction: row; /* 横向排列 */
    height: auto;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 15px;
}
.meta-stamp {
    border: 1px solid var(--seal);
    color: var(--seal);
    font-size: 0.75rem;
    padding: 2px 6px; /* 横排padding */
    border-radius: 2px;
    margin: 0 10px;
    letter-spacing: 0.2rem;
    font-weight: 600;
    writing-mode: horizontal-tb; /* 横排 */
}
.meta-date {
    font-size: 0.7rem;
    color: #999;
    letter-spacing: 0.1rem;
    font-family: 'Noto Serif SC', serif;
    writing-mode: horizontal-tb; /* 横排 */
}

/* 通用标签样式 */
.section-label {
    writing-mode: horizontal-tb; /* 横排 */
    font-size: 0.75rem;
    color: #8a7f75; 
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.2rem;
    border: none; 
    padding: 0;
    position: relative;
}
/* 装饰性小点 */
.section-label::after {
    content: '·';
    position: absolute;
    bottom: -12px; /* 放在文字下方 */
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-weight: normal;
    display: none; /* 横排模式下隐藏这个点，或者改样式 */
}

/* 2. 祈福语 (上) */
.col-blessing {
    height: auto;
    padding: 0 10px;
    margin-bottom: 20px;
}
.blessing-text {
    font-size: 0.9rem;
    color: #666;
    letter-spacing: 0.1rem;
    line-height: 1.6;
    font-weight: 300;
    padding-top: 5px;
    text-align: center;
    writing-mode: horizontal-tb; /* 横排 */
}

/* 3. 主体：鉴心 (中 - 保持竖排) */
.col-insight {
    flex-grow: 1;
    padding: 10px 0;
    writing-mode: vertical-rl; /* 核心保留竖排 */
    min-height: 180px;
}
.insight-text {
    font-size: 1.4rem;
    color: #222;
    letter-spacing: 0.35rem;
    line-height: 1.8;
    font-weight: 600;
    max-height: 100%;
    /* 竖排时 text-align center 其实是顶部对齐，flex 居中由父级控制 */
}
/* 针对不同屏幕和文本长度的微调 */
@media (max-width: 380px) {
    .insight-text { font-size: 1.2rem; }
    .card-container { width: 90vw; }
}

/* 4. 行动与落款 (下) */
.col-action {
    height: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: auto; /* 推到底部 */
}
.action-text {
    font-size: 0.85rem;
    color: #555;
    letter-spacing: 0.1rem;
    line-height: 1.5;
    padding-top: 5px; 
    text-align: center;
    writing-mode: horizontal-tb; /* 横排 */
}
.seal-box {
    display: flex;
    flex-direction: row; /* 印章和文字在一行? 不，还是分行好看 */
    align-items: center;
    margin-bottom: 10px;
}
.seal-img {
    width: 32px;
    height: 32px;
    background-color: var(--seal);
    color: white;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.6rem;
    line-height: 1.1;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 0 0 3px var(--seal);
    opacity: 0.9;
    writing-mode: horizontal-tb;
    margin-bottom: 0; /* reset */
}

/* 高亮样式 */
.highlight {
    color: #A08D6A;
    font-weight: 700;
}

/* 按钮组 */
.action-bar {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    transition: opacity 1s delay 1s;
    width: 100%;
}
.show + .action-bar { opacity: 1; }

.btn-text {
    font-size: 0.9rem;
    color: #555;
    padding: 10px 24px;
    border: 1px solid rgba(160, 141, 106, 0.3);
    border-radius: 30px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-text:hover {
    background: #fff;
    border-color: var(--gold);
    color: var(--ink);
}
.btn-text:active {
    transform: scale(0.96);
}

/* 光效层 */
.flash-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    pointer-events: none;
    opacity: 0;
    z-index: 50;
    transition: opacity 1.5s ease-out;
}

