/* ═══════════════════════════════════════════════════
   batch-review.css — YOLO 批量批改页面样式
   Inherits: style.css CSS variables + Study-style refinements
   ═══════════════════════════════════════════════════ */

/* ─── Body Background ─── */
body {
    background-color: var(--color-bg, #080613);
    background-image:
        linear-gradient(180deg, rgba(8,6,19,0.94) 0%, rgba(8,6,19,0.98) 100%),
        radial-gradient(ellipse at 14% 18%, rgba(168,85,247,0.10) 0%, transparent 34%),
        radial-gradient(ellipse at 82% 16%, rgba(104,88,152,0.14) 0%, transparent 36%),
        radial-gradient(ellipse at 50% 100%, rgba(168,85,247,0.06) 0%, transparent 42%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.review-workspace {
    display: flex;
    gap: 10px;
    padding: 72px 10px 10px 10px;
    height: calc(100vh - 82px);
    min-height: 0;
    overflow: hidden;
}

/* ─── Panel Base ─── */
.panel {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius, 18px);
    background: var(--glass-bg, rgba(18,14,35,0.62));
    backdrop-filter: blur(var(--glass-blur, 14px));
    -webkit-backdrop-filter: blur(var(--glass-blur, 14px));
    border: 1px solid var(--color-border, rgba(255,255,255,0.12));
    box-shadow: var(--glass-shadow, 0 18px 48px rgba(4,8,20,0.28)),
                inset 0 1px 0 rgba(255,255,255,0.06);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(20,16,36,0.85) 0%, rgba(18,14,35,0.65) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text, #edf2ff);
    letter-spacing: 0.01em;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.panel-body::-webkit-scrollbar { width: 5px; }
.panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }

.panel-footer {
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(14,12,28,0.6) 0%, rgba(18,14,35,0.7) 100%);
    flex-shrink: 0;
}

.panel-title-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.panel-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ─── Navigation ─── */
.glass-nav {
    background: linear-gradient(135deg,
        rgba(8,12,24,0.90) 0%,
        rgba(18,14,35,0.86) 52%,
        rgba(20,16,36,0.92) 100%);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 4px 36px rgba(5,8,18,0.25);
}

.glass-nav::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(168,85,247,0.20) 20%,
        rgba(168,85,247,0.35) 50%,
        rgba(168,85,247,0.20) 80%,
        transparent 100%);
    animation: nav-glow-shift 6s ease-in-out infinite;
}

@keyframes nav-glow-shift {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.nav-back-btn:hover {
    color: var(--color-text, #fff);
    border-color: var(--color-primary, #a855f7);
    background: rgba(168, 85, 247, 0.12);
    box-shadow: 0 0 20px rgba(168,85,247,0.12);
}

/* ─── Thumbnail Panel ─── */
.panel-thumbs {
    width: 200px;
    min-width: 170px;
    flex-shrink: 0;
}

.thumb-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.thumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm, 12px);
    cursor: pointer;
    transition: all var(--duration-fast, 180ms) var(--ease-liquid, cubic-bezier(.22,1,.36,1));
    border: 1px solid transparent;
    background: rgba(255,255,255,0.02);
}

.thumb-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
}

