/* ============================================================
   张力弧垂计算 - 样式
   ============================================================ */

/* 主容器
   注意：templates/css/header.css 里有全局 .wrap{max-width:1600px;margin:0 auto;padding:16px}
   ——不改 header.css，这里用更高特异性的 .pdm-app .wrap 覆盖掉，实现整屏宽度自适应。 */
.pdm-app .wrap {
  max-width: none;
  margin: 10px 10px 0;
  padding: 0;
  width: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 16px;
}

/* Tab导航 */
/* 标签导航（对齐 yijiyice_backup .tabs 样式）*/
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #cfd8dc;
  padding: 0 20px;
  overflow-x: auto;
  height: 42px;
  align-items: stretch;
}
/* 隐藏水平滚动条（保留滑动功能）*/
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tab {
  padding: 11px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #546e7a;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: #1565c0;
  background: #e3f2fd;
}

.tab.on {
  color: #1565c0;
  border-bottom-color: #1565c0;
}

/* 工程下拉菜单（对齐 yijiyice .dropdown）
   注意：.tabs 有 overflow-x:auto，会裁剪 position:absolute 的子元素，
   故菜单必须用 position:fixed（与 yijiyice 一致），
   top/left 由 app.js toggleDropdown 按 .dropdown 实际 rect 动态计算。*/
.dropdown {
  position: static;
}
.dropdown .tab {
  line-height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}
.dropdown .tab:hover {
  background: #e3f2fd !important;
}
.dropdown-menu {
  display: none;
  position: fixed;
  top: 116px;
  left: 20px;
  background: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  z-index: 100;
  min-width: 140px;
  overflow: hidden;
}
.dropdown-menu.open {
  display: block;
}
.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  color: #263238;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.1s;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: #e3f2fd;
  color: #1565c0;
}
/* 下拉菜单里的勾选标记（显示设置用），固定宽度保证文字对齐 */
.dropdown-menu a .mi-check {
  display: inline-block;
  width: 16px;
  font-style: normal;
  color: #1565c0;
  font-weight: bold;
}

/* 导线/地线型号可搜索选择器（对齐 huchui hc-picker） */
.pdm-picker {
  position: relative;
  min-width: 150px;
  flex: 1;
}
.pdm-picker > input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
}
.pdm-picker > input:focus {
  border-color: #1565c0;
  outline: none;
}
/* 原 select 保留数据与事件，仅隐藏 */
.pdm-picker > select { display: none; }
.pdm-picker-list {
  /* 挂到 body 的浮层：fixed + JS 动态定位，规避模态框 overflow 裁剪 */
  position: fixed;
  z-index: 3000;
  min-width: 200px;
  max-width: 460px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  text-align: left;
}
.pdm-picker-opt {
  padding: 6px 10px;
  font-size: 13px;
  color: #37474f;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}
.pdm-picker-opt:last-child { border-bottom: none; }
.pdm-picker-opt:hover { background: #e3f2fd; color: #1565c0; }
.pdm-picker-opt.on { background: #e8f0fe; font-weight: 600; }
.pdm-picker-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: #90a4ae;
}

/* 工程名标签（对齐 yijiyice .project-badge：深蓝底白字）*/
.project-badge {
  margin-left: 8px;
  font-size: 12px;
  color: #fff;
  background: #1565c0;
  border-radius: 4px;
  padding: 5px 12px;
  align-self: center;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Tab面板（直接位于 .wrap 内，无 .card 包裹，自带内边距）*/
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 2px;
  margin-bottom: 16px;
}

/* 面板头部 */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.wrap h2 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.wrap h3 {
  margin: 0;
  font-size: 16px;
  color: #555;
  margin-bottom:10px;
}

/* 按钮 */
.btn-primary {
  padding: 8px 18px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #357abd;
}

.btn-del {
  padding: 4px 12px;
  background: #ff5252;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-del:hover {
  background: #d32f2f;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
}

.table-scroll {
  max-height: 600px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  text-align: center;
  white-space: nowrap;
}

th {
  background: #f5f7fa;
  font-weight: 600;
  color: #333;
  position: sticky;
  top: 0;
  z-index: 1;
}

.result-table th {
  background: #e8f0fe;
  color: #4a90d9;
}

/* 条件名列 */
.cond-name {
  text-align: left;
  font-weight: 500;
  background: #fafafa;
  min-width: 120px;
}

/* 张力行和弧垂行 */
.row-force td {
  background: #fff8e1;
}

.row-sag td {
  background: #e8f5e9;
}

/* 定位系数行 */
.row-dingwei td {
  background: #f3e5f5;
}

/* 张力特性与放线表 */
.row-control td { background: #e3f2fd; }
.row-span td { background: #dce8f8; font-weight: 600; }
.row-slash td { background: #f5f5f5; color: #666; }
.row-colhint td { background: #eceff1; font-weight: 600; text-align: center; }
.row-stringing td { background: #ffffff; }

/* 张力特性与放线表：文字不加粗（代表档距行除外）/ 单元格居中 / 列宽收紧 */
#wrap-charstr {
  max-height: none;    /* 取消 600px 高度上限：分段后所有行、列完整展示 */
}

#wrap-charstr > table {
  width: auto;
  table-layout: auto;
}

#wrap-charstr > table + table {
  margin-top: 4px;     /* 分段之间的细分隔 */
}

#wrap-charstr th,
#wrap-charstr td {
  padding: 3px 6px;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
}

#wrap-charstr .cond-name {
  min-width: 0;
  width: 1%;
  text-align: center;
  font-weight: 400;
}

#wrap-charstr .row-span td,
#wrap-charstr .row-control td,
#wrap-charstr .row-colhint td,
#wrap-charstr .row-force td,
#wrap-charstr .row-dingwei td,
#wrap-charstr .row-slash td,
#wrap-charstr .row-stringing td {
  font-weight: 400;
  text-align: center;
}

/* 代表档距行加粗 */
#wrap-charstr .row-span td {
  font-weight: 700;
}

