﻿/* ============================================
   美冠塔口腔患者分析系统 - 组件样式
   医疗行业专业简洁风格 (MEDICO设计规范)
   ============================================ */

/* ============================================
   CSS 变量引用层
   components.css 直接使用 base.css 定义的规范变量名
   base.css 是唯一的设计系统来源（MEDICO设计规范）
   ============================================ */
:root {
    /* 颜色变量已在 base.css 中定义，此处仅保留 DSv2 fallback */
    --primary: var(--primary, #1B3A7B);
    --primary-rgb: var(--primary-rgb, 15, 118, 110);
    --primary-hover: var(--primary-hover, #1B3A7B);
    --primary-light: var(--primary-light, #EDF1FA);
    --danger: var(--danger, #DC2626);
    --success: var(--success, #059669);

    /* 文字变量已在 base.css 中定义 */
    --text-main: var(--text-main, #1a1a2e);
    --text-muted: var(--text-muted, #8b919e);
    --text-title: var(--text-title, #1a1a1a);
    --text-disabled: var(--text-disabled, #8b919e);

    /* 边框变量已在 base.css 中定义 */
    --border: var(--border, #E5E7EB);
    --border-focus: var(--border-focus, var(--primary));

    /* 字体大小已在 base.css 中定义 */
    --text-xs: var(--text-xs, 12px);
    --text-sm: var(--text-sm, 13px);
    --text-base: var(--text-base, 14px);
    --text-lg: var(--text-lg, 16px);
    --text-3xl: var(--text-3xl, 24px);

    /* 行高 */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
}

/* ============================================
   按钮样式 - 医疗专业风格
   ============================================ */

/* 基础按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: var(--leading-tight);
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 主按钮 */
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

/* 次按钮 */
.btn-secondary {
    background: white;
    color: var(--text-main);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* 文字按钮 */
.btn-text {
    background: transparent;
    color: var(--primary);
    border-color: transparent;
    padding-left: 8px;
    padding-right: 8px;
}

.btn-text:hover:not(:disabled) {
    background: var(--primary-light);
}

/* 危险按钮 */
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

/* 成功按钮 */
.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: var(--success);
    border-color: var(--success);
}

/* 按钮尺寸 */
.btn-sm {
    padding: 6px 12px;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--text-base);
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn-icon.btn-sm {
    padding: 6px;
    width: 28px;
    height: 28px;
}

/* 按钮组 */
.btn-group {
    display: inline-flex;
    gap: var(--spacing-xs);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ============================================
   输入框样式
   ============================================ */
.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    background: white;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.input::placeholder {
    color: var(--text-placeholder);
}

.input:hover {
    border-color: var(--text-muted);
}

.input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.input:disabled {
    background: var(--bg-page);
    color: var(--text-disabled);
    cursor: not-allowed;
}

.input.error {
    border-color: var(--danger);
}

.input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 输入框尺寸 */
.input-sm {
    padding: 6px 10px;
    font-size: var(--text-xs);
}

.input-lg {
    padding: 12px 16px;
    font-size: var(--text-base);
}

/* 文本域 */
.textarea {
    min-height: 100px;
    resize: vertical;
}

/* 选择框 */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* 表单组 */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-main);
}

.form-hint {
    margin-top: var(--spacing-xs);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-error {
    margin-top: var(--spacing-xs);
    font-size: var(--text-xs);
    color: var(--danger);
}

/* ============================================
   卡片样式 - 医疗专业风格
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-title);
    margin: 0;
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.card-body {
    padding: var(--spacing-xl);
}

.card-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    background: var(--bg-page);
}

/* 卡片变体 */
.card-flat {
    box-shadow: none;
    border: 1px solid var(--border);
}

.card-elevated {
    box-shadow: var(--shadow-md);
}

/* 卡片交互态 */
.card-hover {
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.card-active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary-light);
}

/* 患者卡片 */
.patient-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: var(--spacing-sm);
}
.patient-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}
.patient-card.selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

/* 统计卡片 */
.stat-card {
    padding: var(--spacing-xl);
    text-align: center;
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-title);
    line-height: 1;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

.stat-change {
    font-size: var(--text-xs);
    margin-top: var(--spacing-xs);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ============================================
   导航样式
   ============================================ */
.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* 导航分组 */
.nav-group {
    margin-bottom: var(--spacing-lg);
}

.nav-group-title {
    padding: var(--spacing-sm) 14px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   徽章样式
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-default {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
}

/* 徽章尺寸 */
.badge-sm {
    padding: 2px 6px;
    font-size: 10px;
}

.badge-lg {
    padding: 6px 14px;
    font-size: var(--text-sm);
}

/* ============================================
   模态框样式
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-xl);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-title);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    background: var(--bg-page);
}

/* 模态框动画 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 模态框尺寸 */
.modal-sm .modal-content {
    max-width: 400px;
}

.modal-lg .modal-content {
    max-width: 720px;
}

.modal-xl .modal-content {
    max-width: 960px;
}

/* ============================================
   表格样式
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-page);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格行状态 */
.table tr.selected {
    background: var(--primary-light);
}

/* 表格变体 */
.table-striped tbody tr:nth-child(even) {
    background: var(--bg-page);
}
.table-striped tbody tr:hover {
    background: var(--bg-hover);
}
.table-compact th,
.table-compact td {
    padding: 8px 12px;
}

/* 单元格变体 */
.table-cell-primary {
    font-weight: 600;
    color: var(--text-title);
}
.table-cell-secondary {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ============================================
   标签页样式
   ============================================ */
.tabs {
    display: flex;
    gap: var(--spacing-xs);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--spacing-lg);
}

.tab {
    padding: 10px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    font-family: inherit;
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================
   分页样式
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   提示样式
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-dark);
}

/* ============================================
   空状态样式
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-lg);
    color: var(--border);
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--spacing-sm);
}

.empty-state-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 400px;
}

/* ============================================
   加载样式
   ============================================ */
.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-muted);
}

.page-loading .loading {
    margin-bottom: var(--spacing-lg);
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-page) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   页面 Hero 标题区 - 全站统一
   使用方式：在页面 div 上添加 class="hero"
   颜色通过 CSS 变量 hero-gradient-from/hero-gradient-via/hero-gradient-to/hero-shadow 控制
   ============================================ */
.hero {
    border-radius: 20px;
    padding: 32px 40px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--hero-shadow, 0 8px 32px rgba(59, 130, 246, 0.35));
    background: linear-gradient(135deg,
        var(--hero-gradient-from, #3b82f6) 0%,
        var(--hero-gradient-via, #1B3A7B) 50%,
        var(--hero-gradient-to, #8b5cf6) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -60px; left: 30%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 26px;
    font-weight: 800;
    color: white;
    margin: 0 0 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hero > div > p,
.hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin: 0;
}

/* Hero 变体：通过 CSS 变量覆盖颜色 */
.hero.blue {
    /* 使用根默认值，无需覆盖 */
}
.hero.blue-flex {
    /* 使用根默认值，无需覆盖 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.hero.online {
    --hero-gradient-from: var(--hero-online-from);
    --hero-gradient-via: var(--hero-online-via);
    --hero-gradient-to: var(--hero-online-to);
    --hero-shadow: var(--hero-online-shadow);
}
.hero.cs {
    --hero-gradient-from: var(--hero-cs-from);
    --hero-gradient-via: var(--hero-cs-via);
    --hero-gradient-to: var(--hero-cs-to);
    --hero-shadow: var(--hero-cs-shadow);
}
.hero.consultant {
    --hero-gradient-from: var(--hero-consultant-from);
    --hero-gradient-via: var(--hero-consultant-via);
    --hero-gradient-to: var(--hero-consultant-to);
    --hero-shadow: var(--hero-consultant-shadow);
}
.hero.doctor {
    --hero-gradient-from: var(--hero-doctor-from);
    --hero-gradient-via: var(--hero-doctor-via);
    --hero-gradient-to: var(--hero-doctor-to);
    --hero-shadow: var(--hero-doctor-shadow);
}
.hero.sky {
    --hero-gradient-from: #0284C7;
    --hero-gradient-via: #1B3A7B;
    --hero-gradient-to: #8b5cf6;
    --hero-shadow: 0 8px 32px rgba(14, 165, 233, 0.3);
}
.hero.purple {
    --hero-gradient-from: #667eea;
    --hero-gradient-via: #764ba2;
    --hero-gradient-to: #8b5cf6;
    --hero-shadow: 0 8px 32px rgba(102, 126, 234, 0.35);
}
.hero.green {
    --hero-gradient-from: var(--hero-cs-from);
    --hero-gradient-via: var(--hero-cs-via);
    --hero-gradient-to: var(--hero-cs-to);
    --hero-shadow: var(--hero-cs-shadow);
}
.hero.orange {
    --hero-gradient-from: #D97706;
    --hero-gradient-via: #f97316;
    --hero-gradient-to: #DC2626;
    --hero-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}
.hero.dark {
    --hero-gradient-from: #1a1a2e;
    --hero-gradient-via: #334155;
    --hero-gradient-to: #475569;
    --hero-shadow: 0 8px 32px rgba(30, 41, 59, 0.4);
}
.hero.pink {
    --hero-gradient-from: #667eea;
    --hero-gradient-via: #764ba2;
    --hero-gradient-to: #f093fb;
    --hero-shadow: 0 8px 32px rgba(102, 126, 234, 0.35);
}

@media (max-width: 768px) {
    .hero {
        padding: 20px 16px;
        border-radius: 16px;
        margin-bottom: 16px;
    }
    .hero h1 { font-size: 20px; }
}

/* ============================================
   工具类
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }
.gap-4 { gap: var(--spacing-lg); }

/* ============================================
   Hero 徽章
   ============================================ */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13px;
    color: white;
    margin-top: 14px;
    backdrop-filter: blur(8px);
}

/* ============================================
   表单网格
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.h-full { height: 100%; }

/* ============================================
   页面容器 - 统一页面wrapper
   ============================================ */
.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 20px;
}

@media (max-width: 768px) {
    .page-container {
        padding: 16px;
    }
}

/* ============================================
   卡片图标 - 用在 card-title 左侧
   ============================================ */
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.card-icon.purple { background: var(--role-consultant-light); color: var(--role-consultant-primary); }
.card-icon.blue { background: var(--info-light); color: var(--info); }
.card-icon.green { background: var(--success-light); color: var(--success); }
.card-icon.orange { background: var(--warning-light); color: var(--warning); }
.card-icon.red { background: var(--danger-light); color: var(--danger); }
.card-icon.teal { background: var(--primary-light); color: var(--primary); }

/* ============================================
   上传区域
   ============================================ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    background: var(--bg);
    transition: all 0.2s;
    cursor: pointer;
}
.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-zone i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}
.upload-zone p {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 8px;
}
.upload-zone .hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   流程步骤条
   ============================================ */
.flow-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: white;
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
}
.flow-step-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.flow-step-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.step-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.flow-connector {
    flex: 1;
    min-width: 40px;
    max-width: 80px;
    height: 2px;
    background: var(--border-light);
    margin: 0 8px;
    position: relative;
    transition: all 0.3s ease;
}
.flow-connector.done {
    background: var(--success);
}
.flow-connector::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--border-light);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}
.flow-connector.done::after {
    border-left-color: var(--success);
}
@media (max-width: 768px) {
    .flow-track {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }
    .flow-connector {
        width: 2px;
        height: 24px;
        min-width: auto;
        max-width: none;
        margin: 0;
    }
    .flow-connector::after {
        right: -3px;
        top: auto;
        bottom: -4px;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 6px solid var(--border-light);
        border-bottom: none;
    }
    .flow-connector.done::after {
        border-top-color: var(--success);
        border-left-color: transparent;
    }
}

/* ============================================
   统计卡片扩展
   ============================================ */
.stat-card.blue .stat-value { color: var(--info); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.orange .stat-value { color: var(--warning); }
.stat-card.purple .stat-value { color: var(--role-consultant-primary); }

.stat-card.gradient-blue {
    background: linear-gradient(135deg, var(--info-light), var(--info-light));
    border: none;
}
.stat-card.gradient-blue .stat-value { color: var(--info); }
.stat-card.gradient-blue .stat-label { color: var(--info-dark); }

.stat-card.gradient-green {
    background: linear-gradient(135deg, var(--success-light), var(--success-light));
    border: none;
}
.stat-card.gradient-green .stat-value { color: var(--success); }
.stat-card.gradient-green .stat-label { color: var(--success-darker); }

.stat-card.gradient-orange {
    background: linear-gradient(135deg, var(--warning-light), var(--warning-light));
    border: none;
}
.stat-card.gradient-orange .stat-value { color: var(--warning); }
.stat-card.gradient-orange .stat-label { color: var(--warning-dark); }

.stat-card.gradient-purple {
    background: linear-gradient(135deg, var(--role-consultant-light), var(--role-consultant-light));
    border: none;
}
.stat-card.gradient-purple .stat-value { color: var(--role-consultant-primary); }
.stat-card.gradient-purple .stat-label { color: var(--role-consultant-primary); }

.stat-card.with-icon {
    position: relative;
    overflow: hidden;
    text-align: left;
    padding: 24px;
}
.stat-card.with-icon .stat-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.12;
}
.stat-card.with-icon .stat-value {
    font-size: 32px;
    margin-bottom: 6px;
}

/* ============================================
   搜索栏 / 过滤器
   ============================================ */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}
.filter-row select,
.filter-row input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
}

/* ============================================
   徽章颜色扩展（loop-badge兼容）
   ============================================ */
.badge.blue { background: var(--info-light); color: var(--info-dark); }
.badge.green { background: var(--success-light); color: var(--success-darker); }
.badge.orange { background: var(--warning-light); color: var(--accent); }
.badge.red { background: var(--danger-light); color: var(--danger-darker); }
.badge.gray { background: var(--bg-hover); color: var(--text-secondary); }

/* ============================================
   单选框/复选框基类 (P5 统一)
   ============================================ */
.radio-group,.checkbox-group{display:flex;flex-direction:column;gap:var(--spacing-sm)}
.radio-item,.checkbox-item{display:flex;align-items:center;gap:8px;min-height:36px;font-size:var(--text-sm);color:var(--text-body);cursor:pointer}
.radio-item input[type=radio],.checkbox-item input[type=checkbox]{width:18px;height:18px;accent-color:var(--primary);cursor:pointer;flex-shrink:0}
.radio-item:hover,.checkbox-item:hover{color:var(--text-title)}

/* ============================================
   开关/toggle (P5 统一)
   ============================================ */
.toggle{position:relative;display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:var(--text-sm);color:var(--text-body)}
.toggle input[type=checkbox]{position:absolute;opacity:0;width:0;height:0}
.toggle-track{width:44px;height:24px;background:var(--border);border-radius:12px;transition:background .2s;flex-shrink:0}
.toggle input:checked+.toggle-track{background:var(--primary)}
.toggle-track::after{content:'';position:absolute;top:2px;left:2px;width:20px;height:20px;background:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.15)}
.toggle input:checked+.toggle-track::after{transform:translateX(20px)}

/* ============================================
   移动端组件增强
   ============================================ */
@media(max-width:768px){
  .btn{min-height:var(--btn-height,40px);padding:10px 14px}
  .btn-lg{min-height:48px;padding:14px 22px}
  .input,.select{padding:12px 14px;font-size:16px}
  .modal-content{max-width:95vw;border-radius:var(--radius-xl)}
  .form-grid{grid-template-columns:1fr}
  .search-bar{flex-direction:column}
  .filter-row select,.filter-row input{width:100%}
  .tabs{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .tab{white-space:nowrap;padding:10px 14px;flex-shrink:0}
  .patient-card{padding:12px 14px}
}

/* ============================================
   角色标签系统 (P5 组件标准化)
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.tag-online { background: var(--role-online-light); color: var(--role-online-primary); }
.tag-cs { background: var(--role-cs-light); color: var(--role-cs-primary); }
.tag-consultant { background: var(--role-consultant-light); color: var(--role-consultant-primary); }
.tag-doctor { background: var(--role-doctor-light); color: var(--role-doctor-primary); }
.tag-admin { background: var(--role-admin-light); color: var(--role-admin-primary); }

/* 状态标签 */
.tag-pending { background: #F0F1F3; color: #5a6070; }
.tag-processing { background: var(--info-light); color: var(--info-dark); animation: tag-pulse 1.5s infinite; }
.tag-completed { background: var(--success-light); color: var(--success-dark); }
.tag-failed { background: var(--danger-light); color: var(--danger-dark); }
.tag-urgent { background: var(--warning-light); color: var(--warning-dark); }

@keyframes tag-pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

.tag-sm { padding: 1px 6px; font-size: 10px; }
.tag-lg { padding: 5px 14px; font-size: var(--text-sm); }

/* ============================================
   底部抽屉 (Bottom Sheet)
   ============================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: drawer-fade-in .2s ease;
}
@keyframes drawer-fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer-bottom {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 16px 32px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
  animation: drawer-slide-up .25s cubic-bezier(.16,1,.3,1);
}
@keyframes drawer-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 18px;
}
.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.drawer-header h3 {
  font-size: var(--text-lg);
  font-weight: 650;
  color: var(--text-title);
  margin: 0;
}
.drawer-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-close:hover { background: var(--danger-light); color: var(--danger); }

/* 搜索框图标版 */
.input-search {
  position: relative;
}
.input-search::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.input-search input {
  padding-left: 36px;
}

.input-icon {
  position: relative;
}
.input-icon .input-icon-slot {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.input-icon input,
.input-icon .input {
  padding-left: 36px;
}
