.calibrate-page { max-width: 1600px;}

.tool-tabs {
    display: flex; gap: 8px; margin-bottom: 20px;
    background: var(--surface-1); border-radius: var(--rounded-lg);
    padding: 8px; border: 1px solid var(--hairline);
}
.tool-tab {
    flex: 1; padding: 12px 16px; border-radius: var(--rounded-md);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: all 0.25s; border: none; background: transparent;
    color: var(--ink-muted); text-align: center;
}
.tool-tab:hover { background: var(--surface-2); color: var(--ink); }
.tool-tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.tool-tab-icon { margin-right: 6px; }

.tool-panel { display: none; }
.tool-panel.active { display: block; }

.calibrate-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.calibrate-panel {
    background: var(--surface-1);
    border-radius: var(--rounded-lg);
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: 480px;
    overflow: hidden;
}
.calibrate-panel-header {
    padding: 14px 20px;
    height: 48px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--hairline);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.calibrate-panel-header .panel-icon {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.calibrate-panel-header .panel-icon.left { background: #6366f1; }
.calibrate-panel-header .panel-icon.mid { background: var(--primary); }
.calibrate-panel-header .panel-icon.right { background: #22c55e; }
.calibrate-panel-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: 0; }
.calibrate-panel-body { flex: 1; padding: 0; overflow-y: auto; }

.upload-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; padding: 32px 20px;
    cursor: pointer; transition: all 0.25s; text-align: center;
}
.upload-zone:hover { background: var(--primary-subtler); }
.upload-zone.has-content { padding: 0; cursor: default; }
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.upload-zone-text { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 6px; }
.upload-zone-hint { color: var(--ink-subtle); font-size: 0.8rem; }
.srt-display {
    padding: 16px; font-family: monospace; font-size: 0.82rem; line-height: 1.8;
    color: var(--ink); white-space: pre-wrap; word-break: break-all;
    height: 100%; overflow-y: auto;
}
.srt-display .srt-line-idx { color: var(--ink-subtle); }
.srt-display .srt-line-time { color: #6366f1; font-size: 0.78rem; }
.srt-display .srt-line-text { color: var(--ink); }

.original-textarea {
    width: 100%; height: 100%; border: none;
    background: transparent; color: var(--ink); padding: 16px;
    font-size: 0.95rem; font-family: inherit; line-height: 1.8;
    resize: none; outline: none; overflow-y: auto;
    box-sizing: border-box;
}
.original-textarea::placeholder { color: var(--ink-subtle); }

.result-display {
    padding: 16px; font-family: monospace; font-size: 0.82rem; line-height: 1.8;
    color: var(--ink); white-space: pre-wrap; word-break: break-all;
    height: 100%; overflow-y: auto;
}
.result-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--ink-subtle); font-size: 0.9rem;
}