/* ============ 导线型号可搜索下拉（1-导线选择） ============ */
.hc-picker {
  position: relative;
  min-width: 150px;
}
.hc-picker > input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  box-sizing: border-box;
}
.hc-picker > input:focus {
  border-color: #4a90d9;
  outline: none;
}
/* 原 select 保留数据与事件，仅隐藏 */
.hc-picker > select { display: none; }
.hc-picker-list {
  /* 挂到 body 的浮层：fixed + JS 动态定位，规避表格 overflow 裁剪 */
  position: fixed;
  z-index: 3000;
  min-width: 200px;
  max-width: 460px;
  max-height: 260px;
  overflow-y: auto;
  /* 滚到边界时不要把整个页面一起滚走 */
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.16);
  text-align: left;
}
.hc-picker-opt {
  padding: 6px 10px;
  font-size: 12px;
  color: #37474f;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}
.hc-picker-opt:last-child { border-bottom: none; }
.hc-picker-opt:hover { background: #e3f2fd; color: #1565c0; }
.hc-picker-opt.on { background: #e8f0fe; font-weight: 600; }
.hc-picker-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: #90a4ae;
}

/* 导线库/气象库编辑表格 */
.lib-input, .wx-input {
  width: 100%;
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  min-width: 60px;
  box-sizing: border-box;
}

.lib-input:focus, .wx-input:focus {
  border-color: #4a90d9;
  outline: none;
}

/* 7-气象库：前 6 列（气象名称~区号）居中 + 固定 100px；说明列居左 */
#tbl-weather-lib th.wx-col,
#tbl-weather-lib td.wx-num {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  text-align: center;
}
#tbl-weather-lib th.wx-col {
  box-sizing: border-box;
}
#tbl-weather-lib td.wx-num {
  box-sizing: border-box;
  padding: 3px 4px;
}
#tbl-weather-lib td.wx-num .wx-input {
  text-align: center;
  padding: 3px 2px;
  min-width: 0;
}
#tbl-weather-lib td.wx-num select.wx-input {
  text-align: center;
  text-align-last: center;
}
#tbl-weather-lib td.wx-num input[type="number"] {
  text-align: center;
}
#tbl-weather-lib th.wx-desc-col,
#tbl-weather-lib td.wx-desc {
  text-align: left;
}
/* 窄屏下略微收窄，避免横向溢出 */
@media (max-width: 768px) {
  #tbl-weather-lib th.wx-col,
  #tbl-weather-lib td.wx-num {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
  }
}

