/* ============================================================
   秉棠云E通 prototype/v2 · 灰阶设计系统（重做版）
   SSOT: docs/10 §3 + prototype/spec/calibration.md（主会话锁定）
   变更纪律: 改此文件先改校准表；页面只消费类名，不写魔法数值
   ============================================================ */

:root {
  /* 文本灰度 3 级（全 ≥4.5:1, AA）——校准表 §1.2 */
  --ink: #1A1A1A;   /* 一级: 标题/价格/状态关键词 (16.7:1) */
  --mid: #595959;   /* 二级: 正文/说明 (7.0:1) */
  --sub: #767676;   /* 三级: 时间戳/占位/元数据 (4.5:1) */

  /* 背景与线（灰阶背景, 非文本灰度档） */
  --bg: #FFFFFF;
  --bg-tint: #F5F5F7;   /* 分区底/次级卡底 */
  --line: #E5E5E8;      /* 描边 */
  --fill: #EDEDEF;      /* 占位块/图标底 */

  /* 间距 SP 令牌 {8,16,24,32,48} —— 校准表 §1.1 */
  --sp-1: 8px;  --sp-2: 16px; --sp-3: 24px; --sp-4: 32px; --sp-5: 48px;
  --page-pad: var(--sp-2);      /* 页边距 = 16（三层默认统一） */

  /* 字号阶梯 32/24/18/16/14/12 —— 校准表 §1.2 */
  --fs-price: 32px; --fs-h1: 24px; --fs-h2: 18px;
  --fs-body: 16px;  --fs-sub: 14px; --fs-cap: 12px;

  /* 圆角一族: 8px 按钮卡片 / 12px 头像图块 / 胶囊=高一半 */
  --r-btn: 8px; --r-block: 12px;

  --tap: 44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--line);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); font-size: var(--fs-body); line-height: 1.5;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--sp-3) var(--sp-2); gap: var(--sp-1);
}

