/**
 * 粤语拼读练习应用程序样式 - 现代化设计
 */

/* 基础样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: #f8fafc;
    color: #1a202c;
    font-size: 14px;
}

/* 顶部导航栏 */
.top-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 0;
    box-shadow: 0 2px 20px rgba(102, 126, 234, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.app-info {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: white;
}

.app-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.nav-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px; /* 添加链接之间的间隔 */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.nav-icon {
    font-size: 16px;
}

.nav-text {
    font-size: 14px;
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.content-area {
    display: flex;
    flex-direction: column;
}

/* 布局容器 */
.layout-wrapper {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 200px);
}

/* 左侧输入区域 */
.input-sidebar {
    flex: 0 0 33.333%;
    min-width: 320px;
}

/* 右侧显示区域 */
.display-main {
    flex: 1;
    min-width: 0;
}

/* 调整输入区域样式 */
.input-sidebar .input-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.input-sidebar .input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-sidebar .input-wrapper textarea {
    flex: 1;
    min-height: 100px;
    max-height: 200px;
    height: 200px;
    resize: none;
    overflow-y: auto;
}

/* 调整显示区域样式 */
.display-main .display-card {
    height: calc(100vh - 150px);
    max-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 24px 24px 24px;
}

.display-main .section-header {
    padding: 10px 0 0 0;
    flex-shrink: 0;
    background: white;
    z-index: 10;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0;
    padding-bottom: 16px;
    position: sticky;
    top: 0;
}

.display-main .playback-progress {
    flex-shrink: 0;
    background: white;
    z-index: 9;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    margin: 0 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 80px; /* 调整到section-header下方 */
}

.display-main .sentence-container {
    flex: 1;
    min-height: 400px; /* 增加最小高度确保有滚动 */
    max-height: calc(100vh - 300px); /* 设置最大高度 */
    overflow-y: scroll !important;
    padding-right: 20px; /* 增加右边距为滚动条留出足够空间 */
    margin-right: -4px; /* 轻微负边距确保滚动条不会被截断 */
}

/* 卡片基础样式 */
.input-card,
.display-card,
.settings-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.3s ease;
}

.input-card:hover,
.display-card:hover,
.settings-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 输入区域头部样式 */
.section-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.section-header .section-title {
    margin-bottom: 0;
    flex-shrink: 0;
}

.section-header .custom-dropdown {
    flex-shrink: 0;
    min-width: 120px;
    max-width: 140px;
}

.section-header .dropdown-trigger {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 32px;
    border-radius: 6px;
}

.section-header .dropdown-text {
    font-size: 13px;
}

.section-header .dropdown-arrow {
    font-size: 10px;
    margin-left: 6px;
}

.section-header .dropdown-menu {
    font-size: 13px;
    max-height: 250px;
    border-radius: 6px;
}

.section-header .dropdown-item {
    padding: 6px 10px;
    font-size: 13px;
}

.section-header .dropdown-section-title {
    padding: 6px 10px;
    font-size: 11px;
}

.input-helpers {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.helper-select {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.helper-select:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.helper-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.helper-select option {
    padding: 8px;
}

/* 内联播放控制样式 */
.playback-controls-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.playback-controls-inline .control-buttons {
    display: flex;
    gap: 8px;
}

.playback-controls-inline .control-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4a5568;
    min-width: auto;
}

.playback-controls-inline .control-btn:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.playback-controls-inline .control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.playback-controls-inline .control-btn.play-stop-btn:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transition: all 0.3s ease;
}

.playback-controls-inline .control-btn.play-stop-btn:hover:not(:disabled) {
    background: #5a67d8;
    border-color: #5a67d8;
}