/* 气象库「说明」列：长文案换行显示 */
.wx-desc {
  min-width: 260px;
  max-width: 460px;
  font-size: 12px;
  line-height: 1.6;
  color: #555;
  white-space: normal;
  word-break: break-word;
  padding: 3px 6px;
}

@media (max-width: 768px) {
  .wx-desc { min-width: 160px; font-size: 11px; }
}

.btn-secondary {
  padding: 8px 18px;
  background: #43a047;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #2e7d32;
}

/* 导线选择表 */
#tbl-wire-select select,
#tbl-wire-select input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
  max-width: 100%;
}

#tbl-wire-select select {
  min-width: 120px;
}

#tbl-wire-select input[type="number"] {
  width: 80px;
  min-width: 60px;
}

#tbl-wire-select th {
  white-space: nowrap;
}

#tbl-wire-select td {
  max-width: 200px;
}

/* 收窄「平均高度 / 地面粗糙度 / 保证率 / 降温补偿」4 列：内容都很短
   （15/20/25、A~D类、1/0.95、0~25），统一 min-width:120 会把表撑到 1393px
   导致 .table-wrap 出现横向滚动条。让这 4 列 th 允许换行、select 收到 64px、
   td/th padding 收紧到 4px 6px（默认 8px 12px）。 */
#tbl-wire-select th:nth-child(4),
#tbl-wire-select th:nth-child(5),
#tbl-wire-select th:nth-child(8),
#tbl-wire-select th:nth-child(10) {
  white-space: normal;
  line-height: 1.2;
  padding: 4px 4px;
  text-wrap: balance;
}
#tbl-wire-select td:nth-child(4) select,
#tbl-wire-select td:nth-child(5) select,
#tbl-wire-select td:nth-child(8) select,
#tbl-wire-select td:nth-child(10) select {
  width: 60px;
  min-width: 52px;
  padding-left: 4px;
  padding-right: 4px;
}
#tbl-wire-select td:nth-child(4),
#tbl-wire-select td:nth-child(5),
#tbl-wire-select td:nth-child(8),
#tbl-wire-select td:nth-child(10) {
  padding: 4px 4px;
}

/* 导线详情 */
.wire-detail {
  margin-top: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

/* 每根导线一个详情分组（标题「线缆N参数详情」）*/
.wire-detail-group {
  margin-bottom: 16px;
}

.wire-detail-group:last-child {
  margin-bottom: 0;
}

.wire-detail-group h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #555;
}

/* 参数网格：固定 6 列 → 12 项字段正好 2 行 */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
  min-width: 0;              /* 允许网格子项收缩，避免长字段撑破格子 */
}

.detail-label {
  color: #666;
  font-size: 13px;
  white-space: nowrap;       /* 标签不折行 */
  flex: 0 0 auto;
}

.detail-value {
  font-weight: 600;
  color: #333;
  font-size: 13px;
  min-width: 0;
  text-align: right;
  word-break: break-word;    /* 长型号名允许在任意处断行 */
}

/* 控制栏 */
.char-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

/* 平面转角配置行 */
.plan-turn-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.plan-turn-row input {
  padding: 6px 8px;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  font-size: 13px;
  min-width: 0;
}
.plan-turn-row .pt-name { width: 90px; }
.plan-turn-row .pt-c { width: 100px; }
.plan-turn-row .pt-angle { flex: 1; }
.plan-turn-row .pt-del {
  border: 1px solid #cfd8dc;
  background: #fff;
  color: #c62828;
  border-radius: 4px;
  width: 28px;
  height: 30px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  flex: none;
}
.plan-turn-row .pt-del:hover {
  background: #ffebee;
}