/* ---- 手机画布（原型壳, 非产品） ---- */
.phone {
  width: 390px; min-height: 844px; background: var(--bg);
  border: 2px solid var(--mid); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.screen { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

/* 原型工具条（客群切换/索引, 独立于画布——docs/10 §6#7 整改） */
.proto-bar {
  width: 390px; display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-cap); color: var(--sub); white-space: nowrap;
}
.proto-bar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.proto-bar a { color: var(--sub); }
.proto-bar .seg { display: flex; border: 1px solid var(--mid); border-radius: var(--r-btn); overflow: hidden; }
.proto-bar .seg button {
  border: 0; background: var(--bg); color: var(--mid); white-space: nowrap;
  font-size: var(--fs-cap); padding: 4px var(--sp-2); cursor: pointer;
}
.proto-bar .seg button.on { background: var(--ink); color: #fff; }
.proto-note { width: 390px; font-size: var(--fs-cap); color: var(--sub); }

/* 客群开关: body[data-segment] 驱动（导航结构跨客群稳定=结构不变内容裁剪）
   P4 终审根治: revert 对 button/a 返回 UA inline 会破坏 flex 布局——
   隐藏仍用 display:none, 显示态按控件族显式恢复（覆盖全部现有用法） */
.s1-only, .s2-only { }
[data-segment="s2"] .s1-only { display: none !important; }
[data-segment="s1"] .s2-only { display: none !important; }
[data-segment="s1"] .s1-only { display: block; }
[data-segment="s2"] .s2-only { display: block; }
[data-segment="s1"] .row.s1-only, [data-segment="s2"] .row.s2-only,
[data-segment="s1"] a.s1-only, [data-segment="s2"] a.s2-only,
[data-segment="s1"] button.s1-only, [data-segment="s2"] button.s2-only { display: flex; }
[data-segment="s1"] .card.s1-only, [data-segment="s2"] .card.s2-only,
[data-segment="s1"] section.s1-only, [data-segment="s2"] section.s2-only,
[data-segment="s1"] article.s1-only, [data-segment="s2"] article.s2-only,
[data-segment="s1"] div.s1-only, [data-segment="s2"] div.s2-only { display: flex; flex-direction: column; }
[data-segment="s1"] span.s1-only, [data-segment="s2"] span.s2-only { display: inline-flex; align-items: center; }

/* ---- 标注点（编号圆点, 实现备注的唯一合法载体——docs/10 §2 铁律2） ---- */
.ann {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--fill); color: var(--mid);
  font-size: 11px; vertical-align: 2px; margin-left: 2px; cursor: help;
}

/* ---- 顶栏 / 底栏 ---- */
.appbar {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: 56px; padding: var(--sp-1) var(--page-pad);
  border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.appbar .ttl { font-size: var(--fs-h2); font-weight: 700; }
.appbar .sp { flex: 1; }
.appbar .back { font-size: var(--fs-h2); color: var(--ink); text-decoration: none; padding: 0 var(--sp-1); min-height: var(--tap); display: inline-flex; align-items: center; }

.searchbox {
  flex: 1; display: flex; align-items: center; min-height: 40px;
  background: var(--bg-tint); border: 1px solid var(--line);
  border-radius: 20px; padding: 0 var(--sp-2);
  color: var(--sub); font-size: var(--fs-sub);
}
/* 可点 searchbox（a 元素形态）40px 视觉高保留主流输入惯例, ::after 上下各扩 2px 补足 44 触控
   （与 tabs--sub 热区策略同族; metrics M6 闸 2026-11-24 抓出） */
a.searchbox { position: relative; text-decoration: none; }
a.searchbox::after { content: ""; position: absolute; inset: -2px 0; }

.tabbar { display: flex; border-top: 1px solid var(--line); background: var(--bg); position: sticky; bottom: 0; z-index: 10; }
.tabbar a {
  flex: 1; min-height: 60px; padding: var(--sp-1) 0 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--sub); font-size: var(--fs-cap); text-decoration: none;
}
.tabbar a.on { color: var(--ink); font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---- 页面内容区: 区块间 32, 组间 24（校准表 §1.1 三级递变） ---- */
.body { padding: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-2); }
.sect { display: flex; flex-direction: column; gap: var(--sp-1); }        /* 区块=sect, 区块间用 .body>gap+margin */
.body > .sect { margin-bottom: var(--sp-2); }                              /* 区块间 32 = 16gap+16margin */
.sect-ttl { font-size: var(--fs-body); font-weight: 700; color: var(--ink); display: flex; align-items: baseline; gap: var(--sp-1); }
.sect-ttl .more { margin-left: auto; font-weight: 500; font-size: var(--fs-body); color: var(--mid); text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; }   /* 触控 44（metrics 闸） */

/* ---- 卡片 ---- */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-block);
  padding: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-1);
}
.card.tint { background: var(--bg-tint); border-color: var(--bg-tint); }
/* 分组容器（gestalt proximity 范式）: 相关卡片收进同一灰底组,
   组内间距 8 = 成组而非粘连; 组与外界 24/32 正常区块距 */
.group {
  background: var(--bg-tint); border-radius: var(--r-block);
  padding: var(--sp-1); display: flex; flex-direction: column; gap: var(--sp-1);
}
.group .card { border-color: var(--line); }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row .sp { flex: 1; min-width: 0; }
/* .sp 弹性语义全局化（2026-11-23 对齐缺陷根治: 原 .row .sp 只覆盖 .row 容器,
   列表行 .row-item / 订单卡头 .order-head 里的 .sp 宽度为 0, 右锚全部失效——
   messages 时间三行三位置 / profile 箭头四行四位置 / orders 卡头徽章同染。
   语义=凡用 .sp 即弹性占位推末项右锚, 与容器类名解耦） */
.sp { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--sp-1); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }

