@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* 背景模糊效果 */
body.blur-background::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 999;
    pointer-events: none;
    animation: fadeIn 0.3s ease-out;
}

/* 移除之前存在的椭圆形蒙层样式 */
body::before, body::after {
    display: none !important;
}

:root {
    --primary-color: #FF5E7D;
    --secondary-color: #6C63FF;
    --accent-color: #FFC107;
    --background-color: #F3F0FF;
    --text-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --wheel-border: #E0E5EC;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    background-image: linear-gradient(135deg, #f9f7ff 0%, #f0f5ff 50%, #f8f0ff 100%);
    position: relative;
    border-radius: 0 !important; /* 确保没有边框半径 */
}

/* 修改结果弹窗样式，确保不被遮挡 */
.result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* 增大z-index确保在最上层 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    backdrop-filter: blur(8px);
}

.result.active {
    opacity: 1;
    visibility: visible;
}

.result-content {
    background: #FFFFFF;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.result-header {
    margin-bottom: 1.8rem;
    position: relative;
}

.result-header h3 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    letter-spacing: 1px;
    background: -webkit-linear-gradient(45deg, var(--primary-color), #FF9671);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 10px;
    display: inline-block;
}

.crown-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFC107"><path d="M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm14 3c0 .6-.4 1-1 1H6c-.6 0-1-.4-1-1v-1h14v1z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    animation: crown-shine 2s infinite alternate;
}

@keyframes crown-shine {
    0% {
        filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.8));
    }
}

.result.active .result-content {
    transform: scale(1);
    animation: celebrate 0.8s ease-out;
}

@keyframes pop {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes celebrate {
    0% {
        transform: scale(0.8);
    }
    40% {
        transform: scale(1.08);
    }
    60% {
        transform: scale(0.98);
    }
    80% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.result-logo {
    width: 140px;
    height: 140px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 4px solid white;
    position: relative;
    animation: logoSpin 1s ease-out, logoGlow 2s infinite alternate;
}

.result-logo img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 50%;
}

.text-logo {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--primary-color), #FF9671);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.result-name {
    font-size: 2.4rem;
    margin-bottom: 2rem;
    color: #222222;
    font-weight: bold;
    position: relative;
    display: inline-block;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.result-name::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #FF9671);
    border-radius: 4px;
}

.close-button {
    background: linear-gradient(145deg, #f5f5f5, #e0e0e0);
    color: #222;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.close-button:hover {
    background: linear-gradient(145deg, #f0f0f0, #e5e5e5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.close-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 添加页脚样式 */
footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--secondary-color);
    font-weight: 500;
    opacity: 0.8;
    animation: fadeIn 1.5s ease-in-out;
}

footer p {
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.header-decoration {
    position: relative;
    width: 120px;
    height: 10px;
    margin: 10px auto 0;
}

.header-decoration::before, .header-decoration::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

.header-decoration::before {
    left: 0;
}

.header-decoration::after {
    right: 0;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .wheel-container {
        max-width: 95%;
    }
    
    .result-content {
        width: 90%;
        padding: 2rem;
    }
    
    .result-logo {
        width: 120px;
        height: 120px;
    }
    
    .result-name {
        font-size: 1.8rem;
    }
    
    .result-header h3 {
        font-size: 1.6rem;
    }
    
    .close-button {
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }
}

/* 添加优雅的动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatBubble {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 30px) scale(1.2);
    }
    100% {
        transform: translate(20px, 60px) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .spin-button {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }
    
    .result-logo {
        width: 100px;
        height: 100px;
    }
    
    .result-name {
        font-size: 1.5rem;
    }
    
    .result-header h3 {
        font-size: 1.4rem;
    }
    
    .close-button {
        padding: 0.7rem 1.8rem;
        font-size: 1rem;
    }
}

@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .result-logo img[src^="data:"] {
            image-rendering: -webkit-optimize-contrast;
        }
    }
}

/* 结果logo发光效果 */
.result-logo::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 94, 125, 0.3) 30%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: expandGlow 2s infinite alternate;
}

@keyframes expandGlow {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

@keyframes logoSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoGlow {
    0% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 5px 25px rgba(255, 94, 125, 0.6);
    }
}

/* 添加回按钮样式 */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* 页面装饰元素 */
.decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    z-index: -1;
    opacity: 0.6;
}

.decoration:nth-child(1) {
    top: 10%;
    left: 10%;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: float 8s infinite ease-in-out;
}

.decoration:nth-child(2) {
    top: 15%;
    right: 15%;
    background-color: var(--secondary-color);
    border-radius: 4px;
    transform: rotate(45deg);
    animation: spin 15s infinite linear;
}

.decoration:nth-child(3) {
    bottom: 10%;
    left: 20%;
    background-color: var(--accent-color);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: float 12s infinite ease-in-out reverse;
}

.decoration:nth-child(4) {
    bottom: 15%;
    right: 10%;
    background-color: #87D4BE;
    border-radius: 50%;
    animation: pulse 5s infinite alternate;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease-in-out;
    position: relative;
    padding: 0 1rem;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    text-shadow: 3px 3px 6px var(--shadow-color);
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.subtitle {
    font-size: 1.4rem;
    color: var(--secondary-color);
    opacity: 0.9;
    font-weight: 500;
    margin-top: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.wheel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    perspective: 1000px;
    margin: 0 auto;
    position: relative;
    padding: 20px 0;
    max-width: 90%;
    width: 500px;
    animation: fadeIn 1s ease-out;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 保持宽高比 1:1 */
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

/* 添加光泽效果 */
.shine-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%);
    z-index: 5;
    pointer-events: none;
}

.controls {
    margin-top: 2rem;
    text-align: center;
}

.spin-button {
    background: linear-gradient(145deg, #FF5F6D, #FF9671);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 95, 109, 0.4);
    position: relative;
    overflow: hidden;
    font-weight: bold;
    letter-spacing: 1px;
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 5px 15px rgba(255, 95, 109, 0.4);
    }
    50% {
        box-shadow: 0 5px 30px rgba(255, 95, 109, 0.8);
    }
    100% {
        box-shadow: 0 5px 15px rgba(255, 95, 109, 0.4);
    }
}

.spin-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 95, 109, 0.7);
    background: linear-gradient(145deg, #FF5F6D, #FFA07A);
}

.spin-button:active,
.spin-button-clicked {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 95, 109, 0.3);
}

/* 添加按钮点击波纹效果 */
.spin-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.7);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.spin-button:focus:not(:active)::after {
    animation: ripple 1.2s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.7;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        transform: scale(45, 45);
    }
}

/* 添加缺失的pulse动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}
