/* 继中堂客户管理系统 - 样式表 */
:root {
    --green-500: #2E7D32;
    --green-700: #1B5E20;
    --green-50: #E8F5E9;
    --green-100: #C8E6C9;
    --green-200: #A5D6A7;
    --green-300: #81C784;
    --red-100: #FFCDD2;
    --red-700: #B71C1C;
    --orange-100: #FFE0B2;
    --orange-700: #E65100;
    --yellow-100: #FFF9C4;
    --blue-100: #BBDEFB;
    --blue-700: #1565C0;
    --purple-100: #E1BEE7;
    --gray-100: #F5F5F5;
    --gray-300: #E0E0E0;
    --gray-500: #9E9E9E;
    --gray-700: #424242;
    --gray-900: #212121;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, "Microsoft YaHei", "微软雅黑", sans-serif;
    background: #FAFAFA;
    color: var(--gray-900);
    font-size: 14px;
}

#app {
    max-width: 100%;
    margin: 0;
    padding: 0 16px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部导航 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 2px solid var(--green-500);
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--green-700);
    white-space: nowrap;
}

.tabs {
    display: flex;
    gap: 4px;
    flex: 1;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--green-50);
}

.tab-btn.active {
    background: var(--green-500);
    color: var(--white);
    font-weight: 600;
}

.status-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
}

.save-idle { color: var(--green-500); }
.save-saving { color: var(--orange-700); }
.save-error { color: var(--red-700); }

/* 备份状态：常驻显示，未备份灰色、已备份绿色打钩 */
.backup-toast {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #9e9e9e;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 4px 12px;
    pointer-events: none;
    white-space: nowrap;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.backup-toast.show {
    color: var(--green-700, #2e7d32);
    background: #e8f5e9;
    border-color: #a5d6a7;
}

/* Tab 内容 */
.tab-content {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 0;
}

.tab-content.active {
    display: block;
    overflow: auto;
    position: relative;
}

/* 数据总表 / 高价值客户 / 健康档案 / 会员服务页面：绿白底色搭配（浅绿渐变到白，视觉效果统一） */
#tab-data, #tab-value, #tab-health, #tab-member, #tab-followup {
    background: linear-gradient(165deg, #eafaf2 0%, #f3fbf7 52%, #ffffff 100%);
}

/* 数据总表：占满视口，工具栏固定不动，只有表格区内部滚动 —— 表头 sticky 永远生效 */
#tab-data.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#tab-data.active .toolbar {
    flex: 0 0 auto;
}
#tab-data.active .table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin-top: 12px;
}

/* 理疗产品：与数据总表同一套布局 —— 标签页本身不滚(overflow:hidden)，只有表格区内部滚，
   否则会出现「标签页滚 + table-wrapper 也滚」的嵌套滚动，把 sticky 表头的参考系搞乱，下滑就看不见表头了 */
#tab-therapy.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;            /* 与 #app 等高，确保内部只有表格区滚动，统计区/表头才固定得住 */
}
#tab-therapy.active .toolbar {
    flex: 0 0 auto;
}
#tab-therapy.active .table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;          /* 显式指定滚动容器，盖过基础 .table-wrapper 的级联稀释，下滑时只有表格内部滚 */
    margin-top: 12px;
}

/* 健康档案：顶部工具栏在标签页内吸顶固定，滚动长表单/表格时按钮排始终可见（不随内容滚走）；
   实心白底 + 细分隔线，固定在顶部但不做悬浮/半透明效果 */
#tab-health.active .toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex: 0 0 auto;
    background: #fff;
    border-bottom: 1px solid #e5e5ea;
    padding: 2px 0 4px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar input {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    width: 240px;
}

.tip {
    color: var(--gray-500);
    font-size: 12px;
    margin-left: auto;
}

.btn-green, .btn-blue, .btn-red {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--white);
    transition: opacity 0.2s;
}

.btn-green { background: var(--green-500); }
.btn-blue { background: var(--blue-700); }
.btn-red { background: var(--red-700); }

.btn-green:hover, .btn-blue:hover, .btn-red:hover {
    opacity: 0.85;
}

/* 数据表格 */
.table-wrapper {
    overflow: auto;                       /* 横向+纵向都可滚动 */
    max-height: calc(100vh - 118px);      /* 占满剩余视口，下拉时表头常驻可见 */
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    scrollbar-width: thin;
    scrollbar-color: var(--green-500) var(--gray-100);
}

/* 自定义滚动条（webkit）——明显的绿色滑块 */
.table-wrapper::-webkit-scrollbar { width: 14px; height: 16px; }
.table-wrapper::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 8px; }
.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--green-500);
    border-radius: 8px;
    border: 3px solid var(--gray-100);
    background-clip: padding-box;
}
.table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--green-700); }

#data-table {
    width: 100%;
    min-width: 0;             /* 允许列宽按内容自适应压缩，尽量挤进一屏 */
    border-collapse: separate;/* 用 separate 才能让 sticky 表头在滚动容器内常驻 */
    border-spacing: 0;
    font-size: 11px;          /* 紧凑字号：一屏呈现更多文字信息 */
    line-height: 1.28;
}

#therapy-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;/* 必须用 separate：collapse 会让 sticky 表头在滚动容器内边框丢失/表头"消失"，下滑就看不见固定表头了 */
    border-spacing: 0;
    font-size: 11px;          /* 与数据总表一致，保持全站紧凑风格 */
    line-height: 1.28;
}

#therapy-table th {
    background: var(--green-500);
    color: var(--white);
    padding: 5px 6px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

#therapy-table td {
    padding: 3px 8px;
    border-bottom: 1px solid var(--gray-300);
    text-align: center;
    white-space: nowrap;
}

/* 理疗表可编辑单元格：覆盖全局 .editable 的 !important，对齐数据总表紧凑度（上下2px） */
#therapy-table td.editable {
    padding: 2px 6px !important;
}

#therapy-table tbody tr:nth-child(even) { background: var(--green-50); }
#therapy-table tbody tr:hover { background: var(--green-100); }

/* 理疗表底部合计行 */
#therapy-table tbody tr.therapy-total-row {
    background: var(--green-200);
    font-weight: 600;
}
#therapy-table tbody tr.therapy-total-row:hover { background: var(--green-200); }
#therapy-table tbody tr.therapy-total-row td {
    border-top: 2px solid var(--green-700);
    color: var(--green-900);
    padding-top: 4px;
    padding-bottom: 4px;
}

/* 数据表首列(序号)横向滚动时固定可见 */
#data-table th:first-child,
#data-table td:first-child {
    position: sticky;
    left: 0;
}
#data-table td:first-child {
    background: var(--white);
    z-index: 5;
}
#data-table th:first-child {
    z-index: 20;  /* 左上角：盖过表头与普通单元格 */
}

#data-table th {
    background: var(--green-500);
    color: var(--white);
    padding: 5px 4px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #2E7D32;
}

/* 表头筛选行：常驻在标题行正下方，与标题行一起 sticky */
#data-table thead tr.filter-row th {
    top: 26px;
    background: #f4f6f4;
    color: #333;
    font-weight: 500;
    z-index: 9;
    padding: 2px 3px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #cfd8cf;
}
.filter-input, .filter-select {
    width: 100%;
    box-sizing: border-box;
    font-size: 10px;
    padding: 2px 3px;
    border: 1px solid #c8c8c8;
    border-radius: 3px;
    background: #fbfdfb;
    color: #222;
}
.filter-select { cursor: pointer; }

#data-table td {
    padding: 3px 4px;
    border-bottom: 1px solid var(--gray-300);
    text-align: center;
    white-space: nowrap;
}

/* 长文本列：限宽并允许换行，避免单行撑爆横向空间，让整表尽量在一屏内呈现 */
#data-table td.cell-wrap {
    max-width: 130px;
    white-space: normal;
    word-break: break-word;
    text-align: left;
    line-height: 1.3;
}

/* 数据总表整行背景色衬托：按发货情况状态区分（待发货/已发货/不发货）+ 已核对左绿边 */
#data-table tbody tr.row-pending { background: #FFF8E1 !important; }   /* 待发货：淡琥珀 */
#data-table tbody tr.row-shipped { background: #E8F5E9 !important; }   /* 已发货：淡绿 */
#data-table tbody tr.row-noship  { background: #F0F1F3 !important; }   /* 不发货：淡灰 */
#data-table tbody tr.row-checked { box-shadow: inset 4px 0 0 #2E7D32; } /* 已核对：左侧绿色强调边 */

/* 鼠标悬停整行高亮（单排高亮）：放在状态底色之后，确保悬停时覆盖底色 */
#data-table tbody tr:hover {
    background: var(--green-300) !important;
}

/* 修改数据时整行高亮：聚焦整条横向数据 + 保存成功短暂加亮 */
#data-table tbody tr.row-active {
    background: #C8E6C9 !important;               /* 聚焦整行：较深绿底 */
    box-shadow: inset 0 0 0 2px var(--green-700); /* 整行绿框强调 */
}
#data-table tbody tr.row-saved {
    background: #A5D6A7 !important;               /* 保存成功：更亮一闪 */
    transition: background 0.5s ease;
}

/* 可编辑单元格 */
.editable {
    cursor: text;
    border-radius: 3px;
    padding: 2px 4px !important;
    text-align: center;
    transition: background 0.15s;
}

/* 下拉选择单元格 */
.cell-select {
    padding: 2px 4px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    background: var(--white);
    cursor: pointer;
    max-width: 100px;
    font-family: inherit;
}

.cell-select:focus {
    outline: 2px solid var(--green-500);
    outline-offset: -2px;
}
/* 开方医生：带下拉列表的文本输入（既能选又能输）放宽一点 */
.cell-select[list] {
    max-width: 130px;
    cursor: text;
}

/* 数据总表底部：三状态列「已完成」统计（tfoot 行，与表格列天然对齐） */
#data-tfoot tr.stats-row td {
    background: #F1F8E9;
    border-top: 2px solid #c5e1a5;
    color: #2e7d32;
    font-weight: 700;
    text-align: center;
    padding: 2px 4px;
}
#data-tfoot tr.stats-row td.stats-cell {
    font-size: inherit;
    letter-spacing: 0;
}
.stat-label { font-size: 12px; color: #555; }
.stat-num { font-size: 20px; font-weight: 700; color: var(--green-700, #2e7d32); }
.stat-total { font-size: 12px; color: #999; }

/* 发货日期：日期选择器 */
.cell-date {
    width: 100%;
    min-width: 96px;
    box-sizing: border-box;
    padding: 2px 4px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
    color: var(--gray-800);
}
.cell-date:focus {
    outline: 2px solid var(--green-500);
    outline-offset: -2px;
}
input.cell-date:disabled {
    background: #fafafa;
    color: var(--gray-500);
    cursor: default;
    border-color: var(--gray-200);
}

/* 已核对：复选框 */
.cell-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--green-600);
    vertical-align: middle;
}
input.cell-check:disabled {
    cursor: default;
}

/* 药方单据上传 */
.prescription-input {
    font-size: 11px;
    max-width: 150px;
    cursor: pointer;
}

#data-table td a.copy-btn {
    text-decoration: none;
    display: inline-block;
}

.editable:hover {
    background: #FFFDE7;
    border: 1px dashed var(--gray-500);
}

.editable:focus {
    background: #FFF9C4;
    outline: 2px solid var(--green-500);
    outline-offset: -2px;
}

.cell-modified {
    background: #FFF9C4 !important;
}

/* 优先级颜色 */
.priority-p0 { background: var(--red-100); color: var(--red-700); font-weight: 600; }
.priority-p1 { background: var(--orange-100); color: var(--orange-700); font-weight: 600; }
.priority-p2 { background: var(--yellow-100); }
.priority-p3 { background: var(--green-100); }

/* 已完成标记 */
.done-yes { color: var(--green-500); font-weight: 600; }
.done-no { color: var(--gray-500); }

/* 分析报告 */
.analysis-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 分析报告：按账号分组展示（管理员可见每个账号独立汇总） */
.analysis-owner-block {
    background: #fff;
    border: 1px solid #e3e8e3;
    border-radius: 12px;
    padding: 18px 20px 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.analysis-owner-title {
    font-size: 16px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f5e9;
}

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

.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-top: 3px solid var(--green-500);
}

.stat-card.red { border-top-color: var(--red-700); }
.stat-card.orange { border-top-color: var(--orange-700); }
.stat-card.blue { border-top-color: var(--blue-700); }
.stat-card.purple { border-top-color: #7B1FA2; }

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--green-700);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--green-100);
}

/* 分析表格 */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.analysis-table th {
    background: var(--green-50);
    color: var(--green-700);
    padding: 8px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--green-100);
}

.analysis-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-300);
    text-align: center;
}

.analysis-table tr:hover {
    background: var(--green-50);
}

/* 跟进清单 */
.followup-section {
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.followup-header {
    background: var(--white);    /* 吸顶时防止下方卡片透出 */
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-300);
}
/* P0 标题被并入顶部吸顶块（#followup-p0-head 已带 followup-header 样式），其内层自身再带一份 border-bottom 会变成“文字下方一条短下划线”，这里去掉内层多余的那条 */
#followup-p0-head .followup-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    background: transparent;
}
/* P0 标题槽自身也带 .followup-header，会留下一条贯穿整页宽度的底线，这里一并去掉 */
#followup-p0-head {
    border-bottom: none;
}
/* 分组标题在“分组区”内部吸顶：P1/P2/P3 滑到顶部时钉在分组区最上方（吸顶头部下方） */
.followup-scroll .followup-header {
    position: sticky;
    top: 0;
    z-index: 30;
}
/* JS 吸顶时给标题加的兜底阴影，与吸顶头部视觉衔接 */
.followup-header.fu-pinned {
    box-shadow: 0 4px 6px -4px rgba(0,0,0,0.15);
    margin-bottom: 12px;
}

