/* ==========================================================================
   BizMS · 业务系统前端主题
   视觉规范对齐 TDesign（Tencent Design）设计语言：
   品牌色 / 功能色 / 灰阶 / 文字透明度体系 / 圆角 / 阴影 全部取自官方设计变量。
   本文件保持零依赖：不引入 npm 或构建工具，纯 CSS 复刻 TDesign 视觉规范。
   ========================================================================== */

:root {
  /* ---------- TDesign 品牌色 ----------
     主色 --brand 可在「界面设置」里切换，其余梯度由它派生，保证全站配色一致 */
  --brand: #0052d9;
  --td-brand-1: color-mix(in srgb, var(--brand) 8%, #fff);
  --td-brand-2: color-mix(in srgb, var(--brand) 18%, #fff);
  --td-brand-3: color-mix(in srgb, var(--brand) 32%, #fff);
  --td-brand-4: color-mix(in srgb, var(--brand) 50%, #fff);
  --td-brand-5: color-mix(in srgb, var(--brand) 68%, #fff);
  --td-brand-6: color-mix(in srgb, var(--brand) 85%, #fff);
  --td-brand-7: var(--brand);
  --td-brand-8: color-mix(in srgb, var(--brand) 84%, #000);
  --td-brand-9: color-mix(in srgb, var(--brand) 68%, #000);

  /* ---------- TDesign 功能色 ---------- */
  --td-error-1: #fff0ed;   --td-error-3: #ffb9b0;   --td-error: #d54941;
  --td-warning-1: #fff1e9; --td-warning-3: #ffb98c; --td-warning: #e37318;
  --td-success-1: #e3f9e9; --td-success-3: #92dab2; --td-success: #2ba471;

  /* ---------- TDesign 灰阶 ---------- */
  --td-gray-1: #f3f3f3;  --td-gray-2: #eeeeee;  --td-gray-3: #e7e7e7;
  --td-gray-4: #dcdcdc;  --td-gray-5: #c5c5c5;  --td-gray-7: #8b8b8b;
  --td-gray-9: #5e5e5e;  --td-gray-11: #383838; --td-gray-13: #242424;

  /* ---------- TDesign 文字色（透明度体系，对比度 ≥ 4.5:1） ---------- */
  --td-text-1: rgba(0, 0, 0, 0.9);
  --td-text-2: rgba(0, 0, 0, 0.6);
  --td-text-3: rgba(0, 0, 0, 0.4);
  --td-text-4: rgba(0, 0, 0, 0.26);

  /* ---------- TDesign 背景 / 边框 ---------- */
  --td-bg-page: #f3f3f3;
  --td-bg-container: #ffffff;
  --td-bg-hover: #f5f6f8;
  --td-border-1: #e7e7e7;
  --td-border-2: #dcdcdc;

  /* ---------- TDesign 圆角 ---------- */
  --td-radius-s: 3px; --td-radius-m: 6px; --td-radius-l: 8px; --td-radius-xl: 12px;

  /* ---------- TDesign 阴影 ---------- */
  --td-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.03);
  --td-shadow-2: 0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12);
  --td-shadow-3: 0 10px 40px rgba(0, 0, 0, 0.16);

  /* ---------- 兼容旧变量（供页面内联样式引用） ---------- */
  --primary: var(--td-brand-7);
  --primary-dark: var(--td-brand-8);
  --danger: var(--td-error);
  --warn: var(--td-warning);
  --ok: var(--td-success);
  --bg: var(--td-bg-page);
  --card: var(--td-bg-container);
  --line: var(--td-border-1);
  --text: var(--td-text-1);
  --muted: var(--td-text-2);
  --sidebar-w: 232px;
  --radius: var(--td-radius-m);
}

/* ==========================================================================
   基础
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5715;
  color: var(--td-text-1);
  background: var(--td-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
a { color: var(--td-brand-7); text-decoration: none; }
::selection { background: var(--td-brand-2); }
.hidden { display: none !important; }
.muted { color: var(--td-text-2); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--td-gray-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--td-gray-5); }

/* ==========================================================================
   登录页（结构参考 TDesign Starter 登录模板：
   全屏背景 + 左侧标题区 + 400px 表单区 + 左下角 Copyright）
   ========================================================================== */
.login-mask {
  position: fixed; inset: 0; z-index: 100; overflow: auto;
  display: flex; flex-direction: column;
  background-color: #fff;
  background-size: cover; background-position: 100%;
  background-repeat: no-repeat;
}

/* ---- 背景：右侧品牌插画 ---- */
#login-view .lg-bg {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none;
  background: #fff url("../img/login-bg.jpg") center right / cover no-repeat;
}
#login-view .lg-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #ffffff 26%, rgba(255, 255, 255, .82) 44%, rgba(255, 255, 255, 0) 66%);
}

/* ---- 主体容器（模板：左侧留白式，非卡片） ---- */
#login-view .lg-container {
  position: absolute; top: 18%; left: 6%;
  min-height: 500px; width: 400px; max-width: calc(100% - 48px);
}

/* 品牌行 */
#login-view .lg-brand { display: flex; align-items: center; gap: 10px; }
#login-view .lg-logo {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  font-size: 16px; font-weight: 700; letter-spacing: .5px;
}
#login-view .lg-brand-name { font-size: 15px; font-weight: 600; color: var(--td-text-1); }

/* 标题区：headline-large 两行 */
#login-view .lg-title {
  margin-top: 6px; font-size: 34px; line-height: 1.35; font-weight: 600;
  color: var(--td-text-1); letter-spacing: .5px;
}
#login-view .lg-title-strong { margin-top: 0; color: var(--brand); }
#login-view .lg-sub {
  margin-top: 24px; font-size: 14px; line-height: 1.8;
  color: var(--td-text-2);
}

/* ---- 表单区 ---- */
#login-view .lg-form { width: 400px; max-width: 100%; margin-top: 40px; animation: lg-in .4s ease both; }
@keyframes lg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 登录页「企业微信登录」：浅色底 + 描边按钮，与实心主按钮区分开（登录页为白底，勿用白色文字） */
.lg-wecom { width: 400px; max-width: 100%; margin-top: 24px; animation: lg-in .5s ease both; }
.lg-wecom-line {
  position: relative; text-align: center; margin-bottom: 18px;
  font-size: 12px; color: var(--td-text-3);
}
.lg-wecom-line::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1px;
  background: var(--td-border-1);
}
.lg-wecom-line span {
  position: relative; padding: 0 12px; background: #fff;
}
.lg-wecom-btn {
  width: 100%; height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; color: var(--td-text-1); cursor: pointer;
  background: #fff; border: 1px solid var(--td-border-2);
  border-radius: var(--td-radius-m); transition: background .2s, border-color .2s;
}
.lg-wecom-btn:hover { background: var(--td-brand-1, #f2f7ff); border-color: var(--brand, #0052d9); }
.lg-wecom-btn svg { flex: none; opacity: .9; color: var(--brand, #0052d9); }

/* 登录页双页签：账号密码 / 企业微信扫码 */
#login-view .lg-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--td-border-1);
}
#login-view .lg-tab {
  flex: 1; padding: 10px 0 12px; font-size: 14px; cursor: pointer;
  background: none; border: none; color: var(--td-text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
#login-view .lg-tab.active { color: var(--brand, #0052d9); font-weight: 600; border-bottom-color: var(--brand, #0052d9); }
#login-view .lg-tab:hover { color: var(--brand, #0052d9); }
#lg-pane-qr { min-height: 300px; }
#lg-qr-box { display: flex; justify-content: center; }
#lg-qr-box iframe { border-radius: 8px; }
.lg-qr-tip { margin-top: 10px; text-align: center; font-size: 13px; color: var(--td-text-3); }
.lg-qr-tip b { color: var(--brand, #0052d9); }

#login-view .lg-field { margin-bottom: 20px; }
#login-view .lg-field label {
  display: block; margin-bottom: 8px;
  font-size: 14px; color: var(--td-text-1);
}
#login-view .lg-input-wrap { position: relative; display: flex; align-items: center; }
#login-view .lg-ico { position: absolute; left: 12px; color: var(--td-text-4); pointer-events: none; }
#login-view .lg-input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; font-size: 14px;
  border: 1px solid var(--td-border-2); border-radius: var(--td-radius-m);
  background: #fff; color: var(--td-text-1);
  transition: border-color .18s, box-shadow .18s;
}
#login-view .lg-input::placeholder { color: var(--td-text-4); }
#login-view .lg-input:hover { border-color: var(--td-brand-5); }
#login-view .lg-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 16%, transparent);
}
#login-view .lg-eye {
  position: absolute; right: 6px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--td-text-4); border-radius: var(--td-radius-s);
}
#login-view .lg-eye:hover { color: var(--td-text-2); background: var(--td-bg-hover); }

/* 记住 / 忘记：两端对齐（对齐模板 check-container） */
#login-view .lg-check {
  display: flex; align-items: center; justify-content: space-between;
  margin: -4px 0 0; font-size: 14px;
}
#login-view .lg-remember {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--td-text-2); cursor: pointer; user-select: none;
}
#login-view .lg-remember input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
#login-view .lg-forgot { color: var(--brand); cursor: pointer; }
#login-view .lg-forgot:hover { color: var(--td-brand-8); }

