/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 响应式字体大小调整 */
@media screen and (max-width: 1200px) {
    html {
        font-size: 15px;
    }
}

/* 系统状态指示器 */
.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-indicator.ready {
    background: #28a745;
}

.status-indicator.detecting {
    background: #007bff;
    animation: pulse 1s infinite;
}

.status-indicator.warning {
    background: #ffc107;
}

.status-indicator.error {
    background: #dc3545;
    animation: pulse 0.5s infinite;
}

.status-text {
    font-size: 0.9rem;
    color: #495057;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 日志面板样式 */
.log-panel {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.log-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-log-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-log-btn:hover {
    background: #d32f2f;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.log-entry {
    display: flex;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e9ecef;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #6c757d;
    min-width: 80px;
    margin-right: 1rem;
}

.log-message {
    color: #495057;
    flex: 1;
}

.log-entry.info .log-message {
    color: #17a2b8;
}

.log-entry.success .log-message {
    color: #28a745;
}

.log-entry.warning .log-message {
    color: #ffc107;
}

.log-entry.error .log-message {
    color: #dc3545;
}

/* 导出按钮样式 */
#export-results-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#export-results-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#export-results-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 快捷键反馈样式 */
.shortcut-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    z-index: 10000;
    opacity: 0;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    /* 平板设备布局调整 */
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.8rem;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.4rem 0.8rem;
    }
    
    .container {
        padding: 0.8rem;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 0.6rem;
        gap: 0.8rem;
    }
    
    .panel-header {
        margin-bottom: 0.6rem;
        padding-bottom: 0.4rem;
    }
    
    .panel-header h3 {
        font-size: 1rem;
    }
    
    /* 监控面板响应式调整 */
    .monitor-content {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .monitor-item {
        font-size: 0.8rem;
    }
    
    .monitor-label {
        width: 3.5rem;
        font-size: 0.75rem;
    }
    
    .monitor-bar {
        width: 2.5rem;
        height: 0.25rem;
    }
    
    .monitor-value {
        width: 2rem;
        font-size: 0.75rem;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    body {
        padding: 0.5rem;
    }
    
    /* 手机设备布局调整 */
    .header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.5rem 0;
    }
    
    .header-left,
    .header-right {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 0.4rem 0.5rem;
    }
    
    .main-content {
        gap: 0.6rem;
        height: calc(100vh - 160px);
    }
    
    .image-comparison {
        flex-direction: column;
    }
    
    .vs-divider {
        width: 100%;
        height: 2rem;
        margin: 0.3rem 0;
    }
    
    .detect-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .panel-title {
        font-size: 0.9rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
        padding: 0.6rem;
    }
    
    .stat-icon {
        margin-right: 0;
        width: 2rem;
        height: 2rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .panel-header {
        margin-bottom: 0.4rem;
        padding-bottom: 0.3rem;
    }
    
    .panel-header h3 {
        font-size: 0.9rem;
    }
    
    .chart-container {
        height: 150px;
        min-height: 150px;
        padding: 0.4rem;
    }
    
    /* 手机端监控面板调整 */
    .monitor-content {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    
    .monitor-item {
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    
    .monitor-label {
        width: 3rem;
        font-size: 0.7rem;
    }
    
    .monitor-bar {
        width: 2rem;
        height: 0.2rem;
    }
    
    .monitor-value {
        width: 1.8rem;
        font-size: 0.7rem;
    }
}

/* 响应式基础设置 */
html {
    font-size: 16px;
}

/* 大屏适配 */
@media screen and (min-width: 1920px) {
    html {
        font-size: 18px;
    }
}

@media screen and (min-width: 2560px) {
    html {
        font-size: 20px;
    }
}

@media screen and (min-width: 3840px) {
    html {
        font-size: 24px;
    }
}

/* 小屏适配 */
@media screen and (max-width: 1366px) {
    html {
        font-size: 14px;
    }
}

@media screen and (max-width: 1024px) {
    html {
        font-size: 12px;
    }
}

body {
    min-height: 100vh;
}

.container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 0; /* 确保flex容器内无额外间距 */
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;  /* 改为底部对齐 */
    padding: 0 1rem 0.02rem 1rem;  /* 只保留底部内边距 */
    border-bottom: 0.5px solid rgba(0, 212, 255, 0.2);  /* 减小边框厚度 */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 0 1px 3px rgba(0, 212, 255, 0.2);  /* 减少阴影大小 */
    flex-shrink: 0;
    height: 48px;  /* 进一步增加高度，更宽松舒适 */
    line-height: 1;
    margin: 0;  /* 确保无外边距 */
    margin-bottom: -1px;  /* 轻微负margin，保持适当间距 */
    box-sizing: border-box;  /* 确保padding包含在高度内 */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo svg {
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.title {
    font-size: 1.8rem;  /* 适当增加字体大小，更协调 */
    font-weight: bold;
    background: linear-gradient(45deg, #00d4ff, #0099cc, #006699);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    line-height: 1;
    margin: 0;  /* 确保无外边距 */
    padding: 0;  /* 确保无内边距 */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

/* 全屏按钮样式 */
.fullscreen-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 0.5rem;
    padding: 0.625rem 0.9375rem;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.fullscreen-btn:hover {
    background: linear-gradient(135deg, #00ffff, #00d4ff);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.fullscreen-btn:active {
    transform: translateY(0);
}

.fullscreen-btn.exit-fullscreen {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.fullscreen-btn.exit-fullscreen:hover {
    background: linear-gradient(135deg, #ff8787, #ff6b6b);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.datetime {
    font-size: 1rem;
    color: #00d4ff;
    font-family: 'Courier New', monospace;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 1rem;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #4ecdc4;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 统计面板 */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;  /* 完全移除间距 */
    padding: 0 1rem;  /* 移除上下内边距 */
    flex-shrink: 0;
    height: 44px;  /* 适当增加高度，保持协调 */
    line-height: 1;
    margin: 0;  /* 确保无外边距 */
    margin-top: -2px;  /* 轻微负margin，保持适当间距 */
    box-sizing: border-box;  /* 确保padding包含在高度内 */
    align-items: center;  /* 垂直居中对齐 */
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 99, 153, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 0.3rem;  /* 适当圆角，更美观 */
    padding: 0.4rem 0.6rem;  /* 适当增加内边距，更舒适 */
    display: flex;
    align-items: center;
    gap: 0.6rem;  /* 适当增加间距，更舒适 */
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin: 0;  /* 确保无外边距 */
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.6);
}

.stat-icon {
    width: 2rem;  /* 适当图标大小 */
    height: 2rem;  /* 适当图标大小 */
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    margin-right: 0.8rem;  /* 适当右边距，更美观 */
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.2rem;  /* 适当增大字体大小 */
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 0.1rem;  /* 轻微底部边距 */
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;  /* 适当增大标签字体大小 */
    color: rgba(255, 255, 255, 0.7);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;  /* 减少字间距 */
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    width: 100vw;
    height: calc(100vh - 91px);  /* 宽松计算：header 48px + stats-panel 44px = 92px，减去1px负margin调整 */
    overflow: hidden;
}

/* 面板通用样式 */
/* 左侧面板 */
.left-panel {
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.panel-header h3 {
    color: #00d4ff;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1;
}

/* 左侧图片库 */
.image-gallery {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.5rem;
}
/* 图像项 */
.image-item {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 0.1rem solid transparent;
}

.image-item:hover {
    transform: scale(1.05);
    border-color: #00d4ff;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

.image-item.selected {
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 中间对比区域 */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-container {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding: 1rem;
    backdrop-filter: blur(10px);
    height: 70%;
}
/* 图像对比容器 */
.image-comparison {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 0;
.monitor-panel {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    backdrop-filter: blur(10px);
    height: 45%;
}display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: bold;
    color: #00d4ff;
    text-align: center;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding-bottom: 0.5rem;
    flex-shrink: 0;
}

.title-icon {
    font-size: 1.2rem;
}

.image-container {
    flex: 1;
    border: 0.15rem dashed rgba(0, 212, 255, 0.3);
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    height: calc(100% - 60px);
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
/* 占位符 */
.placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    width: 90%;
    max-width: 15rem;
}/* 占位符SVG */
.placeholder svg {
    margin-bottom: 0.5rem;
    width: 3rem;
    height: 3rem;
    max-width: 100%;
}

.vs-divider {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 检测控制 */
.detect-controls {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    padding: 1rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    flex-shrink: 0;
    height: 30%;
}

.detect-btn {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
}

.detect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.progress-container {
    width: 100%;
    text-align: center;
}
/* 进度条 */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #4ecdc4);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: #00d4ff;
    font-size: 0.9rem;
}

/* 右侧面板 */
.right-panel {
    background: rgba(255, 255, 255, 0.05);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* 结果面板 */
.result-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.result-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.no-result {
    text-align: center;
    padding: 2.5rem 1.2rem;
    color: #666;
}

.detection-result {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 0.6rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
/* 结果项 */
.result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 0.25rem solid #00d4ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 结果描述 */
.result-description {
    font-size: 0.8rem;
    color: #cccccc;
    line-height: 1.3;
}

/* 结果标题 */
.result-title {
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.result-label {
    color: #888;
    font-size: 0.9rem;
}

.result-value {
    color: #00d4ff;
    font-weight: bold;
    font-size: 0.9rem;
}
/* 严重级别标签 */
.severity-badge {
    padding: 0.2rem 0.4rem;
    border-radius: 0.6rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.severity-high {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.severity-medium {
    background: rgba(255, 167, 38, 0.2);
    color: #ffa726;
    border: 1px solid #ffa726;
}

.severity-low {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    border: 1px solid #4ecdc4;
}

/* 监控面板 */
.monitor-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    margin-bottom: 1rem;
    height: 45%;
}/* 监控内容 */
.monitor-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}/* 监控项 */
.monitor-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.monitor-label {
    width: 4rem;
    font-size: 0.8rem;
    color: #888;
    flex-shrink: 0;
}

.monitor-bar {
    width: 3rem;
    height: 0.3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.15rem;
    overflow: hidden;
    margin: 0 0.3rem;
}
/* 监控填充 */
.monitor-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #4ecdc4);
    border-radius: 0.2rem;
    transition: width 0.3s ease;
}

.monitor-value {
    width: 2.5rem;
    text-align: right;
    font-size: 0.8rem;
    color: #00d4ff;
    font-weight: bold;
    flex-shrink: 0;
}

/* 实时监测面板 */
.realtime-panel {
    flex: 1;
    overflow-y: auto;
    height: calc(100% - 45% - 55% - 2rem);
}

/* 图表面板 */
.chart-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    overflow: hidden;
    height: 55%;
}

.chart-container {
    height: calc(100% - 40px);
    margin-top: 0.5rem;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.6rem;
    padding: 1rem;
}

/* 按钮样式 */
.refresh-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #00d4ff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.refresh-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}

/* 图片放大模态框 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content img {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    object-fit: contain;
    border-radius: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-close:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

.modal-title {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* 系统警告样式 */
.system-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.warning-icon {
    font-size: 1.5rem;
    animation: pulse 1s infinite;
}

.warning-content {
    display: flex;
    flex-direction: column;
}

.warning-title {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.warning-text {
    font-size: 0.8rem;
    opacity: 0.9;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 状态指示器动画 */
.status-dot {
    transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        width: 100% !important;
        max-width: none;
    }
    
    .image-comparison {
        flex-direction: column;
        height: auto;
    }
    
    .image-container {
        height: 40vh;
        min-height: 300px;
    }
}

@media (max-width: 1200px) {
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        width: 100% !important;
        max-width: none;
    }
    
    .image-comparison {
        flex-direction: column;
        height: auto;
    }
    
    .image-container {
        height: 35vh;
        min-height: 250px;
    }
}

/* 缺陷统计面板样式 */
.defect-stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.defect-stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.defect-stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.defect-stat-card.normal {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
}

.defect-stat-card.normal:hover {
    background: rgba(40, 167, 69, 0.15);
}

.defect-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.defect-type {
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 500;
}

.defect-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
}

.defect-stat-card.normal .defect-count {
    color: #28a745;
}

.defect-stat-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.defect-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.defect-stat-fill.normal {
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* 检测历史面板样式 */
.detection-history-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow: hidden;
}

.detection-history-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detection-history-panel .panel-header h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

.clear-history-btn {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: rgba(244, 67, 54, 0.3);
    color: #fff;
}

.detection-history-content {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.detection-history-content::-webkit-scrollbar {
    width: 6px;
}

.detection-history-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.detection-history-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.detection-history-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.history-item {
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
    border-left: 3px solid #ff6b6b;
    transition: all 0.3s ease;
}

.history-item.success {
    border-left-color: #28a745;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.history-image {
    font-size: 0.8rem;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-result {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff6b6b;
}

.history-item.success .history-result {
    color: #28a745;
}

.history-defect {
    font-size: 0.8rem;
    color: #ffa726;
    font-weight: 500;
}

.history-time {
    font-size: 0.7rem;
    color: #999;
    text-align: right;
}

.no-history {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-history svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-history p {
    margin: 0;
    font-size: 0.9rem;
}

/* 新检测动画效果 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.highlight-new {
    animation: pulse 2s ease-in-out;
    background: rgba(255, 107, 107, 0.1) !important;
    border-left-color: #ff6b6b !important;
}

.highlight-new.success {
    background: rgba(40, 167, 69, 0.1) !important;
    border-left-color: #28a745 !important;
}

/* 算法选择器样式 */
#algorithm-select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #00d4ff;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    outline: none;
}

#algorithm-select:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

#algorithm-select:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

#algorithm-select option {
    background: #1a1a1a;
    color: #00d4ff;
    padding: 0.3rem;
}