/* 道教风格抽签网站样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'STKaiti', '楷体', '华文楷体', 'KaiTi', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    color: #f4f1de;
}

/* 道教背景纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(212, 175, 55, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(139, 69, 19, 0.1) 2px, transparent 2px);
    background-size: 60px 60px;
    z-index: -2;
}

/* 流动的云雾效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(212, 175, 55, 0.05) 50%, 
        transparent 60%);
    animation: cloudMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes cloudMove {
    0%, 100% { transform: translateX(-100px) translateY(-50px); }
    50% { transform: translateX(100px) translateY(50px); }
}

.container {
    max-width: 420px;
    width: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(22, 33, 62, 0.9));
    border: 2px solid #d4af37;
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 2px 10px rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
    position: relative;
}

/* 容器装饰边框 */
.container::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #8b4513, #d4af37);
    color: #f4f1de;
    text-align: center;
    padding: 25px 20px;
    position: relative;
    border-bottom: 3px solid #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.bagua {
    font-size: 28px;
    animation: rotate 10s linear infinite;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.title {
    font-size: 26px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.subtitle {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    opacity: 0.9;
    letter-spacing: 1px;
}

/* 主要内容区域 */
.content {
    padding: 30px 20px;
}

.lottery-area {
    text-align: center;
    margin-bottom: 30px;
}

/* 笔筒设计 */
.brush-holder {
    position: relative;
    margin: 0 auto 20px;
    width: 200px;
    height: 250px;
}

.holder-top {
    width: 100%;
    height: 20px;
    background: linear-gradient(135deg, #8b4513, #a0522d);
    border-radius: 10px 10px 0 0;
    border: 2px solid #d4af37;
    border-bottom: none;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

.holder-body {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #654321, #8b4513);
    border: 2px solid #d4af37;
    border-top: none;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

/* 笔筒纹理 */
.holder-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 45%, 
        rgba(212, 175, 55, 0.1) 50%, 
        transparent 55%);
    background-size: 20px 100%;
}

.holder-bottom {
    width: 100%;
    height: 30px;
    background: linear-gradient(135deg, #8b4513, #a0522d);
    border-radius: 0 0 10px 10px;
    border: 2px solid #d4af37;
    border-top: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 竹签容器 */
.bamboo-sticks {
    padding: 10px;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 3px;
    overflow: hidden;
}

/* 竹签样式 */
.bamboo-stick {
    width: 12px;
    height: 180px;
    background: linear-gradient(180deg, #f4e4a6, #e6d76f, #d4af37);
    border-radius: 2px 2px 0 0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #b8941f;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 移除签条上的文字显示 */
.bamboo-stick::before {
    content: '';
}

.bamboo-stick:hover {
    transform: translateY(-10px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    background: linear-gradient(180deg, #f9e79f, #f1c40f, #d4af37);
}

.bamboo-stick.selected {
    transform: translateY(-20px) scale(1.1);
    background: linear-gradient(180deg, #ffd700, #ffed4e, #d4af37);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.5);
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 10px 20px rgba(212, 175, 55, 0.5); }
    to { box-shadow: 0 10px 30px rgba(212, 175, 55, 0.8); }
}

/* 结果显示区域 */
.result-area {
    margin: 20px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-scroll {
    background: linear-gradient(135deg, #f4e4a6, #e6d76f);
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    width: 100%;
    max-width: 250px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
}

.result-scroll::before,
.result-scroll::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #8b4513;
    font-size: 12px;
}

.result-scroll::before {
    left: 8px;
}

.result-scroll::after {
    right: 8px;
}

.scroll-content {
    text-align: center;
}

.result-text {
    color: #8b4513;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 按钮区域 */
.button-area {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* 抽签按钮 */
.draw-btn {
    background: linear-gradient(135deg, #8b4513, #d4af37);
    color: #f4f1de;
    border: 2px solid #d4af37;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    font-family: inherit;
    flex: 1;
    max-width: 150px;
}

.draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #a0522d, #ffd700);
}

.draw-btn:active {
    transform: translateY(0);
}

.draw-btn.shaking {
    animation: shake 0.8s ease-in-out;
}

/* 查看签条按钮 */
.view-btn {
    background: linear-gradient(135deg, #4a5568, #6b7280);
    color: #f4f1de;
    border: 2px solid #6b7280;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    font-family: inherit;
    flex: 1;
    max-width: 150px;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.view-btn:active {
    transform: translateY(0);
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
}

/* 设置区域 */
.settings {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed rgba(212, 175, 55, 0.3);
}

.settings-title {
    font-size: 16px;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.symbol {
    color: #d4af37;
    font-size: 14px;
    animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.textarea-container {
    position: relative;
}

.options-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
    background: rgba(26, 26, 46, 0.8);
    color: #f4f1de;
    line-height: 1.6;
}

.options-textarea::placeholder {
    color: rgba(244, 241, 222, 0.6);
}

.options-textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    background: rgba(26, 26, 46, 0.9);
}

.help-text {
    font-size: 12px;
    color: rgba(244, 241, 222, 0.7);
    margin-top: 8px;
    text-align: center;
    letter-spacing: 0.5px;
}

.reset-btn {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(160, 82, 45, 0.8));
    color: #f4f1de;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.reset-btn:hover {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.9), rgba(212, 175, 55, 0.9));
    border-color: #d4af37;
    transform: translateY(-1px);
}

/* 装饰元素 */
.decoration-left,
.decoration-right {
    position: absolute;
    top: 20%;
    width: 60px;
    height: 200px;
    pointer-events: none;
    opacity: 0.3;
}

.decoration-left {
    left: -30px;
}

.decoration-right {
    right: -30px;
}

.cloud {
    width: 40px;
    height: 20px;
    background: rgba(244, 241, 222, 0.2);
    border-radius: 50px;
    margin-bottom: 20px;
    animation: float 4s ease-in-out infinite;
}

.mountain {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 40px solid rgba(139, 69, 19, 0.3);
    margin: 0 auto;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 移动端适配 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
        max-width: 100%;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .bagua {
        font-size: 24px;
    }
    
    .title {
        font-size: 22px;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .brush-holder {
        width: 180px;
        height: 220px;
    }
    
    .holder-body {
        height: 180px;
    }
    
    .bamboo-stick {
        width: 10px;
        height: 160px;
    }
    
    .button-area {
        flex-direction: column;
        gap: 10px;
    }
    
    .draw-btn,
    .view-btn {
        padding: 12px 25px;
        font-size: 14px;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 65vh;
    }
    
    .sticks-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .stick-item {
        padding: 10px;
        font-size: 14px;
    }
    
    .bamboo-stick.drawn::after {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .decoration-left,
    .decoration-right {
        display: none;
    }
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #8b4513, #d4af37);
    color: #f4f1de;
    padding: 20px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid #d4af37;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 2px;
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #f4f1de;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(244, 241, 222, 0.2);
    transform: translateY(-50%) rotate(90deg);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 签条列表样式 */
.sticks-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.stick-item {
    background: linear-gradient(135deg, #f4e4a6, #e6d76f);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    color: #8b4513;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stick-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.stick-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #f9e79f, #f1c40f);
}

.stick-item:hover::before {
    left: 100%;
}

.stick-item.selected {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-color: #ff8c00;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
    animation: selectedGlow 1.5s ease-in-out infinite alternate;
}

@keyframes selectedGlow {
    from { box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4); }
    to { box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7); }
}

/* 中签签条显示样式 */
.bamboo-stick.drawn {
    transform: translateY(-30px) scale(1.2);
    background: linear-gradient(180deg, #ffd700, #ffed4e, #d4af37);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.6);
    animation: drawnStickGlow 2s ease-in-out infinite alternate;
    z-index: 10;
}

.bamboo-stick.drawn::after {
    content: attr(data-name);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f4e4a6, #e6d76f);
    color: #8b4513;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid #d4af37;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

@keyframes drawnStickGlow {
    from { box-shadow: 0 15px 30px rgba(212, 175, 55, 0.6); }
    to { box-shadow: 0 15px 40px rgba(212, 175, 55, 0.9); }
}

/* 特殊效果 */
.brush-holder.shaking {
    animation: holderShake 1s ease-in-out;
}

@keyframes holderShake {
    0%, 20%, 40%, 60%, 80%, 100% { transform: translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateY(-3px); }
} 