#login-view .lg-err { min-height: 18px; margin: 6px 0 0; font-size: 13px; }

#login-view .lg-btn-box { margin-top: 24px; }
#login-view .lg-btn {
  height: 40px; width: 100%; border-radius: var(--td-radius-m);
  font-size: 15px; letter-spacing: 2px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
#login-view .lg-spinner {
  display: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff;
  animation: lg-spin .7s linear infinite;
}
@keyframes lg-spin { to { transform: rotate(360deg); } }
#login-view .lg-btn.is-loading .lg-spinner { display: inline-block; }
#login-view .lg-btn.is-loading { opacity: .92; }
#login-view .lg-shake { animation: lg-shake .3s ease both; }
@keyframes lg-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 底部提示（模板 switch-container 位置） */
#login-view .lg-switch {
  margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 14px; row-gap: 6px;
  font-size: 13px; color: var(--td-text-3);
}
#login-view .lg-switch span { position: relative; }
#login-view .lg-switch span + span::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 12px; background: var(--td-border-2);
}

/* 版权（模板 copyright：左下角绝对定位） */
#login-view .lg-copyright {
  position: absolute; left: 6%; bottom: 48px;
  font-size: 13px; color: var(--td-text-3);
}

/* 窄屏：改为常规流布局，插画弱化 */
@media (max-width: 900px) {
  .lg-bg::after { background: linear-gradient(180deg, rgba(255, 255, 255, .94) 40%, rgba(255, 255, 255, .55)); }
  .lg-container { position: static; margin: 72px auto 0; padding: 0 24px; min-height: 0; }
  .lg-title { font-size: 27px; }
  .lg-form { margin-top: 28px; }
  .lg-copyright { position: static; margin: 32px auto 24px; text-align: center; }
}
@media screen and (max-height: 680px) {
  .lg-copyright { display: none; }
}

/* ==========================================================================
   门户首页（未登录时的对外展示页：顶部品牌条 + Hero + 能力卡片 + 页脚）
   ========================================================================== */
.portal { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
html { scroll-behavior: smooth; }
/* 锚点跳转时避开吸顶导航 */
.portal section { scroll-margin-top: 64px; }

/* ---- 顶部品牌条 ---- */
.pt-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--td-border-1);
}
.pt-head-in {
  max-width: 1160px; margin: 0 auto; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
}
.pt-logo {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 700;
}
.pt-head-txt { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.pt-head-txt strong { font-size: 15px; font-weight: 600; color: var(--td-text-1); }
.pt-head-txt span { font-size: 12px; color: var(--td-text-3); }
.pt-nav { display: flex; align-items: center; gap: 22px; margin-right: 22px; }
.pt-nav a {
  position: relative; font-size: 14px; color: var(--td-text-2);
  padding: 4px 0; transition: color .18s;
}
.pt-nav a::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 0; height: 2px;
  background: var(--brand); border-radius: 2px;
  transform: translateX(-50%); transition: width .18s;
}
.pt-nav a:hover { color: var(--td-text-1); }
.pt-nav a.is-active { color: var(--brand); font-weight: 500; }
.pt-nav a.is-active::after { width: 18px; }
.pt-link { font-size: 14px; font-weight: 500; color: var(--brand); white-space: nowrap; }
.pt-link:hover { color: var(--td-brand-8); }

