/* ============================================================
   外贸工作台 · 后台模板样式
   直接沿用 MT5 Plus 管理后台那一套（mt5plus/backend_voice_rules/app/admin.css）：
     --dark #1f2733  --accent #2f80ed  --bg #f4f6f9  --card #fff
     --border #e6eaf0  --muted #8a94a6  --green/red/amber
   结构：深色侧栏(brand + 分组 + emoji 图标项) + 白色内容区 + 圆角卡片
   仅 PC：侧栏常显，内容区随窗口自适应。
   ============================================================ */

:root{
  --dark:#1f2733; --accent:#2f80ed; --bg:#f4f6f9; --card:#fff;
  --text:#1f2733; --muted:#8a94a6; --border:#e6eaf0;
  --green:#27ae60; --red:#e74c3c; --amber:#f39c12;
  /* 兼容页面原有变量 */
  --panel:#fff; --ink:#1f2733; --mute:#8a94a6; --line:#e6eaf0;
  --brand:#2f80ed; --brand2:#e9f2fd; --warn:#e74c3c;
}
*{box-sizing:border-box}
html{width:100%;min-height:100%}
body{
  display:block;margin:0;padding:0 0 0 236px;width:100%;min-height:100vh;
  font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--text);font-size:15px;
}
a{color:var(--accent)}
.muted,.mute,small{color:var(--muted)}
.hide{display:none!important}

/* ============ 侧栏（.sidebar / .brand / .nav / .nav-group / .nav-item） ============ */
#side{
  position:fixed;left:0;top:0;bottom:0;z-index:50;
  width:224px;height:100vh;display:flex;flex-direction:column;
  background:var(--dark);color:#cdd6e4;
}
#side .brand{
  flex:0 0 auto;display:flex;align-items:center;gap:9px;
  padding:14px 18px;font-size:15px;font-weight:700;color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
}
#side .brand img{width:30px;height:30px;flex:0 0 30px;border-radius:7px;background:#fff;object-fit:contain}
#side .nav{flex:1;overflow-y:auto;overflow-x:hidden;padding:8px 0}
#side .nav::-webkit-scrollbar{width:4px}
#side .nav::-webkit-scrollbar-track{background:transparent}
#side .nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:2px}
#side{width:236px}
body{padding-left:236px}
#side .nav-group{padding:13px 20px 4px;font-size:11px;color:#7c8aa0;letter-spacing:.6px}
#side a.nav-item{
  display:flex;align-items:center;gap:9px;
  padding:9px 20px;color:#cdd6e4;text-decoration:none;font-size:14px;
  border-left:3px solid transparent;transition:background .15s;
}
#side a.nav-item .ic{flex:0 0 18px;width:18px;text-align:center;font-size:14px;opacity:.85;line-height:1;display:flex;align-items:center;justify-content:center}
#side a.nav-item .ic svg{width:16px;height:16px;display:block;stroke-width:1.7}
#side a.nav-item.active .ic{opacity:1;color:#fff}
#side a.nav-item:hover .ic{opacity:1}
#side a.nav-item.dim .ic{opacity:.55}
#side a.nav-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#side a.nav-item:hover{background:rgba(255,255,255,.04);color:#fff}
#side a.nav-item.active{background:rgba(255,255,255,.06);color:#fff;border-left-color:var(--accent)}
#side a.nav-item.dim{color:#8e9bb0}
#side a.nav-item .flag{margin-left:auto;font-size:11px;color:#7c8aa0}
#side a.nav-item.sub{font-size:13px;color:#a3b0c2;padding:7px 18px 7px 40px;border-left-width:2px;position:relative}
#side a.nav-item.sub::before{content:"└";position:absolute;left:19px;top:50%;transform:translateY(-50%);color:#4d5f75;font-size:12px;line-height:1}
#side a.nav-item.sub .ic{display:none}
#side .side-foot{
  flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:14px 20px;border-top:1px solid rgba(255,255,255,.08);
  font-size:13px;color:#93a1b5;line-height:1.4;
}
#side .side-foot .who{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#cdd6e4}
#side .side-foot .muted{font-size:11.5px;color:#7c8aa0}
#side .side-foot a.logout{
  flex:0 0 auto;padding:5px 10px;border-radius:6px;background:rgba(255,255,255,.08);
  color:#dbe4f0;text-decoration:none;font-size:12.5px;
}
#side .side-foot a.logout:hover{background:rgba(255,255,255,.16);color:#fff}
#menuBtn,#scrim{display:none!important}

