/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

:root {
    --primary-blue: #2A5CAA;
    --secondary-blue: #87CEEB;
    --success-green: #4CAF50;
    --warning-orange: #FFA500;
    --error-red: #FF5252;
    --text-dark: #333;
    --text-light: #FFF;
    --bg-light: #F8F9FA;
}

body {
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--primary-blue);
    color: var(--text-light);
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    
    h1 {
        font-size: 2.4rem;
        margin-bottom: 1.2rem;
        font-weight: 700;
        letter-spacing: 1px;
    }
    
    .header-images {
        display: flex;
        justify-content: center;
        gap: 2rem;
        margin-top: 1.5rem;
        
        img {
            width: 70px;
            height: 70px;
            filter: brightness(0) invert(1);
            transition: transform 0.3s ease;
            
            &:hover {
                transform: scale(1.1);
            }
        }
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.control-panel {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
    flex-wrap: wrap;

    .main-btn {
        padding: 1.8rem 3.5rem;
        font-size: 1.3rem;
        background: var(--primary-blue);
        color: var(--text-light);
        border: none;
        border-radius: 50px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: inline-flex;
        align-items: center;
        gap: 1rem;
        box-shadow: 0 4px 15px rgba(42,92,170,0.3);
        
        &:hover {
            background: #1d4a87;
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(42,92,170,0.4);
        }
        
        img {
            width: 32px;
            height: 32px;
            filter: brightness(0) invert(1);
        }
    }
}

.result-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    
    .result-card {
        background: var(--text-light);
        border-radius: 15px;
        padding: 2.5rem;
        box-shadow: 0 4px 25px rgba(0,0,0,0.08);
        
        h2 {
            color: var(--primary-blue);
            margin-bottom: 2rem;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.8rem;
            
            &::before {
                content: '';
                width: 8px;
                height: 25px;
                background: var(--primary-blue);
                border-radius: 4px;
            }
        }
        
        .result-box {
            min-height: 220px;
            background: var(--bg-light);
            border-radius: 12px;
            padding: 2rem;
            font-size: 1.2rem;
            line-height: 1.8;
            color: var(--text-dark);
        }
    }
}

/* ===== 修改后的进度条样式 ===== */
.progress-container {
  position: relative;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* 增加进度条与百分比之间的间距 */
}

.progress-bar {
  height: 20px;
  width: 100%; /* 宽度调整为100% */
  background: #E0E0E0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-blue);
  border-radius: 10px;
  transition: width 0.8s ease;
}

#accuracyValue {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  text-align: center;
  width: 100%;
  margin-top: 1rem; /* 增加上边距 */
}

.realtime-feedback {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.real-time-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 60px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #d32f2f;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .control-panel {
        gap: 1.5rem;
        margin: 2rem 0;
        
        .main-btn {
            padding: 1.2rem 2.5rem;
            font-size: 1.1rem;
        }
    }
    
    .result-container {
        grid-template-columns: 1fr;
        
        .result-card {
            padding: 1.5rem;
        }
    }
    
    #accuracyValue {
        font-size: 2.5rem;
    }
}

/* 正确答案渐现动画 */
#correctAnswerText {
  transition: opacity 0.5s ease;
  opacity: 0;
}

/* 结果对比布局优化 */
.comparison-container {
  display: grid;
  gap: 1rem;
}

.answer-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.label {
  font-weight: 600;
  color: var(--primary-blue);
}

.text {
  flex: 1;
  word-break: break-all;
}

/* 动态卡片效果 */
.result-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.result-card-enter {
  opacity: 0;
  transform: scale(0.9);
}

.result-card-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: all 0.3s ease-out;
}

/* 实时识别动画 */
.real-time-content {
  position: relative;
  min-height: 80px;
}

.final {
  font-size: 1.4rem;
  color: var(--primary-blue);
  animation: textScale 0.5s ease;
}

.interim {
  color: #666;
  opacity: 0.8;
  animation: fadeInUp 0.5s ease;
}

@keyframes textScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 0.8; }
}

/* 进度条动效 */
.progress-fill {
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.5s ease;
}

/* 按钮交互优化 */
.main-btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.main-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background: rgba(255,255,255,0.1);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.6s ease;
}

.main-btn:active::after {
  transform: translate(-50%, -50%) scale(1);
}
/* 输入框动效 */
#userInputText, #correctAnswerText {
  transition: all 0.3s ease;
  min-height: 60px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* 高亮匹配文本 */
.text-match {
  background: #dfffdf;
  padding: 2px 4px;
  border-radius: 4px;
}

/* 禁用按钮状态 */
.main-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.8);
}