/* ---- 公司简介：白底 + 细点阵 + 右上角光晕 ---- */
.pt-about { position: relative; overflow: hidden; background: #fff; }
.pt-about::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(420px 300px at 88% -8%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(6px 6px at 4px 4px, var(--td-border-1) 1px, transparent 1px) 0 0 / 30px 30px;
  opacity: .75;
}
.pt-about-in { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; padding: 56px 24px 48px; }
.pt-about-body { margin-top: 28px; }
.pt-about-body p { font-size: 15px; line-height: 2; color: var(--td-text-2); text-indent: 2em; }
.pt-about-body p + p { margin-top: 12px; }
.pt-hl {
  margin-top: 36px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.pt-hl-item {
  padding: 18px 20px; border-radius: var(--td-radius-l);
  background: color-mix(in srgb, var(--brand) 6%, #fff);
  display: flex; flex-direction: column; gap: 6px;
}
.pt-hl-item strong { font-size: 15px; color: var(--td-brand-8); }
.pt-hl-item span { font-size: 13px; color: var(--td-text-2); }

/* ---- Hero：整幅照片做底 + 品牌色渐变压暗 + 光斑与细网格，避免大片留白 ---- */
.pt-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: #0b1a2b url("../img/login-bg.jpg") center / cover no-repeat;
}
/* 压暗层：保证白色标题的对比度 */
.pt-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(105deg,
    color-mix(in srgb, var(--td-brand-9) 88%, #000) 0%,
    rgba(8, 22, 40, .82) 52%,
    rgba(8, 22, 40, .58) 100%);
}
/* 装饰层：两处光斑 + 竖向细网格 */
.pt-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; mix-blend-mode: screen; opacity: .9;
  background:
    radial-gradient(560px 340px at 10% 16%, color-mix(in srgb, var(--brand) 60%, transparent), transparent 72%),
    radial-gradient(460px 320px at 92% 82%, rgba(43, 164, 113, .38), transparent 72%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 76px);
}
.pt-hero-in { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 104px 24px 112px; }
.pt-hero-title {
  font-size: 46px; line-height: 1.3; font-weight: 600; letter-spacing: .5px;
  color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
}
.pt-hero-sub { margin-top: 20px; font-size: 16px; line-height: 1.9; color: rgba(255, 255, 255, .84); }
.pt-hero-btns { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.pt-btn-lg {
  height: 44px; padding: 0 28px; border-radius: var(--td-radius-m);
  font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
}
/* 深色底上按钮反白，主按钮用白底品牌字 */
.pt-hero .btn.primary { background: #fff; color: var(--td-brand-8); }
.pt-hero .btn.primary:hover { background: color-mix(in srgb, #fff 86%, var(--brand)); }
.pt-hero .btn:not(.primary) {
  background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .45);
}
.pt-hero .btn:not(.primary):hover { background: rgba(255, 255, 255, .18); border-color: #fff; }

/* 数据条（毛玻璃卡片，压在照片上） */
.pt-stats {
  margin-top: 56px; display: grid; gap: 12px; max-width: 760px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.pt-stat {
  padding: 18px 20px; border-radius: var(--td-radius-l);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 4px;
}
.pt-stat strong { font-size: 30px; line-height: 1.2; font-weight: 600; color: #fff; }
.pt-stat strong em { font-style: normal; font-size: 15px; margin-left: 2px; }
.pt-stat span { font-size: 13px; color: rgba(255, 255, 255, .78); }

/* ---- 通用区块容器 ---- */
.pt-sec-in { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 64px 24px; }
.pt-sec-sub { margin-top: 12px; text-align: center; font-size: 14px; color: var(--td-text-2); }
/* 标题下的一小段渐变条，纯文字标题也有一点视觉重心 */
.pt-sec-title::after {
  content: ""; display: block; width: 40px; height: 3px; margin: 14px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 25%, #fff));
}

/* ---- 业务范围（带图标卡片）：浅色渐变底 + 光斑 ---- */
.pt-biz { position: relative; overflow: hidden; background: linear-gradient(180deg, #f6f9fd 0%, #fff 100%); }
.pt-biz::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 300px at 12% 8%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
    radial-gradient(420px 300px at 88% 92%, rgba(43, 164, 113, .12), transparent 70%);
}
.pt-ico {
  width: 44px; height: 44px; border-radius: var(--td-radius-l);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, #fff);
}
.pt-card-icon { position: relative; overflow: hidden; }
.pt-card-icon::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 20%, #fff));
  opacity: 0; transition: opacity .18s;
}
.pt-card-icon:hover::before { opacity: 1; }
.pt-card-icon h3 { margin-top: 16px; }

/* ---- 服务流程：深色渐变通栏，与浅色区块形成节奏 ---- */
.pt-flow { position: relative; overflow: hidden; color: #fff; background: linear-gradient(120deg, var(--td-brand-9), #0e2a4d 58%, #08203a 100%); }
.pt-flow::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .85;
  background:
    radial-gradient(460px 300px at 86% 12%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 72%),
    radial-gradient(380px 260px at 8% 88%, rgba(43, 164, 113, .3), transparent 72%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 76px);
}
.pt-flow .pt-sec-title { color: #fff; }
.pt-flow .pt-sec-title::after { background: rgba(255, 255, 255, .85); }
.pt-flow .pt-sec-sub { color: rgba(255, 255, 255, .78); }
.pt-steps {
  margin: 40px 0 0; padding: 0; list-style: none;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.pt-steps li {
  position: relative; padding: 24px 20px; border-radius: var(--td-radius-l);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column; gap: 6px;
}
.pt-steps li::after {
  content: ""; position: absolute; top: 50%; right: -8px; transform: translateY(-50%);
  width: 16px; height: 2px; background: rgba(255, 255, 255, .4);
}
.pt-steps li:last-child::after { display: none; }
.pt-step-n { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: color-mix(in srgb, var(--brand) 35%, #fff); }
.pt-steps strong { font-size: 15px; color: #fff; }
.pt-step-d { font-size: 13px; line-height: 1.7; color: rgba(255, 255, 255, .8); }

/* ---- 在线提交需求：浅色渐变 + 点阵 ---- */
.pt-lead { position: relative; overflow: hidden; background: linear-gradient(180deg, #fff 0%, #f5f8fd 100%); }
.pt-lead::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background:
    radial-gradient(460px 300px at 10% 20%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
    radial-gradient(6px 6px at 4px 4px, var(--td-border-1) 1px, transparent 1px) 0 0 / 30px 30px;
}
.pt-form { max-width: 760px; margin: 32px auto 0; }
.pt-form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.pt-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pt-field > span { font-size: 13px; color: var(--td-text-2); }
.pt-field > span i { font-style: normal; color: var(--td-error); margin-left: 2px; }
.pt-field .input { height: 40px; width: 100%; }
.pt-field textarea.input { height: auto; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.pt-form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.pt-form-tip { font-size: 13px; color: var(--td-text-2); min-height: 20px; }
.pt-form-tip.is-err { color: var(--td-error); }
.pt-form-tip.is-ok { color: var(--td-success); }

/* ---- 联系我们 ---- */
.pt-contact {
  position: relative; overflow: hidden;
  background: #0f2c4f url("../img/login-bg.jpg") center / cover no-repeat;
}
/* 压暗 + 光斑：与 Hero 呼应，收尾处留一点分量 */
.pt-contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, rgba(7, 26, 48, .92) 0%, rgba(7, 26, 48, .78) 60%, rgba(7, 26, 48, .7) 100%);
}
.pt-contact::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background:
    radial-gradient(520px 320px at 82% 20%, color-mix(in srgb, var(--brand) 60%, transparent), transparent 72%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 76px);
}
.pt-contact .pt-contact-txt h2,
.pt-contact .pt-contact-txt strong { color: #fff; }
.pt-contact .pt-contact-txt > p,
.pt-contact .pt-contact-list span { color: rgba(255, 255, 255, .78); }
.pt-contact .pt-contact-list strong { color: #fff; }
.pt-contact-box {
  display: grid; gap: 32px; grid-template-columns: 1.4fr .8fr; align-items: center;
}
.pt-contact-txt h2 { font-size: 24px; font-weight: 600; color: var(--td-text-1); }
.pt-contact-txt > p { margin-top: 10px; font-size: 14px; color: var(--td-text-2); }
.pt-contact-list { margin-top: 24px; display: grid; gap: 14px; }
.pt-contact-list div { display: flex; flex-direction: column; gap: 2px; }
.pt-contact-list span { font-size: 13px; color: var(--td-text-3); }
.pt-contact-list strong { font-size: 15px; font-weight: 500; color: var(--td-text-1); }
/* 微信二维码卡位（图片缺失时显示占位提示） */
.pt-qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 24px; border-radius: var(--td-radius-xl);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(3, 18, 36, .25);
}
.pt-qr-frame {
  width: 168px; height: 168px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--td-radius-lg); background: #fff; overflow: hidden; padding: 8px;
}
.pt-qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pt-qr-ph {
  display: none; text-align: center; font-size: 12px; line-height: 1.7; color: var(--td-text-3);
}
.pt-qr-frame.is-empty img { display: none; }
.pt-qr-frame.is-empty { border: 1px dashed var(--td-border-2); }
.pt-qr-frame.is-empty .pt-qr-ph { display: block; }
.pt-qr-tip { font-size: 13px; color: rgba(255, 255, 255, .8); text-align: center; }

/* ---- 滚动进场 ---- */
.pt-reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.pt-reveal.is-in { opacity: 1; transform: none; }

/* ---- 区块标题 / 卡片栅格 ---- */
.pt-sec-title { font-size: 24px; font-weight: 600; text-align: center; color: var(--td-text-1); }
.pt-grid {
  margin-top: 32px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pt-card {
  padding: 24px; background: var(--td-bg-container);
  border: 1px solid var(--td-border-1); border-radius: var(--td-radius-l);
  box-shadow: var(--td-shadow-1);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pt-card:hover { transform: translateY(-3px); border-color: var(--td-brand-5); box-shadow: var(--td-shadow-2); }
.pt-card h3 { font-size: 16px; font-weight: 600; color: var(--td-text-1); }
.pt-card p { margin-top: 10px; font-size: 13px; line-height: 1.8; color: var(--td-text-2); }

/* ---- 页脚 ---- */
.pt-foot { margin-top: auto; border-top: 1px solid var(--td-border-1); background: #fff; }
.pt-foot-in {
  max-width: 1160px; margin: 0 auto; padding: 20px 24px;
  display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: center;
  font-size: 13px; color: var(--td-text-3);
}

@media (max-width: 900px) {
  .pt-hero-in { padding: 48px 20px 56px; }
  .pt-hero-title { font-size: 28px; }
  .pt-hero-sub { font-size: 14px; }
  .pt-head-in { padding: 0 16px; gap: 8px; }
  .pt-nav { display: none; }              /* 窄屏：隐藏导航，保留右上角系统入口 */
  .pt-stats { margin-top: 36px; }
  .pt-stat strong { font-size: 24px; }
  .pt-sec-in { padding: 44px 20px; }
  .pt-about-in { padding: 44px 20px; }
  .pt-contact-box { grid-template-columns: 1fr; }
  .pt-form-row { grid-template-columns: 1fr; }
}

/* 登录页「返回门户首页」 */
#login-view .lg-back {
  position: absolute; top: 24px; left: 6%; z-index: 2;
  font-size: 13px; color: var(--td-text-2);
}
#login-view .lg-back:hover { color: var(--brand); }

/* ==========================================================================
   布局骨架
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--td-bg-container); border-right: 1px solid var(--td-border-1);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  transition: width .2s ease-in-out;
}
.brand {
  display: flex; align-items: center; gap: 10px; height: 56px; flex: 0 0 56px;
  padding: 0 16px; border-bottom: 1px solid var(--td-border-1); overflow: hidden;
}
.logo-mark {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: var(--td-radius-m);
  display: flex; align-items: center; justify-content: center;
  background: var(--td-brand-7); color: #fff; font-size: 15px; font-weight: 700;
}
.brand-txt { font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--td-text-1); white-space: nowrap; }
.brand-txt em { display: block; font-style: normal; font-size: 11px; font-weight: 400; color: var(--td-text-3); }

/* ---- 分组导航（可折叠） ---- */
.nav { flex: 1; padding: 8px 0 16px; overflow-y: auto; overflow-x: hidden; }
.nav-group { margin-bottom: 2px; }
.nav-group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 8px; padding: 8px 12px; border-radius: var(--td-radius-m);
  color: var(--td-text-2); font-size: 14px; cursor: pointer; user-select: none;
  transition: background-color .18s, color .18s;
}
.nav-group-head:hover { background: var(--td-bg-hover); color: var(--td-text-1); }
.nav-group.has-active > .nav-group-head { color: var(--td-text-1); font-weight: 500; }
.ng-arrow { margin-left: auto; color: var(--td-text-3); transition: transform .2s ease; }
.nav-group.open > .nav-group-head > .ng-arrow { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 4px; }
.nav-group.open > .nav-sub { display: block; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 8px 2px 20px; padding: 7px 12px; border-radius: var(--td-radius-m);
  color: var(--td-text-2); font-size: 14px; cursor: pointer;
  transition: background-color .18s, color .18s;
}
.nav-item:hover { background: var(--td-bg-hover); color: var(--td-text-1); }
.nav-item.active { background: var(--td-brand-1); color: var(--td-brand-7); font-weight: 500; }
.nav .ti { width: 16px; height: 16px; flex: 0 0 16px; font-size: 16px; }
.nav-group-head .ng-txt, .nav-item .ni-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { padding: 8px; border-top: 1px solid var(--td-border-1); }
.nav-collapse {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; border: none; background: transparent; border-radius: var(--td-radius-m);
  color: var(--td-text-3); font-size: 13px; text-align: left;
}
.nav-collapse:hover { background: var(--td-bg-hover); color: var(--td-text-1); }
.nav-collapse .ti { width: 16px; height: 16px; flex: 0 0 16px; font-size: 16px; }

/* ---- 收起态（仅图标） ---- */
.app.aside-mini { --sidebar-w: 64px; }
.aside-mini .brand { justify-content: center; padding: 0 8px; }
.aside-mini .brand-txt,
.aside-mini .ng-txt,
.aside-mini .ng-arrow,
.aside-mini .nc-txt,
.aside-mini .nav-sub { display: none; }
.aside-mini .nav-group-head,
.aside-mini .nav-item,
.aside-mini .nav-collapse { justify-content: center; margin: 2px 8px; padding: 8px 0; }
.aside-mini .nav .ti { width: 18px; height: 18px; flex: 0 0 18px; font-size: 18px; }

/* ---- 暗色侧边栏 ---- */
.sidebar.is-dark { background: var(--td-gray-13); border-right-color: var(--td-gray-13); }
.sidebar.is-dark .brand { border-bottom-color: rgba(255, 255, 255, .12); }
.sidebar.is-dark .brand-txt { color: #fff; }
.sidebar.is-dark .brand-txt em { color: rgba(255, 255, 255, .5); }
.sidebar.is-dark .nav-group-head,
.sidebar.is-dark .nav-item { color: rgba(255, 255, 255, .75); }
.sidebar.is-dark .nav-group-head:hover,
.sidebar.is-dark .nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar.is-dark .nav-item.active { background: var(--td-brand-7); color: #fff; }
.sidebar.is-dark .sidebar-foot { border-top-color: rgba(255, 255, 255, .12); }
.sidebar.is-dark .nav-collapse { color: rgba(255, 255, 255, .6); }
.sidebar.is-dark .nav-collapse:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- 主区 ---------- */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; transition: margin-left .2s ease-in-out; }
.topbar {
  height: 56px; flex: 0 0 56px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--td-border-1);
  display: flex; align-items: center; justify-content: space-between;
}
.tb-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.icon-btn {
  width: 32px; height: 32px; flex: 0 0 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--td-radius-m);
  color: var(--td-text-2); cursor: pointer; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--td-gray-1); color: var(--td-text-1); }
.icon-btn .ti { width: 18px; height: 18px; font-size: 18px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--td-text-3); }
.cb-item[data-go] { cursor: pointer; }
.cb-item[data-go]:hover { color: var(--td-brand-7); }
.cb-item.cur { color: var(--td-text-1); font-weight: 500; }
.cb-sep { color: var(--td-text-4); }
.top-right { display: flex; align-items: center; gap: 8px; }
.user-wrap { position: relative; }
.user-box {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: var(--td-radius-m); cursor: pointer;
}
.user-box:hover { background: var(--td-bg-hover); }
.user-menu {
  position: absolute; top: 42px; right: 0; z-index: 40; min-width: 148px; padding: 6px;
  background: var(--td-bg-container); border: 1px solid var(--td-border-1);
  border-radius: var(--td-radius-l); box-shadow: var(--td-shadow-2);
}
.user-menu a {
  display: block; padding: 8px 10px; border-radius: var(--td-radius-m);
  font-size: 13px; color: var(--td-text-1); cursor: pointer;
}
.user-menu a:hover { background: var(--td-bg-hover); }
.user-menu a.divider {
  margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--td-border-1); color: var(--td-error);
}

/* ---------- 界面设置抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: 360px; max-width: 92vw; display: flex; flex-direction: column;
  background: var(--td-bg-container); box-shadow: var(--td-shadow-3);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--td-border-1); font-size: 16px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { padding: 12px 20px 20px; }
.set-block { margin-bottom: 24px; }
.set-label { margin-bottom: 8px; font-size: 13px; color: var(--td-text-2); }
.seg { display: inline-flex; padding: 2px; background: var(--td-gray-1); border-radius: var(--td-radius-m); }
.seg button {
  padding: 6px 18px; border: none; background: transparent; border-radius: var(--td-radius-s);
  font-size: 13px; color: var(--td-text-2); cursor: pointer;
}
.seg button.on { background: var(--td-bg-container); color: var(--td-brand-7); font-weight: 500; box-shadow: var(--td-shadow-1); }
.color-list { display: flex; gap: 10px; }
.color-dot { width: 24px; height: 24px; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }
.color-dot.on { border-color: var(--td-text-1); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--td-gray-4); border-radius: 999px; transition: background-color .2s; }
.switch i::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s;
}
.switch input:checked + i { background: var(--td-brand-7); }
.switch input:checked + i::after { transform: translateX(18px); }
.avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--td-brand-7), var(--td-brand-5));
  color: #fff; font-size: 12px; font-weight: 500;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta b { font-size: 12px; font-weight: 500; color: var(--td-text-1); }
.user-meta em { font-style: normal; font-size: 11px; color: var(--td-text-3); }
.content { padding: 20px 24px 32px; }

/* ==========================================================================
   待办消息通知（右上角铃铛 + 下拉面板）
   ========================================================================== */
.notice { position: relative; }
.notice-btn {
  position: relative; width: 32px; height: 32px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 50%;
  transition: background-color .15s;
}
.notice-btn:hover { background: var(--td-gray-1); }
.notice-btn.active { background: var(--td-gray-2); }
.notice-btn { color: var(--td-text-2); }
.notice-btn:hover { color: var(--td-text-1); }
.notice-btn .ti { width: 18px; height: 18px; font-size: 18px; }
.notice-badge {
  position: absolute; top: 0; right: -2px;
  min-width: 12px; height: 12px; padding: 0 3px; box-sizing: content-box;
  border: 2px solid var(--td-bg-container); border-radius: 999px;
  background: var(--td-error); color: #fff;
  font-size: 10px; font-weight: 500; line-height: 12px; text-align: center;
}
.notice-badge.level-warn { background: var(--td-warning); }
.notice-badge.level-info { background: var(--td-brand-7); }
.notice-panel {
  position: absolute; top: 40px; right: 0; z-index: 40;
  width: 344px; max-height: 70vh; overflow-y: auto;
  background: var(--td-bg-container); border: 1px solid var(--td-border-1);
  border-radius: var(--td-radius-l); box-shadow: var(--td-shadow-2);
}
.notice-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 11px 14px;
  background: var(--td-bg-container); border-bottom: 1px solid var(--td-border-1);
}
.notice-head b { font-size: 13px; font-weight: 600; color: var(--td-text-1); }
.notice-head .link { font-size: 12px; font-weight: 400; cursor: pointer; }
.notice-list { padding: 6px; }
.notice-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px;
  border-radius: var(--td-radius-m); cursor: pointer; transition: background-color .15s;
}
.notice-item:hover { background: var(--td-bg-hover); }
.notice-item .ni-icon {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: var(--td-gray-1);
}
.notice-item.level-danger .ni-icon { background: var(--td-error-1); }
.notice-item.level-warn .ni-icon { background: var(--td-warning-1); }
.notice-item.level-info .ni-icon { background: var(--td-brand-1); }
.notice-item .ni-body { flex: 1; min-width: 0; }
.notice-item .ni-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--td-text-1);
}
.notice-item .ni-count { font-size: 13px; font-weight: 600; color: var(--td-brand-7); }
.notice-item.level-danger .ni-count { color: var(--td-error); }
.notice-item.level-warn .ni-count { color: var(--td-warning); }
.notice-item .ni-desc { margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--td-text-2); }
.notice-item .ni-samples { margin-top: 3px; font-size: 11px; color: var(--td-text-3); }
.notice-empty { padding: 30px 0; text-align: center; color: var(--td-text-3); font-size: 13px; }
.notice-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 11px; border-top: 1px solid var(--td-border-1);
  font-size: 11px; color: var(--td-text-3);
}
@media (max-width: 900px) {
  .notice-panel { width: min(86vw, 344px); }
}

/* ==========================================================================
   卡片 / 工具栏
   ========================================================================== */
.card {
  background: var(--td-bg-container); border: 1px solid var(--td-border-1);
  border-radius: var(--td-radius-m); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--td-shadow-1);
}
.card-title {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 600; color: var(--td-text-1); margin-bottom: 16px;
}
.card-title > .link { font-size: 13px; font-weight: 400; }
.card-inline-title {
  font-size: 14px; font-weight: 500; color: var(--td-text-1);
  margin: 4px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--td-border-1);
}
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; }
.float-right { float: right; }

