:root {
  --primary: #1565c0;
  --primary-light: #e3f2fd;
  --success: #2e7d32;
  --warning: #f9a825;
  --danger: #c62828;
  --bg: #eceff1;
  --card: #fff;
  --border: #cfd8dc;
  --text: #263238;
  --text2: #546e7a;
  --text1: #263238;
  --text3: #90a4ae;
  --radius: 6px;
}
* { margin:0; padding:0; box-sizing:border-box; }

/* ========== 顶部菜单栏 ========== */
.tabs { display:flex; background:#fff; border-bottom:2px solid var(--border); padding:0 20px; overflow-x:auto; height:42px; }
.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:var(--text2); border-bottom:3px solid transparent; transition:all .2s; white-space:nowrap; }
.tab:hover { color:var(--primary); background:var(--primary-light); }
.tab.on { color:var(--primary); border-bottom-color:var(--primary); }

/* 下拉菜单 */
.dropdown { position: static; display: flex; align-items: center; }
.dropdown .tab { height: 100%; display: flex; align-items: center; }
.dropdown .tab:hover { background: var(--primary-light) !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,.18);
  z-index: 100;
  min-width: 140px;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: background .1s;
}
.dropdown-menu a:hover { background: var(--primary-light); color: var(--primary); }

/* 工程名标签 */
.project-badge {
  margin-left: 8px;
  font-size: 12px;
  color: #fff;
  background: var(--primary, #1565c0);
  border-radius: var(--radius, 4px);
  padding: 5px 12px;
  align-self: center;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* 主容器 */
.wrap { max-width: 1800px; margin: 0 auto; padding: 16px; }
.pane { display: none; }
.pane.on { display: block; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.08); padding:10px; margin-bottom: 14px; }
.card h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); border-left: 3px solid var(--primary); padding-left: 10px; }

/* 表单 */
.row { display: flex; gap: 14px; margin-bottom: 10px; align-items: flex-start; flex-wrap: wrap; }
.grp { display: flex; flex-direction: column; gap: 3px; min-width: 180px; flex: 1; }
.grp label { font-size: 12px; color: var(--text2); font-weight: 500; }
.grp input, .grp select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; outline: none; }
.grp input:focus, .grp select:focus { border-color: var(--primary); }
.grp .tip { font-size: 11px; color: var(--text2); line-height: 1.3; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 14px; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; font-weight: 500; transition: all .15s; }
.btn-pri { background: var(--primary); color: #fff; }
.btn-pri:hover { background: #115293; }
.btn-ok { background: var(--success); color: #fff; }
.btn-ok:hover { background: #1b5e20; }
.btn-warn { background: var(--warning); color: #333; }
.btn-err { background: var(--danger); color: #fff; }
.btn-err:hover { background: #b71c1c; }
.btn-out { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-out:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 7px; flex-wrap: wrap; }

/* 表格 */
.tbl-wrap { overflow: auto; max-height: 600px; margin-top: 6px; border: 1px solid var(--border); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 4px 6px; border: 1px solid var(--border); min-width: 50px; }
th { background: #f5f5f5; font-weight: 600; position: sticky; top: 0; z-index: 1; text-align: center; }
tr:hover td { background: var(--primary-light); }
td.edit { cursor: cell; }
td.edit:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
td.err { color: var(--danger); }

/* 表头分组样式 */
thead tr:nth-child(2) th { background: #e8eaf6; font-size: 11px; }

/* 消息 */
.log { padding: 10px 14px; border-radius: 4px; margin-bottom: 10px; font-size: 12px; }
.log.on { display: flex; align-items: center; gap: 6px; }
.log.i { background: #e3f2fd; color: #1565c0; }
.log.ok { background: #e8f5e9; color: #2e7d32; }
.log.e { background: #ffebee; color: #c62828; }
.log.w { background: #fff8e1; color: #f57f17; }

/* 对话框 */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 200; justify-content: center; align-items: center; }
.modal.on { display: flex; }
.mdl { background: #fff; border-radius: var(--radius); max-width: 850px; width: 92%; max-height: 88vh; overflow-y: auto; padding: 22px; }

/* 工程列表项 */
.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .15s;
}
.project-item:hover { border-color: var(--primary); background: var(--primary-light); }
.project-item .pj-name { font-weight: 500; font-size: 14px; }
.project-item .pj-time { font-size: 11px; color: var(--text2); }
.project-item .pj-del {
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}

/* 响应式 */
@media(max-width: 900px) {
  .row { flex-direction: column; }
  .grp { min-width: 100%; }
  .tabs { overflow-x: auto; }
  .tab { padding: 8px 10px; font-size: 12px; }
  .wrap { padding: 8px; }
  .card { padding: 2px 6px 6px 6px; }
  table { font-size: 11px; }
  th, td { padding: 3px 4px; }
}

@media(max-width: 480px) {
  .tabs { padding: 0 6px; height: 38px; }
  .tab { padding: 6px 8px; font-size: 11px; }
  .project-badge { font-size: 11px; padding: 3px 6px; }
  .btn { padding: 5px 10px; font-size: 12px; }
  .card h2 { font-size: 13px; }
}

/* 删除按钮 */
.btn-del-row {
  color: var(--danger);
  background: none;
  border: 1px solid var(--danger);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.btn-del-row:hover { background: var(--danger); color: #fff; }

/* 明细表塔位行/档距行样式 */
.mingxi-tower-row { background: #e8eaf6; }
.mingxi-tower-row:hover td { background: #c5cae9; }
.mingxi-span-row { background: #fff; }
.mingxi-span-row:hover td { background: #f5f5f5; }
.mingxi-tower-row td.edit { font-weight: 500; }
