
/* 默认主题：医护蓝（blue）——清新、暖心、可信赖 */
:root, [data-theme="blue"] {
    --primary: #2E7CF6;
    --primary-dark: #1F63D6;
    --primary-rgb: 46,124,246;
    --secondary: #FFB454;
    --danger: #F0644E;
    --success: #3BB27A;
    --warning: #F7A84C;
    --bg: #F3F7FE;
    --card-bg: #FFFFFF;
    --text: #22324A;
    --text-light: #76869C;
    --border: #E2EAF6;
    --shadow: 0 2px 1.2rem rgba(31,99,214,0.08);
    --radius: 1.2rem;
    --radius-sm: 0.8rem;
    --header-icon: #ffffff;      /* 深色页头 → 白色三方图标（铃铛等） */
    --unread-bg: #ECF3FF;
    --input-bg: #ffffff;
    --fs: 1.1429;  /* 全局字体缩放系数：默认正文 16px(1.4rem基准×1.1429)，管理端字号设置(13-17)实时改写此变量 */
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }

/* 恢复可选择的元素：聊天输入框、聊天消息气泡、所有表单控件 */
input, textarea, select, [contenteditable="true"] { user-select: text; -webkit-user-select: text; cursor: text; }
.chat-msg .bubble, .chat-msg .bubble * { user-select: text; -webkit-user-select: text; }
.chat-input-bar input, .chat-input-bar textarea { user-select: text; -webkit-user-select: text; }
.md-body, .md-body * { user-select: text; -webkit-user-select: text; }

/* rem 基准（PC 兜底，移动端由 head 内联 JS 按视口宽动态覆盖）：1rem=10px@480 设计稿 */
html { font-size: 10px; /* norem */ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    font-family: var(--app-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    background: var(--bg);
    color: var(--text);
    height: 100%;
    overflow: hidden;
    font-size: calc(1.4rem * var(--fs));
    font-weight: var(--app-font-weight, 400);
    line-height: 1.5;
    /* ===== 全站文字换行基线（跨设备一致性的单一事实源）=====
       中文按字符正常换行；长英文/数字/URL 允许断开，绝不撑破容器；严格避头尾标点 */
    word-break: normal;
    overflow-wrap: anywhere;
    line-break: strict;
}

/* ===== 文字排版工具类：全站一律按内容类型取用，禁止各页面自行写截断规则 ===== */
/* 短文本（≤20字）：词组不切断、可整体换到下一行，绝不省略号 */
.text-wrap-keep,
.hp-title, .nurse-card .name, .order-card .service-name, .list-item .title,
.section-title, .hm-head .hp-title {
    white-space: normal; word-break: keep-all; overflow-wrap: anywhere;
}
/* 长文本单行（仅用于长度不可控的摘要/单号等，短文本禁用） */
.text-clip1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 长文本两行：固定两行高（行高随 rem 等比），跨设备高度一致 */
.text-clip2 {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; word-break: normal; overflow-wrap: anywhere;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 48rem;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 3rem rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 页面基础样式 - 由JS控制显示 */
.page {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
    padding-bottom: 8rem;
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.2rem 1.6rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.8rem;
}
.header .back-btn {
    width: 3.2rem; height: 3.2rem; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2); border-radius: 50%; cursor: pointer; font-size: calc(1.8rem * var(--fs));
    border: none; color: white;
}
.header h1 { font-size: calc(1.7rem * var(--fs)); font-weight: 600; flex: 1; text-align: center; margin: 0 0.8rem; }
.header .right-btn { min-width: 3.2rem; text-align: center; font-size: calc(1.3rem * var(--fs)); cursor: pointer; }

/* 底部导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 48rem;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 0.6rem 0 1.2rem;
    border-top: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 -2px 1rem rgba(0,0,0,0.05);
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-light);
    font-size: calc(1.1rem * var(--fs));
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.4rem 0;
}
.tab-item .icon { font-size: calc(2.2rem * var(--fs)); line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.tab-item .icon svg { width: 1em; height: 1em; display: block; }
.tab-item.active { color: var(--primary); }

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 1.2rem 1.6rem;
    padding: 1.6rem;
    box-shadow: var(--shadow);
}
.card-title {
    font-size: calc(1.6rem * var(--fs)); font-weight: 600; margin-bottom: 1.2rem;
    display: flex; align-items: center; gap: 0.8rem;
}
.card-title .icon { color: var(--primary); font-size: calc(1.8rem * var(--fs)); }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 2rem; border-radius: var(--radius-sm);
    border: none; font-size: calc(1.4rem * var(--fs)); font-weight: 500; cursor: pointer;
    transition: all 0.2s; gap: 0.6rem;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; box-shadow: 0 0.4rem 1.2rem rgba(var(--primary-rgb),0.3);
}
.btn-primary:active { transform: scale(0.98); }
.btn-block { width: 100%; padding: 1.4rem; font-size: calc(1.5rem * var(--fs)); border-radius: var(--radius); }
.btn-outline {
    background: transparent; border: 1px solid var(--primary); color: var(--primary);
}
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 0.6rem 1.2rem; font-size: calc(1.2rem * var(--fs)); }

/* 列表项 */
.list-item {
    display: flex; align-items: center; padding: 1.4rem 1.6rem;
    background: white; border-bottom: 1px solid var(--border);
    gap: 1.2rem; cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item .avatar {
    width: 4.8rem; height: 4.8rem; border-radius: 50%; object-fit: cover;
    background: var(--bg); flex-shrink: 0;
}
.list-item .content { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; font-size: calc(1.5rem * var(--fs)); margin-bottom: 0.4rem; }
.list-item .desc {  /* 短描述完整展示；长摘要统一两行收口，行高随 rem 恒定，跨端一致 */
    color: var(--text-light); font-size: calc(1.3rem * var(--fs));
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.list-item .extra { color: var(--text-light); font-size: calc(1.2rem * var(--fs)); text-align: right; flex-shrink: 0; }
.list-item .arrow { color: var(--text-light); font-size: calc(1.6rem * var(--fs)); }

/* 标签 */
.tag {
    display: inline-block; padding: 2px 0.8rem; border-radius: 0.4rem;
    font-size: calc(1.1rem * var(--fs)); font-weight: 500;
}
.tag-primary { background: rgba(var(--primary-rgb),0.1); color: var(--primary); }
.tag-warning { background: rgba(244,162,97,0.1); color: var(--warning); }
.tag-danger { background: rgba(231,111,81,0.1); color: var(--danger); }
.tag-success { background: rgba(82,183,136,0.1); color: var(--success); }
.tag-outline { background: transparent; color: var(--text-light); border: 1px solid var(--border); }

/* 搜索三件套 · 过滤标签行：纯文字按钮不做网格约束，宽度随文字自适应；
   摆不下整颗按钮换到下一行（nowrap+flex-shrink:0 保证词条横排不切断） */
.toolbar-tags, #admin-nurse-filter-tags {
    display: flex; flex-wrap: wrap; gap: 0.8rem;
}
.toolbar-tags .tag, #admin-nurse-filter-tags .tag {
    flex-shrink: 0; white-space: nowrap; word-break: keep-all;
    padding: 0.4rem 1.2rem; font-size: calc(1.2rem * var(--fs));
}
/* 按钮组内的小标注/分隔：状态、排序两组按钮的聚集边界 */
.cs-tag-divider {
    font-size: calc(1.1rem * var(--fs)); color: var(--text-light);
    margin-right: -2px; align-self: center;
}
.cs-tag-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 0.4rem; }

/* 表单 */
.form-group { margin-bottom: 1.6rem; }
.form-label { display: block; font-size: calc(1.4rem * var(--fs)); font-weight: 500; margin-bottom: 0.6rem; color: var(--text); }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 1.2rem 1.4rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: calc(1.4rem * var(--fs)); background: white;
    transition: border-color 0.2s; outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { min-height: 8rem; resize: vertical; }

/* 网格 */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* 服务卡片 */
.service-card {
    background: white; border-radius: var(--radius); padding: 1.6rem;
    box-shadow: var(--shadow); cursor: pointer; transition: transform 0.2s;
}
.service-card:active { transform: scale(0.98); }
.service-card .icon-wrap {
    width: 4.8rem; height: 4.8rem; border-radius: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: calc(2.4rem * var(--fs)); margin-bottom: 1rem;
}
.service-card .name { font-weight: 600; font-size: calc(1.5rem * var(--fs)); margin-bottom: 0.4rem; }
.service-card .price { color: var(--danger); font-weight: 600; font-size: calc(1.4rem * var(--fs)); }
.service-card .price span { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); font-weight: normal; }

/* 护工卡片 */
.nurse-card {
    background: white; border-radius: var(--radius); padding: 1.6rem;
    box-shadow: var(--shadow); margin-bottom: 1.2rem;
}
/* 找护工列表容器：卡片自带无侧边距，由容器统一给边距（底部留出 tabbar 空间） */
#nurse-list-container { padding: 1.2rem 1.6rem 8rem; }
.nurse-card .top {
    display: flex; gap: 1.2rem; margin-bottom: 1.2rem;
}
.nurse-card .avatar {
    width: 6.4rem; height: 6.4rem; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.nurse-card .info { flex: 1; }
.nurse-card .name-row {
    display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem;
}
.nurse-card .name { font-size: calc(1.6rem * var(--fs)); font-weight: 600; }
.nurse-card .rating { color: var(--warning); font-size: calc(1.3rem * var(--fs)); }
.nurse-card .tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.8rem; }
.nurse-card .tags .tag { white-space: nowrap; word-break: keep-all; flex-shrink: 0; }
.nurse-card .meta { color: var(--text-light); font-size: calc(1.2rem * var(--fs)); }
.nurse-card .bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); padding-top: 1rem;
}
.nurse-card .price { color: var(--danger); font-size: calc(1.8rem * var(--fs)); font-weight: 700; }
.nurse-card .price span { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); font-weight: normal; }

/* 订单卡片 */
.order-card {
    background: white; border-radius: var(--radius); padding: 1.6rem;
    box-shadow: var(--shadow); margin: 1.2rem 1.6rem;
}
.order-card .header-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.order-card .order-no { font-size: calc(1.3rem * var(--fs)); color: var(--text-light); }
.order-card .status { font-size: calc(1.3rem * var(--fs)); font-weight: 600; }
.order-card .body { display: flex; gap: 1.2rem; margin-bottom: 1.2rem; }
.order-card .icon-wrap {
    width: 4.8rem; height: 4.8rem; border-radius: var(--radius-sm);
    background: var(--bg); display: flex; align-items: center; justify-content: center;
    font-size: calc(2.4rem * var(--fs)); flex-shrink: 0;
}
.order-card .info { flex: 1; }
.order-card .service-name { font-weight: 600; margin-bottom: 0.4rem; }
.order-card .detail { color: var(--text-light); font-size: calc(1.3rem * var(--fs)); line-height: 1.6; }
.order-card .footer {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); padding-top: 1rem;
}
.order-card .amount { font-size: calc(1.6rem * var(--fs)); font-weight: 700; color: var(--danger); }
.order-card .actions { display: flex; gap: 0.8rem; }