/* ==========================================================================
   表格
   ========================================================================== */
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th,
table.grid td {
  padding: 11px 12px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--td-gray-2); color: var(--td-text-1);
}
table.grid th {
  background: var(--td-gray-1); color: var(--td-text-2);
  font-weight: 500; white-space: nowrap;
}
table.grid th:first-child { border-top-left-radius: var(--td-radius-m); }
table.grid th:last-child { border-top-right-radius: var(--td-radius-m); }
table.grid tbody tr { transition: background-color .15s; }
table.grid tbody tr:hover { background: var(--td-bg-hover); }
table.grid tbody tr:last-child td { border-bottom: none; }
/* 紧凑表格：压缩行高，用于规格较多的列表 */
table.grid.compact th,
table.grid.compact td { padding: 5px 12px; line-height: 1.4; }
table.grid.compact tbody tr { height: 30px; }
/* 紧凑行里内嵌的输入框同步压低（如门户填写报价的单价列） */
table.grid.compact td .input { height: 28px; padding: 0 8px; }
/* 单元格文本最多两行：合同名 + 编码、状态徽标组这类会换行的长文本统一收口，
   避免个别行被撑成三四行、整表行高参差 */
.clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
/* 表头内嵌筛选：列标题本身就是一个下拉（如「选择商品」的分类 / 品牌列），选中后整列高亮 */
table.grid th select.col-filter {
  width: 100%; height: 26px; padding: 0 2px; margin: 0;
  border: 1px solid transparent; border-radius: var(--td-radius-s);
  background: transparent; font: inherit; font-weight: 500; color: inherit; cursor: pointer;
}
table.grid th select.col-filter:hover { border-color: var(--td-gray-4); background: var(--td-bg-container); }
table.grid th select.col-filter.active { color: var(--td-brand-7); font-weight: 600; }
table.grid th select.col-filter option { color: var(--td-text-1); font-weight: 400; }
/* 表头内嵌筛选（按钮版）：点开的是可折叠的品类树，用于层级较深的「分类」列 */
table.grid th button.col-filter {
  width: 100%; height: 26px; padding: 0 6px; margin: 0;
  display: flex; align-items: center; gap: 4px;
  border: 1px solid transparent; border-radius: var(--td-radius-s);
  background: transparent; font: inherit; font-weight: 500; color: inherit;
  cursor: pointer; text-align: left;
}
table.grid th button.col-filter:hover { border-color: var(--td-gray-4); background: var(--td-bg-container); }
table.grid th button.col-filter.active { color: var(--td-brand-7); font-weight: 600; }
table.grid th button.col-filter .cf-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid th button.col-filter .tree-caret { flex: none; color: var(--td-text-3); font-size: 11px; }
/* 品类树下拉面板：fixed 定位，免得被表格的滚动容器裁掉 */
.tree-pop {
  position: fixed; z-index: 200; width: 300px; padding: 8px;
  background: var(--td-bg-container); border: 1px solid var(--td-border-1);
  border-radius: var(--td-radius-m); box-shadow: var(--td-shadow-2);
}
.tree-pop .tp-search { margin-bottom: 6px; }
.tree-pop .tp-body { max-height: 330px; overflow-y: auto; }
.tree-pop .tree-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--td-radius-s);
  font-size: 13px; line-height: 1.4; color: var(--td-text-1); font-weight: 400; cursor: pointer;
}
.tree-pop .tree-row:hover { background: var(--td-bg-hover); }
.tree-pop .tree-row.on { background: var(--td-brand-1); color: var(--td-brand-7); font-weight: 600; }
.tree-pop .tree-caret { flex: none; width: 12px; text-align: center; color: var(--td-text-3); transition: transform .15s; }
.tree-pop .tree-caret.open { transform: rotate(90deg); }
.tree-pop .tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-pop .tree-cnt { flex: none; color: var(--td-text-3); font-size: 11px; }
.tree-pop .tp-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--td-border-1); }
/* 对齐工具类需覆盖 table.grid td 的元素+类选择器权重 */
table.grid td.right, table.grid th.right, .right { text-align: right; }
table.grid td.center, table.grid th.center { text-align: center; }
.empty { text-align: center; color: var(--td-text-3); padding: 40px 0; font-size: 13px; }
.action-cell { white-space: nowrap; }
/* 操作列收窄版：按钮较多时允许换行，避免整列被 nowrap 撑得过宽 */
.action-cell.wrap { white-space: normal; }
.action-cell.wrap .btn { margin: 0 4px 4px 0; }
.action-cell .btn { margin-right: 4px; }
.action-cell .btn:last-child { margin-right: 0; }