.thumb-item.active {
    border-color: var(--color-primary, #a855f7);
    background: rgba(168,85,247,0.10);
    box-shadow: 0 0 16px rgba(168,85,247,0.12), inset 0 1px 0 rgba(255,255,255,0.04);
}

.thumb-item.gt-done { border-left: 3px solid #22c55e; }
.thumb-item.reviewing { border-left: 3px solid var(--color-primary, #a855f7); }
.thumb-item.error { border-left: 3px solid var(--color-danger, #f85149); }

.thumb-img {
    width: 48px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255,255,255,0.04);
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.06);
}

.thumb-info {
    flex: 1;
    min-width: 0;
}

.thumb-name {
    font-size: 11px;
    color: var(--color-text, #edf2ff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.thumb-status {
    font-size: 10px;
    color: var(--color-text-muted, #b0a0b8);
    margin-top: 1px;
}

.thumb-item.gt-done .thumb-status { color: #22c55e; }
.thumb-item.reviewing .thumb-status { color: var(--color-primary, #a855f7); }
.thumb-item.error .thumb-status { color: var(--color-danger, #f85149); }

/* ─── Thumbnail Delete ─── */
.thumb-del {
    font-size: 14px; color: var(--color-text-muted, #b0a0b8);
    cursor: pointer; padding: 0 2px; opacity: 0; transition: opacity 0.15s;
    line-height: 1; flex-shrink: 0; margin-left: auto;
}
.thumb-item:hover .thumb-del { opacity: 0.4; }
.thumb-del:hover { opacity: 1 !important; color: #f85149; }

/* ─── Canvas Panel ─── */
.panel-canvas {
    flex: 1;
    min-width: 300px;
}

.canvas-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(168,85,247,0.03) 0%, transparent 60%);
    position: relative;
    border-radius: 0 0 var(--radius-sm, 12px) var(--radius-sm, 12px);
}

.upload-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--color-text-muted, #b0a0b8);
    text-align: center;
    padding: 48px;
    border-radius: var(--radius, 18px);
    border: 2px dashed rgba(255,255,255,0.10);
    transition: all var(--duration-normal, 350ms) var(--ease-liquid, cubic-bezier(.22,1,.36,1));
    background: rgba(255,255,255,0.015);
}

.upload-placeholder:hover {
    border-color: var(--color-primary, #a855f7);
    background: rgba(168,85,247,0.05);
    box-shadow: 0 0 30px rgba(168,85,247,0.08);
}

.upload-placeholder .upload-icon {
    font-size: 48px;
    opacity: 0.4;
}

.upload-placeholder .hint {
    font-size: 11px;
    color: var(--color-text-muted, #b0a0b8);
    opacity: 0.6;
}

.review-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    image-rendering: auto;
    border-radius: 4px;
}

.review-canvas.annotating {
    cursor: crosshair;
}

/* ─── Canvas Controls ─── */
.canvas-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(10,10,26,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm, 12px);
    padding: 5px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.zoom-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-text, #edf2ff);
    transition: all var(--duration-fast, 180ms) var(--ease-liquid, cubic-bezier(.22,1,.36,1));
    user-select: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
}

.zoom-btn:hover {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.25);
    color: #fff;
}

.zoom-value {
    font-size: 11px;
    color: var(--color-text-muted, #b0a0b8);
    min-width: 42px;
    text-align: center;
    font-weight: 500;
}

/* ─── Review Panel ─── */
.panel-review {
    width: 340px;
    min-width: 290px;
    flex-shrink: 0;
}

.review-body {
    padding: 10px 14px;
}

/* ─── Review List ─── */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.review-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm, 12px);
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all var(--duration-fast, 180ms) var(--ease-liquid, cubic-bezier(.22,1,.36,1));
    cursor: pointer;
    font-size: 12px;
}

.review-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
}

.review-item.active {
    border-color: var(--color-primary, #a855f7);
    background: rgba(168,85,247,0.08);
    box-shadow: 0 0 12px rgba(168,85,247,0.08);
}

.review-item .det-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.review-item .det-name {
    flex: 1;
    font-weight: 500;
    color: var(--color-text, #edf2ff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.review-item .det-conf {
    font-size: 10px;
    color: var(--color-text-muted, #b0a0b8);
    min-width: 36px;
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.review-item .det-status {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.det-status-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--color-text-muted, #b0a0b8);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--duration-fast, 180ms) var(--ease-liquid, cubic-bezier(.22,1,.36,1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.det-status-btn:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.15);
}

.det-status-btn.selected-correct {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.35);
    color: #22c55e;
    box-shadow: 0 0 10px rgba(34,197,94,0.12);
}

.det-status-btn.selected-wrong {
    background: rgba(248,81,73,0.15);
    border-color: rgba(248,81,73,0.35);
    color: #f85149;
    box-shadow: 0 0 10px rgba(248,81,73,0.12);
}

/* ─── Review Footer ─── */
.review-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── Annotation Tools ─── */
#annotate-tools select {
    padding: 7px 10px;
    border-radius: var(--radius-sm, 12px);
    background: rgba(255,255,255,0.05);
    color: var(--color-text, #edf2ff);
    border: 1px solid rgba(255,255,255,0.10);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

#annotate-tools select:hover {
    border-color: rgba(168,85,247,0.35);
}

/* ─── Button Refinements ─── */
.btn {
    border-radius: var(--radius-sm, 12px);
    transition: all var(--duration-fast, 180ms) var(--ease-liquid, cubic-bezier(.22,1,.36,1));
    font-weight: 500;
    letter-spacing: 0.01em;
}

.btn-accent {
    background: rgba(168,85,247,0.12);
    border: 1px solid rgba(168,85,247,0.25);
    color: #c4a0f5;
}
.btn-accent:hover:not(:disabled) {
    background: rgba(168,85,247,0.20);
    border-color: rgba(168,85,247,0.40);
    color: #fff;
    box-shadow: 0 0 20px rgba(168,85,247,0.15);
}

.btn-glow {
    background: rgba(34,197,94,0.10);
    border: 1px solid rgba(34,197,94,0.22);
    color: #4ade80;
}
.btn-glow:hover:not(:disabled) {
    background: rgba(34,197,94,0.18);
    border-color: rgba(34,197,94,0.35);
    color: #fff;
    box-shadow: 0 0 20px rgba(34,197,94,0.15);
}

.btn-ghost {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--color-text-muted, #b0a0b8);
}
.btn-ghost:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: var(--color-text, #fff);
}

.btn-tiny {
    padding: 4px 12px;
    font-size: 11px;
}

button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* ─── Count Badge ─── */
.count-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 99px;
    background: rgba(168,85,247,0.12);
    color: #c4a0f5;
    font-weight: 500;
    border: 1px solid rgba(168,85,247,0.15);
    white-space: nowrap;
}

/* ─── Runtime Hint ─── */
.runtime-hint {
    font-size: 10px;
    color: var(--color-text-muted, #b0a0b8);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Empty State ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--color-text-muted, #b0a0b8);
    text-align: center;
    gap: 10px;
}

.empty-icon {
    font-size: 40px;
    opacity: 0.3;
}

/* ─── Save Indicator ─── */
.save-indicator {
    font-size: 10px;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 99px;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.15);
}

.save-time-text {
    font-size: 10px;
    color: var(--color-text-muted, #b0a0b8);
}

/* ─── Status Bar ─── */
.status-bar {
    padding: 7px 16px;
    background: linear-gradient(180deg,
        rgba(8,12,24,0.85) 0%,
        rgba(12,10,22,0.90) 100%);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.status-bar .sep {
    color: rgba(255,255,255,0.08);
    margin: 0 8px;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.idle { background: #9a9ab0; }
.status-dot.ok { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.3); }
.status-dot.loading { background: #f59e0b; animation: dot-pulse 1s infinite; }
.status-dot.error { background: #f85149; box-shadow: 0 0 8px rgba(248,81,73,0.3); }

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.footer-link {
    color: var(--color-text-muted, #b0a0b8);
    text-decoration: none;
    font-size: 11px;
    transition: color 0.2s;
}

.footer-link:hover { color: var(--color-primary, #a855f7); }

/* ─── Progress Bar ─── */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
    margin: 6px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary, #a855f7), #39d2c0);
    border-radius: 2px;
    transition: width 0.4s var(--ease-liquid, cubic-bezier(.22,1,.36,1));
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(4,4,12,0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 0.2s var(--ease-liquid, cubic-bezier(.22,1,.36,1));
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: rgba(20,16,36,0.95);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius, 18px);
    padding: 24px;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.06);
    animation: modal-slide-up 0.25s var(--ease-liquid, cubic-bezier(.22,1,.36,1));
}

@keyframes modal-slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ─── Hotkey Help Table ─── */
.hotkey-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.hotkey-table td {
    padding: 5px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hotkey-table td:first-child {
    white-space: nowrap;
    color: var(--color-primary, #a855f7);
    font-weight: 600;
    padding-right: 16px;
}

.hotkey-table tr:last-child td { border-bottom: none; }

kbd {
    display: inline-block;
    padding: 2px 7px;
    font-size: 10px;
    font-family: inherit;
    font-weight: 600;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    margin: 0 2px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

/* ─── Context Menu ─── */
.ctx-menu {
    position: fixed;
    z-index: 5000;
    background: rgba(20,16,36,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm, 12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.55),
                inset 0 1px 0 rgba(255,255,255,0.05);
    min-width: 150px;
    padding: 4px 0;
    animation: ctx-appear 0.12s var(--ease-liquid, cubic-bezier(.22,1,.36,1));
}

@keyframes ctx-appear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.ctx-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text, #edf2ff);
    transition: all 0.1s;
}

.ctx-menu-item:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #fff;
}

/* ─── Hidden Upload Input ─── */
.upload-input-native { display: none; }

/* ─── RGB Glow for Selected Review Item ─── */
.review-item.rgb-glow {
    position: relative;
    isolation: isolate;
    overflow: visible;
    z-index: 0;
    border: 2px solid transparent !important;
    background-image:
        linear-gradient(rgba(20,16,36,0.95), rgba(20,16,36,0.95)),
        conic-gradient(
            from var(--rgb-flow-angle),
            #ff5a5a,
            #4dffa6,
            #4da2ff,
            #ff4db3,
            #ff5a5a
        ) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    animation: rgb-flow-anim 3s linear infinite, rgb-glow-fade 1.8s ease-out forwards;
    box-shadow: 0 0 20px rgba(168,85,247,0.18) !important;
}
.review-item.rgb-glow::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    border-radius: inherit;
    pointer-events: none;
    z-index: -2;
    padding: 4px;
    filter: blur(0.8rem);
    opacity: 0.35;
    background-image: conic-gradient(from var(--rgb-flow-angle), #ff5a5a, #4dffa6, #4da2ff, #ff4db3, #ff5a5a);
    animation: rgb-flow-anim 3s linear infinite;
}
@keyframes rgb-glow-fade {
    0% { box-shadow: 0 0 24px rgba(168,85,247,0.25); }
    70% { box-shadow: 0 0 18px rgba(168,85,247,0.15); }
    100% { box-shadow: 0 0 8px rgba(168,85,247,0.04); }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .panel-thumbs { display: none; }
    .panel-review { width: 280px; min-width: 240px; }
}

@media (max-width: 640px) {
    .review-workspace { flex-direction: column; padding: 68px 6px 6px 6px; gap: 6px; }
    .panel-canvas { min-height: 220px; }
    .panel-review { width: 100%; min-width: 0; max-height: 40vh; }
    .canvas-controls { bottom: 6px; right: 6px; }
}