/* 状态颜色 */
.status-0 { color: var(--warning); }
.status-1 { color: var(--primary); }
.status-2 { color: #3B82F6; }
.status-3 { color: #8B5CF6; }
.status-4 { color: var(--success); }
.status-5 { color: var(--success); }
.status-6 { color: var(--danger); }
.status-7 { color: var(--text-light); }
.status-8 { color: var(--text-light); }

/* 搜索栏 */
.search-bar {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.6rem; background: white;
    position: sticky; top: 4.8rem; z-index: 99;
    border-bottom: 1px solid var(--border);
}
.search-bar input {
    flex: 1; padding: 1rem 1.4rem; border: 1px solid var(--border);
    border-radius: 2rem; font-size: calc(1.4rem * var(--fs)); outline: none;
    background: var(--bg);
}
.search-bar input:focus { border-color: var(--primary); }

/* 轮播图 */
.banner {
    margin: 1.2rem 1.6rem; border-radius: var(--radius); overflow: hidden;
    height: 16rem; position: relative; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center; color: white;
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner .text { position: absolute; padding: 2rem; text-align: center; }
.banner .text h2 { font-size: calc(2rem * var(--fs)); margin-bottom: 0.8rem; }
.banner .text p { font-size: calc(1.3rem * var(--fs)); opacity: 0.9; }

/* 快速入口 */
.quick-entry {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem;
    padding: 1.6rem; background: white; margin: 0 1.6rem 1.2rem;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; cursor: pointer; }
.quick-item .icon {
    width: 4.8rem; height: 4.8rem; border-radius: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    font-size: calc(2.4rem * var(--fs)); color: white;
}
.quick-item .label { font-size: calc(1.2rem * var(--fs)); color: var(--text); }

/* ==================== 用户首页改版（医护蓝·智护风） ==================== */
/* 浅底头部：品牌胶囊在左，消息/铃铛在右（挂载注入 .home-actions） */
.home-header {
    justify-content: space-between;
    padding: 1rem 1.6rem 0.8rem;
    /* 底色实色打底 + 顶部淡色渐变，保证滚动时内容绝不透视 */
    background: var(--bg) linear-gradient(180deg, rgba(var(--primary-rgb),.12) 0%, rgba(var(--primary-rgb),.04) 60%, transparent 100%);
}
.home-brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.hb-logo {
    width: 3.4rem; height: 3.4rem; border-radius: 1.1rem; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: calc(1.6rem * var(--fs)); box-shadow: 0 0.4rem 1rem rgba(var(--primary-rgb),.35);
}
.hb-name { font-size: calc(1.7rem * var(--fs)); font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-name img { height: 2.2rem; border-radius: 0.5rem; vertical-align: -0.4rem; margin-right: 2px; }
.home-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.home-header .bell-btn { color: var(--text); margin-left: 0; font-size: calc(1.8rem * var(--fs)); }
.home-header .bell-badge,
.home-header .cs-msg-badge { border-color: var(--bg); }

/* 搜索条 */
.home-search {
    margin: 0.4rem 1.6rem 1.2rem;
    height: 4.2rem; border-radius: 99.9rem;
    background: var(--card-bg); border: 1px solid var(--border);
    box-shadow: 0 2px 1rem rgba(var(--primary-rgb),.07);
    display: flex; align-items: center; gap: 0.9rem; padding: 0 1.6rem;
}
.home-search i { color: var(--text-light); font-size: calc(1.4rem * var(--fs)); flex-shrink: 0; }
.home-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: calc(1.35rem * var(--fs)); color: var(--text); font-family: inherit; min-width: 0;
}
.home-search input::placeholder { color: var(--text-light); }

/* 主视觉 hero（沿用 .banner 定位，覆盖其居中布局） */
.home-hero {
    display: block; height: 15.2rem; border-radius: 1.6rem;
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 0.8rem 2rem rgba(var(--primary-rgb),.25);
}
.home-hero::after {
    content: '';
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 32%, rgba(var(--primary-rgb),.9) 46%, rgba(var(--primary-rgb),0) 62%);
}
/* 后台配置了轮播图时关闭文字遮罩，整图展示 */
.home-hero.has-carousel::after { display: none; }
.home-hero .hero-text {
    position: absolute; left: 2rem; top: 0; bottom: 0; z-index: 2;
    display: flex; flex-direction: column; justify-content: center;
    max-width: 60%;
}
/* Hero 文案：keep-all 保证只在「·」等标点处整词换行（如 数字护享·/暖心护理），断点不随设备字体宽度变化 */
.home-hero .hero-text h2 { font-size: calc(2.1rem * var(--fs)); font-weight: 700; color: #fff; margin-bottom: 0.7rem; letter-spacing: .5px; word-break: keep-all; }
.home-hero .hero-text p { font-size: calc(1.2rem * var(--fs)); color: rgba(255,255,255,.88); margin-bottom: 1.2rem; line-height: 1.5; word-break: keep-all; }
.hero-btn {
    align-self: flex-start; border: none; cursor: pointer;
    background: #fff; color: var(--primary-dark);
    font-size: calc(1.3rem * var(--fs)); font-weight: 600; font-family: inherit;
    padding: 0.7rem 1.8rem; border-radius: 99.9rem;
    box-shadow: 0 0.3rem 0.8rem rgba(0,0,0,.12);
}
.hero-btn:active { transform: scale(.96); }
.home-hero .hero-img {
    position: absolute; right: -1.8rem; bottom: -1.2rem; z-index: 1;
    height: 128%; width: auto; max-width: none;
    object-fit: contain; object-position: right bottom;
    pointer-events: auto; user-select: none;
    transform-origin: right bottom;
    will-change: transform;
}
.home-hero .hero-img.hero-editable {
    cursor: grab;
    border: 2px dashed rgba(255,255,255,.35);
    border-radius: 0.8rem;
    box-shadow: 0 0 0 1px rgba(255,255,255,.2);
    touch-action: none;   /* 阻止移动端默认滚动/缩放，让手势生效 */
}
.home-hero .hero-img.hero-editable:active { cursor: grabbing; }

/* 金刚区 */
.home-quick {
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 1.6rem 0.6rem 1.2rem; margin-top: 1.2rem;
}
.hq-item { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; cursor: pointer; }
.hq-item:active { opacity: .65; }
.hq-icon {
    width: 4.6rem; height: 4.6rem; border-radius: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(var(--primary-rgb),.1);
    color: var(--primary);
}
.hq-icon svg { width: 2.5rem; height: 2.5rem; }
.hq-label { font-size: calc(1.25rem * var(--fs)); color: var(--text); word-break: keep-all; text-align: center; }

/* 护工资质 / 热门服务 双卡 */
.home-duo {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    margin: 0 1.6rem; align-items: start;  /* 两卡高度各自随内容自适应，资质侧留白不撑高服务侧 */
}
.home-panel { margin: 0; padding: 1.4rem 1.3rem; }
.hp-title { font-size: calc(1.5rem * var(--fs)); font-weight: 700; color: var(--text); margin-bottom: 1.1rem; }
/* 文字标签：不做网格约束，宽度随文字自适应；整颗标签横排不切断，摆不下整颗换行 */
.hp-tags { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.hp-tags > span {
    font-size: calc(1.2rem * var(--fs)); color: var(--text);
    background: rgba(var(--primary-rgb),.07);
    border-radius: 0.8rem; padding: 0.5rem 1rem; cursor: default;
    white-space: nowrap; word-break: keep-all; flex-shrink: 0;
}
.hp-tags > span.on { background: var(--primary); color: #fff; font-weight: 600; }
.hp-tags > span.hp-link { cursor: pointer; }
.hp-tags > span.hp-link:active { background: rgba(var(--primary-rgb),.16); }
.hp-tags > span.hp-dim { background: transparent; color: var(--text-light); padding-left: 0; }

/* 护理商城 */
.home-mall { margin: 1.6rem 1.6rem 0; }
.hm-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 1rem; }
.hm-more { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); cursor: pointer; }
.hm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hm-card {
    position: relative; min-height: 10.4rem; border-radius: 1.4rem;
    padding: 1.3rem 1.3rem 1rem; overflow: hidden; cursor: pointer;
    color: #fff; display: flex; flex-direction: column;
    box-shadow: 0 0.6rem 1.4rem rgba(31,99,214,.18);
}
.hm-card:active { transform: scale(.97); }
.hm-card.mc-a { background: linear-gradient(135deg, #4E93FF 0%, #2E7CF6 60%, #1F63D6 100%); }
.hm-card.mc-b { background: linear-gradient(135deg, #7B8CFF 0%, #5B6FE8 55%, #3D52C9 100%); }
.hm-name { font-size: calc(1.6rem * var(--fs)); font-weight: 700; position: relative; z-index: 2; word-break: keep-all; }
.hm-feat { font-size: calc(1.05rem * var(--fs)); opacity: .9; margin-top: 0.6rem; line-height: 1.7; position: relative; z-index: 2; }
.hm-feat i { font-style: normal; margin-right: 2px; }
/* 商品右下方的柔光晕，让抠图商品更有悬浮感 */
.hm-card::before {
    content: ''; position: absolute; right: -3.4rem; bottom: -3.4rem; z-index: 0;
    width: 13.2rem; height: 13.2rem; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}
.hm-card img {
    position: absolute; right: -1.4rem; bottom: -1rem; height: 126%; width: auto; max-width: none;
    object-fit: contain; object-position: right bottom; z-index: 1;
    pointer-events: none; user-select: none;
    transform-origin: right bottom;
    will-change: transform;
}
/* 预览窗口里的商城商品图可编辑 */
#home-preview-body .hm-card {
    overflow: visible;   /* 预览时不裁剪，让商品图完整可交互 */
    cursor: default;
}
#home-preview-body .hm-card:active { transform: none; }
.mall-img-editable {
    pointer-events: auto !important;
    cursor: grab;
    border: 2px dashed rgba(255,255,255,.4);
    border-radius: 0.6rem;
    touch-action: none;   /* 阻止移动端默认滚动/缩放，让手势生效 */
}
.mall-img-editable:active { cursor: grabbing; }

/* 首页商城价格 */
.hm-price { position: relative; z-index: 2; margin-top: auto; display: flex; align-items: baseline; gap: 0.6rem; }
.hm-price-now { font-size: calc(1.5rem * var(--fs)); font-weight: 700; }
.hm-price-old { font-size: calc(1.1rem * var(--fs)); opacity: .7; text-decoration: line-through; }

/* 商城页商品列表 */
.mall-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.mall-card { background: var(--card-bg); border-radius: 1.4rem; overflow: hidden; box-shadow: 0 2px 0.8rem rgba(0,0,0,.06); }
.mall-img { width: 100%; aspect-ratio: 1; background: #f5f7fa; display: flex; align-items: center; justify-content: center; }
.mall-img img { width: 100%; height: 100%; object-fit: cover; }
.mall-img-placeholder { font-size: calc(4rem * var(--fs)); color: #ccc; }
.mall-info { padding: 1rem 1.2rem; }
.mall-name { font-size: calc(1.4rem * var(--fs)); font-weight: 600; color: var(--text); }
.mall-feat { font-size: calc(1.1rem * var(--fs)); color: var(--text-light); margin-top: 2px; }
.mall-rv-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: calc(1.15rem * var(--fs)); cursor: pointer; }
.mall-rv-count { color: var(--text-light); }
.mall-price-row { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 0.6rem; }
.mall-price-now { font-size: calc(1.6rem * var(--fs)); font-weight: 700; color: var(--danger); }
.mall-price-old { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); text-decoration: line-through; }
.mall-actions { display: flex; gap: 0.6rem; margin-top: 0.8rem; }
.mall-actions .btn { flex: 1; font-size: calc(1.2rem * var(--fs)); padding: 0.6rem 0; }

/* 购物车 */
.cart-item { display: flex; gap: 1.2rem; background: var(--card-bg); border-radius: 1.2rem; padding: 1.2rem; margin-bottom: 1rem; }
.cart-img { width: 7rem; height: 7rem; border-radius: 1rem; background: #f5f7fa; display: flex; align-items: center; justify-content: center; font-size: calc(2.8rem * var(--fs)); flex-shrink: 0; }
.cart-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 1rem; }
.cart-info { flex: 1; }
.cart-name { font-size: calc(1.5rem * var(--fs)); font-weight: 600; }
.cart-price { color: var(--danger); font-weight: 700; margin-top: 0.4rem; }
.cart-qty { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.8rem; }
.qty-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: calc(1.6rem * var(--fs)); }
.cart-del { margin-left: auto; background: none; border: none; color: var(--text-light); cursor: pointer; font-size: calc(1.3rem * var(--fs)); }
.cart-footer { position: fixed; bottom: 6rem; left: 0; right: 0; max-width: 48rem; margin: 0 auto; background: #fff; padding: 1.2rem 1.6rem; display: flex; align-items: center; gap: 1.2rem; border-top: 1px solid var(--border); box-shadow: 0 -2px 0.8rem rgba(0,0,0,.06); }
.cart-total { flex: 1; }
.cart-total b { color: var(--danger); font-size: calc(1.8rem * var(--fs)); }

/* 结算弹窗 */
.checkout-row { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid #f0f0f0; font-size: calc(1.4rem * var(--fs)); }

/* 管理端商品列表 */
.admin-product-item { display: flex; gap: 1.2rem; background: var(--card-bg); border-radius: 1.2rem; padding: 1.2rem; margin-bottom: 1rem; align-items: center; }
.ap-img { width: 6rem; height: 6rem; border-radius: 1rem; background: #f5f7fa; display: flex; align-items: center; justify-content: center; font-size: calc(2.4rem * var(--fs)); flex-shrink: 0; }
.ap-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 1rem; }
.ap-info { flex: 1; min-width: 0; }
.ap-name { font-size: calc(1.5rem * var(--fs)); font-weight: 600; }
.ap-feat { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); margin-top: 2px; }
.ap-price { display: flex; align-items: baseline; gap: 0.8rem; margin-top: 0.4rem; flex-wrap: wrap; }
.ap-now { color: var(--danger); font-weight: 700; }
.ap-old { color: var(--text-light); text-decoration: line-through; font-size: calc(1.2rem * var(--fs)); }
.ap-sort { font-size: calc(1.1rem * var(--fs)); color: var(--text-light); }
.ap-actions { display: flex; flex-direction: column; gap: 0.6rem; flex-shrink: 0; }
.ap-actions .btn { padding: 0.4rem 1.2rem; font-size: calc(1.2rem * var(--fs)); }

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border-radius: var(--radius); padding: 2rem;
    margin: 1.2rem 1.6rem; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: -50%; right: -20%;
    width: 20rem; height: 20rem; background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.stat-card .label { font-size: calc(1.3rem * var(--fs)); opacity: 0.9; margin-bottom: 0.8rem; }
.stat-card .value { font-size: calc(2.8rem * var(--fs)); font-weight: 700; }

/* 聊天（#page-chat 为 flex 列布局：头部固定 / 消息区滚动 / 表情面板+输入框固定底部） */
.chat-messages {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; padding: 1.6rem;
    padding-bottom: 3vh; /* 距底部输入框最近距离 ≈ 对话框内容高度的 3% */
    -webkit-overflow-scrolling: touch;
}
.chat-msg {
    --avatar-size: 3.6rem;
    display: flex; align-items: flex-start;
    gap: 5%; /* 气泡距头像的横向距离 5% */
    margin-bottom: 1.6rem;
}
.chat-msg.self { flex-direction: row-reverse; }
.chat-msg .avatar { width: var(--avatar-size); height: var(--avatar-size); border-radius: 50%; flex-shrink: 0; object-fit: cover; }
/* 头像列：头像 + 头像下方的发送者名称（名称横排，不竖排变形） */
.chat-msg .avatar-col {
    flex-shrink: 0; width: var(--avatar-size);
    display: flex; flex-direction: column; align-items: center;
}
.chat-msg .avatar-name {
    margin-top: 0.4rem;
    font-size: calc(1rem * var(--fs)); line-height: 1.2; color: var(--text-light);
    text-align: center; max-width: 8.4rem;
    /* 真名（短文本）不省略不切断，放不下整词换行，最多两行 */
    white-space: normal; word-break: keep-all; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* 气泡列最大宽度 = 除去左右两个头像后剩余宽度的 80%：80%*(100%-2*3.6rem) = 80% - 5.76rem */
.chat-msg .msg-body { max-width: calc(80% - 5.76rem); min-width: 0; }
/* 自己发送的消息：气泡和时间整体靠右并按内容收缩 */
.chat-msg.self .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
/* 气泡按内容自适应宽度（短消息只包裹字符，左右内边距=圆角半径14px），最长不超过气泡列 */
.chat-msg .bubble {
    width: fit-content; max-width: 100%;
    padding: 1rem 1.4rem; border-radius: 1.4rem;
    font-size: calc(1.4rem * var(--fs)); line-height: 1.5; word-break: break-word;
    background: white; border: 1px solid var(--border);
    box-sizing: border-box;
}
.chat-msg.self .bubble { background: var(--primary); color: white; border: none; }
/* 图片消息：宽/高均不超过聊天窗宽度的 40%（桌面容器480px→19.2rem，移动端 40vw） */
.chat-msg .bubble.bubble-img { padding: 0.4rem; cursor: pointer; }
.chat-msg .bubble.bubble-img img {
    display: block; border-radius: 1rem;
    max-width: min(40vw, 19.2rem); max-height: min(40vw, 19.2rem);
}
/* 语音消息 */
.chat-msg .voice-bubble { display: flex; align-items: center; gap: 0.8rem; min-width: 9.6rem; cursor: pointer; user-select: none; }
.chat-msg .voice-bubble .vicon { font-size: calc(1.8rem * var(--fs)); line-height: 1; }
.chat-msg .voice-bubble .vdur { font-size: calc(1.3rem * var(--fs)); }
/* 时间：对方消息左对齐，自己发送（气泡在右）右对齐 */
.chat-msg .time { font-size: calc(1.1rem * var(--fs)); color: var(--text-light); margin-top: 0.4rem; text-align: left; }
.chat-msg.self .time { text-align: right; }

/* 关键词定位高亮：初始柔和底色，闪烁动画结束后由 JS 移除 mark 恢复正常 */
.kw-hit {
    background: rgba(250, 204, 21, .35);
    color: inherit; padding: 0 1px; border-radius: 0.3rem;
}
/* 闪烁3下：每 0.5s 一次高亮脉冲，共3次后恢复 */
.kw-hit.kw-flash { animation: kw-flash-anim .5s ease-in-out 3; }
@keyframes kw-flash-anim {
    0%, 100% { background: rgba(250, 204, 21, .35); color: inherit; box-shadow: none; }
    50% { background: #faad14; color: #000; box-shadow: 0 0 0 0.3rem rgba(250,173,20,.35); border-radius: 0.3rem; }
}

/* 客服工作台分区：用户消息 / 护工消息 */
.cs-section { margin-bottom: 0.6rem; }
.cs-section-title {
    display: flex; justify-content: space-between; align-items: center;
    font-size: calc(1.4rem * var(--fs)); font-weight: 700;
    padding: 0.9rem 1.2rem; border-radius: 1rem; margin-bottom: 1rem;
}
.cs-section-title.cs-sec-user { background: #e6f4ff; color: #0958d9; }
.cs-section-title.cs-sec-nurse { background: #f6ffed; color: #389e0d; }
.cs-section-meta { font-size: calc(1.1rem * var(--fs)); font-weight: 400; }
.cs-section-meta b { font-weight: 700; }

.chat-input-bar {
    background: white; padding: 1rem 1.2rem;
    border-top: 1px solid var(--border);
    display: flex; gap: 0.8rem; align-items: center;
    width: 100%; max-width: 48rem; margin: 0 auto;
    box-sizing: border-box; flex-shrink: 0;
}
.chat-tool-btn {
    background: transparent; border: none; font-size: calc(2.2rem * var(--fs));
    cursor: pointer; padding: 0.4rem; line-height: 1; flex-shrink: 0;
    -webkit-touch-callout: none; touch-action: manipulation;
}
.chat-tool-btn:active { transform: scale(0.9); }
.chat-tool-btn.active { background: var(--bg); border-radius: 0.8rem; }
#chat-voice-btn.recording { color: var(--danger); animation: voicePulse 1s infinite; }
@keyframes voicePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.chat-input-bar input {
    flex: 1; padding: 1rem 1.4rem; border: 1px solid var(--border);
    border-radius: 2rem; outline: none; min-width: 0;
}
#emoji-panel { flex-shrink: 0; }
#emoji-grid span { cursor: pointer; padding: 0.4rem; border-radius: 0.4rem; display: inline-block; }
#emoji-grid span:hover { background: var(--bg); }

/* 录音中提示 */
#voice-rec-tip {
    position: fixed; inset: 0; z-index: 3000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.45);
}
#voice-rec-tip .box {
    background: rgba(0,0,0,0.8); color: #fff; border-radius: 1.4rem;
    padding: 2.4rem 3.2rem; text-align: center; font-size: calc(1.5rem * var(--fs));
}
#voice-rec-tip .box .mic { font-size: calc(4.2rem * var(--fs)); display: block; margin-bottom: 1rem; animation: voicePulse 1s infinite; }

/* 聊天图片全屏预览（二级弹窗，层级最高，确保在评论等弹窗之上） */
#chat-img-preview {
    position: fixed; inset: 0; z-index: 30000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.85); cursor: zoom-out;
}
#chat-img-preview img { max-width: 92%; max-height: 82%; border-radius: 0.8rem; }

/* 空状态 */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 6rem 2rem; color: var(--text-light);
}
.empty-state .icon { font-size: calc(6.4rem * var(--fs)); margin-bottom: 1.6rem; opacity: 0.5; }
.empty-state .text { font-size: calc(1.4rem * var(--fs)); }

/* 加载动画 */
.loading {
    display: flex; align-items: center; justify-content: center; padding: 4rem;
    color: var(--text-light);
}

/* 管理员面板 */
.admin-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem;
    padding: 1.6rem;
}
.admin-card {
    background: white; border-radius: var(--radius); padding: 2rem;
    box-shadow: var(--shadow); text-align: center; cursor: pointer;
}
.admin-card .icon { font-size: calc(3.2rem * var(--fs)); margin-bottom: 0.8rem; }
.admin-card .title { font-weight: 600; margin-bottom: 0.4rem; }
.admin-card .desc { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); }

/* 表格（管理后台） */
.data-table { width: 100%; border-collapse: collapse; font-size: calc(1.3rem * var(--fs)); }
.data-table th, .data-table td { padding: 1rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg); font-weight: 600; position: sticky; top: 0; }
.data-table tr:active { background: var(--bg); }

/* 审核状态 */
.audit-0 { color: var(--warning); }
.audit-1 { color: var(--success); }
.audit-2 { color: var(--danger); }
.audit-3 { color: var(--text-light); }

/* 浮动按钮 */
.fab {
    position: fixed; bottom: 8rem; right: 2rem;
    width: 5.6rem; height: 5.6rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: calc(2.4rem * var(--fs)); box-shadow: 0 0.4rem 1.6rem rgba(var(--primary-rgb),0.4);
    cursor: pointer; z-index: 90; border: none;
}

/* 步骤条 */
.steps { display: flex; align-items: center; padding: 1.6rem; background: white; margin: 0 1.6rem 1.2rem; border-radius: var(--radius); }
.step { flex: 1; text-align: center; position: relative; }
.step::after {
    content: ''; position: absolute; top: 1.2rem; right: -50%; width: 100%; height: 2px;
    background: var(--border); z-index: 0;
}
.step:last-child::after { display: none; }
.step .dot {
    width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--border);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: calc(1.2rem * var(--fs)); color: white; position: relative; z-index: 1;
}
.step.active .dot { background: var(--primary); }
.step.done .dot { background: var(--success); }
.step .label { font-size: calc(1.1rem * var(--fs)); color: var(--text-light); margin-top: 0.6rem; }
.step.active .label { color: var(--primary); font-weight: 600; }

