/* ===== 体检报告查询系统 - 全局样式 ===== */

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --success: #0d9488;
    --warning: #f59e0b;
    --danger: #dc2626;
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 前台 ===== */
.frontend-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.frontend-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px 44px;
    width: 100%;
    max-width: 540px;
}

/* 桌面端大屏：整体放大，更宽敞 */
@media (min-width: 1024px) {
    .frontend-card {
        max-width: 580px;
        padding: 56px 52px;
        border-radius: 20px;
    }
    .frontend-logo h1 {
        font-size: 26px;
    }
    .frontend-desc {
        font-size: 15px;
    }
    .frontend-card .form-group input[type="text"] {
        padding: 13px 16px;
        font-size: 16px;
    }
    .frontend-card .btn-lg {
        padding: 16px 32px;
        font-size: 17px;
    }
}

/* 平板 */
@media (min-width: 768px) and (max-width: 1023px) {
    .frontend-card {
        max-width: 500px;
        padding: 44px 38px;
    }
}

/* 手机端 */
@media (max-width: 767px) {
    .frontend-wrapper {
        padding: 20px 14px;
        justify-content: flex-start;
        padding-top: 40px;
    }
    .frontend-card {
        padding: 28px 20px;
        border-radius: 12px;
        max-width: 100%;
    }
    .frontend-logo h1 {
        font-size: 20px;
    }
    .frontend-desc {
        font-size: 13px;
        margin-bottom: 24px;
    }
    .frontend-card .form-group {
        margin-bottom: 16px;
    }
    .frontend-card .form-group input[type="text"] {
        padding: 10px 12px;
        font-size: 16px;  /* 防止 iOS 缩放 */
    }
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="search"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafbfc;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
    background: #fff;
}

.form-group input::placeholder { color: #c0c6cc; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0f766e; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
    background: #fff;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { background: #f9fafb; color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 提示消息 ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ===== 后台布局 ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: #1a1f36;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-brand {
    padding: 24px 20px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    text-align: center;
}

.admin-sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-left-color: var(--primary);
}

.admin-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.admin-sidebar-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}
.admin-sidebar-footer a:hover { color: #fff; }

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-header {
    background: #fff;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.admin-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.admin-header .user-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-body {
    padding: 24px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-info h4 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== 表格 ===== */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th {
    background: #f8fafc;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    font-size: 13px;
}

table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

table tbody tr:hover {
    background: #f8fafc;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.pagination a {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .disabled {
    color: #ccc;
    pointer-events: none;
}

/* ===== 文件上传区域 ===== */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: #fafbfc;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone .upload-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 14px;
}

.upload-zone .upload-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.upload-file-list {
    margin-top: 16px;
}

.upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
}

.upload-file-item .remove-file {
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 500px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); font-size: 13px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
    }
    .admin-sidebar-brand,
    .admin-sidebar-nav a span,
    .admin-sidebar-footer span {
        display: none;
    }
    .admin-sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .frontend-card {
        padding: 32px 24px;
    }
    .admin-content {
        padding: 16px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
