/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题样式 */
.title {
    text-align: center;
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 30px;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.title span {
    color: #e74c3c;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* 控制面板 */
.control-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.control-panel h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #34495e;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 设置项 */
.setting-item {
    margin-bottom: 25px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.setting-item small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.8em;
}

/* 滑块样式 */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

/* 选择框样式 */
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 模式按钮 */
.mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.mode-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 文件上传 */
.file-input-wrapper {
    position: relative;
    margin-top: 10px;
}

input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-name {
    display: block;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #666;
    text-align: center;
    z-index: 1;
}

/* 按钮样式 */
.detect-btn {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.detect-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.detect-btn:active {
    transform: translateY(0);
}

.stop-btn {
    background: #e74c3c;
}

.stop-btn:hover {
    background: #c0392b;
}

.export-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.export-btn:hover {
    background: #229954;
}

.btn-icon {
    font-size: 18px;
}

/* 结果面板 */
.result-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.result-panel h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #34495e;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 预览区域 */
.preview-area {
    position: relative;
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #f8f9fa;
}

.preview-area img,
.preview-area video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* 检测结果 */
.detection-results {
    margin-top: 20px;
}

.detection-results h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #34495e;
}

.results-header {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
    font-weight: 500;
    font-size: 14px;
    color: #555;
}

.results-body {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr 1fr;
    gap: 10px;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:nth-child(even) {
    background: #f9f9f9;
}

.no-results {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 16px;
    color: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 2em;
    }
    
    .control-panel,
    .result-panel {
        padding: 20px;
    }
    
    .preview-area {
        height: 300px;
    }
    
    .results-header,
    .result-item {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        font-size: 12px;
    }
    
    .results-header span,
    .result-item span {
        word-break: break-word;
    }
}

/* 滚动条样式 */
.results-body::-webkit-scrollbar {
    width: 8px;
}

.results-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.results-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.results-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 火灾检测结果样式 */
.result-item.fire {
    border-left: 4px solid #e74c3c;
}

.result-item.smoke {
    border-left: 4px solid #95a5a6;
}
