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


/* ========== SVG 按钮图标 ========== */
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ========== 顶部菜单栏 ========== */
.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: 1200px; margin: 0 auto; padding: 16px 16px 60px 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: 16px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

/* ========== 已记录塔号列表 ========== */
.tower-list-bar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.tower-list-title {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  margin-bottom: 8px;
}
.tower-list-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tower-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.tower-tag:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.tower-tag.on {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.tower-tag-user {
  font-size: 10px;
  opacity: 0.7;
}

/* 编辑指示器 */
.editing-indicator {
  font-size: 12px;
  color: var(--warning);
  align-items: center;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-tip { font-size: 13px; color: var(--text3); }

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.grp { display: flex; flex-direction: column; gap: 3px; }
.grp label { font-size: 12px; color: var(--text2); font-weight: 500; }
.grp input, .grp select, .grp textarea {
  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); }
.req { color: var(--danger); }

.form-section {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}
.form-section-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.checkbox-group, .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chk-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.chk-item:hover { border-color: var(--primary); }
.chk-item input { margin: 0; cursor: pointer; }
.other-input {
  margin-top: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.other-input:focus { border-color: var(--primary); }

/* 按钮 */
.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-err { background: var(--danger); color: #fff; }
.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; align-items: center; }

/* 搜索输入 */
.search-input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  min-width: 200px;
}
.search-input:focus { border-color: var(--primary); }

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

/* 对话框 */
.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: 12px 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-info { font-size: 11px; color: var(--text2); margin-top: 2px; }
.project-item .pj-time { font-size: 11px; color: var(--text3); }

/* 延迟上传照片占位 */
.photo-placeholder {
  width: 100%;
  height: 180px;
  background: #f0f4f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.photo-placeholder-name {
  font-size: 13px;
  color: var(--text2);
  max-width: 90%;
  text-align: center;
  word-break: break-all;
}
.photo-placeholder-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--warning);
  color: #fff;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 10px;
  font-weight: 500;
}
.photo-upload-btn {
  position: absolute;
  bottom: 38px;
  right: 8px;
  padding: 6px 18px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
.photo-upload-btn:hover { opacity: 0.85; }

/* 延迟上传开关 - switch 样式 */
.delay-upload-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 16px;
  color: var(--text1);
}
.delay-upload-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.delay-switch-track {
  width: 52px;
  height: 28px;
  background: #ccc;
  border-radius: 14px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.delay-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.delay-upload-switch input:checked + .delay-switch-track {
  background: var(--warning);
}
.delay-upload-switch input:checked + .delay-switch-track .delay-switch-thumb {
  transform: translateX(24px);
}
.delay-switch-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text1);
}

/* 照片上传 */
.photo-upload-area { margin-bottom: 10px; }
.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.photo-item {
  position: relative;
  width: 200px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.photo-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.photo-item .photo-caption {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: #f8f9fa;
  word-break: break-all;
}
.photo-item .photo-caption input {
  width: 100%;
  border: none;
  background: none;
  font-size: 12px;
  outline: none;
  color: var(--text);
}
.photo-item .photo-caption input::placeholder { color: var(--text3); }
.photo-item .photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.photo-item .photo-del:hover { background: var(--danger); }

/* 上传进度条覆层 */
.photo-progress-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.photo-progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.3);
  border-radius: 3px;
  overflow: hidden;
}
.photo-progress-bar-fill {
  height: 100%;
  background: #4fc3f7;
  border-radius: 3px;
  transition: width .15s ease;
}
.photo-progress-text {
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* 人员搜索 */
.member-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-results {
  margin-bottom: 16px;
}
.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}
.search-result-item:hover { background: var(--primary-light); }
.search-result-item .sr-info { display: flex; gap: 12px; align-items: center; }
.search-result-item .sr-name { font-weight: 500; }
.search-result-item .sr-phone { color: var(--text2); font-size: 12px; }

