* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2c5f2d;
    --primary-light: #4a8b4c;
    --primary-bg: #f0f7f0;
    --bg: #f5f0e8;
    --card-bg: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e8e0d4;
    --border-light: #f0ebe3;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* 布局 */
.app {
    display: flex;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1e4620 0%, #2c5f2d 100%);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: #7cda80;
}

.nav-icon {
    font-size: 8px;
    opacity: 0.6;
}

/* 侧边栏用户信息 */
.sidebar-user {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.user-name {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    min-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    opacity: 0.6;
    white-space: nowrap;
}
.btn-logout {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffc107;
}

.status-dot.connected { background: #28a745; }
.status-dot.disconnected { background: #dc3545; }

/* 主内容区 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

/* 工作台统计卡片 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.section-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

/* 推广横幅 */
.hero-banner-wrap {
    width: 100%;
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(44,95,45,0.10);
    text-align: center;
}

.hero-banner-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    border-radius: var(--radius);
    background: #f8f9fa;
}

.section-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.quick-actions {
    display: flex;
    gap: 12px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
}

.toolbar select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--card-bg);
    outline: none;
    cursor: pointer;
}

/* 数据表格 */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f5f0;
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover td {
    background: #fafaf5;
}

.empty-tip {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 14px !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #f0f0f0; color: #999; }
.status-draft { background: #fff3cd; color: #856404; }
.status-submitted { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-report { background: #e2d5f1; color: #4a235a; font-weight: 600; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #1e4620;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--border-light);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}

.btn-link:hover {
    text-decoration: underline;
}

.action-btns {
    display: flex;
    gap: 4px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* 表单 */
.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    flex: 1;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea {
    height: 70px;
    resize: vertical;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-item input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    transition: transform 0.3s ease;
    z-index: 200;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h1 { font-size: 14px; }
    .sidebar-subtitle, .nav-item span:last-child, .sidebar-footer span { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .form-row { flex-direction: column; gap: 0; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 问诊详情页 ===== */
.header-actions {
    display: flex;
    gap: 8px;
}

.info-bar {
    display: flex;
    gap: 24px;
    padding: 14px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.info-item span:last-child {
    font-size: 14px;
    font-weight: 500;
}

.detail-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* 首诊表单 - 检查项目行 */
.exam-item-row {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-light);
}

.exam-item-row:last-child {
    border-bottom: none;
}

/* 复诊表单 - 基线信息 */
.baseline-info {
    background: #fafaf5;
    padding: 12px 16px;
    border-left: 3px solid var(--primary-light);
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.8;
}

.fu-label {
    color: var(--text-muted);
    display: inline-block;
    width: 80px;
    min-width: 80px;
}

/* 复诊表单 - 处方展示表 */
.fu-prescription-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.fu-prescription-table th {
    background: #f0f4e8;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.fu-prescription-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-light);
}

/* 复诊表单 - 评分项 */
.score-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
}

.score-legend span {
    padding: 2px 8px;
    border-radius: 3px;
}

.score-high { background: #d4edda; color: #155724; }
.score-mid { background: #fff3cd; color: #856404; }
.score-low { background: #f8d7da; color: #721c24; }

.score-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    gap: 12px;
}

.score-item:last-child {
    border-bottom: none;
}

.score-item .item-name {
    flex: 1;
    font-size: 14px;
    min-width: 120px;
}

.score-item .score-select {
    width: 160px;
}

.score-item select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.score-item select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(44,95,45,0.15);
}

.score-item input[type="text"],
.fu-change-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    min-height: auto;
    outline: none;
}

.score-item input[type="text"]:focus,
.fu-change-input:focus {
    border-color: var(--primary);
}

.remove-btn {
    background: var(--danger);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-btn:hover { background: #c82333; }

/* 复诊表单 - 图片上传 */
.image-upload-area {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 报告查看页 ===== */
.report-iframe {
    width: 100%;
    height: calc(100vh - 180px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: white;
}

.report-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* ===== 通知面板 ===== */
.notif-btn {
    position: relative;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.notif-btn:hover {
    color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 50;
    display: none;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: var(--primary-bg);
}

.notif-item.unread {
    background: #fffef0;
}

.notif-item.unread::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin-right: 6px;
    vertical-align: middle;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.notif-content {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== AI辨证区 ===== */
.ai-section {
    min-height: 60px;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f0f7f0;
    border-radius: 6px;
    margin-top: 12px;
    color: var(--primary);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-result {
    margin-top: 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}

.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f0f7f0;
    border-bottom: 1px solid var(--border-light);
}

.ai-result-header h4 {
    font-size: 14px;
    color: var(--primary);
}

.ai-context-hint {
    padding: 8px 16px;
    font-size: 12px;
    color: #6b8e7b;
    background: #f0f7f2;
    border-bottom: 1px solid #d5e8da;
    border-radius: 0;
}
.ai-diagnosis-table {
    padding: 0 16px;
    max-height: 400px;
    overflow-y: auto;
    border-bottom: 1px solid #e8e0d4;
}
.ai-diagnosis-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
}
.ai-diagnosis-table th,
.ai-diagnosis-table td {
    border: 1px solid #d5e8da;
    padding: 6px 10px;
    text-align: left;
}
.ai-diagnosis-table th {
    background: #f0f7f2;
    font-weight: 600;
    color: #2c5f2d;
}
.ai-result-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

/* 处方表格 */
.prescription-table-wrap {
    overflow-x: auto;
}

.prescription-table {
    width: 100%;
    border-collapse: collapse;
}

.prescription-table th {
    background: #f8f5f0;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.prescription-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.prescription-table .herb-name-input,
.prescription-table .herb-dosage-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.prescription-table .herb-name-input:focus,
.prescription-table .herb-dosage-input:focus {
    border-color: var(--primary);
}

.herb-price-cell, .herb-cost-cell {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    padding-top: 14px !important;
}

/* 药材自动补全 */
.herb-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.prescription-table td:first-child {
    position: relative;
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.autocomplete-item:hover {
    background: var(--primary-bg);
}

.autocomplete-item .herb-name {
    font-weight: 500;
    color: var(--text);
}

.autocomplete-item .herb-category {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 8px;
}

.autocomplete-item .herb-price-val {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

/* 处方费用汇总 - 顶部醒目卡片 */
.prescription-summary-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--primary-bg), #e8f5e9);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 4px rgba(44,95,45,0.06);
}

.prescription-summary-top .summary-dose-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.prescription-summary-top .summary-dose-group label {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.prescription-summary-top .summary-dose-group input {
    width: 64px;
    padding: 4px 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.prescription-summary-top .summary-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
    flex-shrink: 0;
}

.prescription-summary-top .summary-stats-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.prescription-summary-top .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.prescription-summary-top .stat-item span {
    color: var(--text-secondary);
}

.prescription-summary-top .stat-item strong {
    color: var(--primary);
    font-size: 16px;
}

.prescription-summary-top .stat-item.stat-highlight strong {
    color: #c62828;
    font-size: 17px;
    font-weight: 700;
}

/* 可点击行 */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: #f5f0e8;
}

/* 新建问诊弹窗 */
.modal-sm {
    max-width: 420px;
}

.patient-search-results {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
}

.patient-result-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.patient-result-item:hover {
    background: var(--primary-bg);
}

.patient-result-item .text-muted {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.selected-patient {
    padding: 10px 14px;
    background: var(--primary-bg);
    border-radius: 6px;
    font-size: 14px;
    color: var(--primary);
}

.selected-patient strong {
    margin: 0 4px;
}

.no-result {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-link.danger {
    color: var(--danger);
}

/* ===== 随访管理 ===== */
.stat-card.clickable { cursor: pointer; transition: transform 0.2s; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.status-pending { background: #e6f0ff; color: #1a56db; }
.status-evaluated { background: #fff3e0; color: #e67e22; }
.status-evaluating, .status-ai_diagnosing, .status-diagnosed { background: #f3e8ff; color: #7c3aed; }
.status-prescribing, .status-prescribed, .status-safety_checking { background: #f3e8ff; color: #7c3aed; }
.status-completed { background: #d4edda; color: #155724; }
.status-ended { background: #e9ecef; color: #6c757d; }
.status-overdue { background: #f8d7da; color: #721c24; }

/* 随访状态筛选Tab */
.followup-filter-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #e8e8e8; padding: 0 4px; }
.followup-filter-tab {
    padding: 8px 18px;
    font-size: 14px;
    color: #666;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.followup-filter-tab:hover { color: var(--primary); }
.followup-filter-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.followup-filter-tab .tab-count {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}
.followup-filter-tab.active .tab-count { background: var(--primary); color: white; }

/* 时间线 */
.timeline { margin-top: 16px; padding-left: 20px; border-left: 2px solid var(--primary-light); }
.timeline-item { position: relative; padding: 8px 0 8px 20px; font-size: 13px; }
.timeline-item::before { content: ''; position: absolute; left: -26px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline-item .tl-date { color: var(--text-muted); font-size: 12px; }
.timeline-item .tl-content { color: var(--text); }

/* 处方表格行号 */
.row-num { width: 32px; text-align: center; color: #999; font-size: 12px; padding-top: 14px !important; }

/* 通知面板定位 */
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: white; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: none; align-items: center; justify-content: center; padding: 0 4px; }
.notif-panel { position: absolute; top: 100%; right: 0; width: 320px; max-height: 400px; overflow-y: auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 50; display: none; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background 0.2s; }
.notif-item:hover { background: var(--primary-bg); }
.notif-item.unread { background: #fffef0; }
.notif-item.unread::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: middle; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-content { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* 报告操作栏 */
.report-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.report-iframe { width: 100%; height: calc(100vh - 180px); border: 1px solid var(--border-light); border-radius: var(--radius); background: white; }

/* 评分颜色标记 */
.score-item select option[value="10"], .score-item select option[value="9"], .score-item select option[value="8"] { color: #155724; }
.score-item select option[value="7"], .score-item select option[value="6"], .score-item select option[value="5"] { color: #856404; }
.score-item select option[value="4"], .score-item select option[value="3"], .score-item select option[value="2"], .score-item select option[value="1"], .score-item select option[value="0"] { color: #721c24; }
.score-item select option[value="-1"], .score-item select option[value="-2"] { color: #a71d2a; font-weight: bold; }

/* 随访详情的变更输入 */
.fud-change-input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; min-height: auto; outline: none; }
.fud-change-input:focus { border-color: var(--primary); }

/* ===== 数据分析页 ===== */
.analysis-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1024px) {
    .chart-grid { grid-template-columns: 1fr; }
}

.chart-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 16px 20px;
}

.chart-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.chart-container {
    width: 100%;
    height: 320px;
}

.trend-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.trend-filter label {
    color: var(--text-secondary);
}

.trend-filter select,
.trend-filter input {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}

/* ===== 体质辨识页 ===== */
.constitution-form-section {
    background: linear-gradient(135deg, #f8faf5, #f0f7e8);
}

.constitution-progress {
    background: var(--border-light);
    height: 6px;
    width: 100%;
    margin-bottom: 16px;
    position: relative;
}

.constitution-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2d5016, #4a7c29);
    transition: width 0.3s;
    border-radius: 3px;
}

.constitution-group-title {
    background: #fff;
    border-left: 4px solid #4a7c29;
    padding: 10px 16px;
    margin: 16px 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #2d5016;
    border-radius: 0 6px 6px 0;
}

.constitution-group-desc {
    font-size: 12px;
    color: #888;
    margin: -4px 0 8px 20px;
}

.constitution-question-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
}

.constitution-question-text {
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

.constitution-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.constitution-opt-btn {
    flex: 1;
    min-width: 50px;
    padding: 8px 4px;
    border: 1.5px solid #d4c8bc;
    border-radius: 6px;
    background: #faf8f5;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
    user-select: none;
}

.constitution-opt-btn:hover {
    border-color: #4a7c29;
}

.constitution-opt-btn:active {
    transform: scale(0.95);
}

.constitution-opt-btn.selected {
    background: #4a7c29;
    color: #fff;
    border-color: #4a7c29;
}

/* 体质辨识结果 */
.cf-result-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
}

.cf-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 10px 0;
}

.cf-result-table th {
    background: #f0f7e8;
    padding: 8px 12px;
    text-align: center;
    font-weight: 600;
    color: #2d5016;
    border-bottom: 1px solid #d4e8c8;
}

.cf-result-table th:first-child {
    text-align: left;
}

.cf-result-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #f0ebe5;
}

.cf-result-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.cf-conclusion-box {
    background: linear-gradient(135deg, #f0f7e8, #e8f5e0);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 12px 0;
    border-left: 4px solid #4a7c29;
}

.cf-conclusion-box .label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.cf-conclusion-box .value {
    font-size: 18px;
    font-weight: 700;
    color: #2d5016;
}

.cf-verdict-yes { color: #c0392b; font-weight: 700; }
.cf-verdict-lean { color: #e67e22; font-weight: 600; }
.cf-verdict-no { color: #27ae60; font-weight: 400; }

.cf-patient-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* ===== 体质信息弹窗 ===== */
.const-info-empty {
    text-align: center;
    padding: 24px 16px;
}

.const-info-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.const-info-empty-text {
    font-size: 15px;
    color: var(--text-muted);
}

.const-info-card {
    padding: 4px 0;
}

.const-info-conclusion {
    background: linear-gradient(135deg, #f0f7e8, #e8f5e0);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
    border-left: 4px solid #4a7c29;
}

.const-info-conclusion-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.const-info-conclusion-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d5016;
}

.const-info-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 0 4px;
}

.const-info-scores {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

.const-info-score-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.const-info-score-item:last-child {
    border-bottom: none;
}

.const-info-score-type {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.const-info-score-val {
    width: 50px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 12px;
}

.const-info-score-verdict {
    width: 60px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

.const-info-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ===== 从扣子导入报告弹窗 ===== */
.modal-lg {
    max-width: 720px;
}

.import-preview-section {
    margin-top: 8px;
}

.ir-preview-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.ir-preview-iframe {
    width: 100%;
    height: 320px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: white;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-light, #f5f5f5);
    border-radius: 8px;
    padding: 3px;
}
.tab-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted, #888);
    transition: all 0.2s;
}
.tab-btn:hover {
    color: var(--text, #333);
}
.tab-btn.active {
    background: white;
    color: var(--primary, #2c7a4a);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Timeline List */
.timeline-list {
    padding: 10px 0;
}
.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-left: 3px solid var(--primary, #2c7a4a);
    margin-bottom: 8px;
    background: var(--bg-light, #f9f9f9);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
}
.timeline-date {
    color: var(--text-muted, #888);
    min-width: 90px;
    font-size: 12px;
}
.timeline-tag {
    background: var(--primary, #2c7a4a);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}
.timeline-text {
    color: var(--text, #333);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ===== 疗效跟踪 ===== */
.efficacy-trend-chart {
    min-height: 100px;
    padding: 10px 0;
}
.efficacy-bar {
    transition: all 0.3s ease;
}
.efficacy-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.02);
}
.efficacy-score-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.score-input-row {
    transition: background 0.2s;
}
.score-input-row:hover {
    background: #f5f0e8 !important;
}
.score-range-input {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}
.score-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2c5f2d;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.score-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2c5f2d;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== 中西药安全审查 ===== */
.drug-safety-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ds-sub-panel { background: #fafaf7; border: 1px solid #e8e0d4; border-radius: 8px; padding: 14px; }
.ds-sub-title { font-size: 14px; font-weight: 600; color: #2c5f2d; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #e8e0d4; }
.ds-check-items { min-height: 30px; }
.ds-empty-tip { color: #999; font-size: 13px; padding: 8px 0; }
.ds-loading { color: #2c5f2d; font-size: 13px; font-style: italic; }
.ds-summary { margin-top: 14px; padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 1.8; border-left: 4px solid #ccc; background: #f9f9f9; }
.ds-level-red { border-left-color: #c0392b; background: #fdf2f2; color: #721c24; }
.ds-level-orange { border-left-color: #e67e22; background: #fef9f0; color: #7d5a29; }
.ds-level-yellow { border-left-color: #f1c40f; background: #fefce8; color: #6b5e1e; }
.ds-level-green { border-left-color: #28a745; background: #f0faf3; color: #155724; }
.ds-result-item { margin-bottom: 8px; padding: 10px 12px; border-radius: 6px; border-left: 3px solid #ccc; font-size: 13px; line-height: 1.7; }
.ds-item-red { border-left-color: #c0392b; background: #fdf2f2; }
.ds-item-orange { border-left-color: #e67e22; background: #fef9f0; }
.ds-item-yellow { border-left-color: #f1c40f; background: #fefce8; }
.ds-item-green { border-left-color: #28a745; background: #f0faf3; }
.ds-result-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ds-level-badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #fff; }
.ds-badge-red { background: #c0392b; }
.ds-badge-orange { background: #e67e22; }
.ds-badge-yellow { background: #d4a017; color: #fff; }
.ds-badge-green { background: #28a745; }
.ds-result-detail { color: #555; padding-left: 4px; }
@media (max-width: 768px) { .drug-safety-panel { grid-template-columns: 1fr; } }

/* ===== v2.8 P2 患者管理改造 ===== */

/* 分类Tab栏 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 18px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tab-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    padding: 0 5px;
}

.category-tab.active .tab-count {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

.category-tab:not(.active) .tab-count {
    background: #f0f0f0;
    color: var(--text-secondary);
}

/* 分类徽章 - pill样式 */
.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.category-badge.pending_first_visit {
    background: #cce5ff;
    color: #004085;
}

.category-badge.pending_revisit {
    background: #d4edda;
    color: #155724;
}

.category-badge.treatment_completed {
    background: #f0f0f0;
    color: #999;
}

/* 患者详情弹窗 */
#patientDetailModal .modal {
    max-width: 800px;
}

/* 详情内部Tab */
.detail-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    background: #fafaf5;
}

.detail-tab {
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.detail-tab:hover {
    color: var(--primary);
}

.detail-tab.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* 详情Tab面板 */
.dtab-panel {
    display: none;
}

.dtab-panel.active {
    display: block;
}

/* 基本信息网格 */
.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-info-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-info-item > span:last-child,
.detail-info-item > select {
    font-size: 14px;
    color: var(--text);
}

/* 详情空提示 */
.detail-empty-tip {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 首诊记录摘要卡片 */
.first-visit-card {
    background: #fafaf5;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
}

.fv-field {
    margin-bottom: 12px;
}

.fv-field:last-child {
    margin-bottom: 0;
}

.fv-field-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.fv-field-value {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}

/* 复诊历史列表 */
.followup-list {
    list-style: none;
    padding: 0;
}

.followup-item {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.followup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fafaf5;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.followup-header:hover {
    background: #f0ebe3;
}

.followup-body {
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.7;
    display: none;
    border-top: 1px solid var(--border-light);
}

.followup-item.expanded .followup-body {
    display: block;
}

/* 诊断报告卡片列表 */
.report-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fafaf5;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
}

.report-card:hover {
    border-color: var(--primary-light);
    background: #f0f7f0;
}

.report-card-info {
    flex: 1;
}

.report-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.report-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.report-source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.report-source-tag.auto {
    background: #cce5ff;
    color: #004085;
}

.report-source-tag.manual {
    background: #fff3cd;
    color: #856404;
}

/* 处方历史列表 */
.prescription-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prescription-history-item {
    padding: 12px 16px;
    background: #fafaf5;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.prescription-history-item.current {
    border-color: var(--primary);
    background: #f0f7f0;
}

.prescription-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.prescription-history-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.prescription-current-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
}

.prescription-history-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* 操作按钮组 - 分类相关 */
.action-btn-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-action-first {
    background: #cce5ff;
    color: #004085;
}

.btn-action-first:hover {
    background: #b3d7ff;
}

.btn-action-revisit {
    background: #d4edda;
    color: #155724;
}

.btn-action-revisit:hover {
    background: #c3e6cb;
}

.btn-action-detail {
    background: #f0f0f0;
    color: #555;
}

.btn-action-detail:hover {
    background: #e0e0e0;
}

.btn-action-redo {
    background: #fff3cd;
    color: #856404;
}

.btn-action-redo:hover {
    background: #ffe69c;
}

.btn-action-delete {
    background: #f8d7da;
    color: #721c24;
}

.btn-action-delete:hover {
    background: #f5c6cb;
}

/* 诊断报告查看弹窗 */
.report-view-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ===== 附件上传区域 ===== */
.upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}
.upload-area:hover {
    border-color: #0d7377;
    background: #f0faf9;
}
.upload-area.dragover {
    border-color: #0d7377;
    background: #e6f7f5;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #999;
}
.upload-icon {
    font-size: 28px;
    color: #0d7377;
    font-weight: bold;
}

/* ===== 附件列表 ===== */
.attachment-list {
    margin-top: 10px;
}
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}
.attachment-item .att-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.attachment-item .att-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}
.attachment-item .att-size {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}
.attachment-item .att-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    flex-shrink: 0;
}
.attachment-item .att-remove:hover {
    color: #a71d2a;
}

/* ===== 报告详情中的附件下载区 ===== */
.report-attachments {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}
.report-attachments h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}
.report-attachments .att-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    margin: 3px;
}
.report-attachments .att-download:hover {
    background: #bbdefb;
}


/* ===== 流程进度条 ===== */
.workflow-progress {
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
}
.progress-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    transition: all 0.3s;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
}
.step-done .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.step-active .step-circle {
    background: var(--primary-light);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(44,95,45,0.15);
}
.step-pending .step-circle {
    background: #f5f5f5;
    border-color: #ddd;
    color: #bbb;
}
.step-label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
}
.step-active .step-label {
    color: var(--primary);
    font-weight: 600;
}
.step-done .step-label {
    color: var(--primary);
}
.step-line {
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: var(--border);
}
.step-done .step-line {
    background: var(--primary);
}

/* ===== 复诊记录页面 ===== */
.revisit-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--card-bg);
}
.revisit-tab {
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.revisit-tab:hover {
    color: var(--primary);
    background: var(--primary-bg);
}
.revisit-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.revisit-tab .tab-count {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    background: var(--border-light);
    font-size: 11px;
    margin-left: 4px;
    padding: 0 6px;
}
.revisit-tab.active .tab-count {
    background: var(--primary-bg);
    color: var(--primary);
}

.revisit-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 20px;
}
.revisit-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}
.revisit-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(44,95,45,0.1);
    transform: translateY(-1px);
}
.revisit-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.revisit-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.revisit-card-code {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
}
.revisit-overdue-badge {
    font-size: 11px;
    color: #dc3545;
    background: #fde8e8;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}
.revisit-card-body {
    margin-bottom: 12px;
}
.revisit-card-field {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.5;
}
.revisit-card-field span {
    color: var(--text-muted);
}
.revisit-card-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

/* ===== 新建问诊弹窗-新患者分割线 ===== */
.nc-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.nc-divider::before, .nc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.nc-divider span {
    padding: 0 12px;
}

/* ===== 处方审查 ===== */
.rx-review-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.rx-review-card {
    background: #f8faf8;
    border: 1px solid #d4edda;
    border-radius: var(--radius);
    padding: 16px;
}
.rx-review-card h4 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 8px;
}
.rx-review-content {
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ===== 新状态badge ===== */
.status-badge.status-pending { background: #fff3cd; color: #856404; }
.status-badge.status-manual_done { background: #d1ecf1; color: #0c5460; }
.status-badge.status-ai_done { background: #d4edda; color: #155724; }
.status-badge.status-rx_draft { background: #cce5ff; color: #004085; }
.status-badge.status-rx_reviewed { background: #e2d5f1; color: #4a235a; }
.status-badge.status-rx_complete { background: #d4edda; color: #155724; font-weight: 600; }

/* ===== btn-success ===== */
.btn-success {
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-success:hover { background: #218838; }
.btn-success.btn-sm { padding: 6px 14px; font-size: 13px; }


/* ===== v3.2 进度跟踪样式 ===== */
.progress-tracking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
}
.progress-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.2s;
}
.progress-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.progress-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.progress-bar-container {
    margin: 12px 0;
    overflow-x: auto;
}
.progress-steps {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: fit-content;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}
.step-done .step-dot {
    background: var(--primary);
    color: white;
}
.step-pending .step-dot {
    background: #e0e0e0;
    color: #999;
}
.step-current .step-dot {
    box-shadow: 0 0 0 3px rgba(33,150,243,0.3);
    transform: scale(1.1);
}
.step-label {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
}
.step-done .step-label {
    color: var(--primary);
    font-weight: 500;
}
.step-connector {
    width: 30px;
    height: 2px;
    background: #e0e0e0;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.connector-done {
    background: var(--primary);
}
.progress-card-footer {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* ===== v3.2 重要信息提示 ===== */
.important-note-item {
    transition: background 0.2s;
}
.important-note-item:hover {
    background: #fff8e1;
}

/* ===== v3.2 助手工作台 ===== */
#page-assistant-dashboard .dashboard-grid {
    margin-bottom: 20px;
}

/* ===== v3.2 药材管理 ===== */
#page-herbs-admin .data-table {
    font-size: 13px;
}
#page-herbs-admin .data-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* ===== v3.2 全平台患者 ===== */
#page-global-patients .data-table td {
    max-width: 200px;
}

/* ===== v3.2 助手端特殊样式 ===== */
.followup-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.followup-card:hover {
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ===== v3.2 角色菜单隐藏过渡 ===== */
.sidebar-nav .nav-item {
    transition: opacity 0.2s, max-height 0.3s;
}
.sidebar-nav .nav-item[style*="display: none"] {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}


/* ===== 格式门禁验证样式 ===== */
.format-gate-error {
    margin-top: 16px;
    padding: 16px;
    background: #fff5f5;
    border: 2px solid #e53e3e;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}
.gate-error-header {
    font-size: 16px;
    font-weight: bold;
    color: #c53030;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #feb2b2;
}
.gate-error-list {
    margin-bottom: 12px;
}
.gate-error-item {
    padding: 4px 0;
    color: #742a2a;
}
.gate-format-spec {
    margin: 12px 0;
    background: #fffaf0;
    border: 1px solid #ed8936;
    border-radius: 6px;
    padding: 8px 12px;
}
.gate-format-spec summary {
    cursor: pointer;
    font-weight: bold;
    color: #c05621;
    padding: 4px 0;
}
.gate-format-spec[open] summary {
    margin-bottom: 8px;
}
.gate-spec-pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}
.gate-action-hint {
    margin-top: 12px;
    padding: 8px 12px;
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 4px;
    color: #2b6cb0;
    font-size: 13px;
}


/* ===== v3.5 AI推荐处方 + 历史处方参考面板 ===== */
.rx-reference-panel {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5e9 100%);
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.rx-ref-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #c8e6c9;
    padding-bottom: 8px;
    margin-bottom: 10px;
}
.rx-ref-tab {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
}
.rx-ref-tab.active {
    background: #2c7a4a;
    color: #fff;
    font-weight: 500;
}
.rx-ref-tab:hover:not(.active) {
    background: #e0f2e5;
}
.rx-ref-body {
    min-height: 40px;
    max-height: 200px;
    overflow-y: auto;
}
.rx-ref-content {
    padding: 4px 0;
}
.rx-ref-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 10px;
}
.rx-herb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rx-herb-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #a5d6a7;
    border-radius: 14px;
    font-size: 12px;
    color: #2c7a4a;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.rx-herb-tag:hover {
    background: #2c7a4a;
    color: #fff;
    transform: scale(1.02);
}
.rx-herb-tag.rx-herb-hist {
    border-color: #90a4ae;
    color: #546e7a;
}
.rx-herb-tag.rx-herb-hist:hover {
    background: #546e7a;
    color: #fff;
}
.rx-history-group {
    margin-bottom: 12px;
}
.rx-history-header {
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #ddd;
}
.rx-ref-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #c8e6c9;
}

/* ===== v3.5 PDF查看器弹窗 ===== */
.pdf-viewer-modal .modal-body {
    padding: 0;
    min-height: 70vh;
}
.pdf-viewer-frame {
    width: 100%;
    height: 70vh;
    border: none;
}
.modal-lg {
    max-width: 900px;
    width: 95%;
}

/* ===== v3.5 处方详情弹窗 ===== */
.rx-detail-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rx-detail-pdf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
    transition: background 0.2s;
}
.rx-detail-pdf-item:hover {
    background: #f0f7f2;
}
.rx-pdf-icon {
    font-size: 20px;
}
.rx-detail-pdf-item span:nth-child(2) {
    flex: 1;
    font-size: 14px;
}
.rx-detail-pdf-empty {
    color: #999;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}
.rx-detail-tip {
    margin-top: 12px;
    padding: 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    font-size: 12px;
    color: #795548;
}
.rx-detail-tip p {
    margin: 0;
}

/* ===== 历史处方评分样式 ===== */
.rx-history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #2d3748;
}
.rx-manual-score {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}
.rx-manual-score.score-good {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}
.rx-manual-score.score-medium {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}
.rx-manual-score.score-low {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}
.rx-herb-count {
    color: #718096;
    font-size: 13px;
    margin-left: auto;
}

/* 閲嶈淇℃伅鎻愮ず鏍?*/
.important-info-bar {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(255,193,7,0.15);
    width: 100%;
}
.important-info-bar .info-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,193,7,0.3);
}
.important-info-bar .info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: #333;
    border-bottom: 1px dashed rgba(255,193,7,0.2);
}
.important-info-bar .info-item:last-child {
    border-bottom: none;
}
.important-info-bar .info-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}
.important-info-bar .info-text {
    flex: 1;
    line-height: 1.5;
}
.important-info-bar .info-text strong {
    color: #2c7a4a;
}
.important-info-bar .info-time {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}
.important-info-bar .info-badge {
    display: inline-block;
    background: #ff5722;
    color: white;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* 重要信息提示栏 - 滚动效果 */
.info-scroll-container {
    overflow: hidden;
    max-height: 120px;
    position: relative;
}
.info-scroll-content {
    animation: infoScroll 12s ease-in-out infinite;
}
@keyframes infoScroll {
    0%, 20% { transform: translateY(0); }
    25%, 45% { transform: translateY(-33.33%); }
    50%, 70% { transform: translateY(-66.66%); }
    75%, 95% { transform: translateY(-33.33%); }
    100% { transform: translateY(0); }
}
.info-scroll-content .info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    font-size: 13px;
    color: #333;
    border-bottom: 1px dashed rgba(198,40,40,0.15);
    min-height: 40px;
}
.info-scroll-content .info-item:last-child {
    border-bottom: none;
}
.info-scroll-content .info-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}
.info-scroll-content .info-text {
    flex: 1;
    line-height: 1.5;
}
.info-scroll-content .info-text strong {
    color: #c62828;
}
.info-scroll-content .info-time {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}
.info-scroll-content .info-badge {
    display: inline-block;
    background: #c62828;
    color: white;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* 自定义 Hero Banner */
.hero-banner-custom {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 180px;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: var(--radius);
    overflow: hidden;
}
.hero-text-content {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.hero-main-title {
    font-size: 32px;
    font-weight: 700;
    color: #c62828;
    letter-spacing: 2px;
}
.hero-sub-title {
    font-size: 14px;
    color: #888;
    font-weight: 400;
    letter-spacing: 1px;
}
.hero-desc {
    font-size: 18px;
    color: #c62828;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 1px;
}
.hero-image-side {
    flex: 1;
    max-width: 50%;
    height: 180px;
    overflow: hidden;
}
.hero-image-side .hero-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.hero-desc-only {
    font-size: 26px;
    color: #c62828;
    font-weight: 700;
    letter-spacing: 3px;
    white-space: nowrap;
}




/* Info item clickable */
.info-scroll-content .info-item {
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    padding: 10px 8px !important;
    margin: 0 -8px;
}
.info-scroll-content .info-item:hover {
    background: rgba(198, 40, 40, 0.06);
}

/* Modal overlay for info detail */
.info-detail-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.info-detail-overlay.show {
    display: flex;
}
.info-detail-overlay .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
}

/* ===== 页面锁定标识 ===== */
.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    color: #856404;
    font-weight: 500;
    margin-left: 10px;
    vertical-align: middle;
}
.lock-badge::before {
    content: '🔒';
    font-size: 12px;
}

/* ===== 处方笺打印样式（参照弘善庆堂格式） ===== */
#prescriptionPaperOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}
#prescriptionPaperOverlay.active {
    display: flex;
}
.prescription-paper-toolbar {
    position: sticky;
    top: 0;
    z-index: 10001;
    background: white;
    padding: 12px 20px;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}
.prescription-paper-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
}

/* 处方笺内容样式 */
.rx-paper {
    padding: 30px 40px 20px;
    font-family: "SimSun", "宋体", "STSong", serif;
    color: #000;
    line-height: 1.6;
    min-height: 1000px;
}
/* 头部：医院名称 */
.rx-paper .rx-hospital {
    text-align: center;
    margin-bottom: 6px;
}
.rx-paper .rx-hospital .rx-logo {
    width: 48px;
    height: 48px;
    vertical-align: middle;
    margin-right: 10px;
}
.rx-paper .rx-hospital h1 {
    display: inline-block;
    vertical-align: middle;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 4px;
    margin: 0;
}
.rx-paper .rx-hospital .rx-hospital-en {
    display: block;
    font-size: 11px;
    color: #666;
    letter-spacing: 2px;
    font-family: Arial, sans-serif;
    margin-top: 2px;
    text-transform: uppercase;
}
.rx-paper .rx-title {
    text-align: center;
    font-size: 16px;
    color: #333;
    margin: 8px 0 14px;
    letter-spacing: 2px;
}
/* 信息行 */
.rx-paper .rx-info-row {
    display: flex;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid #ccc;
    gap: 20px;
}
.rx-paper .rx-info-row .rx-info-item {
    white-space: nowrap;
}
.rx-paper .rx-info-row .rx-info-label {
    color: #333;
}
.rx-paper .rx-info-row .rx-info-value {
    font-weight: 600;
    color: #000;
}
/* R 符号 */
.rx-paper .rx-r-symbol {
    font-size: 32px;
    font-weight: 700;
    color: #000;
    font-family: "Times New Roman", serif;
    margin: 16px 0 10px;
    line-height: 1;
}
/* 药材网格（4列） */
.rx-paper .rx-drugs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 24px;
    font-size: 14pt;
    margin-bottom: 16px;
    padding: 0 4px;
}
.rx-paper .rx-drugs-grid .rx-drug-item {
    display: flex;
    align-items: baseline;
    justify-content: center;
    padding: 5px 0;
}
.rx-paper .rx-drugs-grid .rx-drug-name {
    font-weight: 500;
}
.rx-paper .rx-drugs-grid .rx-drug-dose {
    font-weight: 600;
    margin-left: 24px;
    white-space: nowrap;
}
.rx-paper .rx-drugs-grid .rx-drug-special {
    font-size: 12px;
    color: #e65100;
    font-weight: 400;
}
/* 汇总信息（右对齐） */
.rx-paper .rx-summary {
    text-align: right;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.8;
}
/* 用法用量 */
.rx-paper .rx-usage-text {
    font-size: 13px;
    color: #333;
    margin-bottom: 20px;
    text-align: right;
    line-height: 1.8;
}
.rx-paper .rx-usage-text .rx-usage-prefix {
    font-weight: 600;
}
/* 底部签名区 */
.rx-paper .rx-footer {
    margin-top: 30px;
}
.rx-paper .rx-footer .rx-doctor-line {
    font-size: 13px;
    margin-bottom: 20px;
}
.rx-paper .rx-footer .rx-doctor-line .rx-sign-label {
    color: #333;
}
.rx-paper .rx-footer .rx-doctor-line .rx-sign-name {
    font-weight: 600;
    margin-left: 8px;
    border-bottom: 1px solid #999;
    padding: 0 30px 2px;
    display: inline-block;
    min-width: 80px;
}
.rx-paper .rx-footer .rx-pharmacist-row {
    display: flex;
    font-size: 13px;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    gap: 20px;
}
.rx-paper .rx-footer .rx-pharmacist-row .rx-pharm-item {
    flex: 1;
}
.rx-paper .rx-footer .rx-pharmacist-row .rx-pharm-label {
    color: #333;
}
.rx-paper .rx-footer .rx-pharmacist-row .rx-pharm-line {
    display: inline-block;
    border-bottom: 1px solid #999;
    min-width: 80px;
    margin-left: 4px;
    height: 18px;
}

/* 打印时只显示处方 */
@media print {
    body * { visibility: hidden !important; }
    #prescriptionPaperOverlay,
    #prescriptionPaperOverlay * { visibility: visible !important; }
    #prescriptionPaperOverlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        background: white !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    .prescription-paper-toolbar { display: none !important; }
    .prescription-paper-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }
    .rx-paper {
        padding: 15mm 20mm 10mm !important;
        min-height: auto !important;
    }
    @page {
        size: A4;
        margin: 0;
    }
}
