/* ========================================
   古签解语 - 传统签诗在线抽签
   古典卷轴风格设计
   ======================================== */

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

body {
    font-family: "Songti SC", "SimSun", "STSong", "Noto Serif SC", serif;
    background: linear-gradient(135deg, #f5e6c8 0%, #e8d4a8 50%, #d4c49a 100%);
    min-height: 100vh;
    color: #2c1810;
    line-height: 1.8;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ========================================
   头部区域
   ======================================== */

header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
    margin-bottom: 20px;
}

.lotus-decoration {
    font-size: 28px;
    margin: 10px 0;
    opacity: 0.8;
}

h1 {
    font-size: 36px;
    color: #8B4513;
    letter-spacing: 8px;
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.2);
    font-weight: normal;
}

.subtitle {
    font-size: 14px;
    color: #6b4423;
    letter-spacing: 4px;
    margin-top: 5px;
}

/* ========================================
   状态切换
   ======================================== */

.state {
    display: none;
}

.state.active {
    display: block;
}

/* ========================================
   初始状态：签筒和抽签按钮
   ======================================== */

.blessing-box {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #fff9e6, #fff5d6);
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.blessing-text {
    font-size: 18px;
    color: #8B4513;
    margin-bottom: 8px;
}

.instruction {
    font-size: 14px;
    color: #a07040;
}

/* 签筒 */
.qian-tong {
    position: relative;
    width: 200px;
    height: 280px;
    margin: 30px auto;
    background: linear-gradient(135deg, #d4a574 0%, #b8956c 50%, #9a7a54 100%);
    border-radius: 20px 20px 40px 40px;
    box-shadow: 
        inset 0 10px 30px rgba(255, 255, 255, 0.3),
        inset 0 -10px 30px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid #8B4513;
    overflow: hidden;
}

.qian-tong::before {
    content: '签';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    color: rgba(139, 69, 19, 0.3);
    font-weight: bold;
    font-family: "STKaiti", "KaiTi", serif;
}

.stick-container {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 250px;
    display: flex;
    justify-content: center;
    gap: 2px;
}

.qian-stick {
    width: 10px;
    height: 180px;
    background: linear-gradient(to bottom, #f5deb3, #deb887, #d2b48c);
    border-radius: 3px 3px 1px 1px;
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.2);
    animation: stickIdle 3s ease-in-out infinite;
}

@keyframes stickIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.qian-base {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, #a07040, #8B4513);
    border-radius: 0 0 37px 37px;
}

/* 抽签按钮 */
.draw-button {
    display: block;
    width: 200px;
    height: 60px;
    margin: 30px auto;
    background: linear-gradient(135deg, #c41e3a 0%, #8B0000 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 24px;
    letter-spacing: 6px;
    cursor: pointer;
    box-shadow: 
        0 4px 15px rgba(196, 30, 58, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-family: "STKaiti", "KaiTi", "Ma Shan Zheng", serif;
}

.draw-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(196, 30, 58, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.draw-button:active {
    transform: translateY(1px);
    box-shadow: 
        0 2px 10px rgba(196, 30, 58, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

/* ========================================
   抽签动画
   ======================================== */

.drawing-animation {
    text-align: center;
    padding: 60px 20px;
}

.spinning-stick {
    width: 60px;
    height: 200px;
    background: linear-gradient(to bottom, #f5deb3, #deb887);
    margin: 0 auto 30px;
    border-radius: 5px;
    animation: shake 0.5s ease-in-out infinite;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes shake {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.chanting {
    font-size: 16px;
    color: #8B4513;
    margin-top: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========================================
   古典卷轴风格（抽签后默认页面）
   ======================================== */

.scroll-container {
    padding: 10px;
}

/* 外层边框：黄色复古纹理 */
.scroll-outer-border {
    background: linear-gradient(135deg, #e8d4a8 0%, #d4c49a 50%, #c9b896 100%);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 0 30px rgba(139, 69, 19, 0.1);
}

/* 内层边框：金色回纹 */
.scroll-inner-border {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 8px,
        rgba(212, 175, 55, 0.3) 8px,
        rgba(212, 175, 55, 0.3) 10px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        rgba(212, 175, 55, 0.3) 8px,
        rgba(212, 175, 55, 0.3) 10px
    );
    background-color: #f9f3e3;
    padding: 10px;
    border: 3px solid #d4af37;
    border-radius: 4px;
    position: relative;
}

/* 回纹装饰角 */
.scroll-inner-border::before,
.scroll-inner-border::after {
    content: '卍';
    position: absolute;
    font-size: 20px;
    color: #d4af37;
    opacity: 0.6;
}

.scroll-inner-border::before {
    top: 5px;
    left: 5px;
}

.scroll-inner-border::after {
    bottom: 5px;
    right: 5px;
}

/* 卷轴主体 */
.scroll-body {
    background: linear-gradient(to bottom, #fdf6e3, #f9f3e3);
    padding: 20px 15px;
    border-radius: 2px;
}

/* 顶部标题区 */
.scroll-header {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
    margin-bottom: 15px;
}

.qian-number-large {
    font-size: 28px;
    color: #c41e3a;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.qian-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #c41e3a, #8B0000);
    color: #fff;
    padding: 4px 16px;
    border-radius: 15px;
    font-size: 16px;
    letter-spacing: 2px;
    margin: 5px 5px 5px 0;
}

.qian-gong-text {
    display: inline-block;
    background: rgba(139, 69, 19, 0.1);
    color: #6b4423;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 14px;
    margin: 5px 0 0 5px;
}

/* 签名行 */
.qian-title-row {
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(139, 69, 19, 0.2);
    margin-bottom: 15px;
}

.guren-icon {
    font-size: 18px;
    margin-right: 8px;
}

.guren-name {
    font-size: 20px;
    color: #8B4513;
    font-weight: bold;
    letter-spacing: 3px;
}

/* 中间内容区：左右两列 */
.scroll-content {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.content-column {
    flex: 1;
    position: relative;
}

.column-title {
    font-size: 18px;
    color: #c41e3a;
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(196, 30, 58, 0.3);
}

/* 左列：仙机/运势网格 */
.fortune-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fortune-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 4px;
    font-size: 13px;
}

.fortune-label {
    color: #6b4423;
    font-weight: bold;
}

.fortune-value {
    color: #8B4513;
}

/* 运势值颜色 */
.fortune-value.ji { color: #c41e3a; font-weight: bold; }
.fortune-value.xiong { color: #666; }
.fortune-value.zhong { color: #8B4513; }

/* 锁定遮罩 */
.locked-overlay {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    backdrop-filter: blur(2px);
}

.locked-overlay span {
    color: #8B4513;
    font-size: 14px;
}

/* 右列：签诗（竖排） */
.poem-vertical {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 12px;
    min-height: 100px;
    margin-bottom: 15px;
}

.poem-line {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 16px;
    color: #2c1810;
    line-height: 1.6;
    letter-spacing: 2px;
}

/* 解签（右列内） */
.jie-section-inline {
    border-top: 1px dashed rgba(139, 69, 19, 0.2);
    padding-top: 12px;
    margin-top: 10px;
}

.jie-text {
    font-size: 13px;
    color: #5a3a1a;
    line-height: 1.8;
    padding: 8px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 4px;
}

/* 底部总结语 */
.scroll-footer {
    border-top: 2px solid rgba(139, 69, 19, 0.2);
    padding-top: 15px;
    margin-top: 10px;
}

.fayu-section {
    text-align: center;
    padding: 10px;
    background: rgba(196, 30, 58, 0.05);
    border-radius: 4px;
}

.fayu-label {
    font-size: 16px;
    color: #c41e3a;
    font-weight: bold;
    margin-right: 8px;
}

.fayu-text {
    font-size: 15px;
    color: #8B4513;
    line-height: 1.6;
}

/* ========================================
   操作按钮
   ======================================== */

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.unlock-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #c41e3a 0%, #8B0000 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
    transition: all 0.3s ease;
    font-family: "STKaiti", "KaiTi", serif;
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
}

.secondary-btn {
    padding: 12px 25px;
    background: rgba(139, 69, 19, 0.1);
    color: #6b4423;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "STKaiti", "KaiTi", serif;
}

.secondary-btn:hover {
    background: rgba(139, 69, 19, 0.15);
    border-color: rgba(139, 69, 19, 0.5);
}

.share-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    font-family: "STKaiti", "KaiTi", serif;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* ========================================
   详细解签页面（第二阶段）
   ======================================== */

.detail-paper {
    background: linear-gradient(to bottom, #fdf6e3, #f9f3e3);
    border-radius: 8px;
    padding: 25px 20px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 0 30px rgba(139, 69, 19, 0.05);
    border: 2px solid rgba(139, 69, 19, 0.15);
}

.detail-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
    margin-bottom: 25px;
}

.detail-title {
    font-size: 20px;
    color: #8B4513;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.detail-summary {
    font-size: 14px;
    color: #5a3a1a;
    line-height: 1.6;
    padding: 10px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 6px;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    font-size: 18px;
    color: #c41e3a;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(196, 30, 58, 0.3);
    letter-spacing: 2px;
}

.section-label {
    font-size: 14px;
    color: #6b4423;
    font-weight: bold;
    margin-bottom: 8px;
}

.poem-content, .jie-content {
    font-size: 15px;
    color: #2c1810;
    line-height: 1.8;
    padding: 12px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 6px;
    margin-bottom: 15px;
    white-space: pre-line;
}

.meaning-list {
    font-size: 14px;
    color: #5a3a1a;
    line-height: 1.8;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

/* 运势表格 */
.fortune-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fortune-table th,
.fortune-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.fortune-table th {
    background: rgba(139, 69, 19, 0.1);
    color: #6b4423;
    font-weight: bold;
}

.fortune-table td {
    color: #5a3a1a;
}

.fortune-table tr:hover {
    background: rgba(139, 69, 19, 0.03);
}

/* 建议列表 */
.advice-list {
    font-size: 14px;
    color: #5a3a1a;
    line-height: 2;
    padding: 10px 15px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 6px;
}

.advice-list p {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.advice-list p::before {
    content: '•';
    position: absolute;
    left: 5px;
    color: #c41e3a;
}

/* 底部提示 */
.detail-footer-note {
    text-align: center;
    padding-top: 20px;
    border-top: 1px dashed rgba(139, 69, 19, 0.2);
    margin-top: 20px;
}

.detail-footer-note p {
    font-size: 14px;
    color: #6b4423;
    margin: 5px 0;
}

.ai-note {
    font-size: 12px;
    color: #999;
}

/* ========================================
   页脚
   ======================================== */

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 30px;
    border-top: 1px solid rgba(139, 69, 19, 0.2);
}

footer p {
    font-size: 14px;
    color: #6b4423;
    margin: 5px 0;
}

.disclaimer {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.copyright-note {
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
}

/* ========================================
   支付弹窗
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(to bottom, #fdf6e3, #f9f3e3);
    border-radius: 12px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(139, 69, 19, 0.2);
}

.modal-title {
    font-size: 22px;
    color: #c41e3a;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.modal-subtitle {
    font-size: 14px;
    color: #6b4423;
    margin-bottom: 20px;
}
.modal-note {
    font-size: 15px;
    color: #c41e3a;
    margin-bottom: 18px;
    padding: 10px;
    background: rgba(196, 30, 58, 0.06);
    border-radius: 8px;
    line-height: 1.6;
    font-weight: bold;
}

.qr-container {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: inline-block;
}

.qr-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.payment-note {
    font-size: 13px;
    color: #5a3a1a;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(196, 30, 58, 0.05);
    border-radius: 6px;
}

.verify-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fff;
    letter-spacing: 8px;
    font-family: monospace;
}

.verify-input:focus {
    outline: none;
    border-color: #c41e3a;
}

.verify-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #c41e3a 0%, #8B0000 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.verify-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

.verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.close-btn {
    background: none;
    border: 1px solid rgba(139, 69, 19, 0.3);
    color: #6b4423;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.error-message {
    color: #c41e3a;
    font-size: 13px;
    margin-bottom: 10px;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 28px;
        letter-spacing: 5px;
    }
    
    .scroll-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .poem-vertical {
        min-height: 80px;
    }
    
    .poem-line {
        font-size: 14px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .unlock-btn, .secondary-btn, .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .fortune-table {
        font-size: 13px;
    }
    
    .fortune-table th,
    .fortune-table td {
        padding: 8px 10px;
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* ==========================================
   支付弹窗 - 自动验证模式
   ========================================== */

.payment-modal-content {
    max-width: 380px;
}

.auto-verify-status {
    text-align: center;
    padding: 10px 0;
}

.status-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.status-text {
    font-size: 16px;
    color: #5a3e2b;
    margin-bottom: 4px;
}

.status-tip {
    font-size: 12px;
    color: #999;
}

.verify-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-family: 'STKaiti', 'KaiTi', serif;
    transition: opacity 0.3s;
}

.verify-btn:hover {
    opacity: 0.9;
}

/* 弹窗覆盖样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    padding: 30px 24px 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-title {
    font-size: 20px;
    margin-bottom: 4px;
    color: #2c1810;
}

.modal-subtitle {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
}

.modal-note {
    font-size: 15px;
    color: #c41e3a;
    margin-bottom: 18px;
    padding: 10px;
    background: rgba(196, 30, 58, 0.06);
    border-radius: 8px;
    line-height: 1.6;
    font-weight: bold;
}
.qr-container {
    margin: 0 auto 12px;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    border: 2px solid #e8d4a8;
}

.payment-note {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.close-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'STKaiti', 'KaiTi', serif;
}

.close-btn:hover {
    background: #e0e0e0;
}
