/**
 * 刮削配置组件样式 - ScrapeConfig
 * 
 * 与 auto-scrape.html 样式完全一致的赛博朋克风格配置面板
 */

/* ==================== 配置卡片 ==================== */

.sc-card {
    background: var(--glass-bg, rgba(30, 30, 45, 0.8));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.sc-title {
    font-size: var(--text-lg, 18px);
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-title svg {
    width: 20px;
    height: 20px;
    color: var(--neon-cyan, #00f5ff);
}

.sc-hint {
    font-size: var(--text-xs, 12px);
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 149, 0, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--warning-color, #FF9500);
    line-height: 1.5;
}

/* ==================== 数据源列表 ==================== */

.sc-source-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.sc-source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.sc-source-item:hover {
    border-color: var(--text-tertiary, rgba(255, 255, 255, 0.3));
}

.sc-source-item.selected {
    border-color: var(--neon-cyan, #00f5ff);
    background: rgba(0, 255, 255, 0.05);
}

.sc-source-item.selected.primary {
    border-color: var(--neon-pink, #ff00ff);
    background: rgba(255, 0, 255, 0.05);
}

.sc-source-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.sc-source-item.selected .sc-source-checkbox {
    background: var(--neon-cyan, #00f5ff);
    border-color: var(--neon-cyan, #00f5ff);
}

.sc-source-item.selected.primary .sc-source-checkbox {
    background: var(--neon-pink, #ff00ff);
    border-color: var(--neon-pink, #ff00ff);
}

.sc-source-checkbox svg {
    width: 14px;
    height: 14px;
    color: var(--bg-primary, #0a0a0f);
    opacity: 0;
    transition: opacity 0.2s;
}

.sc-source-item.selected .sc-source-checkbox svg {
    opacity: 1;
}

.sc-source-info {
    flex: 1;
    min-width: 0;
}

.sc-source-name {
    font-size: var(--text-sm, 14px);
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.sc-source-desc {
    font-size: var(--text-xs, 12px);
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    margin-top: 2px;
}

.sc-source-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--neon-pink, #ff00ff);
    color: white;
    font-weight: 600;
    display: none;
}

.sc-source-item.primary .sc-source-badge {
    display: inline-block;
}

/* ==================== 字段选项 ==================== */

.sc-field-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.sc-field-option {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sc-field-option:hover {
    border-color: var(--text-tertiary, rgba(255, 255, 255, 0.3));
}

.sc-field-option.active {
    border-color: var(--neon-purple, #8b5cf6);
    background: rgba(138, 43, 226, 0.05);
}

.sc-field-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.2));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sc-field-option.active .sc-field-checkbox {
    background: var(--neon-purple, #8b5cf6);
    border-color: var(--neon-purple, #8b5cf6);
}

.sc-field-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.sc-field-option.active .sc-field-checkbox svg {
    opacity: 1;
}

.sc-field-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm, 14px);
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.sc-field-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan, #00f5ff);
    opacity: 0.8;
    transition: all 0.2s ease;
}

.sc-field-icon svg {
    width: 100%;
    height: 100%;
}

.sc-field-option.active .sc-field-icon {
    color: var(--neon-purple, #8b5cf6);
    opacity: 1;
    filter: drop-shadow(0 0 4px var(--neon-purple, #8b5cf6));
}

/* ==================== 选项行 ==================== */

.sc-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.sc-option-row:last-child {
    border-bottom: none;
}

.sc-option-column {
    flex-direction: column;
    align-items: stretch;
}

.sc-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sc-option-label {
    font-size: var(--text-sm, 14px);
    color: var(--text-primary, #ffffff);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.sc-edit-keywords-link {
    margin-left: 8px;
    color: var(--neon-cyan, #00f5ff);
    font-size: var(--text-xs, 12px);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    opacity: 0.8;
}

.sc-edit-keywords-link:hover {
    opacity: 1;
    text-shadow: 0 0 8px var(--neon-cyan, #00f5ff);
}

.sc-edit-keywords-link:active {
    opacity: 0.6;
}

.sc-option-desc {
    font-size: var(--text-xs, 12px);
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
}

/* ==================== 开关样式 ==================== */

.sc-toggle {
    width: 50px;
    height: 28px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sc-toggle.active {
    background: var(--neon-cyan, #00f5ff);
}

.sc-toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sc-toggle.active::after {
    left: 25px;
}

/* ==================== 置信度滑块 ==================== */

.sc-confidence-value {
    font-size: var(--text-lg, 18px);
    font-weight: 600;
    color: var(--neon-cyan, #00f5ff);
}

.sc-slider-container {
    width: 100%;
}

.sc-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, 
        var(--neon-cyan, #00f5ff) 0%, 
        var(--neon-purple, #8b5cf6) 70%, 
        var(--bg-tertiary, rgba(255, 255, 255, 0.1)) 70%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

/* Firefox 需要单独设置轨道样式 */
.sc-slider::-moz-range-track {
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.sc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--neon-cyan, #00f5ff), var(--neon-purple, #8b5cf6));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 245, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 15px rgba(0, 245, 255, 0.6);
}

.sc-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--neon-cyan, #00f5ff), var(--neon-purple, #8b5cf6));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 245, 255, 0.4);
}

.sc-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: var(--text-xs, 12px);
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
}

/* ==================== 响应式 ==================== */

@media (max-width: 360px) {
    .sc-field-options {
        grid-template-columns: 1fr;
    }
}

/* ==================== 紧凑模式（弹窗使用） ==================== */

/* 区块样式 */
.sc-compact .sc-section {
    margin-bottom: 16px;
}

.sc-compact .sc-section:last-child {
    margin-bottom: 0;
}

.sc-compact .sc-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 数据源标签容器 */
.sc-compact .sc-source-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 数据源标签 */
.sc-compact .sc-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.sc-compact .sc-source-tag:hover {
    border-color: var(--text-tertiary, rgba(255, 255, 255, 0.3));
}

.sc-compact .sc-source-tag.selected {
    border-color: var(--neon-cyan, #00f5ff);
    background: rgba(0, 255, 255, 0.1);
}

.sc-compact .sc-source-tag.selected.primary {
    border-color: var(--neon-pink, #ff00ff);
    background: rgba(255, 0, 255, 0.1);
}

.sc-compact .sc-tag-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    transition: all 0.2s;
}

.sc-compact .sc-source-tag.selected .sc-tag-check {
    background: var(--neon-cyan, #00f5ff);
    border-color: var(--neon-cyan, #00f5ff);
}

.sc-compact .sc-source-tag.selected.primary .sc-tag-check {
    background: var(--neon-pink, #ff00ff);
    border-color: var(--neon-pink, #ff00ff);
}

.sc-compact .sc-tag-check svg {
    width: 10px;
    height: 10px;
    color: var(--bg-primary, #0a0a0f);
    opacity: 0;
    transition: opacity 0.2s;
}

.sc-compact .sc-source-tag.selected .sc-tag-check svg {
    opacity: 1;
}

.sc-compact .sc-tag-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

/* 字段标签容器 */
.sc-compact .sc-field-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 字段标签 */
.sc-compact .sc-field-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.sc-compact .sc-field-tag:hover {
    border-color: var(--text-tertiary, rgba(255, 255, 255, 0.3));
}

.sc-compact .sc-field-tag.active {
    border-color: var(--neon-purple, #8b5cf6);
    background: rgba(138, 43, 226, 0.1);
}

.sc-compact .sc-field-tag .sc-tag-check {
    border-radius: 4px;
}

.sc-compact .sc-field-tag.active .sc-tag-check {
    background: var(--neon-purple, #8b5cf6);
    border-color: var(--neon-purple, #8b5cf6);
}

.sc-compact .sc-field-tag.active .sc-tag-check svg {
    opacity: 1;
}

/* 紧凑选项行 */
.sc-compact .sc-compact-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.sc-compact .sc-compact-option:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sc-compact .sc-compact-option:first-child {
    padding-top: 0;
}

.sc-compact .sc-compact-label {
    font-size: 13px;
    color: var(--text-primary, #ffffff);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* 紧凑滑块 */
.sc-compact .sc-compact-slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 180px;
}

.sc-compact .sc-compact-slider-wrap .sc-slider {
    flex: 1;
    height: 6px;
}

.sc-compact .sc-compact-slider-wrap .sc-slider::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
}

.sc-compact .sc-compact-slider-wrap .sc-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
}

.sc-compact .sc-confidence-value {
    font-size: 13px;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

/* 紧凑开关 */
.sc-compact .sc-toggle {
    width: 44px;
    height: 24px;
}

.sc-compact .sc-toggle::after {
    width: 18px;
    height: 18px;
}

.sc-compact .sc-toggle.active::after {
    left: 23px;
}

/* ==================== 双语歌词格式选项（普通模式 - 触发器） ==================== */

.sc-bilingual-trigger {
    cursor: pointer;
    transition: all 0.2s;
}

.sc-bilingual-trigger:hover {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.03));
}

.sc-bilingual-trigger:active {
    transform: scale(0.99);
}

.sc-bilingual-current {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--neon-cyan, #00f5ff);
}

.sc-bilingual-current-text {
    font-size: var(--text-sm, 14px);
    font-weight: 500;
}

.sc-bilingual-current svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* ==================== 双语歌词底部弹窗 ==================== */

.sc-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sc-sheet-overlay.active {
    opacity: 1;
}

.sc-sheet-content {
    width: 100%;
    max-width: 500px;
    background: var(--bg-secondary, #12121a);
    border-radius: 20px 20px 0 0;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sc-sheet-overlay.active .sc-sheet-content {
    transform: translateY(0);
}

.sc-sheet-header {
    text-align: center;
    margin-bottom: 20px;
}

.sc-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.sc-sheet-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.sc-sheet-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.sc-sheet-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--bg-tertiary, #1a1a24);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sc-sheet-option:active {
    transform: scale(0.98);
}

.sc-sheet-option.active {
    border-color: var(--neon-cyan, #00f5ff);
    background: color-mix(in srgb, var(--neon-cyan) 10%, var(--bg-tertiary));
}

.sc-sheet-radio {
    flex-shrink: 0;
    margin-top: 2px;
}

.sc-sheet-radio-outer {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary, #666);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sc-sheet-option.active .sc-sheet-radio-outer {
    border-color: var(--neon-cyan, #00f5ff);
}

.sc-sheet-radio-inner {
    width: 10px;
    height: 10px;
    background: var(--neon-cyan, #00f5ff);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s;
}

.sc-sheet-option.active .sc-sheet-radio-inner {
    transform: scale(1);
}

.sc-sheet-option-info {
    flex: 1;
    text-align: left;
}

.sc-sheet-option-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-sheet-option-desc {
    font-size: 12px;
    color: var(--text-secondary, #888);
    line-height: 1.4;
}

.sc-sheet-recommend {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--bg-primary, #0a0a0f);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 4px;
}

.sc-sheet-cancel {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary, #1a1a24);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    color: var(--text-secondary, #888);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sc-sheet-cancel:active {
    background: var(--bg-primary, #0a0a12);
}

/* ==================== 紧凑模式双语歌词标签 ==================== */

.sc-compact .sc-compact-option-column {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.sc-bilingual-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sc-bilingual-tag {
    padding: 6px 12px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary, #888);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.sc-bilingual-tag:hover {
    border-color: var(--text-tertiary, rgba(255, 255, 255, 0.3));
}

.sc-bilingual-tag.active {
    border-color: var(--neon-cyan, #00f5ff);
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan, #00f5ff);
}

/* ==================== 樱花主题适配 ==================== */

[data-theme="sakura"] .sc-bilingual-current {
    color: var(--neon-pink, #ec4899);
}

[data-theme="sakura"] .sc-sheet-option.active {
    border-color: var(--neon-pink, #ec4899);
    background: color-mix(in srgb, var(--neon-pink) 10%, var(--bg-tertiary));
}

[data-theme="sakura"] .sc-sheet-option.active .sc-sheet-radio-outer {
    border-color: var(--neon-pink, #ec4899);
}

[data-theme="sakura"] .sc-sheet-radio-inner {
    background: var(--neon-pink, #ec4899);
}

[data-theme="sakura"] .sc-sheet-recommend {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
}

[data-theme="sakura"] .sc-bilingual-tag.active {
    border-color: var(--neon-pink, #ec4899);
    background: rgba(236, 72, 153, 0.1);
    color: var(--neon-pink, #ec4899);
}
