* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f7f9fc;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
}

#status {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 15px;
    min-height: 20px;
}

.btn-box {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

button {
    color: white;
    border: none;
    padding: 14px 24px;
    font-size: 15px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.hidden {
    display: none;
}

#micButton {
    background-color: #4f46e5;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

#micButton:hover:not(:disabled) {
    background-color: #4338ca;
    transform: translateY(-1px);
}

#micButton.recording {
    background-color: #dc2626;
    animation: pulse 1.5s infinite;
}

#pauseButton {
    background-color: #f59e0b;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

#pauseButton:hover:not(:disabled) {
    background-color: #d97706;
}

#pauseButton.paused {
    background-color: #10b981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.result-section {
    margin-top: 15px;
}

.label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 600;
}

.box {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    min-height: 40px;
    word-break: break-word;
    margin-bottom: 15px;
    line-height: 1.5;
    white-space: pre-wrap;  /* 保留換行 */
}

.box.translated {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* 響應式 */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .container {
        padding: 18px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    button {
        padding: 12px 20px;
        font-size: 14px;
    }
}