/* 当按钮处于停止状态时的样式 */
.playback-controls-inline .control-btn.play-stop-btn.stop-btn:not(:disabled) {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

.playback-controls-inline .control-btn.play-stop-btn.stop-btn:hover:not(:disabled) {
    background: #e53e3e;
    border-color: #e53e3e;
}

/* 保持原有的单独按钮样式以兼容其他地方 */
.playback-controls-inline .control-btn.play-btn:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.playback-controls-inline .control-btn.play-btn:hover:not(:disabled) {
    background: #5a67d8;
    border-color: #5a67d8;
}

.playback-controls-inline .control-btn.stop-btn:not(:disabled) {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

.playback-controls-inline .control-btn.stop-btn:hover:not(:disabled) {
    background: #e53e3e;
    border-color: #e53e3e;
}

.playback-controls-inline .control-btn.voice-btn:not(:disabled) {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.playback-controls-inline .control-btn.voice-btn:hover:not(:disabled) {
    background: #38a169;
    border-color: #38a169;
}

.playback-controls-inline .control-btn.voice-download-btn:not(:disabled) {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.playback-controls-inline .control-btn.voice-download-btn:hover:not(:disabled) {
    background: #2c5282;
    border-color: #2c5282;
}

.playback-controls-inline .control-btn.pause-btn:not(:disabled) {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

.playback-controls-inline .control-btn.pause-btn:hover:not(:disabled) {
    background: #e53e3e;
    border-color: #e53e3e;
}

.playback-controls-inline .btn-icon {
    font-size: 14px;
}

.playback-controls-inline .btn-text {
    font-size: 12px;
    font-weight: 500;
}

/* 处理指示器样式 */
.processing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    font-size: 12px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.processing-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.processing-text {
    white-space: nowrap;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 声调可视化样式 */
.tone-line {
    display: inline-block;
    width: 8px;
    height: 12px;
    vertical-align: text-top;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    margin-left: 1px;
}

.character-item:hover .tone-line {
    opacity: 1;
}

/* 不同声调的颜色 - 更鲜明的颜色区分 */
.character-item[data-jyutping*="1"] .tone-line path {
    stroke: #dc2626; /* 阴平 - 鲜红色 */
    stroke-width: 2;
}

.character-item[data-jyutping*="2"] .tone-line path {
    stroke: #ea580c; /* 阴上 - 橙红色 */
    stroke-width: 2;
}

.character-item[data-jyutping*="3"] .tone-line path {
    stroke: #d97706; /* 阴去 - 橙黄色 */
    stroke-width: 2;
}

.character-item[data-jyutping*="4"] .tone-line path {
    stroke: #16a34a; /* 阳平 - 绿色 */
    stroke-width: 2;
}

.character-item[data-jyutping*="5"] .tone-line path {
    stroke: #2563eb; /* 阳上 - 蓝色 */
    stroke-width: 2;
}

.character-item[data-jyutping*="6"] .tone-line path {
    stroke: #9333ea; /* 阴入 - 紫色 */
    stroke-width: 2;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tone-line {
        height: 10px;
        margin-left: 2px;
    }
    
    .character-item[data-jyutping*="1"] .tone-line path,
    .character-item[data-jyutping*="2"] .tone-line path,
    .character-item[data-jyutping*="3"] .tone-line path,
    .character-item[data-jyutping*="4"] .tone-line path,
    .character-item[data-jyutping*="5"] .tone-line path,
    .character-item[data-jyutping*="6"] .tone-line path {
        stroke-width: 1.5;
    }
}

/* 多音字纠错复选框样式 */
.polyphone-control {
    display: flex;
    align-items: center;
    margin-left: 16px;
}

.polyphone-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #4a5568;
    user-select: none;
}

.polyphone-checkbox {
    margin-right: 6px;
    cursor: pointer;
}

.polyphone-text {
    white-space: nowrap;
}

.polyphone-label:hover {
    color: #2d3748;
}

/* 播放进度条样式调整 */
.playback-progress {
    margin: 8px 0;
    padding: 0;
}

/* 输入区域的拼读模式控制 */
.processing-mode-control {
    flex-shrink: 0;
}

.processing-mode-control .setting-label {
    font-size: 14px;
    color: #4a5568;
    white-space: nowrap;
    margin: 0;
}

.mode-toggle-group {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px;
    border: none;
    background: white;
    color: #4a5568;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.mode-toggle-btn:last-child {
    border-right: none;
}

.mode-toggle-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.mode-toggle-btn.active {
    background: #667eea;
    color: white;
}

.mode-toggle-btn.active:hover {
    background: #5a67d8;
}

.mode-icon {
    font-size: 14px;
}

.mode-text {
    font-weight: 500;
}

/* 多音字纠错控制 */
.polyphone-correction-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
}

.polyphone-correction-control .setting-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    margin: 0;
}

.setting-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    position: relative;
}

.setting-checkbox:hover {
    border-color: #cbd5e0;
}

.setting-checkbox:checked {
    background: #667eea;
    border-color: #667eea;
}

.setting-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.setting-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 播放区域的设置控制 */
.playback-settings {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: 16px;
}

.voice-control,
.speed-control,
.polyphone-correction-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.voice-control .setting-label,
.speed-control .setting-label,
.polyphone-correction-control .setting-label {
    font-size: 13px;
    color: #4a5568;
    white-space: nowrap;
    margin: 0;
}

.voice-control .setting-select {
    min-width: 140px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #4a5568;
}

.speed-control .speed-slider {
    width: 80px;
    margin: 0;
}

.speed-control .speed-value {
    font-size: 12px;
    color: #4a5568;
    min-width: 40px;
    text-align: center;
}

.polyphone-correction-control .setting-checkbox {
    margin-right: 4px;
    transform: scale(1.1);
}

/* 更新内联播放控制布局 */
.playback-controls-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* 输入区域样式 */
.input-wrapper textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.input-actions {
    justify-content: space-between !important;
    display: flex;
    align-items: center;
    width: 100%;
}

.primary-button {
    background: crimson;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 2px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.primary-button .btn-icon {
    font-size: 16px;
    line-height: 1;
}

.primary-button .btn-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.secondary-button {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.secondary-button:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.char-counter {
    color: #718096;
    font-size: 13px;
    font-weight: 500;
}

.input-hint {
    margin-top: 12px;
    color: #718096;
    font-size: 13px;
}

/* 美化滚动条 - 确保滚动条始终可见 */
.sentence-container {
    /* 强制显示滚动条 */
    overflow-y: scroll !important;
    scrollbar-width: auto; /* Firefox */
    scrollbar-color: #718096 #f1f5f9; /* Firefox */
}

.sentence-container::-webkit-scrollbar {
    width: 16px !important;
    background: #f8fafc !important;
}

.sentence-container::-webkit-scrollbar-track {
    background: #e2e8f0 !important;
    border-radius: 8px !important;
    margin: 2px 0 !important;
}

.sentence-container::-webkit-scrollbar-thumb {
    background: #718096 !important;
    border-radius: 8px !important;
    border: 2px solid #f8fafc !important;
    min-height: 40px !important;
}

.sentence-container::-webkit-scrollbar-thumb:hover {
    background: #4a5568 !important;
}

.sentence-container::-webkit-scrollbar-thumb:active {
    background: #2d3748 !important;
}

/* 强制滚动条显示 - 备用样式 */
#sentenceContainer {
    overflow-y: scroll !important;
    scrollbar-width: auto !important;
}

#sentenceContainer::-webkit-scrollbar {
    width: 18px !important;
    background-color: #f1f5f9 !important;
    border-radius: 0 !important;
}

#sentenceContainer::-webkit-scrollbar-track {
    background-color: #e2e8f0 !important;
    border-radius: 0 !important;
}

#sentenceContainer::-webkit-scrollbar-thumb {
    background-color: #718096 !important;
    border-radius: 9px !important;
    border: 3px solid #f1f5f9 !important;
}