/* 选项按钮：纯文字自适应宽度，整颗不切断，摆不下整颗换行 */
.selector { display: flex; flex-wrap: wrap; gap: 1rem; }
.selector-item {
    padding: 0.8rem 1.6rem; border: 1px solid var(--border); border-radius: 2rem;
    font-size: calc(1.3rem * var(--fs)); cursor: pointer; background: white;
    white-space: nowrap; word-break: keep-all; flex-shrink: 0;
}
.selector-item.active { border-color: var(--primary); background: rgba(var(--primary-rgb),0.1); color: var(--primary); font-weight: 500; }

/* 图片上传 */
.upload-box {
    width: 8rem; height: 8rem; border: 2px dashed var(--border);
    border-radius: var(--radius-sm); display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: var(--text-light);
    font-size: calc(1.2rem * var(--fs)); cursor: pointer;
}
.upload-box .icon { font-size: calc(2.4rem * var(--fs)); margin-bottom: 0.4rem; }

/* 紧急标识 */
.urgent-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--danger); color: white;
    padding: 2px 0.8rem; border-radius: 0.4rem; font-size: calc(1.1rem * var(--fs));
}

/* 价格明细 */
.price-row { display: flex; justify-content: space-between; padding: 0.8rem 0; font-size: calc(1.4rem * var(--fs)); }
.price-row.total { border-top: 1px solid var(--border); margin-top: 0.8rem; padding-top: 1.2rem; font-weight: 600; font-size: calc(1.6rem * var(--fs)); }

