html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

/* 移动端优化的静态背景 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%);
    z-index: -1;
}

/* 只在桌面端显示动画背景 */
@media (min-width: 769px) {
    body::before {
        animation: backgroundShift 20s ease-in-out infinite;
    }
    
    @keyframes backgroundShift {
        0%, 100% {
            opacity: 0.8;
        }
        50% {
            opacity: 1;
        }
    }
}

.container {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    transition: all 0.3s ease;
    position: relative;
}

/* 只在桌面端显示微光效果 */
@media (min-width: 769px) {
    .container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, 
            transparent, 
            rgba(255, 255, 255, 0.8), 
            transparent);
        animation: shimmer 3s ease-in-out infinite;
    }

    @keyframes shimmer {
        0%, 100% {
            transform: translateX(-100%);
        }
        50% {
            transform: translateX(100%);
        }
    }
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}


.controls {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 80px;
}

.control-group label {
    font-size: 1.1em;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

select {
    padding: 16px 24px;
    border: 2px solid #e8f4fd;
    border-radius: 12px;
    font-size: 1.05em;
    background-color: #f8fcff;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23667eea%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%201-13%205.7H18.4c-5%200-9.3-1.8-12.9-5.7-3.6-3.9-5.4-8.5-5.4-13.9%200-5.4%201.8-10%205.4-13.9L132.4%203.3c3.6-3.9%208.2-5.9%2013.9-5.9s10.3%202%2013.9%205.9l114.3%20114.3c3.6%203.9%205.4%208.5%205.4%2013.9%200%205.4-1.8%2010-5.4%2013.9z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 14px;
    transition: all 0.3s ease;
    min-width: 160px;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

select:active {
    transform: scale(0.98);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 44px;
    border-radius: 15px;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    outline: none;
    margin-bottom: 35px;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

/* 简化的按钮发光效果 - 移动端优化 */
button::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6ec7, #7873f5, #4fc3f7, #ff6ec7);
    border-radius: 15px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    button:hover::after {
        opacity: 0.7;
    }
}

/* 按钮波纹效果 */
button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: width 0.6s ease, height 0.6s ease, top 0.6s ease, left 0.6s ease;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

button:active::before {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
}

/* 按钮悬停效果 */
button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* 按钮滚动状态 */
button.scrolling {
    background: linear-gradient(135deg, #e74c3c 0%, #ff6b6b 100%);
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 8px 25px rgba(231, 76, 60, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 12px 35px rgba(231, 76, 60, 0.6),
            0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    }
}

.result {
    margin-top: 20px;
}

.result p {
    font-size: 1.4em;
    color: #ffffff;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#restaurant-name {
    font-size: 2.8em;
    background: linear-gradient(135deg, #ff6b35 0%, #ff9ff3 50%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    min-height: 1.5em;
    display: flex;
    justify-content: center;
    align-items: center;
    word-break: break-word;
    padding: 20px;
    background-color: rgba(255, 248, 248, 0.9);
    border-radius: 20px;
    box-shadow: 
        0 8px 25px rgba(255, 107, 53, 0.25),
        0 0 0 1px rgba(255, 232, 232, 0.5) inset;
    border: 2px solid #ffe8e8;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.3));
}

/* 简化的结果展示区域发光效果 - 移动端优化 */
#restaurant-name::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #ffa502, #ff6348, #ff6b6b);
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

#restaurant-name:not(:empty)::before {
    opacity: 0.2;
}

#restaurant-name:not(:empty) {
    animation: fadeInScale 0.8s ease-out, bounce 0.6s ease-out 0.3s;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 滚动时的特殊效果 */
#restaurant-name.scrolling {
    animation: scrollEffect 0.15s ease-in-out infinite;
    background-color: rgba(255, 248, 248, 0.7);
}

@keyframes scrollEffect {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.02) rotate(0.5deg);
    }
    75% {
        transform: scale(1.02) rotate(-0.5deg);
    }
}

/* 最终结果的庆祝效果 */
#restaurant-name.celebrating {
    animation: celebrate 1s ease-out;
}

@keyframes celebrate {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(5deg);
    }
    50% {
        transform: scale(1.1) rotate(-3deg);
    }
    75% {
        transform: scale(1.15) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* 增强的响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 30px 25px;
        width: 90%;
        margin: 20px;
    }
    
    .controls {
        flex-direction: column;
        gap: 25px;
        align-items: center;
    }
    
    .control-group {
        width: 100%;
        max-width: 280px;
    }
    
    select {
        width: 100%;
        min-height: 50px;
        font-size: 1.1em;
    }
    
    button {
        width: 100%;
        max-width: 280px;
        min-height: 50px;
        font-size: 1.2em;
    }
    
    h1 {
        font-size: 2.4em;
        margin-bottom: 30px;
    }
    
    #restaurant-name {
        font-size: 2.2em;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px 20px;
        margin: 15px;
    }
    
    h1 {
        font-size: 2.0em;
        margin-bottom: 25px;
    }
    
    .controls {
        gap: 20px;
    }
    
    select {
        min-height: 48px;
        padding: 14px 20px;
    }
    
    button {
        min-height: 48px;
        padding: 16px 32px;
    }
    
    #restaurant-name {
        font-size: 1.8em;
        padding: 14px;
    }
}

/* 增强选择框样式 */
select {
    padding: 16px 24px;
    border: 2px solid #e8f4fd;
    border-radius: 12px;
    font-size: 1.05em;
    background: rgba(248, 252, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23667eea%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%201-13%205.7H18.4c-5%200-9.3-1.8-12.9-5.7-3.6-3.9-5.4-8.5-5.4-13.9%200-5.4%201.8-10%205.4-13.9L132.4%203.3c3.6-3.9%208.2-5.9%2013.9-5.9s10.3%202%2013.9%205.9l114.3%20114.3c3.6%203.9%205.4%208.5%205.4%2013.9%200%205.4-1.8%2010-5.4%2013.9z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 14px;
    transition: all 0.3s ease;
    min-width: 160px;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
    background: rgba(248, 252, 255, 0.95);
}

select:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.12);
}

select:active {
    transform: scale(0.98);
}

/* 增强标题动画 */
h1 {
    color: #ffffff;
    margin-bottom: 35px;
    font-size: 2.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 只在桌面端显示标题动画 */
@media (min-width: 769px) {
    h1 {
        animation: titleGlow 3s ease-in-out infinite alternate;
    }

    @keyframes titleGlow {
        0% {
            filter: brightness(1);
            transform: scale(1);
        }
        100% {
            filter: brightness(1.1);
            transform: scale(1.02);
        }
    }
}

/* 简化的控制组样式 - 移动端优化 */
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    position: relative;
}

@media (hover: hover) {
    .control-group::before {
        content: '';
        position: absolute;
        top: -5px;
        left: -5px;
        right: -5px;
        bottom: -5px;
        background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
        border-radius: 15px;
        opacity: 0;
        z-index: -1;
        transition: opacity 0.3s ease;
        background-size: 200% 200%;
        animation: controlGlow 4s ease infinite;
    }

    @keyframes controlGlow {
        0% {
            background-position: 0% 50%;
        }
        50% {
            background-position: 100% 50%;
        }
        100% {
            background-position: 0% 50%;
        }
    }

    .control-group:hover::before {
        opacity: 0.1;
    }
}

/* 添加页面加载动画 */
@keyframes containerEntry {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 防止文本选择和触控高亮 */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

input, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}
