
/* ============================================================
   九五易生物科技 进销存系统 —— 国风样式
   宣纸为底 · 墨色为骨 · 朱砂点睛 · 鎏金作饰
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f2ecdd;            /* 宣纸 */
  --card: #fbf8ef;          /* 暖白绢面 */
  --line: #d9cdb2;          /* 茶色描线 */
  --line-2: #e9e1cc;
  --txt: #2e2a22;           /* 松烟墨 */
  --txt-2: #6e6551;
  --txt-3: #a49a80;
  --brand: #9e2a22;         /* 朱砂 */
  --brand-d: #6f1712;
  --brand-l: #f6e7e0;
  --brand-grad: linear-gradient(135deg, #b23a2b 0%, #9e2a22 55%, #6f1712 100%);
  --gold: #a9822f;          /* 鎏金 */
  --gold-l: #f1e6c8;
  --blue: #3a6377;          /* 黛蓝 */
  --amber: #a9822f;
  --red: #a53028;
  --green: #5b7a4a;         /* 苔绿 */
  --purple: #6b5a8e;        /* 紫棠 */
  --pink: #a85a78;          /* 海棠 */
  --radius: 8px;
  --f-guo: "KaiTi", "STKaiti", "楷体", "Noto Serif SC", "SimSun", serif;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    repeating-linear-gradient(0deg, rgba(169,130,47,.022) 0 1px, transparent 1px 3px),
    var(--bg);
  color: var(--txt); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局 ---------- */
#app { display: flex; min-height: 100vh; }

.side {
  width: 208px; background: linear-gradient(180deg, #f8f2e4 0%, #f2e9d3 55%, #eee2c6 100%); color: var(--txt-2); flex-shrink: 0;
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0;
  border-right: 1px solid var(--line);
}
.side .logo { padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.side .logo .logo-img {
  width: 100%; height: 70px; object-fit: contain;
  mix-blend-mode: multiply; border-radius: 8px; display: block; margin-bottom: 8px;
}
.hero .t2 .co { margin-left: 28px; color: var(--brand-d); font-weight: 500; }
.side .logo span { font-size: 12.5px; color: var(--txt-3); letter-spacing: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav .grp { font-size: 12px; color: var(--txt-3); padding: 12px 10px 5px; letter-spacing: 2px; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
  color: var(--txt-2); text-decoration: none; font-size: 15px; cursor: pointer; margin-bottom: 1px;
  border-left: 2px solid transparent;
}
.nav a:hover { background: rgba(158,42,34,.07); color: var(--brand); }
.nav a.on {
  background: linear-gradient(90deg, #9e2a22, #6f1712); color: #f8f2e2;
  border-left: 2px solid #c9a86a; box-shadow: 0 2px 8px rgba(110,20,15,.28);
}
.nav a .ico { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.nav a .badge {
  margin-left: auto; background: rgba(169,130,47,.22); color: #7a6430; border-radius: 8px;
  padding: 0 6px; font-size: 12px; line-height: 17px;
}
.nav a.on .badge { background: rgba(255,255,255,.25); color: #f8f2e2; }
.side .foot { padding: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--txt-3); }

/* ---------- 国风装饰 ---------- */
/* 侧边栏底部：水墨远山 + 朱砂淡月 */
.side::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 132px; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 208 132'%3E%3Ccircle cx='158' cy='30' r='12' fill='%23c9573f' opacity='.5'/%3E%3Cpath d='M0 98 28 64 50 88 76 52 106 90 132 68 158 92 182 74 208 98 208 132 0 132Z' fill='%23a9926a' opacity='.3'/%3E%3Cpath d='M0 114 34 86 64 108 94 80 126 110 154 90 182 112 208 98 208 132 0 132Z' fill='%238f7a52' opacity='.26'/%3E%3Cpath d='M0 124 46 106 90 122 138 106 176 122 208 114 208 132 0 132Z' fill='%236f5c3a' opacity='.24'/%3E%3C/svg%3E") no-repeat center bottom / 100% 132px;
  pointer-events: none;
}
.side .logo, .nav, .side .foot { position: relative; z-index: 1; }
/* 顶栏：淡祥云纹 */
.top::after {
  content: ""; position: absolute; right: 26px; top: 0; bottom: 0; width: 170px; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 46'%3E%3Cg fill='none' stroke='%23a9822f' stroke-width='1.5' opacity='.3'%3E%3Cpath d='M118 36c-1-8 6-14 14-12 2-7 11-9 16-4 6-2 12 3 11 9-1 5-6 7-11 6'/%3E%3Cpath d='M138 21c3-4 8-5 12-3'/%3E%3Cpath d='M22 39c0-6 6-10 12-8 1-5 8-7 12-3 5-1 9 3 8 8'/%3E%3Ccircle cx='40' cy='31' r='5.5'/%3E%3Cpath d='M46 31c3 0 5 2 5 4'/%3E%3C/g%3E%3C/svg%3E") no-repeat right center / 170px 46px;
  pointer-events: none;
}
.top > * { position: relative; z-index: 1; }

/* 仪表盘山水横幅 */
.hero {
  position: relative; height: 118px; overflow: hidden; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(90deg, #fbf7ec 0%, #f6efdc 55%, #f1e7cd 100%);
  display: flex; align-items: center;
}
.hero .scene { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; }
.hero .htxt { position: relative; z-index: 1; padding-left: 30px; }
.hero .t1 { font-family: var(--f-guo); font-size: 21px; color: var(--brand-d); letter-spacing: 3px; display: flex; align-items: center; }
.hero .t2 { font-size: 13px; color: var(--txt-2); letter-spacing: 2px; margin-top: 8px; }
.hero .seal { margin-left: 12px; display: inline-flex; filter: drop-shadow(0 1px 2px rgba(110,20,15,.25)); }
.hero .hicons { position: relative; z-index: 1; margin-left: auto; padding-right: 38px; display: flex; gap: 30px; }
.hero .hi { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hero .hi span { font-size: 12.5px; color: #6f5c3a; letter-spacing: 2px; font-family: var(--f-guo); }
@media (max-width: 1080px) { .hero .hicons { display: none; } }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 0 20px; height: 54px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.top h2 { font-size: 17.5px; font-weight: 500; font-family: var(--f-guo); letter-spacing: 2px; }
.top h2::before { content: ""; display: inline-block; width: 4px; height: 15px; background: var(--brand-grad); border-radius: 1px; margin-right: 9px; vertical-align: -2px; }
.top .sp { flex: 1; }
.top .daterange { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--txt-2); }

.page { padding: 18px 20px 40px; flex: 1; }

/* ---------- 组件 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--txt);
  padding: 6px 13px; border-radius: 6px; font-size: 14px; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: .12s;
}
.btn:hover { border-color: #c2b28a; background: #f5efdf; }
.btn.pri { background: var(--brand-grad); border-color: var(--brand-d); color: #f8f2e2; }
.btn.pri:hover { background: linear-gradient(135deg, #a13026, #5f120d); }
.btn.danger { color: var(--red); border-color: #ddc2b6; }
.btn.danger:hover { background: #f8ece6; }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 6px; background: #fffdf6;
  color: var(--txt); width: 100%; outline: none; transition: .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(158,42,34,.08); }
input[readonly] { background: #f4efdf; color: var(--txt-2); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--txt-2); margin-bottom: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: 0; top: 0; width: 34px; height: 34px; background: linear-gradient(225deg, rgba(169,130,47,.14), transparent 55%); pointer-events: none; }
.kpi .lb { font-size: 13px; color: var(--txt-2); margin-bottom: 6px; letter-spacing: 1px; }
.kpi .vl { font-size: 23px; font-weight: 500; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--txt-3); margin-top: 4px; }
.kpi.g .vl { color: var(--green); }
.kpi.r .vl { color: var(--red); }
.kpi.b .vl { color: var(--blue); }
.kpi.a .vl { color: var(--amber); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.panel > .hd {
  padding: 12px 15px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #f7f2e2, #fbf8ef);
}
.panel > .hd h3 { font-size: 15px; font-weight: 500; font-family: var(--f-guo); letter-spacing: 1.5px; }
.panel > .hd h3::before { content: "❖"; color: var(--brand); font-size: 12px; margin-right: 7px; vertical-align: 1px; }
.panel > .hd .sp { flex: 1; }
.panel > .bd { padding: 0; }
.panel > .bd.pad { padding: 15px; }

/* 宽表横向滚动：列多时不挤压换行，面板底部出现左右拖动的滚动条 */
.panel > .bd { overflow-x: auto; }
.panel > .bd > table { min-width: max-content; }
.panel > .bd::-webkit-scrollbar { height: 10px; }
.panel > .bd::-webkit-scrollbar-thumb { background: #d3c49e; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
.panel > .bd::-webkit-scrollbar-thumb:hover { background: #bda87a; background-clip: padding-box; border: 2px solid transparent; }
.panel > .bd::-webkit-scrollbar-track { background: #f5efdd; border-radius: 6px; }
.panel > .bd { scrollbar-width: thin; scrollbar-color: #d3c49e #f5efdd; }

/* 表格搜索框（常用方案）：面板标题行右侧一个关键词搜索框 */
/* 标题行筛选控件横向排列（覆盖全局 width:100%） */
.panel > .hd input:not([type="checkbox"]), .panel > .hd select { width: auto; }
.panel > .hd input.psearch {
  min-width: 200px; max-width: 280px; height: 31px; padding: 4px 11px;
  font-size: 13px; color: var(--txt-1); background: #fffdf6;
  border: 1px solid var(--line); border-radius: 7px; outline: none;
}
.panel > .hd input.psearch:focus { border-color: var(--brand); background: #fff; }
.panel > .hd input.psearch:not(:placeholder-shown) { border-color: var(--brand); background: #fdf3e3; }

/* 单据弹窗内「复制自…」下拉：按内容自适应宽度（覆盖全局 width:100%），不撑满整行 */
.modal .mb label.copy-pick { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--txt-3); }
.modal .mb label.copy-pick > span { margin: 0; }
.modal .mb select[data-copy] { width: auto; max-width: 360px; font-size: 13px; height: 31px; padding: 4px 9px; }
.modal .mb .copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal .mb .copy-row > .sp { flex: 1; }
.modal .mb .copy-hint {
  font-size: 13px; color: var(--txt-2); background: #f6f1e0;
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; line-height: 1.6;
}

/* 采购费用区块：运费 / 包材等录入与分摊方式选择 */
.modal .mb .fee-blk {
  margin-top: 14px; border: 1px dashed var(--line); border-radius: 9px;
  padding: 10px 12px; background: #faf9f5;
}
.modal .mb .fee-blk .line-tbl th { font-size: 12px; color: var(--txt-3); text-align: left; padding: 4px 6px; }
.modal .mb .fee-blk .line-tbl td { padding: 3px 6px; }

/* 库存明细可排序列头：可点、悬停高亮、方向指示 */
.panel th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.panel th.sortable:hover { color: var(--brand); }
.panel th.sortable .sarr { font-style: normal; color: var(--brand); font-size: 12px; margin-left: 2px; }

/* 分仓汇总面板：限高纵向滚动，所有仓库都能滑到；表头吸顶 */
.bd.wh-scroll { max-height: 300px; overflow-y: auto; }
.bd.wh-scroll::-webkit-scrollbar { width: 10px; }
.bd.wh-scroll::-webkit-scrollbar-thumb { background: #d3c49e; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
.bd.wh-scroll::-webkit-scrollbar-thumb:hover { background: #bda87a; background-clip: padding-box; border: 2px solid transparent; }
.bd.wh-scroll::-webkit-scrollbar-track { background: #f5efdd; border-radius: 6px; }
.bd.wh-scroll { scrollbar-width: thin; scrollbar-color: #d3c49e #f5efdd; }
.bd.wh-scroll thead th { position: sticky; top: 0; z-index: 2; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .sp { flex: 1; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 9px 12px; background: #f4eeda; color: var(--txt-2);
  font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:hover { background: #f7f2e2; }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
tfoot td { background: #f4eeda; font-weight: 500; border-top: 1px solid var(--line); }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12.5px;
  line-height: 19px; white-space: nowrap; border: 1px solid transparent;
}
.tag.g { background: #eef1df; color: #4a6638; border-color: #d5dcb8; }
.tag.r { background: #f8e8e2; color: #93261e; border-color: #e6c8bc; }
.tag.b { background: #e6edee; color: #33566b; border-color: #c6d4d8; }
.tag.a { background: #f5ecd2; color: #7d5f1a; border-color: #e2d2a4; }
.tag.p { background: #ebe7f2; color: #4e4173; border-color: #d2c9e2; }
.tag.n { background: #eee9da; color: #6b6250; border-color: #dcd2ba; }
.tag.k { background: #f5e6ec; color: #8a4663; border-color: #e2c8d3; }

.empty { padding: 48px 20px; text-align: center; color: var(--txt-3); font-size: 14px; }

/* 单位库胶囊 */
.uchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 13px;
  border: 1px solid var(--line); border-radius: 15px; background: #fdfaf1;
  font-size: 14px; letter-spacing: 1px;
}
.uchip i {
  font-style: normal; font-size: 12px; color: #7a6430; background: rgba(169,130,47,.16);
  border-radius: 8px; padding: 0 6px; line-height: 17px;
}
.uchip b {
  cursor: pointer; color: var(--txt-3); font-weight: 400; font-size: 15px;
  width: 19px; height: 19px; line-height: 17px; text-align: center;
  border-radius: 50%; transition: .12s;
}
.uchip b:hover { background: #f8e8e2; color: var(--red); }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .35; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(30,26,18,.5); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 10px; width: 100%; max-width: 880px;
  border: 1px solid #c9bb96; box-shadow: 0 8px 40px rgba(20,16,8,.25); margin: auto 0;
}
.modal.sm { max-width: 460px; }
.modal.wide { max-width: 960px; }
.modal.xwide { max-width: 1180px; }
/* 单据明细行里自动带出的商品信息列（型号/规格/条码）：只读、不换行、可悬停看全 */
.line-tbl td.pinfo { overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.modal .mh {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0;
  background: var(--card); border-radius: 10px 10px 0 0; z-index: 2;
  border-bottom: 2px solid var(--brand);
}
.modal .mh h3 { font-size: 15px; font-weight: 500; font-family: var(--f-guo); letter-spacing: 1.5px; }
.modal .mh .mh-btns { margin-left: auto; display: flex; gap: 6px; }
.modal .mh .x {
  cursor: pointer; color: var(--txt-3); font-size: 20px;
  line-height: 1; padding: 0 4px; background: none; border: none;
}
.modal .mh .x:hover { color: var(--brand); }
.modal .mb { padding: 18px 20px; }
.modal .mf {
  padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px;
  justify-content: flex-end; position: sticky; bottom: 0; background: var(--card);
  border-radius: 0 0 10px 10px;
}

/* ---------- 弹窗最小化态 ---------- */
.mask.min { background: transparent; pointer-events: none; }
.mask.min .modal { display: none; }
#minBar {
  position: fixed; right: 22px; bottom: 22px; z-index: 210;
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--brand);
  border-radius: 9px; padding: 8px 9px 8px 14px;
  box-shadow: 0 6px 24px rgba(20, 16, 8, .28);
}
#minBar .ic { font-size: 14px; }
#minBar .t {
  font-family: var(--f-guo); font-size: 13.5px; letter-spacing: 1px;
  color: var(--txt); max-width: 260px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
#minBar button {
  cursor: pointer; border: 1px solid var(--brand); background: var(--brand-l);
  color: var(--brand); font-size: 12.5px; padding: 4px 12px;
  border-radius: 6px; font-family: var(--f-guo); letter-spacing: 1px;
}
#minBar button:hover { background: var(--brand); color: #fff; }
#minBar button.xb { background: none; border-color: var(--line); color: var(--txt-3); padding: 4px 8px; }
#minBar button.xb:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }

.line-tbl { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.line-tbl th { padding: 7px 8px; font-size: 12.5px; }
.line-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line-2); }
.line-tbl input, .line-tbl select { padding: 5px 7px; font-size: 13px; }
.line-tbl .del { color: var(--red); cursor: pointer; text-align: center; font-size: 15px; user-select: none; }
.line-tbl .del:hover { opacity: .6; }

.calc { background: #f6f1e0; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.calc .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12.5px; }
.calc .row.big { font-size: 15px; font-weight: 500; border-top: 1px dashed #c9bb96; margin-top: 6px; padding-top: 9px; }
.calc .row .lb { color: var(--txt-2); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
#toast div {
  background: #332d20; color: #f4ecd8; padding: 9px 18px; border-radius: 6px;
  font-size: 12.5px; box-shadow: 0 4px 16px rgba(0,0,0,.25); animation: tin .2s ease;
  border: 1px solid #a9822f55;
}
#toast div.error { background: #8f1d16; border-color: #b23a2b; }
#toast div.ok { background: linear-gradient(135deg, #b23a2b, #6f1712); border-color: #c9a86a; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 登录 / 启动页（国风） ---------- */
#lock {
  position: fixed; inset: 0; background: linear-gradient(180deg, #f8f2e4 0%, #f2e9d3 55%, #eee2c6 100%); z-index: 900;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* 水墨远山 */
#lock::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 190px; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 190'%3E%3Cg fill='none' stroke='%236f5c3a' stroke-width='1.6' opacity='.4' stroke-linecap='round'%3E%3Cpath d='M980 46q6-7 12 0M1010 38q6-7 12 0M1040 48q6-7 12 0'/%3E%3C/g%3E%3Cpath d='M0 150 90 112 180 146 290 96 400 148 520 108 640 152 760 112 880 154 1000 110 1120 150 1240 106 1360 148 1440 118 1440 190 0 190Z' fill='%23a9926a' opacity='.26'/%3E%3Cpath d='M0 170 120 132 260 166 420 122 580 170 740 132 900 172 1060 130 1220 168 1380 134 1440 158 1440 190 0 190Z' fill='%238f7a52' opacity='.22'/%3E%3Cpath d='M0 184 160 154 340 182 540 148 740 184 940 152 1140 182 1320 156 1440 176 1440 190 0 190Z' fill='%236f5c3a' opacity='.2'/%3E%3C/svg%3E") no-repeat center bottom / 100% 190px;
  pointer-events: none;
}
#lock .box {
  position: relative; z-index: 1; text-align: center; color: var(--txt-1);
  width: 360px; padding: 34px 30px 26px; background: #fdf9ee;
  border: 1px solid #d8c9a2; border-radius: 14px; box-shadow: 0 18px 50px rgba(90,70,30,.18);
}
/* 卡内描金细框 */
#lock .box::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(169,130,47,.32); border-radius: 9px; pointer-events: none;
}
#lock .box > * { position: relative; }
#lock .box img { width: 200px; mix-blend-mode: multiply; margin-bottom: 4px; }
#lock .box h2 { font-size: 20px; font-weight: 500; margin-bottom: 4px; font-family: var(--f-guo); letter-spacing: 5px; color: var(--brand-d); }
#lock .box p { font-size: 12.5px; color: #8a7a55; margin-bottom: 18px; }
#lock .box input {
  border: 1px solid #d8c9a2; background: #fffdf7; color: var(--txt-1);
}
#lock .box input:focus { border-color: #c9a86a; }
#lock .box button {
  width: 100%; padding: 11px; background: var(--brand-grad); border: 1px solid #a13026;
  color: #f8f2e2; border-radius: 6px; cursor: pointer; font-size: 13.5px; font-family: inherit;
}
#lock .box button:hover { background: linear-gradient(135deg, #a13026, #5f120d); }
#lock .box .aerr2 { color: #93261e; }
#lock .hint { font-size: 11.5px; color: #a08e60; margin-top: 16px; }

/* ---------- 登录 / 注册表单 ---------- */
#lock .box.auth { width: 360px; }
#lock .box.auth .atabs { display: flex; margin: 14px 0 16px; border-bottom: 1px solid #e0d4b3; }
#lock .box.auth .atabs button {
  flex: 1; width: auto; padding: 8px 0; background: none; border: none; border-bottom: 2px solid transparent;
  color: #8a7a55; font-size: 12.5px; cursor: pointer; font-family: inherit; border-radius: 0; white-space: nowrap;
}
#lock .box.auth .atabs button:hover { background: rgba(158,42,34,.06); color: var(--brand); }
#lock .box.auth .atabs button.on { color: var(--brand-d); border-bottom-color: var(--brand); font-weight: 600; }
#lock .box.auth .aform { display: flex; flex-direction: column; gap: 12px; }
#lock .box.auth input {
  width: 100%; box-sizing: border-box; text-align: left; letter-spacing: normal; font-size: 13.5px;
  padding: 11px 13px; background: #fffdf7; border: 1px solid #d8c9a2; color: var(--txt-1); border-radius: 6px;
}
#lock .box.auth input::placeholder { color: #b3a37e; }
#lock .box.auth input:focus { border-color: #c9a86a; outline: none; box-shadow: 0 0 0 3px rgba(169,130,47,.12); }
#lock .box.auth .aform button { width: 100%; margin-top: 2px; }
#lock .box.auth .atip { font-size: 12.5px; color: #7a6430; text-align: left; line-height: 1.6; padding: 2px 1px; }
#lock .box.auth .aerr { margin-top: 12px; font-size: 12.5px; color: #93261e; background: #f8e8e2; border: 1px solid #e6c8bc; border-radius: 6px; padding: 8px 11px; }
#lock .box.auth .hint { margin-top: 14px; }

/* ---------- 侧边栏用户信息 ---------- */
.side .foot .uinfo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side .foot .uinfo b { font-size: 14px; color: var(--txt-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .foot .uinfo .urole { flex-shrink: 0; font-size: 11.5px; color: #7d5f1a; background: #f5ecd2; border: 1px solid #e2d2a4; border-radius: 8px; padding: 0 7px; line-height: 18px; }

/* ---------- 图表 ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 92px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-row .nm { color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .tr { background: #ebe4cd; border-radius: 3px; height: 16px; overflow: hidden; }
.bar-row .fl { height: 100%; border-radius: 3px; background: var(--brand-grad); transition: width .4s; }
.bar-row .vv { text-align: right; font-variant-numeric: tabular-nums; color: var(--txt); }

.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 128px; padding: 8px 0 0; }
.mini-bars .mb2 { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.mini-bars .stack { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; height: 96px; gap: 2px; }
.mini-bars .seg { border-radius: 3px 3px 0 0; min-height: 1px; }
.mini-bars .lb2 { font-size: 10.5px; color: var(--txt-3); white-space: nowrap; }

@media (max-width: 860px) {
  .side { width: 60px; }
  .side .logo span, .nav .grp, .nav a span:not(.ico), .side .foot { display: none; }
  .nav a { justify-content: center; padding: 9px 0; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
}

/* ---------- 单据文档（采购订单 / 销售单） ---------- */
.doc-toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.doc-paper {
  width: 794px; max-width: 100%; margin: 0 auto; background: #fffdf6;
  padding: 30px 34px 26px; color: #2e2a24; font-size: 12.5px; line-height: 1.7;
  border: 1px solid #c9bb96; box-shadow: 0 2px 14px rgba(60,48,20,.12);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.doc-head { display: flex; align-items: flex-start; gap: 18px; border-bottom: 3px double #9e2a22; padding-bottom: 14px; }
.doc-brand { display: flex; align-items: center; gap: 12px; width: 264px; }
.doc-brand img { width: 170px; height: auto; object-fit: contain; }
.doc-co { font-size: 16px; font-weight: 600; letter-spacing: 1px; font-family: var(--f-guo); }
.doc-sub { font-size: 11px; color: #94876a; letter-spacing: 1px; }
.doc-title { flex: 1; text-align: center; }
.doc-title h1 { font-size: 42px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; font-family: '隶书', 'LiSu', 'SimLi', 'STLiti', 'KaiTi', '楷体', serif; }
.doc-meta { width: 200px; font-size: 12px; color: #55503f; text-align: right; line-height: 1.9; }
.doc-party { padding: 12px 2px 4px; font-size: 12.5px; line-height: 1.9; }
.doc-party2 {
  padding: 12px 2px 4px; font-size: 12.5px; line-height: 1.9;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px;
}
.doc-party2 .pp { border: 1px solid #ddd2b8; border-radius: 6px; padding: 9px 13px; background: #fdfaf1; }
.doc-party2 .pt { font-size: 11px; color: #9e2a22; letter-spacing: 2px; margin-bottom: 3px; font-weight: 600; }
.doc-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.doc-tbl th, .doc-tbl td { border: 1px solid #c2b48e; padding: 7px 8px; text-align: left; vertical-align: middle; }
.doc-tbl th { background: #f3ecd6; font-weight: 500; white-space: nowrap; }
.doc-tbl .doc-sumrow td { background: #f3ecd6; }
.doc-block { margin-top: 14px; font-size: 12.5px; line-height: 2; }
.doc-block .doc-line b { font-weight: 600; color: #6f1712; }
.doc-sign {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 16px; font-size: 12.5px; color: #3a352a;
}
.doc-sign2 { margin-top: 26px; padding-top: 0; }
.doc-sign2 b { font-weight: 600; color: #6f1712; }
.doc-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid #d5caa8; font-size: 11px; color: #94876a; text-align: center; letter-spacing: 1px; }

/* 订货清单（OEM 版式）：甲乙抬头 / 协议前言 / 信息卡 / 签字区 */
.doc-order-head { position: relative; justify-content: space-between; padding-bottom: 0; align-items: center; }
.doc-order-head .doc-brand { width: auto; flex: 0 0 auto; }
.doc-order-head .doc-brand img { width: 210px; height: auto; object-fit: contain; }
.doc-order-head .doc-title { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }
.doc-order-head .doc-title h1 {
  font-size: 42px; font-weight: 700; letter-spacing: 1px; white-space: nowrap;
  font-family: '隶书', 'LiSu', 'SimLi', 'STLiti', 'KaiTi', '楷体', serif;
}
.doc-order-head .doc-meta { flex: 0 0 auto; width: auto; min-width: 150px; white-space: nowrap; }
.doc-order-head + .doc-partyline { padding-top: 3px; }
.doc-partyline {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 16px 2px 2px; font-size: 13.5px; color: #3a352a;
}
.doc-partyline b { font-weight: 600; color: #1f1c14; }
.doc-agree { text-indent: 2em; font-size: 12.5px; line-height: 2.1; color: #3a352a; margin: 10px 0 6px; text-align: justify; }
.doc-strong { font-weight: 600; font-size: 13.5px; color: #1f1c14; margin: 8px 0 0; }
.doc-info2 { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
.doc-info2 td { border: 1px solid #c2b48e; padding: 12px 16px; vertical-align: top; width: 50%; line-height: 2.25; color: #3a352a; }
.doc-info2 b { font-weight: 600; color: #1f1c14; }
.doc-info2 td { padding-bottom: 18px; }
.doc-sign3 { width: 100%; border-collapse: collapse; margin-top: 34px; font-size: 13px; }
.doc-sign3 td { width: 50%; padding: 4px 12px; line-height: 2.4; vertical-align: top; color: #3a352a; }
.doc-close { margin-top: 14px; border-top: 1px solid #c2b48e; }
.doc-foot.nb { border-top: none; padding-top: 8px; margin-top: 10px; }
.doc-sumrow td { font-size: 12.5px; }

/* 打印：只输出单据 */
#printRoot { display: none; }
@media print {
  body > #app, body > #modalRoot, body > #toast, body > #lock { display: none !important; }
  #printRoot { display: block !important; }
  #printRoot .doc-paper { border: none; box-shadow: none; width: 100%; padding: 8mm 10mm; }
  @page { margin: 8mm; }
}

/* ---------- 商品可搜索下拉（pcombo） ---------- */
.pcombo { position: relative; }
.pc-in { width: 100%; }
.pc-list { display: none; position: fixed; z-index: 3000; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.16); max-height: 262px; overflow: auto; padding: 4px; }
.pc-list.on { display: block; }
.pc-opt { padding: 6px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.45; }
.pc-opt:hover { background: var(--brand-soft, rgba(0,0,0,.05)); }
.pc-opt.on { background: var(--brand-soft, rgba(0,0,0,.05)); }
.pc-sub { display: block; font-size: 12px; color: var(--txt-3); }
.pc-empty { padding: 8px 10px; color: var(--txt-3); font-size: 12.5px; }

/* ---------- ICP 备案号页脚 ---------- */
.icp-foot { text-align: center; padding: 14px 0 18px; }
.icp-foot a { font-size: 12.5px; color: var(--txt-3); text-decoration: none; }
.icp-foot a:hover { color: var(--brand); }