/* 比价清单：一行一个产品（商品名称/型号/规格）、一列一家供应商，最低价单元格高亮 */
.pick-cell { white-space: nowrap; cursor: pointer; }
.pick-label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.pick-label input[type="radio"] { width: auto; margin: 0; }
.pick-cell .pick-label { display: flex; align-items: center; justify-content: center; padding: 4px 6px; }
.pick-cell.best-cell { background: #e9f8f0; }
.pick-cell.best-cell .pick-label { font-weight: 600; color: #00875a; }
.pick-cell.best-cell .muted { color: #12a06a; }
/* 已选中该家的产品行：整行淡蓝，便于一眼看出逐行比价结果 */
#pkTable tbody tr.picked-row > td { background: #f5f9ff; }
#pkTable tbody tr.picked-row:hover > td { background: #eef5ff; }
#pkTable .row-pick { margin-top: 4px; white-space: nowrap; }

/* 品牌分组行（物料 / 库存列表） */
table.grid tbody tr.brand-row { cursor: pointer; }
table.grid tbody tr.brand-row > td {
  background: var(--td-gray-1); padding: 9px 12px; font-weight: 500;
}
table.grid tbody tr.brand-row:hover > td { background: var(--td-brand-1); }
.brand-row .caret {
  display: inline-block; width: 12px; margin-right: 2px;
  color: var(--td-text-3); font-size: 11px; transition: transform .15s;
}
.brand-row .caret.open { transform: rotate(0deg); }
.brand-row .caret:not(.open) { transform: rotate(-90deg); }
.brand-row .sub { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--td-text-3); }

/* ==========================================================================
   统计卡片
   ========================================================================== */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat {
  position: relative; overflow: hidden;
  background: var(--td-bg-container); border: 1px solid var(--td-border-1);
  border-radius: var(--td-radius-m); padding: 18px 20px;
  box-shadow: var(--td-shadow-1); transition: box-shadow .2s, transform .2s;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--td-gray-4);
}
.stat:hover { box-shadow: var(--td-shadow-2); transform: translateY(-1px); }
.stat .k { color: var(--td-text-2); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 600; line-height: 1.25; margin-top: 6px; letter-spacing: -.4px; }
.stat .s { font-size: 12px; color: var(--td-text-3); margin-top: 6px; }
.stat.blue::before { background: var(--td-brand-7); }
.stat.good::before { background: var(--td-success); }
.stat.warn::before { background: var(--td-warning); }
.stat.danger::before { background: var(--td-error); }
.stat.blue .v { color: var(--td-brand-7); }
.stat.good .v { color: var(--td-success); }
.stat.warn .v { color: var(--td-warning); }
.stat.danger .v { color: var(--td-error); }
/* 当前所在分区对应的统计卡：描一圈主色，一眼看出「我现在在哪个环节」 */
.stat.on { border-color: var(--td-brand-7); box-shadow: 0 0 0 1px var(--td-brand-7) inset; }
.stat.on::before { background: var(--td-brand-7); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }

/* ==========================================================================
   徽章（TDesign Tag · light 变体）
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: var(--td-radius-s); font-size: 12px; line-height: 1;
  white-space: nowrap; vertical-align: middle;
}
.badge.blue   { background: var(--td-brand-1);   color: var(--td-brand-7); }
.badge.green  { background: var(--td-success-1); color: #008858; }
.badge.gray   { background: var(--td-gray-1);    color: var(--td-text-2); }
.badge.amber,
.badge.warn   { background: var(--td-warning-1); color: var(--td-warning); }
.badge.red    { background: var(--td-error-1);   color: var(--td-error); }
.badge.purple { background: #f3f0ff;             color: #6d28d9; }
.badge.cyan   { background: #e3f3ff;             color: #0a6fb8; }

/* ==========================================================================
   表单
   ========================================================================== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--td-text-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 32px; padding: 0 12px;
  border: 1px solid var(--td-border-2); border-radius: var(--td-radius-s);
  background: #fff; color: var(--td-text-1); font-size: 13px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
textarea.input { height: auto; min-height: 72px; padding: 8px 12px; line-height: 1.6; resize: vertical; }
.input::placeholder { color: var(--td-text-3); }
.input:hover { border-color: var(--td-gray-5); }
.input:focus { border-color: var(--td-brand-7); box-shadow: 0 0 0 2px rgba(0, 82, 217, .12); }
select.input { padding-right: 28px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b8b' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-err { color: var(--td-error); font-size: 12px; min-height: 18px; margin: -6px 0 8px; }

/* ==========================================================================
   按钮（TDesign Button）
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; padding: 0 16px; border: 1px solid transparent;
  border-radius: var(--td-radius-s); font-size: 14px; line-height: 1;
  white-space: nowrap; transition: background-color .18s, border-color .18s, color .18s;
}
.btn.primary { background: var(--td-brand-7); color: #fff; }
.btn.primary:hover { background: var(--td-brand-6); }
.btn.primary:active { background: var(--td-brand-8); }
.btn.success { background: var(--td-success); color: #fff; }
.btn.success:hover { background: #008858; }
.btn.danger { background: #fff; color: var(--td-error); border-color: var(--td-error-3); }
.btn.danger:hover { background: var(--td-error-1); border-color: var(--td-error); }
.btn.ghost { background: #fff; color: var(--td-text-1); border-color: var(--td-border-2); }
.btn.ghost:hover { background: #fff; color: var(--td-brand-7); border-color: var(--td-brand-7); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: var(--td-radius-s); }
.btn.block { width: 100%; height: 40px; font-size: 14px; margin-top: 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: inherit; color: inherit; border-color: inherit; }

/* ==========================================================================
   弹窗（全系统唯一容器 #modal，样式只在这里定义一次）
   ── 结构：head（标题 + 说明 + 关闭） / body（唯一滚动区） / foot（左业务操作 | 右 取消 · 主按钮）
   ── 尺寸：sm 480 · md 640（默认） · lg 960 · xl 1280 · full 96vw（类名挂在遮罩上，向下传导到 .modal）
   ── 状态：.busy（提交中：主按钮转「处理中…」并禁用，此时不允许关闭）
   ========================================================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; padding: 6vh 16px 4vh;
  display: flex; align-items: flex-start; justify-content: center;
  overflow: auto; background: rgba(0, 0, 0, .45);
  animation: mask-in .18s ease-out;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  display: flex; flex-direction: column;
  width: 640px; max-width: 96vw; max-height: 88vh;
  background: var(--td-bg-container);
  border-radius: var(--td-radius-xl); box-shadow: var(--td-shadow-3);
  overflow: hidden;
  animation: modal-in .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* 尺寸档位 */
.modal-mask.sm .modal { width: 480px; }
.modal-mask.md .modal { width: 640px; }
.modal-mask.lg .modal { width: 960px; }
.modal-mask.xl .modal { width: 1280px; }
.modal-mask.full .modal { width: 96vw; max-height: 94vh; }
/* 兼容旧参数：wide → lg，xwide → xl */
.modal-mask.wide .modal { width: 960px; }
.modal-mask.xwide .modal { width: 1280px; }

.modal-head {
  flex: none; display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--td-border-1); background: #fff;
}
.modal-head-main { flex: 1; min-width: 0; }
.modal-title {
  display: block; font-size: 16px; font-weight: 600; line-height: 24px;
  color: var(--td-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modal-desc { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--td-text-3); }
.modal-close {
  flex: none; width: 28px; height: 28px; border: none; background: none; cursor: pointer;
  border-radius: var(--td-radius-s); color: var(--td-text-3);
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.modal-close:hover { background: var(--td-gray-1); color: var(--td-text-1); }
.modal-close:focus-visible { outline: 2px solid var(--td-brand-7); outline-offset: 1px; }

.modal-body {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px; font-size: 13px; color: var(--td-text-1);
}
/* 弹窗内最后一个元素不再补底部间距：滚动到底时与底栏不空一截 */
.modal-body > :last-child { margin-bottom: 0; }

.modal-foot {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--td-border-1); background: #fff;
}
/* 弹窗底部左侧的业务操作按钮区（右侧固定为「取消」→ 主按钮） */
.modal-foot .foot-actions {
  margin-right: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
/* 底栏按钮统一高度，不写 sm 也和页面工具栏一致 */
.modal-foot > .btn { height: 32px; }
/* 提交中：遮罩不再响应关闭，避免请求飞着弹窗没了 */
.modal-mask.busy .modal-close { opacity: .4; cursor: not-allowed; }

/* 打开弹窗时锁住背景滚动 */
body.modal-open { overflow: hidden; }

/* 统一确认 / 提示弹窗的内容区（UI.confirm / UI.alert） */
.modal-confirm { display: flex; gap: 10px; font-size: 14px; line-height: 1.7; color: var(--td-text-1); }
.modal-confirm > div { flex: 1; min-width: 0; }
.modal-confirm .sub { margin-top: 6px; font-size: 12px; color: var(--td-text-3); }
.modal-tip-icon {
  flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  background: var(--td-brand-1); color: var(--td-brand-7);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.modal-tip-icon.danger { background: var(--td-error-1); color: var(--td-error); }

/* 破坏性操作的主按钮（删除 / 作废 / 退回） */
.btn.danger-solid { background: var(--td-error); color: #fff; border-color: var(--td-error); }
.btn.danger-solid:hover { background: #b93a33; border-color: #b93a33; }
.btn.danger-solid:active { background: #a5322c; }

/* 附件预览浮层（复用弹窗外壳，层级更高：可在弹窗内再打开） */
.lb-mask { z-index: 90; }
.lb-body { text-align: center; background: var(--td-bg-hover); }
.lb-img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: var(--td-radius-m); }
.lb-frame { width: 100%; height: 68vh; border: 0; background: #fff; }

/* 窄屏：铺满可视宽度，底栏的业务操作整行落到按钮下方，不挤成一排 */
@media (max-width: 700px) {
  .modal-mask { padding: 4vh 8px; }
  .modal-mask .modal { width: 100%; max-width: 100%; max-height: 94vh; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .foot-actions {
    order: 2; width: 100%; margin-right: 0; justify-content: flex-start;
  }
}

/* ==========================================================================
   Toast（TDesign Message 风格）
   ========================================================================== */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 200;
  min-width: 200px; max-width: 70vw; padding: 10px 18px;
  background: #fff; color: var(--td-text-1); font-size: 14px;
  border: 1px solid var(--td-border-1); border-left: 3px solid var(--td-success);
  border-radius: var(--td-radius-m); box-shadow: var(--td-shadow-2);
  animation: toast-in .22s ease-out;
}
.toast.err { border-left-color: var(--td-error); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translateX(-50%); } }

/* ==========================================================================
   页签 / 其他构件
   ========================================================================== */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--td-border-1); margin-bottom: 16px; }
.tabs button {
  border: none; background: none; padding: 10px 4px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--td-text-2); font-size: 14px; transition: color .18s, border-color .18s;
}
.tabs button:hover { color: var(--td-brand-7); }
.tabs button.active { color: var(--td-brand-7); border-bottom-color: var(--td-brand-7); font-weight: 500; }

.link { color: var(--td-brand-7); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.logout-hint { cursor: pointer; color: var(--td-brand-7); }

.tag-list span { margin-right: 6px; }
.progress { height: 6px; background: var(--td-gray-3); border-radius: 3px; overflow: hidden; min-width: 70px; }
.progress > i { display: block; height: 100%; background: var(--td-brand-7); border-radius: 3px; transition: width .4s ease; }
.kv {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--td-border-1); font-size: 13px;
}
.kv:last-child { border-bottom: none; }
.kv b { width: 118px; flex-shrink: 0; font-weight: 500; color: var(--td-text-2); }
.kv span { flex: 1; color: var(--td-text-1); }
/* 型号参数：海康「产品描述」是多行长文本，保留换行；过长时在卡片内滚动 */
.param-text { white-space: pre-line; line-height: 1.75; max-height: 240px; overflow-y: auto; padding-right: 6px; }

.pur-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pur-item .input { flex: 1; }

/* ==========================================================================
   明细编辑器（报价成本估算 / 合同物料量清单）
   放在选项卡内独占整宽，一行 = 一个物料：可编辑列用输入框，
   计算列用只读文本（不再是"假输入框"），靠整宽换掉横向滚动条。
   ========================================================================== */
.item-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-weight: 400; }
/* 工具条里的按钮统一尺寸与间距：不写 sm 也按同一规格渲染（高 26 / 内距 10 / 字号 12），
   间距交给上面的 flex gap，避免几个按钮大小参差、间隔忽大忽小 */
.item-tools .btn { flex: none; height: 26px; padding: 0 10px; font-size: 12px; }
/* 兜底：卡片标题里直接摆放的按钮（如 exportutil 自动挂载的「导出CSV」）不被 flex 拉伸 */
.card-title > .btn { flex: none; }
.tabs .tab-cnt {
  display: inline-block; margin-left: 6px; padding: 0 7px; height: 18px; line-height: 18px;
  border-radius: 9px; background: var(--td-brand-1); color: var(--td-brand-7);
  font-size: 12px; font-weight: 500;
}

/* ---------- 分页条（商品列表等大列表底部） ---------- */
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  margin-top: 14px;
}
.pager .muted { font-size: 12px; }
.pager .pg {
  min-width: 30px; height: 26px; padding: 0 8px;
  border: 1px solid var(--td-border-2); border-radius: var(--td-radius-s);
  background: #fff; color: var(--td-text-1); font-size: 12px; line-height: 1;
  transition: color .18s, border-color .18s, background-color .18s;
}
.pager .pg:hover:not(:disabled) { color: var(--td-brand-7); border-color: var(--td-brand-7); }
.pager .pg.active { background: var(--td-brand-7); border-color: var(--td-brand-7); color: #fff; font-weight: 500; }
.pager .pg:disabled { opacity: .45; cursor: not-allowed; }
.pager .pg-size { width: 62px; height: 26px; padding: 0 8px; font-size: 12px; }
/* 窄屏兜底：表格自身可横向滚动，但不撑破弹窗 */
.tbl-scroll { overflow-x: auto; }
table.grid.items { min-width: 1040px; }
/* 报价明细：列与「物料与库存 → 商品」表头对齐后列数更多，超出时表格自身横向滚动 */
table.grid.items.wide { min-width: 1400px; }
/* 明细里可直接编辑的「分类 / 品牌 / 型号」列：窄列里输入框也撑满，不撑破表格 */
table.grid.items td .input.cate,
table.grid.items td .input.brand,
table.grid.items td .input.model { min-width: 0; }
table.grid.items th,
table.grid.items td { padding: 8px 7px; vertical-align: middle; }
table.grid.items td .input { height: 30px; padding: 0 8px; }
/* 计算列：等宽数字、弱化颜色，明确只读 */
table.grid.items td.ro { color: var(--td-text-2); font-variant-numeric: tabular-nums; }
table.grid.items td.ro b { color: var(--td-text-1); font-weight: 600; }
table.grid.items td.ro.neg b { color: var(--td-error); }
.row-no {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--td-brand-1); color: var(--td-brand-7);
  font-size: 12px; font-weight: 600; line-height: 1;
}
.item-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  margin-top: 14px; padding: 12px 16px; border-radius: var(--td-radius-m);
  background: var(--td-gray-1); font-size: 13px; color: var(--td-text-2);
}
.item-summary b { color: var(--td-text-1); font-weight: 600; }

