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

:root {
    --chinese-bg: #1a1a2e;
    --english-bg: #16213e;
    --chinese-accent: #00d4ff;
    --english-accent: #7b2cbf;
    --text-color: #fff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0f;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    width: 100dvw;
    background: linear-gradient(180deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
}

.language-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 30px 70px;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.language-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(123, 44, 191, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.chinese-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    transform: rotate(180deg);
}

.english-section {
    background: linear-gradient(135deg, #16213e 0%, #0d1b2a 100%);
    border-top: 1px solid rgba(123, 44, 191, 0.3);
}

.label {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-color);
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 5px;
}

.label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.text-display {
    width: 100%;
    max-width: 95%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    overflow-y: auto;
    padding: 10px 20px;
}

.text-display .placeholder {
    opacity: 0.3;
    font-weight: 300;
    color: var(--text-color);
    font-size: 14px;
}

.message {
    width: 100%;
    font-size: clamp(16px, 3vw, 22px);
    font-weight: 400;
    text-align: center;
    color: var(--text-color);
    word-wrap: break-word;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
}

.message.old {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.message.fadeOut {
    animation: fadeOut 0.3s ease-out forwards;
}

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

@keyframes pushDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(calc(100% + 12px));
    }
}

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

.controls {
    position: absolute;
    bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mic-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.mic-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.mic-btn:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.mic-btn:hover::before {
    opacity: 1;
}

.mic-btn:active {
    transform: scale(0.95);
}

.mic-btn.recording {
    border-color: #ff4757;
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 71, 87, 0.1) 100%);
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.5);
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 71, 87, 0.7);
    }
}

.mic-btn svg {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    min-height: 16px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.divider {
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.5) 20%, 
        rgba(123, 44, 191, 0.5) 50%, 
        transparent 100%);
    position: relative;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.divider-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0a0a0f 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider-line::after {
    content: '⟷';
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.language-section.chinese-section .label {
    color: var(--chinese-accent);
}

.language-section.english-section .label {
    color: var(--english-accent);
}

@media (max-width: 480px) {
    .text-display {
        width: 98%;
        max-width: 98%;
        padding: 8px 15px;
    }

    .mic-btn {
        width: 56px;
        height: 56px;
    }

    .label {
        font-size: 9px;
        top: 5px;
        left: 8px;
    }

    .controls {
        bottom: 25px;
        gap: 6px;
    }
}