/* ---- 文本角色（字重×灰度矩阵, 校准表 §1.2） ---- */
.t-price { font-size: var(--fs-price); font-weight: 700; }
.t-h1 { font-size: var(--fs-h1); font-weight: 700; }
.t-h2 { font-size: var(--fs-h2); font-weight: 700; }
.t-main { font-size: var(--fs-body); font-weight: 500; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.t-body { font-size: var(--fs-body); font-weight: 400; color: var(--mid); }
.t-sub { font-size: var(--fs-sub); font-weight: 400; color: var(--sub); }
.t-cap { font-size: var(--fs-cap); font-weight: 400; color: var(--sub); }
.t-h2m { font-size: var(--fs-h2); font-weight: 500; color: var(--ink); }   /* 标题 Medium 档（卡片标题: travel 线路名/community 帖题） */
.t-ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- 按钮三级体系（校准表 §1.3） ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; white-space: nowrap; border: 0;
}
.btn-primary {
  min-height: 48px; border-radius: var(--r-btn); padding: 0 var(--sp-3);
  background: var(--ink); color: #fff; font-size: var(--fs-h2); font-weight: 700;
}  /* 每屏 ≤1, 禁用于列表卡内 */
.btn-secondary {
  position: relative;
  min-height: 40px; border-radius: var(--r-btn); padding: 0 var(--sp-2);
  border: 1px solid var(--mid); background: transparent; color: var(--ink);
  font-size: var(--fs-body); font-weight: 500;
}  /* 卡片级, 每卡 ≤1 */
.btn-secondary::after { content: ""; position: absolute; inset: -2px; }   /* 热区扩至 ≥44 */
.btn-link {
  min-height: var(--tap); display: inline-flex; align-items: center; gap: 2px;
  background: none; border: 0; color: var(--ink); font-size: var(--fs-body); font-weight: 500;
  text-decoration: none; padding: 0 var(--sp-1); cursor: pointer;
}
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn-disabled {
  background: var(--fill); color: var(--mid); border: 0;
}  /* 禁用态必须带原因文案（防错） */

/* ---- chips（筛选/选择态用, 不常驻装饰） ---- */
.chips { display: flex; gap: var(--sp-1); overflow-x: auto; padding-bottom: 2px; }

/* ---- 横滑区滚动条隐藏（2026-11-23 用户反馈①: 手机无滚动条, PC 浏览器显示滚动条=原型壳噪音;
      保留滑动能力只隐藏滚动条, 全站横滑件(chips/hscroll/hdays/mini-chips)统一生效） ---- */
.chips::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .hdays::-webkit-scrollbar, .mini-chips::-webkit-scrollbar { display: none; }
.chips, .hscroll, .hdays, .mini-chips { scrollbar-width: none; -ms-overflow-style: none; }
.chip {
  position: relative;
  min-height: 36px; padding: 0 var(--sp-2); border-radius: 18px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--mid); font-size: var(--fs-sub);
  display: inline-flex; align-items: center; gap: var(--sp-1);
  background: var(--bg); cursor: pointer;
}
.chip::after { content: ""; position: absolute; inset: -4px; }   /* 触控热区扩至 ≥44（校准表 §1.3） */
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }

/* ---- 徽章（合规标识灰阶形态） ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: var(--fs-cap); color: var(--mid);
  border: 1px solid var(--line); border-radius: var(--r-btn);
  padding: 2px var(--sp-1); background: var(--bg-tint);
}
.badge.strong { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.dash { border-style: dashed; }

/* ---- 列表行（校准表 §1.4: 行高72/头像48/主副各1行） ---- */
.row-item {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: 72px; padding: var(--sp-1) 0; border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.avatar { width: 48px; height: 48px; border-radius: var(--r-block); flex: none; }

/* ---- 占位（诚实灰块+标签） ---- */
.ph {
  background: var(--fill); border-radius: var(--r-btn);
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-size: var(--fs-cap); text-align: center; overflow: hidden;
}
.ph.img { width: 100%; aspect-ratio: 16 / 9; }   /* S4: 图文卡图片区全站统一比例族 */
.ph.big { height: 140px; font-size: var(--fs-sub); }

/* ---- 订单卡四段式（校准表 §1.4: 头行→信息行→价格行→操作行） ---- */
.order-head { display: flex; align-items: center; gap: var(--sp-2); }
.order-info { display: flex; flex-direction: column; gap: 4px; }
.order-ops { display: flex; justify-content: flex-end; gap: var(--sp-1); }

/* ---- 时间线 ---- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: var(--sp-2); position: relative; padding-bottom: var(--sp-3); }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 3px; background: var(--bg); border: 2px solid var(--line); z-index: 1; }
.tl-item.done .tl-dot, .tl-item.cur .tl-dot { background: var(--ink); border-color: var(--ink); }
.tl-item.cur .tl-dot { box-shadow: 0 0 0 3px var(--fill); }

/* ---- 表单 ---- */
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field > label { font-size: var(--fs-body); font-weight: 700; }
.select-line {
  min-height: var(--tap); border: 1px solid var(--line); border-radius: var(--r-btn);
  padding: 0 var(--sp-2); display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-body); color: var(--ink);
}
.select-line.placeholder { color: var(--sub); }