.calibrate-controls {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--surface-1); border-radius: var(--rounded-lg);
    padding: 16px 24px; border: 1px solid var(--hairline);
    box-shadow: var(--shadow-md); margin-bottom: 24px;
}
.option-toggle {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; color: var(--ink-muted); cursor: pointer; user-select: none;
}
.option-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.option-toggle .toggle-hint { font-size: 0.8rem; color: var(--ink-subtle); }
.controls-spacer { flex: 1; }
.btn-calibrate {
    padding: 12px 36px; background: var(--primary); color: #fff;
    border: none; border-radius: var(--rounded-md); font-size: 1rem;
    font-weight: 600; cursor: pointer; transition: all 0.25s;
    box-shadow: var(--shadow-md); white-space: nowrap;
}
.btn-calibrate:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-calibrate:disabled { background: var(--surface-2); color: var(--ink-subtle); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-result-action {
    padding: 6px 14px; border-radius: var(--rounded-md); font-size: 0.8rem;
    font-weight: 600; cursor: pointer; transition: all 0.25s; border: none;
}
.btn-download { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-download:hover { background: var(--primary-hover); }
.btn-copy { background: var(--surface-2); color: var(--ink); border: 1px solid var(--hairline); }
.btn-copy:hover { border-color: var(--primary); color: var(--primary); }
.result-actions { display: flex; gap: 8px; margin-left: auto; }

.file-info-bar {
    padding: 10px 16px; background: var(--primary-subtler);
    border-bottom: 1px solid var(--hairline);
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: var(--primary); font-weight: 500;
}
.file-info-bar .remove-file {
    margin-left: auto; cursor: pointer; opacity: 0.6;
    font-size: 1rem; transition: opacity 0.2s;
}
.file-info-bar .remove-file:hover { opacity: 1; }

.bilingual-options {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.bilingual-option {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; background: var(--surface-1);
    border: 1px solid var(--hairline); border-radius: var(--rounded-md);
    cursor: pointer; transition: all 0.25s;
}
.bilingual-option:hover { border-color: var(--primary); }
.bilingual-option.active { border-color: var(--primary); background: var(--primary-subtler); }
.bilingual-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }
.bilingual-option label { cursor: pointer; font-size: 0.85rem; color: var(--ink-muted); }

.format-options {
    display: flex; gap: 12px; margin-bottom: 16px;
}
.format-option {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; background: var(--surface-1);
    border: 1px solid var(--hairline); border-radius: var(--rounded-md);
    cursor: pointer; transition: all 0.25s; flex: 1;
}
.format-option:hover { border-color: var(--primary); }
.format-option.active { border-color: var(--primary); background: var(--primary-subtler); }
.format-option.disabled { opacity: 0.5; cursor: not-allowed; }
.format-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }
.format-option label { cursor: pointer; font-size: 0.85rem; color: var(--ink-muted); }
.format-badge {
    padding: 2px 8px; border-radius: 4px; font-size: 0.75rem;
    font-weight: 600; background: var(--surface-2); color: var(--ink-subtle);
}

.ass-styles-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.ass-style-card {
    padding: 12px; background: var(--surface-1);
    border: 1px solid var(--hairline); border-radius: var(--rounded-md);
    cursor: pointer; transition: all 0.25s; text-align: center;
}
.ass-style-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.ass-style-card.active { border-color: var(--primary); background: var(--primary-subtler); }
.ass-style-preview {
    padding: 8px; margin-bottom: 8px; border-radius: 4px;
    font-size: 0.85rem; font-weight: 600; min-height: 40px;
    display: flex; align-items: center; justify-content: center;
}
.ass-style-name { font-size: 0.8rem; color: var(--ink-muted); }

.style-classic { background: #000; color: #fff; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); }
.style-neon { background: #000; color: #0ff; text-shadow: 0 0 10px #0ff, 0 0 20px #0ff; }
.style-gradient { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.style-shadow { background: #1a1a1a; color: #fff; text-shadow: 3px 3px 6px rgba(0,0,0,0.5); }
.style-karaoke { background: #ff6b6b; color: #fff; animation: karaoke-glow 1s ease-in-out infinite alternate; }
.style-movie { background: #000; color: #ffd700; font-style: italic; letter-spacing: 2px; }

@keyframes karaoke-glow {
    from { text-shadow: 0 0 5px #ff6b6b; }
    to { text-shadow: 0 0 20px #ff6b6b, 0 0 30px #ff6b6b; }
}

.bilingual-settings {
    background: var(--surface-1); border-radius: var(--rounded-lg);
    border: 1px solid var(--hairline); padding: 16px 24px;
    margin-bottom: 16px;
}
.bilingual-settings h4 {
    font-size: 0.9rem; font-weight: 600; color: var(--ink);
    margin: 0 0 12px 0;
}
.settings-row {
    display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.settings-label {
    font-size: 0.85rem; color: var(--ink-muted); min-width: 80px;
}
.settings-select {
    padding: 8px 12px; background: var(--surface-2);
    border: 1px solid var(--hairline); border-radius: var(--rounded-md);
    color: var(--ink); font-size: 0.85rem; cursor: pointer;
}
.settings-select:focus { outline: none; border-color: var(--primary); }

@media (max-width: 1024px) {
    .calibrate-3col { grid-template-columns: 1fr; }
    .calibrate-panel { height: 360px; }
    .calibrate-controls { flex-wrap: wrap; }
    .result-actions { margin-left: 0; width: 100%; }
    .btn-result-action { flex: 1; }
    .tool-tabs { flex-direction: column; }
    .bilingual-options { flex-direction: column; }
    .format-options { flex-direction: column; }
}

.usage-card {
    background: var(--surface-3); border-radius: var(--rounded-md);
    padding: var(--spacing-md); border: 1px solid var(--hairline);
    margin-top: var(--spacing-md);
}
.usage-card h4 { margin-top: 0; margin-bottom: 10px; font-size: 14px; color: var(--ink); }
.usage-card ul { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-subtle); line-height: 1.8; }