/* 订单详情弹窗（用户/护工端）：与管理端一致的虚线分隔信息行 */
.order-view-row {
    padding: 1.2rem 0;
    border-bottom: 1px dashed var(--border);
    align-items: flex-start;
    gap: 1.6rem;
    font-size: calc(1.4rem * var(--fs));
}
.order-view-row > span:first-child {
    color: var(--text-light);
    flex-shrink: 0;
}
.order-view-row > span:last-child {
    text-align: right;
    word-break: break-all;
    max-width: 64%;
    color: var(--text);
}
/* 弹窗内状态文字与订单列表同色（置于其后覆盖上一行的默认色） */
.order-view-row > span.status-0 { color: var(--warning); }
.order-view-row > span.status-1 { color: var(--primary); }
.order-view-row > span.status-2 { color: #3B82F6; }
.order-view-row > span.status-3 { color: #8B5CF6; }
.order-view-row > span.status-4,
.order-view-row > span.status-5 { color: var(--success); }
.order-view-row > span.status-6 { color: var(--danger); }
.order-view-row > span.status-7,
.order-view-row > span.status-8 { color: var(--text-light); }
.order-view-total {
    font-weight: 700;
    font-size: calc(1.6rem * var(--fs));
    border-bottom: none;
    margin-top: 0.4rem;
}
.order-view-total > span:last-child { font-weight: 700; }

/* 服务类目图标选择：预览盒 + 上传加号角标 */
.st-icon-preview {
    position: relative;
    width: 6.4rem; height: 6.4rem; flex-shrink: 0;
    border-radius: 1.4rem;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: visible;
}
.st-icon-preview #st-icon-preview-inner {
    font-size: calc(3rem * var(--fs)); line-height: 1;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    border-radius: 1.4rem; overflow: hidden;
}
.st-icon-preview #st-icon-preview-inner img {
    width: 100%; height: 100%; object-fit: cover;
}
.st-icon-upload {
    position: absolute; right: -0.8rem; bottom: -0.8rem;
    width: 2.4rem; height: 2.4rem; border-radius: 50%;
    background: var(--primary); color: #fff; border: 2px solid var(--card-bg);
    font-size: calc(1.6rem * var(--fs)); line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.st-icon-upload:active { transform: scale(.9); }

/* 响应式 */
@media (max-width: 22.5rem) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .quick-entry { grid-template-columns: repeat(3, 1fr); }
    .service-card .icon-wrap { width: 4rem; height: 4rem; font-size: calc(2rem * var(--fs)); }
}

/* ==================== Markdown 正文（今日要闻） ==================== */
.md-body { font-size: calc(1.5rem * var(--fs)); line-height: 1.8; color: var(--text); word-break: break-word; }
.md-body h1 { font-size: calc(2.1rem * var(--fs)); font-weight: 700; margin: 1.8rem 0 1rem; line-height: 1.4; }
.md-body h2 { font-size: calc(1.8rem * var(--fs)); font-weight: 700; margin: 1.6rem 0 0.8rem; }
.md-body h3 { font-size: calc(1.6rem * var(--fs)); font-weight: 600; margin: 1.4rem 0 0.6rem; }
.md-body h4 { font-size: calc(1.5rem * var(--fs)); font-weight: 600; margin: 1.2rem 0 0.6rem; }
.md-body p { margin: 0.8rem 0; }
.md-body ul, .md-body ol { margin: 0.8rem 0; padding-left: 2.2rem; }
.md-body li { margin: 0.4rem 0; }
.md-body strong { font-weight: 700; }
.md-body em { font-style: italic; }
.md-body code {
    background: rgba(0,0,0,.06); border-radius: 0.4rem;
    padding: 1px 0.5rem; font-size: calc(1.3rem * var(--fs));
    font-family: Consolas, Monaco, monospace;
}
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 1.6rem 0; }
.md-body a { color: var(--primary); text-decoration: underline; }

/* 围栏代码块 */
.md-body pre.md-code {
    position: relative; margin: 1.2rem 0; padding: 1.4rem 1.6rem;
    background: #1e293b; border-radius: 1rem; overflow-x: auto;
}
.md-body pre.md-code code {
    display: block; background: transparent; padding: 0;
    color: #e2e8f0; font-size: calc(1.3rem * var(--fs)); line-height: 1.7;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    white-space: pre;
}
.md-body pre.md-code[data-lang]::before {
    content: attr(data-lang);
    position: absolute; top: 0.6rem; right: 1rem;
    font-size: calc(1.1rem * var(--fs)); color: rgba(226,232,240,.55);
    font-family: inherit;
}

/* 任务清单（- [ ] / - [x]） */
.md-body ul.md-checklist { list-style: none; padding-left: 0.4rem; }
.md-body ul.md-checklist li {
    display: flex; align-items: flex-start; gap: 0.8rem; margin: 0.6rem 0;
}
.md-body ul.md-checklist li .md-checkbox {
    flex-shrink: 0; width: 1.8rem; height: 1.8rem; margin-top: 0.3rem;
    border: 2px solid var(--text-light); border-radius: 0.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: calc(1.2rem * var(--fs)); line-height: 1; color: #fff;
}
.md-body ul.md-checklist li.checked .md-checkbox {
    background: var(--primary); border-color: var(--primary);
}
.md-body ul.md-checklist li.checked > span:last-child {
    text-decoration: line-through; color: var(--text-light);
}
.md-body blockquote {
    margin: 1rem 0; padding: 0.8rem 1.2rem;
    border-left: 0.4rem solid var(--primary);
    background: rgba(var(--primary-rgb),.08); border-radius: 0 0.8rem 0.8rem 0;
    color: var(--text-light);
}
.md-body .md-table, .md-body table {
    width: 100%; border-collapse: collapse; margin: 1.2rem 0;
    font-size: calc(1.3rem * var(--fs)); display: block; overflow-x: auto;
}