/* 系统设置 → 数据采集：采集脚本的运行日志面板 */
.logbox {
  background: #1d2129; color: #c9d1d9; border-radius: var(--td-radius-m);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.65; padding: 12px 14px;
  max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.item-summary .sep { color: var(--td-gray-4); }
.item-summary .neg { color: var(--td-error); }

/* ==========================================================================
   单据详情视图（.dv-*）：详情弹窗 / 详情页共用的一套展示构件
   版式：dv-head（标题 + 状态 + 金额）→ dv-stats（关键指标）→ dv-sec（分区 + 信息格）
   各单据（合同 / 项目 / 采购 …）都套这套，视觉与阅读顺序保持一致。
   ========================================================================== */
/* 各单据的详情头部（合同/项目 = dv-，应付 = pbv-，报销 = rbv-）共用同一套版式与配色，
   页面内联样式里不再各自写一遍，改样式只改这里 */
.dv-head, .pbv-head, .rbv-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--td-border-1);
  border-radius: var(--td-radius-l);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}
.pbv-head, .rbv-head { margin-bottom: 12px; }
.dv-head-main { min-width: 0; flex: 1; }
.dv-code, .pbv-code, .rbv-code {
  font-size: 12px; color: var(--td-text-3); letter-spacing: .5px; margin-bottom: 4px;
}
.dv-title, .pbv-title, .rbv-reason {
  margin-top: 4px; font-size: 18px; font-weight: 600; line-height: 1.35; word-break: break-all;
}
.dv-tags { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dv-amt { flex: none; padding-left: 16px; border-left: 1px dashed var(--td-border-1); text-align: right; }
.dv-amt .lbl { display: block; font-size: 12px; color: var(--td-text-3); }
.dv-amt .num {
  font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--td-brand-7);
  font-variant-numeric: tabular-nums; letter-spacing: -.4px;
}
.dv-amt .sub { margin-top: 3px; font-size: 12px; color: var(--td-text-2); }

