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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">🧧</text></svg>');
    background-size: 30px;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

header h1 {
    color: white;
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

main {
    padding: 30px;
}

.step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 25px;
    text-align: center;
}

.horse-selector, .role-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.horse-btn, .role-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.horse-btn:hover, .role-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #f5576c;
}

.horse-btn.selected, .role-btn.selected {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f5576c;
    color: white;
}

.horse-icon, .role-icon {
    font-size: 32px;
}

.horse-name, .role-name {
    font-size: 14px;
    font-weight: 500;
}

.selected-horse, .selected-role {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #555;
}

.selected-horse span, .selected-role span {
    font-weight: 600;
    color: #f5576c;
}

.action-btn, .back-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-btn {
    background: transparent;
    color: #999;
    margin-top: 10px;
    font-size: 14px;
}

.back-btn:hover {
    color: #666;
}

.shake-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.shake-btn {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 140, 0, 0.4);
}

.shake-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 140, 0, 0.5);
}

.shake-text {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.shake-stick {
    width: 8px;
    height: 60px;
    background: linear-gradient(to bottom, #8B4513, #A0522D);
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.shake-btn:hover .shake-stick {
    animation: stickShake 0.5s ease-in-out infinite;
}

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

.shaking-anim {
    text-align: center;
    padding: 40px;
}

.shake-animation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.bamboo-stick {
    width: 10px;
    height: 150px;
    background: linear-gradient(to bottom, #228B22, #32CD32);
    border-radius: 5px;
    position: relative;
}

.bamboo-stick::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 20px;
    background: #90EE90;
    border-radius: 50%;
}

.bamboo-stick::after {
    content: '';
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 20px;
    background: #90EE90;
    border-radius: 50%;
}

.stick1 {
    animation: shakeStick1 0.3s ease-in-out infinite;
}

.stick2 {
    animation: shakeStick2 0.3s ease-in-out infinite;
}

.stick3 {
    animation: shakeStick3 0.3s ease-in-out infinite;
}

@keyframes shakeStick1 {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-10px) rotate(-10deg); }
    75% { transform: translateX(10px) rotate(10deg); }
}

@keyframes shakeStick2 {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(10px) rotate(10deg); }
    75% { transform: translateX(-10px) rotate(-10deg); }
}

@keyframes shakeStick3 {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(5deg); }
    75% { transform: translateX(5px) rotate(-5deg); }
}

.shaking-anim p {
    font-size: 18px;
    color: #666;
    animation: pulse 1s ease-in-out infinite;
}

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

.result-card {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e1 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-emoji {
    font-size: 60px;
    margin-bottom: 10px;
}

.result-level {
    font-size: 28px;
    font-weight: 700;
    color: #f5576c;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.result-body {
    space-y: 20px;
}

.result-item {
    margin-bottom: 20px;
}

.result-label {
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
}

.result-value {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-value.keywords li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.result-value.keywords li::before {
    content: '✨';
    position: absolute;
    left: 0;
}

.result-value.hints li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.result-value.hints li::before {
    content: '🚩';
    position: absolute;
    left: 0;
}

.result-value.fortune-word {
    font-size: 18px;
    font-weight: 600;
    color: #f5576c;
    text-align: center;
    border-left: 4px solid #f5576c;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .horse-selector, .role-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .horse-btn, .role-btn {
        padding: 15px 8px;
    }

    .horse-icon, .role-icon {
        font-size: 24px;
    }

    .horse-name, .role-name {
        font-size: 12px;
    }

    header h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 18px;
    }

    .shake-btn {
        width: 160px;
        height: 160px;
    }

    .result-card {
        padding: 20px;
    }
}