/* ==================== 全局通知铃铛 ==================== */
.bell-btn {
    position: relative; width: 3.2rem; height: 3.2rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text); cursor: pointer; font-size: calc(1.7rem * var(--fs));
    margin-left: 0.8rem;
}
.bell-btn:active { opacity: .6; }
/* 未读角标：微微切入铃铛右上角，泡泡紧贴数字 */
.bell-badge {
    position: absolute; top: -0.3rem; right: -0.5rem;
    min-width: 1.5rem; height: 1.5rem;
    padding: 0 0.35rem; border-radius: 0.8rem;
    background: var(--danger); color: #fff;
    font-size: calc(0.9rem * var(--fs)); font-weight: 600; line-height: 1.5rem;
    text-align: center; font-style: normal;
    border: 1.5px solid var(--primary-dark);
    box-sizing: border-box;
    box-shadow: 0 1px 0.3rem rgba(0,0,0,.25);
}

/* 顶栏客服消息入口：复用铃铛尺寸，居左侧与铃铛对称（右侧留出与铃铛 margin-left 等量的 0.8rem） */
.cs-msg-entry { margin-left: 0; margin-right: 0.8rem; }
/* 紧挨返回按钮时：与返回按钮留 0.6rem 间隙 */
.cs-msg-entry.after-back { margin-left: 0.6rem; }
/* 未读数字：与铃铛角标同款内切样式，数字泡泡切入消息图标右上角 */
.cs-msg-badge {
    position: absolute; top: -0.3rem; right: -0.5rem;
    min-width: 1.5rem; height: 1.5rem;
    padding: 0 0.35rem; border-radius: 0.8rem;
    background: var(--danger); color: #fff;
    font-size: calc(0.9rem * var(--fs)); font-weight: 600; line-height: 1.5rem;
    text-align: center; font-style: normal;
    border: 1.5px solid var(--primary-dark);
    box-sizing: border-box;
    box-shadow: 0 1px 0.3rem rgba(0,0,0,.25);
}

/* ==================== 通用列表工具栏（搜索 + 筛选 + 排序） ==================== */
.list-toolbar {
    display: flex; gap: 0.8rem; align-items: center;
    padding: 1rem 1.6rem; background: #fff;
    border-bottom: 1px solid var(--border);
}
.lt-search {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.6rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 1.8rem;
    padding: 0 1.2rem; height: 3.4rem;
}
.lt-search i { color: var(--text-light); font-size: calc(1.3rem * var(--fs)); flex-shrink: 0; }
.lt-search input {
    flex: 1; min-width: 0; border: none; background: transparent; outline: none;
    font-size: calc(1.3rem * var(--fs)); color: var(--text); height: 100%;
}
.lt-select {
    flex-shrink: 0; height: 3.4rem; border: 1px solid var(--border); border-radius: 1.8rem;
    background: var(--bg); font-size: calc(1.2rem * var(--fs)); color: var(--text);
    padding: 0 0.8rem; outline: none; max-width: 10.4rem;
}

/* ==================== 通用业务卡片（管理列表卡片化） ==================== */
.biz-card {
    background: #fff; border-radius: 1.2rem; padding: 1.4rem;
    box-shadow: 0 1px 0.4rem rgba(0,0,0,.05); border: 1px solid var(--border);
}
.biz-card .biz-head { display: flex; align-items: center; gap: 1rem; }
.biz-card .biz-avatar {
    width: 4.4rem; height: 4.4rem; border-radius: 50%; background: var(--bg);
    object-fit: cover; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; font-size: calc(2rem * var(--fs));
}
.biz-card .biz-name { font-size: calc(1.5rem * var(--fs)); font-weight: 600; }
.biz-card .biz-sub { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); margin-top: 2px; }
.biz-card .biz-tags { margin-left: auto; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.biz-card .biz-meta {
    margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border);
    font-size: calc(1.25rem * var(--fs)); color: var(--text-light); line-height: 1.8;
}
.biz-card .biz-actions { display: flex; gap: 0.8rem; margin-top: 1.2rem; }
.biz-card .biz-actions .btn { flex: 1; padding: 0.7rem 0; font-size: calc(1.3rem * var(--fs)); }

/* ==================== 通知卡片 ==================== */
.ntf-card {
    background: #fff; border-radius: 1.2rem; padding: 1.4rem;
    display: flex; gap: 1.2rem; border: 1px solid var(--border);
    box-shadow: 0 1px 0.4rem rgba(0,0,0,.04);
}
.ntf-card.unread { border-left: 0.3rem solid var(--primary); background: var(--unread-bg); }
.ntf-icon {
    width: 3.8rem; height: 3.8rem; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: calc(1.6rem * var(--fs)); background: rgba(var(--primary-rgb),.12); color: var(--primary);
}
.ntf-icon.ntf-order { background: rgba(var(--primary-rgb),.12); color: var(--primary); }
.ntf-icon.ntf-withdraw { background: rgba(82,183,136,.14); color: var(--success); }
.ntf-icon.ntf-audit { background: rgba(244,162,97,.16); color: var(--warning); }
.ntf-icon.ntf-complaint { background: rgba(231,111,81,.14); color: var(--danger); }
.ntf-icon.ntf-system { background: rgba(107,123,140,.14); color: var(--text-light); }
.ntf-body { flex: 1; min-width: 0; }
.ntf-title { font-size: calc(1.45rem * var(--fs)); font-weight: 600; line-height: 1.4; }
.ntf-card.unread .ntf-title::after {
    content: ''; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%;
    background: var(--danger); margin-left: 0.6rem; vertical-align: middle;
}
.ntf-content { font-size: calc(1.3rem * var(--fs)); color: var(--text-light); line-height: 1.6; margin-top: 0.4rem; word-break: break-all; }
.ntf-time { font-size: calc(1.15rem * var(--fs)); color: #9aa8b6; margin-top: 0.6rem; }
.ntf-jump {
    margin-top: 0.8rem; border: 1px solid var(--primary); color: var(--primary);
    background: transparent; border-radius: 1.6rem; font-size: calc(1.25rem * var(--fs));
    padding: 0.5rem 1.4rem; cursor: pointer;
}
.ntf-jump:active { background: rgba(var(--primary-rgb),.08); }

/* ==================== 服务图标选择器 ==================== */
.st-ic {
    width: 3.8rem; height: 3.8rem; border-radius: 1rem;
    border: 1px solid var(--border); background: var(--bg);
    font-size: calc(2rem * var(--fs)); line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; flex-shrink: 0;
    transition: all .15s ease;
}
.st-ic.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb),.12);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.st-ic:active { transform: scale(.92); }

