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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8dfd4 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #8b4513;
    margin-bottom: 10px;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
}

.fortune-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 2;
    border-radius: 10px;
    background: linear-gradient(180deg, #faf8f5 0%, #f0ebe3 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#fortuneCanvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.cylinder-overlay {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
    width: 23%;
    height: 50%;
}

.cylinder-bottom {
    width: 100%;
    height: 12%;
    background: linear-gradient(180deg, #4a3015 0%, #654321 100%);
    border-radius: 0 0 6px 6px;
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cylinder-body {
    width: 100%;
    height: 76%;
    background: linear-gradient(90deg, #5c3d1e 0%, #8b4513 20%, #8b4513 80%, #5c3d1e 100%);
    position: relative;
    border-left: 2px solid #4a3015;
    border-right: 2px solid #4a3015;
}

.cylinder-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        rgba(139, 69, 19, 0.3) 8px,
        rgba(139, 69, 19, 0.3) 10px
    );
    opacity: 0.4;
}

.cylinder-top {
    width: 100%;
    height: 12%;
    background: linear-gradient(180deg, #654321 0%, #8b4513 100%);
    border-radius: 6px 6px 0 0;
    margin: 0 auto;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.3);
}

.controls {
    display: flex;
    gap: 20px;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #8b8b8b 0%, #6b6b6b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 139, 139, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 139, 139, 0.5);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.result-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90%;
    max-width: 400px;
    background: linear-gradient(135deg, #faf8f5 0%, #f0ebe3 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 30px;
    z-index: 1000;
    animation: cardAppear 0.5s ease;
}

.result-card.hidden {
    display: none;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #d4af37;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.result-title {
    font-size: 1.5rem;
    color: #8b4513;
    font-weight: bold;
}

.card-body {
    text-align: center;
}

.fortune-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
    padding: 15px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
}

.philosophy {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    line-height: 1.6;
    padding: 15px;
    background: rgba(139, 69, 19, 0.05);
    border-left: 4px solid #d4af37;
    border-radius: 0 10px 10px 0;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.sign-item {
    position: absolute;
    width: 15px;
    height: 100px;
    background: linear-gradient(90deg, #f5deb3 0%, #fff8dc 50%, #f5deb3 100%);
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: #8b4513;
    font-weight: bold;
}

@media (max-width: 600px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    .canvas-wrapper {
        width: 90%;
        max-width: 280px;
    }
    
    .controls {
        flex-direction: column;
        width: 90%;
        max-width: 280px;
        gap: 15px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .fortune-container {
        gap: 20px;
    }
}