/* 基础样式 */
:root {
    --primary-color: #d62839;
    --secondary-color: #8c271e;
    --accent-color: #f9a03f;
    --background-color: #f8f9fa;
    --text-color: #333;
    --card-bg: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* 主题颜色变量 */
    --traditional-primary: #d62839;
    --traditional-secondary: #8c271e;
    --traditional-accent: #f9a03f;
    --traditional-bg: #f8f9fa;
    
    --modern-primary: #3a86ff;
    --modern-secondary: #0077b6;
    --modern-accent: #48cae4;
    --modern-bg: #f0f5f9;
    
    --dream-primary: #9d4edd;
    --dream-secondary: #7b2cbf;
    --dream-accent: #c77dff;
    --dream-bg: #f7f2ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:active {
    background-color: var(--secondary-color);
    transform: scale(0.98);
}

.secondary-btn {
    background-color: #eee;
    color: var(--text-color);
}

.secondary-btn:active {
    background-color: #ddd;
    transform: scale(0.98);
}

.danger-btn {
    background-color: #dc3545;
    color: white;
}

.premium-btn {
    background-color: var(--accent-color);
    color: white;
}

/* 签筒区域 */
.fortune-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    flex: 1;
}

.bucket-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.fortune-bucket {
    position: relative;
    width: 200px;
    height: 250px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    margin-bottom: 1rem;
}

.bucket-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sticks-container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 100px;
    display: flex;
    justify-content: center;
}

.fortune-stick {
    position: relative;
    width: 30px;
    min-height: 180px;
    background-color: #f4e9d2;
    border-radius: 2px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    margin: 0 auto;
}

.fortune-text {
    writing-mode: vertical-rl;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    color: var(--secondary-color);
}

.bucket-instructions {
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin-top: 0.5rem;
}

/* 结果和解读区域 */
.fortune-result, .fortune-interpretation {
    width: 100%;
    max-width: 350px;
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.fortune-actions, .interpretation-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.interpretation-content {
    margin: 1rem 0;
    line-height: 1.8;
    font-size: 1rem;
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background-color: var(--card-bg);
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    position: sticky;
    bottom: 0;
    margin-top: 1rem;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem;
    flex: 1;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* 历史记录页面 */
.page {
    width: 100%;
    padding: 1rem 0;
}

.history-list {
    margin: 1rem 0 2rem;
}

.history-item {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    color: #777;
    font-size: 0.8rem;
}

.history-fortune {
    font-weight: 500;
    margin: 0.5rem 0;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
}

/* 设置页面 */
.settings-group {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.settings-group h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.theme-options, .fortune-type-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.theme-option, .fortune-type {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background-color: #eee;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.theme-option.active, .fortune-type.active {
    background-color: var(--primary-color);
    color: white;
}

.settings-description {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #777;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    width: 90%;
    max-width: 350px;
}

.share-image-preview {
    width: 100%;
    height: 200px;
    background-color: #eee;
    border-radius: 10px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-options {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
}

.share-option i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* 广告容器 */
.ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    z-index: 900;
    display: none;
}

.ad-content {
    width: 100%;
    height: 80px;
    background-color: #eee;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-ad-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #777;
    cursor: pointer;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 主题样式 */
body.traditional {
    --primary-color: var(--traditional-primary);
    --secondary-color: var(--traditional-secondary);
    --accent-color: var(--traditional-accent);
    --background-color: var(--traditional-bg);
}

body.modern {
    --primary-color: var(--modern-primary);
    --secondary-color: var(--modern-secondary);
    --accent-color: var(--modern-accent);
    --background-color: var(--modern-bg);
}

body.dream {
    --primary-color: var(--dream-primary);
    --secondary-color: var(--dream-secondary);
    --accent-color: var(--dream-accent);
    --background-color: var(--dream-bg);
}

/* 响应式样式 */
@media (min-width: 768px) {
    .app-container {
        max-width: 500px;
    }
    
    .fortune-bucket {
        width: 250px;
        height: 300px;
    }
    
    .fortune-result, .fortune-interpretation {
        max-width: 450px;
    }
}

/* 动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes fallDown {
    0% { 
        transform: translateY(-50px); 
        opacity: 0;
    }
    100% { 
        transform: translateY(0); 
        opacity: 1;
    }
}

.fall-down {
    animation: fallDown 0.8s ease-out forwards;
}