/* ---- 服务边界提示条（docs/10 §2 铁律4: 一行短句+须知›, 禁大段落） ---- */
.boundary {
  border-top: 1px solid var(--line); background: var(--bg-tint);
  padding: var(--sp-1) var(--page-pad);
  display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-cap); color: var(--mid);
}
.boundary .t-ellipsis { flex: 1; }
.boundary a { color: var(--mid); white-space: nowrap; }

/* ---- 底部操作栏 ---- */
.paybar {
  border-top: 1px solid var(--line); background: var(--bg);
  padding: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2);
  position: sticky; bottom: 0;
}

/* ---- 步骤指示 ---- */
.steps { display: flex; gap: var(--sp-1); font-size: var(--fs-cap); color: var(--sub); }
.steps .on { color: var(--ink); font-weight: 700; }

/* ---- FAB（社区发布） ---- */
.fab {
  position: absolute; right: var(--sp-2); bottom: 84px; z-index: 5;
  min-height: 48px; padding: 0 var(--sp-3); border-radius: 24px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: var(--fs-body); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* ---- 空态 ---- */
.empty { padding: var(--sp-5) var(--sp-2); text-align: center; color: var(--sub); font-size: var(--fs-sub); }

/* ============================================================
   复用收敛批（2026-11-23）：原 10 页页内重复定义上收共享层
   依据: 文件头 SSOT 纪律「页面只消费类名」；形态差异保留为变体
   ============================================================ */

:root {
  --appbar-h: 56px;          /* Tab sticky 锚依赖 appbar 高度（原各页裸写 56px） */
  --ink-inverse-sub: #E5E5E8; /* 深底卡反白副行专用档（hero .t-sub; 审计 P2: 勿再借用 --line 当文本色, 令牌语义分离） */
}

/* ---- 公共页面规则（原 10 页 <head> 各复制一份 → 收编） ---- */
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; width: 24px; height: 24px; flex: none; }
.badge svg { width: 16px; height: 16px; }
.back svg { width: 22px; height: 22px; }
.btn-link { white-space: nowrap; }
.card.row { flex-direction: row; }
.appbar > * { flex: none; }
.appbar { min-height: var(--appbar-h); }
.appbar .searchbox { flex: 1; min-width: 0; }
.searchbox > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[hidden] { display: none !important; }
.col { display: flex; flex-direction: column; min-width: 0; }
.screen { min-height: 0; }
.phone { height: 844px; }   /* 固定高: sticky bottom 件计算依赖 */