#sentenceContainer::-webkit-scrollbar-thumb:hover {
    background-color: #4a5568 !important;
}

/* 确保空状态时也显示滚动条 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #a0aec0;
    text-align: center;
    min-height: 500px; /* 确保有足够高度触发滚动 */
}

/* 全局强制滚动条显示 */
* {
    scrollbar-width: auto;
}

/* 特别针对句子容器的滚动条 */
div[id="sentenceContainer"] {
    overflow-y: scroll !important;
}

div[id="sentenceContainer"]::-webkit-scrollbar {
    width: 16px !important;
    background: #f8fafc !important;
    display: block !important;
}

div[id="sentenceContainer"]::-webkit-scrollbar-track {
    background: #e2e8f0 !important;
    border-radius: 8px !important;
}

div[id="sentenceContainer"]::-webkit-scrollbar-thumb {
    background: #718096 !important;
    border-radius: 8px !important;
    border: 2px solid #f8fafc !important;
}

div[id="sentenceContainer"]::-webkit-scrollbar-thumb:hover {
    background: #4a5568 !important;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.sentence-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sentence-item:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.sentence-item.highlighted {
    background: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.sentence-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sentence-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sentence-number {
    background: beige;
    color: black;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.characters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
    flex: 1;
}

.sentence-text {
    font-size: 16px;
    line-height: 1.4;
    color: #2d3748;
    flex: 1;
}

.jyutping-placeholder {
    font-size: 13px;
    color: #a0aec0;
    font-style: italic;
    margin-left: 36px; /* 对齐到句子编号后面 */
}

/* 播放控制区域 */
.playback-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.control-btn:hover:not(:disabled) {
    background: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

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

.control-btn.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.control-btn.play-btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-size: 12px;
    font-weight: 500;
}

.playback-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-info-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.progress-info {
    flex: 1;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.4;
}

.copy-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.copy-btn {
    padding: 4px 12px;
    font-size: 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
}

.copy-btn:active {
    background: #e2e8f0;
    transform: translateY(1px);
}

.copy-btn.success {
    background: #c6f6d5;
    border-color: #9ae6b4;
    color: #22543d;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-info {
    text-align: center;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
}

/* 设置区域 */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.setting-row.inline-controls {
    justify-content: space-between;
    align-items: flex-start;
}

.setting-label {
    font-weight: 500;
    color: #4a5568;
    min-width: 80px;
    font-size: 14px;
}

.setting-select {
    flex: 1;
    max-width: 300px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.speed-slider {
    flex: 1;
    max-width: 150px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.speed-value {
    min-width: 50px;
    text-align: center;
    font-weight: 500;
    color: #4a5568;
    background: #f7fafc;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

/* 字符显示样式 */
.characters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
    margin-top: 8px;
}

.character-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 28px;
    position: relative;
}

.character-item.chinese {
    background: #f0f4f8;
    border-radius: 6px;
    padding: 1px;
    transition: all 0.2s ease;
}

.character-item.chinese.has-jyutping {
    background: #e6fffa;
}

.character-item.chinese[data-clickable="true"] {
    cursor: pointer;
}

.character-item.chinese[data-clickable="true"]:hover {
    background: #bee3f8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.character-item.chinese[data-clickable="true"]:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
}

.character {
    font-size: 18px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.2;
    user-select: none;
}

.jyutping {
    font-size: 11px;
    color: #718096;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    margin-bottom: 2px;
    line-height: 1;
    user-select: none;
}

/* 加载和错误提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    min-width: 300px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #fed7d7;
    color: #c53030;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.2);
    z-index: 10000;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #feb2b2;
}

.error-toast .close-btn {
    background: none;
    border: none;
    color: #c53030;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    opacity: 0.7;
}

.error-toast .close-btn:hover {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        max-width: none;
        padding: 20px;
    }
    
    .layout-wrapper {
        gap: 20px;
    }
    
    .input-sidebar {
        flex: 0 0 35%;
        min-width: 300px;
    }
}

@media (max-width: 1024px) {
    .layout-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .input-sidebar {
        flex: none;
        min-width: auto;
    }
    
    .display-main {
        flex: none;
    }
    
    .display-main .display-card {
        height: calc(100vh - 200px);
        max-height: calc(100vh - 200px);
    }
    
    .display-main .section-header {
        padding-bottom: 12px;
        position: sticky;
        top: 0;
    }
    
    .display-main .playback-progress {
        padding: 6px 0;
        margin: 0 0 6px 0;
        position: sticky;
        top: 70px; /* 调整移动端的top值 */
    }
    
    .progress-info-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .copy-buttons {
        justify-content: center;
    }
    
    .copy-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .input-sidebar .input-wrapper textarea {
        min-height: 200px;
        max-height: 200px;
        height: 200px;
    }
    
    .display-main .sentence-container {
        min-height: 200px;
        max-height: none;
        padding-right: 14px; /* 移动端适当的右边距 */
        overflow-y: scroll !important;
    }
}