.followup-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-p0 { background: var(--red-100); color: var(--red-700); }
.badge-p1 { background: var(--orange-100); color: var(--orange-700); }
.badge-p2 { background: var(--yellow-100); color: #F57F17; }
.badge-p3 { background: var(--green-100); color: var(--green-700); }

.followup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.followup-table th {
    background: var(--gray-100);
    padding: 3px 5px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

.followup-table td {
    padding: 2px 5px;
    border-bottom: 1px solid var(--gray-300);
    text-align: center;
    font-size: 11px;
}

.followup-table tr.p0-row { background: #FFEBEE; }
.followup-table tr.p1-row { background: #FFF3E0; }
.followup-table tr.p2-row { background: #FFFDE7; }
.followup-table tr.p3-row { background: #E8F5E9; }

.msg-box {
    background: var(--green-50);
    border-left: 3px solid var(--green-500);
    padding: 8px 12px;
    margin: 4px 0;
    font-size: 12px;
    color: var(--gray-700);
    border-radius: 0 4px 4px 0;
}

.followup-msg-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    min-width: 220px;
    max-width: 420px;
}
.followup-status-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    min-width: 220px;
    max-width: 420px;
}
.followup-msg-cell textarea, .followup-status-cell textarea { text-align: center; }
.followup-status-edit {
    width: 100%;
    min-height: 58px;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}
.followup-status-edit:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 2px rgba(46,125,50,.15);
}
.followup-msg-edit {
    width: 100%;
    min-height: 58px;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    font-family: inherit;
    color: var(--gray-700);
    resize: vertical;
    background: var(--white);
}
.followup-msg-edit:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 2px rgba(46,125,50,.12);
}
.followup-msg-edit.is-custom {
    background: #FFF8E1;
    border-color: #F9A825;
}
.followup-msg-actions {
    display: flex;
    gap: 6px;
}
.reset-btn {
    padding: 2px 8px;
    font-size: 11px;
    background: var(--white);
    color: #8D6E63;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
}
.reset-btn:hover { background: var(--gray-100); }

.copy-btn {
    padding: 2px 8px;
    font-size: 11px;
    background: var(--green-500);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.copy-btn:hover { opacity: 0.85; }
.copy-btn.copied { background: var(--green-600, #1a7f43); box-shadow: 0 0 0 2px rgba(42,125,70,.25); }

.status-toggle {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-block;
}

.status-toggle.pending {
    background: var(--gray-100);
    color: var(--gray-500);
}

.status-toggle.done {
    background: var(--green-100);
    color: var(--green-700);
    font-weight: 600;
}

/* 标签指南 */
/* 标签指南：进度条 + 搜索框 一起浮动常驻顶部 */
.tag-float-bar {
    background: var(--white);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.tag-progress-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.tag-progress-info { flex: 0 0 auto; }
.tag-progress-stats { display: flex; gap: 16px; font-size: 13px; }
.tag-progress-stats span { color: var(--gray-500); }
.tag-progress-stats strong { color: var(--green-700); }

.tag-progress-track {
    flex: 1;
    height: 8px;
    background: var(--gray-300);
    border-radius: 4px;
    overflow: hidden;
}

.tag-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #66BB6A, var(--green-700));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}

.tag-search-box {
    margin: 10px 0 0;
}

.tag-search-box input {
    width: 280px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.tag-search-box input:focus {
    border-color: var(--green-500);
}

.tag-def-card {
    background: var(--white);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tag-def-title {
    font-weight: 600;
    color: var(--green-700);
    margin-bottom: 2px;
    font-size: 13px;
}

/* 标签体系副标题：企微创建路径，紧贴主标题连成一体 */
.tag-def-sub {
    font-size: 12px;
    color: #999;
    margin: 2px 0 6px;
    line-height: 1.4;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-chip {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10.5px;
    background: var(--green-50);
    color: var(--green-700);
    border: 1px solid var(--green-100);
}

.tag-chip.tc-venue { background: #E3F2FD; color: var(--blue-700); border-color: #BBDEFB; }
.tag-chip.tc-illness { background: #FFF3E0; color: var(--orange-700); border-color: #FFE0B2; }
.tag-chip.tc-status { background: #F3E5F5; color: #7B1FA2; border-color: #E1BEE7; }
.tag-chip.tc-value { background: #FFFDE7; color: #F57F17; border-color: #FFF9C4; }
.tag-chip.tc-priority { background: #FFEBEE; color: var(--red-700); border-color: #FFCDD2; }

/* 标签体系：3 列紧凑网格 */
.tag-defs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 10px;
}
.tag-def-item { min-width: 0; }

/* 标签可点击筛选 */
.tag-chip.clickable { cursor: pointer; user-select: none; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.tag-chip.clickable:hover { filter: brightness(0.94); transform: translateY(-1px); }
.tag-chip.tag-selected { outline: 2px solid #2E7D32; font-weight: 600; box-shadow: 0 0 0 2px rgba(46,125,50,0.30); }

/* 标签客户卡片 */
.tag-date-group {
    margin-top: 16px;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tdg-p0 { background: #FFCDD2; color: #B71C1C; }
.tdg-p1 { background: #FFE0B2; color: #BF360C; }
.tdg-p2 { background: #FFF9C4; color: #F57F17; }
.tdg-p3 { background: #C8E6C9; color: #1B5E20; }

.tag-date-group .count { font-size: 12px; font-weight: 400; opacity: 0.8; }

.tag-customer-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--white);
    transition: border-color 0.2s;
}

.tag-customer-card:hover { border-color: #A5D6A7; }

.tag-customer-card.tc-p0 { border-left: 4px solid #D32F2F; background: #FFEBEE; }
.tag-customer-card.tc-p1 { border-left: 4px solid #EF6C00; background: #FFF3E0; }
.tag-customer-card.tc-p2 { border-left: 4px solid #F9A825; background: #FFFDE7; }
.tag-customer-card.tc-p3 { border-left: 4px solid var(--green-500); background: #E8F5E9; }

.tcc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tcc-name { font-size: 16px; font-weight: 700; }

.tcc-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.tcc-pri-p0 { background: #FFCDD2; color: #B71C1C; }
.tcc-pri-p1 { background: #FFE0B2; color: #BF360C; }
.tcc-pri-p2 { background: #FFF9C4; color: #F57F17; }
.tcc-pri-p3 { background: #C8E6C9; color: #1B5E20; }

.tcc-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.tcc-info span { display: flex; align-items: center; gap: 4px; }
.tcc-info .label { color: #999; }

.tcc-copy-section {
    background: #FAFAFA;
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
}

.tcc-copy-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.tcc-copy-row:last-child { margin-bottom: 0; }

.tcc-copy-label {
    font-size: 11px;
    color: #999;
    min-width: 56px;
    padding-top: 2px;
}

.tcc-copy-content {
    flex: 1;
    font-size: 13px;
}

.tcc-remark-text {
    font-family: monospace;
    font-size: 12px;
    color: #333;
    background: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    word-break: break-all;
}

.tcc-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tcc-tag-list .tag-chip {
    font-size: 11px;
    padding: 2px 6px;
}

.tcc-done-badge {
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ccc;
    background: var(--white);
    color: #999;
    transition: all 0.2s;
}

.tcc-done-badge.done {
    background: var(--green-500);
    color: var(--white);
    border-color: var(--green-500);
}

.tcc-done-badge:hover { border-color: var(--green-500); }

.tcc-wx-btn {
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ccc;
    background: var(--white);
    color: #1976d2;
    transition: all 0.2s;
}
.tcc-wx-btn:hover { border-color: #1976d2; }
.tcc-wx-btn.done {
    background: var(--green-500);
    color: var(--white);
    border-color: var(--green-500);
}

.tcc-copy-btn {
    padding: 3px 10px;
    border: 1px solid #A5D6A7;
    border-radius: 4px;
    background: var(--green-50);
    color: var(--green-500);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.tcc-copy-btn:hover { background: var(--green-100); }
.tcc-copy-btn:active { transform: scale(0.96); }
.tcc-copy-btn.copied { background: var(--green-500); color: var(--white); border-color: var(--green-500); }

/* 搜索过滤 */
.row-hidden {
    display: none;
}

/* 跟进清单搜索框 */
.followup-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    margin: 0;
}

/* 跟进清单：筛选按钮（发送状态 + 优先级），与进度条/搜索联动 */
.fu-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.fu-filter-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 4px;
}
.fu-filter-btn {
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.fu-filter-btn:hover { border-color: var(--green-500); }
.fu-filter-btn em {
    font-style: normal;
    font-weight: 700;
    margin-left: 2px;
    opacity: 0.85;
}
.fu-filter-btn.active {
    color: #fff;
    border-color: transparent;
}
.fu-filter-btn.fu-status.active { background: var(--blue-600, #1e88e5); }
.fu-filter-btn.fu-done.active { background: var(--green-600, #2e7d32); }
.fu-filter-btn.fu-pending.active { background: var(--orange-700, #ef6c00); }
.fu-filter-btn.fu-prio.active.prio-p0 { background: var(--red-700, #c62828); }
.fu-filter-btn.fu-prio.active.prio-p1 { background: var(--orange-700, #ef6c00); }
.fu-filter-btn.fu-prio.active.prio-p2 { background: var(--blue-600, #1e88e5); }
.fu-filter-btn.fu-prio.active.prio-p3 { background: #7B1FA2; }
.fu-filter-btn.tg-wx.active { background: var(--blue-600, #1e88e5); }
.fu-filter-btn.tg-nowx.active { background: var(--gray-500, #777); }
.fu-filter-btn.tg-done.active { background: var(--green-600, #2e7d32); }
.fu-filter-btn.tg-notdone.active { background: var(--orange-700, #ef6c00); }
.fu-filter-btn.fu-clear { border-style: dashed; color: var(--gray-500); }
.fu-filter-btn.fu-clear:hover { color: var(--red-700); border-color: var(--red-700); }
.fu-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fu-result-hint {
    font-size: 13px;
    color: var(--gray-600);
    padding: 8px 0 2px;
}
.fu-result-hint strong { color: var(--blue-600, #1e88e5); }

.followup-toolbar input {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    width: 340px;
    outline: none;
    transition: border-color 0.2s;
}

.followup-toolbar input:focus {
    border-color: var(--green-500);
}

/* 跟进清单：进度条 + 搜索框 + 统计排 整体吸顶（自适应高度，无需固定像素） */
/* 跟进清单：与数据总表 / 理疗产品同一套布局 —— 标签页本身不滚(overflow:hidden)，
   只有「分组区」(.followup-scroll) 内部滚动，下滑时顶部模块固定、表格在框内滚 */
#tab-followup.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;            /* 与 #app 等高，确保内部只有分组区滚动 */
}
#tab-followup.active .followup-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
#tab-followup.active .followup-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;          /* 唯一滚动容器：P0/P1/P2/P3 分组表格在此内部滚动，不再滑出页面顶 */
    margin-top: 4px;
}
.followup-sticky-head {
    position: sticky;
    top: 0;
    z-index: 45;
    background: var(--white);
    flex: 0 0 auto;          /* 固定占顶部，不被压缩、不随页面滚走 */
    display: flex;
    flex-direction: column;
    gap: 14px;               /* 进度条+搜索 / 统计排 / P0标题 三块均匀分布，间距一致 */
    padding: 0 12px 12px;
    margin-bottom: 0;
    border-bottom: none;     /* 去掉未定义 --gray-200 可能在部分浏览器渲染出的长条黑线，保留阴影过渡 */
    box-shadow: 0 4px 10px -6px rgba(0,0,0,0.18);
}
/* 跟进清单：进度条 + 搜索框 一起浮动常驻顶部 */
.followup-float-bar {
    background: var(--white);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 0;            /* 间距交给外层 .followup-sticky-head */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 标签指南：与跟进清单完全同一套布局 —— 整页不滚、内容区内滚、顶块吸顶固定 */
/* 标签页本身不滚(overflow:hidden)，只有「内容区」(.tags-scroll) 内部滚动，下滑时顶块固定 */
#tab-tags.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;            /* 与 #app 等高，确保内部只有内容区滚动 */
}
#tab-tags.active .tags-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
#tab-tags.active .tags-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;          /* 唯一滚动容器：标签体系 + 客户列表在此内部滚动，不再滑出页面顶 */
    margin-top: 0;
}
.tags-sticky-head {
    position: sticky;
    top: 0;
    z-index: 45;
    background: var(--white);
    flex: 0 0 auto;          /* 固定占顶部，不被压缩、不随页面滚走 */
    display: flex;
    flex-direction: column;
    gap: 6px;                /* 提示 + 进度条/搜索/筛选 两块均匀分布，间距一致 */
    padding: 0 12px 6px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--gray-200);
    box-shadow: 0 4px 10px -6px rgba(0,0,0,0.18);
}
/* 标签体系固定在顶部：不随客户列表滚动（与吸顶块同为 flex:0 0 auto，只有 .tags-scroll 内部滚动） */
.tags-defs-fixed {
    flex: 0 0 auto;
    margin: 0 12px 4px;
}
.tags-sticky-head .tags-toolbar { margin-bottom: 0; }
.followup-progress-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}
.followup-progress-info { flex: 0 0 auto; }
.followup-progress-stats { display: flex; gap: 16px; font-size: 13px; }
.followup-progress-stats span { color: var(--gray-500); }
.followup-progress-stats strong { color: var(--blue-600, #1e88e5); }
.followup-progress-track {
    flex: 1;
    height: 8px;
    background: var(--gray-300);
    border-radius: 4px;
    overflow: hidden;
}
.followup-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #42a5f5, #1565c0);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}

/* 理疗产品 — 汇总条 */
.therapy-summary {
    margin-bottom: 10px;
    flex: 0 0 auto;          /* 不被压缩、不伸缩，牢牢钉在表格区上方，下滑时统计区不动 */
    position: sticky;        /* 兜底：即使外层整页滚动，统计区也吸顶常驻 */
    top: 0;
    z-index: 6;
    background: #fff;
}

.therapy-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.ts-card {
    background: var(--white);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-top: 3px solid var(--green-500);
}

.ts-card.blue { border-top-color: var(--blue-700); }
.ts-card.purple { border-top-color: #7B1FA2; }
.ts-card.green { border-top-color: var(--green-700); }

.ts-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.ts-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* 理疗产品 — 场次卡片 */
.therapy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.therapy-card {
    background: var(--white);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--green-500);
    transition: box-shadow 0.2s, transform 0.2s;
}

.therapy-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--gray-300);
}

.tc-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tc-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--green-700);
}

.tc-venue {
    font-size: 12px;
    color: var(--gray-500);
}

.tc-field {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.tc-field-label {
    flex: 0 0 64px;
    color: var(--gray-500);
    font-size: 12px;
}

.tc-field-val {
    flex: 1;
    color: var(--gray-900);
    min-height: 20px;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.tc-field-full {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.tc-field-full .tc-field-label {
    flex: none;
}

/* 响应式 */
@media (max-width: 768px) {
    #app { padding: 0 8px; }
    .topbar { gap: 8px; }
    .tab-btn { padding: 6px 10px; font-size: 12px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .toolbar input { width: 100%; }
    .tip { display: none; }
    .tcc-info { grid-template-columns: 1fr; }
}


/* ===== 修改开关（滑动开关） ===== */
.edit-lock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4f6f4;
    border: 1px solid #d8e0d8;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}
.followup-toolbar .edit-lock,
.tags-toolbar .edit-lock { margin-left: 0; }
.tags-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.edit-lock input { display: none; }
.edit-lock .slider {
    width: 34px; height: 18px; border-radius: 9px;
    background: #c8c8c8; position: relative; transition: background .2s; flex: none;
}
.edit-lock .slider::after {
    content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; top: 2px; left: 2px; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.edit-lock input:checked + .slider { background: var(--green-500); }
.edit-lock input:checked + .slider::after { transform: translateX(16px); }
.edit-lock-state { font-size: 12px; color: #999; min-width: 52px; }
.edit-lock input:checked ~ .edit-lock-state { color: var(--green-700); }
.cell-locked { background: #fafafa !important; cursor: default; }

/* ===== 著作权页脚 ===== */
.app-footer {
    text-align: center;
    padding: 14px 0 18px;
    margin-top: 20px;
    color: #9aa19a;
    font-size: 13px;
    border-top: 1px solid #eee;
}

/* ===== 登录遮罩（深色品牌风，手机号验证码为主） ===== */
.login-overlay {
    position: fixed; inset: 0; z-index: 100000;
    background: #1a1a1a;
    display: flex; align-items: center; justify-content: center;
}
.login-box {
    background: transparent; width: 360px; max-width: 92vw;
    padding: 8px 4px; text-align: center; color: #e8e8e8;
}
.login-brand {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 22px;
}
.login-brand-mark {
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: #fff; font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(46,125,50,.4);
}
.login-brand-name { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.login-title { font-size: 22px; font-weight: 700; color: #f0f0f0; margin-bottom: 4px; letter-spacing: 1px; }
.login-sub { font-size: 12px; color: #888; margin-bottom: 22px; }

/* 复合字段行（手机号 / 验证码） */
.login-field {
    display: flex; align-items: center;
    background: #2a2a2a; border: 1px solid #333; border-radius: 10px;
    padding: 0 14px; margin-bottom: 14px;
    transition: border-color .2s;
}
.login-field:focus-within { border-color: #66bb6a; }
.login-prefix {
    color: #aaa; font-size: 14px; padding-right: 12px;
    border-right: 1px solid #444; margin-right: 12px;
    user-select: none;
}
.login-field .login-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: #f0f0f0; font-size: 15px; padding: 14px 0; margin: 0;
}
.login-field .login-input::placeholder { color: #666; }
.login-sendcode {
    background: transparent; color: #66bb6a; border: none;
    font-size: 13px; padding: 0 4px; cursor: pointer; white-space: nowrap;
    font-weight: 500;
}
.login-sendcode:disabled { color: #555; cursor: not-allowed; }
.login-sendcode:hover:not(:disabled) { color: #81c784; }

/* 独立输入（密码模式 & 注册密码） */
.login-input {
    width: 100%; box-sizing: border-box;
    background: #2a2a2a; border: 1px solid #333; border-radius: 10px;
    padding: 14px; margin-bottom: 14px;
    color: #f0f0f0; font-size: 15px; outline: none;
    transition: border-color .2s;
}
.login-input::placeholder { color: #666; }
.login-input:focus { border-color: #66bb6a; }

.login-regpw { display: block; animation: slideDown .25s ease-out; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-err { color: #ef5350; font-size: 12px; min-height: 16px; margin: 4px 0 6px; text-align: center; }
.login-remember {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #aaa; margin: -6px 0 14px; cursor: pointer; user-select: none;
    justify-content: flex-start;
}
.login-remember input { width: 15px; height: 15px; accent-color: #66bb6a; cursor: pointer; }

.login-btn {
    width: 100%; padding: 14px; border: none; border-radius: 10px;
    background: #fff; color: #1a1a1a; font-size: 16px; font-weight: 600;
    cursor: pointer; margin-top: 6px;
    transition: background .2s;
}
.login-btn:hover:not(:disabled) { background: #e8e8e8; }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

.login-terms { margin-top: 18px; font-size: 11px; color: #777; line-height: 1.7; }
.login-terms a { color: #aaa; text-decoration: none; }
.login-terms a:hover { color: #fff; }
.login-switch {
    margin-top: 24px; font-size: 13px; color: #888; cursor: pointer; user-select: none;
}
.login-switch:hover { color: #66bb6a; }

/* ===== 顶栏当前用户 / 登出 ===== */
.current-user { font-size: 13px; color: #2e7d32; font-weight: 600; }

/* ===== 账号管理（紧凑：缩小新增/展示模块，让下方文档区上移贴顶） ===== */
.accounts-wrap { padding: 8px 10px 0; }
.accounts-add {
    background: #f6fbf6; border: 1px solid #c8e6c9; border-radius: 9px;
    padding: 8px 10px; margin-bottom: 7px;
}
.accounts-add-title { font-weight: 600; font-size: 12px; margin-bottom: 5px; color: #2e7d32; }
.accounts-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.accounts-form input, .accounts-form select {
    padding: 5px 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 12px;
}
.accounts-form input[type=text] { min-width: 96px; }
.accounts-list { margin-top: 2px; }
.accounts-table { width: 100%; border-collapse: collapse; background: #fff; }
.accounts-table th, .accounts-table td {
    border: 1px solid #e0e0e0; padding: 3px 8px; text-align: center; font-size: 12px;
}
.accounts-table th { background: #2e7d32; color: #fff; }
.accounts-table tr:nth-child(even) td { background: #f6fbf6; }
.accounts-ops { white-space: nowrap; }
.btn-sm { padding: 3px 9px; font-size: 11px; margin-right: 5px; }

/* ===== 药方识别页 ===== */
.rx-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.rx-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.rx-left { flex: 0 0 360px; min-width: 300px; }
.rx-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rx-panel {
    background: var(--white);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 14px;
}
.rx-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--green-700);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--green-100);
}
.rx-img-box img { border: 1px solid var(--gray-300); }
.rx-upload-status { margin-top: 8px; font-size: 12px; color: var(--gray-700); min-height: 18px; }
.rx-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 12px;
}
.rx-info-grid label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--gray-500);
    gap: 2px;
}
.rx-input {
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--white);
}
.rx-input:focus { border-color: var(--green-500); outline: none; }
.rx-input[readonly] { background: #f5f5f5; color: #555; }
.rx-textarea {
    width: 100%;
    min-height: 120px;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
}
.rx-textarea:focus { border-color: var(--green-500); outline: none; }
.rx-herbs-wrap { max-height: 260px; margin-bottom: 10px; }
#rx-herbs-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 0; }
#rx-herbs-table th {
    background: var(--green-500); color: #fff; padding: 6px; position: sticky; top: 0; z-index: 5;
}
#rx-herbs-table td { padding: 4px 6px; border-bottom: 1px solid var(--gray-300); text-align: center; }
#rx-herbs-table .rx-input { width: 100%; box-sizing: border-box; }
.rx-fields {
    display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px;
}
.rx-fields label { display: flex; flex-direction: column; font-size: 12px; color: var(--gray-500); gap: 2px; flex: 1; min-width: 140px; }
.rx-actions { display: flex; align-items: center; gap: 12px; }

@media (max-width: 900px) {
    .rx-layout { flex-direction: column; }
    .rx-left { flex: 1 1 auto; width: 100%; }
    .rx-info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 药方识别（批量） ===== */

/* API 密钥文件查看弹窗 */
.kv-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.kv-table td { border: 1px solid var(--gray-200, #e5e7eb); padding: 8px 10px; vertical-align: middle; }
.kv-key { width: 150px; font-weight: 600; background: var(--green-50, #f0fdf4); color: var(--gray-700, #374151); white-space: nowrap; }
.kv-val-cell { word-break: break-all; }
.kv-val { color: var(--gray-700, #374151); }
.kv-input { width: 100%; border: 1px solid var(--gray-300, #d1d5db); border-radius: 6px; padding: 6px 8px; font-family: monospace; font-size: 12px; }
.kv-copy { margin-left: 6px; padding: 3px 10px; font-size: 12px; border: none; border-radius: 6px; background: var(--blue-600, #2563eb); color: #fff; cursor: pointer; }
.kv-copy:hover { background: var(--blue-700, #1d4ed8); }
.kv-act { width: 64px; text-align: center; }
.rx-modal-close { float: right; font-size: 22px; line-height: 1; cursor: pointer; color: var(--gray-400, #9ca3af); margin-left: 12px; font-weight: 400; }
.rx-modal-close:hover { color: var(--gray-700, #374151); }
.rx-hint-sm { font-size: 11px; color: var(--orange-700, #c2410c); background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; padding: 5px 8px; margin: 6px 0; line-height: 1.5; }

/* --- 识别结果页 · 色彩衬托 --- */
#tab-rx {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 55%, #faf5ff 100%);
    border-radius: 14px;
    padding: 16px 18px;
    min-height: 62vh;
}
.rx-banner {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(90deg, #ecfdf5, #eef2ff);
    border: 1px solid #d1fae5;
    border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
}
.rx-banner .rx-banner-ico { font-size: 22px; }
.rx-banner .rx-banner-txt { font-size: 13px; color: #1f5b3f; line-height: 1.4; }
.rx-banner .rx-banner-txt b { color: #0f766e; }

.rx-card {
    border: 1px solid var(--gray-300);
    border-left: 5px solid var(--green-500);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16, 100, 60, 0.07);
    transition: box-shadow .15s, transform .15s;
}
.rx-card:hover { box-shadow: 0 5px 16px rgba(16, 100, 60, 0.13); }
.rx-card.st-done { border-left-color: #2e7d32; }
.rx-card.st-error { border-left-color: #ef6c00; }
.rx-card.st-imported { border-left-color: #1565c0; }
.rx-card.st-loading { border-left-color: #7c3aed; }

.rx-card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 70%);
    border-bottom: 1px solid var(--gray-200);
}
.rx-card.st-imported .rx-card-head { background: linear-gradient(90deg, #e8f1fe 0%, #ffffff 70%); }
.rx-card.st-error .rx-card-head { background: linear-gradient(90deg, #fff4ea 0%, #ffffff 70%); }
.rx-card.st-loading .rx-card-head { background: linear-gradient(90deg, #f4ecfe 0%, #ffffff 70%); }

.rx-card-status { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 12px; margin-top: 3px; }
.rx-card-status.st-pending { background: #eceff1; color: #607d8b; border: 1px solid #cfd8dc; }
.rx-card-status.st-done { background: #e6f4ea; color: #1b7a34; border: 1px solid #b7e1c2; }
.rx-card-status.st-error { background: #fff1e6; color: #c2410c; border: 1px solid #fed7aa; }
.rx-card-status.st-imported { background: #e7f0fd; color: #1565c0; border: 1px solid #bcd6f5; }
.rx-card-status.st-loading { background: #f3e8ff; color: #7c3aed; border: 1px solid #e3d3fb; animation: rxPulse 1.1s ease-in-out infinite; }
@keyframes rxPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.rx-batch-bar {
    background: linear-gradient(90deg, #ffffff, #f4fbf6);
}
.rx-upload-zone {
    border: 2px dashed var(--green-400, #66bb6a);
    border-radius: 10px;
    background: #f4fbf5;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    margin-bottom: 12px;
}
.rx-upload-zone:hover, .rx-upload-zone.drag { background: #e8f6ea; border-color: var(--green-600, #43a047); }
.rx-upload-icon { font-size: 30px; margin-bottom: 6px; }
.rx-upload-main { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.rx-upload-sub { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.rx-batch-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.btn-gray {
    background: var(--gray-400, #bdbdbd); color: #fff; border: none; border-radius: 6px;
    padding: 8px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn-gray:hover { background: var(--gray-500, #9e9e9e); }
.btn.sm, .btn-blue.sm, .btn-green.sm, .btn-gray.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.rx-list { display: flex; flex-direction: column; gap: 14px; }
.rx-empty { color: var(--gray-500); text-align: center; padding: 30px; font-size: 14px; }
.rx-card { border: 1px solid var(--gray-300); border-radius: 10px; background: #fff; overflow: hidden; }
.rx-card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; background: #f7faf7; border-bottom: 1px solid var(--gray-200);
}
.rx-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--gray-300); cursor: pointer; flex: 0 0 auto; }
.rx-card-meta { flex: 1; min-width: 0; }
.rx-card-title { font-weight: 600; font-size: 13px; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-card-status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; margin-top: 3px; }
.rx-card-status.st-pending { background: #eeeeee; color: #666; }
.rx-card-status.st-done { background: #e8f5e9; color: #2e7d32; }
.rx-card-status.st-error { background: #fff3e0; color: #ef6c00; }
.rx-card-status.st-imported { background: #e3f2fd; color: #1565c0; }
.rx-card-msg { font-size: 11px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-card-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.rx-card-body { padding: 12px; }
.rx-card-body .rx-raw { width: 100%; min-height: 70px; border: 1px solid var(--gray-300); border-radius: 6px; padding: 6px 8px; font-size: 12px; font-family: monospace; box-sizing: border-box; resize: vertical; }
.rx-card-body .rx-raw:focus { border-color: var(--green-500); outline: none; }
.rx-card-body .rx-info-grid { grid-template-columns: repeat(5, 1fr); margin: 8px 0; }
.rx-card-body .rx-info-grid label { font-size: 11px; }
.rx-card-body .rx-info-grid .rx-input { font-size: 12px; padding: 4px 6px; }
.rx-card-body .rx-fields { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gray-300); }
.rx-card-body .rx-herbs-wrap { max-height: 240px; overflow-y: auto; }
.btn-green.sm, .btn-blue.sm { font-size: 12px; }

@media (max-width: 900px) {
    .rx-card-body .rx-info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 多模态大模型配置弹窗 ===== */
.rx-modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.45); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.rx-modal { background: #fff; border-radius: 10px; width: 560px; max-width: 92vw; max-height: 92vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.25); font-size: 14px; }
.rx-modal-title { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 600; color: #0f172a; }
.rx-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.rx-modal-body label { display: flex; flex-direction: column; gap: 4px; color: #475569; font-size: 13px; }
.rx-modal-body select, .rx-modal-body input[type=text], .rx-modal-body input[type=password] { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; color: #0f172a; }
.rx-modal-body input[type=password] { font-family: ui-monospace, monospace; }
.rx-modal-tip { color: #64748b; font-size: 12px; line-height: 1.6; background: #f1f5f9; padding: 8px 10px; border-radius: 6px; }
.rx-modal-tip code { background: #fff; padding: 2px 4px; border-radius: 3px; }
.rx-modal-actions { padding: 12px 18px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px; justify-content: flex-end; }

/* ===== 回到顶部浮动箭头（每个页面通用） ===== */
.to-top-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--green-500);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.to-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top-btn:hover { background: var(--green-700); }

/* ===== 操作准则（挂在账号管理后面，上提贴顶） ===== */
.guidelines-wrap {
    margin-top: 4px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 14px;
}
.guidelines-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2933;
    margin-bottom: 6px;
}
.guidelines-lead {
    margin: 0 0 18px;
    color: #5b6573;
    font-size: 14px;
    line-height: 1.7;
}
.guidelines-lead b { color: #1f8a4c; }
.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.gl-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: #f7faf8;
    border: 1px solid #e3efe8;
    border-radius: 10px;
}
.gl-step {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1f8a4c;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gl-body { flex: 1; }
.gl-h { font-weight: 700; color: #23303a; margin-bottom: 4px; }
.gl-p { font-size: 13px; color: #5b6573; line-height: 1.6; }
.gl-p b { color: #1f8a4c; }

.gl-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.gl-rule {
    font-size: 13.5px;
    line-height: 1.6;
    padding: 9px 12px;
    border-radius: 8px;
}
.gl-rule.red { background: #fdecec; border: 1px solid #f5c2c2; color: #a4282c; }
.gl-rule.red b { color: #a4282c; }
.gl-rule.yellow { background: #fff8e6; border: 1px solid #f3e0a8; color: #8a6d1f; }

.gl-pits { background: #f3f6fb; border: 1px solid #dde6f2; border-radius: 10px; padding: 14px 16px; }
.gl-pits-h { font-weight: 700; color: #23303a; margin-bottom: 8px; }
.gl-pits ul { margin: 0; padding-left: 20px; }
.gl-pits li { font-size: 13px; color: #5b6573; line-height: 1.8; }
.gl-pits li b { color: #1f8a4c; }

@media (max-width: 720px) {
    .guidelines-grid { grid-template-columns: 1fr; }
}

/* ===== 理疗表格「日期」日历选择器 ===== */
.therapy-date-input {
    width: 150px;
    min-width: 150px;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1.28;
    text-align: center !important;
    background: #fff;
    color: #23303a;
    font-family: inherit;
}
.therapy-date-input:focus { outline: none; border-color: #1f8a4c; box-shadow: 0 0 0 2px rgba(31,138,76,.15); }
.therapy-date-input:disabled,
.therapy-date-input.cell-locked { background: #f3f4f6; color: #9aa3ad; cursor: not-allowed; }

/* ===== 药方识别记录查看弹窗 ===== */
.rx-records-modal { width: 760px; max-width: 94vw; }
.rx-records-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rx-records-toolbar .edit-lock { margin-left: auto; }
.rx-records-search {
    flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #cbd5e1;
    border-radius: 8px; font: inherit; font-size: 13px; color: #0f172a;
}
.rx-records-search:focus { outline: none; border-color: #1f8a4c; box-shadow: 0 0 0 2px rgba(31,138,76,.15); }
.rx-records-list { display: flex; flex-direction: column; gap: 12px; max-height: 64vh; overflow: auto; padding-right: 4px; }
.rx-records-loading, .rx-records-empty { color: #64748b; font-size: 13px; text-align: center; padding: 24px 0; }
.rxr-card {
    border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; background: #fafbfc;
}
.rxr-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15,23,42,.06); }
.rxr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rxr-name { font-size: 16px; font-weight: 700; color: #0f172a; }
.rxr-meta { font-size: 12px; color: #64748b; }
.rxr-info { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; color: #475569; }
.rxr-diag { margin-top: 8px; font-size: 13px; color: #334155; background: #eef6f0; border-radius: 6px; padding: 6px 10px; }
.rxr-herbs { margin-top: 10px; }
.rxr-herbs-title { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.rxr-herbs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rxr-chip {
    background: #fff; border: 1px solid #d8e3dd; border-radius: 14px; padding: 3px 10px;
    font-size: 12.5px; color: #1f3d2e;
}
.rxr-chip b { color: #1f8a4c; }
.rxr-chip-empty { color: #9aa3ad; border-style: dashed; }
.rxr-usage { margin-top: 10px; font-size: 12.5px; color: #475569; }
.rxr-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.rxr-thumb {
    width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb;
    cursor: pointer; background: #fff;
}
.rxr-thumb:hover { border-color: #1f8a4c; box-shadow: 0 0 0 2px rgba(31,138,76,.18); }
.rxr-time { font-size: 11.5px; color: #94a3b8; }

/* ---- 药方记录可编辑控件 ---- */
.rxr-name-edit { font-size: 16px; font-weight: 700; color: #0f172a; border: 1px solid #d8dee6; border-radius: 6px; padding: 3px 8px; min-width: 140px; background: #fff; }
.rxr-saved { font-size: 12px; color: #1f8a4c; font-weight: 600; }
.rxr-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; margin-top: 8px; }
.rxr-field { display: flex; flex-direction: column; gap: 3px; }
.rxr-field > span { font-size: 11px; color: #64748b; }
.rxr-field-full { margin-top: 8px; }
.rxr-input { border: 1px solid #d8dee6; border-radius: 6px; padding: 5px 8px; font-size: 13px; font-family: inherit; color: #1f2937; background: #fff; width: 100%; box-sizing: border-box; }
.rxr-input:focus { outline: none; border-color: #1f8a4c; box-shadow: 0 0 0 2px rgba(31,138,76,.15); }
.rxr-herbs-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 8px; }
.rxr-herb-row { display: flex; gap: 4px; align-items: center; }
.rxr-herb-name { flex: 1 1 auto; min-width: 0; }
.rxr-herb-gram { flex: 0 0 60px; }
@media (max-width: 900px) { .rxr-herbs-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .rxr-herbs-list { grid-template-columns: 1fr; } }
.rxr-herb-del { flex: 0 0 auto; border: none; background: #fde8e8; color: #c0392b; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; }
.rxr-herb-del:hover { background: #f9c9c9; }
.rxr-herb-add { margin-left: 8px; border: 1px dashed #1f8a4c; background: #fff; color: #1f8a4c; border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer; }
.rxr-herb-add:hover { background: #eef6f0; }
.rxr-herb-count { color: #1f8a4c; font-weight: 700; }
.rxr-no-herb { font-size: 12px; color: #9aa3ad; padding: 6px 0; }
.rxr-usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 10px; }
.rxr-save-btn { margin-left: auto; border: 1px solid #cbd5e1; background: #e2e8f0; color: #475569; border-radius: 6px; padding: 6px 14px; font-size: 13px; font-family: inherit; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.rxr-save-btn:hover { background: #cbd5e1; }
.rxr-save-btn.saved { background: #1f8a4c; border-color: #1f8a4c; color: #fff; cursor: default; }
.rxr-del-btn { border: 1px solid #f3c0c0; background: #fdeaea; color: #c0392b; border-radius: 6px; padding: 6px 14px; font-size: 13px; font-family: inherit; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.rxr-del-btn:hover { background: #f6c5c5; border-color: #e0a0a0; }
.rxr-date-input { width: 200px; min-width: 200px; max-width: 100%; }
.rxr-input:disabled, .rxr-herb-del:disabled, .rxr-herb-add:disabled { background: #f3f4f6; color: #9aa3ad; cursor: not-allowed; border-color: #e2e8f0; }
.rxr-input:disabled { color: #475569; }
.rxr-date-input:disabled { background: #f3f4f6; color: #9aa3ad; }
.rxr-express { margin-top: 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 10px; }
.rx-edit-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #475569; cursor: pointer; user-select: none; white-space: nowrap; padding: 4px 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.rx-edit-toggle input { cursor: pointer; }
#rx-records-edit:checked + * { font-weight: 600; }
.rx-records-modal.rx-edit-on .rx-edit-toggle { border-color: #1f8a4c; background: #eef6f0; color: #1f8a4c; }
@media (max-width: 600px) {
    .rxr-info-grid { grid-template-columns: repeat(2, 1fr); }
    .rxr-usage-grid { grid-template-columns: 1fr; }
}

/* —— 老风格补丁：移除绿色覆盖层后，基础层缺失的少量布局/文本 class ——
   仅做最小、朴素、与原始系统（白卡 + 功能色 + 柔和阴影）一致的布局，
   不引入任何新配色或特效。 */
.tags-container { display: block; }
.followup-container { display: block; }
.accounts-list { display: block; }
.edit-lock-label { font-size: 12px; color: var(--gray-700); margin-left: 6px; }
.login-field-code { display: flex; gap: 8px; align-items: center; }
.rx-upload-inner { text-align: center; padding: 32px 16px; }

/* ============ 药方识别卡片：快递收件信息分块（老风格，与记录页一致） ============ */
.rx-ship { margin-top: 10px; padding: 10px 12px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; }
.rx-ship-title { font-size: 12px; font-weight: 600; color: var(--green-700, #15803d); margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.rx-ship-grid { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.rx-ship-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--gray-500); gap: 2px; flex: 1; min-width: 150px; }
.rx-ship-grid label.full { flex-basis: 100%; }
.rx-ship-grid .rx-input { font-size: 12px; padding: 4px 6px; border: 1px solid var(--gray-300); border-radius: 6px; background: #fff; box-sizing: border-box; }
.rx-ship-grid .rx-input:focus { border-color: var(--green-500, #22c55e); outline: none; }

/* ===== 响应式适配：平板 / 手机（桌面样式完全不变，仅在窄屏生效） =====
   目标：所有页面统一成数据总表那种「紧凑规整 + 表格横向滚动不溢出」的观感，
   顶栏标签可横滑、工具栏换行、弹窗贴边、统计卡自适应。 */

/* —— 平板及更窄：顶栏改为可横滑的单行标签，避免换行挤压 —— */
@media (max-width: 1024px) {
    #app { padding: 0 12px; }
    .topbar {
        position: static;            /* 不再吸顶，避免与下方 sticky 浮动栏重叠 */
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px 12px;
    }
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 2px;
        scrollbar-width: none;       /* Firefox 隐藏滚动条 */
    }
    .tabs::-webkit-scrollbar { height: 0; display: none; }
    .tab-btn { flex: 0 0 auto; }
    .status-bar { flex-wrap: wrap; gap: 8px; }
}

/* —— 手机：全面重排，统一紧凑规整 —— */
@media (max-width: 768px) {
    #app { padding: 0 10px; }
    .tab-btn { padding: 7px 12px; font-size: 13px; }
    .status-bar { font-size: 12px; }

    /* 工具栏：按钮换行、输入框占满整行 */
    .toolbar { gap: 6px; margin-bottom: 10px; }
    .toolbar input,
    .toolbar select,
    .toolbar .cell-select { flex: 1 1 100%; width: 100%; min-width: 0; }
    .toolbar button { flex: 1 1 auto; }

    /* 所有表格：窄屏改为卡片堆叠（字段名+值纵向排列），贴合手机浏览习惯，与标签指南一致 */
    #app table {
      min-width: 0 !important;
      width: 100%;
      border: 0;
      background: transparent;
    }
    #app table thead { display: none; }
    #app table tbody tr {
      display: block;
      margin-bottom: 14px;
      background: #fff;
      border: 1px solid #d7e8d7;
      border-radius: 12px;
      box-shadow: 0 1px 5px rgba(0,0,0,.06);
      overflow: hidden;
    }
    #app table tbody td {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      padding: 9px 12px !important;
      border-bottom: 1px solid #eee;
      text-align: right;
      background: #fff !important;
    }
    #app table tbody td:last-child { border-bottom: 0; }
    #app table tbody td::before {
      content: attr(data-label);
      font-weight: 600;
      color: #555;
      text-align: left;
      flex: none;
      max-width: 42%;
      word-break: break-all;
    }
    /* 数据总表首列(序号)在卡片视图下隐藏，避免冗余 */
    #data-table tbody td:first-child { display: none; }
    .table-wrapper { overflow: visible; }

    /* 进度条：统计信息在上、进度槽在下，占满整宽 */
    .followup-progress-bar,
    .tag-progress-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    /* 筛选按钮行：紧凑、可换行（保留桌面可点选体验） */
    .fu-filter-row { gap: 5px; }
    .fu-filter-btn { padding: 5px 10px; font-size: 12px; }

    /* 浮动栏内搜索框占满 */
    .fu-search-row { width: 100%; }
    .fu-search-row input { width: 100%; }

    /* 统计卡：两列，数字略缩 */
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-num { font-size: 24px; }
    .stat-card { padding: 12px; }

    /* 账号管理表单：输入框占满 */
    .accounts-wrap { padding: 12px; }
    .accounts-form input, .accounts-form select { flex: 1 1 100%; min-width: 0; }

    /* 药方批量栏：按钮换行占满 */
    .rx-batch-bar { display: flex; flex-wrap: wrap; gap: 6px; }
    .rx-batch-bar button { flex: 1 1 auto; }

    /* 操作准则 padding 收小 */
    .guidelines-wrap { padding: 0; }

    /* 页脚字体收小 */
    .app-footer { font-size: 11px; padding: 14px 4px; }
}

/* —— 弹窗在手机上贴边、可整屏滚动 —— */
@media (max-width: 768px) {
    .rx-modal-mask { padding: 8px; align-items: flex-start; }
    .rx-modal, .rx-records-modal { width: 100%; max-width: 100%; max-height: 94vh; }
    .rx-modal-title { font-size: 14px; }
    .login-overlay { padding: 12px; }
    .login-box { width: 100%; max-width: 360px; padding: 18px 16px; }
    .login-title { font-size: 18px; }
}

/* —— 小屏手机微调 —— */
@media (max-width: 480px) {
    .tab-btn { font-size: 12px; padding: 6px 9px; }
    .stat-num { font-size: 22px; }
    .fu-filter-label { display: none; }   /* 省空间，按钮文字已自解释 */
    .to-top-btn { width: 40px; height: 40px; right: 14px; bottom: 14px; font-size: 19px; }
}

/* ============ 健康档案表单（药方识别下一步） ============ */
.health-auth {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0 14px;
}
.health-auth-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #9a3412; line-height: 1.5; }
.health-auth-row input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; flex: 0 0 auto; }
.health-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--green-500);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.health-card-h {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 10px;
}
.health-req { font-size: 11px; color: var(--red-700); margin-left: 6px; border: 1px solid var(--red-700); border-radius: 4px; padding: 0 4px; }
.health-opt { font-size: 11px; color: #64748b; margin-left: 6px; }
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 12px;
}
.health-grid label { display: flex; flex-direction: column; font-size: 12px; color: #475569; gap: 4px; }
.health-grid .cell-input, .health-grid .cell-select { padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; color: #0f172a; }
.health-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.health-chip {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all .12s;
}
.health-chip:hover { border-color: var(--blue-700); }
.health-chip.on { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.health-submit-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* 健康档案新建/编辑表单：按钮放在滚动内容最底部，不悬浮遮挡 */
.health-form-footer {
    position: static;
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    padding: 12px 0 4px;
}
#health-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#health-table th, #health-table td { border: 1px solid #e2e8f0; padding: 7px 9px; text-align: left; }
#health-table th { background: #f1f5f9; color: #334155; }

/* 健康档案表头固定（滚动时不丢表头） */
#health-table thead th {
    background: var(--green-500);
    color: #fff;
    padding: 7px 8px;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.tcc-tagset-btn.done { background: var(--green-500); color: var(--white); border-color: var(--green-500); }

#health-table tr:nth-child(even) td { background: #f8fafc; }
.btn-blue.sm, .btn-red.sm, .btn-green.sm { padding: 3px 9px; font-size: 12px; margin-right: 4px; }

/* 健康档案查看/编辑/删除三按钮：查看(绿) + 编辑(蓝) + 删除(红)，同款圆润清晰、仅底色不同 */

/* ========== 健康档案 查看(只读) 弹窗 ========== */
.hv-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, .45);
    display: none;
    align-items: center; justify-content: center;
    padding: 16px;
    animation: hvFadeIn .15s ease-out;
}
@keyframes hvFadeIn { from { opacity: 0; } to { opacity: 1; } }
.hv-modal {
    background: #fff;
    border-radius: 14px;
    width: min(720px, 100%);
    max-height: 86vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
    animation: hvSlideUp .2s ease-out;
}
@keyframes hvSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.hv-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfeff 100%);
    border-bottom: 1px solid #d1d5db;
}
.hv-title { font-size: 15px; font-weight: 600; color: var(--green-700, #15803d); }
.hv-close {
    font-size: 24px; line-height: 1; cursor: pointer; color: var(--gray-500); font-weight: 300;
    width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .15s;
}
.hv-close:hover { background: rgba(0,0,0,.06); color: var(--gray-700); }
.hv-body { padding: 18px 22px; overflow-y: auto; flex: 1; font-size: 13px; color: var(--gray-700); }
.hv-footer { padding: 10px 20px; border-top: 1px solid #e5e7eb; text-align: right; background: #f9fafb; }

.hv-headline {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--green-50, #f0fdf4) 0%, #ecfeff 100%);
    border-radius: 10px;
    margin-bottom: 14px;
    border-left: 3px solid var(--green-500, #22c55e);
}
.hv-headline-name { font-size: 17px; font-weight: 700; color: var(--green-700, #15803d); }
.hv-headline-sub { font-size: 12px; color: var(--gray-500); }
.hv-headline-phone { margin-left: auto; font-size: 13px; color: var(--blue-700, #1565c0); font-weight: 600; }

.hv-section-h {
    font-size: 12px; font-weight: 600; color: var(--green-700, #15803d);
    margin: 14px 0 6px;
    padding-left: 8px;
    border-left: 3px solid var(--green-500, #22c55e);
}
.hv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 4px 14px;
    background: #fafafa;
    border-radius: 8px;
    padding: 8px 12px;
}
.hv-kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #eee; }
.hv-kv:last-child { border-bottom: 0; }
.hv-kv-key { color: var(--gray-500); font-size: 12px; white-space: nowrap; }
.hv-kv-val { color: var(--gray-900); font-size: 13px; font-weight: 500; text-align: right; word-break: break-all; max-width: 60%; }
.hv-empty { color: #cbd5e1; font-style: italic; font-weight: 400; }
.hv-note {
    background: #fffef7; border-left: 3px solid #fbbf24; border-radius: 6px;
    padding: 10px 12px; font-size: 13px; color: var(--gray-700); white-space: pre-wrap;
}
.hv-foot {
    margin-top: 14px; padding-top: 10px; border-top: 1px dashed #e5e7eb;
    font-size: 11px; color: var(--gray-500); text-align: right;
}

/* 窄屏适配：弹窗占满，标签-值纵向排列 */
@media (max-width: 768px) {
    .hv-overlay { padding: 0; }
    .hv-modal { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
    .hv-grid { grid-template-columns: 1fr; }
    .hv-kv { flex-direction: column; gap: 2px; }
    .hv-kv-val { text-align: left; max-width: 100%; }
    .hv-headline { flex-direction: column; align-items: flex-start; }
    .hv-headline-phone { margin-left: 0; }
}

/* 药方记录：已建立健康档案徽章 */
.rxr-health-badge{display:inline-flex;align-items:center;gap:4px;padding:5px 12px;border-radius:999px;background:linear-gradient(135deg,#e8f8ee,#d4f1df);color:#1a7f43;font-weight:600;font-size:13px;border:1px solid #b7e3c8;white-space:nowrap;}

/* 健康档案序号列 + 药方记录序号徽章 */
.health-idx{color:#94a3b8;font-variant-numeric:tabular-nums;font-size:12px;text-align:center;width:40px;white-space:nowrap}
.rxr-idx{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:22px;padding:0 6px;margin-right:8px;border-radius:6px;background:#eef2ff;color:#4338ca;font-weight:700;font-size:13px;font-variant-numeric:tabular-nums}

/* 会员服务页 */
.member-tiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.member-tier{border:1px solid #e5e5ea;border-radius:14px;padding:14px;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.04)}
.member-tier:nth-child(1){border-top:3px solid #2d7d46}
.member-tier:nth-child(2){border-top:3px solid #a97d28}
.member-tier:nth-child(3){border-top:3px solid #b43e2e}
.member-tier-name{font-weight:700;font-size:15px;margin-bottom:4px}
.member-price{font-size:22px;font-weight:800;color:#b43e2e;margin:2px 0 8px}
.member-price small{font-size:12px;font-weight:400;color:#6e6e73}
.member-ul{margin:0;padding-left:18px;font-size:13px;line-height:1.7;color:#333}
.member-script{border:1px solid #e5e5ea;border-radius:10px;padding:8px 12px;margin:6px 0;background:#fff;font-size:13.5px}
.member-script summary{cursor:pointer;font-weight:600;color:#2d7d46}
.member-script-body{padding:8px 4px 2px;color:#333;line-height:1.7}
.member-form{border:1px solid #e5e5ea;border-radius:14px;padding:14px;background:#fafafa}
.member-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.member-grid label{display:block;font-size:13px;color:#6e6e73}
.member-grid input{margin-top:4px}
#member-price-table th,#member-price-table td,#member-flow-table th,#member-flow-table td{padding:8px 6px;border-bottom:1px solid #e5e5ea;font-size:13px;text-align:left;vertical-align:top}
#member-price-table th,#member-flow-table th{color:#6e6e73;font-weight:600;font-size:12px}

/* ============ 打印价目单样式 ============ */
@media print {
    body * { visibility: hidden !important; }
    body.printing-member #tab-member,
    body.printing-member #tab-member * { visibility: visible !important; }
    body.printing-member #tab-member { position: absolute; left: 0; top: 0; width: 100%; padding: 0 !important; }
    body.printing-member #tab-member .toolbar,
    body.printing-member #tab-member #member-expiring-wrap,
    body.printing-member #tab-member #member-list,
    body.printing-member #tab-member .member-form,
    body.printing-member #tab-member h3 + .member-tiers + h3 { display: none !important; }
    body.printing-member #tab-member .member-tiers { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
    body.printing-member #tab-member .member-tier { page-break-inside: avoid; border: 1px solid #cbd5e1 !important; }
    body.printing-member #tab-member table { font-size: 11px; }
    body.printing-member #tab-member details { display: block !important; }
    body.printing-member #tab-member details > summary { list-style: none; }
    body.printing-member #tab-member details > summary::before { content: ''; }
    body.printing-member #tab-member details > div.member-script-body { display: block !important; }
    body.printing-member::before {
        content: '继中堂 · 健康会员价目单';
        display: block;
        font-size: 20px;
        font-weight: 700;
        text-align: center;
        padding: 12px 0;
        visibility: visible !important;
    }
}

/* ============ 客户全景弹窗样式 ============ */
.pano-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.pano-chip{display:inline-block;padding:5px 12px;border-radius:999px;font-size:13px;font-weight:600}
.pano-chip.ok{background:#e8f8ee;color:#1a7f43;border:1px solid #b7e3c8}
.pano-chip.no{background:#fde8e8;color:#b43e2e;border:1px solid #f5c2c2}
.pano-card{background:#fff;border-radius:10px;margin-bottom:10px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,0.04)}
.pano-card-h{padding:9px 14px;background:#f5f5f7;border-bottom:1px solid #e5e5ea;font-size:14px;color:#1a1a1a}
.pano-empty{color:#b43e2e;font-size:12px;font-weight:400}
.pano-tbl{width:100%;border-collapse:collapse;font-size:12.5px}
.pano-tbl th{background:#fafafa;color:#6e6e73;font-weight:600;padding:6px 8px;text-align:left;border-bottom:1px solid #e5e5ea;width:14%}
.pano-tbl td{padding:6px 8px;border-bottom:1px solid #e5e5ea}
.pano-tbl tr:last-child td,.pano-tbl tr:last-child th{border-bottom:none}

/* ============ 客户全景打印样式（仅导出 PDF 时触发） ============ */
@media print {
    body.printing-panorama * { visibility: hidden !important; }
    body.printing-panorama #panorama-overlay,
    body.printing-panorama #panorama-overlay * { visibility: visible !important; }
    body.printing-panorama #panorama-overlay {
        position: absolute; left: 0; top: 0; width: 100%;
        background: #fff !important;
    }
    body.printing-panorama #panorama-overlay .hv-header {
        background: linear-gradient(90deg, #b8860b, #d4a017) !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    body.printing-panorama #panorama-overlay .hv-close,
    body.printing-panorama #panorama-overlay > div:last-child { display: none !important; }
    body.printing-panorama #panorama-overlay .hv-body { padding: 14px !important; overflow: visible !important; max-height: none !important; }
    body.printing-panorama #panorama-overlay .pano-card { page-break-inside: avoid; box-shadow: none !important; }
    body.printing-panorama #panorama-overlay button { display: none !important; }
    body.printing-panorama #panorama-overlay input { display: none !important; }
    body.printing-panorama #panorama-overlay .tip { display: none !important; }
    body.printing-panorama #panorama-overlay #panorama-print-header {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 6px 12px;
        border-bottom: 1px solid #e5e5ea;
        background: #fff;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        visibility: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.printing-panorama #panorama-overlay .hv-body {
        padding-top: 50px !important;
    }
    @page { size: A4; margin: 12mm 10mm 16mm; }
}

/* ============ 会员运营增强 v8：看板 / 标签 ============ */
.stat-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-card { min-width: 92px; flex: 1; background: linear-gradient(180deg,#ffffff,#fafafa); border: 1px solid #e5e5ea; border-radius: 12px; padding: 10px 12px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.stat-val { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12px; color: #6e6e73; margin-top: 4px; }
.stat-chip { display: inline-block; background: #eef2ff; color: #1d4ed8; border: 1px solid #c7d2fe; border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0; }

/* ===== 账号经营看板（多层表格 + 动态图表） ===== */
.acct-dash { background:#fff; border:1px solid #e5e5ea; border-radius:14px; padding:14px 16px; margin:12px 0; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.acct-dash-title { font-size:16px; font-weight:800; color:#1d1d1f; margin-bottom:10px; }
.acct-toggle { display:flex; gap:8px; margin-bottom:12px; }
.acct-tab { cursor:pointer; border:1px solid #d2d2d7; background:#f5f5f7; color:#1d1d1f; border-radius:999px; padding:6px 16px; font-size:13px; font-weight:600; transition:all .15s; }
.acct-tab.active { background:#C62828; border-color:#C62828; color:#fff; }
.acct-table { width:100%; border-collapse:collapse; font-size:13px; }
.acct-table thead th { background:#f5f5f7; color:#6e6e73; font-weight:700; padding:8px 10px; text-align:center; border-bottom:2px solid #e5e5ea; }
.acct-table td { padding:8px 10px; text-align:center; border-bottom:1px solid #f0f0f2; }
.acct-table td.acct-name { text-align:left; font-weight:700; color:#1d1d1f; }
.acct-table .num { font-variant-numeric:tabular-nums; }
.acct-total { background:#fff4f4; }
.acct-total td { font-weight:700; color:#C62828; border-bottom:2px solid #f3c4c4; }
.acct-owner { cursor:pointer; transition:background .12s; }
.acct-owner:hover { background:#fbfbfd; }
.acct-strong { color:#C62828; font-weight:800; }
.acct-caret { color:#999; font-size:11px; }
.acct-print-btn { display:inline-block; margin-left:8px; padding:1px 6px; font-size:11px; font-weight:400; color:#b3b3b3; background:transparent; border:1px solid #e3e3e3; border-radius:6px; cursor:pointer; vertical-align:middle; transition:.15s; }
.acct-print-btn:hover { color:#8a8a8a; border-color:#cfcfcf; }
.acct-print-btn:active { transform:scale(.96); }
.acct-sub > td { background:#fafafa; padding:0; }
.acct-charts { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.acct-chart { background:#fff; border:1px solid #ececf0; border-radius:14px; padding:12px 14px; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.acct-chart-title { font-size:14px; font-weight:700; color:#1d1d1f; margin-bottom:6px; }
.acct-legend { display:flex; flex-wrap:wrap; gap:10px; margin-top:6px; font-size:12px; color:#333; }
.acct-legend-dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.acct-donut-legend { margin-top:6px; }
.acct-donut-leg { font-size:12px; color:#333; margin:2px 0; }
@media (max-width:760px){ .acct-charts { grid-template-columns:1fr; } }

/* ===== 分析报告：药方识别记录 / 健康档案 概览区块 ===== */
.ov-block { background:#fff; border:1px solid #e5e5ea; border-radius:14px; padding:14px 16px; margin:14px 0; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.ov-head { font-size:16px; font-weight:800; color:#1d1d1f; margin-bottom:12px; }
.ov-cards { display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.ov-card { flex:1; min-width:120px; background:linear-gradient(135deg,#eafaf2,#d9f2e7); border:1px solid #cfe9d8; border-radius:12px; padding:12px 14px; text-align:center; }
.ov-card-val { font-size:26px; font-weight:800; color:#1b5e20; font-variant-numeric:tabular-nums; }
.ov-card-label { font-size:12px; color:#6e6e73; margin-top:2px; }
.ov-body { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:12px; }
.ov-dist { background:#eef8f1; border:1px solid #d8ecdf; border-radius:10px; padding:10px 12px; }
.ov-dist-title { font-size:13px; font-weight:700; color:#1d1d1f; margin-bottom:6px; }
.ov-dist-row { display:flex; justify-content:space-between; font-size:12px; color:#444; padding:3px 0; border-bottom:1px dashed #f0f0f2; }
.ov-dist-row:last-child { border-bottom:none; }
.ov-dist-row b { color:#1b5e20; font-variant-numeric:tabular-nums; }
.ov-recent-title { font-size:13px; font-weight:700; color:#1d1d1f; margin:4px 0 8px; }
.ov-recent { width:100%; border-collapse:collapse; font-size:12px; }
.ov-recent thead th { background:#f5f5f7; color:#6e6e73; font-weight:700; padding:7px 9px; text-align:center; border-bottom:2px solid #e5e5ea; }
.ov-recent td { padding:6px 9px; text-align:center; border-bottom:1px solid #f0f0f2; color:#333; }
.ov-recent td.ov-name { text-align:left; font-weight:700; color:#1d1d1f; }
.ov-recent tr:hover td { background:#fbfbfd; }
@media (max-width:760px){ .ov-body { grid-template-columns:1fr; } }

/* ============ 分析报告页：绿色底色衬托 + 三大区块切换按钮 ============ */
#tab-analysis {
    background: linear-gradient(165deg, #e9f3ec 0%, #f3f9f5 55%, #ffffff 100%);
}
#tab-analysis .analysis-container { gap: 20px; }

.analysis-tabs { display: flex; gap: 10px; margin: 4px 0 18px; flex-wrap: wrap; }
.analysis-tab {
    cursor: pointer;
    border: 1px solid #bfe0c6;
    background: #fff;
    color: #1b5e20;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.analysis-tab:hover { background: #eef6f0; }
.analysis-tab.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
    box-shadow: 0 2px 8px rgba(46,125,50,.25);
}
.analysis-block { /* 移除打开分析页时的淡入动画，修复每次打开闪一下 */ }
@keyframes analysisFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ 作战资料库（分析报告页 · 并列资料入口） ============ */
.sop-lib {
    margin: -6px 0 18px;
    padding: 12px 14px;
    background: #f3faf4;
    border: 1px dashed #9fceb0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.sop-lib-h { font-size: 13px; font-weight: 700; color: #1b5e20; margin-right: 2px; white-space: nowrap; }
.sop-lib-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sop-lib-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 13px; border: 1px solid #bfe0c6; background: #fff;
    border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #1b5e20;
    text-decoration: none; cursor: pointer; transition: all .15s; line-height: 1.3;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.sop-lib-btn:hover { background: #eef6f0; border-color: #7fc08a; transform: translateY(-1px); }
.sop-lib-btn .sop-lib-ic { font-size: 13px; }
.sop-lib-btn.sop-lib-upload { border-style: dashed; border-color: #1d4ed8; color: #1d4ed8; }
.sop-lib-btn.sop-lib-upload:hover { background: #eef3ff; border-color: #1d4ed8; }


/* 账号管理页：文档三按钮 + 内嵌面板 */
.doc-tabs { display: flex; gap: 10px; margin: 10px 0 12px; flex-wrap: wrap; }
.doc-tab { cursor: pointer; border: 1px solid #bfe0c6; background: #fff; color: #1b5e20; border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 600; transition: all .15s; }
.doc-tab:hover { background: #eef6f0; }
.doc-tab.active { background: #2e7d32; border-color: #2e7d32; color: #fff; box-shadow: 0 2px 8px rgba(46,125,50,.25); }
.doc-panel { animation: analysisFade .18s ease; }
.doc-iframe { width: 100%; height: 82vh; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.06); }

/* ===== 电子会员体验卡 · 海报预览（与打印样式一致） ===== */
.mc-poster{width:320px;margin:0 auto;background:linear-gradient(160deg,#eafaf2,#ffffff);border:2px solid #2e7d32;border-radius:16px;padding:22px;text-align:center;box-sizing:border-box}
.mc-poster-h{font-size:13px;color:#2e7d32;letter-spacing:1px}
.mc-poster-t{font-size:20px;font-weight:700;color:#1b5e20;margin:6px 0}
.mc-poster-name{font-size:22px;font-weight:700;margin-top:10px;color:#1b5e20}
.mc-poster-phone{color:#475569;margin:4px 0;font-size:14px}
.mc-poster-code{margin:12px 0;font-size:14px;color:#334155}
.mc-poster-code b{font-size:24px;color:#b43e2e;letter-spacing:3px;margin-left:4px}
.mc-poster-qr{width:184px;height:184px;margin:8px auto;display:block}
.mc-poster-id{font-size:12px;color:#94a3b8;margin-top:6px}
.mc-poster-tip{font-size:12px;color:#64748b;margin-top:8px}

/* ===== 高价值客户表：对齐「数据总表」视觉（深绿 sticky 表头 + 按档位淡底色 + 悬停高亮） ===== */
#value-table {
    width: 100%;             /* 占满页面宽度，与数据总表一致（之前缺这句所以只有半宽） */
    min-width: 0;            /* 允许列宽按内容自适应压缩，尽量挤进一屏不横向溢出 */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    line-height: 1.35;
}
#value-table thead th {
    background: var(--green-500);
    color: #fff;
    padding: 7px 8px;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--green-700);
}
#value-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-300);
    vertical-align: middle;
}
/* 按档位着淡底色（与数据总表「按状态着色」同风格） */
#value-table tbody tr.tier-high   { background: #FFEBEE; }  /* 高端：淡红 */
#value-table tbody tr.tier-mid    { background: #FFF3E0; }  /* 中端：淡橙 */
#value-table tbody tr.tier-normal { background: #F5F5F5; }  /* 普通：淡灰 */
/* 悬停整行高亮（覆盖档位底色） */
#value-table tbody tr:hover { background: var(--green-300) !important; }


/* ============ 作战文档 · 分组并列按钮（分析页tab行 / 会员服务工具条） ============ */
/* 分析报告页：紧跟健康档案概览 tab，做成与 .analysis-tab 同款绿描边胶囊 */
.analysis-sop-btns {
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.analysis-sop-doc {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer;
    border: 1px solid #bfe0c6; background: #fff; color: #1b5e20;
    border-radius: 999px; padding: 6px 16px; font-size: 12.5px; font-weight: 600;
    text-decoration: none; line-height: 1.4; transition: all .15s;
    white-space: nowrap;
}
.analysis-sop-doc:hover { background: #eef6f0; border-color: #7fc08a; }
.analysis-sop-upload {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer;
    border: 1px dashed #2e7d32; background: #fff; color: #2e7d32;
    border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600;
    line-height: 1.4; transition: all .15s; white-space: nowrap;
}
.analysis-sop-upload:hover { background: #eef6f0; border-color: #2e7d32; }
.analysis-sop-load { vertical-align: middle; }

/* 会员服务页：与工具条其它按钮一致的 btn-green 绿色长方形 */
.member-sop-btns { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: 6px; vertical-align: middle; }
.member-sop-btns .sop-btn-green {
    text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.member-sop-btns .sop-btn-green:hover { opacity: .85; }


/* ============ 云端备份文件清单面板（替代服务器本地打开文件夹） ============ */
.bk-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    display: flex; align-items: center; justify-content: center; z-index: 12000;
}
.bk-box {
    background: #fff; border-radius: 12px; width: 620px; max-width: 94vw;
    max-height: 88vh; display: flex; flex-direction: column;
    box-shadow: 0 18px 60px rgba(0,0,0,.3); overflow: hidden;
}
.bk-head {
    padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 700;
    color: #0f172a; font-size: 15px; display: flex; align-items: center; justify-content: space-between;
}
.bk-close { cursor: pointer; font-size: 22px; color: #9ca3af; line-height: 1; font-weight: 400; background:none;border:none; }
.bk-close:hover { color: #374151; }
.bk-body { padding: 12px 18px; overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 180px; }
.bk-sub { color: #64748b; font-size: 12px; margin-bottom: 4px; }
.bk-empty { color: #94a3b8; font-size: 13px; text-align: center; padding: 24px 0; }
.bk-del { display: inline-block; padding: 5px 12px; font-size: 12px; font-weight: 600; background: #dc2626; color: #fff; border: none; border-radius: 6px; cursor: pointer; margin-left: 6px; }
.bk-del:hover { background: #b91c1c; }

.bk-row {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    border: 1px solid #eef0f3; border-radius: 8px; background: #fbfcfd;
}
.bk-row:hover { background: #f3f6f8; }
.bk-kind {
    flex: none; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
}
.bk-kind.data { background: #dcfce7; color: #15803d; }
.bk-kind.code { background: #dbeafe; color: #1d4ed8; }
.bk-info { flex: 1; min-width: 0; }
.bk-name { font-weight: 600; font-size: 13px; color: #0f172a; word-break: break-all; }
.bk-meta { font-size: 11px; color: #64748b; margin-top: 1px; }
.bk-dl {
    flex: none; padding: 5px 12px; font-size: 12px; font-weight: 600;
    background: #2e7d32; color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.bk-dl:hover { opacity: .88; }


/* ============ 作战文档 · 页面内 iframe 面板（不跳新窗） ============ */
.sopv-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.55);
    display: flex; align-items: center; justify-content: center; z-index: 13000;
    padding: 2vh 2vw;
}
.sopv-box {
    background: #fff; border-radius: 12px; width: min(1150px, 96vw);
    height: min(92vh, 95vh); display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden;
}
.sopv-head {
    padding: 10px 16px; border-bottom: 1px solid #e5e7eb; font-weight: 700;
    color: #0f172a; font-size: 14px; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; flex: none;
}
.sopv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sopv-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.sopv-ext { font-size: 12px; color: #1d4ed8; text-decoration: none; font-weight: 600; }
.sopv-ext:hover { text-decoration: underline; }
.sopv-close { cursor: pointer; font-size: 24px; color: #9ca3af; line-height: 1;
    font-weight: 400; background: none; border: none; padding: 0 4px; }
.sopv-close:hover { color: #b43e2e; }
.sopv-frame { flex: 1; width: 100%; border: none; background: #f5f5f7; }


/* ============ 作战文档 · 当前页内容区内嵌切换显示（不浮动遮罩） ============ */
.sopdoc-view {
    background: #fff; border: 1px solid #d8e3f5; border-radius: 10px;
    margin: 4px 0 18px; overflow: hidden; box-shadow: 0 2px 10px rgba(15,23,42,.06);
    animation: analysisFade .2s ease;
}
.sopdoc-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; background: #f4f8ff; border-bottom: 1px solid #e3ebf7;
}
.sopdoc-title { font-weight: 700; font-size: 14px; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sopdoc-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.sopdoc-body { height: calc(100vh - 200px); min-height: 420px; background: #fff; }
.sopdoc-body .sopv-frame { width: 100%; height: 100%; border: none; background: #fff; }

/* ============ 停止系统 · 全屏纯黑锁定遮罩 ============ */
#stop-black {
    position: fixed; inset: 0; z-index: 2147483000; background: #000;
    display: flex; align-items: center; justify-content: center;
}

/* ============ 药方识别(识别视图)药材网格：一行4味，缩短页面高度 ============ */
.rx-herbs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 8px; margin-bottom: 8px; }
.rx-herb-cell { display: flex; gap: 4px; align-items: center; min-width: 0; }
.rx-herb-cell .rx-herb-name { flex: 1 1 auto; min-width: 0; }
.rx-herb-cell .rx-herb-gram { flex: 0 0 58px; }
.rx-herb-cell .rx-herb-del { flex: 0 0 auto; border: none; background: #fde8e8; color: #c0392b; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; }
.rx-herb-cell .rx-herb-del:hover { background: #f9c9c9; }
.rx-no-herb { grid-column: 1 / -1; color: #94a3b8; font-size: 12px; padding: 4px 2px; }
@media (max-width: 900px) { .rx-herbs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .rx-herbs-grid { grid-template-columns: 1fr; } }

/* ============ 分析报告 / 会员服务：顶部吸顶（与数据总表·理疗·跟进清单同款布局） ============ */
/* 分析报告：标签页本身不滚(overflow:hidden)，只有 .analysis-container 内部滚；顶部冻结块(.analysis-freeze)整体吸顶 */
#tab-analysis.active { display:flex; flex-direction:column; overflow:hidden; height:100%; }
.analysis-container { flex:1 1 auto; min-height:0; overflow:auto; }
.analysis-container > * { flex-shrink: 0; }
.analysis-tabs { background:#fff; padding-bottom:6px; }
/* 会员服务：顶部两个工具条包成吸顶块(.member-sticky-head)，其余内容在 .member-scroll 内部滚 */
#tab-member.active { display:flex; flex-direction:column; overflow:hidden; height:100%; }
.member-sticky-head { flex:0 0 auto; position:sticky; top:0; z-index:8; background:#fff; }
.member-scroll { flex:1 1 auto; min-height:0; overflow:auto; }

/* ============ 分析报告页：单块冻结顶栏（三表对账+切换标签+看板标题+表头 整体固定） ============ */
.analysis-freeze {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    padding-bottom: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.acct-dash-title { font-size:16px; font-weight:800; color:#1d1d1f; margin:6px 0 4px; }
/* 表头表与表体共用列宽，保证对齐 */
.acct-table-head, .acct-table-body { table-layout: fixed; width:100%; border-collapse:collapse; font-size:13px; }
.acct-table-head th, .acct-table-body td { padding:9px 10px; text-align:left; border-bottom:1px solid #ececec; }
.acct-table-head th { background:#f5f5f7; font-weight:700; color:#1d1d1f; }
.acct-table-head th:nth-child(1), .acct-table-body td:nth-child(1) { width:20%; }
.acct-table-head th:nth-child(2), .acct-table-body td:nth-child(2) { width:9%; }
.acct-table-head th:nth-child(3), .acct-table-body td:nth-child(3) { width:14%; }
.acct-table-head th:nth-child(4), .acct-table-body td:nth-child(4) { width:12%; }
.acct-table-head th:nth-child(5), .acct-table-body td:nth-child(5) { width:12%; }
.acct-table-head th:nth-child(6), .acct-table-body td:nth-child(6) { width:14%; }
.acct-table-head th:nth-child(7), .acct-table-body td:nth-child(7) { width:10%; }
.acct-table-head th:nth-child(8), .acct-table-body td:nth-child(8) { width:9%; }
.acct-table-body .num { text-align:right; font-variant-numeric:tabular-nums; }
.acct-table-body tr.acct-owner { cursor:pointer; }
.acct-table-body tr.acct-owner:hover { background:#fafafa; }
.acct-strong { font-weight:800; color:#C62828; }
/* 合计行：独立表，作为滚动容器直接子元素，sticky bottom:0 钉在视口底部；内容短时自然停在表尾不悬空 */
.acct-table-total {
    position: sticky;
    bottom: 0;
    z-index: 26;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff4f4;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.06);
}
.acct-table-total td { padding:9px 10px; text-align:left; border-bottom:2px solid #f3c4c4; font-weight:700; color:#C62828; }
.acct-table-total td:nth-child(1) { width:20%; }
.acct-table-total td:nth-child(2) { width:9%; }
.acct-table-total td:nth-child(3) { width:14%; }
.acct-table-total td:nth-child(4) { width:12%; }
.acct-table-total td:nth-child(5) { width:12%; }
.acct-table-total td:nth-child(6) { width:14%; }
.acct-table-total td:nth-child(7) { width:10%; }
.acct-table-total td:nth-child(8) { width:9%; }
.acct-sub td { background:#fcfcfd; padding:4px 10px; }

/* ═══ 2026-10-08 需求5：药方识别记录里的「订单核对原始材料」区块（纯追加）═══ */
.rxr-m4{margin-top:12px;padding:10px 12px;border:1px solid #dbe6e0;border-radius:10px;background:#f7fbf9}
.rxr-m4-empty{color:#6b7280;font-size:12.5px;line-height:1.7}
.rxr-m4-hint{color:#94a3b8}
.rxr-m4-badge{margin-left:8px;font-size:11px;font-weight:600;color:#14703f;background:#e7f5ec;
  border-radius:999px;padding:2px 9px}
.rxr-m4-saved{margin-left:8px;font-size:11px;color:#94a3b8;font-weight:400}
.rxr-m4-h5line{margin:6px 0 8px;font-size:12px;color:#475569;background:#fff;border:1px solid #e6ebe8;
  border-radius:8px;padding:6px 10px}
.rxr-m4-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px}
.rxr-m4-inp{width:100%;box-sizing:border-box}
.rxr-m4-herb{display:grid;grid-template-columns:1.2fr .9fr .9fr 1.2fr;gap:6px;align-items:center}
.rxr-m4-herb input{width:100%;box-sizing:border-box}
@media (max-width:720px){
  .rxr-m4-herb{grid-template-columns:1fr 1fr}
  .rxr-m4-fields{grid-template-columns:1fr}
}

/* ═══ 2026-10-10：「只查 H5 订单（不传药方）」按钮 → 绿底白字（覆盖旧蓝描边）═══ */
.rx-only-h5-btn{background:var(--green-500) !important;color:#fff !important;border:none !important}
.rx-only-h5-btn:hover{background:var(--green-700) !important}

/* ═══ 2026-10-10：「只查 H5 订单（不传药方）」弹窗 ═══ */
.h5q-modal{width:760px;max-width:94vw}
.h5q-msg{padding:8px 12px;border-radius:8px;font-size:13px;line-height:1.5}
.h5q-msg.info{background:#eef2ff;color:#334155}
.h5q-msg.ok{background:#f0fdf4;color:#15803d}
.h5q-msg.bad{background:#fef2f2;color:#b91c1c}
.h5q-login{display:flex;flex-direction:column;gap:10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:12px}
.h5q-login-row{display:flex;gap:10px;align-items:center}
.h5q-input{flex:1;padding:8px 10px;border:1px solid #cbd5e1;border-radius:6px;font:inherit;color:#0f172a;box-sizing:border-box}
.h5q-cap-input{flex:0 0 140px}
.h5q-capimg{height:38px;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;background:#fff}
.h5q-toolbar{display:flex;gap:10px;align-items:center}
.h5q-search{flex:1;padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;font:inherit;color:#0f172a;box-sizing:border-box}
.h5q-filter{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 2px;margin-top:-4px}
.h5q-filter-label{font-size:12px;color:#64748b;white-space:nowrap}
.h5q-pill{font-size:12px;padding:5px 12px;border:1px solid #cbd5e1;border-radius:999px;background:#fff;color:#334155;cursor:pointer;transition:all .15s ease;white-space:nowrap}
.h5q-pill:hover{border-color:#22c55e;color:#16a34a;background:#f0fdf4}
.h5q-pill.active{border-color:#22c55e;background:#22c55e;color:#fff;font-weight:500}
.h5q-count{display:inline-block;min-width:16px;margin-left:6px;padding:0 6px;font-size:11px;line-height:16px;text-align:center;border-radius:999px;background:#e2e8f0;color:#475569;font-weight:600}
.h5q-pill.active .h5q-count{background:rgba(255,255,255,.28);color:#fff}
.h5q-cache{font-size:12px;color:#64748b;padding:2px 2px 4px;line-height:1.4}
.h5q-results{max-height:54vh;overflow:auto;display:flex;flex-direction:column;gap:10px;padding-right:4px}
.h5q-empty{padding:24px;text-align:center;color:#94a3b8;font-size:13px}
.h5q-card{border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,0.04)}
.h5q-card-h{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:14px;margin-bottom:8px}
.h5q-card-h b{color:#0f172a}
.h5q-meta{color:#64748b;font-size:12px}
.h5q-no{color:#0e7490;font-size:12px;font-family:ui-monospace,monospace}
.h5q-status{margin-left:auto;background:#eef2ff;color:#334155;font-size:12px;padding:2px 8px;border-radius:999px}
.h5q-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px}
.h5q-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.h5q-k{color:#64748b;font-size:12px}
.h5q-v{color:#0f172a;font-size:13px;font-weight:500;word-break:break-word;white-space:pre-wrap}
.h5q-v-dyn{min-height:18px}
.h5q-dyn-row{margin-top:8px;font-size:12px;color:#0f172a;background:#f0fdf4;border-radius:6px;padding:6px 8px;word-break:break-word}
.h5q-tip-row{margin-top:8px;font-size:12px;color:#64748b;background:#f8fafc;border-radius:6px;padding:6px 8px}
@media (max-width:560px){.h5q-grid,.h5q-grid-3{grid-template-columns:1fr}}
/* 2026-10-12：订单卡片可点击 → 打开客户订单详情 */
.h5q-card{cursor:pointer;transition:box-shadow .15s ease,border-color .15s ease}
.h5q-card:hover{border-color:#16a34a;box-shadow:0 4px 14px rgba(22,163,74,.12)}
.h5q-card:active{transform:scale(.997)}
.h5q-detail-modal{width:680px;max-width:94vw}
.h5q-d-h{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:15px;margin-bottom:12px}
.h5q-d-h b{color:#0f172a}
.h5q-d-sec-title{margin:16px 0 7px;font-size:13px;color:#475569;font-weight:600;border-top:1px dashed #e2e8f0;padding-top:12px}
.h5q-d-sec-title:first-of-type{border-top:none;padding-top:0}
.h5q-med-table{width:100%;border-collapse:collapse;font-size:13px}
.h5q-med-table th,.h5q-med-table td{border:1px solid #e2e8f0;padding:6px 10px;text-align:left}
.h5q-med-table th{background:#f8fafc;color:#475569;font-weight:600}
.h5q-med-table td{color:#0f172a;word-break:break-word}


/* ===== 2026-10-10 防呆A：剂数/剂型 被填成重量/体积(800g/500ml)时的标黄提示 =====
   与前端 isDosageUnitAbnormal()、后端 _is_weight_like_dosage() 同一套判定：
   这类值不会被当成服药天数，标黄提醒人工改成「7剂」这类剂数，避免客户被跟进清单遗忘。
   只做视觉提示，不改任何既有样式。 */
.cell-warn {
    background: #fff4e5 !important;
    border: 1px solid #ff9500 !important;
    border-radius: 6px;
    color: #b25000 !important;
    font-weight: 600;
}
.cell-warn:hover { background: #ffeacc !important; }
.cell-warn:focus { outline: 2px solid #ff9500; outline-offset: 1px; }


/* ===== 2026-10-10 #451：数据总表横向体验（列显隐面板 + 左右悬浮翻页钮）=====
   实测背景：23 列表格实际宽 1871px、可视区约 1408px，要横向滑 463px 才看得全，
   且滑到右边就认不出这行是谁。列显隐让不常用列去掉即可一屏放下（根治）。
   本段只做新增，不改动任何既有样式。 */
#tab-data { position: relative; }

.col-panel {
    position: absolute; top: 46px; right: 14px; z-index: 80; display: none;
    background: #fff; border: 1px solid #dfe6df; border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 10px 12px;
    min-width: 210px; max-width: 300px;
}
.col-panel.show { display: block; }
.col-panel-head { font-size: 13px; font-weight: 700; color: #2d7d46; margin-bottom: 6px; }
.col-panel-list { max-height: 52vh; overflow: auto; }
.col-panel-list label {
    display: flex; align-items: center; gap: 6px; font-size: 12px;
    padding: 3px 2px; cursor: pointer; color: #333;
}
.col-panel-list label:hover { background: #f2f8f4; border-radius: 4px; }
.col-panel-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.col-panel-actions button { padding: 4px 10px; font-size: 12px; }
.col-panel-tip { margin-top: 6px; font-size: 11px; color: #888; }

.table-xnav {
    position: absolute; top: 54%; transform: translateY(-50%); z-index: 40;
    width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(46,125,50,.92); color: #fff; font-size: 20px; line-height: 1;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.28);
    transition: opacity .15s, background .15s;
}
.table-xnav:hover { background: rgba(30,100,36,1); }
.table-xnav.left  { left: 8px; }
.table-xnav.right { right: 8px; }

/* ===== 2026-10-11 #452：底部统计行固定 + 底部常驻横向滑块条 =====
   ① 表尾统计行（已标记/已发/已发货）与表头一样 sticky 常驻：上下滑数据时它钉在底部不动，
      左右滑时跟着列走，数字始终对齐在对应列下方。
   ② 左右滑动控件从「表格中部悬浮箭头」移到表格下方常驻条（箭头+可拖动滑块），
      控件都在表格外面，点控件绝不会再误触数据格。
   ③ 本段只做新增，不改动任何既有样式。 */
#data-tfoot tr.stats-row td {
    position: sticky;
    bottom: 0;
    z-index: 8;
    box-shadow: 0 -2px 6px rgba(0,0,0,.10);
}
/* 表尾首列（序号列）本身是 sticky left，需要更高层级才不会被普通单元格盖住 */
#data-tfoot tr.stats-row td:first-child {
    z-index: 9;
    left: 0;
}

.data-footbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 2px 2px 0;
}
.fb-arrow {
    width: 28px; height: 26px; flex: 0 0 auto;
    border: 1px solid #cfd8cf; border-radius: 6px;
    background: #fff; color: #2d7d46; font-size: 17px; line-height: 1;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.fb-arrow:hover { background: #2d7d46; color: #fff; }
.fb-track {
    position: relative; flex: 1 1 auto; height: 12px;
    background: #eef2ee; border-radius: 8px; cursor: pointer; display: none;
}
.fb-thumb {
    position: absolute; top: -2px; left: 0; height: 16px;
    background: var(--green-500, #2e7d32); border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.28); cursor: grab;
}
.fb-thumb:hover { background: #1e6424; }
.fb-thumb:active { cursor: grabbing; }
.fb-info { flex: 0 0 auto; font-size: 11px; color: #888; white-space: nowrap; }

/* ===== 2026-10-11 #452b：统计行正式搬到底部常驻条 =====
   实测结论：tfoot 里的统计行即使加了 position:sticky;bottom:0 也钉不住 —— sticky 元素被限制在 tfoot 盒内，
   滚到中间时整行仍被推到可视区外（statsTop 975 > 容器底部 789）。
   故改为：tfoot 隐藏，三个统计改在表格下方的常驻条里显示（与左右滑块同一条），永远不动、永远可见。
   本段只做新增，不删除任何既有样式。 */
#data-tfoot { display: none; }
.fb-stats { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.fb-stat {
    display: inline-flex; align-items: center; gap: 4px;
    background: #F1F8E9; border: 1px solid #c5e1a5; border-radius: 6px;
    padding: 1px 8px; color: #2e7d32; font-weight: 700; font-size: 12px;
    white-space: nowrap;
}
.fb-stat-label { font-size: 12px; }
.fb-stat-num { font-size: 13px; }

/* ===== 2026-10-11 #453：统计回到表尾原位 + 底部只留一个「短·居中·隐形」小滑块 =====
   用户拍板：① 已标记/已发/已发货 是统计企微标签、跟进消息、发货情况三列的，必须待在
   表尾原来的位置（跟着对应列走），不能搬到别处；② 底部不要长条滑块、不要箭头、不要提示文字，
   只要一个很短的小滑块，居中，平时隐形，鼠标滑到底部才淡入。
   本段只做新增，不删任何既有样式（用后定义覆盖前定义）。 */
#data-tfoot { display: table-footer-group; }
#data-tfoot tr.stats-row td { position: static; box-shadow: none; }

.data-footbar {
    justify-content: center;      /* 小滑块居中 */
    height: 16px;
    margin-top: 2px;
    padding: 0;
}
.fb-track {
    width: 200px;                 /* 短滑块：不再横贯整行 */
    flex: 0 0 auto;
    height: 10px;
    opacity: 0;                   /* 默认隐形 */
    transition: opacity .18s ease;
}
.data-footbar.hot .fb-track { opacity: 1; }
.fb-thumb { top: -3px; height: 16px; }

/* ===== 2026-10-11 #454：统计行真钉住(tr级sticky) + 滑块缩到按钮级/严格悬停显隐 + 回顶箭头同款 =====
   实测纠正 #452 结论：sticky 加在 td 上钉不住（td 被行盒限制），但加在 tr.stats-row 本身就能钉住
   （实测滚到中间 statsTop 784 = 容器底 805 - 行高 21，数据从统计行下面滚过）。
   滑块：44px 按钮级短轨道，叠在统计行那一排居中；bar 本身 pointer-events:none 不挡任何点击，
   只有 44px 轨道可悬停/拖动；opacity 0 + :hover 严格悬停才显现，拖动中 .hot 保持显示。
   回到顶部箭头：缩到 28px，默认全透明，悬停才显现（.show 保留可点性，样式交给 hover）。
   本段只追加，不删改任何既有规则（后者覆盖前者）。 */
#data-tfoot tr.stats-row {
    position: sticky;
    bottom: 0;
    z-index: 8;
}
#data-tfoot tr.stats-row td:first-child {
    position: sticky;
    left: 0;
    z-index: 9;
}
.data-footbar {
    width: 96px;                    /* #456：容纳加长后的 88px 轨道（原 64px 会裁掉轨道） */
    height: 14px;
    margin: 0 auto;                 /* 水平居中 */
    transform: translateY(-16px);   /* 纯视觉上移，叠到统计行那一排；布局占位不变 */
    pointer-events: none;           /* 条上空白处不挡点击 */
    justify-content: center;
    position: relative;             /* #454 实测修复：统计行 z-index:8 压在滑块上导致 :hover 收不到 */
    z-index: 40;                    /* 底栏提到统计行之上，轨道才能悬停/拖动（bar 本身 pe:none 仍不挡点击） */
}
.fb-track {
    width: 88px;                    /* #456：加长到约 2 倍(44→88)，方便拖动 */
    height: 10px;
    pointer-events: auto;           /* 只有这 88px 小条可悬停/拖动 */
}
.fb-thumb { height: 14px; top: -2px; }
.fb-track:hover { opacity: 1; }
.to-top-btn {
    width: 28px; height: 28px; right: 14px; bottom: 14px; font-size: 14px;
    opacity: 0; visibility: visible; transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.to-top-btn.show { opacity: 0; visibility: visible; transform: none; }
.to-top-btn.show:hover, .to-top-btn:hover { opacity: 1; }

/* ===== 2026-10-11 #455：代码更新自动刷新提示条 + 渲染双缓冲配套 =====
   只做新增，不删改任何既有规则。 */
#jzt-update-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%) translateY(10px);
    background: var(--green-500, #2e7d32);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
#jzt-update-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 网站备案信息条（2026-10-13 新增） ============ */
.site-beian { margin-top: 6px; font-size: 12px; line-height: 1.6; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; }
.site-beian .beian-link { color: #6e6e73; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.site-beian .beian-link:hover { color: var(--green-700, #15803d); border-bottom-color: currentColor; }
.site-beian .beian-gongan { color: #6e6e73; background: #f4f6f5; border: 1px solid #e3e8e6; border-radius: 6px; padding: 1px 8px; }
@media (max-width: 480px) { .site-beian { font-size: 11px; gap: 8px; } }
/* ============ 页脚著作权+备案统一单排（2026-10-13 #475） ============ */
.app-footer { padding: 10px 0 12px; margin-top: 12px; }
.footer-inline { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; line-height: 1.4; }
.footer-inline .footer-copyright { white-space: nowrap; }
.footer-inline .footer-sep { color: #cfd4d1; }
.footer-inline .beian-link { color: #6e6e73; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.footer-inline .beian-link:hover { color: var(--green-700, #15803d); border-bottom-color: currentColor; }
.footer-inline .beian-gongan { color: #6e6e73; background: #f4f6f5; border: 1px solid #e3e8e6; border-radius: 6px; padding: 1px 8px; }
@media (max-width: 480px) { .footer-inline { gap: 6px; font-size: 11px; } }

/* 2026-10-14 移动端：隐藏无 thead 表格的首行表头（每张卡片已带字段名）；有 thead 的表由上方规则统一隐藏 */
@media (max-width: 768px) {
    #app table tr.jzt-head-row { display: none !important; }
}

/* 2026-10-14 手机端深度适配：顶部 tab 横滑 + 卡片内部对齐/不溢出 */
@media (max-width: 768px) {
  /* ① 顶部纵向堆叠：logo / 状态条 / tabs 各占整行；tabs 独占整行后内部横滑（iOS 惯性滚动，隐藏滚动条） */
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; flex-wrap: nowrap; }
  .topbar > .logo { flex: 0 0 auto; min-width: 0; width: 100%; }
  .topbar > .status-bar { flex: 0 0 auto; min-width: 0; width: 100%; }
  .tabs {
    flex: 1 1 auto; min-width: 0; max-width: 100%; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    padding: 4px 0;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > .tab-btn { flex: 0 0 auto; white-space: nowrap; }

  /* ② 整表转 block 并锁宽 100%：规避 table-layout:auto 按内容撑宽，且把 tbody 行组上下文一并转 block 防止内部撑爆 */
  #app table { display: block; width: 100%; max-width: 100%; box-sizing: border-box; }
  #app table thead { display: none; }
  #app table tbody,
  #app table tbody tr { display: block; width: 100%; max-width: 100%; box-sizing: border-box; }

  /* ③ 卡片内每行：label 固定列宽左对齐、值区紧跟，长文/控件可收缩不撑爆 */
  #app table tbody td {
    display: flex;
    width: 100%; max-width: 100%; box-sizing: border-box;
    min-width: 0;
    text-align: left;
    justify-content: flex-start;
    gap: 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  #app table tbody td::before {
    content: attr(data-label);
    flex: 0 0 92px;
    max-width: 92px;
    -webkit-box-flex: 0;
    color: #6b7280; font-weight: 600;
  }
  #app table tbody td input,
  #app table tbody td select,
  #app table tbody td textarea {
    width: 100%; max-width: 100%; min-width: 0;
    box-sizing: border-box; flex: 1 1 auto;
  }

  /* ④ 操作列按钮整齐排列（并排/换行，不溢出） */
  #app table tbody td:last-child {
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 8px;
  }
  #app table tbody td:last-child > a,
  #app table tbody td:last-child > button,
  #app table tbody td:last-child > input { flex: 0 0 auto; }

  /* ⑤ 表尾「统计行 / 分页行」：原本 23 列被压成每格 8px 且 sticky 悬浮压住卡片 → 改为正常流式工具条 */
  #app table tfoot tr {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 10px; row-gap: 10px;
    width: 100%; max-width: 100%; box-sizing: border-box;
    position: static;                 /* 取消 sticky，不再悬浮压住卡片内容 */
    padding: 10px 0;
  }
  #app table tfoot td {
    display: block; flex: 0 1 auto; min-width: 0; max-width: 100%;
    box-sizing: border-box; text-align: center; white-space: normal;
  }
  #app table tfoot td:empty { display: none; }   /* 纯占位空格（无文字无子元素）直接隐去，避免一堆 8px 碎片 */
  #app table tfoot td input,
  #app table tfoot td select,
  #app table tfoot td button,
  #app table tfoot td a { max-width: 100%; box-sizing: border-box; }

  /* ⑥ 手机端滚动容器修复：原规则把 .table-wrapper 改成 overflow:visible（本意交给外层滚），
     但这些页的 section 是 overflow:hidden 固定高（#tab-data.therapy.analysis.member）→ 两层都不滚，
     后段卡片被 section 裁掉、滚不到。恢复由 .table-wrapper 自身承载滚动（与桌面一致，也是 flex 结构本意）。 */
  #tab-data.active .table-wrapper,
  #tab-therapy.active .table-wrapper,
  #tab-analysis.active .table-wrapper,
  #tab-member.active .table-wrapper {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
  }
}

/* ===== 手机端 App 化（B 方案）2026-10-16 ===== */
@media (max-width:768px){
  body{ padding-bottom:16px !important; background:#f5f6f8 !important; }
  #tab-data, #tab-data .table-wrapper, #app .tab-content.active{ background:#f5f6f8!important; }
  #tab-data.active, #app #tab-data.active, .tab-content#tab-data.active{ overflow:auto!important; -webkit-overflow-scrolling:touch!important; }
  #tab-data .table-wrapper, #app #tab-data .table-wrapper{ max-height:none!important; height:auto!important; flex:0 0 auto!important; overflow:visible!important; }
  #tab-data .data-pager{ position:static!important; margin:0 12px 14px!important; }

  /* 顶栏：两行，tabs 横滑胶囊 + 毛玻璃 */
  .topbar{ position:sticky!important; top:0!important; z-index:80!important;
    display:flex!important; flex-direction:row!important; flex-wrap:wrap!important; align-items:center!important;
    background:rgba(255,255,255,.82)!important; backdrop-filter:saturate(180%) blur(22px)!important;
    -webkit-backdrop-filter:saturate(180%) blur(22px)!important;
    border-bottom:1px solid rgba(0,0,0,.07)!important; padding:10px 14px 6px!important; gap:0!important; }
  .logo{ order:1!important; flex:0 0 auto!important; font-size:16px!important; width:auto!important; }
  .status-bar{ order:2!important; flex:1 1 auto!important; justify-content:flex-end!important; gap:8px!important;
    font-size:12px!important; background:transparent!important; border:none!important; padding:0!important; width:auto!important; }
  #current-user{ font-size:12px!important; }
  #logout-btn{ padding:5px 12px!important; font-size:12px!important; border-radius:999px!important; }
  .tabs{ order:3!important; flex:1 1 100%!important; width:100%!important; display:flex!important; gap:6px!important;
    overflow-x:auto!important; padding:8px 0 8px!important; scrollbar-width:none!important; }
  .tabs::-webkit-scrollbar{ display:none; }
  .tab-btn{ flex:0 0 auto!important; padding:7px 14px!important; border-radius:999px!important;
    background:#f1f3f5!important; border:1px solid transparent!important; font-size:13px!important;
    color:#3c4043!important; white-space:nowrap!important; }
  .tab-btn.active{ background:linear-gradient(135deg,#4caf50,#2e7d32)!important; color:#fff!important;
    box-shadow:0 2px 10px rgba(46,125,50,.3)!important; }

  /* 工具栏：纯 CSS（不碰 DOM，避免与 ensureTableNavTools 冲突）。搜索框独占一行，按钮自动换行铺开 */
  #tab-data .toolbar{ display:flex!important; flex-wrap:wrap!important; gap:8px!important; align-items:center!important;
    padding:10px 12px 8px!important; background:transparent!important; border:none!important; box-shadow:none!important; }
  #tab-data .toolbar #search-input{ flex:1 1 100%!important; order:-1!important; width:100%!important; margin:0 0 4px!important;
    height:42px!important; border-radius:12px!important; background:#fff!important;
    border:1px solid rgba(0,0,0,.07)!important; padding:0 14px!important; font-size:14px!important; box-sizing:border-box!important; }
  #tab-data .toolbar > *:not(#search-input){ flex:0 0 auto!important; height:34px!important; border-radius:999px!important;
    font-size:12.5px!important; padding:0 14px!important; display:inline-flex!important;
    align-items:center!important; white-space:nowrap!important; }

  /* 数据页卡片：工整档案卡（限定 #tab-data table，不影响其他页） */
  #tab-data table, #tab-data table tbody{ background:transparent!important; }
  #tab-data table tbody tr, #tab-data table tbody tr.row-shipped, #tab-data table tbody tr.row-checked{
    display:flex!important; flex-direction:column!important; background:#fff!important;
    border-radius:16px!important; box-shadow:0 1px 2px rgba(16,24,40,.05),0 6px 16px rgba(16,24,40,.05)!important;
    border:1px solid rgba(0,0,0,.035)!important; margin:0 0 12px!important; padding:12px 0 6px!important; }
  #tab-data table tbody td{ border:none!important; background:#fff!important;
    padding:7px 16px!important; font-size:14px!important; box-sizing:border-box!important; }
  #tab-data table tbody td.m-empty{ display:none!important; }
  #tab-data table tbody td:not(.m-cardtitle){ display:flex!important; align-items:baseline!important; justify-content:flex-start!important; }
  #tab-data table tbody td:not(.m-cardtitle)::before{
    content:attr(data-label)!important; flex:0 0 6.5em!important; max-width:6.5em!important;
    text-align:left!important; padding-right:12px!important; color:#9aa0a6!important; font-size:12.5px!important;
    font-weight:500!important; line-height:1.5!important; }
  #tab-data table tbody td:not(.m-cardtitle) > *{ text-align:left!important; }
  #tab-data table tbody td, #tab-data table tbody td.cell-wrap{
    width:100%!important; max-width:100%!important; box-sizing:border-box!important; }
  #tab-data table tbody td input:not([type=checkbox]):not([type=radio]),
  #tab-data table tbody td select, #tab-data table tbody td select.cell-select{
    flex:1 1 auto!important; width:auto!important; max-width:100%!important; min-width:0!important;
    text-align:left!important; font-size:14px!important;
    color:#1f2328!important; -webkit-text-fill-color:#1f2328!important; opacity:1!important;
    background:transparent!important; border:none!important; box-shadow:none!important;
    appearance:none!important; -webkit-appearance:none!important; height:auto!important; padding:0!important; line-height:1.5!important; }
  #tab-data table tbody td select.cell-select{ display:block!important; }
  #tab-data table tbody td input[type=checkbox], #tab-data table tbody td input[type=radio]{
    appearance:auto!important; -webkit-appearance:auto!important; width:18px!important; height:18px!important;
    flex:0 0 auto!important; margin:0 0 0 2px!important; opacity:1!important; background:transparent!important; }
  #tab-data table tbody td.m-cardtitle{ order:-1!important; display:block!important; padding:0 16px 10px!important;
    border-bottom:1px solid rgba(0,0,0,.06)!important; margin-bottom:4px!important; }
  #tab-data table tbody td.m-cardtitle::before{ display:none!important; }
  #tab-data table tbody td.m-cardtitle, #tab-data table tbody td.m-cardtitle *{ font-size:17px!important; font-weight:700!important; color:#1f2328!important; }
  #tab-data table tbody td.m-cardtitle input{ width:100%!important; }

  /* 翻页/统计条：随卡片流，不悬浮 */
  #tab-data table tfoot{ display:block!important; position:static!important; background:transparent!important; }
  #tab-data table tfoot tr, #tab-data table tfoot tr.stats-row{
    display:flex!important; flex-wrap:wrap!important; justify-content:center!important; align-items:center!important;
    gap:8px!important; position:static!important; bottom:auto!important; background:#fff!important;
    border-radius:16px!important; margin:0 0 12px!important; padding:12px 10px!important;
    box-shadow:0 1px 2px rgba(16,24,40,.05)!important; border:1px solid rgba(0,0,0,.035)!important; }
  #tab-data table tfoot td{ display:block!important; border:none!important; padding:0!important; background:transparent!important; }
  #tab-data table tfoot td:empty{ display:none!important; }

  /* 底部导航（总表/复诊/药方/档案/我的）已按需求移除 2026-10-16；
     仅保留 display:none 兜底，防止旧缓存 app.js 注入后复现 */
  .m-tabbar{ display:none!important; }
  .m-fab{ position:fixed!important; right:16px!important; bottom:calc(95px + env(safe-area-inset-bottom))!important; z-index:130!important;
    width:44px!important; height:44px!important; border-radius:50%!important; border:none!important;
    background:linear-gradient(135deg,#4caf50,#2e7d32)!important; color:#fff!important; font-size:22px!important;
    line-height:1!important; box-shadow:0 4px 12px rgba(46,125,50,.32)!important; cursor:pointer!important; }
}

/* ===== 手机端分页条吸底 2026-10-16 ===== */
@media (max-width:768px){
  /* 数据总表分页条：固定吸底（贴在底部导航上方，含安全区适配） */
  #tab-data .data-pager{
    position:fixed!important; left:0!important; right:0!important;
    bottom:env(safe-area-inset-bottom)!important;
    z-index:110!important; margin:0!important;
    display:flex!important; align-items:center!important; justify-content:center!important;
    flex-wrap:wrap!important; gap:6px 10px!important;
    background:rgba(255,255,255,.94)!important;
    backdrop-filter:saturate(180%) blur(22px)!important; -webkit-backdrop-filter:saturate(180%) blur(22px)!important;
    border-top:1px solid rgba(0,0,0,.07)!important; padding:7px 12px!important;
    box-shadow:0 -2px 14px rgba(16,24,40,.08)!important; }
  /* 滚动内容留出底部空间，避免最后卡片被吸底条+底部导航盖住 */
  #tab-data.active, #app #tab-data.active, .tab-content#tab-data.active{
    padding-bottom:calc(96px + env(safe-area-inset-bottom))!important; }
  /* 手机端隐藏页脚备案行（底部已被导航+分页条占用，避免碍事） */
  .app-footer{ display:none!important; }
}

/* ===== 手机端去底栏+FAB缩小 2026-10-16 =====
   底栏已移除；FAB 44px；分页条贴屏幕最底；body 底部留白 16px。
   全部限 @media(max-width:768px)，桌面端零改动。 */

/* ===== 手机端多页对齐修复 2026-10-17 =====
   ① 数据总表：字段标签靠左（见上 B 方案块内 ::before 改 text-align:left）。
   ② 健康档案/高价值：app.js initMobileTableLabels 的 targets 增加 health-tbody/value-table，
      两张表注入 data-label 后走通用「标签 92px + 内容」卡，与数据总表观感一致。
   ③ 无 data-label 的单元格：空标签列曾固定占 92px 把内容推到中间（看着像居中），现隐藏。
   ④ 分析报告：全部账号合计改「名称一行 + 数据一排」。
   ⑤ 标签指南：吸顶头改 static。⑥ 药方页：上传区文字靠左。全部仅手机端。 */
@media (max-width:768px){
  /* 无标签单元格：隐藏空的 92px 标签列，内容顶格靠左 */
  #app table tbody td:not([data-label])::before{ display:none!important; flex:0 0 0!important; }
  /* 分析报告·全部账号合计：名称独占一行，7 项数据一字排开 */
  #tab-analysis #acct-total-bar{ display:block!important; width:100%!important; }
  #tab-analysis #acct-total-bar tbody{ display:block!important; width:100%!important; }
  #tab-analysis #acct-total-bar tr{ display:flex!important; flex-wrap:wrap!important; gap:3px 9px!important;
    align-items:baseline!important; width:100%!important; }
  #tab-analysis #acct-total-bar td{ display:inline-block!important; width:auto!important; flex:0 0 auto!important;
    white-space:nowrap!important; font-size:11.5px!important; padding:2px 0!important;
    border-bottom:none!important; text-align:left!important; }
  #tab-analysis #acct-total-bar td.acct-name{ flex:1 1 100%!important; font-size:13px!important; padding-bottom:1px!important; }
  /* 标签指南：吸顶头改回随内容滚动，不再挡住后面内容 */
  #tab-tags .tags-sticky-head{ position:static!important; }
  /* 药方页：上传区文字靠左 */
  #tab-rx .rx-upload-zone, #tab-rx .rx-upload-inner, #tab-rx .rx-upload-icon,
  #tab-rx .rx-upload-main, #tab-rx .rx-upload-sub{ text-align:left!important; }
  /* 高价值页：单元格内容靠左（压掉行内 text-align） */
  #tab-value #value-table tbody td{ text-align:left!important; }
}
