/* ===== 压簧设计优化软件 样式 ===== */

:root{

  --bg:#f4f6f9; --panel:#ffffff; --border:#dfe3ea; --text:#24292f;

  --accent:#1f4e78; --accent2:#2f6fb2; --danger:#c00000; --ok:#2e7d32;

  --btn-bg:#ffffff; --btn-hover:#eef2f8; --th-bg:#f0f4f9; --card-bg:#fcfdff;

  --tab-bg:#fafbfd; --input-bg:#ffffff; --field-hover:#eef2f8;

  --shadow:0 1px 3px rgba(20,40,70,.08);

}

*{box-sizing:border-box; margin:0; padding:0;}

html,body{height:100%;}

body{

  font-family:"Microsoft YaHei","Segoe UI",sans-serif; color:var(--text);

  background:linear-gradient(135deg,#eef2f8 0%,#e4ebf4 50%,#eef2f8 100%);

  display:flex; flex-direction:column; height:100vh; overflow:hidden; font-size:13px;

}



/* ---------- 菜单栏 ---------- */

.menubar{

  display:flex; align-items:center; background:linear-gradient(90deg,#1f4e78,#2f6fb2);

  color:#fff; height:40px; padding:0 12px; flex:none; box-shadow:0 2px 6px rgba(0,0,0,.18);

}

.app-brand{font-weight:700; font-size:17px; letter-spacing:1px; margin-right:24px;

  font-family:'华文行楷','楷体','STXingkai','STKaiti','KaiTi',cursive;}

.app-brand span{font-weight:400; font-size:11px; opacity:.85; margin-left:6px;}

.menu{display:flex; height:100%;}

.menu-item{

  position:relative; padding:0 16px; line-height:40px; cursor:pointer; user-select:none;

  font-size:13.5px;

}

.menu-item:hover{background:rgba(255,255,255,.14);}

.dropdown{

  display:none; position:absolute; top:40px; left:0; min-width:150px; background:#fff;

  box-shadow:0 6px 18px rgba(0,0,0,.18); border:1px solid var(--border); border-radius:6px;

  padding:5px; z-index:100;

}

.menu-item:hover .dropdown{display:block;}

.dropdown a{

  display:block; padding:8px 12px; color:var(--text); text-decoration:none; border-radius:4px; font-size:13px;

}

.dropdown a:hover{background:#eef3f9; color:var(--accent);}

.dropdown a.danger{color:var(--danger);}

.menu-status{margin-left:auto; font-size:12px; opacity:.9;}

.auth-entry{display:flex; align-items:center; gap:6px; margin-left:12px;}

.auth-entry #authUserName{font-size:12.5px; color:#cfe3f7;}

.auth-entry .mini-btn{margin-left:0;}

.auth-tabs{display:flex; gap:8px; margin-bottom:10px;}

.auth-tabs .mini-btn.active{background:var(--accent); color:#fff; border-color:var(--accent);}



/* ===== 登录模态框 · 科技感压簧渲染图 ===== */

.auth-modal{width:min(92vw,760px)!important; max-height:92vh; display:flex; flex-direction:row; padding:0!important; overflow:hidden; border-radius:14px;}

.auth-art{position:relative; width:300px; flex:none; background:radial-gradient(120% 120% at 20% 10%, #12314f 0%, #0a1628 60%, #060d18 100%); overflow:hidden; display:flex; flex-direction:column; align-items:center; justify-content:center;}

.auth-art-grid{position:absolute; inset:0; background:

  repeating-linear-gradient(90deg, rgba(41,211,255,.08) 0 1px, transparent 1px 28px),

  repeating-linear-gradient(0deg, rgba(41,211,255,.08) 0 1px, transparent 1px 28px); opacity:.7;}

.auth-art-particles,.auth-particles{position:absolute; inset:0; z-index:1; width:100%; height:100%; opacity:.9;}

.auth-art-scan{position:absolute; left:0; right:0; height:2px; z-index:1;

  background:linear-gradient(90deg, transparent, rgba(41,211,255,.9), transparent);

  box-shadow:0 0 18px 2px rgba(41,211,255,.5);

  animation:authScan 4.5s linear infinite;}

@keyframes authScan{0%{top:-4%;}100%{top:104%;}}

.auth-art-glow{position:absolute; width:240px; height:240px; border-radius:50%; background:radial-gradient(circle, rgba(41,211,255,.28), transparent 70%); filter:blur(12px); animation:authPulse 3.4s ease-in-out infinite;}

.auth-corner{position:absolute; z-index:2; width:26px; height:26px; border:2px solid rgba(41,211,255,.75); filter:drop-shadow(0 0 6px rgba(41,211,255,.6));}

.auth-corner.tl{top:16px; left:16px; border-right:none; border-bottom:none;}

.auth-corner.br{bottom:16px; right:16px; border-left:none; border-top:none;}

.auth-art svg{position:relative; z-index:2; flex:0 0 auto; width:180px; height:330px; filter:drop-shadow(0 0 12px rgba(41,211,255,.35));}

.auth-art-brand{position:relative; z-index:2; flex:0 0 auto; font-weight:700; font-size:34px; letter-spacing:3px; color:#37e6ff; text-shadow:0 0 16px rgba(41,211,255,.75); margin-top:-6px;

  font-family:'华文行楷','楷体','STXingkai','STKaiti','KaiTi',cursive;}

.auth-art-sub{position:relative; z-index:2; flex:0 0 auto; font-size:10px; letter-spacing:2px; color:#67c7ea; margin-top:2px; opacity:.8;}

@keyframes authPulse{0%,100%{opacity:.55; transform:scale(1);}50%{opacity:1; transform:scale(1.12);}}



/* 压簧 SVG 元素样式 */

.spring-back{fill:none; stroke:#173a5e; stroke-width:7; stroke-linecap:round; opacity:.9;}

.spring-front{fill:none; stroke:#29d3ff; stroke-width:8; stroke-linecap:round;

  filter:drop-shadow(0 0 6px rgba(41,211,255,.8)); stroke-dasharray:6 10; animation:springFlow 3s linear infinite;}

.spring-end{fill:none; stroke:#3fe0ff; stroke-width:7; stroke-linecap:round; filter:drop-shadow(0 0 5px rgba(41,211,255,.6));}

.spring-axis{stroke:rgba(41,211,255,.45); stroke-width:1.5; stroke-dasharray:4 6;}

.spring-cap{fill:#0a1628; stroke:#3fe0ff; stroke-width:2;}

@keyframes springFlow{to{stroke-dashoffset:-96;}}

/* 磁场线与电子(电子压簧) */

.mag-line{fill:none; stroke:rgba(55,110,255,.55); stroke-width:1.6; stroke-linecap:round;

  filter:drop-shadow(0 0 4px rgba(80,140,255,.55));}

.mag-arrow{fill:none; stroke:#7fa6ff; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;}

.electron{fill:#9ff1ff; filter:drop-shadow(0 0 7px rgba(41,211,255,.95));}

.electron.dim{fill:#4fd8ff; opacity:.75;}



.auth-side{flex:1; padding:22px 26px 18px; display:flex; flex-direction:column; justify-content:center; min-width:0;}

.auth-opt-row{display:flex; align-items:center; justify-content:space-between; margin:2px 0 6px;}

.auth-check{display:flex!important; align-items:center; gap:5px; margin:0!important; font-size:12.5px; color:#3a4453; cursor:pointer;}

.auth-check input{width:auto!important; margin:0!important;}

.auth-forgot{font-size:12.5px; color:var(--accent2); cursor:pointer; text-decoration:none;}

.auth-forgot:hover{text-decoration:underline; color:var(--accent);}

.auth-reset-tip{font-size:12px; color:#667; background:#f4f8fd; border:1px solid #d6e3f3; border-radius:6px; padding:8px 10px; line-height:1.6;}

.auth-side label input{width:100%; padding:7px 9px; border:1px solid var(--border); border-radius:5px; font-size:13px; margin-top:3px;}

.auth-side label input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 2px rgba(43,132,217,.18);}



/* ---------- 工具栏 ---------- */

.toolbar{

  display:flex; align-items:center; gap:6px; padding:7px 12px; background:var(--panel);

  border-bottom:1px solid var(--border); flex:none;

}

.tb-btn{

  padding:5px 12px; border:1px solid var(--border); border-radius:5px; background:var(--btn-bg); cursor:pointer; font-size:12.5px;

}

.tb-btn:hover{background:#f0f4f9; border-color:#a9bfd4;}

.tb-btn.accent{background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600;}

.tb-btn.accent:hover{background:var(--accent2);}

.tb-sep{width:1px; height:20px; background:var(--border); margin:0 4px;}

.tb-right{margin-left:auto; font-size:12px; color:#667;}



/* ---------- 主体网格布局 ----------

   第1列: 第1行设计计算 / 第2行三维可视化

   第2列: 第1-2行优化结果(跨两行)

   底部一行: 优化设计日志(跨两列) */

.app-grid{

  flex:1; display:grid; gap:8px; padding:8px 10px 0; min-height:0;

  grid-template-columns: repeat(12, minmax(0, 1fr));

  grid-template-rows: minmax(0,1fr) minmax(0,1fr) minmax(96px, 0.54fr);

}

/* 日志收起(最小化): 第三行收缩为仅标题行高度 */
body.log-collapsed .app-grid{
  grid-template-rows: minmax(0,1fr) minmax(0,1fr) auto;
}

/* 窄窗口: 优化输入区允许换行, 减小最小宽度, 避免挤压 */

@media (max-width: 1180px){

  .opt-input{grid-template-columns: 1fr !important;}

  .range-row label{min-width:120px;}

}

.panel{background:var(--panel); border:1px solid var(--border); border-radius:8px; box-shadow:var(--shadow); display:flex; flex-direction:column; min-height:0;}

.panel-title{

  padding:8px 14px; border-bottom:1px solid var(--border); font-weight:700; color:var(--accent); flex:none;

  display:flex; align-items:center; gap:8px;

  background:linear-gradient(90deg,#f6f9fd,#edf2f9);

}

.panel-title .hint{font-weight:400; color:#8a94a6; font-size:11.5px; margin-left:auto;}



/* 第1行·左: 设计参数输入 (行1, 1-6列) */

.input-panel{grid-area:1/1/2/7; overflow-y:auto;}

/* 参数输入统一 grid: 从上到下/从左到右填满, 隐藏字段(不同输入方式)不占位, dense 自动补位, 无中间空 */
.input-body{display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:8px 12px; padding:8px 14px 10px; overflow-y:auto; align-items:end;}
.input-body > .param-row{display:contents;}
.input-body > .mode-row{display:flex; flex-wrap:wrap; gap:6px 14px; grid-column:1/-1; align-items:center; padding:2px 0;}
.input-body > .param-row.proj-row{display:flex; flex-wrap:wrap; gap:8px 14px; grid-column:1/-1; align-items:center; padding:2px 0;}
.input-body > .param-row.proj-row label{flex:none; min-width:150px;}
.input-body > .param-row.fig2-row{display:flex; flex-wrap:wrap; gap:6px 10px; grid-column:1/-1; align-items:center; padding-top:8px;}

/* 参数输入内部固定 6 列(从左到右、从上到下), 保证行列可定位: 第2行=目标寿命/频率, 第4行第5列=工作温度 */

.input-body .param-row{grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px 12px;}
.fig2-row{grid-template-columns:repeat(6,minmax(0,1fr)) !important; gap:6px 12px; align-items:center; border-top:1px dashed rgba(31,78,120,.18); padding-top:8px; margin-top:4px;}
.fig2-lbl{grid-column:1/-1; font-size:11.5px; font-weight:700; color:#1f4e78; margin:0;}
.fig2-row .chk{display:flex; align-items:center; gap:3px; font-size:12px; color:#33415b; margin:0; padding:2px 4px; border:1px solid rgba(31,78,120,.16); border-radius:4px; background:#fff; cursor:pointer; min-width:0; white-space:nowrap;}
.fig2-row .chk:hover{background:rgba(31,78,120,.06);}
.fig2-row .chk input{margin:0; accent-color:#2f6fb2;}
.fig2-hint{grid-column:1/-1; font-size:11px; color:#8a94a6; margin:0;}




/* 第2行·左: 设计参数输出 (行2, 1-3列) */

.result-panel{grid-area:2/1/3/4; overflow-y:auto; min-height:0;}

.result-panel .panel-title{flex:none;}



/* 第2行·中: 三维可视化 (行2, 4-6列) */

.view3d-panel{grid-area:2/4/3/7; display:flex; flex-direction:column;}

.view-controls{

  display:flex; align-items:center; gap:4px; padding:5px 12px; border-bottom:1px solid #eef1f6; flex:none; flex-wrap:wrap;

}

.vc-label{font-size:12px; color:#8a94a6; margin-right:2px;}

.vc-btn{padding:2px 10px; font-size:12px;}



/* 优化: 第1-2行·右 (行1-2, 7-12列) */

.opt-panel{grid-area:1/7/3/13; overflow-y:auto; min-width:0;}

.opt-head{padding:4px 14px 6px; flex:none;}

.opt-input{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:6px; min-width:0;}

.opt-input .opt-ctrl{grid-column:1/3;}

.opt-blk{padding:10px 12px; background:#f4f8fd; border:1px solid #d6e3f3; border-radius:8px; min-width:0; box-sizing:border-box;}

.opt-blk-title{font-size:12.5px; font-weight:700; color:var(--accent2); margin-bottom:8px; border-bottom:1px solid var(--border); padding-bottom:4px;}

/* 范围寻优: 变量/约束区块折叠 */
.opt-blk.collapsible{position:relative;}
.opt-blk-title.collapsible-hd{cursor:pointer; user-select:none; display:flex; align-items:center; gap:6px; transition:color .15s;}
.opt-blk-title.collapsible-hd:hover{color:var(--accent);}
.opt-blk-title.collapsible-hd .cb-arrow{display:inline-block; font-size:10px; color:var(--accent); transition:transform .18s; width:12px; text-align:center;}
.opt-blk.collapsed > .opt-blk-title.collapsible-hd{color:var(--accent);}
.opt-blk.collapsed > .opt-blk-title.collapsible-hd .cb-arrow{transform:rotate(-90deg);}
.opt-blk.collapsed > :not(.opt-blk-title.collapsible-hd){display:none!important;}
.opt-blk.collapsible.collapsed{padding-bottom:6px;}

.range-box{margin-top:4px; padding:6px 10px; background:#f4f8fd; border:1px solid #d6e3f3; border-radius:6px;}

.range-row{display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; padding:4px 0; min-width:0;}

/* 优化面板 高度范围约束: 三行, 每行一个"调整"开关 + 该行 min~max 输入; 关闭时输入框锁定(disabled) */
.hgt-row{grid-template-columns:1fr; gap:4px 10px;}
.hgt-row .range-adj{display:flex; align-items:center; gap:6px; min-width:0; border:1px solid transparent; border-radius:6px; padding:2px 4px; transition:border-color .18s;}
.hgt-row .range-adj:has(.hgt-adj-cb:checked){border-color:rgba(47,111,178,.35); background:rgba(47,111,178,.045);}
.hgt-row .range-adj label{display:grid; grid-template-columns:auto minmax(40px,1fr) auto minmax(40px,1fr); align-items:center; gap:5px; font-size:12px; color:#33415b; margin:0; min-width:0; white-space:nowrap;}
.hgt-row .range-adj input.rng:disabled{background:#eef1f6; color:#9aa4b6; cursor:not-allowed; box-shadow:none;}
.hgt-row .range-adj .series-switch{margin:0; flex:none; width:74px;}

.range-row label{display:grid; grid-template-columns:auto minmax(40px,1fr) auto minmax(40px,1fr); align-items:center; gap:4px; font-size:12px; color:#33415b; margin:0; min-width:0; white-space:normal;}

.constr-row label{grid-template-columns:auto minmax(60px,1fr);}

.range-row .rng, .opt-blk .rng{width:52px !important; box-sizing:border-box; min-width:0;}

.range-row input, .opt-ctrl input, .opt-blk input{width:100%; padding:5px 6px; border:1px solid var(--border); border-radius:5px; font-size:12.5px; box-sizing:border-box;}

.range-row input:focus, .opt-ctrl input:focus, .opt-blk input:focus{outline:none; border-color:#2f6fb2; box-shadow:0 0 0 2px rgba(47,111,178,.16);}

.opt-ctrl{flex-wrap:wrap; align-items:flex-end;}

.opt-ctrl label{display:flex; flex-direction:column; gap:2px; font-size:12px; color:#33415b; min-width:0;}



/* 输入方式切换 */

.mode-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:3px 0 6px; border-bottom:1px dashed #e4eaf2;}

.mode-label{font-size:12.5px; font-weight:700; color:var(--accent);}

.mode-radio{display:flex; align-items:center; gap:4px; font-size:12.5px; margin:0; cursor:pointer; color:#3a4453;}

.mode-radio input{width:auto; margin:0;}

.mode-hint{font-size:11.5px; color:#8a94a6;}

/* 允许调整载荷 toggle 开关(顶部右侧, 与设计计算/验算按钮并列) */
.compute-group .adj-switch{display:flex; align-items:center; gap:6px; margin:0 8px 0 2px; cursor:pointer; height:100%;}
.compute-group .adj-switch .switch{position:relative; display:inline-block; width:34px; height:20px; flex:none;}
.compute-group .adj-switch .switch input{opacity:0; position:absolute; inset:0; width:100%; height:100%; margin:0; padding:0; cursor:pointer; z-index:2;}
.compute-group .adj-switch .slider{position:absolute; cursor:pointer; inset:0; background:#cbd5e1; border-radius:20px; transition:background .18s; box-shadow:inset 0 1px 2px rgba(0,0,0,.12);}
.compute-group .adj-switch .slider:before{content:""; position:absolute; height:16px; width:16px; left:2px; bottom:2px; background:#fff; border-radius:50%; transition:transform .18s; box-shadow:0 1px 2px rgba(0,0,0,.28);}
.compute-group .adj-switch .switch input:checked + .slider{background:#2f6fb2;}
.compute-group .adj-switch .switch input:checked + .slider:before{transform:translateX(14px);}
.compute-group .adj-switch .switch input:focus-visible + .slider{box-shadow:0 0 0 3px rgba(47,111,178,.25);}
.compute-group .adj-switch .adj-lbl{font-size:12px; font-weight:600; color:#33415b; white-space:nowrap; user-select:none; line-height:1;}

/* 载荷模式几何指定: 中径/线径 组合分段按钮 */
.compute-group .geo-mode-group{display:flex; align-items:center; gap:2px; margin:0 6px 0 2px; height:100%;}
.compute-group .geo-mode-btn{font-size:11.5px; padding:4px 9px; border:1px solid var(--border,#d7dee8); background:var(--btn-bg,#fff); color:var(--text,#33415b);
  cursor:pointer; white-space:nowrap; line-height:1; transition:all .15s;}
.compute-group .geo-mode-btn:first-child{border-radius:6px 0 0 6px;}
.compute-group .geo-mode-btn:last-child{border-radius:0 6px 6px 0;}
.compute-group .geo-mode-btn + .geo-mode-btn{border-left:none;}
.compute-group .geo-mode-btn:hover{background:var(--btn-hover,#eef2f9);}
.compute-group .geo-mode-btn.active{background:var(--accent,#2f6fb2); color:#fff; border-color:var(--accent,#2f6fb2); font-weight:600;}

.mode-row .mini-btn{margin-left:auto;}



/* 参数行(横向排列) */

.param-row{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px 14px; padding:6px 0 0; align-items:end;}

.param-row label{display:flex; flex-direction:column; font-size:11.5px; font-weight:600; color:#33415b; margin:0; min-width:0;}

.param-row input, .param-row select{width:100%; padding:5px 7px; border:1px solid var(--border); border-radius:5px; font-size:12.5px; margin-top:2px; box-sizing:border-box; background:var(--input-bg); transition:border-color .15s, box-shadow .15s;}

.param-row input:hover, .param-row select:hover{border-color:#b9c6d8;}

.param-row input:focus, .param-row select:focus{outline:none; border-color:#2f6fb2; box-shadow:0 0 0 2px rgba(47,111,178,.16);}
/* 中径/线径 系列化锁定时: 只读灰显(保留值, 由系列化圆整), 区别于自动反推的 disabled */
.param-row input[readonly]{background:linear-gradient(135deg,#eef1f6,#e6ebf2); color:#7c879a; cursor:not-allowed; border-style:dashed; border-color:#c3cddb;}
/* 深色系主题才用深底: 浅色主题下 data-theme 同样存在, 原先的 body[data-theme] 会把只读框刷成黑底(系列化一开就出现"黑框") */
body.theme-dark .param-row input[readonly]{background:linear-gradient(135deg,#1a2436,#202b3e); color:#8b97ad; border-color:#33415b;}

.param-row .freq-hint{font-size:11px; color:#7a8698; align-self:center; text-align:left; line-height:1.5;}

.param-row .opt-progress{font-size:11.5px; color:#667; justify-content:center;}

.param-row .mini-btn{flex:none; align-self:center;}



/* 材料规范提示条 */

.spec-bar{margin-top:6px; padding:4px 10px; background:#eef4fb; border:1px solid #d6e3f3; border-radius:5px;

  font-size:11.5px; color:#1f4e78; display:flex; flex-wrap:wrap; gap:5px 18px; align-items:center; line-height:1.7;}
.spec-it{display:inline-flex; align-items:baseline; gap:4px; white-space:normal;}
.spec-it b{color:#1f4e78;}
.input-body > .spec-bar{grid-column:1/-1; width:auto;}



/* 通用 label / 输入控件(模态框等处使用) */

label{font-size:12.5px; color:#3a4453;}

input:focus, select:focus{outline:none; border-color:var(--accent2);}



.canvas-wrap{position:relative; flex:1; min-height:0; overflow:hidden;}

#view3d{display:block; width:100%; height:100%;

  background:radial-gradient(circle at 50% 32%, #ffffff 0%, #eef3f9 58%, #e2eaf4 100%); cursor:grab;}

#view3d:active{cursor:grabbing;}

.canvas-legend{

  position:absolute; left:10px; bottom:8px; background:rgba(255,255,255,.86); padding:3px 10px; color:#2c3e5a;

  border-radius:5px; font-size:11.5px; border:1px solid #d4deeb; backdrop-filter:blur(2px); box-shadow:0 1px 3px rgba(20,40,70,.1);

}

.mini-btn{

  padding:3px 9px; border:1px solid var(--border); border-radius:5px; background:var(--btn-bg); cursor:pointer; font-size:11.5px; margin-left:4px;

  color:var(--text); transition:background .15s, border-color .15s;

}

.mini-btn:hover{background:var(--btn-hover);}

/* ===== 优化控制按钮 · 强调美化(仅优化面板) ===== */
.param-row.opt-ctrl{gap:8px;}
.param-row.opt-ctrl .mini-btn{
  padding:7px 18px; border-radius:8px; font-size:12.5px; font-weight:600;
  letter-spacing:.3px; margin-left:8px; cursor:pointer;
  display:inline-flex; align-items:center; gap:5px;
  border:1px solid transparent;
  box-shadow:0 2px 6px rgba(31,78,120,.12);
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}
/* 开始优化 · 主按钮: 蓝渐变 */
.param-row.opt-ctrl .mini-btn.accent{
  color:#fff;
  background:linear-gradient(135deg,#1f4e78,#2f6fb2 55%,#3a86d6);
  border-color:rgba(255,255,255,.18);
  box-shadow:0 4px 12px rgba(31,78,120,.35);
}
.param-row.opt-ctrl .mini-btn.accent:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 18px rgba(47,111,178,.45);
  background:linear-gradient(135deg,#2a5f8f,#3a86d6 55%,#4a97e0);
}
.param-row.opt-ctrl .mini-btn.accent:active{
  transform:translateY(0); box-shadow:0 2px 6px rgba(31,78,120,.3);
}
/* 可行组合 · 次级按钮: 描边 */
.param-row.opt-ctrl .mini-btn:not(.accent){
  background:var(--panel); color:var(--accent); border:1px solid var(--accent2);
}
.param-row.opt-ctrl .mini-btn:not(.accent):hover{
  background:var(--btn-hover); transform:translateY(-1px); box-shadow:0 4px 12px rgba(31,78,120,.18);
}
body.theme-dark .param-row.opt-ctrl .mini-btn:not(.accent):hover{
  background:#1c2c4a; box-shadow:0 4px 12px rgba(0,0,0,.4);
}



/* 标签页 */

.tabbar{display:flex; flex:none; border-bottom:1px solid var(--border); background:var(--tab-bg);}

.tab{padding:8px 14px; border:none; background:none; cursor:pointer; font-size:13px; color:var(--text); border-bottom:2px solid transparent;}

.tab.active{color:var(--accent); font-weight:600; border-bottom-color:var(--accent); background:var(--panel);}

.tabpane{display:none; overflow:auto; padding:10px 12px; flex:1;}

.tabpane.active{display:block;}



/* 综合图表页 */

.combo-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px;}

.chart-card{border:1px solid var(--border); border-radius:6px; padding:8px; background:var(--card-bg);}

.chart-title{font-size:12.5px; color:var(--accent); font-weight:600; margin-bottom:6px;}

.chart-card canvas{width:100%; height:auto; background:#fff; border:1px solid #eef1f6; border-radius:4px;}

.chart-title-bar{display:flex; align-items:center; justify-content:space-between; margin-bottom:6px;}

.chart-title-bar .chart-tools{display:flex; gap:4px;}

#paretoChart{width:100%; height:auto;}

#historyChart{width:100%; height:auto; margin-top:6px;}

#loadChart{width:100%; height:auto;}

/* 放大模态窗 */

.modal.zoom{width:min(96vw,1080px); max-height:92vh; display:flex; flex-direction:column;}

.zoom-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}

.zoom-head h3{color:var(--accent);}

.zoom-tools{display:flex; gap:6px;}

#zoomCanvas{width:100%; height:auto; max-height:76vh; background:#fff; border:1px solid var(--border); border-radius:6px;}



/* 结果网格 */

.result-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}

.result-card{border:1px solid var(--border); border-radius:6px; padding:8px 12px; background:var(--card-bg);}

.result-card h4{font-size:12.5px; color:var(--accent); margin-bottom:6px; border-bottom:1px dashed #cfd8e3; padding-bottom:4px;}

.result-row{display:flex; justify-content:space-between; padding:2.5px 0; font-size:12.5px; border-bottom:1px dotted #eef1f6;}

.result-row .rk{color:#6a7482;}

.result-row .rv{font-weight:600;}

/* 未计算时的占位提示(替代以前的空白/空壳卡片) */
.result-empty{border-style:dashed; background:transparent;}
.result-empty .re-tip{font-size:12.5px; color:#8892a2; line-height:1.7;}

.result-row .rv.good{color:var(--ok);} .result-row .rv.bad{color:var(--danger);}

.status-line{padding:8px 2px; font-size:12px; color:#667;}



/* 优化 */

.opt-bar{display:flex; gap:18px; align-items:center; flex-wrap:wrap; margin-bottom:8px; font-size:12.5px;}

.opt-spinner{width:18px; height:18px; border:3px solid #dfe6ee; border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite;}

@keyframes spin{to{transform:rotate(360deg);}}

#paretoChart{width:100%; height:auto; background:var(--card-bg); border:1px solid var(--border); border-radius:6px; margin-bottom:8px;}

.data-table{width:100%; border-collapse:separate; border-spacing:0; font-size:12px;}

.data-table th,.data-table td{padding:5px 8px; border:1px solid var(--border); text-align:center;}

.data-table th{background:var(--th-bg); color:var(--accent); position:sticky; top:0; z-index:2;}

.data-table thead th{border-bottom:2px solid var(--accent);}

.data-table tr:nth-child(even){background:var(--tab-bg);}

.data-table tr.best td{background:#fff8e1; font-weight:700;}

/* 优化结果表: 输出解(最优折中解)行高亮 */
.data-table tr.pareto-best td{background:var(--best-row-bg,#fff3bf); font-weight:700; color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent);}



/* 报告 */

.report-tools{margin-bottom:8px;}

.report-editor{

  width:100%; min-height:280px; border:1px solid var(--border); border-radius:6px; padding:10px;

  font-family:"Microsoft YaHei",monospace; font-size:13px; line-height:1.6; resize:vertical;

}



/* 可拖拽分隔条(调节宽/高比例) */

.resizer-v{width:7px; cursor:col-resize; flex:none; background:transparent; transition:background .15s;}

.resizer-v:hover,.resizer-v:active{background:rgba(47,111,178,.28);}

.resizer-h{height:7px; cursor:row-resize; flex:none; background:transparent; transition:background .15s;}

.resizer-h:hover,.resizer-h:active{background:rgba(47,111,178,.28);}

/* 收起日志: 隐藏内容栏, 仅留标题行 */

.log-panel.collapsed .log-box{display:none;}

.log-panel.collapsed .opt-progresswrap{display:none !important;}



/* 日志(底部一行, 跨12列, 占约1/4) */

.log-panel{

  grid-area:3/1/4/13; min-height:0; background:var(--panel); border:1px solid var(--border);

  border-radius:8px; box-shadow:var(--shadow); display:flex; flex-direction:column; overflow:hidden;

}

.log-head{

  padding:6px 14px; border-bottom:1px solid var(--border); font-weight:700; color:var(--accent);

  font-size:12.5px; flex:none; display:flex; align-items:center; gap:8px;

}

.log-toggle{margin-left:auto; cursor:pointer; color:var(--accent2); font-size:11.5px; padding:2px 8px;}

.log-step{font-weight:400; color:#8a94a6; font-size:11.5px; max-width:46%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

.log-progresswrap{flex:none; display:flex; align-items:center; gap:10px; padding:4px 14px; border-bottom:1px solid var(--border); background:#f7fafd;}

.log-progressbar{flex:1; height:9px; background:#e6edf5; border-radius:5px; overflow:hidden;}

.log-progressbar .opt-bar{height:100%; width:0%; background:linear-gradient(90deg,#2f6fb2,#4a9de0); border-radius:5px; transition:width .3s;}

.log-progressbar .opt-bar.done{background:linear-gradient(90deg,#2e7d32,#66bb6a);}

.log-progressbar .opt-bar.err{background:linear-gradient(90deg,#c00000,#e57373);}

.opt-pct{font-size:11.5px; color:var(--accent2); font-weight:700; min-width:44px; text-align:right;}

.log-box{flex:1; overflow-y:auto; padding:6px 12px; font-family:Consolas,"Courier New",monospace; font-size:11.5px;}

.log-item{border-left:3px solid #cfd8e3; padding:2px 8px; margin:2px 0; background:#fafbfd; border-radius:2px;}

.log-item .t{color:#9aa3b2; margin-right:6px;}

.log-item.INFO{border-color:var(--accent2);}

.log-item.WARN{border-color:#e6a700;}

.log-item.ERROR{border-color:var(--danger);}

.log-item .m{color:#333;}



/* 状态栏 */

.statusbar{

  display:flex; justify-content:space-between; padding:5px 14px; background:var(--panel);

  border-top:1px solid var(--border); font-size:11.5px; color:#8a94a6; flex:none;

}



/* ===== 工作台布局(活动栏 + 侧边栏 + 主体) 参照 VS Code ===== */

.workbench{flex:1; display:flex; flex-direction:row; min-height:0; width:100%;}

/* 活动栏 · 左侧竖排图标 */

.activity-bar{

  flex:none; width:44px; display:flex; flex-direction:column; justify-content:space-between;

  background:linear-gradient(180deg,#223a58,#1a2d45); color:#cdd9ec; padding:4px 0;

}

.act-top,.act-bottom{display:flex; flex-direction:column; align-items:center; gap:2px;}

.act-btn{

  width:36px; height:36px; margin:1px 0; border:none; border-radius:6px; background:transparent;

  font-size:17px; line-height:1; cursor:pointer; color:#aebdd6; position:relative;

}

.act-btn:hover{background:rgba(255,255,255,.08); color:#fff;}

.act-btn.active{background:rgba(255,255,255,.16); color:#fff;}

.act-btn.active::before{content:""; position:absolute; left:-4px; top:8px; bottom:8px; width:3px; border-radius:2px; background:#37e6ff;}

/* 侧边栏 */

.side-panel{

  flex:none; width:248px; background:var(--panel); border-right:1px solid var(--border);

  display:flex; flex-direction:column; min-height:0; overflow:hidden;

  transition:width .18s ease, opacity .15s ease, margin-left .18s ease;

}

body.side-collapsed .side-panel{width:0; min-width:0; margin-left:0; padding:0; opacity:0; border-right-width:0; overflow:hidden; pointer-events:none;}
/* 收缩时把腾出的宽度交给主区: 用 width 过渡而不是负 margin, 否则 flex 行宽会按 44+0-248 计算,
   主区被撑到 2116px 并向左溢出 204px, 表现为“最小化后界面整体变形/右半边被裁” */

.side-head{

  flex:none; display:flex; align-items:center; justify-content:space-between;

  padding:7px 10px; border-bottom:1px solid var(--border); background:linear-gradient(90deg,#f6f9fd,#edf2f9);

}

body.theme-dark .side-head{background:#0f1830;}

body[data-theme] .side-head{background:transparent;}

.side-title{font-weight:700; color:var(--accent); font-size:12.5px;}

.side-head-actions{display:flex; align-items:center;}

.side-btn{

  width:22px; height:22px; border:1px solid var(--border); border-radius:4px; background:transparent;

  cursor:pointer; font-size:12px; line-height:1; color:#5a6472;

}

.side-btn:hover{background:#eef2f8; color:var(--accent);}

body.theme-dark .side-btn:hover{background:#1b2a44;}

.side-body{flex:1; min-height:0; overflow-y:auto; padding:8px 8px 12px;}

/* 侧边栏视图切换 */

.side-view{display:flex; flex-direction:column;}

/* 树形列表 */

.tree-sec{font-size:11px; color:#8a94a6; letter-spacing:.3px; padding:6px 6px 3px; font-weight:600;}

.tree{display:flex; flex-direction:column;}

.tree-item{

  display:flex; align-items:center; gap:5px; padding:5px 8px; border-radius:5px; font-size:12.5px;

  color:var(--text); cursor:pointer; user-select:none;

}

.tree-item:hover{background:var(--field-hover); color:var(--accent);}

.tree-item.active{background:var(--th-bg); color:var(--accent); font-weight:600;}

.tree-item .tri{font-size:10px; color:#8a94a6; width:12px; flex:none;}

.tree-item.indent{padding-left:22px;}

.tree-item .file{color:#8a94a6; width:16px; text-align:center; flex:none;}

/* 资源管理器 · 可展开分组 */

.tree-group .tree-item.expandable{font-weight:600; color:var(--text); cursor:pointer;}

.tree-group .tree-item.expandable .tri{transition:transform .15s ease;}

/* 资源管理器: 待开发模块占位 */

.tree-group .tree-item.expandable.todo{opacity:.55; cursor:default;}

.tree-group .tree-item.expandable.todo .tri{visibility:hidden;}

.mod-name{flex:0 1 auto;}

.mod-tag{margin-left:auto; font-size:9px; color:#8a94a6; border:1px solid var(--border); border-radius:8px; padding:1px 6px; flex:none;}



.tree-group .tree-children{display:flex; flex-direction:column;}

.tree-group:not(.open) .tree-children{display:none;}

.tree-group .tree-item.child{padding-left:30px; font-weight:400;}

.tree-group .tree-item.child .file{width:16px;}

/* 搜索 */

.search-box{display:flex; align-items:center; gap:4px; padding:4px 2px;}

.search-box input{flex:1; padding:6px 8px; border:1px solid var(--border); border-radius:5px; font-size:12.5px; background:var(--panel); color:var(--text);}

.search-box input:focus{outline:none; border-color:var(--accent);}

.search-meta{font-size:11px; color:#8a94a6; padding:4px 6px;}

/* 项目卡片 */

.proj-card{background:var(--card-bg); border:1px solid var(--border); border-radius:8px; padding:8px 10px; margin:4px 2px;}

.proj-row{display:flex; justify-content:space-between; gap:8px; padding:3px 0; font-size:12px; color:#5a6472; border-bottom:1px dashed var(--border);}

.proj-row:last-of-type{border-bottom:none;}

.proj-row b{color:var(--text); text-align:right; word-break:break-all;}

.proj-actions{display:flex; gap:5px; flex-wrap:wrap; margin-top:8px;}

.proj-actions .mini-btn{padding:4px 9px; font-size:12px;}



/* 本地文件浏览 */

.file-toolbar{display:flex; align-items:center; gap:4px; padding:4px 2px;}

.file-toolbar .side-btn{width:26px; height:24px; padding:0; font-size:12px; flex:none;}

.file-cwd{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:#8a94a6; border:1px solid var(--border); border-radius:5px; padding:4px 6px; background:var(--field-bg, transparent);}

.file-pathrow{display:flex; align-items:center; gap:4px; padding:4px 2px 6px; flex-wrap:wrap;}

.file-pathrow input{flex:1 1 120px; min-width:0; padding:5px 7px; border:1px solid var(--border); border-radius:5px; font-size:11.5px; background:var(--panel); color:var(--text);}

.file-pathrow input:focus{outline:none; border-color:var(--accent);}

.file-pathrow .side-btn{white-space:nowrap; padding:0 6px; height:22px; font-size:11px;}

.file-status{font-size:11px; color:#8a94a6; padding:4px 6px;}

#fileTree .tree-item{display:flex; align-items:center; gap:2px; padding:4px 6px;}

#fileTree .tree-item .file{flex:none;}

#fileTree .tree-item{color:var(--text);}

.file-mkrow{display:flex; align-items:center; gap:4px; padding:4px 2px;}
.file-mkrow input{flex:1; min-width:0; padding:5px 7px; border:1px solid var(--border); border-radius:5px; font-size:11.5px; background:var(--panel); color:var(--text);}
.file-mkrow input:focus{outline:none; border-color:var(--accent);}
.file-mkrow .side-btn{white-space:nowrap; padding:0 6px; height:22px; font-size:11px;}
.file-mkrow select{flex:none; padding:4px 5px; border:1px solid var(--border); border-radius:5px; font-size:11px; background:var(--panel); color:var(--text);}
.file-mkrow select:focus{outline:none; border-color:var(--accent);}

.file-del{margin-left:auto; flex:none; width:18px; height:18px; padding:0; border:none; background:transparent; color:#a22; font-size:13px; line-height:1; cursor:pointer; border-radius:4px; opacity:.55;}
.file-del:hover{opacity:1; background:rgba(170,34,34,.12);}
.file-actions{display:flex; align-items:center; gap:4px; padding:2px 2px 4px; flex-wrap:wrap;}
.file-actions .side-btn{width:26px; height:24px; padding:0; font-size:13px; flex:none; position:relative;}
.file-actions .side-btn.hasclip::after{content:""; position:absolute; top:-1px; right:-1px; width:7px; height:7px; border-radius:50%; background:var(--ok,#2ecc71); border:1px solid var(--panel,#fff);}
.file-sel{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--accent,#4096ff); cursor:default;}
.file-actions-sep{flex:none; width:1px; height:16px; background:var(--border,#2c3448); margin:0 2px;}

#fileTree .tree-item{cursor:default; border-radius:5px;}
#fileTree .tree-item.sel{background:var(--accent,#4096ff); color:#fff !important;}
#fileTree .tree-item.sel .file{color:rgba(255,255,255,.85);}
#fileTree .tree-item.sel span[style]{color:rgba(255,255,255,.85) !important;}
#fileTree .tree-item[title]:hover{position:relative;}




/* 模态框 */

.modal-overlay{

  position:fixed; inset:0; background:rgba(10,20,40,.45); display:flex; align-items:center; justify-content:center; z-index:200;

}

.modal{background:var(--panel); color:var(--text); border-radius:10px; padding:20px 24px; width:420px; box-shadow:0 12px 40px rgba(0,0,0,.25);}

.modal.small{width:380px;}

.modal.help{width:min(98vw,1320px); max-width:100%; max-height:92vh; display:flex; flex-direction:column; padding:18px 22px;}

.help-body{overflow:auto; flex:1; min-height:0; padding:4px 6px 6px 2px; font-size:12.5px; line-height:1.75; color:#2c3442;}

.help-body h4{color:var(--accent); margin:10px 0 4px; border-left:3px solid var(--accent2); padding-left:8px;}

.help-body h4:first-child{margin-top:2px;}

.help-body ul{margin:2px 0 6px 20px;}

.help-body li{margin:2px 0;}

.help-body b{color:#1f4e78;}

.help-overview{background:rgba(31,78,120,.08); border:1px solid rgba(31,78,120,.22); border-radius:6px; padding:8px 10px; margin-bottom:8px;}

.help-formula{border-collapse:collapse; width:100%; min-width:0; table-layout:fixed; margin:2px 0 6px; font-size:12.5px;}

.help-formula th{background:#e9f0f8; color:var(--accent); text-align:left; vertical-align:top; padding:4px 8px; border:1px solid rgba(31,78,120,.18);}
/* ===== 所有表格统一悬浮表头(滚动时表头固定) ===== */
.help-formula th{position:sticky; top:0; z-index:3; background:var(--th-bg,#e9f0f8);}
.helptab{border-collapse:collapse; width:100%; font-size:12.5px; margin:2px 0 6px;}
.helptab th{position:sticky; top:0; z-index:3; background:#1f4e78; color:#fff; text-align:left; padding:5px 8px; border:1px solid rgba(31,78,120,.35);}
.helptab td{padding:5px 8px; border:1px solid rgba(31,78,120,.15); vertical-align:top; word-break:break-word;}
.helptab tr:nth-child(even) td{background:rgba(31,78,120,.05);}


.help-formula td{padding:4px 8px; border:1px solid rgba(31,78,120,.14); vertical-align:top; word-break:break-word; white-space:normal;}
.help-formula th:nth-child(1),.help-formula td:nth-child(1){width:15%;}
.help-formula th:nth-child(2),.help-formula td:nth-child(2){width:42%;}
.help-formula th:last-child,.help-formula td:last-child{width:auto;}

.help-formula tr:nth-child(even) td{background:rgba(31,78,120,.03);}
.hdd-tree{border:1px solid rgba(31,78,120,.22); border-radius:6px; padding:8px 12px; margin:0 0 12px; background:rgba(31,78,120,.05);}
.hdd-cap{font-weight:700; color:var(--accent); margin-bottom:4px; font-size:13px;}
.hdd-tree details{margin:2px 0;}
.hdd-tree summary{cursor:pointer; font-weight:600; color:#1f4e78; padding:2px 6px; user-select:none; border-radius:4px; list-style:none;}
.hdd-tree summary::before{content:'🗂 ';}
.hdd-tree summary:hover{background:rgba(31,78,120,.08);}
.hdd-item{cursor:pointer; padding:2px 4px 2px 24px; color:#2c3442; border-radius:4px; font-size:12.5px; position:relative;}
.hdd-item::before{content:'📄 ';}
.hdd-item:hover{background:rgba(31,78,120,.12); color:#c00000;}

.help-body hr{border:none; border-top:1px solid rgba(31,78,120,.22); margin:12px 0;}

.modal h3{color:var(--accent); margin-bottom:12px;}

.modal label{display:block; margin:8px 0;}

.modal p{margin:8px 0; font-size:12.5px; line-height:1.6;}

.modal ul{margin:8px 0 10px 18px; font-size:12.5px; line-height:1.7;}

.modal-btns{display:flex; gap:8px; justify-content:flex-end; margin-top:12px;}

.file-list{list-style:none; max-height:280px; overflow-y:auto; border:1px solid var(--border); border-radius:6px;}

.file-list li{padding:8px 12px; cursor:pointer; border-bottom:1px solid #eef1f6; font-size:12.5px;}

.file-list li:hover{background:var(--btn-hover); color:var(--accent);}



::-webkit-scrollbar{width:8px; height:8px;}

::-webkit-scrollbar-thumb{background:#c4cdd8; border-radius:4px;}

::-webkit-scrollbar-thumb:hover{background:#a9b6c6;}





/* 验算结果卡片: 不足约束 + 改进建议 */

.check-card{border:1px solid var(--border); background:var(--panel);}

.check-card h4{color:var(--accent); padding:6px 14px; border-bottom:1px solid var(--border);}

.chk-row{display:grid; grid-template-columns:1.4fr 1fr 1.4fr 0.6fr; gap:8px; padding:6px 12px;

  border-bottom:1px solid var(--border); font-size:12px; align-items:center;}

.chk-row.bad{background:#fdf3f3; border-left:3px solid var(--danger);}

.chk-row.ok{background:#f6faf6; border-left:3px solid #39a35a;}

.chk-name{font-weight:600; color:#334; word-break:break-all;}

.chk-val{font-family:Consolas,monospace; color:#555;}

.chk-limit{color:#8a93a2;}

.chk-res{font-weight:700;}

.chk-row.bad .chk-res{color:var(--danger);}

.chk-row.ok .chk-res{color:#2c9a4f;}

.chk-sug{grid-column:1/-1; color:#a3500a; line-height:1.45; padding:2px 0;}



/* ---------- 计算/验算主按钮(优化显示) ---------- */

.tb-btn.compute{

  background:linear-gradient(90deg,var(--accent),var(--accent2)); color:#fff; border:none;

  font-weight:700; padding:7px 18px; font-size:13px; letter-spacing:.5px;

  box-shadow:0 2px 6px rgba(31,78,120,.30); transition:filter .15s, transform .1s, box-shadow .15s;

}

.tb-btn.compute:hover{filter:brightness(1.1); box-shadow:0 3px 9px rgba(31,78,120,.38); transform:translateY(-1px);}

.tb-btn.compute:active{transform:translateY(0);}

.tb-btn.check{

  background:#fff; color:var(--accent); border:1px solid var(--accent2); font-weight:600; padding:6px 14px;

}

.tb-btn.check:hover{background:var(--btn-hover); border-color:var(--accent);}

.tb-btn.check:active{background:#dde9f5;}

/* 结果面板内计算/验算按钮分组 */

.compute-group{display:flex; align-items:center; gap:6px; margin-left:auto;}

.compute-group .mini-btn.compute{background:linear-gradient(90deg,var(--accent),var(--accent2)); color:#fff; border:none;

  font-weight:700; padding:6px 14px; box-shadow:0 1px 4px rgba(31,78,120,.26);}

.compute-group .mini-btn.compute:hover{filter:brightness(1.1);}

.compute-group .mini-btn.check{color:var(--accent); border:1px solid var(--accent2); font-weight:600; padding:6px 12px;}

.compute-group .mini-btn.check:hover{background:var(--btn-hover);}



/* ---- 数据库核验(三化) ---- */

.modal.medium{width:min(680px,92vw);}

.db-check-body{max-height:64vh; overflow:auto; padding:4px 8px 8px;}

.db-summary{font-weight:600; font-size:14px; padding:10px 14px; border-radius:8px; margin-bottom:12px;}

.db-s-ok{color:#1d6f3a; background:#e7f6ec; border:1px solid #bfe6cd;}

.db-s-bad{color:#a11313; background:#fdeaea; border:1px solid #f3c0c0;}

.db-item{border:1px solid var(--line,#d8dee8); border-radius:8px; padding:8px 12px; margin-bottom:8px; background:#fff;}

.db-item.db-fail{border-left:4px solid #c62828; background:#fff8f7;}

.db-item.db-pass{border-left:4px solid #2e7d32; background:#f7fbf7;}

.db-head{display:flex; align-items:center; gap:8px; font-size:13px; color:#16324a; margin-bottom:4px;}

.db-ok{color:#2e7d32; font-weight:700;}

.db-bad{color:#c62828; font-weight:700;}

.db-tag{margin-left:auto; font-size:11px; padding:1px 8px; border-radius:10px; background:#eef2f7; color:#5a6b7b;}

.db-item.db-fail .db-tag{background:#fbe3e3; color:#a11313;}

.db-item.db-pass .db-tag{background:#e3f2e8; color:#2e7d32;}

.db-detail{font-size:12.5px; color:#3b4a5a; line-height:1.6;}

.db-sug{font-size:12px; color:#9a6a00; margin-top:4px; padding-left:10px; border-left:2px solid #f0c14b;}

/* 数据库核验 · 命中库内重复/可替代时输出该条全部信息 */
.db-dupbox{border:1.5px solid #f0a020; background:#fffdf6; border-radius:8px; padding:10px 12px; margin-bottom:12px;}
.db-dup-head{font-size:13px; font-weight:700; color:#a15a00; margin-bottom:8px;}
.db-dup-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:6px 14px;}
.db-dup-item{display:flex; align-items:center; gap:6px; font-size:12.5px; line-height:1.6;}
.db-dup-label{color:#7a6a4a; white-space:nowrap; flex:none;}
.db-dup-val{color:#23303c; font-weight:600; word-break:break-all;}

/* 典型库表 · 命中重复/可替代的行高亮 */
.tk-table tbody tr.tk-duphl{background:#fff4d6 !important; outline:2px solid #f0a020;}
.tk-table tbody tr.tk-duphl td{background:#fff4d6 !important; color:#6b4a00; font-weight:600;}



/* ---- 数据库核验弹窗工具栏 ---- */

.db-check-tools{display:flex;gap:8px;padding:2px 8px 10px;border-bottom:1px dashed #d8dee8;margin-bottom:10px;margin-top:4px;}

.db-check-tools .mini-btn{margin:0;}



/* ---- 材料 S-N / e-N 曲线页签 ---- */

.sn-intro{background:#eef3fb;border:1px solid #d8e2f0;border-radius:8px;padding:8px 12px;color:#5a6472;font-size:12.5px;margin-bottom:10px;}

.sn-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start;}

@media (max-width:900px){.sn-grid{grid-template-columns:1fr;}}

.sn-card{display:flex;flex-direction:column;}

.sn-card canvas{width:100%;height:auto;background:#fff;}

.sn-inputs,.sn-btns{margin-top:8px;}

#snPoints{width:100%;box-sizing:border-box;border:1px solid #cdd7e6;border-radius:6px;padding:6px 8px;font:12px/1.5 sans-serif;color:#223;resize:vertical;background:#fbfcfe;min-height:74px;}

.en-inputs{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;padding:6px 0;}

.en-inputs label{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#5a6472;}

.en-inputs .en-switch-line{font-weight:600;color:#1f4e78;border:1px solid #b9c9e0;border-radius:6px;padding:3px 8px;background:#eef4fb;cursor:pointer;}

.en-inputs .en-switch-line input{width:auto;margin:0;}

.en-inputs input{width:74px;border:1px solid #cdd7e6;border-radius:6px;padding:3px 6px;font-size:12px;text-align:right;background:#fff;}

.sn-src{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;padding:6px 0;}

.sn-src label{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#5a6472;}

.sn-src select,.sn-src input{padding:3px 6px;border:1px solid #cdd7e6;border-radius:6px;font-size:12px;background:#fff;}

.sn-src input{width:86px;text-align:right;}

.plastic-ctrl{display:flex;flex-direction:column;gap:4px;align-items:stretch;border:1px dashed #b9a86b;border-radius:8px;padding:4px 10px;background:#fffdf4;transition:opacity .2s;}

.plastic-row{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;}

.plastic-ctrl .en-switch-line{font-weight:600;color:#7a5a00;cursor:pointer;padding:2px 6px;width:auto;max-width:auto;white-space:nowrap;}

.plastic-ctrl input[type=number]{width:64px;text-align:right;}

.plastic-ctrl label{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#5a6472;white-space:nowrap;}

.plastic-ctrl select{padding:2px 4px;border:1px solid #cdd7e6;border-radius:6px;font-size:12px;background:#fff;}

.sn-btns{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}

.sn-btns .mini-btn{margin:0;}

.sn-out{font-size:12px;color:#2a7a4a;}



/* ================= 材料库 (material) ================= */

#tab-material .mat-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:8px; font-weight:700; color:var(--accent,#1f4e78); }

#tab-material .mat-toolbar .hint { font-weight:400; color:#7a8698; font-size:12px; }

.mat-controls { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:10px; }

.mat-input { height:30px; border:1px solid #c8d2de; border-radius:6px; padding:0 8px; font-size:12.5px; background:#fff; color:#223; }

#matSearch { width:220px; }

.mat-controls select.mat-input { width:170px; }

.mat-form { border:1px solid #c8d2de; border-radius:8px; background:#f6f9fc; padding:12px 14px; margin-bottom:12px; }

.mat-form-title { font-weight:700; color:var(--accent,#1f4e78); margin-bottom:8px; }

.mat-form-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px 12px; }

.mat-form-grid label { font-size:12px; color:#4a5568; display:flex; flex-direction:column; gap:3px; }

.mat-form-grid input, .mat-form-grid select { height:29px; border:1px solid #c8d2de; border-radius:6px; padding:0 7px; font-size:12.5px; }

.mat-form-grid .span2 { grid-column: span 2; }

.mat-form-btns { margin-top:10px; display:flex; gap:8px; align-items:center; }

.mat-form-btns .status-line { margin-left:8px; color:#a3500a; }

.mat-table-wrap { border:1px solid #e2e8f0; border-radius:8px; }

.mat-table { width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }

.mat-table th { position:sticky; top:0; background:#1f4e78; color:#fff; padding:7px 8px; white-space:nowrap; z-index:2; }

.mat-table td { padding:6px 8px; border-bottom:1px solid #eef2f7; white-space:nowrap; }

.mat-table tbody tr:hover { background:#f0f6ff; }

.mat-table .mat-hint-row td { background:#eef4fb; color:#4a5568; white-space:normal; }

.mat-table .mat-name { font-weight:600; color:var(--accent,#1f4e78); max-width:220px; overflow:hidden; text-overflow:ellipsis; }

.mat-table .mat-note-td { max-width:220px; overflow:hidden; text-overflow:ellipsis; color:#6b7280; }

.mat-table .mat-sim { display:inline-block; background:#e6eefb; color:#1f4e78; border-radius:10px; padding:1px 8px; font-size:11px; }

.mat-table .mat-tag-c { background:#fde68a; color:#92400e; border-radius:8px; font-size:10px; padding:0 5px; }

/* 材料来源标记: 衍生牌号(名字带后缀) / 重复属性(与同族另一条物性完全相同) */
.mat-table .mat-tag-p { background:#dbeafe; color:#1e40af; border-radius:8px; font-size:10px; padding:0 5px; }
.mat-table .mat-tag-d { background:#e5e7eb; color:#4b5563; border-radius:8px; font-size:10px; padding:0 5px; }
.mat-controls .mat-chk { display:flex; align-items:center; gap:4px; font-size:12px; color:#374151; cursor:pointer; }
.mat-controls .mat-chk input { transform:scale(1.05); cursor:pointer; }

.mat-table input[type=checkbox] { transform:scale(1.1); cursor:pointer; }



/* 材料库动态分类列 */

.mat-table th .mat-unit{display:block;font-weight:400;color:#7a89a0;font-size:10px;margin-top:2px}

.mat-table-wrap{overflow:visible}

.mat-table{min-width:880px}
/* 典型库: 列宽按内容自适应, 文本列省略显示, 容器横向滚动 */
.tk-wrap{border:1px solid #e2e8f0; border-radius:8px;}
.tk-table{min-width:1180px; table-layout:auto; width:auto;}
.tk-table th{position:sticky; top:0; background:#1f4e78 !important; color:#fff; z-index:2;}
.tk-table th,.tk-table td{white-space:nowrap;}
.tk-table td{max-width:220px; overflow:hidden; text-overflow:ellipsis;}
.tk-table td:nth-child(1){max-width:140px;}      /* 名称 */
.tk-table td:nth-child(4){max-width:180px;}      /* 材料 */
.tk-table td:nth-child(14){max-width:200px;}     /* 备注 */
.tk-table td:nth-child(15){max-width:100px;}     /* 录入人 */
.tk-table td.tk-ops{max-width:140px; text-align:center;}  /* 操作 按钮不截断 */





/* 非线性属性面板 */

.mat-nl-overlay{position:fixed;inset:0;background:rgba(10,18,30,.55);z-index:1200;display:flex;align-items:center;justify-content:center}

.mat-nl-panel{background:#f7f9fd;color:#1c2733;border:1px solid #c6d2e2;border-radius:10px;padding:14px 16px;width:min(720px,94vw);max-height:86vh;overflow:auto;box-shadow:0 12px 40px rgba(0,0,0,.35)}

.mat-nl-head{display:flex;justify-content:space-between;align-items:center;font-size:15px;margin-bottom:10px}

.mat-nl-close{cursor:pointer;color:#556;padding:0 6px}

.mat-nl-tool{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}

.mat-nl-tool label{display:flex;align-items:center;gap:6px;font-size:12px}

.mat-nl-bilinear{display:flex;gap:14px;flex-wrap:wrap;padding:8px 0}

.mat-nl-bilinear label{display:flex;align-items:center;gap:6px;font-size:12px}

.mat-nl-table{margin:8px 0}

.mat-nl-tabletool{display:flex;gap:8px;align-items:center;margin-bottom:6px}

.mat-nl-table .data-table input[type=number]{width:110px;padding:3px 4px}

.mat-nl-foot{display:flex;gap:8px;align-items:center;margin-top:10px}

.mat-nl-hyper table input[type=number]{width:130px;padding:3px 4px}

.mat-tag-nl{background:#7b4fd0;color:#fff;font-size:10px;border-radius:3px;padding:1px 4px;margin-left:4px}



.snen-wrap{margin-top:4px;width:100%;border:1px solid #e2e8f0;border-radius:8px;}

.mat-param-table{min-width:1500px;table-layout:auto}

.mat-param-table td{color:#111;font-weight:500}

.mat-param-table th,.mat-param-table td{white-space:nowrap}

.mat-param-table th:nth-child(1){width:34px}

.mat-param-table th:nth-child(2),.mat-param-table td:nth-child(2){width:185px}

.mat-param-table th:nth-child(3),.mat-param-table td:nth-child(3){width:185px}

.mat-param-table th:nth-child(n+4):nth-child(-n+14),.mat-param-table td:nth-child(n+4):nth-child(-n+14){width:76px}

.mat-param-table th:nth-child(15),.mat-param-table td:nth-child(15){width:240px}

.mat-param-table th:nth-child(16),.mat-param-table td:nth-child(16){width:70px}

/* 文本列允许换行、左对齐, 保证材料名称完整可读 */

.mat-param-table th:nth-child(2),.mat-param-table th:nth-child(3),.mat-param-table th:nth-child(15),

.mat-param-table td:nth-child(2),.mat-param-table td:nth-child(3),.mat-param-table td:nth-child(15){white-space:normal;text-align:left}

.mat-param-table input[type=text],.mat-param-table input[type=number]{width:100%;box-sizing:border-box;padding:2px 3px;font-size:12px;color:#111;border:1px solid #b9c4d2;background:#fff}

.mat-param-table .snen-del{color:#c00000;cursor:pointer;background:#fff;border:1px solid #c00000;border-radius:3px;padding:1px 8px;font-size:12px}

.mat-param-table .snen-del:hover{background:#c00000;color:#fff}



/* 选择保存路径弹窗 */

.modal.path { width: 560px; max-width: 94vw; }

.path-head { display:flex; align-items:center; justify-content:space-between; }

.path-hint { font-size:12px; color:#8a94a6; }

.path-bar { display:flex; align-items:center; gap:8px; margin:10px 0 8px; }

.path-input-wrap { flex:1; display:flex; align-items:center; gap:6px; }

.path-input-wrap > span { font-size:12px; color:#8a94a6; white-space:nowrap; }

.path-input-wrap input { flex:1; font-family:Consolas,Menlo,monospace; font-size:13px; padding:6px 8px;

  border:1px solid #2c3448; background:#0d1220; color:#cfe3ff; border-radius:6px; }

.path-dirs { height:220px; overflow:auto; border:1px solid #2c3448; border-radius:8px;

  background:#0d1220; padding:6px; }

.path-dir { padding:7px 10px; border-radius:6px; cursor:pointer; font-size:13px; color:#c7d3e8;

  display:flex; align-items:center; gap:8px; }

.path-dir:hover { background:rgba(56,132,255,.16); color:#eaf2ff; }

.path-dir .icon { color:#5b8cff; font-weight:bold; }

.path-empty { padding:12px; color:#8a94a6; font-size:13px; }

.path-def { display:flex; align-items:center; gap:6px; margin-top:10px; font-size:13px; color:#c7d3e8; }

.mini-btn.primary { background:linear-gradient(135deg,var(--accent2),var(--accent)); color:#fff; font-weight:600; }

.mini-btn.primary:hover { filter:brightness(1.08); }





/* 设置弹窗 */

.modal.settings { width: 480px; max-width: 94vw; }

.set-row { display:flex; align-items:center; gap:10px; margin:10px 0; }

.set-label { width: 120px; font-size:13px; color:var(--text); flex:none; }

.set-row select { flex:1; padding:6px 8px; border:1px solid var(--border); background:var(--input-bg); color:var(--text);

  border-radius:6px; font-size:13px; }

.set-pick { flex:1; display:flex; gap:8px; }

.set-pick input { flex:1; font-family:Consolas,Menlo,monospace; font-size:12px; padding:6px 8px;

  border:1px solid var(--border); background:var(--input-bg); color:var(--text); border-radius:6px; }



/* 多账号快捷切换 */

.auth-accounts { margin-top:8px; display:flex; flex-wrap:wrap; gap:6px; }

.auth-accounts .acct-chip { font-size:12px; padding:4px 10px; border:1px solid #2c3448; border-radius:20px;

  background:#0d1220; color:#c7d3e8; cursor:pointer; }

.auth-accounts .acct-chip:hover { background:rgba(56,132,255,.18); color:#eaf2ff; }

.auth-accounts .acct-chip.on { background:rgba(56,132,255,.28); border-color:#3b82f6; color:#fff; }



/* 密度：舒适 */

body.theme-comfort { --rpad:26px; --rhead:34px; }

@media (prefers-reduced-motion: reduce){}



/* 深色主题(外壳级) */

body.theme-dark { background:#0b101c; color:#c9d8f0;

  --panel:#0e1526; --border:#26334d; --text:#c9d8f0;

  --btn-bg:#16223a; --btn-hover:#1c2c4a; --th-bg:#18233c; --card-bg:#111a2f; --tab-bg:#0f1828; --input-bg:#0c1322; }

body.theme-dark .menubar, body.theme-dark header { background:#0d1322; border-color:#1c2639; }

body.theme-dark .toolbar { background:#101828; border-color:#1c2639; }

body.theme-dark .menu-status { color:#8a97b5; }

body.theme-dark footer.statusbar { background:#0d1322; border-color:#1c2639; color:#8a97b5; }

body.theme-dark .menu-item > a, body.theme-dark nav.menu .menu-item { color:#c9d8f0; }

body.theme-dark .dropdown { background:#121a2c; border-color:#223048; }

body.theme-dark .dropdown a { color:#c9d8f0; }

body.theme-dark .dropdown a:hover { background:#1b2a44; }

body.theme-dark .tabbar .tab-btn { color:#9db1d0; border-color:#223048; }

body.theme-dark .tabbar .tab-btn.active { background:#16233c; color:#eaf2ff; border-color:#2b3f63; }



/* 显示/隐藏密码 */

.pw-field { display:flex; flex-direction:column; gap:4px; margin:6px 0; font-size:13px; color:#c7d3e8; }

.pw-box { display:flex; align-items:center; gap:4px; }

.pw-box input { flex:1; }

.pw-toggle { width:34px; height:30px; flex:none; border:1px solid #2c3448; background:#0d1220; color:#cfe3ff;

  border-radius:6px; cursor:pointer; font-size:15px; line-height:1; }

.pw-toggle:hover { background:#16223a; }



/* 菜单分隔线与编辑/视图 */

.menu-sep { display:block; height:1px; margin:5px 8px; background:#2a3350; }

.menu .dropdown a { display:block; padding:7px 16px; text-decoration:none; color:#dbe4f5; white-space:nowrap; }

.menu .dropdown a:hover { background:#1c2c4a; color:#fff; }



/* 账号权限管理 */

.user-mgmt-list { max-height:320px; overflow:auto; border:1px solid #25304a; border-radius:6px; background:#0c1322; margin:8px 0; }

.um-row { display:flex; align-items:center; gap:10px; padding:8px 10px; border-bottom:1px solid #182234; font-size:13px; }

.um-row:last-child { border-bottom:none; }

.um-user { flex:1; color:#e8f0ff; }

.um-online { font-style:normal; color:#37c26a; font-size:11px; }

.um-role { flex:none; font-size:11px; padding:2px 8px; border-radius:10px; }

.um-role.developer { background:#7a3fa0; color:#fff; }

.um-role.admin { background:#1f4e78; color:#fff; }

.um-role.user { background:#2c3448; color:#cfe3ff; }

.um-btn { flex:none; font-size:12px; }

.um-note { flex:none; color:#7f93b5; font-size:12px; }

.um-empty { padding:14px; text-align:center; color:#7f93b5; }



/* 账号列表手机号 */

.um-ph { color:#6b7fa3; font-size:11px; margin-left:6px; }

.um-btn.del { border-color:#5a2230; background:#2a1218; color:#ffb3b3; }

.um-btn.del:hover { background:#431d28; color:#fff; }

/* 记住密码/自动登录 排列 */

.auth-opt-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:4px 0; }

.auth-opt-row .auth-check { flex:none; }



/* 锁定时菜单栏置灰禁用(未登录/超时/登出); 解锁后激活 */

.menubar.locked .menu-item{opacity:.45; filter:grayscale(.9); pointer-events:none;}

.menubar.locked .menu-item:hover{background:transparent;}

/* 未登录/锁定时工具栏快捷按钮统一置灰禁点(登录按钮在 header 仍可点) */

body.gate-locked .toolbar .tb-btn{opacity:.45; filter:grayscale(.9); pointer-events:none;}

body.gate-locked .toolbar .tb-btn:hover{background:var(--btn-bg);}



/* 登录后: 展开的下拉菜单改为彩色(主题蓝) */

.menubar:not(.locked) .dropdown{background:#eaf2ff; border-color:#b9d0f5;}

.menubar:not(.locked) .dropdown a{color:#1f4e78;}

.menubar:not(.locked) .dropdown a:hover{background:#d5e6ff; color:#0f47b6;}

.menubar:not(.locked) .dropdown a.danger{color:#c00000;}

body.theme-dark .menubar:not(.locked) .dropdown{background:#15233d; border-color:#2c4a7c;}

body.theme-dark .menubar:not(.locked) .dropdown a{color:#c9ddff;}

body.theme-dark .menubar:not(.locked) .dropdown a:hover{background:#1d3357; color:#fff;}





/* ===== 5 款主题（data-theme 外壳/强调色；深色系沿用 theme-dark 基础） ===== */

body[data-theme=ocean] { --accent:#1e90ff; --accent2:#4db3ff; background:#051d36;

  --panel:#0a2233; --border:#155a9c; --text:#dfeaf7;

  --btn-bg:#0f2e44; --btn-hover:#143b57; --th-bg:#0f2c42; --card-bg:#081d2e; --tab-bg:#06233a; --input-bg:#082034; }

body[data-theme=ocean] .menubar, body[data-theme=ocean] header { background:linear-gradient(90deg,#07304f,#0b4a7a); border-color:#155a9c; }

body[data-theme=ocean] .dropdown { background:#0a2c4c; border-color:#155a9c; }

body[data-theme=ocean] .dropdown a:hover { background:#0f3f6e; }

body[data-theme=ocean] .menubar:not(.locked) .dropdown { background:#0f3f6e; border-color:#2a6ca8; }

body[data-theme=ocean] .menubar:not(.locked) .dropdown a { color:#d6ecff; }

body[data-theme=ocean] .menubar:not(.locked) .dropdown a:hover { background:#17528a; color:#fff; }

body[data-theme=forest] { --accent:#34a853; --accent2:#4cc06b; background:#0b2117;

  --panel:#0f3524; --border:#1b7a46; --text:#e2f4ea;

  --btn-bg:#14412c; --btn-hover:#1a5536; --th-bg:#123a26; --card-bg:#0d2d1e; --tab-bg:#0b281b; --input-bg:#0d2c1d; }

body[data-theme=forest] .menubar, body[data-theme=forest] header { background:linear-gradient(90deg,#0c3522,#126b3f); border-color:#1b7a46; }

body[data-theme=forest] .dropdown { background:#0f3524; border-color:#1b7a46; }

body[data-theme=forest] .dropdown a:hover { background:#175c39; }

body[data-theme=forest] .menubar:not(.locked) .dropdown { background:#175c39; border-color:#2f9c5e; }

body[data-theme=forest] .menubar:not(.locked) .dropdown a { color:#dcf5e6; }

body[data-theme=forest] .menubar:not(.locked) .dropdown a:hover { background:#1f7a4c; color:#fff; }

body[data-theme=violet] { --accent:#8b5cf6; --accent2:#a78bfa; background:#170f2b;

  --panel:#23173f; --border:#433071; --text:#efe9fc;

  --btn-bg:#2a1c4d; --btn-hover:#352463; --th-bg:#281a4a; --card-bg:#1f1440; --tab-bg:#1b1137; --input-bg:#1d1238; }

body[data-theme=violet] .menubar, body[data-theme=violet] header { background:linear-gradient(90deg,#2a1a54,#4c2a9c); border-color:#5b3ec2; }

body[data-theme=violet] .dropdown { background:#241749; border-color:#5b3ec2; }

body[data-theme=violet] .dropdown a:hover { background:#3a2877; }

body[data-theme=violet] .menubar:not(.locked) .dropdown { background:#3a2877; border-color:#7a5bd0; }

body[data-theme=violet] .menubar:not(.locked) .dropdown a { color:#f0e9ff; }

body[data-theme=violet] .menubar:not(.locked) .dropdown a:hover { background:#4a34a0; color:#fff; }



/* ===== 保存对话框：新建文件夹 + 文件名行 ===== */

.path-newrow, .path-filerow { display:flex; align-items:center; gap:8px; margin:8px 0 2px; }

.path-newrow input, .path-filerow input { flex:1; padding:5px 8px; border:1px solid var(--border); border-radius:5px; background:#fff; color:var(--text); }

body[data-theme] .path-newrow input, body[data-theme] .path-filerow input { background:var(--panel); }

.path-filerow label { white-space:nowrap; color:var(--text); }

.path-filerow input:disabled { background:#eef1f5; color:#98a1b3; }

body[data-theme] .path-filerow input:disabled { background:#1a2436; color:#7d8aa3; }



/* ===== 账号审核: 待审核徽标 ===== */

.um-pending { color:#ff9800; font-style:normal; margin-left:4px; border:1px solid #ff9800; border-radius:3px; padding:0 4px; font-size:11px; }

.um-btn.ok { background:var(--ok); color:#fff; }

body[data-theme] .um-pending { color:#ffb74d; border-color:#ffb74d; }



/* 综合图表: 压簧二维工程图卡片 */

.draw2d-box{overflow-x:auto;margin-top:4px}

.draw2d-box svg{display:block;margin:0 auto;max-width:100%;height:auto}

.spec-more-wrap{position:relative; display:inline-flex;}
.spec-more{cursor:pointer; font-size:11px; color:#2f6fb2; background:#fff; border:1px solid #b9c6d8; border-radius:4px; padding:1px 7px; white-space:nowrap;}
.spec-more:hover{background:rgba(47,111,178,.08);}
.spec-tip{display:none; position:absolute; top:calc(100% + 4px); left:0; z-index:40; background:#fff; border:1px solid #c8d2de; border-radius:6px; padding:6px 10px; box-shadow:0 4px 14px rgba(31,78,120,.16); min-width:320px; max-width:620px; flex-wrap:wrap; gap:4px 12px; align-items:baseline;}
.spec-more-wrap:hover .spec-tip, .spec-more-wrap:focus-within .spec-tip{display:flex;}
.spec-tip .spec-it{font-size:11px; color:#33415b;}

/* ===== 消除表头悬浮时与标签栏/容器顶部的缝隙 =====
   滚动容器 .tabpane 有 padding-top:10px, .help-body 有 padding-top:4px,
   sticky top:0 停在 content 内缘, 故需负偏移抵消 padding, 使表头贴住容器顶。 */
.tabpane thead th{position:sticky; top:-10px; z-index:3;}
.tabpane table > tbody tr:first-child th{position:sticky; top:-10px; z-index:3;}
.help-body thead th{position:sticky; top:-4px; z-index:3;}
.help-body table > thead th{top:-4px;}
.help-formula tr:first-child th, .helptab tr:first-child th{position:sticky; top:-4px; z-index:3;}

.hdd-fig{margin:10px 0 6px; text-align:center; border:1px solid rgba(31,78,120,.18); border-radius:6px; padding:8px 6px 6px; background:rgba(31,78,120,.04);}
.hdd-fig svg{width:100%; max-width:620px; height:auto; display:block; margin:0 auto;}
.hdd-fig figcaption{font-size:12.5px; color:#1f4e78; margin-top:6px; font-weight:600;}
.hdd-fig .cap-note{font-size:11.5px; color:#5a6a7e; margin-top:2px;}

/* ===== 标准系列化开关(中径/线径) + 载荷微调百分比挡位 ===== */
.series-switch{display:inline-flex; align-items:center; gap:5px; cursor:pointer; height:34px; margin:0 6px 0 2px; padding:0 8px; border:1px solid rgba(31,78,120,.22); border-radius:6px; background:rgba(31,78,120,.05);}
.series-switch .switch{position:relative; display:inline-block; width:30px; height:17px; flex:none;}
.series-switch .switch input{opacity:0; position:absolute; inset:0; width:100%; height:100%; margin:0; padding:0; cursor:pointer; z-index:2;}
.series-switch .slider{position:absolute; cursor:pointer; inset:0; background:#cbd5e1; border-radius:17px; transition:background .18s; box-shadow:inset 0 1px 2px rgba(0,0,0,.12);}
.series-switch .slider:before{content:""; position:absolute; height:13px; width:13px; left:2px; bottom:2px; background:#fff; border-radius:50%; transition:transform .18s; box-shadow:0 1px 2px rgba(0,0,0,.28);}
.series-switch .switch input:checked + .slider{background:#2f6fb2;}
.series-switch .switch input:checked + .slider:before{transform:translateX(13px);}
.series-switch .switch input:focus-visible + .slider{box-shadow:0 0 0 3px rgba(47,111,178,.25);}
.series-switch .adj-lbl{font-size:12px; font-weight:600; color:#33415b; white-space:nowrap; user-select:none; line-height:1;}
.load-adjust-group{display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 8px; border:1px solid rgba(31,78,120,.22); border-radius:6px; background:rgba(31,78,120,.05);}
.load-adjust-group .adj-lbl{font-size:12px; font-weight:600; color:#33415b; white-space:nowrap; user-select:none;}
.load-adjust-btns{display:inline-flex; gap:2px;}
.load-adjust-btn{font-size:11.5px; font-weight:600; padding:2px 7px; border:1px solid rgba(31,78,120,.25); border-radius:4px; background:#fff; color:#2c3e50; cursor:pointer; transition:all .15s; line-height:1.4;}
.load-adjust-btn:hover{background:#e8f0f7; border-color:#2f6fb2;}
.load-adjust-btn.active{background:#2f6fb2; color:#fff; border-color:#2f6fb2; box-shadow:0 1px 3px rgba(47,111,178,.35);}
/* 微调载荷关闭: 整组档位置灰且不可点 */
.load-adjust-group.is-disabled{opacity:.5; filter:grayscale(1); border-style:dashed; background:rgba(120,128,140,.06); cursor:not-allowed;}
.load-adjust-group.is-disabled .load-adjust-btn{cursor:not-allowed; background:#f1f3f6; color:#9aa4b2; border-color:#d6dbe2; box-shadow:none;}
.load-adjust-group.is-disabled .load-adjust-btn.active{background:#c9d0da; color:#fff; border-color:#c9d0da;}
.load-adjust-group.is-disabled .load-adjust-btn:hover{background:#f1f3f6; border-color:#d6dbe2;}

.result-card.advice{border-color:#e6c98f; background:#fffcf3; grid-column:1 / -1;}
.advice-list{margin:2px 0 0 16px; padding:0;}
.advice-list li{font-size:12px; line-height:1.65; color:#5b4a2a; margin:2px 0;}


/* ---------- 留言板(评论) ---------- */
.menu-badge{display:inline-block; min-width:15px; height:15px; line-height:15px; padding:0 4px; margin-left:5px;
  border-radius:8px; background:#d9534f; color:#fff; font-size:10.5px; text-align:center; vertical-align:1px;}
.cmt-modal{max-width:760px; width:94vw; max-height:86vh; display:flex; flex-direction:column; padding-bottom:6px;}
.cmt-head{display:flex; align-items:center; justify-content:space-between; margin:0 0 6px;}
.cmt-head h3{margin:0;}
.cmt-sub{font-size:11.5px; font-weight:400; color:#8a94a6; margin-left:6px;}
.cmt-x{border:0; background:transparent; font-size:16px; line-height:1; color:#8a94a6; cursor:pointer; padding:2px 4px;}
.cmt-x:hover{color:#c0392b;}
.cmt-list{flex:1 1 auto; min-height:160px; overflow-y:auto; padding:6px 2px; border-top:1px solid #e6eaf0;
  border-bottom:1px solid #e6eaf0; margin-bottom:8px;}
.cmt-empty{color:#98a2b3; font-size:12.5px; text-align:center; padding:26px 10px; line-height:1.8;}
.cmt-item{position:relative; padding:9px 10px 7px; margin:6px 0; border:1px solid #e6eaf0; border-radius:8px;
  background:#fbfcfe;}
.cmt-item.reply{margin-left:26px; background:#f6f8fb; border-left:3px solid #cfd9e6;}
.cmt-item.deleted{opacity:.66; background:#fafafa;}
.cmt-meta{display:flex; align-items:center; gap:6px; margin-bottom:4px;}
.cmt-ava{width:20px; height:20px; border-radius:50%; background:#4a6fa5; color:#fff; font-size:11px;
  line-height:20px; text-align:center; flex:0 0 auto;}
.cmt-user{font-size:12.5px; color:#2f3b4d;}
.cmt-tag{font-size:10px; padding:0 4px; border-radius:3px; line-height:15px; height:15px;
  background:#e8eef7; color:#4a6fa5;}
.cmt-tag.dev{background:#e6f4ea; color:#2e7d4f;}
.cmt-tag.adm{background:#fdf1e3; color:#a86a1f;}
.cmt-tag.me{background:#eef0f4; color:#6b7686;}
.cmt-time{font-size:11px; color:#9aa4b2; margin-left:auto;}
.cmt-body{font-size:12.8px; color:#33404f; line-height:1.75; word-break:break-word; white-space:normal;}
.cmt-gone{color:#9aa4b2; font-style:italic;}
.cmt-figs{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px;}
.cmt-fig{max-width:190px; max-height:150px; border:1px solid #dfe5ee; border-radius:5px; cursor:zoom-in;
  background:#fff;}
.cmt-img-err{font-size:11px; color:#c0392b;}
.cmt-acts{display:flex; gap:12px; margin-top:5px;}
.cmt-acts a{font-size:11.5px; color:#4a6fa5; text-decoration:none;}
.cmt-acts a:hover{text-decoration:underline;}
.cmt-acts a.cmt-del{color:#c0392b;}
.cmt-compose{border-top:0;}
.cmt-reply-to{display:flex; align-items:center; gap:8px; font-size:12px; color:#54637a;
  background:#f2f6fc; border:1px solid #dde6f3; border-radius:6px; padding:4px 8px; margin-bottom:6px;}
#cmtBody{width:100%; box-sizing:border-box; resize:vertical; min-height:62px; max-height:170px;
  font-size:12.8px; line-height:1.7; padding:7px 9px; border:1px solid #d7dee8; border-radius:6px;
  font-family:inherit; color:#2f3b4d;}
#cmtBody:focus{outline:none; border-color:#8fb0dd; box-shadow:0 0 0 2px rgba(74,111,165,.12);}
.cmt-tools{display:flex; align-items:center; gap:8px; margin-top:6px;}
.cmt-tip{font-size:10.5px; color:#9aa4b2; margin-right:auto;}
.cmt-pending{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px;}
.cmt-thumb{position:relative; width:70px; height:70px; border:1px solid #dfe5ee; border-radius:5px;
  overflow:hidden; background:#fff;}
.cmt-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.cmt-thumb-x{position:absolute; top:0; right:0; width:16px; height:16px; line-height:14px; padding:0;
  border:0; border-radius:0 0 0 5px; background:rgba(0,0,0,.55); color:#fff; font-size:11px; cursor:pointer;}
.cmt-emoji{display:none; margin-top:6px; padding:6px; border:1px solid #e3e9f1; border-radius:6px;
  background:#fafcff; max-height:96px; overflow-y:auto;}
.cmt-emo{width:28px; height:28px; border:0; background:transparent; font-size:16px; cursor:pointer;
  border-radius:5px; line-height:1;}
.cmt-emo:hover{background:#eaf1fb;}

/* ---------- 留言板(左侧栏内嵌) ---------- */
.act-btn{position:relative;}
.act-badge{position:absolute; top:1px; right:1px; min-width:14px; height:14px; line-height:14px; padding:0 3px;
  border-radius:7px; background:#d9534f; color:#fff; font-size:9.5px; text-align:center; pointer-events:none;}
.side-view.cmt-view{height:100%; min-height:0; overflow:hidden; padding:0 2px;}
.cmt-side-head{display:flex; align-items:center; justify-content:space-between; gap:6px;
  padding:1px 0 6px; border-bottom:1px solid #e6eaf0; margin-bottom:6px; flex:0 0 auto;}
.cmt-side-head .cmt-sub{font-size:11px; color:#8a94a6;}
.cmt-view .cmt-list{flex:1 1 auto; min-height:0; overflow-y:auto; border:0; margin:0; padding:0 1px 4px;}
.cmt-view .cmt-item{padding:7px 8px 6px; margin:5px 0; border-radius:7px;}
.cmt-view .cmt-item.reply{margin-left:14px; border-left-width:3px;}
.cmt-view .cmt-meta{gap:5px; flex-wrap:wrap;}
.cmt-view .cmt-ava{width:17px; height:17px; line-height:17px; font-size:10px;}
.cmt-view .cmt-user{font-size:11.8px;}
.cmt-view .cmt-time{font-size:10px;}
.cmt-view .cmt-body{font-size:12px; line-height:1.68;}
.cmt-view .cmt-fig{max-width:132px; max-height:104px;}
.cmt-view .cmt-acts{gap:10px; margin-top:4px;}
.cmt-view .cmt-acts a{font-size:11px;}
.cmt-view .cmt-compose{flex:0 0 auto; padding:6px 0 4px; border-top:1px solid #e6eaf0;}
.cmt-view #cmtBody{min-height:50px; max-height:120px; font-size:12px; padding:6px 8px;}
.cmt-view .cmt-tools{gap:6px; margin-top:5px;}
.cmt-view .cmt-tip{display:none;}
.cmt-view .cmt-thumb{width:52px; height:52px;}
.cmt-view .cmt-emoji{max-height:78px;}
.cmt-view .cmt-emo{width:24px; height:24px; font-size:14px;}
.cmt-view .status-line{font-size:11px; min-height:14px; margin-top:2px;}

/* 使用授权 状态标签 */
.lic-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;margin-right:8px;border-radius:12px;
  font-size:12px;cursor:pointer;border:1px solid transparent;white-space:nowrap}
.lic-chip.ok{background:#e8f6ee;color:#1e7b46;border-color:#bfe3cd}
.lic-chip.warn{background:#fff5e6;color:#a8641a;border-color:#f0d3a6}
.lic-chip.bad{background:#fdecec;color:#b03434;border-color:#f0c2c2}
body.public-mode [data-view="files"],body.public-mode [data-view="explorer"]{display:none!important}
body.public-mode #view-files,body.public-mode #view-explorer{display:none!important}
.pub-note{padding:14px 12px;font-size:12.5px;line-height:1.8;color:#6b7684}

/* 账号管理里的授权状态 */
.um-lic{font-style:normal;font-size:11px;margin-left:6px;padding:1px 6px;border-radius:8px;border:1px solid transparent}
.um-lic.ok{background:#e8f6ee;color:#1e7b46;border-color:#bfe3cd}
.um-lic.trial{background:#eef3fb;color:#315a91;border-color:#cadcf2}
.um-lic.pend{background:#fff5e6;color:#a8641a;border-color:#f0d3a6}
.um-lic.bad{background:#fdecec;color:#b03434;border-color:#f0c2c2}

/* ===== LaTeX 流式公式(tex.js) =====
   原则: 用 CSS 排分数线与根号顶线, 与正文字体(宋体/雅黑)自然贴合, 不加载额外字体文件。 */
.tex{font-family:"Cambria Math","Times New Roman","STIX Two Math",Georgia,serif; font-size:1.06em; line-height:1.15; white-space:nowrap; letter-spacing:.1px;}
.tex .tx-var{font-style:italic; font-family:"Cambria Math","Times New Roman",Georgia,serif;}
.tex .tx-op{padding:0 .12em;}
.tex .tx-txt{font-style:normal; font-family:inherit;}
.tex .tx-sp{display:inline-block;}
.tex .tx-delim{font-size:1.06em;}
/* 分数: 横线 + 上下居中 */
.tex .tx-fr{display:inline-flex; flex-direction:column; align-items:center; vertical-align:middle; margin:0 .22em; position:relative; top:-.06em;}
.tex .tx-fr .tx-num{padding:0 .28em .04em; border-bottom:1.15px solid currentColor; line-height:1.12;}
.tex .tx-fr .tx-den{padding:.04em .28em 0; line-height:1.12;}
/* 根号: √ + 顶线 */
.tex .tx-sq{display:inline-flex; align-items:flex-start; margin:0 .06em;}
.tex .tx-sq .tx-rad{line-height:1.02; font-size:1.12em; transform:translateY(.02em);}
.tex .tx-sq .tx-body{border-top:1.15px solid currentColor; padding:.06em .16em 0 .1em; margin-left:.03em; line-height:1.14;}
.tex .tx-sq .tx-idx{font-size:.62em; vertical-align:.75em; margin-right:-.1em;}
/* 上下标 */
.tex .tx-sup{font-size:.7em; vertical-align:.52em; line-height:0; padding-left:.04em;}
.tex .tx-sub{font-size:.7em; vertical-align:-.28em; line-height:.0; padding-left:.04em;}
/* 同一底数的上下标叠放 */
.tex .tx-ss{display:inline-flex; flex-direction:column; vertical-align:.28em; font-size:.7em; line-height:1.02; margin-left:.05em;}
.tex .tx-ss .tx-ss-s{padding-bottom:.02em;}
.tex .tx-ss .tx-ss-b{padding-top:.02em;}
/* 块级公式: 居中 + 右侧编号 */
.tex-d{display:block; text-align:center; margin:10px 0 12px; font-size:1.02em; position:relative; padding:2px 0;}
.tex-d .eqno{position:absolute; right:6px; top:50%; transform:translateY(-50%); font-size:.86em; color:#5a6a7e; font-style:normal;}
.tex-i{white-space:nowrap;}
.tex-i .tex{font-size:1.02em;}

/* ===== 编辑菜单 → 窗口开关: 隐藏任意面板后, 其余面板自动占满并重排 ===== */
body.panel-layout .app-grid{
  grid-template-rows:minmax(0,1fr) minmax(0,1fr) auto;   /* 由 JS 按可见性覆盖 */
  grid-auto-flow:row;
  align-content:stretch;
}
body.panel-layout .app-grid > .panel,
body.panel-layout .app-grid > .log-panel{
  grid-row:auto; min-height:0;
}
body.panel-layout .log-panel{grid-column:1/-1 !important;}
/* 菜单里的勾选项 */
.dropdown a.menu-check{padding-left:22px; position:relative; white-space:nowrap;}
.dropdown a.menu-check.checked{font-weight:600;}

/* ===== 联网模式 · 本机保存位置 ===== */
#localDirRow{display:flex; align-items:center; gap:6px; flex-wrap:nowrap;}
#localDirRow .ellip{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; color:#2f6fb2;}
#localDirRow .mini-btn{flex:none; padding:1px 6px; font-size:11px;}
#localDirTip{display:block; margin:2px 0 4px; font-size:10.5px; line-height:1.5; color:#8892a2;}

/* ===== 留言板: 分组/筛选/问题项报告 ===== */
.cmt-side-head{display:flex; align-items:center; gap:3px; flex-wrap:wrap;}
.cmt-side-head .cmt-sub{flex:1 1 auto; min-width:0;}
.cmt-mini{font-size:10.5px; padding:1px 2px; max-width:78px; border:1px solid var(--border); border-radius:4px;
          background:var(--input-bg); color:inherit; height:20px;}
.cmt-group{display:flex; align-items:center; justify-content:space-between; margin:8px 2px 3px;
           padding:2px 6px; font-size:11px; font-weight:600; color:#2f6fb2;
           background:rgba(47,111,178,.08); border-left:3px solid #2f6fb2; border-radius:3px;}
.cmt-group i{font-style:normal; font-weight:400; color:#7a8698;}

/* ===== 留言板: 今日摘要横幅 ===== */
.cmt-digest{display:flex; align-items:center; gap:6px; margin:4px 2px 2px; padding:4px 8px;
            font-size:11.5px; line-height:1.5; border-radius:5px; border:1px solid transparent;}
.cmt-digest span{flex:1 1 auto; min-width:0;}
.cmt-digest.ok{background:#eef7f0; color:#1e7b46; border-color:#c9e6d3;}
.cmt-digest.warn{background:#fff6e8; color:#a8641a; border-color:#f0d3a6;}
.cmt-digest.bad{background:#fdecec; color:#b03434; border-color:#f0c2c2;}
.cmt-digest b{font-weight:700;}
.cmt-digest .mini-btn{flex:none; padding:0 6px; font-size:11px;}

/* ===== 联网版: 未登录提示条 ===== */
.pub-login-bar{display:flex; align-items:center; gap:10px; justify-content:center;
  margin:6px 10px 0; padding:7px 12px; border-radius:6px;
  background:#fff6e8; border:1px solid #f0d3a6; color:#8a5a12; font-size:12.5px;}
.pub-login-bar span{flex:0 1 auto;}
.pub-login-bar .mini-btn{flex:none; background:#1f4e78; color:#fff; border:none; padding:3px 12px;}

/* ===== 启动看门狗提示(旧内核/微信内置浏览器) ===== */
#bootTip{position:fixed; inset:0; z-index:99998; background:rgba(15,23,35,.72);
  display:flex; align-items:center; justify-content:center; padding:24px;}
#bootTip .boot-card{max-width:420px; background:#fff; border-radius:10px; padding:22px 24px;
  box-shadow:0 12px 40px rgba(0,0,0,.28); font-size:13px; line-height:1.75; color:#2b3648;}
#bootTip h3{margin:0 0 10px; font-size:16px; color:#1f4e78;}
#bootTip p{margin:6px 0;}
#bootTip .boot-url{word-break:break-all; color:#2f6fb2; font-family:Consolas,monospace; font-size:12px;
  background:#f3f7fc; padding:6px 8px; border-radius:5px;}
#bootTip button{margin-top:12px; margin-right:8px; padding:6px 14px; border:none; border-radius:5px;
  background:#1f4e78; color:#fff; font-size:12.5px; cursor:pointer;}
#bootTip button#bootCopy{background:#5a6a7e;}

/* 提示条是父容器(flex)的子项: 必须禁止拉伸, 否则会占满剩余高度, 把布局挤变形 */
#pubLoginBar{flex:0 0 auto; align-self:stretch; height:auto; margin:6px 10px 0;}

/* 试用/登录遮罩出现时, 隐藏顶部提示条(避免两个入口打架) */
body.gate-locked #pubLoginBar{display:none !important;}