@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 0 16px;
    }
    
    .navbar-right {
        gap: 8px; /* 移动端减少间隔 */
    }
    
    .main-container {
        padding: 16px;
    }
    
    .layout-wrapper {
        gap: 16px;
    }
    
    .input-card,
    .display-card {
        padding: 20px;
    }
    
    .input-sidebar .input-wrapper textarea {
        min-height: 150px;
        max-height: 150px;
        height: 150px;
    }
    
    .display-main .section-header {
        position: sticky;
        top: 0;
    }
    
    .display-main .playback-progress {
        position: sticky;
        top: 60px; /* 移动端调整top值 */
    }
    
    .display-main .sentence-container {
        padding-right: 10px; /* 移动端增加右边距 */
    }
    
    /* 移动端滚动条样式调整 - 确保可见性 */
    .sentence-container {
        overflow-y: scroll !important;
        padding-right: 12px; /* 移动端增加右边距 */
    }
    
    .sentence-container::-webkit-scrollbar {
        width: 10px;
        background: #f8fafc;
    }
    
    .sentence-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 5px;
        border: 1px solid #e2e8f0;
    }
    
    .sentence-container::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #a0aec0 0%, #718096 100%);
        border-radius: 5px;
        border: 1px solid #f1f5f9;
        min-height: 25px;
    }
    
    .sentence-container::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #718096 0%, #4a5568 100%);
    }
    
    /* 多音字纠错控制栏移动端适配 */
    .correction-mode-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .correction-mode-info {
        justify-content: center;
        text-align: center;
        font-size: 13px;
    }
    
    .correction-mode-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .mode-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 70px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .input-helpers {
        flex-direction: column;
        gap: 8px;
    }
    
    .helper-select,
    .custom-dropdown {
        flex: none;
        min-width: auto;
    }
    
    .dropdown-menu {
        left: -10px;
        right: -10px;
        max-height: 250px;
    }
    
    .dropdown-item-text {
        font-size: 13px;
    }
    
    .dropdown-item-meta {
        font-size: 10px;
    }
    
    .playback-controls-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .playback-settings {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .voice-control,
    .speed-control,
    .polyphone-correction-control {
        justify-content: space-between;
    }
    
    .processing-mode-control {
        flex-direction: column;
        align-items: stretch;
        margin-right: 0;
        margin-bottom: 12px;
        gap: 8px;
    }
    
    .mode-toggle-group {
        width: 100%;
    }
    
    .mode-toggle-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }
    
    .playback-controls-inline .control-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px; /* 稍微增加间距 */
    }
    
    .playback-controls-inline .control-btn {
        flex: 0 1 auto; /* 改为自适应大小，不强制拉伸 */
        min-width: 0;
        justify-content: center;
        padding: 8px 12px; /* 调整内边距 */
        font-size: 11px; /* 稍微减小字体以适应移动端 */
    }

    /* 多音字复选框在移动端的样式 */
    .polyphone-control {
        margin-left: 0;
        margin-top: 8px;
        justify-content: center;
        width: 100%;
    }

    .polyphone-label {
        font-size: 12px;
    }
    
    .input-footer {
        display: flex;
        justify-content: space-between; /* 重要：两端对齐 */
        align-items: center;
        margin-top: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .input-actions {
        display: flex;
        justify-content: space-between; /* 内部也两端对齐 */
        align-items: center;
        width: 100%;    
    }
    
    .input-actions {
        justify-content: center;
    }
    
    .char-counter {
        text-align: center;
    }
    
    .control-buttons {
        gap: 12px;
    }
    
    .control-btn {
        min-width: 70px;
        padding: 12px 16px;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .setting-row.inline-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .speed-control {
        min-width: auto;
        flex-direction: column;
        gap: 8px;
    }
    
    .speed-slider {
        max-width: none;
        width: 100%;
    }
    
    .checkbox-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .setting-label {
        min-width: auto;
        text-align: left;
    }
    
    .setting-select {
        max-width: none;
        width: 100%;
    }
    
    /* 句子显示响应式 */
    .sentence-header {
        gap: 8px;
    }
    
    .sentence-number {
        font-size: 11px;
        padding: 3px 6px;
        min-width: 20px;
    }
    
    .characters-container {
        gap: 4px;
    }
    
    .character-item {
        min-width: 25px;
    }
    
    .character {
        font-size: 16px;
    }
    
    .jyutping {
        font-size: 10px;
    }
    
    .jyutping-placeholder {
        margin-left: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 18px;
    }
    
    .app-subtitle {
        font-size: 13px;
    }
    
    .main-container {
        padding: 12px;
    }
    
    .input-card,
    .display-card,
    .settings-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .control-buttons {
        flex-direction: row; /* 改为水平排列 */
        flex-wrap: wrap; /* 允许换行 */
        justify-content: center;
        gap: 8px; /* 减小间距以适应移动端 */
    }
    
    .control-btn {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        padding: 10px 12px; /* 调整内边距 */
        font-size: 12px; /* 稍微减小字体 */
        flex: 0 1 auto; /* 不强制拉伸，自适应内容 */
    }
    
    .btn-text {
        font-size: 14px;
    }
    
    /* 播放控制按钮的移动端样式 */
    .playback-controls-inline .btn-icon {
        font-size: 12px;
    }

    .playback-controls-inline .btn-text {
        font-size: 10px;
        font-weight: 500;
    }
    
    .primary-button .btn-icon {
        font-size: 14px;
    }
    
    .primary-button .btn-text {
        font-size: 13px;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .error-toast {
        left: 12px;
        right: 12px;
        max-width: none;
    }
    
    /* 超小屏幕句子显示 */
    .sentence-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .sentence-header {
        gap: 6px;
    }
    
    .sentence-number {
        font-size: 10px;
        padding: 2px 5px;
        min-width: 18px;
    }
    
    .character {
        font-size: 15px;
    }
    
    .jyutping {
        font-size: 9px;
    }
    
    .sentence-text {
        font-size: 15px;
    }
    
    .jyutping-placeholder {
        margin-left: 24px;
        font-size: 11px;
    }
}

/* 自定义历史记录下拉框 */
.custom-dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
}

.dropdown-trigger:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.dropdown-trigger.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dropdown-text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-arrow {
    font-size: 12px;
    color: #718096;
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.dropdown-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.dropdown-section {
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-section-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8fafc;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f7fafc;
}

.dropdown-item.danger {
    color: #e53e3e;
}

.dropdown-item.danger:hover {
    background: #fed7d7;
}

.dropdown-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dropdown-item-text {
    font-size: 14px;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-meta {
    font-size: 11px;
    color: #718096;
    margin-top: 2px;
}

.dropdown-item.danger .dropdown-item-text {
    color: #e53e3e;
}

.dropdown-item-delete {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.dropdown-item:hover .dropdown-item-delete {
    opacity: 1;
}

.dropdown-item-delete:hover {
    background: #fed7d7;
    color: #c53030;
}

.dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.dropdown-empty-icon {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #edf2f7;
    color: #2d3748;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 历史记录统计 */
.history-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 14px;
    color: #4a5568;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #2b6cb0;
}

/* 历史记录操作按钮 */
.history-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.danger-button {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.danger-button:hover:not(:disabled) {
    background: #c53030;
    transform: translateY(-1px);
}

.danger-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* 自定义确认对话框样式 */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.custom-confirm-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.custom-confirm-header {
    background: #f8fafc;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.custom-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-confirm-body {
    padding: 20px 24px;
}

.custom-confirm-message {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 16px;
}

.custom-confirm-text-preview {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    color: #2d3748;
    max-height: 80px;
    overflow-y: auto;
    word-break: break-all;
    font-family: inherit;
}

.custom-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    background: #f8fafc;
}

.custom-confirm-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 80px;
}

.custom-confirm-btn-cancel {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.custom-confirm-btn-cancel:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.custom-confirm-btn-delete {
    background: #dc3545;
    color: white;
}

.custom-confirm-btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式设计 - 确认对话框 */
@media (max-width: 480px) {
    .custom-confirm-dialog {
        max-width: none;
        margin: 0 16px;
    }
    
    .custom-confirm-header,
    .custom-confirm-body,
    .custom-confirm-actions {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .custom-confirm-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .custom-confirm-btn {
        width: 100%;
    }
}

/* 快捷历史记录样式 */
.quick-history-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.quick-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quick-history-title {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.quick-history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.manage-history-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manage-history-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.manage-icon {
    font-size: 12px;
}

.manage-text {
    font-size: 11px;
}

.quick-history-hide-btn {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.quick-history-hide-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.quick-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e6fffa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.quick-history-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-history-item-text {
    flex: 1;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.quick-history-item-delete {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.quick-history-item:hover .quick-history-item-delete {
    opacity: 1;
}

.quick-history-item-delete:hover {
    background: #fed7d7;
    color: #c53030;
}

.quick-history-empty {
    text-align: center;
    color: #a0aec0;
    font-size: 12px;
    padding: 12px;
    font-style: italic;
}

/* 响应式设计 - 快捷历史记录 */
@media (max-width: 768px) {
    .quick-history-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .quick-history-title {
        font-size: 12px;
    }
    
    .quick-history-item {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .quick-history-item-delete {
        font-size: 13px;
    }
}

/* 历史记录列表 */
.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: #f7fafc;
}

.history-item.selected {
    background: #ebf8ff;
    border-color: #bee3f8;
}

.history-checkbox {
    margin-right: 12px;
    cursor: pointer;
}

.history-text {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
    line-height: 1.4;
}

.history-meta {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.history-delete {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
    opacity: 0;
}

.history-item:hover .history-delete {
    opacity: 1;
}

.history-delete:hover {
    background: #fed7d7;
    color: #c53030;
}

/* 空状态 */
.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.history-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .history-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .history-actions {
        flex-direction: column;
    }
    
    .history-actions button {
        width: 100%;
    }
    
    .history-controls {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .helper-select {
        width: 100%;
    }
}

/* ===== 多音字纠错样式 ===== */

/* 多音字纠错模式控制栏 */
.correction-mode-bar {
    background: #fef5e7;
    border: 1px solid #f6ad55;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease-out;
}

.correction-mode-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c05621;
    font-size: 14px;
    font-weight: 500;
}

.correction-icon {
    font-size: 16px;
    animation: rotate 2s linear infinite;
}

.correction-text {
    flex: 1;
}

.correction-mode-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mode-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mode-btn.primary {
    background: #ed8936;
    color: white;
}

.mode-btn.primary:hover {
    background: #dd7324;
    transform: translateY(-1px);
}

.mode-btn.secondary {
    background: white;
    color: #c05621;
    border: 1px solid #f6ad55;
}

.mode-btn.secondary:hover {
    background: #fef5e7;
    border-color: #ed8936;
}

.mode-btn.tertiary {
    background: transparent;
    color: #a0aec0;
    border: 1px solid #e2e8f0;
}

.mode-btn.tertiary:hover {
    background: #f7fafc;
    color: #718096;
}

.mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(237, 137, 54, 0.7);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 0 10px rgba(237, 137, 54, 0);
    }
}

/* 多音字标识 */
.character-item.polyphone {
    border: 2px dashed #f6ad55;
    background: #fffbf0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-item.polyphone:hover {
    border-color: #ed8936;
    background: #fef5e7;
    transform: scale(1.05);
}

.character-item.polyphone::after {
    content: "🔄";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    background: #f6ad55;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 词汇中的多音字（确定读音） */
.character-item.polyphone-in-word {
    border: 2px solid #3182ce;
    background: #ebf8ff;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-item.polyphone-in-word:hover {
    border-color: #2c5282;
    background: #bee3f8;
    transform: scale(1.05);
}

.character-item.polyphone-in-word::after {
    content: "📖";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    background: #3182ce;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.character-item.corrected {
    border: 2px solid #48bb78;
    background: #f0fff4;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-item.corrected:hover {
    border-color: #38a169;
    background: #c6f6d5;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.character-item.corrected::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    background: #48bb78;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 多音字纠错弹窗 */
.polyphone-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.polyphone-popup .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.polyphone-popup .correction-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 320px;
    max-width: 400px;
    animation: popupSlideIn 0.2s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.polyphone-popup .popup-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.polyphone-popup .popup-character {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.polyphone-popup .popup-subtitle {
    font-size: 14px;
    color: #718096;
    margin-left: 8px;
}

.polyphone-popup .popup-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.polyphone-popup .popup-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.polyphone-popup .alternatives-list {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.polyphone-popup .alternative-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    outline: none;
}

.polyphone-popup .alternative-item:last-child {
    margin-bottom: 0;
}

.polyphone-popup .alternative-item:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.polyphone-popup .alternative-item.active {
    background: #ebf8ff;
    border-color: #3182ce;
}

.polyphone-popup .alternative-item.corrected {
    border-color: #48bb78;
    background: #f0fff4;
}

.polyphone-popup .alternative-jyutping {
    font-size: 18px;
    font-weight: 600;
    color: #3182ce;
    min-width: 80px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.polyphone-popup .alternative-meaning {
    flex: 1;
    color: #4a5568;
    font-size: 14px;
    margin: 0 12px;
}

.polyphone-popup .alternative-frequency {
    font-size: 12px;
    color: #718096;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
}

.polyphone-popup .alternative-item.active .alternative-frequency {
    background: #bee3f8;
    color: #2b6cb0;
}

.polyphone-popup .alternative-item.corrected .alternative-frequency {
    background: #c6f6d5;
    color: #276749;
}

.polyphone-popup .popup-actions {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.polyphone-popup .popup-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.polyphone-popup .popup-btn.primary {
    background: #3182ce;
    color: white;
}

.polyphone-popup .popup-btn.primary:hover {
    background: #2c5282;
}

.polyphone-popup .popup-btn.secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.polyphone-popup .popup-btn.secondary:hover {
    background: #edf2f7;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .polyphone-popup .correction-popup {
        width: 95%;
        max-width: none;
        min-width: auto;
    }
    
    .polyphone-popup .popup-header {
        padding: 16px;
    }
    
    .polyphone-popup .popup-character {
        font-size: 20px;
    }
    
    .polyphone-popup .popup-subtitle {
        font-size: 12px;
    }
    
    .polyphone-popup .alternatives-list {
        padding: 12px;
    }
    
    .polyphone-popup .alternative-item {
        padding: 10px;
    }
    
    .polyphone-popup .alternative-jyutping {
        font-size: 16px;
        min-width: 60px;
    }
    
    .polyphone-popup .alternative-meaning {
        font-size: 13px;
        margin: 0 8px;
    }
    
    .polyphone-popup .popup-actions {
        padding: 12px 16px;
    }
}

/* 声调波形弹出窗口 */
.waveform-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px; /* 增加最大宽度以支持长句子 */
    min-width: 700px;  /* 增加最小宽度 */
    min-height: 450px; /* 设置最小高度 */
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease;
    transition: width 0.3s ease, height 0.3s ease; /* 添加尺寸变化动画 */
}

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

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    text-align: center;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 8px 0;
}

.modal-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: #475569;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
}

.waveform-canvas {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.waveform-info {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #10b981;
}

.waveform-info p {
    margin: 0 0 8px 0;
    color: #4a5568;
    font-size: 14px;
}

.waveform-tip {
    font-size: 12px !important;
    color: #64748b !important;
    font-style: italic;
    margin-bottom: 12px !important;
    opacity: 0.8;
}

/* 重听按钮样式 */
.replay-waveform-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: fadeInUp 0.5s ease;
    margin-right: 12px; /* 为全句播放按钮留出间距 */
}

.replay-waveform-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.replay-waveform-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.replay-icon {
    font-size: 16px;
    animation: none;
    transition: transform 0.3s ease;
}

.replay-waveform-btn:hover .replay-icon {
    transform: rotate(180deg);
}

.replay-text {
    font-size: 14px;
}

/* 全句播放按钮样式 */
.play-full-sentence-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    animation: fadeInUp 0.5s ease 0.1s both; /* 稍微延迟显示 */
}

.play-full-sentence-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.play-full-sentence-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.play-full-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.play-full-sentence-btn:hover .play-full-icon {
    transform: scale(1.1);
}

.play-full-text {
    font-size: 14px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 波形动画 */
.waveform-animating #waveformPath {
    opacity: 1;
}

/* 字符独立波形路径样式 */
.character-waveform-path {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 全句连续波形路径样式 */
.full-sentence-waveform-path {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 字符标记样式 */
.character-marker {
    opacity: 0;
    animation-fill-mode: forwards;
}

.tone-label {
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.character-marker circle {
    stroke: white;
    stroke-width: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.character-marker text {
    fill: white;
    font-size: 16px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

/* 粤拼文字样式 */
.jyutping-text {
    fill: #64748b;
    font-size: 10px;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: central;
    font-family: 'Courier New', monospace;
    pointer-events: none;
}

/* 含义文字样式 */
.meaning-text {
    fill: #4a5568;
    font-size: 11px;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: central;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
}

.meaning-text:hover {
    fill: #3b82f6 !important;
    font-weight: bold !important;
}

/* 含义背景样式 */
.meaning-bg {
    fill: transparent;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
}

.meaning-bg:hover {
    fill: rgba(59, 130, 246, 0.1) !important;
}

/* 声调标签动画 */
.tone-label {
    animation: slideInFromTop 0.6s ease;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 句子行点击提示样式 */
.sentence-row {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.sentence-row:hover {
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        min-width: auto; /* 移动端取消最小宽度限制 */
        min-height: 400px; /* 移动端最小高度 */
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px 20px 12px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .waveform-canvas {
        padding: 16px;
    }
    
    #waveformSvg {
        height: 190px;
        min-width: auto; /* 移动端取消最小宽度限制 */
    }
    
    .character-marker text {
        font-size: 14px;
    }
    
    .jyutping-text {
        font-size: 9px !important;
    }
    
    .meaning-text {
        font-size: 10px !important;
    }
    
    .character-marker circle {
        r: 16;
    }
    
    .sentence-row:hover::after {
        display: none; /* 移动端隐藏悬停提示 */
    }
    
    /* 移动端按钮样式调整 */
    .replay-waveform-btn,
    .play-full-sentence-btn {
        padding: 8px 16px;
        font-size: 12px;
        margin-right: 8px;
    }
    
    .replay-text,
    .play-full-text {
        font-size: 12px;
    }
    
    .replay-icon,
    .play-full-icon {
        font-size: 14px;
    }
}
/* 波形按钮样式 */
.waveform-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.8; /* 改为默认可见，便于调试 */
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    z-index: 10;
}

.waveform-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    opacity: 1;
}

.waveform-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* 句子行悬停时显示波形按钮 */
.sentence-row:hover .waveform-btn {
    opacity: 1;
}

/* 句子头部需要相对定位以便波形按钮绝对定位 */
.sentence-header {
    position: relative;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .waveform-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        right: 8px;
    }
    
    /* 移动端始终显示波形按钮 */
    .sentence-row .waveform-btn {
        opacity: 0.7;
    }
    
    .sentence-row:hover .waveform-btn,
    .sentence-row .waveform-btn:hover {
        opacity: 1;
    }
}


/* ========================================
   示例选择区域样式（树形结构）
   ======================================== */

.example-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.example-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.example-section-title {
    font-size: 13px;
    font-weight: 600;
}

.example-section-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.example-section-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 示例内容区 - 树形结构 */
.example-content {
    max-height: 320px;
    overflow-y: auto;
    background: white;
}

/* 树形分类 */
.example-tree-category {
    border-bottom: 1px solid #e2e8f0;
}

.example-tree-category:last-child {
    border-bottom: none;
}

.example-tree-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.example-tree-header:hover {
    background: #f0f4ff;
}

.example-tree-category.expanded .example-tree-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tree-toggle {
    font-size: 10px;
    color: #667eea;
    width: 14px;
    text-align: center;
    transition: transform 0.2s ease;
}

.category-icon {
    font-size: 16px;
}

.category-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
}

.category-count {
    font-size: 11px;
    color: #a0aec0;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 树形示例项容器 */
.example-tree-items {
    background: #fafbfc;
}

/* 树形示例项 */
.example-tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 8px 36px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.example-tree-item:last-child {
    border-bottom: none;
}

.example-tree-item:hover {
    background: #e8f0fe;
}

.example-tree-item.hot {
    background: #fff8f8;
}

.example-tree-item.hot:hover {
    background: #ffefef;
}

.example-tree-item .example-title {
    font-size: 13px;
    color: #4a5568;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.example-tree-item:hover .example-title {
    color: #667eea;
}

.example-tags {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.example-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

.example-tag.hot {
    background: transparent;
}

.example-tag.difficulty {
    background: #e2e8f0;
    color: #4a5568;
}

.example-tag.difficulty.beginner {
    background: #c6f6d5;
    color: #276749;
}

.example-tag.difficulty.intermediate {
    background: #feebc8;
    color: #c05621;
}

.example-tag.difficulty.advanced {
    background: #e9d8fd;
    color: #6b46c1;
}
