:root {
  --primary: #1565c0;
  --primary-light: #e3f2fd;
  --success: #2e7d32;
  --warning: #f9a825;
  --danger: #c62828;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text2: #607d8b;
  --border: #e0e0e0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ========== 菜单栏 ========== */
.tabs { display:flex; background:#fff; border-bottom:2px solid var(--border); padding:0 20px; overflow-x:auto; height:42px; position:sticky; top:56px; z-index:90; }
.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); font-weight: 600; }

.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);
}

/* 下拉菜单 */
.dropdown { position: static; display: flex; align-items: center; }
.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 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
}
.dropdown-menu a:hover { background: var(--primary-light); }

/* ========== 主容器 ========== */
.wrap { padding: 16px; max-width: 1400px; margin: 0 auto; }

/* ========== 面板 ========== */
.pane { display: none; }
.pane.on { display: block; }

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--primary);
}

/* ========== 表单 ========== */
.form-grid { display: grid; gap: 14px; }
.form-section { margin-bottom: 12px; }
.form-section-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }

.grp { display: flex; flex-direction: column; gap: 4px; }
.grp label { font-size: 13px; font-weight: 600; color: var(--text); }
.grp input, .grp textarea, .grp select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}
.grp input:focus, .grp textarea:focus, .grp select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.req { color: var(--danger); }

/* ========== 按钮 ========== */
.btns { display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { background: #f5f5f5; }
.btn-pri { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-pri:hover { background: #0d47a1; }
.btn-ok { background: var(--success); color: #fff; border-color: var(--success); }
.btn-ok:hover { background: #1b5e20; }
.btn-err { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-err:hover { background: #b71c1c; }
.btn-out { background: #fff; color: var(--text); border-color: var(--border); }
.btn-out:hover { background: #f5f5f5; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-icon { width: 16px; height: 16px; }

/* ========== 表格 ========== */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid #cfd8dc; }
th { background: #f5f7fa; padding: 8px 10px; text-align: left; font-weight: 600; color: var(--text2); border: 1px solid #cfd8dc; white-space: nowrap; }
td { padding: 8px 10px; border: 1px solid #cfd8dc; vertical-align: top; }
tr:hover td { background: #fafbfc; }
tr:nth-child(even) td { background: #fafbfc; }
tr:nth-child(even):hover td { background: #f0f4f8; }

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

/* ========== 塔号标签列表 ========== */
.tower-list-bar {
  background: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.tower-list-title { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.tower-list-items { display: flex; flex-wrap: wrap; gap: 6px; }
.tower-tag {
  padding: 4px 10px;
  background: #f0f4f8;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text2);
  transition: all 0.15s;
}
.tower-tag:hover { background: var(--primary-light); color: var(--primary); }
.tower-tag.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== 照片 ========== */
.photo-upload-area { margin-bottom: 10px; }
.photo-list { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-item {
  position: relative;
  width: 180px;
  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-caption { padding: 4px 6px; }
.photo-caption input {
  width: 100%;
  border: none;
  font-size: 12px;
  padding: 2px 4px;
  outline: none;
  background: transparent;
  font-family: inherit;
}
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-del:hover { background: var(--danger); }

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

/* ========== 模态框 ========== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal.on { display: flex; }
.mdl {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  width: 90%;
}

/* ========== 工程列表项 ========== */
.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: background 0.15s;
}
.project-item:hover { background: #f8f9fa; }
.pj-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pj-info { font-size: 12px; color: var(--text2); margin-top: 2px; }
.pj-time { font-size: 11px; color: #b0bec5; margin-top: 2px; }

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.tag-red { background: #ffebee; color: #c62828; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-grey { background: #f5f5f5; color: #757575; }

/* ========== 状态标签 ========== */
.status-closed {
  display: inline-block;
  padding: 2px 8px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-open {
  display: inline-block;
  padding: 2px 8px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-pending {
  display: inline-block;
  padding: 2px 8px;
  background: #fff8e1;
  color: #f57f17;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ========== 临期提醒灯 ========== */
.light-red, .light-yellow, .light-green, .light-grey {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: middle;
}
.light-red { background: #e53935; box-shadow: 0 0 4px rgba(229,57,53,0.5); animation: pulse-red 1.5s infinite; }
.light-yellow { background: #fdd835; box-shadow: 0 0 4px rgba(253,216,53,0.5); }
.light-green { background: #43a047; box-shadow: 0 0 4px rgba(67,160,71,0.3); }
.light-grey { background: #bdbdbd; }

@keyframes pulse-red {
  0% { box-shadow: 0 0 4px rgba(229,57,53,0.5); }
  50% { box-shadow: 0 0 10px rgba(229,57,53,0.8); }
  100% { box-shadow: 0 0 4px rgba(229,57,53,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;
  background: #fafbfc;
}
.sr-info { display: flex; gap: 12px; align-items: center; }
.sr-name { font-weight: 600; font-size: 13px; }
.sr-phone { font-size: 12px; color: var(--text2); }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .tabs { padding: 0 8px; }
  .tab { padding: 8px 10px; font-size: 12px; }
  .wrap { padding: 8px; }
  .card { padding: 12px; }
  .btns { flex-wrap: wrap; }
  .mdl { width: 95%; padding: 16px; }
  th, td { padding: 6px; font-size: 12px; }
  .photo-item { width: 140px; }
  .photo-item img { height: 110px; }
}
