* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fb;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.logo h2 {
    font-size: 1.5rem;
    margin: 10px 0;
}

.nav-links {
    list-style: none;
    margin-top: 20px;
}

.nav-links li {
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.nav-links li.active {
    background: #34495e;
    border-left: 4px solid #3498db;
}

.nav-links li:hover {
    background: #34495e;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.status {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.active {
    background: #2ecc71;
}

/* 仪表盘样式 */
.dashboard {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.camera-section {
    flex: 2;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.recognition-section {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.camera-view h3, .recognition-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.video-container {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.detection-box {
    position: absolute;
    border: 2px solid #27ae60;
    border-radius: 4px;
    animation: pulse 2s infinite;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.detection-box .label {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 14px;
    position: absolute;
    top: -30px;
    left: 10px;
    white-space: nowrap;
}

.highlight {
    animation: highlight 1s;
}

@keyframes highlight {
    0% { box-shadow: 0 0 0 4px rgba(39, 174, 96, 0); }
    50% { box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.5); }
    100% { box-shadow: 0 0 0 4px rgba(39, 174, 96, 0); }
}

.zoom-in {
    animation: zoomIn 0.8s;
}

@keyframes zoomIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.fade-out {
    animation: fadeOut 1s;
    opacity: 0;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* 识别启动动画样式 */
.recognition-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.recognition-animation.active {
    opacity: 1;
}

.scanning-effect {
    position: relative;
    width: 80%;
    height: 70%;
    border: 2px solid rgba(52, 152, 219, 0.7);
    border-radius: 5px;
    overflow: hidden;
}

.scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, #3498db, transparent);
    animation: scanning 2s infinite linear;
}

.scanning-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(52, 152, 219, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52, 152, 219, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.7;
}

@keyframes scanning {
    0% { top: 0; }
    100% { top: calc(100% - 4px); }
}

.recognition-message {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-dots .dot {
    animation: dotPulse 1.5s infinite;
    opacity: 0;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: 0.5s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 1s;
}

@keyframes dotPulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* 暂停遮罩样式 */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.pause-overlay.active {
    opacity: 1;
}

.pause-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.pause-bar {
    width: 6px;
    height: 20px;
    background: white;
    margin: 0 4px;
    border-radius: 2px;
}

.pause-message {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.resume-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.controls button {
    flex: 1;
    margin: 0 5px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.controls button:first-child {
    margin-left: 0;
}

.controls button:last-child {
    margin-right: 0;
}

.start-btn {
    background-color: #27ae60;
    color: white;
}

.pause-btn {
    background-color: #f39c12;
    color: white;
}

.settings-btn {
    background-color: #3498db;
    color: white;
}

.controls button:hover {
    filter: brightness(1.1);
}

.controls button:active, .controls button.active {
    transform: translateY(2px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 状态指示器样式 */
.status {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #e74c3c;
    margin-right: 8px;
}

.status-indicator.active {
    background-color: #27ae60;
}

.pulse {
    animation: pulse 2s;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

/* 行为列表样式 */
.behavior-list {
    max-height: 300px;
    overflow-y: auto;
}

.behavior-item {
    display: flex;
    padding: 12px 15px;
    border-radius: 6px;
    background-color: #f9f9f9;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.behavior-item.current {
    background-color: #e8f4fc;
    border-left-color: #3498db;
}

.behavior-icon {
    font-size: 24px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.behavior-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.behavior-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.behavior-confidence, .behavior-time {
    font-size: 14px;
    color: #666;
    margin-bottom: 3px;
}

.behavior-description {
    font-size: 13px;
    color: #777;
    margin-top: 3px;
}

.highlight-behavior {
    animation: highlightBehavior 1s;
}

@keyframes highlightBehavior {
    0% { background-color: #d5e9f7; }
    50% { background-color: #b0d5ee; }
    100% { background-color: #e8f4fc; }
}

.fade-in {
    animation: fadeIn 0.8s;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 摄像头设置模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 700px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

.setting-item select, .setting-item input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.slider-container {
    display: flex;
    align-items: center;
}

.slider-container input[type="range"] {
    flex: 1;
    margin-right: 10px;
}

.slider-value {
    width: 50px;
    text-align: right;
    font-size: 14px;
    color: #666;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.preview-container {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.preview-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.camera-preview {
    width: 320px;
    height: 240px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    border: 1px solid #ddd;
}

.camera-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.preview-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.preview-status {
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.preset-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 6px;
    border: 2px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-item:hover {
    background-color: #f9f9f9;
}

.preset-item.active {
    border-color: #3498db;
    background-color: #eaf5fd;
}

.preset-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.preset-name {
    font-size: 14px;
    font-weight: 500;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

#reset-camera-btn {
    background-color: #f1f1f1;
    color: #333;
}

.save-camera-btn {
    background-color: #3498db;
    color: white;
}

.btn:hover {
    filter: brightness(1.05);
}

.small-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    background-color: #f1f1f1;
    color: #333;
    transition: all 0.2s;
}

.small-btn:hover {
    background-color: #e1e1e1;
}

/* 统计图表样式 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 12px 15px;
}

.stat-item.full-width {
    grid-column: span 2;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-label {
    font-weight: 500;
    color: #555;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.stat-bar-container {
    width: 100%;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.stat-bar.good {
    background-color: #27ae60;
}

.stat-bar.warning {
    background-color: #f39c12;
}

.stat-bar.critical {
    background-color: #e74c3c;
}

.stat-indicator {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    color: white;
}

.stat-indicator.good {
    background-color: #27ae60;
}

.stat-indicator.warning {
    background-color: #f39c12;
}

.stat-indicator.critical {
    background-color: #e74c3c;
}

.system-message {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}

.uptime {
    font-size: 13px;
    color: #777;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    background-color: #f8f8f8;
    color: #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    display: flex;
    align-items: center;
    font-weight: 500;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.hide {
    transform: translateY(-10px);
    opacity: 0;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
}

.notification.warning {
    background-color: #fff3cd;
    color: #856404;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
}

.notification-icon {
    margin-right: 10px;
}

.warning {
    color: #e74c3c;
}

/* 图表容器样式优化 */
.chart-container {
    height: auto;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-container h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.chart-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

#time-period-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f8f9fa;
}

.refresh-chart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f5f7fb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-chart-btn:hover {
    background-color: #e1e7f0;
    transform: rotate(15deg);
}

.refresh-chart-btn:active {
    transform: rotate(180deg);
}

.refresh-icon {
    font-size: 16px;
}

.chart-container-inner {
    position: relative;
    height: 250px;
    margin-bottom: 15px;
}

.chart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.behavior-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    text-align: center;
}

.total-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.total-value {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.behavior-details-panel {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.behavior-detail-item {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.behavior-detail-item:hover {
    background-color: #f5f7fb;
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

.behavior-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 5px;
}

.behavior-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}

.behavior-percentage {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 3px;
    color: #333;
}

.behavior-duration {
    font-size: 12px;
    color: #666;
}

@media (max-width: 768px) {
    .behavior-details-panel {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-options {
        margin-top: 10px;
        width: 100%;
    }
    
    #time-period-select {
        flex: 1;
    }
}

/* 响应式设计 */
@media (max-width: 1100px) {
    .dashboard, .statistics {
        flex-direction: column;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .anomaly-section {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .logo h2, .nav-links a span:not(.icon) {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .icon {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
}

/* 设置页面样式 */
.settings-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.tab:hover {
    background: #f5f7fb;
}

.tab.active {
    background: #3498db;
    color: white;
}

.settings-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    min-height: 400px;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.settings-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.setting-item input[type="text"],
.setting-item input[type="email"],
.setting-item input[type="password"],
.setting-item input[type="tel"],
.setting-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button input {
    flex: 1;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
}

.slider-value {
    font-weight: bold;
    color: #2c3e50;
    min-width: 40px;
    text-align: right;
}

.slider-desc {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.storage-info {
    margin-bottom: 15px;
}

.storage-bar {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    margin-bottom: 8px;
    overflow: hidden;
}

.storage-used {
    height: 100%;
    background: #3498db;
    border-radius: 5px;
}

.storage-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.camera-list {
    margin-bottom: 15px;
}

.camera-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    margin-bottom: 10px;
}

.camera-info {
    flex: 2;
}

.camera-info h4 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1rem;
}

.device-details {
    font-size: 0.85rem;
    color: #7f8c8d;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.camera-preview {
    flex: 1;
    text-align: center;
}

.camera-preview img {
    border-radius: 4px;
    max-width: 100%;
}

.camera-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.add-camera-btn {
    padding: 10px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.add-camera-btn:hover {
    background: #27ae60;
}

.behavior-types-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.behavior-type-item {
    display: flex;
    align-items: center;
}

.behavior-type-item input[type="checkbox"] {
    margin-right: 8px;
}

.account-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.account-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.account-avatar img {
    border-radius: 50%;
}

.account-details {
    flex: 1;
}

.password-change-btn {
    background: #3498db;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.password-change-btn:hover {
    background: #2980b9;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 0;
}

.cancel-btn {
    background: #ecf0f1;
    color: #7f8c8d;
}

.cancel-btn:hover {
    background: #bdc3c7;
}

.save-btn {
    background: #3498db;
    color: white;
}

.save-btn:hover {
    background: #2980b9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .settings-tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex-basis: 50%;
    }
    
    .behavior-types-list {
        grid-template-columns: 1fr;
    }
    
    .camera-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .camera-info, .camera-preview, .camera-actions {
        width: 100%;
    }
    
    .camera-actions {
        flex-direction: row;
    }
}

/* 历史记录页样式 */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-field label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.date-field input[type="date"] {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-btn {
    background: #3498db;
    color: white;
    padding: 6px 15px;
}

.search-btn:hover {
    background: #2980b9;
}

.filter-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.reset-btn {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 8px 15px;
    margin-left: auto;
}

.reset-btn:hover {
    background: #bdc3c7;
}

.video-preview-section, .history-table-section {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
}

.video-actions {
    display: flex;
    gap: 10px;
}

.video-player {
    width: 100%;
    position: relative;
}

.video-container {
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.video-container img {
    width: 100%;
    height: auto;
    display: block;
}

.video-info {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    padding: 10px 15px;
}

.video-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.video-details {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #bdc3c7;
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2c3e50;
    color: white;
    padding: 8px 15px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.control-btn {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress {
    height: 100%;
    background: #3498db;
    border-radius: 2px;
    width: 0%;
}

.time-display {
    font-size: 0.8rem;
    color: #bdc3c7;
    min-width: 90px;
    text-align: center;
}

.sortable {
    cursor: pointer;
    position: relative;
}

.sort-icon {
    margin-left: 5px;
    font-size: 0.8rem;
}

.export-options {
    position: relative;
    display: inline-block;
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 10;
    min-width: 150px;
}

.export-option {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.export-option:hover {
    background: #f5f7fb;
}

.behavior-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.behavior-tag.eating {
    background-color: #e74c3c;
}

.behavior-tag.resting {
    background-color: #3498db;
}

.behavior-tag.activity {
    background-color: #f39c12;
}

.behavior-tag.social {
    background-color: #27ae60;
}

.behavior-tag.drinking {
    background-color: #9b59b6;
}

.confidence-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.confidence-level {
    height: 100%;
    background: #2ecc71;
    text-align: center;
    color: white;
    font-size: 0.8rem;
    line-height: 20px;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.9rem;
    padding: 0;
    background: #ecf0f1;
    color: #7f8c8d;
}

.action-btn:hover {
    background: #3498db;
    color: white;
}

.history-table tr {
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-table tr:hover {
    background: #f5f7fb;
}

.history-table tr.selected {
    background: #e3f2fd;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modalOpen 0.3s ease;
}

@keyframes modalOpen {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    color: #2c3e50;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: #7f8c8d;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.behavior-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.behavior-timestamp {
    font-size: 0.95rem;
    color: #7f8c8d;
}

.behavior-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.detail-group {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.detail-value {
    font-weight: 500;
    color: #2c3e50;
}

.behavior-metrics {
    margin-bottom: 20px;
}

.behavior-metrics h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.metric-card {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 12px;
}

.metric-title {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.metric-value {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 10px;
}

.metric-chart {
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
}

.bar-indicator {
    height: 100%;
    background: #3498db;
}

.behavior-notes {
    margin-top: 20px;
}

.behavior-notes h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.behavior-notes textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 10px;
}

.save-notes-btn {
    background: #3498db;
    color: white;
    padding: 8px 15px;
}

.save-notes-btn:hover {
    background: #2980b9;
}

/* 加载状态 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1000px) {
    .behavior-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .date-range-picker {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .reset-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .video-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .behavior-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* 通知样式 */
#notification {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #34495e;
    color: white;
    padding: 12px 25px;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 0.95rem;
    transition: top 0.3s ease;
}

#notification.show {
    top: 20px;
}

#notification.error {
    background-color: #e74c3c;
}

/* 改进按钮交互状态 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.active, .start-btn.active {
    background-color: #2980b9;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.pause-btn.active {
    background-color: #c0392b;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

/* 自定义日期容器 */
.custom-date-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    align-items: center;
}

.apply-date-btn {
    background: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.apply-date-btn:hover {
    background: #2980b9;
}

/* 统计值警告颜色 */
.stat-value.warning {
    color: #e74c3c;
}

/* 摄像头数据更新样式 */
.camera-item h4 {
    position: relative;
}

.camera-item h4::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
}

.camera-item h4:contains("已连接")::after {
    background: #2ecc71;
}

/* 表格行选中状态 */
.data-table tbody tr.selected {
    background-color: #e3f2fd;
}

/* 行为类型标签 */
.behavior-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.behavior-tag.eating {
    background-color: #e74c3c;
}

.behavior-tag.resting {
    background-color: #3498db;
}

.behavior-tag.activity {
    background-color: #f39c12;
}

.behavior-tag.social {
    background-color: #27ae60;
}

.behavior-tag.drinking {
    background-color: #9b59b6;
}

/* 帮助页面样式 */
.help-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.help-nav-item {
    flex: 1;
    min-width: 120px;
    padding: 15px 10px;
    background: white;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.help-nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.help-nav-item.active {
    background: #3498db;
    color: white;
}

.help-nav-item.search-match {
    border: 2px solid #e74c3c;
}

.help-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.help-title {
    font-weight: 500;
}

/* 帮助内容样式 */
.help-section {
    display: none;
    margin-bottom: 30px;
}

.help-section.active {
    display: block;
}

.help-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.help-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.help-card.search-highlight {
    border-left: 4px solid #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

.help-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.help-image {
    width: 100%;
    max-width: 800px;
    border-radius: 4px;
    margin: 10px 0;
}

.help-image-caption {
    text-align: center;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.help-note, .help-tip {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.help-note p, .help-tip p {
    margin: 0;
}

.help-tip {
    border-left-color: #2ecc71;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.help-table th, .help-table td {
    padding: 10px 15px;
    text-align: left;
    border: 1px solid #ecf0f1;
}

.help-table th {
    background: #f5f7fb;
    font-weight: bold;
    color: #2c3e50;
}

.help-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* FAQ 样式 */
.faq-item {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 15px;
    background: #f5f7fb;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.faq-toggle {
    font-size: 1.5rem;
    color: #7f8c8d;
    font-weight: bold;
}

.faq-answer {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.faq-item.expanded .faq-answer {
    padding: 15px;
}

/* 故障排除样式 */
.troubleshooting-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.troubleshooting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.troubleshooting-item h4 {
    color: #e74c3c;
    margin-bottom: 10px;
}

/* 搜索状态样式 */
#search-status {
    position: absolute;
    right: 10px;
    top: 100%;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 5px;
    display: none;
}

.search-found {
    background: #eafaf1;
    color: #27ae60;
}

.search-not-found {
    background: #fdecea;
    color: #e74c3c;
}

/* 时间范围选择器样式 */
.time-range-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.time-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-field label {
    font-size: 0.9rem;
}

.time-field input[type="time"] {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 输入验证样式 */
.input-validation {
    font-size: 0.85rem;
    margin-top: 5px;
    height: 20px;
}

.validation-error {
    color: #e74c3c;
}

.validation-success {
    color: #2ecc71;
}

/* 图表加载效果 */
.chart-loading-overlay {
    position: absolute;
    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: 10;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.chart-loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.refresh-chart-btn.rotating {
    animation: rotateButton 0.8s ease-in-out;
}

@keyframes rotateButton {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 版权信息样式 */
.footer {
    text-align: center;
    padding: 15px 0;
    font-size: 0.85rem;
    color: #7f8c8d;
    border-top: 1px solid #ecf0f1;
    margin-top: 20px;
    background: white;
}

.copyright {
    font-weight: 500;
}