.char-controls label {
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.char-controls select,
.char-controls input {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

/* 张力特性与放线表 控制条：数字输入框统一窄宽度 45px */
.char-controls input[type="number"] {
  width: 45px;
  min-width: 45px;
}

/* 全屏按钮（悬浮在断面图标题栏右侧；点击后 #panel-org-view 全屏显示） */
.fs-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cfd8dc;
  border-radius: 5px;
  background: #fff;
  color: #546e7a;
  cursor: pointer;
  line-height: 1;
}
.fs-btn:hover { background: #eceff1; color: #1565c0; border-color: #90a4ae; }
.fs-btn.on { background: #1565c0; border-color: #1565c0; color: #fff; }
/* 悬浮在断面图标题栏右侧（垂直居中） */
.view-block-hd .fs-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

/* 比载表 - 不适用项灰色显示 */
.cell-muted {
  color: #ccc;
  background: #fafafa;
}

/* 比载表 - 高亮项 */
.cell-highlight {
  font-weight: 600;
  color: #1565c0;
  background: #e3f2fd;
}

/* 特性曲线图 */
.chart-wrap {
  margin-top: 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.chart-title {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #333;
}

.chart-container {
  position: relative;
  height: 630px;
  width: 100%;
}

/* 放线表双列表头 */
#tbl-str th[rowspan="2"] {
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #e8f0fe;
}

#tbl-str th[colspan="2"] {
  text-align: center;
  background: #d0e3f7;
}

/* 结果框 */
.result-box {
  padding: 16px;
}

.result-box .hint {
  color: #999;
  text-align: center;
  padding: 40px 0;
}

/* 参数网格响应式：6 列在窄屏依次降为 4 / 3 / 2 列 */
@media (max-width: 1280px) {
  .detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 响应式 */
@media (max-width: 768px) {
  /* 手机：单列卡片式，标签在上、数值在下（横向并排会被挤断行并撑破屏幕）*/
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .detail-item {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: 8px 12px;
    min-width: 0;
  }
  .detail-label {
    flex: 0 0 auto;
    white-space: normal;      /* 允许长标签自然换行 */
    font-size: 12px;
    color: #8a97a5;
    line-height: 1.4;
  }
  .detail-value {
    text-align: left;         /* 纵向堆叠后不再需要右对齐 */
    font-size: 15px;           /* 手机上数值放大更好读 */
    line-height: 1.4;
    white-space: nowrap;       /* 数字绝不折行 */
    word-break: keep-all;
    font-variant-numeric: tabular-nums;
  }
  .wire-detail {
    margin-top: 12px;
    padding: 12px;
  }
  .wire-detail-group {
    margin-bottom: 14px;
  }
  .wire-detail-group h3 {
    font-size: 15px;
    margin-bottom: 8px;
  }
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .char-controls {
    width: 100%;
  }
  .tab {
    padding: 8px 12px;
    font-size: 13px;
  }
  .project-badge {
    font-size: 11px;
    padding: 3px 6px;
  }
  .stress-result-grid {
    grid-template-columns: 1fr;
  }
}

/* 超小屏（iPhone SE 等）：进一步压缩间距与字号 */
@media (max-width: 480px) {
  .wire-detail {
    padding: 10px;
  }
  .detail-item {
    padding: 7px 10px;
  }
  .detail-label {
    font-size: 11px;
  }
  .detail-value {
    font-size: 14px;
  }
}

/* ============================================================
   工程管理（对话框 / 工程列表）— 菜单与徽章已并入 .tabs 第 0 项
   ============================================================ */
/* 对话框（对齐 yijiyice .modal / .modal .mdl）*/
.proj-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.proj-modal.on {
  display: flex;
}

/* 上传框会从「打开工程」的导入按钮叠层弹出，必须比后者高，
   否则同 z-index 下会被 DOM 里更靠后的 modal-proj-open 盖住。 */
#modal-proj-upload,
#modal-file-manage {
  z-index: 210;
}

.proj-modal-box {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 24px;
  width: 90%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
}

.proj-modal-box h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: #2c3e50;
}

.proj-label {
  display: block;
  font-size: 13px;
  color: #555;
  margin: 8px 0 6px;
}

.proj-modal-box input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.proj-modal-box input[type="text"]:focus {
  outline: none;
  border-color: #4a90d9;
}

.proj-modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.proj-list {
  max-height: 320px;
  overflow-y: auto;
}

.proj-empty {
  text-align: center;
  padding: 20px;
  color: #546e7a;
  font-size: 14px;
}

/* 工程列表项（对齐 yijiyice .project-item：列表式，仅下边框线）*/
.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #cfd8dc;
  transition: background 0.15s;
  cursor: pointer;
}