.dv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.dv-stat {
  padding: 8px 12px; border: 1px solid var(--td-border-1); border-radius: var(--td-radius-m);
  background: #fff; min-width: 0;
}
.dv-stat .k { font-size: 12px; color: var(--td-text-3); }
.dv-stat .v { margin-top: 3px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dv-stat.ok .v { color: var(--td-success); }
.dv-stat.warn .v { color: var(--td-warning); }
.dv-stat.brand .v { color: var(--td-brand-7); }

.dv-sec {
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--td-border-1); border-radius: var(--td-radius-m); background: #fff;
}
.dv-sec-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.dv-sec-h::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--td-brand-7); flex: none; }
.dv-sec-h .muted { font-weight: 400; }
.dv-sec-h .item-tools { margin-left: auto; }
/* 分区内直接放表格：去掉表格自身上边框的重复描边，视觉上是一整块 */
.dv-sec > table.grid th:first-child { border-top-left-radius: 0; }
.dv-sec > table.grid th:last-child { border-top-right-radius: 0; }

.dv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dv-cell {
  min-width: 0; padding: 7px 10px;
  border: 1px solid var(--td-border-1); border-radius: var(--td-radius-s); background: #fcfcfd;
}
.dv-cell .k { display: block; font-size: 12px; color: var(--td-text-3); margin-bottom: 2px; }
.dv-cell .v { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; word-break: break-all; }
.dv-cell.wide { grid-column: span 3; }
.dv-cell.half { grid-column: span 2; }
.dv-note { margin-top: 8px; font-size: 12px; color: var(--td-text-2); line-height: 1.6; }
/* 小弹窗里的说明 / 风险提示：一句话交代「点了会怎样」，避免只有按钮没有上下文 */
.dv-tip {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px;
  padding: 10px 12px; border-radius: var(--td-radius-m);
  background: var(--td-brand-1); color: var(--td-text-1); font-size: 13px; line-height: 1.6;
}
.dv-tip::before { content: "ℹ"; color: var(--td-brand-7); font-size: 13px; line-height: 1.5; }
.dv-tip.warn { background: var(--td-warning-1); }
.dv-tip.warn::before { content: "!"; color: var(--td-warning); font-weight: 700; }
.dv-tip.danger { background: var(--td-error-1); }
.dv-tip.danger::before { content: "!"; color: var(--td-error); font-weight: 700; }

@media (max-width: 1000px) {
  .dv-stats { grid-template-columns: repeat(2, 1fr); }
  .dv-grid { grid-template-columns: repeat(2, 1fr); }
  .dv-cell.wide, .dv-cell.half { grid-column: span 2; }
  .dv-head { flex-direction: column; }
  .dv-amt { padding-left: 0; border-left: none; text-align: left; }
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1280px) { :root { --sidebar-w: 200px; } .content { padding: 16px 16px 28px; } }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}

