

/* ========================================
   计时管理界面重构样式
   ======================================== */

/* 顶部统计栏 */
.timer-stats-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 20px;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* 主控制面板 */
.timer-control-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.panel-title i {
    color: #4f46e5;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-tabs-wrapper {
    display: flex;
    align-items: center;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 14px;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    width: 200px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    border-color: #4f46e5;
    outline: none;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #f3f4f6;
    color: #4f46e5;
    border-color: #4f46e5;
}

.toolbar-btn.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* 设备容器 */
.timer-devices-container {
    padding: 20px;
    background: #f8fafc;
    min-height: 300px;
}

/* 活跃会话面板 */
.active-sessions-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.session-count-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.sessions-table-container {
    overflow-x: auto;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.sessions-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.sessions-table tbody tr {
    transition: all 0.2s ease;
}

.sessions-table tbody tr:hover {
    background: #f8fafc;
}

.sessions-table .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.sessions-table .status-active {
    background: #dcfce7;
    color: #166534;
}

.sessions-table .status-paused {
    background: #fef3c7;
    color: #92400e;
}

.sessions-table .status-completed {
    background: #e0e7ff;
    color: #3730a3;
}

.sessions-table .action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.sessions-table .action-btn:last-child {
    margin-right: 0;
}

.sessions-table .btn-pause {
    background: #fef3c7;
    color: #92400e;
}

.sessions-table .btn-pause:hover {
    background: #fde68a;
}

.sessions-table .btn-resume {
    background: #dcfce7;
    color: #166534;
}

.sessions-table .btn-resume:hover {
    background: #bbf7d0;
}

.sessions-table .btn-end {
    background: #fee2e2;
    color: #991b1b;
}

.sessions-table .btn-end:hover {
    background: #fecaca;
}

/* 设备卡片新样式 */
.timer-device-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.timer-device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.timer-device-card.status-available {
    border-color: #10b981;
}

.timer-device-card.status-occupied {
    border-color: #ef4444;
}

.timer-device-card.status-paused {
    border-color: #f59e0b;
}

.timer-device-card.status-maintenance {
    border-color: #6b7280;
    opacity: 0.7;
}

.device-card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.device-card-header.available {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.device-card-header.occupied {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.device-card-header.paused {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.device-card-header.maintenance {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.device-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.device-type {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.available {
    background: #10b981;
    color: white;
}

.status-indicator.occupied {
    background: #ef4444;
    color: white;
}

.status-indicator.paused {
    background: #f59e0b;
    color: white;
}

.status-indicator.maintenance {
    background: #6b7280;
    color: white;
}

.device-card-body {
    padding: 16px;
}

.timer-display-large {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin-bottom: 12px;
    color: #1e293b;
}

.timer-display-large.overtime {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
}

.cost-display-large {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #10b981;
    margin-bottom: 12px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.info-item {
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
}

.info-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 2px;
}

.info-value {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
}

.device-card-actions {
    display: flex;
    gap: 8px;
}

.btn-start-timer, .btn-stop-timer {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-start-timer {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.btn-start-timer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-stop-timer {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-stop-timer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-pause-timer {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-pause-timer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .panel-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .toolbar-left {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .sessions-table {
        font-size: 12px;
    }
    
    .sessions-table th,
    .sessions-table td {
        padding: 10px 8px;
    }
}

/* 动画效果 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
}

.timer-device-card.status-occupied {
    animation: pulse-glow 2s infinite;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 14px;
    color: #d1d5db;
}

/* 加载状态 */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .timer-stats-bar {
        background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    }
    
    .timer-control-panel,
    .active-sessions-panel {
        background: #1f2937;
    }
    
    .panel-header {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
        border-color: #4b5563;
    }
    
    .panel-title {
        color: #f3f4f6;
    }
    
    .panel-toolbar {
        background: #1f2937;
        border-color: #374151;
    }
    
    .search-box input,
    .filter-select,
    .toolbar-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .sessions-table th {
        background: #374151;
        color: #9ca3af;
        border-color: #4b5563;
    }
    
    .sessions-table td {
        color: #e5e7eb;
        border-color: #374151;
    }
    
    .sessions-table tbody tr:hover {
        background: #374151;
    }
    
    .timer-devices-container {
        background: #111827;
    }
    
    .timer-device-card {
        background: #1f2937;
    }
    
    .device-card-header.available {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    }
    
    .device-card-header.occupied {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    }
    
    .device-name {
        color: #f3f4f6;
    }
    
    .device-type {
        color: #9ca3af;
    }
    
    .info-item {
        background: #374151;
    }
    
    .info-label {
        color: #9ca3af;
    }
    
    .info-value {
        color: #f3f4f6;
    }
}
