* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
}

/* 全屏敏感词警告 */
.sensitive-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: flashBlackWhite 0.15s ease-in-out 6;
}

@keyframes flashBlackWhite {
    0%, 100% { background: #000; }
    50% { background: #fff; }
}

.sensitive-overlay .word {
    font-size: 20vw;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: invertColor 0.15s ease-in-out 6;
}

@keyframes invertColor {
    0%, 100% { color: #fff; }
    50% { color: #000; }
}

.container {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90vw;
}

/* 识别结果区域 - 主要 */
.result-container {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.85rem;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    flex-shrink: 0;
}

.status.listening::before {
    background: #38ef7d;
    animation: pulse 1s infinite;
}

.status.error::before {
    background: #eb3349;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.char-count {
    color: #999;
    font-size: 0.8rem;
}

.result-text {
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 14px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
}

.result-text .placeholder {
    color: #bbb;
    text-align: center;
    margin-top: 100px;
    font-size: 0.95rem;
}

.result-text .interim {
    color: #999;
    font-style: italic;
}

/* 敏感词高亮 */
.result-text .sensitive-word {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 控制按钮 - 次要 */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    touch-action: manipulation;
}

.btn .icon {
    font-size: 1rem;
}

.btn-start {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-start:active:not(:disabled) {
    transform: scale(0.96);
}

.btn-start:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-stop {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-stop:active:not(:disabled) {
    transform: scale(0.96);
}

.btn-stop:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-clear {
    background: #e0e0e0;
    color: #666;
    padding: 10px 14px;
}

.btn-clear:active {
    transform: scale(0.96);
}

/* 桌面端适配 */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        padding: 20px;
        width: 100%;
        max-width: 600px;
    }
    
    .result-text {
        min-height: 350px;
        max-height: 500px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* 滚动条样式 */
.result-text::-webkit-scrollbar {
    width: 4px;
}

.result-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.result-text::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* 小屏幕手机适配 */
@media (max-width: 360px) {
    .container {
        padding: 12px;
        width: 95vw;
    }
    
    .result-text {
        min-height: 250px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}
