/* 中医药健康管理系统 */
:root {
  --ink: #0e2f28;
  --ink-2: #16453a;
  --ink-3: #1f5a4b;
  --paper: #f7f4ee;
  --card: #ffffff;
  --line: #e6e0d4;
  --text: #23291f;
  --muted: #7c8479;
  --gold: #b9924f;
  --gold-soft: #f0e5cf;
  --red: #b3402f;
  --red-soft: #fbeae6;
  --green: #2f7a5f;
  --green-soft: #e6f3ec;
  --blue: #2f6f9e;
  --blue-soft: #e6eff6;
  --amber: #a9761b;
  --amber-soft: #fbf1dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 34, .05), 0 12px 28px -18px rgba(20, 40, 34, .28);
  --sidebar: 224px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--paper);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfc8b9; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录 ---------------- */
#login {
  position: fixed; inset: 0; display: flex; background: var(--ink);
  z-index: 50;
}
#login.hide { display: none; }
.login-brand {
  flex: 1.15; position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 15% 10%, #1d5a49 0%, #0e2f28 55%, #081f1a 100%);
  display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(40px, 6vw, 96px);
  color: #f2ede1;
}
.login-brand::after {
  content: ""; position: absolute; right: -160px; bottom: -160px; width: 460px; height: 460px;
  border-radius: 50%; border: 1px solid rgba(185, 146, 79, .35);
  box-shadow: 0 0 0 60px rgba(185, 146, 79, .05), 0 0 0 130px rgba(185, 146, 79, .04);
}
.login-brand .seal {
  width: 64px; height: 64px; border-radius: 14px; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
  letter-spacing: 2px; box-shadow: 0 10px 24px -10px rgba(179, 64, 47, .9); margin-bottom: 28px;
  overflow: hidden; box-sizing: border-box;
}
/* 自定义品牌标识：白底衬底，保持正方形内完整显示 */
.login-brand .seal.has-logo { background: #fff; padding: 4px; }
.login-brand .seal img, aside .brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-brand h1 { font-size: clamp(26px, 2.4vw, 38px); line-height: 1.35; margin: 0 0 14px; font-weight: 600; letter-spacing: 1px; }
.login-brand p { color: #b9c6bd; line-height: 2; margin: 0; max-width: 620px; font-size: 14px; }
.login-brand .meta { margin-top: 46px; display: flex; gap: 30px; color: #8fa79c; font-size: 13px; }
.login-brand .meta b { display: block; color: #e8dcc2; font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-form-wrap { width: 460px; background: var(--paper); display: flex; flex-direction: column; justify-content: center; padding: 0 56px; }
.login-form-wrap h2 { margin: 0 0 6px; font-size: 22px; }
.login-form-wrap .sub { color: var(--muted); margin: 0 0 30px; font-size: 13px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; letter-spacing: .5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; outline: none; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(31, 90, 75, .1); }
/* 单选/复选：不参与输入框 100% 宽度，避免文字被挤成竖排 */
.field input[type=radio], .field input[type=checkbox] {
  width: auto; height: auto; padding: 0; margin: 0; flex: none; accent-color: var(--red);
}
.radio-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 9px 0; }
.radio-row label {
  display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13.5px; font-weight: 400;
  color: var(--text); letter-spacing: 0; white-space: nowrap; cursor: pointer;
}
.check-line {
  display: flex !important; align-items: center; gap: 8px; margin: 0 !important;
  font-size: 13px !important; font-weight: 400 !important; color: var(--text) !important;
  letter-spacing: 0 !important; cursor: pointer; line-height: 1.6;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: #cfc6b4; background: #fbf9f4; }
.btn.primary { background: var(--ink-2); border-color: var(--ink-2); color: #f4efe2; }
.btn.primary:hover { background: var(--ink-3); }
.btn.danger { color: var(--red); border-color: #e8c8c1; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 框架 ---------------- */
#app { display: none; height: 100%; }
#app.on { display: flex; }
aside {
  width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--ink); color: #dfe7e2;
  display: flex; flex-direction: column; position: relative;
}
aside .brand { padding: 22px 15px 18px; display: flex; gap: 9px; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, .07); }
aside .brand .mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
  flex: 0 0 36px; overflow: hidden; box-sizing: border-box;
}
aside .brand .mark.has-logo { background: #fff; padding: 3px; }
aside .brand .brand-text { min-width: 0; }
aside .brand b { display: block; font-size: 14.5px; color: #f3eee1; letter-spacing: .5px;
  line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside .brand em { display: block; font-style: normal; font-size: 11.5px; color: #d8e4dd;
  letter-spacing: .3px; line-height: 1.5; margin-top: 1px; }
aside .brand span { display: block; font-size: 9.5px; color: #86a196; letter-spacing: .28px;
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
nav .grp { font-size: 11px; color: #64817a; letter-spacing: 1.5px; padding: 14px 12px 8px; }
nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #c3d2cb; font-size: 13.5px; margin-bottom: 2px; transition: .15s; position: relative;
}
nav a svg { width: 17px; height: 17px; opacity: .8; }
nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
nav a.active { background: rgba(185, 146, 79, .16); color: #f4e8cd; }
nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
  background: var(--gold); border-radius: 0 3px 3px 0;
}
aside .foot { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11px; color: #6f8c84; letter-spacing: .2px; }
aside .foot div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside .foot .foot-help { display: flex; gap: 6px; margin-bottom: 10px; white-space: normal; overflow: visible; }
aside .foot .foot-help a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 4px; border-radius: 9px; background: rgba(255, 255, 255, .05);
  color: #b9c9c2; font-size: 11.5px; cursor: pointer; transition: .15s;
}
aside .foot .foot-help a:hover { background: rgba(185, 146, 79, .18); color: #f4e8cd; }
aside .foot .foot-help a svg { width: 18px; height: 18px; opacity: .85; }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
header {
  height: 62px; flex: 0 0 62px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 8;
}
header h2 { font-size: 16.5px; margin: 0; font-weight: 600; }
header .crumb { color: var(--muted); font-size: 12.5px; }
header .spacer { flex: 1; }
header .who { display: flex; align-items: center; gap: 9px; font-size: 13px; white-space: nowrap; }
header .who, header .who * { white-space: nowrap; }
header .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink-2); color: #f0e6d2;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px;
}
.content { padding: 20px 22px 40px; overflow-y: auto; flex: 1; }
.hidden { display: none !important; }

/* ---------------- 通用组件 ---------------- */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi { padding: 15px 16px 14px; position: relative; overflow: hidden; }
.kpi .lab { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 25px; font-weight: 600; letter-spacing: -.4px; margin: 9px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .delta { font-size: 12px; padding: 1px 7px; border-radius: 20px; margin-left: 6px; }
.up { color: var(--red); background: var(--red-soft); }
.down { color: var(--green); background: var(--green-soft); }
.kpi.accent::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(185, 146, 79, .16), transparent 70%);
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .head {
  display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel .head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.panel .head .tip { font-size: 12px; color: var(--muted); }
.panel .head .spacer { flex: 1; }
.panel .body { padding: 16px 18px; }
.panel .body.flush { padding: 0; }

table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 10px 12px; background: #fbf9f4; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.dt td { padding: 11px 12px; border-bottom: 1px solid #f1ece2; vertical-align: middle; }
table.dt tbody tr:hover { background: #fcfaf5; }
table.dt tbody tr:last-child td { border-bottom: none; }
table.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt th.num { text-align: right; }
table.dt tfoot td { padding: 11px 12px; background: #fbf9f4; font-weight: 600; }
.link { color: var(--ink-3); border-bottom: 1px dashed #b9c9c2; cursor: pointer; }
.link:hover { color: var(--gold); border-color: var(--gold); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 1.7; white-space: nowrap; }
.tag.wait { background: var(--amber-soft); color: var(--amber); }
.tag.ship { background: var(--blue-soft); color: var(--blue); }
.tag.done { background: var(--green-soft); color: var(--green); }
.tag.void { background: #eeece7; color: #96938a; text-decoration: line-through; }
.tag.gold { background: var(--gold-soft); color: #8a6a2f; }
.tag.red { background: var(--red-soft); color: var(--red); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=text], .toolbar input[type=date], .toolbar input[type=search], .toolbar select {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--ink-3); }
.toolbar .grow { flex: 1; }
.search { min-width: 210px; }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; color: var(--muted); font-size: 12.5px; }
.pager .btn { padding: 4px 10px; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 15px; color: #9a9f93; margin-bottom: 6px; }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(14, 32, 27, .42); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 60; padding: 6vh 16px; overflow-y: auto;
}
.modal {
  width: 620px; max-width: 100%; background: #fff; border-radius: 16px;
  box-shadow: 0 30px 70px -20px rgba(9, 30, 24, .55); overflow: hidden; animation: pop .18s ease-out;
}
.modal.wide { width: 860px; }
.modal.narrow { width: 440px; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes cp-spin { to { transform: rotate(360deg); } }
.modal .mhead { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .mhead h3 { margin: 0; font-size: 15.5px; flex: 1; }
.modal .mhead .x { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px; }
.modal .mbody { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal .mfoot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fbf9f4; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .field { margin-bottom: 0; }
/* 出库 / 发货弹窗里「快递区」「自提区」与上方的间距，避免提示文字与下一段标签贴在一起 */
#ixExpress .form-grid, #ixPickup .form-grid, #pkExpress .form-grid, #pkPickup .form-grid { margin-top: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.sec-title { font-size: 12.5px; color: var(--gold); letter-spacing: 1px; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--gold-soft); }

/* ---------------- 提示 ---------------- */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item {
  padding: 10px 18px; border-radius: 10px; background: #17332c; color: #f0ebe0; font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); animation: drop .2s ease-out;
}
.toast-item.err { background: #8f3325; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }

/* ---------------- 后端不可达横幅 ---------------- */
.net-banner {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  align-items: center; gap: 12px; padding: 10px 18px;
  background: #8f3325; color: #fdf3e8; font-size: 13px; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .55);
}
.net-banner b { font-weight: 600; }
.net-banner span { opacity: .88; font-size: 12.5px; }
.net-banner .btn { margin-left: auto; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); color: #fff; }
.net-banner .btn:hover { background: rgba(255, 255, 255, .26); }
.ver-banner {
  display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 210;
  align-items: center; gap: 12px; padding: 10px 18px;
  background: #a9761b; color: #fff8e8; font-size: 13px; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .55);
}
.ver-banner b { font-weight: 600; }
.ver-banner span { opacity: .92; font-size: 12.5px; }
.ver-banner .btn { margin-left: auto; }
@media (max-width: 760px) { .ver-banner { flex-wrap: wrap; gap: 6px 10px; padding: 9px 12px; } }

/* ---------------- 开关（设置项） ---------------- */
.switch-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; user-select: none; }
.switch {
  width: 46px; height: 26px; border-radius: 14px; background: #ddd6c6; position: relative;
  flex: none; transition: background .18s ease; margin-top: 2px;
}
.switch i {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .18s ease;
}
.switch.on { background: #1d6b52; }
.switch.on i { left: 23px; }
.switch-txt b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 3px; }
.switch-txt span { font-size: 12.5px; color: var(--muted); line-height: 1.75; }

/* ---------------- 图表 ---------------- */
.chart-wrap { width: 100%; overflow: hidden; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-legend { flex: 1; font-size: 12.5px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed #f0ebe1; }
.donut-legend div:last-child { border: none; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.donut-legend i { width: 9px; height: 9px; border-radius: 2px; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-item .top { display: flex; font-size: 12.5px; margin-bottom: 5px; }
.bar-item .top b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.bar-track { height: 7px; background: #f2eee5; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2c6b58, #4f9678); }

.matrix td { text-align: right; font-variant-numeric: tabular-nums; }
.matrix td.month { text-align: left; color: var(--muted); }
.matrix td.zero { color: #c9c5bb; }

.split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.split-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* 客户卡片 */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cust-card { padding: 16px; cursor: pointer; transition: .16s; }
.cust-card:hover { border-color: #d6c9ae; transform: translateY(-1px); }
.cust-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cust-card .ava {
  width: 38px; height: 38px; border-radius: 11px; background: var(--ink-2); color: #f2e8d3;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.cust-card .nm { font-weight: 600; font-size: 14.5px; }
.cust-card .sm { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cust-card .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.cust-card .row b { color: var(--text); font-variant-numeric: tabular-nums; }
.cust-card .bal { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.cust-card .bal span { font-size: 12px; color: var(--muted); }
.cust-card .bal b { font-size: 19px; }

.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.profile-head .ava { width: 54px; height: 54px; border-radius: 14px; background: var(--ink-2); color: #f2e8d3; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.profile-head .nm { font-size: 18px; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.mini-stat { background: #fbf9f4; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mini-stat span { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 4px; }
.mini-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs div { padding: 8px 14px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs div.on { color: var(--ink); border-color: var(--gold); font-weight: 500; }

.img-thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); cursor: pointer; }

/* ---------------- 移动端（H5）适配 ---------------- */
.nav-toggle { display: none; }
.nav-backdrop { display: none; }
.nav-back { display: none; }
.tabbar { display: none; }

@media (max-width: 1180px) {
  .split, .split-3 { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-wrap { width: 100%; }
}
@media (max-width: 860px) {
  :root { --sidebar: 64px; }
  aside .brand b, aside .brand em, aside .brand span, nav .grp, aside .foot { display: none; }
  nav a span { display: none; }
  nav a { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .content { padding: 14px; }
}

/* 手机 / 窄屏：抽屉式导航，表格可横向滚动，弹窗贴底全屏 */
@media (max-width: 760px) {
  :root { --sidebar: 262px; }
  html, body { font-size: 14px; -webkit-text-size-adjust: 100%; }

  /* 登录页 */
  #login { flex-direction: column; overflow-y: auto; }
  .login-brand { display: flex; flex: 0 0 auto; padding: 30px 26px 18px; }
  .login-brand .seal { width: 52px; height: 52px; font-size: 21px; margin-bottom: 14px; }
  .login-brand h1 { font-size: 22px; margin-bottom: 8px; }
  .login-brand p { display: none; }
  .login-brand .meta { margin-top: 16px; gap: 22px; }
  .login-brand .meta b { font-size: 18px; }
  .login-form-wrap { width: 100%; flex: 1; padding: 26px 24px calc(30px + env(safe-area-inset-bottom)); }

  /* 抽屉侧栏：默认隐藏在左侧，打开时滑入 */
  #app.on { display: block; }
  aside {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: var(--sidebar);
    transform: translateX(-100%); transition: transform .22s ease; z-index: 71;
    box-shadow: 8px 0 30px rgba(0, 0, 0, .25);
  }
  body.nav-open aside { transform: translateX(0); }
  aside .brand { padding-top: calc(22px + env(safe-area-inset-top)); }
  aside .brand b, aside .brand em, aside .brand span, nav .grp, aside .foot { display: block; }
  nav a span { display: inline; }
  nav a { justify-content: flex-start; }
  nav a.active::before { left: -10px; }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(10, 26, 21, .5);
    z-index: 70; opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* 顶栏：两行布局——主信息一行，页面工具栏换行占满宽度，避免挤压标题 */
  main { width: 100%; height: 100dvh; }
  header {
    height: auto; min-height: 56px; flex-basis: auto; flex-wrap: wrap; align-content: center;
    padding: 8px 12px; gap: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top));
  }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center; flex: 0 0 36px; order: 1;
    width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px;
    background: #fff; color: var(--ink); cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .nav-back {
    display: none; align-items: center; justify-content: center; flex: 0 0 30px; order: 0;
    width: 30px; height: 36px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  }
  .nav-back.show { display: flex; }
  .nav-back svg { width: 22px; height: 22px; }
  header h2 { order: 2; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
  header .crumb { display: none; }
  header .spacer { order: 3; }
  header .who { order: 4; margin-left: auto; }
  header .who > div:not(.avatar) { display: none; }
  header .who .btn { padding: 6px 9px; font-size: 12px; }
  #headTools {
    order: 5; flex: 1 0 100%; width: 100%; gap: 8px !important; overflow-x: auto;
    -webkit-overflow-scrolling: touch; white-space: nowrap; padding-top: 2px;
  }
  #headTools > * { flex: 0 0 auto; }
  #headTools .btn { padding: 7px 11px; font-size: 12.5px; }

  /* 内容区 */
  .content { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }
  .page-head, .toolbar { gap: 8px; }
  .toolbar input[type=text], .toolbar input[type=date], .toolbar input[type=search], .toolbar select { flex: 1 1 120px; min-width: 0; }
  .toolbar .grow { flex-basis: 100%; }

  /* 表格：外层横向滚动，避免列被压扁 */
  table.dt { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table.dt th, table.dt td { padding: 9px 10px; }
  .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 统计卡与栅格 */
  .mini-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mini-stat { padding: 9px 10px; }
  .mini-stat b { font-size: 15px; }
  .split, .split-3, .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr !important; }

  /* 弹窗：贴底、圆角上收、限高，底部按钮安全区 */
  .mask { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.narrow {
    width: 100%; max-width: 100%; max-height: 94dvh; border-radius: 18px 18px 0 0;
    display: flex; flex-direction: column;
  }
  .modal .mhead { padding: 14px 16px calc(14px + env(safe-area-inset-top)); flex: 0 0 auto; }
  .modal .mbody { padding: 14px 16px; max-height: none; flex: 1 1 auto; overflow-y: auto; }
  .modal .mfoot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex: 0 0 auto;
    flex-wrap: wrap; position: sticky; bottom: 0;
  }
  .modal .mfoot .btn { flex: 1 1 auto; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 播放器弹窗：视频区高度按竖屏收敛，控件可点 */
  .modal .mbody video { max-height: 46vh !important; }
  .modal .mbody iframe { height: 48vh !important; }

  /* 底部导航栏：常用功能一眼可见，老年人无需找汉堡图标 */
  .tabbar {
    display: flex; flex: 0 0 auto; position: sticky; bottom: 0; z-index: 9;
    background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px -10px rgba(20, 40, 34, .3);
  }
  .tabbar .tab-item {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px 7px; border: 0; background: none; color: #8a9288;
    font-size: 11px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar .tab-item svg { width: 22px; height: 22px; }
  .tabbar .tab-item.active { color: var(--red); }
  .tabbar .tab-item.active svg { stroke-width: 2.1; }
  .tabbar .tab-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* 长声明/页脚缩短占位 */
  .app-disclaimer { padding: 8px 12px calc(6px + env(safe-area-inset-bottom)); font-size: 11px; }
}
@media print {
  aside, header, .toolbar, .pager, .nav-toggle, .nav-backdrop, .tabbar { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* ---------------- 品牌标识上传（系统设置） ---------------- */
.brand-logo-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand-logo-box {
  width: 96px; height: 96px; flex: 0 0 96px; border: 1px dashed var(--line); border-radius: 14px;
  background: #fbfaf6; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo-box .logo-default {
  width: 56px; height: 56px; border-radius: 12px; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
}
.brand-logo-info { flex: 1; min-width: 240px; }
.brand-logo-info .line { font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.brand-logo-info input[type=file] { font-size: 12.5px; padding: 0; border: 0; background: transparent; }
.brand-logo-info .btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.brand-logo-tip { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* 成品档案 · 卡片视图 */
.prod-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; padding:14px; }
.pcard { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; transition:box-shadow .18s,transform .18s; }
.pcard:hover { box-shadow:0 6px 18px rgba(80,60,30,.12); transform:translateY(-2px); }
.pcard-img { height:150px; background:#fbfaf6; display:flex; align-items:center; justify-content:center; position:relative; overflow:hidden; }
.pcard-img img { width:100%; height:100%; object-fit:contain; }
.pcard-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  font-size:46px; color:#d8d0bd; background:linear-gradient(145deg,#faf7f0,#f2ede3); }
.pcard-off { position:absolute; top:6px; right:6px; background:rgba(0,0,0,.55); color:#fff;
  font-size:11px; border-radius:6px; padding:2px 6px; }
.pcard-b { padding:10px 11px 12px; }
.pcard-name { font-size:13.5px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pcard-price { font-size:15px; font-weight:700; color:#b3402f; display:flex; align-items:baseline; gap:6px; }
.pcard-price span { font-size:11px; font-weight:400; color:#a8a396; }
.pcard-ops { display:flex; gap:6px; margin-top:9px; }
.pcard-ops .btn { flex:1; }

/* 客户产品详情弹窗 */
.shop-img { cursor:zoom-in; }
.shop-name { cursor:zoom-in; }
.pd-wrap { display:grid; grid-template-columns:330px 1fr; gap:28px; align-items:start; }
.pd-img { height:300px; background:#fbfaf6; border:1px solid var(--line); border-radius:12px;
  display:flex; align-items:center; justify-content:center; overflow:hidden; }
.pd-img img { width:100%; height:100%; object-fit:contain; }
.pd-thumbs { display:flex; gap:8px; margin-top:10px; overflow-x:auto; padding-bottom:4px; }
.pd-thumb { width:62px; height:62px; flex:0 0 auto; object-fit:cover; border:2px solid transparent;
  border-radius:8px; cursor:pointer; background:#fbfaf6; transition:border-color .15s; }
.pd-thumb:hover { border-color:var(--gold); }
.pd-thumb.active { border-color:var(--red); }
.pd-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  font-size:84px; color:#d8d0bd; background:linear-gradient(145deg,#faf7f0,#f2ede3); }
.pd-info h3 { font-size:19px; margin:0 0 4px; color:var(--text); }
.pd-row { display:flex; justify-content:space-between; align-items:baseline; padding:10px 0;
  border-bottom:1px dashed var(--line); font-size:13px; }
.pd-row span { color:#8a8f86; }
.pd-price { color:#b3402f; font-size:18px; }
.pd-add { margin-top:18px; width:100%; padding:11px; font-size:14px; }
.pd-sec { font-size:14px; font-weight:700; color:#2f6fd0; margin:16px 0 6px; }
.pd-text { font-size:13px; line-height:1.95; color:#5b6259; }
@media (max-width: 860px) { .pd-wrap { grid-template-columns:1fr; } .pd-img { height:220px; } }

/* -------------------------------------------- 底部免责声明 */
.app-disclaimer {
  padding: 13px 20px; text-align: center; font-size: 12px; color: #8b8f86;
  border-top: 1px dashed #e6dfd0; background: #fbf8f2; letter-spacing: .2px;
}
.login-disclaimer {
  margin: 18px auto 0; max-width: 340px; text-align: center; font-size: 11.5px;
  color: #9a958a; line-height: 1.7;
}

/* -------------------------------------------- 知情同意书 */
.consent-mask {
  position: fixed; inset: 0; background: rgba(28, 26, 22, .55); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.consent-box {
  width: min(720px, 100%); max-height: 88vh; background: #fff; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 48px rgba(0,0,0,.28);
}
.consent-head { padding: 18px 22px 12px; border-bottom: 1px solid #eee7da; }
.consent-head h3 { margin: 0; font-size: 17px; color: #1d6b52; }
.consent-head .ver { font-size: 12px; color: #a8a396; margin-top: 4px; }
.consent-body { padding: 16px 22px; overflow-y: auto; font-size: 13.5px; line-height: 2; color: #3f4a44; }
.consent-body p { margin: 0 0 10px; }
.consent-decl {
  margin-top: 12px; padding: 10px 12px; background: #fdf6e8; color: #8a6d2f;
  border-radius: 9px; font-size: 12.5px; line-height: 1.8;
}
.consent-foot { padding: 14px 22px 18px; border-top: 1px solid #eee7da; background: #fcfaf6; }
.consent-foot .ck { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; }
.consent-foot .row { display: flex; gap: 10px; }
.consent-foot .tip { margin-top: 8px; font-size: 11.5px; color: #a8a396; }

/* ------------------------------------------------ 知识付费 · 课程弹窗里的章节行 */
.cc-lrow input[type=number]::-webkit-outer-spin-button,
.cc-lrow input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cc-lrow input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.cc-lrow input { outline: none; }
.cc-lrow input:focus { border-color: #c9b98f !important; box-shadow: 0 0 0 3px rgba(201, 185, 143, .16); }

/* ---------------- 在线客服窗（Chatwoot） ---------------- */
.cw-launcher {
  position: fixed; right: 18px; bottom: 20px; z-index: 120;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; transition: transform .18s, opacity .18s;
  -webkit-tap-highlight-color: transparent;
}
.cw-launcher:hover { transform: translateY(-3px); }
.cw-launcher.hidden { opacity: 0; pointer-events: none; transform: scale(.8); }
.cw-launcher .cw-ic {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -8px rgba(120, 85, 30, .6);
}
.cw-launcher svg { width: 26px; height: 26px; }
.cw-launcher .cw-lb {
  font-size: 11px; line-height: 1; padding: 3px 8px; border-radius: 9px;
  background: rgba(255, 255, 255, .94); color: #8a6a1f; white-space: nowrap;
  box-shadow: 0 2px 8px -2px rgba(20, 18, 14, .18);
}
.cw-panel {
  --cw-primary: #2d8cf0;
  position: fixed; right: 22px; bottom: 24px; z-index: 121;
  width: 360px; height: 520px; max-height: calc(100dvh - 40px);
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px -14px rgba(10, 30, 24, .4);
  display: none; flex-direction: column;
}
.cw-panel.open { display: flex; }
.cw-head {
  flex: 0 0 auto; padding: 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--cw-primary), #1f5a4b);
  display: flex; align-items: center; justify-content: space-between;
}
.cw-head b { display: block; font-size: 15px; }
.cw-head small { display: block; font-size: 11px; opacity: .85; margin-top: 2px; }
.cw-close { cursor: pointer; font-size: 22px; line-height: 1; opacity: .85; padding: 2px 6px; }
.cw-close:hover { opacity: 1; }
.cw-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; background: #f7f8fa; }
.cw-msg { display: flex; flex-direction: column; margin: 8px 0; }
.cw-msg.in { align-items: flex-end; }
.cw-msg.out, .cw-msg.sys { align-items: flex-start; }
.cw-msg .cw-name { font-size: 12px; color: #8a9199; margin: 0 2px 3px; max-width: 78%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-bubble { max-width: 80%; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.cw-msg.out .cw-bubble, .cw-msg.sys .cw-bubble { background: #fff; border: 1px solid #e5e6eb; color: #23291f; }
.cw-msg.in .cw-bubble { background: var(--cw-primary); color: #fff; }
.cw-bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
.cw-time { font-size: 11px; color: #b0b5bc; margin: 3px 4px 0; }
.cw-loading, .cw-empty { font-size: 13px; color: #8a8f99; padding: 12px 2px; text-align: center; }
.cw-voice { margin-top: 6px; font-size: 12px; }
.cw-inputbar { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.cw-input { flex: 1 1 0; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; outline: none; }
.cw-input:focus { border-color: var(--cw-primary); }
.cw-send { flex: 0 0 auto; padding: 0 16px; border: 0; border-radius: 8px; background: var(--cw-primary); color: #fff; font-size: 13.5px; cursor: pointer; }
.cw-send:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) {
  .cw-launcher { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .cw-launcher .cw-ic { width: 50px; height: 50px; }
  .cw-launcher .cw-lb { font-size: 10.5px; padding: 3px 7px; }
  .cw-panel { right: 0; bottom: 0; left: 0; width: 100%; height: 78dvh; max-height: 78dvh; border-radius: 16px 16px 0 0; }
  .cw-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .cw-inputbar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* ---------------- 图片灯箱（产品中心点图放大） ---------------- */
.img-lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  background: rgba(12, 14, 12, .88); padding: 5vh 4vw;
}
.img-lightbox.show { display: flex; }
.img-lightbox .lb-img { max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.img-lightbox .lb-cap { color: #f0ece2; font-size: 13.5px; text-align: center; }
.img-lightbox .lb-close {
  position: absolute; top: 20px; right: 26px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.img-lightbox .lb-close:hover { background: rgba(255,255,255,.24); }
.img-lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
}
.img-lightbox .lb-nav:hover { background: rgba(255,255,255,.28); }
.img-lightbox .lb-prev { left: 3vw; }
.img-lightbox .lb-next { right: 3vw; }
.img-lightbox .lb-count { color: #cfc9bb; font-size: 12.5px; }
@media (max-width: 760px) {
  .img-lightbox .lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .img-lightbox .lb-prev { left: 8px; }
  .img-lightbox .lb-next { right: 8px; }
}
.pd-zoom { cursor: zoom-in !important; }

/* ---------------- 成品多图管理（管理端表单） ---------------- */
.admin-img-list { display:flex; gap:10px; flex-wrap:wrap; }
.admin-img-item { position:relative; width:76px; height:76px; border:1px solid var(--line);
  border-radius:10px; overflow:hidden; background:#fcfaf5; }
.admin-img-item img { width:100%; height:100%; object-fit:cover; cursor:zoom-in; display:block; }
.admin-img-item .ai-badge { position:absolute; left:0; top:0; background:rgba(20,18,14,.72); color:#fff;
  font-size:10px; padding:2px 5px; border-radius:0 0 6px 0; }
.admin-img-item .ai-ops { position:absolute; right:0; bottom:0; display:flex; gap:2px; }
.admin-img-item .ai-ops button { width:19px; height:19px; border:0; background:rgba(20,18,14,.72);
  color:#fff; font-size:12px; line-height:1; cursor:pointer; padding:0; }
.admin-img-item .ai-ops button:hover { background:var(--red); }

/* ---------------- 新建订单：多商品明细行 ---------------- */
.oi-lines { display:flex; flex-direction:column; gap:8px; }
.oi-line { display:grid; grid-template-columns:1fr 76px 96px 84px 30px; gap:8px; align-items:center; }
.oi-line .oi-sel, .oi-line .oi-qty, .oi-line .oi-price {
  padding:7px 9px; border:1px solid var(--line); border-radius:8px; font-size:13px; outline:none; min-width:0;
}
.oi-line .oi-qty, .oi-line .oi-price { text-align:right; }
.oi-line .oi-amt { font-size:13px; text-align:right; color:var(--ink); font-weight:600; }
.oi-line .oi-del { width:28px; height:28px; border:1px solid var(--line); border-radius:8px;
  background:#fff; color:#b3402f; cursor:pointer; font-size:15px; line-height:1; }
.oi-line .oi-del:hover { background:#fdeceb; }
@media (max-width: 760px) {
  .oi-line { grid-template-columns:1fr 58px 78px 30px; }
  .oi-line .oi-amt { grid-column:1 / 4; text-align:right; font-size:12.5px; }
}

/* ---------------- 我的订单：商品缩略图明细 ---------------- */
.mo-items { display: flex; flex-direction: column; gap: 8px; min-width: 236px; }
.mo-item { display: flex; gap: 9px; align-items: flex-start; }
.mo-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 7px; overflow: hidden;
  object-fit: cover; background: #f4f1e9; border: 1px solid var(--line); cursor: zoom-in;
}
.mo-thumb.ph {
  display: flex; align-items: center; justify-content: center;
  color: #b9b3a4; font-size: 15px; cursor: default; border-style: dashed;
}
.mo-meta { min-width: 0; line-height: 1.5; }
.mo-name { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.mo-spec { font-size: 11.5px; color: #a8a396; }
.mo-price { font-size: 12.5px; color: #c0562c; font-weight: 600; }
.mo-tag {
  font-size: 10px; line-height: 1.5; padding: 0 4px; border-radius: 4px;
  background: #f3efe3; color: #8a7a52; font-weight: 400; flex: none;
}
.mo-more { font-size: 11.5px; color: #a8a396; padding-left: 53px; }
@media (max-width: 760px) {
  .mo-items { min-width: 186px; gap: 7px; }
  .mo-thumb { width: 38px; height: 38px; }
  .mo-name { font-size: 12.5px; }
  .mo-more { padding-left: 47px; }
}


/* 首页装修动态行 v1.41 */
.hm-list { display:flex; flex-direction:column; gap:8px; }
.hm-row { display:flex; align-items:flex-start; gap:8px; padding:9px; background:#fbf9f4; border:1px solid #ebe4d6; border-radius:10px; flex-wrap:wrap; }
.hm-thumb { width:56px; height:56px; border-radius:8px; overflow:hidden; background:#efe9dc; color:#a49d90; font-size:11px; display:flex; align-items:center; justify-content:center; flex:none; }
.hm-thumb img { width:100%; height:100%; object-fit:cover; }
.hm-fields { flex:1; min-width:180px; display:flex; flex-direction:column; gap:6px; }
.hm-fields input { width:100%; padding:6px 9px; border:1px solid #e2dccf; border-radius:7px; font-size:12.5px; background:#fff; }
.hm-fields input:focus { outline:none; border-color:var(--gold,#b08d57); }
.hm-row > .btn { flex:none; align-self:center; }
@media (max-width:760px) { .hm-thumb { width:46px; height:46px; } .hm-fields { min-width:140px; } }