/* ==================== 投诉图片九宫格 ==================== */
.cp-img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cp-img-tile {
    position: relative; aspect-ratio: 1/1; border-radius: 1rem; overflow: hidden;
    background: var(--bg); border: 1px solid var(--border);
}
.cp-img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-img-del {
    position: absolute; top: 0.4rem; right: 0.4rem; width: 2.2rem; height: 2.2rem;
    border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none;
    font-size: calc(1.2rem * var(--fs)); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.cp-img-add {
    aspect-ratio: 1/1; border-radius: 1rem; border: 1.5px dashed var(--border);
    background: #fafbfc; display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: var(--text-light); font-size: calc(1.2rem * var(--fs)); cursor: pointer; gap: 0.4rem;
}
.cp-img-add i { font-size: calc(2.2rem * var(--fs)); color: #b8c4d0; }

/* 投诉详情图片缩略图（列表卡片内） */
.cp-thumbs { display: flex; gap: 0.8rem; margin-top: 0.8rem; flex-wrap: wrap; }
.cp-thumbs img {
    width: 7.2rem; height: 7.2rem; border-radius: 0.8rem; object-fit: cover;
    border: 1px solid var(--border); cursor: pointer;
}
.cp-reply-box {
    margin-top: 1rem; background: #f4faf8; border: 1px solid #d8eeea;
    border-radius: 1rem; padding: 1rem 1.2rem; font-size: calc(1.3rem * var(--fs)); line-height: 1.6;
}
.cp-reply-box .cp-reply-title { color: var(--primary); font-weight: 600; margin-bottom: 0.4rem; font-size: calc(1.25rem * var(--fs)); }

/* ==================== 开关（护工接单设置） ==================== */
.switch-row {
    display: flex; align-items: center; gap: 1.2rem;
    padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--border); cursor: pointer;
}
.switch-row:last-child { border-bottom: none; }
.switch-info { flex: 1; min-width: 0; }
.switch-title { font-size: calc(1.45rem * var(--fs)); font-weight: 500; }
.switch-desc { font-size: calc(1.2rem * var(--fs)); color: var(--text-light); margin-top: 0.3rem; line-height: 1.5; }
.switch {
    flex-shrink: 0; width: 4.6rem; height: 2.6rem; border-radius: 1.3rem;
    background: #c6d0da; position: relative; transition: background .2s;
    display: inline-block;
}
.switch.on { background: var(--primary); }
.switch-dot {
    position: absolute; top: 0.3rem; left: 0.3rem; width: 2rem; height: 2rem;
    border-radius: 50%; background: #fff; transition: transform .2s;
    box-shadow: 0 1px 0.3rem rgba(0,0,0,.25);
}
.switch.on .switch-dot { transform: translateX(2rem); }
.md-body .md-table th, .md-body .md-table td,
.md-body table th, .md-body table td {
    border: 1px solid var(--border); padding: 0.6rem 1rem; text-align: left;
    white-space: nowrap;
}
.md-body .md-table th, .md-body table th {
    background: rgba(var(--primary-rgb),.1); font-weight: 600;
}

/* 主题：清爽绿（默认） */
.md-theme-default { --md-accent: var(--primary); }
.md-theme-default h1, .md-theme-default h2 { color: var(--primary-dark); }

/* 主题：暖阳橙 */
.md-theme-warm {
    background: #fff8f0; border-radius: 1.2rem; padding: 1.4rem 1.6rem;
    --md-accent: var(--warning);
}
.md-theme-warm h1, .md-theme-warm h2, .md-theme-warm h3 { color: #c26a2a; }
.md-theme-warm blockquote {
    border-left-color: var(--warning);
    background: rgba(244,162,97,.12);
}
.md-theme-warm .md-table th, .md-theme-warm table th { background: rgba(244,162,97,.15); }
.md-theme-warm a { color: #c26a2a; }

/* 主题：夜间深色 */
.md-theme-dark {
    background: #1f2937; border-radius: 1.2rem; padding: 1.4rem 1.6rem;
    color: #e5e7eb; --md-accent: #60a5fa;
}
.md-theme-dark h1, .md-theme-dark h2, .md-theme-dark h3, .md-theme-dark h4 { color: #f3f4f6; }
.md-theme-dark p, .md-theme-dark li { color: #d1d5db; }
.md-theme-dark code { background: rgba(255,255,255,.12); color: #fcd34d; }
.md-theme-dark hr { border-top-color: rgba(255,255,255,.15); }
.md-theme-dark a { color: #60a5fa; }
.md-theme-dark blockquote {
    border-left-color: #60a5fa; background: rgba(96,165,250,.12); color: #cbd5e1;
}
.md-theme-dark .md-table th, .md-theme-dark .md-table td,
.md-theme-dark table th, .md-theme-dark table td { border-color: rgba(255,255,255,.18); }
.md-theme-dark .md-table th, .md-theme-dark table th { background: rgba(96,165,250,.18); color: #f3f4f6; }

/* ==================== 全局主题系统（医护蓝 blue 为默认 / 青绿 teal 可选） ==================== */
[data-theme="teal"] {
    --primary: #2A9D8F;
    --primary-dark: #21867a;
    --primary-rgb: 42,157,143;
    --secondary: #E9C46A;
    --danger: #E76F51;
    --success: #52B788;
    --warning: #F4A261;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #264653;
    --text-light: #6B7B8C;
    --border: #E2E8F0;
    --shadow: 0 2px 1.2rem rgba(0,0,0,0.08);
    --header-icon: #ffffff;      /* 深色页头 → 白色三方图标（铃铛等） */
    --unread-bg: #f1f9f7;
    --input-bg: #ffffff;
}

/* 标题栏铃铛：主题均为安全色深色页头，铃铛一律使用白色，保证清晰可见 */
.bell-btn { color: #fff; }
/* 角标描边与页头同色（页头为 primary→primary-dark 渐变），视觉上嵌入铃铛右上角 */
.bell-badge { border-color: var(--primary-dark); }

/* ==================== 自定义下拉选择器（替代原生 select，各端样式一致） ==================== */
.select-native-hidden {
    position: absolute; width: 1px; height: 1px; opacity: 0;
    pointer-events: none; overflow: hidden;
}
.ui-select { position: relative; width: 100%; }
.ui-select-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 0.8rem; min-height: 4.4rem; padding: 1rem 1.4rem;
    background: var(--input-bg, var(--card-bg));
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: calc(1.4rem * var(--fs)); line-height: 1.3;
    font-family: inherit; font-weight: inherit;
    cursor: pointer; text-align: left;
    transition: border-color .2s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}
.ui-select-trigger:active { border-color: var(--primary); }
.ui-select-trigger.is-placeholder .ui-select-label { color: var(--text-light); }
.ui-select-trigger.is-disabled { opacity: .5; cursor: not-allowed; }
.ui-select-chev { color: var(--text-light); font-size: calc(1.1rem * var(--fs)); flex-shrink: 0; transition: transform .2s; }
.ui-select-compact { width: auto; flex-shrink: 0; }
.ui-select-compact .ui-select-trigger {
    min-height: 3.4rem; height: 3.4rem; padding: 0 3rem 0 1.4rem;
    border-radius: 1.8rem; font-size: calc(1.25rem * var(--fs)); font-weight: 500;
    background: var(--bg); white-space: nowrap;
}
.ui-select-compact .ui-select-chev {
    position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
}

/* 底部弹出选择面板 */
#ui-select-mask {
    position: fixed; inset: 0; z-index: 10002;
    background: rgba(0,0,0,.45);
    display: flex; align-items: flex-end; justify-content: center;
    animation: fadeIn .18s ease;
}
.ui-sheet {
    width: 100%; max-width: 48rem;
    background: var(--card-bg);
    border-radius: 1.6rem 1.6rem 0 0;
    padding-bottom: env(safe-area-inset-bottom, 1.2rem);
    max-height: 72vh; display: flex; flex-direction: column;
    animation: sheetUp .24s cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 -0.8rem 3rem rgba(0,0,0,.18);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ui-sheet-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.4rem 1.8rem 1rem; border-bottom: 1px solid var(--border);
}
.ui-sheet-title { font-size: calc(1.5rem * var(--fs)); font-weight: 600; color: var(--text); }
.ui-sheet-cancel { font-size: calc(1.4rem * var(--fs)); color: var(--text-light); cursor: pointer; min-width: 4rem; }
.ui-sheet-sp { min-width: 4rem; }
.ui-sheet-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0.6rem 0 1rem; }
.ui-sheet-group {
    padding: 1.2rem 1.8rem 0.6rem; font-size: calc(1.2rem * var(--fs)); color: var(--text-light);
}
.ui-sheet-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.3rem 1.8rem; font-size: calc(1.5rem * var(--fs)); color: var(--text);
    cursor: pointer; gap: 1.2rem;
}
.ui-sheet-item span { min-width: 0; word-break: break-all; }
.ui-sheet-item:active { background: var(--bg); }
.ui-sheet-item i { color: var(--primary); font-size: calc(1.7rem * var(--fs)); opacity: 0; flex-shrink: 0; }
.ui-sheet-item.selected { color: var(--primary); font-weight: 600; }
.ui-sheet-item.selected i { opacity: 1; }

/* ==================== 主题化确认弹窗（替代原生 confirm） ==================== */
#uic-mask, #income-log-mask, #bill-report-mask, #carelog-mask, #booking-choice-mask {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .18s ease;
    padding: 0 2rem;
}

/* ==================== 通用弹窗基础类（三段式：顶部固定标题 / 中间滚动内容 / 底部固定按钮组） ==================== */
.modal-mask {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .18s ease;
    padding: 0 1.6rem;
}
.modal {
    width: 100%; max-width: 42rem; max-height: 86vh;
    display: flex; flex-direction: column;
    background: var(--card-bg);
    border-radius: 1.4rem;
    box-shadow: 0 1.2rem 4rem rgba(0,0,0,.25);
    animation: uicPop .18s ease;
    overflow: hidden;
}
.modal-header {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--border);
    font-size: calc(1.6rem * var(--fs)); font-weight: 700; color: var(--text);
}
.modal-header h3 { margin: 0; font-size: calc(1.6rem * var(--fs)); font-weight: 700; color: var(--text); }
.modal-close {
    border: none; background: none; padding: 0 2px; line-height: 1;
    font-size: calc(1.8rem * var(--fs)); color: var(--text-light); cursor: pointer;
}
.modal-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1.6rem; }
.modal-footer {
    flex-shrink: 0; display: flex; gap: 1rem;
    padding: 1.2rem 1.6rem; border-top: 1px solid var(--border);
    background: var(--card-bg);
}

/* ==================== 通用表单弹窗（增加/编辑/查看 统一弹层，≤5字段默认弹窗约定） ==================== */
.form-modal-mask {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .18s ease;
    padding: 0 1.6rem;
}
.form-modal-box {
    width: 100%; max-width: 42rem; max-height: 86vh; overflow-y: auto;
    margin: 0 !important;
    padding: 1.6rem;
    text-align: left;
    background: var(--card-bg);
    border-radius: 1.4rem;
    box-shadow: 0 1.2rem 4rem rgba(0,0,0,.25);
    animation: uicPop .18s ease;
}
#income-log-mask .uic-box, #bill-report-mask .uic-box, #carelog-mask .uic-box { text-align: left; max-width: 42rem; }
.uic-box {
    width: 100%; max-width: 30rem;
    background: var(--card-bg);
    border-radius: 1.4rem; padding: 2rem 1.8rem 1.4rem;
    box-shadow: 0 1.2rem 4rem rgba(0,0,0,.25);
    animation: uicPop .18s ease;
    text-align: center;
}
@keyframes uicPop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.uic-title { font-size: calc(1.6rem * var(--fs)); font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.uic-msg { font-size: calc(1.35rem * var(--fs)); color: var(--text-light); line-height: 1.7; margin-bottom: 1.8rem; word-break: break-all; }
.uic-btns { display: flex; gap: 1rem; }
.uic-btn {
    flex: 1; padding: 0.9rem 0; border-radius: 1rem; border: none;
    font-size: calc(1.4rem * var(--fs)); font-weight: 600; cursor: pointer; transition: opacity .15s;
}
.uic-btn:active { opacity: .7; }
.uic-cancel { background: var(--bg); color: var(--text-light); }
.uic-ok { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }

/* ==================== 订单详情弹窗三分页 ==================== */
.od-tabs {
    flex-shrink: 0; display: flex; gap: 0.4rem;
    padding: 0 1.2rem; background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}
.od-tab {
    flex: 1; text-align: center; padding: 1.2rem 0;
    font-size: calc(1.4rem * var(--fs)); font-weight: 500; color: var(--text-light);
    border-bottom: 2px solid transparent; cursor: pointer;
    white-space: nowrap; transition: color .15s;
}
.od-tab.active {
    color: var(--primary); font-weight: 700;
    border-bottom-color: var(--primary);
}
/* 分页正文：无内容时空状态撑满可视区正中且不可滚动，有内容时正常滚动 */
#order-view-body { display: flex; flex-direction: column; }
#od-page-logs, #od-page-review { flex: 1; display: flex; flex-direction: column; }
#service-log-timeline { flex: 1; display: flex; flex-direction: column; }
#od-page-logs .empty-state,
#od-page-review .empty-state {
    flex: 1; padding-top: 0; padding-bottom: 0;
    /* 弹窗高度由内容自适应：空状态以适中高度自然撑起页面，图标文字垂直居中，
       弹窗总高（约45vh）天然远低于 70% 上限，无需生硬裁切 */
    min-height: 36vh;
}
/* 空状态图标统一占位：保证各空页的图标大小与文字处于同一水平线 */
#od-page-logs .empty-state .icon,
#od-page-review .empty-state .icon {
    line-height: 1; height: 6.4rem;
    display: flex; align-items: center; justify-content: center;
}
#eval-view-area .empty-state { min-height: 40vh; }

/* ==================== 全屏实时拍照 ==================== */
#cam-capture-mask {
    position: fixed; inset: 0; z-index: 10005;
    background: #000; display: flex; flex-direction: column;
    overflow: hidden; animation: uicPop .15s ease;
    user-select: none; -webkit-user-select: none;
}
#cam-capture-mask .cam-stage {
    position: relative; flex: 1; min-height: 0;
    overflow: hidden; background: #000; touch-action: none;
}
#cam-capture-mask video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
/* 取景画面统一绘制在画布上（盖在 video 上方）：窗口固定全屏，画面随变焦缩放 */
#cam-capture-mask .cam-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%; display: block;
}
#cam-capture-mask .cam-top {
    position: absolute; top: 0; left: 0; right: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.4rem 1.6rem;
    background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0));
    color: #fff; font-size: calc(1.5rem * var(--fs)); font-weight: 600;
}
#cam-capture-mask .cam-icon-btn {
    width: 3.8rem; height: 3.8rem; border-radius: 50%;
    border: none; background: rgba(0,0,0,.4); color: #fff;
    font-size: calc(1.7rem * var(--fs)); cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background .15s;
}
#cam-capture-mask .cam-icon-btn:active { background: rgba(0,0,0,.7); }
#cam-capture-mask .cam-zoom-badge {
    position: absolute; right: 1.4rem; top: 6.6rem; z-index: 5;
    background: rgba(0,0,0,.45); color: #fff;
    font-size: calc(1.2rem * var(--fs)); padding: 0.3rem 1rem; border-radius: 1.2rem;
    display: none;
}
#cam-capture-mask .cam-focus-ring {
    position: absolute; z-index: 4; width: 7.2rem; height: 7.2rem;
    margin: -3.6rem 0 0 -3.6rem; border: 2px solid #ffd54a; border-radius: 0.6rem;
    pointer-events: none; opacity: 0;
    box-shadow: 0 0 0 200rem rgba(0,0,0,.06);
}
#cam-capture-mask .cam-focus-ring.show { animation: camFocus 1.4s ease forwards; }
@keyframes camFocus {
    0% { opacity: 0; transform: scale(1.5); border-color: #fff; }
    25% { opacity: 1; transform: scale(1); border-color: #ffd54a; }
    75% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}
#cam-capture-mask .cam-bottom {
    flex-shrink: 0; padding: 1.4rem 1.6rem calc(1.8rem + env(safe-area-inset-bottom));
    background: #0d0d0d; display: flex; flex-direction: column;
    align-items: center; gap: 1.4rem;
}
#cam-capture-mask .cam-zoom-row {
    display: none; align-items: center; gap: 1rem;
    width: 100%; max-width: 32rem; color: #fff; font-size: calc(1.2rem * var(--fs));
}
#cam-capture-mask .cam-zoom-row.show { display: flex; }
#cam-capture-mask input[type="range"].cam-zoom-range {
    flex: 1; accent-color: var(--primary, #2E7CF6);
}
#cam-capture-mask .cam-shutter {
    width: 7rem; height: 7rem; border-radius: 50%;
    border: 0.4rem solid rgba(255,255,255,.85);
    background: #fff; cursor: pointer; padding: 0.4rem;
    transition: transform .1s;
}
#cam-capture-mask .cam-shutter::after {
    content: ''; display: block; width: 100%; height: 100%;
    border-radius: 50%; background: #fff; border: 2px solid #111;
    box-sizing: border-box;
}
#cam-capture-mask .cam-shutter:active { transform: scale(.92); }
#cam-capture-mask .cam-preview-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; background: #000; display: none;
}
#cam-capture-mask .cam-review-actions {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
    display: flex; gap: 1.2rem; padding: 1.6rem 2rem calc(2rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
}
#cam-capture-mask .cam-review-actions .btn { flex: 1; }

