/* 通用高亮样式 - 跨平台兼容版本 */
.highlight-word {
    background-color: #ffeb3b !important;
    color: #000 !important;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.sentence-highlight {
    background-color: rgba(255, 235, 59, 0.3) !important;
    border-left: 3px solid #ffc107;
    padding-left: 8px;
    transition: all 0.3s ease;
}

.reading-line {
    background-color: #ffeb3b !important;
    color: #000 !important;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.reading-line-chinese {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* 高亮动画效果 */
@keyframes word-highlight-pulse {
    0% {
        background-color: #ffeb3b;
        transform: scale(1);
    }
    50% {
        background-color: #ffc107;
        transform: scale(1.05);
    }
    100% {
        background-color: #ffeb3b;
        transform: scale(1);
    }
}

@keyframes sentence-highlight-fade {
    0% {
        background-color: rgba(255, 235, 59, 0.2);
    }
    50% {
        background-color: rgba(255, 235, 59, 0.4);
    }
    100% {
        background-color: rgba(255, 235, 59, 0.2);
    }
}

/* 激活状态的高亮 */
.highlight-word.active {
    animation: word-highlight-pulse 1s infinite;
}

.sentence-highlight.active {
    animation: sentence-highlight-fade 2s infinite;
}

/* 打印样式优化 */
@media print {
    .highlight-word,
    .sentence-highlight,
    .reading-line,
    .reading-line-chinese {
        background-color: #000 !important;
        color: #fff !important;
        border: 1px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* 确保中英对照打印为纯黑色 */
    .bilingual-print {
        color: #000 !important;
        background: #fff !important;
    }
    
    /* 调整段间距确保一页纸显示 */
    .speech-content {
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .chinese-text {
        margin-top: 4px;
        margin-bottom: 12px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .highlight-word {
        padding: 1px 3px;
        font-size: 0.9em;
    }
    
    .sentence-highlight {
        padding-left: 6px;
    }
    
    .reading-line,
    .reading-line-chinese {
        padding: 3px 6px;
        font-size: 0.95em;
    }
}

/* 强制颜色调整（针对某些浏览器） */
.force-highlight {
    background-color: #ffeb3b !important;
    color: #000 !important;
    box-shadow: 0 0 0 2px #ffeb3b !important;
}

/* 错误状态的高亮 */
.highlight-error {
    background-color: #ffcdd2 !important;
    color: #c62828 !important;
    border: 1px solid #f44336;
}

/* 成功状态的高亮 */
.highlight-success {
    background-color: #c8e6c9 !important;
    color: #2e7d32 !important;
    border: 1px solid #4caf50;
}