/* ========================================
   Video 小鱼儿 - 视频下载器 样式
   ======================================== */

:root {
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --card-bg: #1a1a2e;
    --bg-input: #16213e;
    --border: #2a2a4a;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --success: #22c55e;
    --success-hover: #4ade80;
    --danger: #ef4444;
    --warning: #f59e0b;
    --accent: #8b5cf6;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ---------- Header ---------- */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ---------- Card ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}

.card:hover {
    border-color: #3a3a6a;
}

.card h3 {
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--text);
}

/* ---------- Input Section ---------- */
.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.input-row input:focus {
    border-color: var(--primary);
}

.input-row input::placeholder {
    color: #4a5568;
}

.input-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #4a5568;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

.btn-outline:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
}

/* ---------- Advanced Options ---------- */
.advanced-options .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    padding: 10px 4px;
}

.advanced-options .section-header h3 {
    margin-bottom: 0;
}

.toggle-icon {
    color: var(--text-secondary);
    transition: transform 0.3s;
    font-size: 12px;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.section-body {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.option-group {
    margin-bottom: 16px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.option-label input[type="checkbox"] {
    margin-right: 6px;
}

.option-hint {
    font-size: 11px;
    color: #4a5568;
    margin-top: 4px;
}

.select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 8px;
    font-size: 13px;
    outline: none;
}

.select option {
    padding: 4px 8px;
    background: var(--bg-input);
}

.input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.input:focus {
    border-color: var(--primary);
}

.textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: 'Consolas', 'Courier New', monospace;
    resize: vertical;
    outline: none;
}

.textarea:focus {
    border-color: var(--primary);
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.download-options {
    background: rgba(99, 102, 241, 0.05);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* ---------- Result Section ---------- */
.result-section h3 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    word-break: break-all;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-meta .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-source {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-hover);
}

.tag-ext {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.tag-ok {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.tag-err {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.result-ok {
    border-left: 3px solid var(--success);
}

.result-err {
    border-left: 3px solid var(--danger);
}

.result-error-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: #fca5a5;
    font-family: 'Consolas', 'Courier New', monospace;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
}

.result-summary {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.result-actions {
    margin-top: 14px;
    text-align: center;
}

/* ========== Enhanced Progress Section ========== */
.progress-section {
    animation: cardSlideIn 0.4s ease-out;
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Header ---- */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 0;
}

.progress-icon {
    color: var(--primary);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(0.9); }
}

.progress-icon.done {
    color: var(--success);
    animation: none;
}

.progress-icon.error-ico {
    color: var(--danger);
    animation: none;
}

.progress-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.progress-divider {
    color: var(--border);
}

.progress-percent-main {
    font-weight: 700;
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: right;
}

.progress-percent-main.done {
    background: linear-gradient(135deg, var(--success), #4ade80);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---- Main Progress Bar ---- */
.progress-bar-wrap {
    margin-bottom: 18px;
}

.progress-bar-track {
    width: 100%;
    height: 14px;
    background: rgba(22, 33, 62, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #6366f1);
    background-size: 300% 100%;
    background-position: 0% 0%;
    border-radius: 10px;
    position: relative;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientShift 3s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255,255,255,0.15);
}

.progress-bar-fill.done {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    background-size: 100% 100%;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: none;
}

.progress-bar-fill.error {
    background: linear-gradient(90deg, #ef4444, #f87171);
    background-size: 100% 100%;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: none;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Shimmer overlay ---- */
.progress-bar-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.15) 40%,
        rgba(255,255,255,0.25) 50%,
        rgba(255,255,255,0.15) 60%,
        transparent 100%
    );
    animation: shimmerSweep 1.8s ease-in-out infinite;
}

@keyframes shimmerSweep {
    0%   { left: -80px; }
    100% { left: 100%; }
}

/* ---- Status Row ---- */
.progress-info-area {
    margin-bottom: 14px;
}

.progress-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.progress-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    animation: dotPulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

.progress-status-dot.done {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: none;
}

.progress-status-dot.error-dot {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: none;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.5); opacity: 0.5; }
}

.progress-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.progress-text.done-text {
    color: var(--success);
}

.progress-text.error-text {
    color: var(--danger);
}

/* ---- Details ---- */
.progress-details {
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 20px;
    line-height: 1.7;
    min-height: 20px;
}

.progress-details .detail-line {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.progress-details .detail-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-hover);
}

.progress-details .detail-badge.warn {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.progress-details .detail-badge.ok {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

/* ---- Terminal-style Progress Bar ---- */
.terminal-bar {
    margin-bottom: 16px;
}

.terminal-bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terminal-bar-content {
    background: #0c0c1d;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    overflow: hidden;
}

.terminal-bar-pre {
    font-family: 'Consolas', 'Courier New', 'Cascadia Code', monospace;
    font-size: 12px;
    color: #a78bfa;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
}

.terminal-bar-pre .term-done  { color: #4ade80; }
.terminal-bar-pre .term-warn  { color: #fbbf24; }
.terminal-bar-pre .term-err   { color: #f87171; }
.terminal-bar-pre .term-info  { color: #818cf8; }
.terminal-bar-pre .term-dim   { color: #4a5568; }

/* ---- Progress Bar (legacy compact for backward compat) ---- */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-status {
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
}

.file-item .file-name {
    color: var(--text);
    word-break: break-all;
    flex: 1;
    min-width: 150px;
}

.file-item .file-size {
    color: var(--text-secondary);
    white-space: nowrap;
}

.file-item .btn-save,
.file-item .btn-open-folder {
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-open-folder {
    background: transparent;
    border: 1px solid var(--warning);
    color: var(--warning);
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-open-folder:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

.btn-small {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* ---------- 转换 MP4 按钮 ---------- */
.btn-convert {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff !important;
    border: none;
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-convert:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-convert-done {
    background: var(--success) !important;
    color: #fff !important;
    border: none !important;
}

.file-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

/* 批量转换提示 */
.convert-batch-banner {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.convert-batch-banner em {
    color: var(--primary);
    font-style: normal;
    font-weight: 600;
}

/* 转换进度区域 */
.file-convert-progress {
    margin: 4px 0 8px 24px;
}

.convert-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: rgba(99, 102, 241, 0.06);
    border-left: 3px solid var(--primary);
    animation: fadeIn 0.3s ease;
}
.convert-status.submitting {
    border-left-color: #a78bfa;
    background: rgba(167, 139, 250, 0.06);
}
.convert-status.merging,
.convert-status.converting {
    border-left-color: var(--primary);
}
.convert-status.merging::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: auto;
}
.convert-status.converting::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #f59e0b;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: auto;
}
.convert-status.done {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.06);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.convert-status.error {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
    color: var(--danger);
}

.convert-seg-count {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: auto;
}

.convert-result {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.convert-done-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}
.convert-result-size {
    font-size: 11px;
    color: var(--text-secondary);
}

.convert-result-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-convert-save {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 转换后的文件条目高亮 */
.file-item-converted {
    border: 2px dashed rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 4px;
    background: rgba(16, 185, 129, 0.03);
    animation: highlightPulse 1.5s ease;
}
@keyframes highlightPulse {
    0% { border-color: rgba(16, 185, 129, 0.8); }
    100% { border-color: rgba(16, 185, 129, 0.3); }
}

/* ---------- 依赖警告 ---------- */
.dep-warnings {
    margin-bottom: 12px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 13px;
}

.dep-warnings strong {
    color: var(--warning);
}

.dep-warnings ul {
    margin: 6px 0 0 16px;
    padding: 0;
}

.dep-warnings li {
    margin-bottom: 3px;
    font-size: 12px;
    color: #fcd34d;
}

/* ---------- Error Section ---------- */
.error-box {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 14px;
}

.error-box strong {
    margin-right: 6px;
}

.error-box pre {
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #fca5a5;
    overflow-x: auto;
    line-height: 1.5;
}

.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-retry:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.btn-retry:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-retry .countdown-pulse {
    animation: retryCountdown 1s ease-in-out infinite;
}
@keyframes retryCountdown {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------- 图像检查区域 ---------- */
.inspect-section {
    border-left: 4px solid #8b5cf6;
}
.inspect-section .inspect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.inspect-section .inspect-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}
.inspect-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.inspect-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    transition: border-color 0.2s;
}
.inspect-card:hover {
    border-color: #8b5cf6;
}
.inspect-card .file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.inspect-card .file-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.inspect-card .file-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.inspect-card .file-meta .val {
    color: var(--text);
    font-weight: 500;
}
.inspect-card .badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-ok       { background: #065f46; color: #6ee7b7; }
.badge-warn     { background: #78350f; color: #fcd34d; }
.badge-error    { background: #7f1d1d; color: #fca5a5; }
.badge-info     { background: #1e3a5f; color: #93c5fd; }
.badge-purple   { background: #3b0764; color: #c4b5fd; }
.inspect-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--bg);
}
.inspect-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
}
.inspect-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.inspect-summary-item .num {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}
.inspect-summary-item .label {
    font-size: 11px;
    color: var(--text-muted);
}
.inspect-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer p {
    font-size: 12px;
    color: #4a5568;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 9999;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

.toast-success {
    background: var(--success);
    color: #fff;
}

.toast-error {
    background: var(--danger);
    color: #fff;
}

.toast-info {
    background: var(--primary);
    color: #fff;
}

/* ---------- Spinner ---------- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Cookie 助手面板
   ======================================== */
.cookie-helper {
    margin-top: 8px;
}

.cookie-helper-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    color: var(--primary-hover);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    user-select: none;
}

.cookie-helper-toggle:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a78bfa;
}

.cookie-helper-icon {
    font-size: 16px;
}

.cookie-helper-arrow {
    font-size: 10px;
    transition: transform 0.3s;
    margin-left: 2px;
    opacity: 0.7;
}

.cookie-helper-arrow.open {
    transform: rotate(180deg);
}

.cookie-helper-body {
    margin-top: 12px;
    padding: 16px;
    background: rgba(15, 15, 30, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    animation: cookieHelperIn 0.3s ease-out;
}

@keyframes cookieHelperIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cookie-helper-intro {
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
}

.cookie-helper-intro p {
    margin-bottom: 6px;
}

.cookie-helper-note {
    font-size: 12px;
    color: var(--text-secondary);
}

.cookie-helper-note code {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* ---- Method Card ---- */
.cookie-method {
    margin-bottom: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.cookie-method:last-child {
    margin-bottom: 0;
}

.cookie-method.recommended {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.04);
}

.cookie-method-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

.cookie-method-badge {
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.cookie-method-body {
    padding: 12px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.cookie-method-body p {
    margin-bottom: 6px;
}

.cookie-method-body strong {
    color: var(--text);
}

/* ---- Extension List ---- */
.cookie-ext-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.cookie-ext-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    font-size: 12px;
}

.cookie-ext-name {
    color: var(--text);
    font-weight: 500;
}

.cookie-ext-link {
    color: var(--primary-hover);
    text-decoration: none;
    font-size: 11px;
    white-space: nowrap;
}

.cookie-ext-link:hover {
    text-decoration: underline;
    color: #a78bfa;
}

/* ---- Steps ---- */
.cookie-method-steps {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.cookie-method-steps ol {
    margin: 4px 0 0 18px;
    padding: 0;
}

.cookie-method-steps li {
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.cookie-method-steps code {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
}

/* ---- Code Block ---- */
.cookie-code-block {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.cookie-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid var(--border);
}

.cookie-code-lang {
    font-size: 11px;
    color: var(--primary-hover);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-copy-code {
    height: 28px;
    padding: 0 12px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 5px;
    color: var(--primary-hover);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy-code:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.btn-copy-code.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--success);
}

.cookie-code-pre {
    margin: 0;
    padding: 12px 14px;
    background: #0c0c1d;
    font-family: 'Consolas', 'Cascadia Code', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: #a78bfa;
    overflow-x: auto;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre;
    tab-size: 4;
    -moz-tab-size: 4;
}

.cookie-code-pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* ---- Template Buttons ---- */
.cookie-template-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-template-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.cookie-template-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-hover);
}

.cookie-template-btn.filled {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
    color: var(--success);
}

.cookie-template-icon {
    font-size: 15px;
}

/* ---- Diagnose Button ---- */
.btn-diagnose-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
    margin-left: 8px;
}

.btn-diagnose-sm:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.08);
}

.btn-diagnose-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Diagnostic Report Panel ---- */
.diagnose-panel {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: none;
}

.diagnose-panel.show {
    display: block;
}

.diagnose-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.diagnose-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.diagnose-stat .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-fatal { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-warn  { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-info  { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-ok    { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.diagnose-verdict {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
}

.diagnose-verdict.pass { color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.diagnose-verdict.fail { color: #ef4444; background: rgba(239, 68, 68, 0.08); }

.diagnose-issues {
    max-height: 360px;
    overflow-y: auto;
}

.diagnose-issue {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.diagnose-issue.fatal {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid #ef4444;
}

.diagnose-issue.warn {
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid #f59e0b;
}

.diagnose-issue.info {
    background: rgba(59, 130, 246, 0.06);
    border-left: 3px solid #3b82f6;
}

.diagnose-issue.ok {
    background: rgba(34, 197, 94, 0.06);
    border-left: 3px solid #22c55e;
}

.diagnose-issue .issue-field {
    font-weight: 600;
    color: var(--primary-light);
}

.diagnose-issue .issue-fix {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.diagnose-field-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.diagnose-field {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.diagnose-field .field-key {
    color: var(--primary-light);
    min-width: 100px;
    font-weight: 600;
}

.diagnose-field .field-desc {
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
}

/* ========================================
   Responsive (Cookie Helper 适配)
   ======================================== */
@media (max-width: 600px) {
    .input-row {
        flex-direction: column;
    }
    .input-row .btn {
        width: 100%;
        justify-content: center;
    }
    .checkbox-row {
        flex-direction: column;
        gap: 8px;
    }
    .container {
        padding: 16px 12px 40px;
    }
    .logo h1 {
        font-size: 26px;
    }
}