/* ==================== 护理照片查看器（左右滑动切换） ==================== */
#care-photo-viewer {
    position: fixed; inset: 0; z-index: 30000;
    background: rgba(0,0,0,.92); display: flex;
    align-items: center; justify-content: center;
    cursor: zoom-out; touch-action: pan-y;
}
#care-photo-viewer img {
    max-width: 92%; max-height: 80%; border-radius: 0.8rem;
    user-select: none; -webkit-user-drag: none;
}
#care-photo-viewer .cpv-counter {
    position: absolute; top: 2.2rem; left: 0; right: 0;
    text-align: center; color: #fff; font-size: calc(1.4rem * var(--fs));
    text-shadow: 0 1px 0.4rem rgba(0,0,0,.6);
}
#care-photo-viewer .cpv-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 4rem; height: 4rem; border-radius: 50%; border: none;
    background: rgba(0,0,0,.5); color: #fff; font-size: calc(1.6rem * var(--fs));
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#care-photo-viewer .cpv-prev { left: 1.2rem; }
#care-photo-viewer .cpv-next { right: 1.2rem; }

/* ==================== 主题编辑页 ==================== */
/* 主题卡片是主题色板本身，固定浅色底板 + 深色文字，任何主题预览下都清晰可读 */
.theme-card {
    display: flex; align-items: center; gap: 1.2rem;
    border: 2px solid #E2E8F0; border-radius: 1.2rem;
    padding: 1.2rem 1.4rem; cursor: pointer; transition: all .2s;
    background: #FFFFFF;
}
.theme-card.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb),.08);
}
.theme-card .tc-preview { display: flex; gap: 0.5rem; flex-shrink: 0; }
.theme-card .tc-dot {
    width: 1.8rem; height: 1.8rem; border-radius: 50%;
    border: 2px solid rgba(0,0,0,.06); box-sizing: border-box;
}
.theme-card .tc-info { flex: 1; min-width: 0; }
.theme-card .tc-name { font-size: calc(1.4rem * var(--fs)); font-weight: 600; color: #264653; }
.theme-card .tc-desc { font-size: calc(1.2rem * var(--fs)); color: #6B7B8C; margin-top: 2px; }
.theme-card .tc-check {
    font-size: calc(1.8rem * var(--fs)); color: #CBD5E0; flex-shrink: 0;
    transition: color .2s;
}
.theme-card.active .tc-check { color: var(--primary); }

/* 字体/背景色块选择器 */
.te-swatches { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.6rem; }
.te-swatch {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    cursor: pointer; padding: 0.8rem 0.8rem 0.6rem; border-radius: 1rem;
    border: 2px solid transparent; min-width: 6rem; flex-shrink: 0;
    transition: all .15s;
}
.te-swatch:active { transform: scale(.95); }
.te-swatch.active { border-color: var(--primary); background: rgba(var(--primary-rgb),.08); }
.te-sw-chip {
    width: 2.8rem; height: 2.8rem; border-radius: 50%;
    border: 2px solid rgba(0,0,0,.1); box-shadow: 0 1px 0.3rem rgba(0,0,0,.12);
    box-sizing: border-box;
}
.te-sw-label { font-size: calc(1.1rem * var(--fs)); color: var(--text); text-align: center; white-space: nowrap; }

/* ==================== 评价标签多选 ==================== */
#order-actions { display: flex; flex-direction: column; gap: 1rem; }
.eval-tag {
    padding: 0.6rem 1.3rem; border-radius: 1.6rem;
    border: 1px solid var(--border); background: var(--card-bg);
    font-size: calc(1.3rem * var(--fs)); color: var(--text-light);
    cursor: pointer; user-select: none; transition: all .15s;
}
.eval-tag:active { transform: scale(.95); }
.eval-tag.active {
    border-color: var(--primary); color: var(--primary);
    background: rgba(var(--primary-rgb),.1); font-weight: 600;
}

/* ==================== 支付方式底部弹层 ==================== */
#pay-sheet-mask {
    position: fixed; inset: 0; z-index: 10002;
    background: rgba(0,0,0,.45);
    display: flex; align-items: flex-end; justify-content: center;
    animation: fadeIn .18s ease;
}
.pay-sheet {
    width: 100%; background: var(--card-bg);
    border-radius: 1.8rem 1.8rem 0 0;
    padding: 1.8rem 1.6rem calc(2rem + env(safe-area-inset-bottom));
    animation: sheetUp .22s ease;
}
.pay-sheet-title { text-align: center; font-size: calc(1.6rem * var(--fs)); font-weight: 700; color: var(--text); }
.pay-sheet-amount { text-align: center; font-size: calc(1.3rem * var(--fs)); color: var(--text-light); margin: 0.6rem 0 1.4rem; }
.pay-sheet-amount b { color: var(--danger); font-size: calc(2rem * var(--fs)); margin-left: 0.4rem; }
.pay-method {
    display: flex; align-items: center; gap: 1.2rem;
    padding: 1.2rem 1.4rem; border: 1px solid var(--border); border-radius: 1.2rem;
    margin-bottom: 1rem; cursor: pointer; transition: background .15s;
}
.pay-method:active { background: var(--bg); }
.pay-method-icon {
    width: 3.8rem; height: 3.8rem; border-radius: 1rem; flex-shrink: 0;
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: calc(1.9rem * var(--fs)); font-weight: 700;
}
.pay-method-name { flex: 1; min-width: 0; font-size: calc(1.5rem * var(--fs)); font-weight: 600; color: var(--text); }
.pay-method-name small { display: block; font-size: calc(1.2rem * var(--fs)); color: var(--text-light); font-weight: 400; margin-top: 2px; }
.pay-method-badge {
    font-size: calc(1.1rem * var(--fs)); color: #fff; background: var(--primary);
    padding: 2px 0.9rem; border-radius: 1rem; flex-shrink: 0;
}
.pay-method-tag {
    font-size: calc(1.2rem * var(--fs)); color: var(--primary); border: 1px solid var(--primary);
    padding: 2px 0.9rem; border-radius: 1rem; flex-shrink: 0;
}

/* ==================== 第三方支付渠道行（账单报告内） ==================== */
.pay-channel {
    display: flex; align-items: center; gap: 1.2rem;
    padding: 1.1rem 1.4rem; border: 1px solid var(--border); border-radius: 1.2rem;
    margin-bottom: 0.8rem; cursor: pointer; transition: background .15s;
}
.pay-channel:active { background: var(--bg); }
.pay-channel-icon {
    width: 3.4rem; height: 3.4rem; border-radius: 0.9rem; flex-shrink: 0;
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: calc(1.7rem * var(--fs)); font-weight: 700;
}
.pay-channel-name { flex: 1; font-size: calc(1.4rem * var(--fs)); font-weight: 600; color: var(--text); }
.pay-channel-go { color: var(--text-light); font-size: calc(1.8rem * var(--fs)); flex-shrink: 0; }

/* ==================== 主页装饰编辑页 ==================== */
.decor-tabs {
    display: flex; background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}
.decor-tab {
    flex: 1; text-align: center; padding: 1.1rem 0;
    font-size: calc(1.4rem * var(--fs)); color: var(--text-light);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.decor-tab.active {
    color: var(--primary); font-weight: 600;
    border-bottom-color: var(--primary);
}
.decor-pane-theme, .decor-pane-home, .decor-pane-icons { padding-top: 2px; }

/* ==================== 图标装饰页面 ==================== */
.icons-layout {
    display: flex; flex-direction: column;
    gap: 0; min-height: calc(100vh - 18rem);
}
/* 左侧：目标列表 */
.icons-targets {
    background: var(--card-bg); border-bottom: 1px solid var(--border);
    padding: 1.2rem 1.6rem;
    max-height: 40vh; overflow-y: auto;
}
.icons-targets-title {
    font-size: calc(1.2rem * var(--fs)); color: var(--text-light);
    font-weight: 600; letter-spacing: 0.5px;
    margin-bottom: 0.8rem; text-transform: uppercase;
}
.icons-scope-group { margin-bottom: 1rem; }
.icons-scope-label {
    font-size: calc(1.1rem * var(--fs)); color: var(--text-light);
    padding: 0.4rem 0 0.6rem 0; font-weight: 600;
}
.icon-target-row {
    display: flex; align-items: center; gap: 1.2rem;
    padding: 1rem 1.2rem; border-radius: 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.icon-target-row:hover { background: var(--bg); }
.icon-target-row.active {
    background: var(--primary-bg, rgba(46,124,246,0.1));
    border-color: var(--primary);
}
.icon-target-preview {
    width: 4rem; height: 4rem; border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--primary);
    flex-shrink: 0; font-size: calc(2rem * var(--fs));
    overflow: hidden;
}
.icon-target-preview svg { width: 2.4rem; height: 2.4rem; }
.icon-target-info { flex: 1; min-width: 0; }
.icon-target-label { font-size: calc(1.4rem * var(--fs)); font-weight: 500; color: var(--text); }
.icon-target-hint { font-size: calc(1.1rem * var(--fs)); color: var(--text-light); margin-top: 2px; }
.icon-target-chevron {
    color: var(--text-light); font-size: calc(1.8rem * var(--fs)); flex-shrink: 0;
}

/* 右侧：图标面板 */
.icons-panel {
    flex: 1; display: flex; flex-direction: column;
    min-height: 0; background: var(--card-bg);
}
.icons-panel-header {
    display: flex; align-items: center; gap: 1.2rem;
    padding: 1.2rem 1.6rem; border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.icons-type-switch { display: flex; gap: 0.4rem; background: var(--bg); border-radius: 0.8rem; padding: 0.3rem; }
.icons-type-btn {
    padding: 0.6rem 1.2rem; border: none; background: transparent;
    border-radius: 0.6rem; font-size: calc(1.2rem * var(--fs)); color: var(--text-light);
    cursor: pointer; display: flex; align-items: center; gap: 0.4rem;
    transition: all 0.15s;
}
.icons-type-btn.active {
    background: var(--card-bg); color: var(--primary);
    box-shadow: 0 1px 0.3rem rgba(0,0,0,0.08); font-weight: 600;
}
.icons-search-wrap {
    flex: 1; min-width: 14rem; position: relative;
    display: flex; align-items: center;
}
.icons-search-wrap svg {
    position: absolute; left: 1rem; color: var(--text-light);
}
.icons-search {
    width: 100%; padding: 0.8rem 1.2rem 0.8rem 3rem;
    border: 1px solid var(--border); border-radius: 0.8rem;
    font-size: calc(1.3rem * var(--fs)); background: var(--bg); color: var(--text);
    outline: none; transition: border-color 0.15s;
}
.icons-search:focus { border-color: var(--primary); }

/* 分类标签 */
.icons-svg-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.icons-groups {
    display: flex; flex-wrap: wrap; gap: 0.6rem;
    padding: 1rem 1.6rem; border-bottom: 1px solid var(--border);
}
.icons-group-btn {
    padding: 0.5rem 1.1rem; font-size: calc(1.2rem * var(--fs)); border: 1px solid var(--border);
    border-radius: 1.4rem; background: transparent; color: var(--text-light);
    cursor: pointer; transition: all 0.15s; white-space: nowrap; word-break: keep-all; flex-shrink: 0;
}
.icons-group-btn.active {
    background: var(--primary); border-color: var(--primary);
    color: #fff; font-weight: 600;
}

/* SVG 网格 */
.icons-grid {
    flex: 1; overflow-y: auto; padding: 0.8rem 1.4rem 1.6rem;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem; align-content: start;
}
.icons-cell {
    aspect-ratio: 1; border: 1px solid var(--border);
    border-radius: 0.8rem; background: transparent;
    display: flex; align-items: center; justify-content: center;
    color: var(--text); cursor: pointer; padding: 0;
    transition: all 0.15s;
    overflow: hidden;
}
.icons-cell svg { width: 70%; height: 70%; flex-shrink: 0; }
.icons-cell:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.06); }
.icons-cell.active {
    border-color: var(--primary); background: var(--primary-bg, rgba(46,124,246,0.1));
    color: var(--primary);
}
.icons-cell.emoji { font-size: calc(2.2rem * var(--fs)); border-radius: 0.8rem; }
.icons-empty { grid-column: 1 / -1; text-align: center; color: var(--text-light); font-size: calc(1.3rem * var(--fs)); padding: 2rem; }

/* Emoji 网格 */
.icons-emoji-panel { flex: 1; overflow-y: auto; }
.icons-emoji-grid {
    display: grid; padding: 1rem 1.4rem 2rem;
    grid-template-columns: repeat(7, 1fr); gap: 0.4rem;
}
.icons-emoji-grid .icons-cell {
    aspect-ratio: 1; font-size: calc(2.2rem * var(--fs));
    border-radius: 0.6rem; border: none; background: transparent;
}
.icons-emoji-grid .icons-cell:hover { background: var(--bg); transform: scale(1.15); }

/* 横屏 / 宽屏适配：布局改为左右分栏 */
@media (min-width: 33.75rem) {
    .icons-layout {
        flex-direction: row; gap: 0;
    }
    .icons-targets {
        width: 22rem; max-height: none; border-right: 1px solid var(--border);
        border-bottom: none; flex-shrink: 0;
    }
    .icons-grid { grid-template-columns: repeat(7, 1fr); }
    .icons-emoji-grid { grid-template-columns: repeat(10, 1fr); }
}
.home-decor-section { margin-top: 1.4rem; }
.home-decor-section:first-of-type { margin-top: 0; }

/* ==================== FAB 悬浮保存按钮 ==================== */
.decor-fab {
    position: fixed;
    right: 1.6rem;
    bottom: 10rem;  /* 避开底部 tab-bar */
    z-index: 50;
}
.fab-main {
    width: 5.2rem; height: 5.2rem; border-radius: 50%;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    box-shadow: 0 0.4rem 1.4rem rgba(0,0,0,.25);
    transition: transform .15s, box-shadow .15s;
}
.fab-main:hover { transform: scale(1.08); box-shadow: 0 0.6rem 2rem rgba(0,0,0,.3); }
.fab-main:active { transform: scale(0.95); }

.fab-menu {
    position: absolute;
    right: 6rem;
    bottom: 0;
    display: flex; flex-direction: column; gap: 0.8rem;
    padding: 0.8rem;
    background: var(--card-bg);
    border-radius: 1.2rem;
    box-shadow: 0 0.4rem 2rem rgba(0,0,0,.18);
    border: 1px solid var(--border);
}
.fab-item {
    border: none; background: var(--bg);
    padding: 0.8rem 1.6rem; border-radius: 0.8rem;
    font-size: calc(1.3rem * var(--fs)); color: var(--text);
    cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s;
}
.fab-item:hover { background: var(--primary); color: #fff; }

/* 裁剪弹窗中的宽高比按钮 */
.crop-ratio-btn {
    border: 1px solid var(--border);
    background: transparent;
    padding: 0.6rem 1.2rem; font-size: calc(1.2rem * var(--fs));
    border-radius: 1.4rem; cursor: pointer;
    color: var(--text-light);
    transition: all .15s;
}
.crop-ratio-btn.active {
    background: var(--primary); color: #fff;
    border-color: var(--primary); font-weight: 600;
}

/* 金刚区编辑配置区 */
.icons-quick-edit {
    border-top: 1px dashed var(--border);
    padding-top: 1rem;
}

/* 金刚区图标选择行：SVG预览 + 图标select + 文字input + 跳转select */
.hq-icon-picker {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.hq-icon-picker:last-child { border-bottom: none; }
.hq-icon-preview {
    width: 4.6rem; height: 4.6rem; border-radius: 1.4rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(var(--primary-rgb),.1); color: var(--primary);
}
.hq-icon-preview svg { width: 2.5rem; height: 2.5rem; }
.hq-fields { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.hq-fields .form-input { font-size: calc(1.3rem * var(--fs)); padding: 0.8rem 1rem; }

/* 标签编辑器：chips + 输入框 */
.tag-editor .te-tags { display: flex; flex-wrap: wrap; gap: 0.7rem; min-height: 3.2rem; }
.te-tag-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(var(--primary-rgb),.1); color: var(--primary);
    border-radius: 0.8rem; padding: 0.5rem 1rem; font-size: calc(1.2rem * var(--fs));
}
.te-tag-chip i { cursor: pointer; opacity: .6; font-size: calc(1.1rem * var(--fs)); }
.te-tag-chip i:active { opacity: 1; }

/* 商城商品编辑行：图片列 + 名称/特点/配色列 */
.mall-item-row {
    display: flex; gap: 1rem; padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.mall-item-row:last-child { border-bottom: none; }
.mall-img-cell {
    width: 6.4rem; flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.mall-img-cell img {
    width: 6rem; height: 6rem; border-radius: 1rem;
    background: var(--bg); object-fit: contain;
}
.mall-img-cell .btn { font-size: calc(1.1rem * var(--fs)); padding: 0.3rem 0.6rem; }
.mall-fields { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.mall-fields .form-input { font-size: calc(1.3rem * var(--fs)); padding: 0.8rem 1rem; }

/* 首页预览（独立页面 #page-home-preview）：内容 1:1 渲染，与真实首页完全同比例 */
.preview-home { padding: 1.2rem; background: var(--bg); }
.preview-home .home-hero { margin: 0 0 1.2rem; }
.preview-home .home-quick { margin: 0 0 1.2rem; }
.preview-home .home-duo { margin: 0 0 1.2rem; }
.preview-home .hm-card { min-height: 10.4rem; }  /* 与真实首页一致：高度随内容自适应，价格行不被压没 */
/* 预览页可编辑图片：透明边框扩大触摸热区（四周 +1.4rem），解决小图拖拽焦点难获取 */
#home-preview-body img {
    border: 1.4rem solid transparent; box-sizing: content-box;
    touch-action: none; cursor: grab;
    user-select: none; -webkit-user-drag: none;
}
