/* ========================================
   内容重复率检测工具 - 专用样式
   ======================================== */

/* ========== 1. 输入区样式 ========== */
.detector-input-section {
    margin-bottom: 2rem;
}

.input-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.input-card label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.content-textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.content-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-metrics {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
}

.input-metrics span {
    font-size: 0.875rem;
    color: #666;
}

/* ========== 2. 配置选项区样式 ========== */
.detector-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.option-group {
    flex: 1;
    min-width: 250px;
}

.option-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

/* 滑块组 */
.slider-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.slider-value {
    font-weight: 600;
    color: #667eea;
    min-width: 30px;
    text-align: center;
}

/* 复选框组 */
.checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* ========== 3. 操作按钮样式 ========== */
.detector-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* ========== 4. 加载中提示 ========== */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 1.1rem;
    color: #667eea;
}

.loading-indicator i {
    margin-right: 0.5rem;
}

/* ========== 5. 重复率仪表盘样式 ========== */
.duplicate-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.dashboard-main {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.dashboard-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.dashboard-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.dashboard-bar-fill {
    height: 100%;
    background: white;
    border-radius: 6px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.dashboard-bar-fill.rate-low {
    background: #4caf50;
}

.dashboard-bar-fill.rate-medium {
    background: #ff9800;
}

.dashboard-bar-fill.rate-high {
    background: #f44336;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ========== 6. 高亮显示区样式 ========== */
.highlight-section {
    margin-bottom: 2rem;
}

.highlight-section h3 {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 1rem;
}

.highlight-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.level-2 {
    background-color: rgba(255, 235, 59, 0.5);
    border: 2px solid #FBC02D;
}

.legend-color.level-3 {
    background-color: rgba(255, 152, 0, 0.5);
    border: 2px solid #F57C00;
}

.legend-color.level-5 {
    background-color: rgba(244, 67, 54, 0.5);
    border: 2px solid #D32F2F;
}

.highlighted-text {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    line-height: 2;
    font-size: 1rem;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 高亮等级样式 */
.highlight-level-2 {
    background-color: rgba(255, 235, 59, 0.3);
    border-bottom: 2px solid #FBC02D;
    padding: 2px 0;
}

.highlight-level-3 {
    background-color: rgba(255, 152, 0, 0.3);
    border-bottom: 2px solid #F57C00;
    padding: 2px 0;
}

.highlight-level-5 {
    background-color: rgba(244, 67, 54, 0.3);
    border-bottom: 2px solid #D32F2F;
    padding: 2px 0;
}

/* ========== 7. 重复详情列表样式 ========== */
.duplicate-details {
    margin-bottom: 2rem;
}

.duplicate-details h3 {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 1rem;
}

.duplicate-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.duplicate-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.duplicate-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.duplicate-index {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
}

.duplicate-content {
    flex: 1;
}

.duplicate-text {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.6;
    word-break: break-word;
}

.duplicate-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #666;
}

.duplicate-count {
    font-weight: 600;
    color: #667eea;
}

.no-duplicates,
.more-duplicates {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1rem;
}

/* ========== 8. 响应式设计 ========== */
@media (max-width: 768px) {
    /* 配置选项垂直排列 */
    .detector-options {
        flex-direction: column;
    }

    .option-group {
        min-width: 100%;
    }

    /* 仪表盘统计单列显示 */
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-value {
        font-size: 2.5rem;
    }

    /* 按钮全宽 */
    .detector-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* 重复项索引缩小 */
    .duplicate-index {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .duplicate-item {
        padding: 1rem;
    }

    /* 输入框调整 */
    .content-textarea {
        min-height: 200px;
        font-size: 13px;
    }

    .input-metrics {
        flex-wrap: wrap;
    }

    /* 高亮文本调整 */
    .highlighted-text {
        padding: 1rem;
        font-size: 0.9rem;
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    /* 更小屏幕的额外调整 */
    .dashboard-value {
        font-size: 2rem;
    }

    .duplicate-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========== 9. 滚动条美化 ========== */
.highlighted-text::-webkit-scrollbar {
    width: 8px;
}

.highlighted-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.highlighted-text::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.highlighted-text::-webkit-scrollbar-thumb:hover {
    background: #555;
}