.project-item:last-child {
  border-bottom: none;
}

.project-item:hover {
  background: #e3f2fd;
}

.pj-name {
  font-weight: 500;
  font-size: 14px;
  color: #263238;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pj-time {
  font-size: 11px;
  color: #546e7a;
  margin-top: 2px;
}

.proj-item-ops {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.proj-item-ops button {
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 12px;
}

.proj-item-ops button.danger {
  background: #e53935;
}

/* ============================================================
   平断面工具（pdm）专属样式
   ============================================================ */

/* ---------- 平断面显示区 ---------- */
.org-canvas-wrap {
  position: relative;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  flex: 1 1 auto;
  /* 兜底最小高度：保证画布永远有非零高度可画 */
  min-height: 260px;
  overflow: hidden;
  /* 断面图/平面图上下同屏：两块各占约一半高度，无需切换 */
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}

/* 单个视图块（断面图 / 平面图）：标题栏 + 画布区 */
.view-block {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #eceff1;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.view-block.hidden { display: none; }

.view-block-hd {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  position: relative;          /* 全屏按钮相对标题栏绝对定位（悬浮在右侧） */
  padding-right: 32px;
  padding: 3px 10px;
  background: #f5f7f8;
  border-bottom: 1px solid #eceff1;
  font-size: 12px;
  color: #37474f;
  white-space: nowrap;
  overflow: hidden;
}
.view-block-hd b { font-size: 12px; color: #263238; }
.view-block-hd span { color: #78909c; font-size: 11px; }

.view-cv {
  flex: 1 1 auto;
  min-height: 80px;
  position: relative;
}
.view-cv canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* 鼠标十字叉：向四周的射线（中心不留缺口，在鼠标处相交），叠加层不挡交互 */
.view-cv canvas {
  cursor: none;
}
.cv-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
  z-index: 5;
  overflow: hidden;
}
.cv-crosshair.on { display: block; }
.cv-crosshair > div { position: absolute; background: rgba(21, 101, 192, 0.5); }
.cv-crosshair .ch-hl { left: 0; height: 1px; }
.cv-crosshair .ch-hr { right: 0; height: 1px; }
.cv-crosshair .ch-vt { top: 0; width: 1px; }
.cv-crosshair .ch-vb { bottom: 0; width: 1px; }

/* 分隔条：断面图/平面图之间，上下拖动调整两视图高度比例
   注意：HTML 用 id="view-resizer"，此处同时给 id 与 class 兜底，
   否则选择器不命中 → 元素高度塌陷为 0，拖动功能整体失效。 */
#view-resizer,
.view-resizer {
  flex: 0 0 12px;
  height: 12px;
  min-height: 12px;
  width: 100%;
  margin: 0;
  cursor: row-resize;
  background: #cfd8dc;
  border-radius: 6px;
  position: relative;
  transition: background 0.12s;
  box-sizing: border-box;
}
#view-resizer:hover,
.view-resizer:hover { background: #b0bec5; }
#view-resizer.dragging,
.view-resizer.dragging { background: #1565c0; }
/* 中央三点式 grip，提示可上下拖动 */
#view-resizer::after,
.view-resizer::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 3px;
  transform: translate(-50%, -50%);
  background: #78909c;
  border-radius: 2px;
  box-shadow: 0 4px 0 #78909c, 0 -4px 0 #78909c;
}
#view-resizer.dragging::after,
.view-resizer.dragging::after { background: #fff; box-shadow: 0 4px 0 #fff, 0 -4px 0 #fff; }
#view-resizer.hidden,
.view-resizer.hidden { display: none; }

.org-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #90a4ae;
  font-size: 16px;
  line-height: 2;
  pointer-events: none;
}

.org-placeholder span {
  font-size: 12px;
  color: #b0bec5;
}

/* ---------- 上传模态框 ---------- */
.upload-hint {
  font-size: 13px;
  color: #456;
  margin-bottom: 6px;
}

.upload-label {
  margin-top: 14px;
}

.upload-label .req {
  color: #e53935;
  margin-right: 2px;
}

#modal-proj-upload input[type="file"] {
  width: 100%;
  font-size: 13px;
  padding: 6px 0;
  box-sizing: border-box;
}

/* ---------- 拖拽上传区（.org/.ind/.ta 三个上传控件共用）---------- */
.file-drop {
  border: 1.5px dashed #b0bec5;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fafbfc;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.file-drop:hover {
  border-color: #4a90d9;
}

.file-drop.dragover {
  border-color: #4a90d9;
  background: #e8f1fb;
}

.file-drop input[type="file"] {
  width: 100%;
  font-size: 13px;
  padding: 2px 0;
  box-sizing: border-box;
  border: none;
  background: transparent;
}

.file-drop-hint {
  font-size: 12px;
  color: #90a4ae;
  margin-top: 2px;
  user-select: none;
}

.file-drop.has-file {
  border-color: #66bb6a;
  border-style: solid;
  background: #f1f8e9;
}

.file-drop.has-file .file-drop-hint {
  color: #2e7d32;
  word-break: break-all;
}

/* ---------- 数据文件管理模态框 ---------- */
.fm-box {
  max-width: 620px;
}

.fm-list {
  margin-top: 10px;
}

.fm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafbfc;
}

.fm-badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 1px;
}

.fm-badge.org { background: #4a90d9; }
.fm-badge.ind { background: #7e57c2; }
.fm-badge.ta  { background: #ef6c00; }

.fm-info {
  flex: 1;
  min-width: 0;
}

.fm-name {
  font-size: 13px;
  color: #2c3e50;
  font-weight: 600;
  word-break: break-all;
}

.fm-meta {
  font-size: 12px;
  color: #90a4ae;
  margin-top: 2px;
}

.fm-ops {
  flex: none;
  display: flex;
  gap: 6px;
}

.fm-ops button {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #cfd8e3;
  background: #fff;
  color: #456;
  cursor: pointer;
}

.fm-ops button:hover {
  border-color: #4a90d9;
  color: #4a90d9;
}

.fm-ops button.danger:hover {
  border-color: #e53935;
  color: #e53935;
}

.fm-empty {
  font-size: 13px;
  color: #90a4ae;
  text-align: center;
  padding: 24px 0 10px;
}

.fm-row-empty {
  border-style: dashed;
  background: #fff;
}

.fm-row-empty .fm-none {
  color: #b0bec5;
  font-weight: 500;
}

/* ---------- 配置模态框（线路/跨越/其它）---------- */
.cfg-box {
  max-width: 640px;
}

.cfg-box-wide {
  max-width: 860px;
}

.cfg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 13px;
  color: #333;
  flex-wrap: wrap;
}

.cfg-row > label:first-child {
  color: #455a64;
  white-space: nowrap;
  min-width: 64px;
}

.cfg-row input[type="number"],
.cfg-row input[type="text"] {
  width: 110px;
  padding: 5px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
}

.cfg-row input[type="number"]:focus {
  outline: none;
  border-color: #4a90d9;
}

.cfg-row select {
  padding: 5px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  font-size: 13px;
  min-width: 120px;
}

.cfg-unit {
  color: #78909c;
  font-size: 12px;
  white-space: nowrap;
}

/* 配置项下方的灰色提示（杆塔库参数、当前排位状态等） */
.cfg-hint {
  color: #78909c;
  font-size: 12px;
  line-height: 1.6;
  margin: 2px 0 6px;
}

.cfg-note {
  color: #d32f2f;
  font-size: 12px;
  margin: 8px 0 4px;
}

.cfg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.cfg-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 700px) {
  .cfg-grid, .cfg-grid2 {
    grid-template-columns: 1fr;
  }
}

.cfg-fieldset {
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  padding: 10px 14px 14px;
  margin: 10px 0;
  min-width: 0;
}

.cfg-fieldset legend {
  font-size: 13px;
  color: #1565c0;
  font-weight: 600;
  padding: 0 6px;
}

.cfg-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #37474f;
  white-space: nowrap;
  cursor: pointer;
}

.cfg-radio input {
  margin: 0;
}

.cfg-checks {
  gap: 14px;
}

.cfg-calc-btn {
  margin-top: 4px;
}

/* ---------- 气象配置模态框内表格（沿用 huchui 气象库样式类）---------- */
#modal-weather-config .proj-modal-box {
  max-width: 980px;
}