/* 品类树折叠箭头 */
.tree-toggle {
  display: inline-block;
  width: 14px;
  margin-right: 4px;
  cursor: pointer;
  color: #6b7280;
  user-select: none;
  font-size: 12px;
}
.tree-toggle:hover { color: #111827; }
.tree-toggle.tree-leaf { cursor: default; }

/* 角色管理：可见页面勾选 */
.perm-box {
  margin-top: 16px;
  border: 1px solid var(--td-border-1);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--td-gray-1);
}
.perm-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.perm-bar .muted { font-size: 12px; }
.perm-group { margin-bottom: 10px; }
.perm-head { font-size: 12px; color: var(--td-text-2); margin-bottom: 6px; }
.perm-items { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.perm-items label.chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.perm-items label.chk input { margin: 0; }

/* ==========================================================================
   数据采集页：脚本参数卡片紧凑排版
   参数多（每张卡 8~11 项），压缩内边距、字段间距与输入框高度，一屏能看全
   ========================================================================== */
.collect-card { padding: 14px 16px; margin-bottom: 12px; }
.collect-card .card-title { font-size: 14px; margin-bottom: 4px; }
.collect-card .collect-file { font-weight: 400; font-size: 11px; }
.collect-card .collect-desc { font-size: 12px; line-height: 1.4; margin-bottom: 10px; }
.collect-card .grid-3 { gap: 0 14px; }
.collect-card .field { margin-bottom: 10px; }
.collect-card .field > label { font-size: 12px; margin-bottom: 4px; }
.collect-card .input { height: 28px; padding: 0 10px; font-size: 12px; }
.collect-card select.input { padding-right: 24px; background-position: right 8px center; }
.collect-card .field-help { font-size: 11px; line-height: 1.35; color: var(--td-text-3); margin-top: 3px; }
.collect-card .collect-actions { margin: 2px 0 0; }

/* 系统参数页：分组卡片两两并排（原来 4 张卡竖排很占高度），组内字段两列 + 紧凑排版 */
.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cfg-grid > .card { margin-bottom: 0; }
.cfg-card { padding: 14px 16px; }
.cfg-card .card-title { font-size: 14px; margin-bottom: 10px; }
.cfg-card .cfg-count { font-weight: 400; font-size: 11px; }
.cfg-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.cfg-card .field { margin-bottom: 10px; }
.cfg-card .field > label { font-size: 12px; margin-bottom: 4px; }
.cfg-card .input { height: 28px; padding: 0 10px; font-size: 12px; }
.cfg-card select.input { padding-right: 24px; background-position: right 8px center; }
.cfg-card .field-help { font-size: 11px; line-height: 1.35; color: var(--td-text-3); margin-top: 3px; }
@media (max-width: 1100px) {
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-grid > .card { margin-bottom: 12px; }
  .cfg-fields { grid-template-columns: 1fr; }
}

/* 报价表单 · 基本信息：客户 / 报价日期 / 有效期至 / 税率发票类型 排成一行四个
   （原来走全局 .form-grid 的两列 → 两行两列，右侧空一截）。这里单独放开 4 列，
   不动其它页面共用的 .form-grid；客户与税率下拉文字较长，给略宽的权重。 */
.form-grid-4 { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; }
/* 媒体查询放在规则之后：同优先级下后者生效，窄屏依次回落两列 / 单列 */
@media (max-width: 1280px) { .form-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px)  { .form-grid-4 { grid-template-columns: 1fr; } }

/* 采集页「规格与参数」弹窗 · 参数块：大华参数是整段文字（要点列表 / 应用场景），
   用文本块展示并保留内部换行（white-space: pre-wrap）；没有小标题的项（如核心技术参数要点）只显示正文。 */
.param-blocks { border: 1px solid var(--line, #e5e7eb); border-radius: 8px; overflow: hidden; }
.param-block { padding: 10px 12px; border-top: 1px solid var(--line, #e5e7eb); }
.param-block:first-child { border-top: 0; }
.param-block:nth-child(odd) { background: #fafafa; }
.param-k { font-weight: 600; margin-bottom: 4px; }
.param-v { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }

/* ==========================================================================
   手机端 / 企业微信内置浏览器适配
   窄屏下侧边栏改成抽屉：原来直接 display:none 会把导航整个藏掉，手机上等于没有菜单。
   表格改为横向滚动（挤成一列反而看不清）；输入框字号提到 16px，避免 iOS 聚焦时自动放大整页。
   ========================================================================== */
.aside-mask { display: none; position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .45); }

@media (max-width: 900px) {
  .sidebar {
    width: 78vw; max-width: 300px; z-index: 40;
    transform: translateX(-100%); transition: transform .22s ease-in-out;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    display: flex !important;              /* 覆盖上面 900px 断点的 display:none */
  }
  /* 抽屉展开时压过底栏；底栏则降到遮罩之下（被压暗），避免浮在遮罩上还能点 */
  .app.aside-open .sidebar { transform: translateX(0); z-index: 46; }
  .app.aside-open .aside-mask { display: block; }
  .app.aside-open .tabbar { z-index: 28; }
  .main { margin-left: 0; }

  .topbar { height: 50px; flex: 0 0 50px; padding: 0 10px; }
  .tb-left { min-width: 0; }
  .crumb { max-width: 44vw; overflow: hidden; white-space: nowrap; }
  .content { padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 14px 12px; margin-bottom: 12px; overflow-x: auto; }
  .card-title { font-size: 14px; }
  table.grid { min-width: 100%; width: max-content; }

  .input, select.input, textarea.input { font-size: 16px; }
  .btn { min-height: 34px; }
  .toolbar { gap: 8px; }
  .grid-2, .grid-3, .cfg-grid, .form-grid-4 { grid-template-columns: 1fr; }
  .user-menu { right: 6px; max-width: 78vw; }
  .notice-panel { right: 6px; width: calc(100vw - 24px); max-width: 344px; }
  .modal-mask { padding: 3vh 8px; }
}

/* ==========================================================================
   手机 App 形态：底部 Tab 栏 + 卡片流列表
   手机上像 App 而不是像"缩小的后台"：常用入口固定在底部，列表从宽表变成一张张卡片，
   顶栏收敛成居中的标题栏。表格卡片化只作用于被 JS 打上 .is-cards 的表（表头已转成标签），
   没处理到的表仍走横向滚动，不会因为脚本没跑完就变得没法看。
   ========================================================================== */
.tabbar { display: none; }

@media (max-width: 900px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(54px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--td-bg-container); border-top: 1px solid var(--td-border-1);
    box-shadow: 0 -2px 14px rgba(0, 0, 0, .06);
  }
  .tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; border: 0; background: none; padding: 0; cursor: pointer;
    color: var(--td-text-3); font-size: 11px; position: relative;
  }
  .tabbar .tab.on { color: var(--brand, #0052d9); }
  .tabbar .tab svg { width: 22px; height: 22px; }
  .tabbar .tb-badge {
    position: absolute; top: 3px; left: 54%; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--td-error); color: #fff;
    font-size: 10px; line-height: 16px; text-align: center;
  }
  /* 内容区给底栏让位（含 iPhone 底部安全区） */
  .content { padding: 12px 12px calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* 顶栏收敛成 App 标题栏：标题居中，次要图标收进"我的"菜单 */
  .tb-left { flex: 1; }
  .crumb {
    max-width: none; flex: 1; justify-content: center;
    font-size: 14px; font-weight: 600; color: var(--td-text-1);
  }
  #btn-help, #btn-setting { display: none; }
  .user-wrap .user-meta { display: none; }
  .top-right { gap: 4px; }

  /* 卡片流：表格 → 一张张卡片，左边是字段名右边是值 */
  .card { padding: 12px; border-radius: 12px; }
  table.grid.is-cards { width: 100%; min-width: 0; }
  table.grid.is-cards thead { display: none; }
  table.grid.is-cards, table.grid.is-cards tbody { display: block; }
  table.grid.is-cards tr {
    display: block; padding: 10px 12px; margin-bottom: 10px;
    border: 1px solid var(--td-border-1); border-radius: 10px;
    background: var(--td-bg-container);
  }
  table.grid.is-cards td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 5px 0; border: 0; text-align: right; font-size: 13px;
  }
  table.grid.is-cards td::before {
    content: attr(data-label); flex: 0 0 auto;
    color: var(--td-text-3); font-size: 12px; text-align: left;
  }
  table.grid.is-cards td:first-child { font-weight: 600; font-size: 14px; }
  table.grid.is-cards td.action-cell {
    justify-content: flex-end; flex-wrap: wrap; gap: 8px;
    margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--td-border-1);
  }
  table.grid.is-cards td.action-cell::before { display: none; }
}