/* ============ 内容区（.main / .content） ============ */
#main{min-width:0;max-width:none;width:auto;padding:clamp(20px,1.4vw,32px) clamp(22px,1.8vw,40px) 40px}
#main>*{min-width:0}
h1{font-size:22px;font-weight:650;margin:0 0 18px;line-height:1.3}
h2{font-size:17px;font-weight:600;margin:0 0 14px}
h3{font-size:15px;font-weight:600;margin:16px 0 8px}

/* 页头：标题左，操作右 */
.head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px;min-height:40px}
.head h1{margin:0}
.head small{font-size:13px}
.bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0}

/* ============ 卡片（.card） ============ */
section{
  background:var(--card);border:1px solid var(--border);border-radius:12px;
  padding:20px;margin-bottom:18px;
}
section>h2{margin:0 0 16px;font-size:16px}
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:0;margin-bottom:0}

/* ============ 按钮（button / .ghost / .p / .d / .sm） ============ */
button,.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:36px;padding:9px 16px;
  border:0;border-radius:8px;background:var(--accent);color:#fff;
  font-family:inherit;font-size:14px;font-weight:400;line-height:1.2;
  cursor:pointer;text-decoration:none;transition:.15s;
}
button:hover,.btn:hover{background:#1f6fd0;color:#fff}
button.ghost,.btn.ghost{background:#eef2f7;color:var(--text)}
button.ghost:hover,.btn.ghost:hover{background:#e4eaf3;color:var(--text)}
button.p,.btn.p{background:var(--accent);color:#fff}
button.d{background:#fdeceb;color:var(--red)}
button.d:hover{background:#fbdcd8;color:var(--red)}
button.sm{padding:5px 10px;min-height:28px;font-size:12px;border-radius:6px}
button:disabled,.btn:disabled{opacity:.55;cursor:not-allowed}

/* ============ 表单 ============ */
label{display:block;margin:10px 0 4px;color:var(--muted);font-size:13px}
input,select,textarea{
  width:100%;min-height:38px;padding:9px 12px;
  border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--text);
  font-family:inherit;font-size:14px;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent)}
input[readonly]{background:#f7f9fc;color:var(--muted)}
input[type=checkbox]{width:auto;min-height:0}
textarea{resize:vertical;min-height:56px}
.head label{margin:0;display:flex;align-items:center;gap:6px}
.head select{width:auto}

/* ============ 表格（th 浅灰底，细线，同后台） ============ */
.lst{width:100%;border-collapse:collapse}
.lst th,.lst td{padding:10px 12px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}
.lst th{color:var(--muted);font-weight:600;font-size:13px;background:#fafbfc}
.lst td{font-size:14px;color:var(--text)}
.lst tr[data-id]{cursor:pointer}
.lst tbody tr:hover td,.lst tr.on td,.lst tr[data-id]:hover td{background:#f7faff}
.tablewrap{max-width:100%;overflow:auto}

/* ============ 标签（.pill） ============ */
.tag,.chip{
  display:inline-block;padding:3px 10px;border:0;border-radius:20px;
  background:#eef2f7;color:#5b6579;font-size:12px;line-height:1.5;white-space:nowrap;margin-right:4px;
}
.tag.o,.chip.o{background:#fdeceb;color:var(--red)}
.tag.g,.chip.g{background:#eafaf1;color:var(--green)}
.status-new{background:#eafaf1;color:var(--green)}
.status-update{background:#fdf4e7;color:#b9770e}
.status-unchanged{background:#eef2f7;color:#5b6579}

/* ============ 线性图标：页头、环节卡、数字卡共用 ============ */
h1 .hic{display:inline-flex;align-items:center;justify-content:center;vertical-align:-.12em;margin-right:9px;color:var(--accent)}
h1 .hic svg{width:.86em;height:.86em;stroke-width:1.9}

.stats .statcard{position:relative}
.stats .statcard .sic{position:absolute;top:15px;right:15px;color:#c8d6e6;display:flex}
.stats .statcard .sic svg{width:22px;height:22px}

.flow .st .stic{display:flex;color:var(--accent);margin-bottom:6px}
.flow .st .stic svg{width:20px;height:20px}
.flow .st:not(.live) .stic{color:#b6c2d1}

/* ============ 概览数字卡（.stats / .stat） ============ */
.stats{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.stats .statcard{flex:1;min-width:170px;padding:18px;background:var(--card);border:1px solid var(--border);border-radius:12px}
.stats .statcard .num{display:block;font-size:26px;font-weight:700;line-height:1.2;color:var(--text)}
.stats .statcard .label{display:block;color:var(--muted);font-size:13px;margin-top:4px}
.stat{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.stat>div{padding:18px;background:var(--card);border:1px solid var(--border);border-radius:12px}
.stat b{display:block;font-size:26px;font-weight:700;line-height:1.2}
.stat span,.stat small{display:block;margin-top:4px;color:var(--muted);font-size:13px}

/* ============ 常用操作宫格（.quick / .qbtn） ============ */
.quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.qbtn{
  display:block;padding:16px 10px 13px;text-align:center;font-size:13px;
  background:#fff;border:1px solid var(--border);border-radius:10px;
  text-decoration:none;color:var(--text);cursor:pointer;transition:.15s;
}
.qbtn:hover{border-color:var(--accent);background:#f7faff;color:var(--text)}
.qbtn .qi{display:flex;align-items:center;justify-content:center;height:44px;margin-bottom:8px}
.qbtn .qi svg{width:58px;height:46px;display:block}
@media(max-width:1300px){.quick{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1000px){.quick{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ============ 业务流程总览 ============ */
.flow{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;margin-bottom:18px}
.flow .st{
  display:block;padding:14px 15px;text-decoration:none;color:var(--text);
  background:var(--card);border:1px solid var(--border);border-radius:12px;transition:.15s;
}
.flow .st:not(.live){background:#fafbfc;color:var(--muted)}
.flow .st.live:hover{border-color:var(--accent);background:#f7faff}
.flow .st i{font-style:normal;margin-right:6px;font-size:13px;color:var(--muted)}
.flow .st b{display:block;margin-top:2px;font-size:15px;font-weight:600;line-height:1.35}
.flow .st span{font-size:13px;color:var(--muted)}

/* ============ 产品卡片 ============ */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.card{cursor:pointer;overflow:hidden;padding:0}
.card:hover{border-color:var(--accent)}
.card .ph{height:136px;background:#fafbfc;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:12px;overflow:hidden}
.card .ph img{width:100%;height:136px;object-fit:contain;background:#fff}
.card .bd{padding:10px 12px}
.card b{display:block;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card .sub{font-size:12.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.imgs{display:grid;grid-template-columns:repeat(auto-fill,minmax(126px,1fr));gap:10px;margin-top:8px}
.im{border:1px solid var(--border);border-radius:10px;overflow:hidden;background:#fafbfc}
.im.main{border-color:var(--accent);box-shadow:0 0 0 2px var(--brand2)}
.im .tagm{background:var(--accent);color:#fff}

/* ============ 订单页 ============ */
.deal{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;align-items:start}
#form{height:auto!important;max-height:none!important;min-height:0;max-width:1000px;padding:20px}
#wrap{overflow-x:auto;min-width:0}
#doc{min-width:0}
#doc .doc-sheet{max-width:100%}
@media(min-width:1660px){
  .deal{grid-template-columns:clamp(430px,27vw,520px) minmax(0,1fr)}
  #form{
    height:var(--form-panel-height,calc(100vh - 100px))!important;
    max-height:var(--form-panel-height,calc(100vh - 100px))!important;
    min-height:640px;max-width:none;overflow-y:auto;
  }
  #wrap{overflow:visible}
}

/* 单据标签条 */
#tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:10px;overflow-x:auto}
#tabs button{
  background:none;color:#5b6579;border:0;border-bottom:3px solid transparent;border-radius:0;
  min-height:auto;padding:8px 12px;font-size:14px;white-space:nowrap;
}
#tabs button:hover{background:none;color:var(--accent)}
#tabs button.on{border-color:var(--accent);color:var(--accent);font-weight:600}
.doc-preview-toolbar{display:flex;align-items:flex-end;gap:12px;border-bottom:1px solid var(--border);margin-bottom:12px}
.doc-preview-toolbar #tabs{flex:1;min-width:0;margin:0;border-bottom:0}
.doc-style-picker{color:var(--muted);font-size:13px}


/* ---- 表格行内操作：默认浅色，只保留主操作蓝 ---- */
.lst .row-actions button,
.lst td button:not(.p):not(.d){background:#eef2f7;color:var(--text);min-height:28px;padding:5px 10px;font-size:12.5px;border-radius:6px}
.lst .row-actions button:hover,
.lst td button:not(.p):not(.d):hover{background:#e4eaf3;color:var(--text)}
.lst td button.d{background:#fdeceb;color:var(--red)}
.lst td button.d:hover{background:#fbdcd8;color:var(--red)}
.lst td button.p{background:var(--accent);color:#fff}

/* ============ 两栏 ============ */
.two,.two.wide{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;align-items:start}
@media(min-width:1250px){
  .two,.two.wide{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .two.wide{grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr)}
}
.two>section,.two.wide>section{min-width:0;margin-bottom:0}

/* ============ 表单栅格 ============ */
.g{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px}
.g .w{grid-column:span 2}
.item{border:1px solid var(--border);border-radius:10px;padding:10px 12px;margin:10px 0;background:#fafbfc}
.item .g{grid-template-columns:repeat(3,minmax(0,1fr))}
.item .w{grid-column:span 3}
.master-fields,.master-editor .master-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 18px}
.master-fields .w,.master-editor .master-fields .w{grid-column:1/-1}
.master-fields h3,.master-editor .master-fields h3{grid-column:1/-1;margin:16px 0 2px;padding-bottom:6px;border-bottom:1px solid var(--border)}
.kv{display:grid;grid-template-columns:1fr 1.6fr auto;gap:8px;align-items:center;margin-bottom:6px}
.tiers{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-bottom:6px}
.sups{display:grid;grid-template-columns:1.4fr 1fr 1.4fr auto;gap:8px;margin-bottom:6px}
.drop{border:1px dashed #cbd3de;border-radius:10px;padding:14px;text-align:center;color:var(--muted);font-size:12.5px;margin-top:8px}
.drop.on{border-color:var(--accent);background:#f7faff}

/* ============ 基础设置 ============ */
.settings-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:20px;align-items:start;max-width:1520px}
.settings-jump{
  display:flex;flex-direction:column;gap:2px;position:sticky;top:18px;margin:0;padding:9px;
  background:var(--card);border:1px solid var(--border);border-radius:12px;
}
.settings-jump button{
  width:100%;justify-content:flex-start;min-height:auto;padding:9px 12px;
  background:transparent;color:#5b6579;border:0;border-radius:8px;font-size:14px;
}
.settings-jump button:hover{background:#f1f4f8;color:var(--text)}
.settings-jump button:focus{outline:none}
.settings-jump button.on{padding-left:14px}
.settings-jump button.on{background:#e9f2fd;color:var(--accent);font-weight:600;box-shadow:inset 3px 0 0 var(--accent)}
.settings-stack{display:block;max-width:none;min-width:0}
.settings-stack>div{display:contents}
.settings-stack .g{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 20px}
.settings-stack section{margin-top:0!important;max-width:1120px}
@media(max-width:1250px){
  .settings-layout{grid-template-columns:1fr}
  .settings-jump{position:static;flex-direction:row;flex-wrap:wrap}
}

/* ============ 运单表格 ============ */
/* 运单表列多：宽屏固定列宽，窄屏收紧字号与内边距，尽量一屏放下 */
.shipment-table{width:100%;min-width:1180px;table-layout:fixed}
@media(max-width:1500px){
  /* 窄屏：按百分比切列，一屏放下，内容自动折行 */
  .shipment-table{min-width:0;width:100%;table-layout:fixed}
  .shipment-table th,.shipment-table td{padding:9px 8px;font-size:13px}
  .shipment-table td small{font-size:12px}
  .shipment-table th:nth-child(1){width:13%}
  .shipment-table th:nth-child(2){width:9%}
  .shipment-table th:nth-child(3){width:9%}
  .shipment-table th:nth-child(4){width:9%}
  .shipment-table th:nth-child(5){width:19%}
  .shipment-table th:nth-child(6){width:8%}
  .shipment-table th:nth-child(7){width:7%}
  .shipment-table th:nth-child(8){width:8%}
  .shipment-table th:nth-child(9){width:18%}
  .shipment-table td.num{white-space:normal}
  .shipment-table .row-actions{display:flex;flex-wrap:wrap;gap:4px}
  .shipment-table .row-actions button{min-height:26px;padding:4px 8px;font-size:12px}
  .shipment-table .products-col button{min-height:26px;padding:4px 8px;font-size:12px}
}
}
.shipment-table-wrap{overflow-x:auto;overflow-y:hidden;max-width:100%}
.shipment-table th,.shipment-table td{white-space:normal}
/* 运单表列多，字号比正文小一档，避免挤压 */
.shipment-table td{font-size:14px}
.shipment-table th{font-size:13.5px}
.shipment-table td small{font-size:12.5px}
.shipment-table .waybill-col b{font-size:14.5px}
.trace-copy{font-size:14px}
.shipment-table th{white-space:nowrap}
.shipment-table tbody tr:hover{background:#f7faff}
.shipment-table td{font-size:13px}
.shipment-table td small{font-size:12px}

/* ============ 弹窗 ============ */
.shipment-modal,.confirm-modal,.site-confirm{
  background:#fff;border:1px solid var(--border);border-radius:12px;
  box-shadow:0 16px 44px rgba(0,0,0,.22);
}
.site-confirm-head{padding:16px 18px}
.site-confirm-head h2{margin:0;font-size:16px}
.site-confirm-body{padding:18px 18px 8px;color:#5b6579;font-size:14px;line-height:1.65}
.site-confirm-x{margin-left:auto;min-height:28px;padding:4px 10px}
.action-dock{
  background:#fff;border:1px solid var(--border);border-radius:12px;
  box-shadow:0 10px 28px rgba(0,0,0,.14);padding:10px 12px;
}
.action-dock .dock-msg{color:#5b6579;font-size:13px}

/* ============ 时间线 / 待办 / 物流 ============ */
.tl2{border-left:2px solid var(--border);margin:8px 0 0 6px;padding-left:14px}
.tl2 .node{position:relative;padding:0 0 12px}
.tl2 .node::before{content:"";position:absolute;left:-21px;top:6px;width:8px;height:8px;border-radius:50%;background:var(--accent)}
.feed{margin-top:8px}
.feeditem{position:relative;padding:0 0 14px 20px;border-left:1px solid var(--border);margin-left:5px}
.feeditem:last-child{border-left-color:transparent}
.feeditem::before{content:"";position:absolute;left:-5px;top:6px;width:9px;height:9px;border-radius:50%;background:var(--accent)}
.task,.taskrow{border:1px solid var(--border);border-radius:10px;background:#fff}
.task.over,.taskrow.overdue{border-color:#f6c6c2;background:#fdf2f1}
.task.today,.taskrow.today{border-color:#f3d9a7;background:#fff8ec}
.task.done,.taskrow.done{opacity:.55}
.lookup-grid{grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:12px}
.lookup-item{padding:13px 14px;border:1px solid var(--border);border-radius:10px}
.logistics-import{border-radius:10px;padding:14px;border:1px dashed #cbd3de;background:#fafbfc}
.shipment-detail{grid-template-columns:repeat(3,minmax(0,1fr));font-size:13px;gap:6px 18px}
.preview-order-block{border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:10px}
.preview-order-head{background:#fafbfc;border-bottom:1px solid var(--border)}
.preview-order-index{background:var(--accent)}
.prog .bar2{background:#eef2f7;border-radius:6px;height:8px}
.prog .bar2 i{background:var(--accent)}

/* ============================================================
   排版尺度：随浏览器宽度自动放大
   小窗口（≈1280）下正文 13px，宽屏（≥1920）自动到 15px 左右。
   旧样式里的 px 字号在这里统一收口，不再逐条去改。
   ============================================================ */
:root{--fs-base:clamp(13px,.34vw + 8.8px,14.8px);--fs-sm:clamp(11.5px,.19vw + 8.8px,12.8px)}

body{
  font-size:var(--fs-base);
  line-height:1.6;
  padding-left:204px;
}
#side{width:204px}
#side .brand{font-size:clamp(13px,.2vw + 10.4px,14.4px);padding:12px 16px;gap:8px}
#side .brand img{width:26px;height:26px;flex:0 0 26px;border-radius:6px}
#side .nav-group{font-size:clamp(10px,.1vw + 8.8px,10.6px);padding:11px 18px 4px}
#side a.nav-item{font-size:clamp(12.5px,.16vw + 10.4px,13.4px);padding:8px 18px;gap:8px}
#side a.nav-item .ic{flex:0 0 16px;width:16px;font-size:12px}
#side a.nav-item.sub{font-size:clamp(11.5px,.13vw + 10px,12.6px);padding:6px 16px 6px 40px}
#side .side-foot{font-size:clamp(10.5px,.11vw + 9.2px,11.4px);padding:11px 18px}

#main{padding:clamp(19px,1.28vw,32px) clamp(21px,1.6vw,38px) 38px}

h1{font-size:clamp(19px,.5vw + 12.8px,25.6px);margin-bottom:16px}
h2{font-size:clamp(14.5px,.27vw + 11.2px,17.6px);margin-bottom:13px}
h3{font-size:clamp(13px,.19vw + 10.4px,15.2px)}
section{padding:18px}
section>h2{font-size:clamp(13.5px,.24vw + 11.2px,16px)}

/* 正文里的辅助文字 */
.muted,.mute,small{font-size:var(--fs-sm)}
.head small{font-size:var(--fs-sm)}
p,li,td,div{line-height:inherit}

/* 表格 */
.lst th{font-size:clamp(11.5px,.16vw + 9.6px,12.4px);padding:10px 11px}
.lst td{font-size:clamp(12px,.18vw + 10.4px,13.6px);padding:10px 11px}
.lst td small{font-size:clamp(10.5px,.12vw + 9.6px,11.6px)}

/* 表单 */
label{font-size:clamp(11.5px,.14vw + 10px,12.4px);margin:10px 0 4px}
input,select,textarea{font-size:clamp(12px,.18vw + 10.4px,13.6px);min-height:34px;padding:8px 10px}
button,.btn{font-size:clamp(12px,.16vw + 10.4px,13.2px);min-height:31px;padding:8px 14px}
button.sm{font-size:clamp(10.5px,.11vw + 9.6px,11.6px);min-height:25px;padding:5px 9px}

/* 标签 */
.tag,.chip{font-size:clamp(10.5px,.11vw + 9.6px,11.6px);padding:3px 9px}

/* 总览 */
.stats .statcard .num{font-size:clamp(23px,.48vw + 16px,29px)}
.stats .statcard .label{font-size:var(--fs-sm)}
.flow .st b{font-size:clamp(13px,.19vw + 10.8px,14.4px)}
.flow .st i,.flow .st span{font-size:clamp(11px,.13vw + 9.6px,12px)}
.qbtn{font-size:clamp(11.5px,.14vw + 10px,12.4px);padding:14px 8px 12px}
.qbtn .qi{height:38px;margin-bottom:7px}
.qbtn .qi svg{width:50px;height:40px}

/* 产品卡片 */
.card b{font-size:clamp(12px,.16vw + 10.4px,13.2px);font-weight:600}
.card .sub{font-size:clamp(11px,.13vw + 9.6px,12px)}
.card .ph{height:120px}
.card .ph img{height:120px}

/* 页头与单据标签 */
#tabs button{font-size:clamp(11.5px,.14vw + 10.4px,12.8px);padding:7px 11px}
.doc-style-picker{font-size:var(--fs-sm)}
.quick .qbtn{min-height:0}

/* 侧栏变宽后，单据页并排阈值同步上调 */
@media(min-width:1700px){
  .deal{grid-template-columns:clamp(352px,21.6vw,432px) minmax(0,1fr)}
}

/* 表格里的文字型操作链接（编辑 / 删除）保持链接样式 */
.lst td a:not(.btn){color:var(--accent);text-decoration:none;font-size:inherit}
.lst td a:not(.btn):hover{text-decoration:underline}
.lst td a.d{color:var(--red)}
/* 表格里的按钮统一淡色，避免整屏蓝色按钮 */
.lst td>button,.lst td>.row-actions button{
  background:#eef2f7;color:var(--text);min-height:25px;padding:5px 9px;
  font-size:clamp(10.5px,.11vw + 9.6px,11.6px);border-radius:5px;
}
.lst td>button:hover,.lst td>.row-actions button:hover{background:#e4eaf3;color:var(--text)}
.lst td>button.d,.lst td>.row-actions button.d{background:#fdeceb;color:var(--red)}
.lst td>button.p,.lst td>.row-actions button.p{background:var(--accent);color:#fff}

/* 表格里的 a.btn（如列表行末的「编辑」）用淡色小按钮，别整屏蓝块 */
.lst td a.btn{
  background:#eef2f7;color:var(--text);min-height:25px;padding:5px 9px;
  font-size:clamp(10.5px,.11vw + 9.6px,11.6px);border-radius:5px;font-weight:400;
}
.lst td a.btn:hover{background:#e4eaf3;color:var(--text)}

/* 宽屏铺满：内容区不吃旧样式的 max-width，section 占满可用宽度 */
#main>section,#main>.two,#main>.stats,#main>.flow,#main>.head{max-width:none}
#main section{min-width:0}
/* 表格过宽时在容器内横向滚动，不把整个页面撑出横向滚动条 */
#main .tablewrap,#main .shipment-table-wrap{overflow-x:auto;max-width:100%}
#main .tablewrap>table,#main .shipment-table-wrap>table{max-width:none}

/* 单据预览：跟着容器走，不再固定在中间留白 */
#doc{max-width:none;width:100%}
#doc .doc-sheet{width:100%;max-width:none;box-sizing:border-box}
#wrap>section{padding:18px 20px}

/* 壳子铺满：侧栏 fixed 在左，内容区用 margin-left 让开，宽度取剩下的全部。
   不写 width:100%，也不给 body 加内边距 —— 两者相加会超出屏幕右边。 */
/* 只作用于工作台页面（登录页没有 #main，保持自己的居中布局） */
body:has(#main){display:block!important;padding:0!important;width:auto!important;max-width:none!important}
#side{width:204px!important}
body:has(#main) #main{
  display:block!important;flex:none!important;
  width:auto!important;max-width:none!important;min-width:0;
  margin:0 0 0 204px;
}
#main>*,#main>section,#main>.head,#main>.stats,#main>.flow,#main>.two,
.settings-layout,.settings-stack,.settings-stack section,.deal,#form,#wrap{max-width:none}

/* 侧栏底部：账号一行，修改密码 / 退出登录 一行 */
#side .side-foot{flex-wrap:wrap;row-gap:6px}
#side .side-foot .who{flex:1 1 100%}