#tbl-weather th.wx-col,
#tbl-weather td.wx-num {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  text-align: center;
}

#tbl-weather td.wx-num {
  padding: 3px 4px;
  box-sizing: border-box;
}

#tbl-weather td.wx-num .wx-input {
  text-align: center;
  padding: 3px 2px;
  min-width: 0;
}

#tbl-weather td.wx-num select.wx-input {
  text-align: center;
  text-align-last: center;
}

#tbl-weather th.wx-desc-col,
#tbl-weather td.wx-desc {
  text-align: left;
}

@media (max-width: 768px) {
  #tbl-weather th.wx-col,
  #tbl-weather td.wx-num {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
  }
}

/* ============================================================
   自适应布局（pdm 专属）
   ============================================================ */

/* pdm-app 占满 header 以下的整屏高度；高度由 JS 写入 --pdm-header 变量。
   min-height 是兜底：万一 --pdm-header 未写入/计算异常，也能保证
   .wrap 与画布拿到真实高度，不会塌成 0 高导致整张图看不见。 */
.pdm-app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--pdm-header, 0px));
  min-height: 520px;
}

/* tabs 固定、wrap 弹性填充、状态栏固定，三者之间均为 10px 间距 */
.tabs {
  flex: 0 0 auto;
}

/* 活动面板撑满 .wrap（纵向） */
.wrap > .tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
}