/* 手册 */
.manual-content {
  min-height: 200px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.manual-content:empty::before {
  content: '暂无勘察指导手册内容。点击「编辑手册」按钮添加。';
  color: var(--text3);
}
.manual-editor {
  width: 100%;
  min-height: 300px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
  outline: none;
  resize: vertical;
  font-family: inherit;
}
.manual-editor:focus { border-color: var(--primary); }

/* 记录详情 */
.record-detail-section {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}
.record-detail-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.record-detail-value {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}
.record-detail-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.record-detail-photos img {
  width: 180px;
  height: 135px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.photo-detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.photo-detail-caption {
  font-size: 12px;
  color: var(--text2);
  text-align: center;
  word-break: break-all;
  max-width: 180px;
  line-height: 1.4;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin: 1px;
}
.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff8e1; color: #f57f17; }
.tag-red { background: #ffebee; color: #c62828; }
.tag-grey { background: #f5f5f5; color: #616161; }

/* ========== 响应式：平板 ========== */
@media(max-width: 900px) {
  .wrap { padding: 8px 8px 70px 8px; }
  .card { padding: 2px 10px 10px 10px; }
  .checkbox-group, .radio-group { flex-direction: column; gap: 6px; }
  .member-search-bar { flex-direction: column; }
  .search-input { min-width: 0; width: 100%; }
  table { font-size: 11px; }
  th, td { padding: 4px 5px; }
}

/* ========== 响应式：手机 ========== */
@media(max-width: 768px) {
  .project-badge { font-size: 11px; padding: 3px 6px; }
  .dropdown-menu { left: 10px; min-width: 120px; }
  .dropdown-menu a { padding: 14px 18px; font-size: 15px; }
  .tab { padding: 10px 12px; font-size: 15px; }
  .tabs { height: 48px; padding: 0 8px; }

  /* 主容器 */
  .wrap { padding: 8px 8px 80px 8px; }
  .card {
    padding: 2px 12px 12px 12px;
    margin-bottom: 10px;
  }
  .card h2 {
    font-size: 16px;
    padding-left: 12px;
  }

  /* 塔号列表 */
  .tower-list-bar { padding: 10px 12px; }
  .tower-list-title { font-size: 14px; }
  .tower-tag {
    font-size: 14px;
    padding: 7px 14px;
  }
  .tower-tag-user { font-size: 11px; }

  /* 表单 */
  .form-grid { gap: 14px; }
  .grp label { font-size: 14px; }
  .grp input, .grp select, .grp textarea {
    padding: 10px 12px;
    font-size: 15px;
  }
  .form-section {
    padding: 14px;
    margin-bottom: 14px;
  }
  .form-section-label {
    font-size: 15px;
    margin-bottom: 10px;
  }
  .chk-item {
    padding: 8px 16px;
    font-size: 15px;
    gap: 6px;
  }
  .other-input {
    padding: 10px 12px;
    font-size: 15px;
  }

  /* 按钮 */
  .btn {
    padding: 10px 16px;
    font-size: 15px;
  }
  .btn-icon {
    width: 18px;
    height: 18px;
  }

  /* 搜索框 */
  .search-input {
    padding: 10px 12px;
    font-size: 15px;
    min-width: 0;
    width: 100%;
  }

  /* 表格 */
  table { font-size: 14px; }
  th, td { padding: 8px 6px; }
  .tbl-wrap { max-height: 450px; }

  /* 照片 */
  .photo-item {
    width: calc(50% - 6px);
  }
  .photo-item img { height: 140px; }
  .photo-item .photo-caption { font-size: 13px; }
  .photo-item .photo-caption input { font-size: 13px; }
  .photo-del {
    width: 26px;
    height: 26px;
  }

  /* 对话框 */
  .mdl {
    width: 96%;
    padding: 16px;
  }
  .mdl h3 { font-size: 17px; }

  /* 人员搜索 */
  .member-search-bar { flex-direction: column; gap: 10px; }
  .search-result-item {
    padding: 12px;
    font-size: 15px;
  }
  .sr-name { font-size: 15px; }
  .sr-phone { font-size: 13px; }

  /* 手册 */
  .manual-content { font-size: 15px; }
  .manual-editor { font-size: 15px; }

  /* 记录详情 */
  .record-detail-label { font-size: 14px; }
  .record-detail-value { font-size: 15px; }
  .record-detail-photos img {
    width: calc(50% - 5px);
    height: auto;
    aspect-ratio: 4/3;
  }

  /* 标签 */
  .tag { font-size: 12px; padding: 3px 9px; }

  /* 空状态 */
  .empty-icon { font-size: 56px; }
  .empty-text { font-size: 18px; }
  .empty-tip { font-size: 14px; }
}
