* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #042C53;
  background-image:
    linear-gradient(rgba(55,138,221,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55,138,221,.07) 1px, transparent 1px);
  background-size: 32px 32px;
  color: #E6F1FB;
}
.hidden { display: none !important; }

/* 登录 */
.login-wrap { height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.login-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, rgba(55,138,221,.20), transparent 62%);
}
.login-card {
  background: #0C447C; padding: 36px 32px; border-radius: 14px; width: 340px;
  border: 1px solid rgba(55,138,221,.5); box-shadow: 0 14px 44px rgba(0,0,0,.45);
  position: relative; z-index: 1;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: #378ADD; border-radius: 14px 14px 0 0;
}
.login-card h1 { font-size: 22px; text-align: center; color: #E6F1FB; }
.login-card .sub { text-align: center; color: #85B7EB; margin: 6px 0 22px; font-size: 13px; }
.login-card input {
  width: 100%; padding: 11px 12px; margin-bottom: 12px;
  border: 1px solid rgba(55,138,221,.5); border-radius: 8px; font-size: 14px;
  background: #042C53; color: #E6F1FB;
}
.login-card input::placeholder { color: #7FA8D6; }

/* 打冰小组上道状态按钮 + 负责人填充格 */
.online-ctl { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.online-btn { font-size: 12px; padding: 2px 10px; border: 0; border-radius: 12px; cursor: pointer; line-height: 1.6; }
.online-btn.off { background: #0C447C; color: #85B7EB; border: 1px solid rgba(55,138,221,.45); }
.online-btn.on { background: #378ADD; color: #042C53; }
.leader-input { font-size: 12px; padding: 2px 6px; border: 1px solid rgba(55,138,221,.5); border-radius: 6px; width: 120px; background: #042C53; color: #E6F1FB; }
.online-badge { font-size: 12px; padding: 2px 10px; border-radius: 12px; line-height: 1.6; cursor: default; }
.online-badge.off { background: #0C447C; color: #85B7EB; }
.online-badge.on { background: #378ADD; color: #042C53; }
.leader-readonly { font-size: 12px; color: #B5D4F4; }

/* 网电车巡冰出动情况（修改2） */
.np-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.np-label { font-size: 15px; font-weight: 600; color: #E6F1FB; }
.np-fields { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.np-fields label { font-size: 13px; color: #B5D4F4; display: flex; flex-direction: column; gap: 4px; }
.np-fields input { padding: 7px 9px; border: 1px solid rgba(55,138,221,.5); border-radius: 7px; font-size: 13px; background: #042C53; color: #E6F1FB; min-width: 200px; }

/* 打冰小组作业情况汇总表（按 Excel 统计格式） */
.co-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.co-table caption { font-weight: 600; padding: 8px; background: #185FA5; color: #E6F1FB; font-size: 14px; }
.co-table th, .co-table td { border: 1px solid rgba(55,138,221,.35); padding: 6px 8px; font-size: 13px; text-align: left; color: #E6F1FB; }
.co-table thead th { background: #0C447C; }
.co-table tbody tr:nth-child(even) { background: #0A3A66; }
.op-col { text-align: center; white-space: nowrap; width: 72px; }
.row-del { background: #7A1F1F; color: #fff; border: 0; border-radius: 4px; padding: 3px 10px; cursor: pointer; font-size: 12px; }
.row-del:hover { background: #A12B2B; }
.row-del:disabled { opacity: .6; cursor: default; }
.login-card button { width: 100%; padding: 11px; background: #378ADD; color: #042C53; border: 0; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600; }
.login-card button:hover { background: #5AA9F0; }
.login-card .err { color: #E56B6B; font-size: 13px; min-height: 18px; margin-top: 8px; text-align: center; }
.login-card .hint { margin-top: 14px; font-size: 11px; color: #85B7EB; line-height: 1.6; }

/* 布局 */
.topbar { height: 54px; background: #0C447C; border-bottom: 1px solid rgba(55,138,221,.4); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.brand { font-weight: 600; color: #E6F1FB; }
.user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #E6F1FB; }
.badge { padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.super { background: rgba(229,107,107,.18); color: #E56B6B; }
.badge.normal { background: rgba(55,138,221,.20); color: #9FCBF5; }
.user button { border: 1px solid rgba(55,138,221,.5); background: #0C447C; color: #E6F1FB; border-radius: 6px; padding: 5px 12px; cursor: pointer; }

.layout { display: flex; height: calc(100vh - 54px); }
.sidebar { width: 280px; background: #0C447C; border-right: 1px solid rgba(55,138,221,.4); overflow-y: auto; padding: 12px; }
.sidebar-title { font-size: 12px; color: #85B7EB; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }

/* 树 */
.tree .node { user-select: none; }
.tree .row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; color: #E6F1FB; }
.tree .row:hover { background: rgba(55,138,221,.15); }
.tree .row.active { background: rgba(55,138,221,.30); color: #E6F1FB; font-weight: 600; }
.tree .caret { width: 14px; text-align: center; color: #7FA8D6; transition: transform .15s; }
.tree .caret.open { transform: rotate(90deg); }
.tree .children { margin-left: 14px; border-left: 1px dashed rgba(55,138,221,.4); padding-left: 6px; }
.tree .lock { font-size: 11px; color: #E56B6B; margin-left: auto; }
.tree .editable { font-size: 11px; color: #4FD08A; margin-left: auto; }

/* 内容 */
.content { flex: 1; overflow-y: auto; padding: 20px 26px; }
.panel .empty { color: #85B7EB; margin-top: 60px; text-align: center; font-size: 15px; }
.panel h2 { font-size: 18px; margin-bottom: 4px; color: #E6F1FB; }
.panel .crumb { color: #85B7EB; font-size: 13px; margin-bottom: 16px; }
.card { background: #0C447C; border: 1px solid rgba(55,138,221,.35); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 14px; color: #E6F1FB; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-grid label { font-size: 12px; color: #B5D4F4; display: block; margin-bottom: 4px; }
.form-grid input { width: 100%; padding: 8px 10px; border: 1px solid rgba(55,138,221,.5); border-radius: 7px; font-size: 14px; background: #042C53; color: #E6F1FB; }
.form-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
.form-actions button { background: #378ADD; color: #042C53; border: 0; padding: 9px 18px; border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 600; }
.form-actions button:disabled { background: #2A4A6B; color: #7FA8D6; cursor: not-allowed; }
.form-msg { font-size: 13px; min-height: 18px; }
.form-msg.err { color: #E56B6B; }
.form-msg.ok { color: #4FD08A; }
.readonly-note { background: rgba(240,168,48,.12); color: #F0A830; padding: 10px 12px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; border: 1px solid rgba(240,168,48,.35); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid rgba(55,138,221,.35); padding: 7px 9px; text-align: center; color: #E6F1FB; }
th { background: #0C447C; color: #B5D4F4; font-weight: 600; }
tr:nth-child(even) td { background: #0A3A66; }

/* 导出 */
.export-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.export-bar label { font-size: 12px; color: #B5D4F4; display: block; margin-bottom: 4px; }
.export-bar select, .export-bar input { padding: 7px 9px; border: 1px solid rgba(55,138,221,.5); border-radius: 7px; font-size: 13px; background: #042C53; color: #E6F1FB; }
.export-bar button { background: #378ADD; color: #042C53; border: 0; padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; }
.export-bar button.word { background: #185FA5; color: #E6F1FB; }
.save { background: #378ADD; color: #042C53; border: 0; padding: 8px 18px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; }
.chart-box { max-width: 680px; }
/* 周冰情汇总：表下三图横向排列 */
.co-charts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.co-charts .chart-box { flex: 1 1 320px; min-width: 280px; max-width: none; background: rgba(255,255,255,.03); border: 1px solid rgba(55,138,221,.25); border-radius: 10px; padding: 14px 12px 10px; }
.co-charts .chart-box h4 { margin: 0 0 10px; font-size: 14px; color: #E6F1FB; text-align: center; font-weight: 600; }
@media (max-width: 720px) { .co-charts { flex-direction: column; } .co-charts .chart-box { flex: 1 1 auto; } }
.tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; background: rgba(55,138,221,.20); color: #9FCBF5; margin-left: 8px; }

/* 树：周汇总 / dispatch / issue 标记 */
.tree .summary-tag { font-size: 11px; color: #C9B6FF; margin-left: auto; background: rgba(123,63,242,.25); padding: 1px 7px; border-radius: 10px; }
.tree .summary-tag.dispatch-tag { color: #fff; background: #7F4AD1; }
.tree .summary-tag.issue-tag { color: #fff; background: #C0392B; }
/* 提示卡 */
.card.hint, .hint { background: rgba(55,138,221,.12); color: #9FCBF5; font-size: 13px; line-height: 1.7; border: 1px solid rgba(55,138,221,.35); }
/* 周汇总表（复刻上传格式） */
table.wk-table { margin-top: 6px; }
table.wk-table th.grp { background: #0C447C; color: #E6F1FB; }
table.wk-table thead tr:first-child th { background: #0A3A66; }
table.wk-table tr.total-row td { background: rgba(240,168,48,.18); color: #F0A830; font-weight: 700; }
table.wk-table tr.total-row td:first-child { text-align: center; }
.muted { color: #85B7EB; font-size: 13px; }

/* 隧道页：每日一行，左至右铺满，无横向滚动，逐日向下排列 */
.reports { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.report-card { background: #0C447C; border: 1px solid rgba(55,138,221,.35); border-radius: 10px; padding: 12px 14px; }
.report-card.new { border-style: dashed; border-color: rgba(55,138,221,.6); }
.report-card.empty { background: #0A3A66; color: #85B7EB; }
/* 单行填写：各字段从左到右铺满整行，不允许出现横向滚动条 */
.rc-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: nowrap; }
.rc-row label { font-size: 11px; color: #B5D4F4; display: flex; flex-direction: column; gap: 3px; flex: 1 1 64px; min-width: 64px; }
.rc-row label.rc-loc { flex: 1 1 110px; min-width: 110px; }
.rc-row input { width: 100%; min-width: 0; padding: 6px 7px; border: 1px solid rgba(55,138,221,.5); border-radius: 6px; font-size: 13px; background: #042C53; color: #E6F1FB; }
.rc-date { font-weight: 600; color: #E6F1FB; font-size: 14px; white-space: nowrap; flex: 0 0 auto; align-self: center; }
.rc-row .btn { background: #378ADD; color: #042C53; border: 0; padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; white-space: nowrap; flex: 0 0 auto; font-weight: 600; }
.rc-row .btn.store { background: #B7791F; color: #fff; }
.rc-row .btn.save { background: #2e9e5b; color: #fff; }
.rc-view { color: #B5D4F4; font-size: 13px; margin-left: auto; }
.rc-entries { width: 100%; margin-top: 10px; }
.rc-entries th, .rc-entries td { text-align: center; }
.rc-summary { margin-top: 10px; }
.rc-summary-title { font-size: 12px; color: #B5D4F4; font-weight: 600; margin-bottom: 6px; }
.danger { background: rgba(229,107,107,.18); color: #E56B6B; border: 1px solid rgba(229,107,107,.4); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; flex: 0 0 auto; align-self: flex-end; }

/* 本周人员出动情况 表格（复刻上传格式） */
table.dispatch { border-collapse: collapse; width: 100%; min-width: 940px; margin-top: 4px; }
table.dispatch th, table.dispatch td { border: 1px solid rgba(55,138,221,.35); padding: 6px 8px; text-align: center; font-size: 13px; color: #E6F1FB; }
table.dispatch thead th { background: #185FA5; color: #E6F1FB; }
table.dispatch thead th[rowspan] { vertical-align: middle; }
table.dispatch tbody td.dp-team { text-align: left; font-weight: 600; background: #0A3A66; white-space: nowrap; }
table.dispatch td.dp-comp { background: rgba(46,158,91,.18); color: #4FD08A; font-weight: 600; }
table.dispatch input { width: 74px; padding: 5px 6px; border: 1px solid rgba(55,138,221,.5); border-radius: 6px; text-align: center; background: #042C53; color: #E6F1FB; }
table.dispatch input:disabled { background: #0A3A66; color: #7FA8D6; }
table.dispatch tfoot td { background: rgba(240,168,48,.18); color: #F0A830; font-weight: 700; }
table.dispatch tfoot td:first-child { text-align: left; }
table.dispatch tr[data-patrol="1"] { background: rgba(55,138,221,.10); }
table.dispatch tr[data-patrol="1"] td.dp-team { background: rgba(55,138,221,.20); color: #9FCBF5; }
table.dispatch tr[data-patrol="1"] td.dp-comp { background: rgba(55,138,221,.12); color: #9FB6D0; }
table.hist { border-collapse: collapse; width: 100%; margin-top: 6px; }
table.hist th, table.hist td { border: 1px solid rgba(55,138,221,.35); padding: 6px 10px; font-size: 13px; text-align: center; color: #E6F1FB; }
table.hist th { background: #0C447C; color: #E6F1FB; }

/* 发现问题 / 管理人员跟班情况 表格 */
table.issues-table { border-collapse: collapse; width: 100%; margin-top: 4px; table-layout: fixed; }
table.issues-table th, table.issues-table td { border: 1px solid rgba(55,138,221,.35); padding: 6px 8px; text-align: center; font-size: 13px; color: #E6F1FB; }
table.issues-table thead th { background: #185FA5; color: #E6F1FB; }
table.issues-table tbody td.iss-seq { background: #0A3A66; font-weight: 600; width: 42px; }
table.issues-table input, table.issues-table select { width: 100%; min-width: 70px; padding: 5px 6px; border: 1px solid rgba(55,138,221,.5); border-radius: 6px; text-align: center; box-sizing: border-box; background: #042C53; color: #E6F1FB; }
table.issues-table input:disabled, table.issues-table select:disabled { background: #0A3A66; color: #7FA8D6; }
table.issues-table tbody td { vertical-align: middle; }
table.issues-table .iss-del { color: #E56B6B; cursor: pointer; font-size: 12px; white-space: nowrap; }
table.issues-table tfoot td { background: rgba(240,168,48,.18); color: #F0A830; font-weight: 700; }
/* 管理人员跟班情况表共用 .dispatch 样式，仅强化合计行 */
table.dispatch tfoot tr.total-row td { background: rgba(240,168,48,.18); color: #F0A830; font-weight: 700; }
/* 管理人员跟班情况表：固定列宽（工队/人次窄，姓名宽），输入框撑满单元格 */
table.dispatch.lead-fixed { table-layout: fixed; min-width: 0; }
table.dispatch.lead-fixed input { width: 100%; box-sizing: border-box; }

/* ===== 移动端适配（窄屏 ≤ 720px）===== */
@media (max-width: 720px) {
  body { background-size: 24px 24px; }

  /* 登录 */
  .login-wrap { padding: 0 14px; }
  .login-card { width: calc(100% - 28px); max-width: 360px; padding: 28px 22px; }

  /* 顶栏紧凑 */
  .topbar { height: 48px; padding: 0 12px; }
  .brand { font-size: 15px; }
  .user { font-size: 12px; gap: 8px; }
  .user button { padding: 4px 9px; font-size: 12px; }

  /* 左右布局改为上下堆叠：侧边栏变顶部栏 */
  .layout { flex-direction: column; height: auto; }
  .sidebar {
    width: 100%; max-height: 38vh; border-right: 0;
    border-bottom: 1px solid rgba(55,138,221,.4); padding: 10px;
  }
  .sidebar-title { margin-bottom: 6px; }

  /* 内容区允许表格横向滚动，避免挤压变形 */
  .content { padding: 14px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card { padding: 14px; }
  .panel h2 { font-size: 16px; }

  /* 隧道单行填写：窄屏换行堆叠 */
  .rc-row { flex-wrap: wrap; gap: 8px 10px; }
  .rc-row label { flex: 1 1 46%; min-width: 46%; }
  .rc-row label.rc-loc { flex: 1 1 100%; min-width: 100%; }
  .rc-date { flex: 1 1 100%; }
  .rc-row .btn { flex: 1 1 auto; }

  /* 宽表格在手机上横向滚动，不挤压错位 */
  .content table { font-size: 12px; }
  table.dispatch { min-width: 720px; }
  table.hist, table.issues-table { min-width: 560px; }

  /* 导出栏按钮堆叠 */
  .export-bar { gap: 8px; }
  .export-bar button { flex: 1 1 auto; }
}