/* 平断面主面板内的画布容器撑满 */
#panel-org-view.active .org-canvas-wrap {
  flex: 1 1 auto;
}

/* 全屏：UA 会把 #panel-org-view 设为 fixed 100%×100%（遮住站点 header/tabs/状态栏），
   这里只收拾观感：去圆角阴影、收内边距，给画布腾地方 */
#panel-org-view:fullscreen,
#panel-org-view:-webkit-full-screen {
  padding: 12px;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
#panel-org-view:fullscreen .panel-header,
#panel-org-view:-webkit-full-screen .panel-header {
  margin-bottom: 10px;
}

/* ---------- 底部状态栏 ---------- */
.status-bar {
  flex: 0 0 auto;
  margin: 10px;
  background: #263238;
  color: #cfd8dc;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 22px;
}

.status-bar .sb-item {
  white-space: nowrap;
}

.status-bar .sb-item b {
  color: #fff;
  font-weight: 600;
}

.status-bar .sb-title {
  color: #90caf9;
  margin-left: auto;
}

/* 小屏：状态栏换行 */
@media (max-width: 768px) {
  .status-bar {
    gap: 10px;
    font-size: 11px;
  }
}

/* ===== 断面图塔位右键菜单 ===== */
.tower-ctx {
  position: fixed;
  z-index: 400;
  display: none;
  min-width: 160px;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding: 4px 0;
}
.tower-ctx.on { display: block; }
.tower-ctx .ctx-item {
  padding: 7px 14px;
  font-size: 13px;
  color: #37474f;
  cursor: pointer;
  white-space: nowrap;
}
.tower-ctx .ctx-item:hover { background: #e8f0fe; color: #1a73e8; }
.tower-ctx .ctx-sep { height: 1px; background: #e0e0e0; margin: 4px 0; }
.tower-ctx .ctx-item.ctx-danger { color: #c62828; font-weight: 600; }
.tower-ctx .ctx-item.ctx-danger:hover { background: #fdecea; color: #b71c1c; }

/* ========== 断面图跨越点悬停冒泡（点编码 + 高程）========== */
.cv-tip {
  position: absolute;
  display: none;
  pointer-events: none;
  z-index: 6;
  max-width: 260px;
  padding: 7px 10px;
  background: rgba(38, 50, 56, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.cv-tip.on { display: block; }
.cv-tip.pin { box-shadow: 0 0 0 2px rgba(255, 179, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.25); }
.cv-tip b { color: #ffd54f; }