/* ---- 提示弹条（原 8 页重复；bottom 因各页吸底组合不同, 页内一行覆写） ---- */
.notice {
  position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: 96px; z-index: 30;
  background: var(--ink); color: #fff; border-radius: var(--r-btn);
  padding: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2);
}
.notice .btn-link { color: #fff; min-height: 0; }

/* ---- Tab 切换器组件族（原 messages/orders/profile/community 四处各自定义）
     形态差异是业务合理的（S10 两轴分离 + 消息等分/订单左排品类惯例）,
     代码收敛为 基类+变体: ---- */
/* 基类: 左排 · 下划线选中（单轴内容分类, 电商订单线惯例） */
.tabs { display: flex; gap: var(--sp-3); border-bottom: 1px solid var(--line); background: var(--bg); }
.tabs > button, .tabs > a {
  border: 0; background: none; cursor: pointer; padding: var(--sp-1) 0;
  min-height: var(--tap);   /* 触控 ≥44（适老断言 A13; 2026-11-23 metrics 闸抓出 39px 违例后补） */
  color: var(--mid); font-size: var(--fs-body); font-weight: 500;
  text-decoration: none; border-bottom: 2px solid transparent;
}
.tabs > button.on, .tabs > a.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
/* 变体: sticky 钉 appbar 下沿（滚动常驻, 列表页用） */
.tabs--sticky { position: sticky; top: var(--appbar-h); z-index: 5; }
/* 变体: 等分居中（消息三分类, chat-list 惯例; 隐含 sticky 锚） */
.tabs--split { gap: 0; position: sticky; top: var(--appbar-h); z-index: 5; }
.tabs--split > button, .tabs--split > a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: var(--tap); }
/* 变体: 二级轻 Tab（社区内容类型; S10 两轴权重分离: 小一号降灰无底线, 裁决#7） */
.tabs--sub { border-bottom: 0; }
.tabs--sub > button, .tabs--sub > a {
  font-size: var(--fs-sub); color: var(--sub);
  position: relative;
}
/* 横向热区补足: 二级 Tab 字短(「推荐」仅 28px 宽), ::after 左右各扩 8px 达 44 触控（审计 P1 修复, 与 chips 热区策略同族） */
.tabs--sub > button::after, .tabs--sub > a::after { content: ""; position: absolute; inset: 0 -8px; }
.tabs--sub > button.on, .tabs--sub > a.on { color: var(--ink); }
/* 未读角标（消息分类行内计数） */
.cnt {
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---- 浏览列表 chips 描边选中态（orders/community/travel 三页重复覆写收编;
     语义=浏览橱窗 0 实心件, 实心保留给每页唯一主动作） ---- */
.chips.outline .chip.on { background: var(--bg); color: var(--ink); border-color: var(--ink); font-weight: 700; }

/* ---- 就诊人家人卡组件族（orders/home/booking 三页复用, 组件单源防「三页三排版」;
     2026-11-23 用户裁定: 陪诊=给家人下单, 家人卡是第一视觉主体;
     2026-11-24 升格为首页主轴——位置以家人为准, 下单=选人后带出就医位置） ---- */
.fam { display: flex; gap: var(--sp-2); overflow-x: auto; }
.famcard {
  flex: none; width: 96px; min-height: 96px;
  border: 1px solid var(--line); border-radius: var(--r-block); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; padding: var(--sp-1); text-decoration: none; color: inherit;
  position: relative;
}
.famcard .avatar { width: 44px; height: 44px; }
.famcard .fname { font-size: var(--fs-sub); font-weight: 500; color: var(--mid); }
.famcard.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.famcard.on .fname { color: var(--ink); font-weight: 700; }
/* 名下订单数徽章：右上角小圆点（待办语义） */
.famcard .fnum {
  position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--fill); color: var(--mid); font-size: var(--fs-cap);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.famcard.on .fnum { background: var(--ink); color: #fff; }
/* 常驻城市/医院行（首页家人轴专用: 就医位置是家人档案属性, 非 GPS 语义） */
.famcard .fcity { font-size: var(--fs-cap); color: var(--sub); max-width: 84px; }
.famcard.on .fcity { color: var(--mid); }

/* ===== H5 全屏模式（build-deploy 注入, 工程版不含）: 去原型手机壳, 内容铺满真实视口 ===== */
body { padding: 0; gap: 0; background: var(--bg); }
.phone {
  width: 100%; max-width: none; height: auto; min-height: 100vh; min-height: 100dvh;
  border: 0; border-radius: 0; overflow: visible;
}
.screen { overflow: visible; }
.notice { position: fixed; }   /* 弹条改视口吸底（壳去除后 absolute 会沉文档底看不见） */
