/* ================================================
   ZQR™ 数智云平台 - 管理端 v8.0 样式表
   核心宗旨：客户至上·效率第一·人性化·傻瓜式
   ================================================ */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 主色调 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;
    
    /* 辅助色 */
    --success-color: #10b981;
    --success-light: #d1fae5;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --info-color: #6366f1;
    --info-light: #e0e7ff;
    
    /* 中性色 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-dark: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 侧边栏 */
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --header-height: 60px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ==================== 基础样式 ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* ==================== 登录页样式 ==================== */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    display: inline-block;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    font-size: 24px;
    font-weight: bold;
    line-height: 72px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-secondary);
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background: var(--danger-light);
    color: var(--danger-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    text-align: center;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ==================== 按钮样式 ==================== */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 6px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== 主应用布局 ==================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部导航 */
.app-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    padding: 4px 0;
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: var(--transition-fast);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.header-title {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* 主体区域 */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ==================== 侧边栏样式 ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: white;
    overflow-y: auto;
    transition: width var(--transition-normal);
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 12px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
    font-size: 14px;
}

.nav-badge {
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.nav-badge:empty {
    display: none;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

/* ==================== 页面头部 ==================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-item select,
.filter-item input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: white;
    min-width: 120px;
}

.search-input {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 12px;
}

.search-input input {
    border: none;
    padding: 8px;
    min-width: 200px;
    font-size: 13px;
}

.search-input input:focus {
    outline: none;
}

.search-input button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}

/* ==================== 数据表格 ==================== */
.data-table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-primary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-primary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格操作按钮 */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

/* ==================== 状态标签 ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    gap: 4px;
}

.status-badge.pending {
    background: var(--warning-light);
    color: #b45309;
}

.status-badge.approved {
    background: var(--success-light);
    color: #047857;
}

.status-badge.rejected {
    background: var(--danger-light);
    color: #b91c1c;
}

.status-badge.disabled {
    background: var(--border-light);
    color: var(--text-muted);
}

.status-badge.in-progress {
    background: var(--info-light);
    color: #4338ca;
}

.status-badge.completed {
    background: var(--success-light);
    color: #047857;
}
.status-badge.draft {
    background: #f3f4f6;
    color: #6b7280;
}
.status-badge.submitted {
    background: #dbeafe;
    color: #1d4ed8;
}
.status-badge.reviewing {
    background: #fef3c7;
    color: #92400e;
}
.status-badge.in_progress {
    background: #fff3e0;
    color: #e65100;
}
.status-badge.delivered {
    background: #e8eaf6;
    color: #283593;
}
.status-badge.archived {
    background: #efebe9;
    color: #4e342e;
}
.status-badge.revision_needed {
    background: #fee2e2;
    color: #dc2626;
}

/* ==================== 卡片布局 ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.clinic-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.clinic-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.clinic-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.clinic-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.clinic-card-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.clinic-card-body {
    margin-bottom: 16px;
}

.clinic-card-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

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

.clinic-card-item label {
    color: var(--text-muted);
}

.clinic-card-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-card-icon.blue { background: var(--primary-light); }
.stat-card-icon.green { background: var(--success-light); }
.stat-card-icon.orange { background: var(--warning-light); }
.stat-card-icon.purple { background: var(--info-light); }

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== 病例进度 ==================== */
.case-progress {
    display: flex;
    gap: 4px;
    align-items: center;
}

.progress-step {
    width: 32px;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
}

.progress-step.active {
    background: var(--primary-color);
}

.progress-step.completed {
    background: var(--success-color);
}

/* ==================== 病例详情页 ==================== */
.case-detail-container {
    max-width: 1200px;
    margin: 0 auto;
}

.case-detail-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.case-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.case-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.case-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.case-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-header-actions {
    display: flex;
    gap: 12px;
}

.case-progress-detail {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.stage-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
}

.stage-dot.active {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.stage-dot.completed {
    background: var(--success-color);
}

.stage-label {
    font-size: 13px;
    color: var(--text-muted);
}

.stage-label.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* 阶段详情卡片 */
.stages-container {
    display: grid;
    gap: 24px;
}

.stage-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.stage-card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stage-card-body {
    padding: 24px;
}

.stage-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stage-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stage-info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-info-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* 评分显示 */
.score-display {
    margin-top: 16px;
}

.score-display-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.score-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.score-item-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.score-item-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.score-item-value.low {
    color: var(--danger-color);
}

.score-item-value.mid {
    color: var(--warning-color);
}

.score-item-value.high {
    color: var(--success-color);
}

.score-average {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-light), var(--info-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avg-score-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.avg-score-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 文件列表 */
.files-section {
    margin-top: 24px;
}

.files-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.file-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: var(--border-light);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.file-name {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 照片画廊 */
.photos-section {
    margin-top: 24px;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    color: white;
    font-size: 24px;
}

/* ==================== 评分表单 ==================== */
.score-form {
    display: grid;
    gap: 20px;
}

.score-form-item {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 16px;
}

.score-form-label {
    font-size: 14px;
    color: var(--text-primary);
}

.score-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--danger-color), var(--warning-color), var(--success-color));
    outline: none;
}

.score-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.score-form-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.score-summary {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.summary-item label {
    font-size: 14px;
    color: var(--text-secondary);
}

.score-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== 模态框样式 ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-dialog {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

.modal-dialog.modal-sm { max-width: 400px; }
.modal-dialog.modal-md { max-width: 500px; }
.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog.modal-xl { max-width: 1000px; }

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== 照片查看器 ==================== */
.photo-viewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.photo-viewer.active {
    display: flex;
}

.photo-viewer img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.viewer-close:hover {
    background: rgba(255,255,255,0.2);
}

.viewer-prev,
.viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.viewer-prev { left: 20px; }
.viewer-next { right: 20px; }

.viewer-prev:hover,
.viewer-next:hover {
    background: rgba(255,255,255,0.2);
}

.viewer-info {
    color: white;
    font-size: 14px;
}

.viewer-bottom-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.6);
    padding: 8px 20px;
    border-radius: var(--radius-full);
}

.viewer-download-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.viewer-download-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ==================== 文件上传 ==================== */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-area input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon {
    font-size: 36px;
}

.upload-formats {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

/* ==================== 加载状态 ==================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

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

.empty-state-hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 通知预览 ==================== */
.notify-preview {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.preview-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.preview-target {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        z-index: 99;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-item select,
    .filter-item input {
        flex: 1;
    }
    
    .data-table-wrapper {
        overflow-x: auto;
    }
    
    .case-progress-detail {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .score-form-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.font-bold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
