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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 初始页面样式 */
.initial-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.5s ease;
}

.initial-content {
    text-align: center;
    max-width: 90%;
    animation: fadeIn 1s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.initial-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.btn-enter {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
    margin-top: 30px;
}

.initial-image:hover {
    transform: scale(1.02);
}

.btn-enter {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.btn-enter:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(79, 172, 254, 0.4);
}

/* 隐藏类 */
.hidden {
    display: none;
}

/* 过渡动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.decibel-display {
    text-align: center;
    margin-bottom: 30px;
}

.emoji-section {
    margin-bottom: 20px;
}

.emoji {
    font-size: 8rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.status {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.value-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.decibel-value {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.decibel-level {
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-save {
    background: #28a745;
    color: white;
    width: 100%;
    margin-top: 15px;
}

.btn-save:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-pause {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: white;
}

.btn-pause:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(247, 151, 30, 0.4);
}

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

.settings {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.settings h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.setting-group label {
    min-width: 120px;
    font-weight: 600;
    color: #555;
}

.setting-group input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
}

.setting-group input:focus {
    outline: none;
    border-color: #4facfe;
}

footer {
    background: #f8f9fa;
    text-align: center;
    padding: 20px;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

.state-quiet {
    color: #28a745;
}

.state-noisy {
    color: #ffc107;
}

.state-loud {
    color: #dc3545;
}

.bg-quiet {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.bg-noisy {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.bg-loud {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .emoji {
        font-size: 6rem;
    }
    
    .decibel-value {
        font-size: 2.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .setting-group label {
        min-width: auto;
    }
    
    .setting-group input {
        width: 100px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px;
    }

    .emoji {
        font-size: 5rem;
    }

    .decibel-value {
        font-size: 2rem;
    }

    .status {
        font-size: 1.1rem;
    }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}