#fab {
  position: absolute; right: 12px; top: calc(var(--safe-top) + 52px + var(--statusbar-offset));
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: none; cursor: pointer;
  box-shadow: var(--shadow-sm), 0 0 0 0.5px rgba(0,0,0,0.03);
  z-index: 20; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
#fab svg { width: 20px; height: 20px; fill: var(--accent); transition: transform 0.3s; }
#fab.active { background: var(--text); }
#fab.active svg { fill: #fff; transform: rotate(135deg); }
#fab-menu {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-height: 90vh; z-index: 30;
  background: var(--bg-glass); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 24px 24px 0 0;
  display: none; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.1);
}
#fab-menu.active { display: flex; animation: sheetUp 0.35s cubic-bezier(0.16,1,0.3,1); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
#fab-menu .sheet-handle {
  width: 36px; height: 5px; border-radius: 3px; background: var(--separator);
  margin: 8px auto 4px; flex-shrink: 0;
}
#fab-menu .sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 20px 8px; flex-shrink: 0;
}
#fab-menu .sheet-title { font-family: var(--font-serif); font-size: 19px; font-weight: 900; letter-spacing: 0.05em; }
#fab-menu .sheet-close {
  width: 30px; height: 30px; border-radius: 50%; background: var(--separator-light);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sheet-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  padding: 6px 16px 8px; flex-shrink: 0;
  margin-bottom: 0;
  border-bottom: 0.5px solid var(--separator);
}
.sheet-tab {
  padding: 12px 6px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
  transition: var(--transition); display: flex; align-items: center; gap: 4px;
  justify-content: center; text-align: center;
  border-radius: 8px 8px 0 0;
}
.sheet-tab svg { width: 15px; height: 15px; opacity: 0.6; color: var(--text-2); }
.sheet-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.sheet-tab.active svg { opacity: 1; color: var(--accent); }
.sheet-tab { position: relative; }
.event-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.sheet-content {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 16px 20px;
  min-height: 200px;
  max-height: calc(90vh - 120px);
  scrollbar-width: thin;
}
/*build tab*/
.build-category { margin-bottom: 16px; }
.build-category-title {
  font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: 0.04em;
  margin-bottom: 8px; padding-left: 4px; display: flex; align-items: center; gap: 6px;
}
.build-category-title svg { width: 15px; height: 15px; }
.build-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
}
.build-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-xs);
  background: var(--bg-card); border: 1.5px solid transparent;
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.build-item:active { transform: scale(0.97); }
.build-item.selected { border-color: var(--accent); background: var(--accent-light); }
.build-item .bi-color { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.build-item .bi-color svg { width: 16px; height: 16px; opacity: 1; stroke: white !important; fill: none; }
.build-item .bi-name { flex: 1; font-size: 13px; font-weight: 500; }
.build-item .bi-cost { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.build-item.selected .bi-cost { color: var(--accent); }
.build-item .bi-info { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); opacity: 0.5; cursor: pointer; transition: opacity 0.15s; }
.build-item .bi-info svg { width: 16px; height: 16px; }
.build-item .bi-info:hover { opacity: 1; color: var(--accent); }
/*layer toggle*/
.layer-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-xs);
  background: var(--bg-card); margin-bottom: 8px; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: var(--transition);
}
.layer-row:active { transform: scale(0.98); }
.layer-row .lr-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--separator); flex-shrink: 0; }
.layer-row.active .lr-dot { background: var(--green); border-color: var(--green); }
.layer-row .lr-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.layer-row .lr-icon svg { width: 18px; height: 18px; opacity: 0.7; }
.layer-row.active .lr-icon svg { opacity: 1; }
.layer-row .lr-name { flex: 1; font-size: 15px; font-weight: 500; }
.layer-row .lr-z { font-size: 11px; color: var(--text-3); }
/*stats tab*/
.stats-section { margin-bottom: 16px; }
.stats-section h3 {
  font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: 0.04em;
  margin-bottom: 8px; padding-left: 4px; display: flex; align-items: center; gap: 6px;
}
.stats-section h3 svg { width: 15px; height: 15px; opacity: 0.7; color: var(--accent); flex-shrink: 0; }
.prs-bureau {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--bg-card); border-radius: var(--radius-xs);
  margin-bottom: 4px; box-shadow: var(--shadow-xs); min-height: 44px;
}
.prs-bureau-left { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.prs-bureau-name { font-weight: 600; font-size: 13px; color: var(--text-1); white-space: nowrap; }
.prs-bureau-desc { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prs-bureau-info { display: flex; align-items: center; gap: 6px; flex-shrink: 1; min-width: 0; max-width: 200px; overflow: hidden; }
.prs-faction-tag {
  display: inline-block; color: #fff; border-radius: 4px;
  padding: 1px 6px; font-size: 10px; line-height: 1.4; white-space: nowrap; flex-shrink: 0;
}
.prs-official-name { font-weight: 600; font-size: 12px; color: var(--text-1); white-space: nowrap; }
.prs-official-stats { font-size: 10px; color: var(--text-3); line-height: 1.4; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prs-btn {
  width: auto; padding: 4px 12px; font-size: 11px; border: none; border-radius: 6px;
  cursor: pointer; font-weight: 600; white-space: nowrap;
}
.prs-btn-appoint { background: var(--accent); color: #fff; }
.prs-btn-dismiss { background: var(--separator); color: var(--text-2); }

/* v2.9.9b 紧凑彩色操作按钮（替代过大的 start-btn primary，招聘等操作按钮多色区分） */
.prs-act {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 6px 10px; font-size: 13px; font-weight: 600; line-height: 1.25;
  border: 1px solid var(--separator); border-radius: 8px; background: var(--bg-card);
  color: var(--text); cursor: pointer; text-align: center; white-space: normal;
  transition: filter 0.15s, transform 0.05s;
}
.prs-act:hover { filter: brightness(0.96); }
.prs-act:active { transform: scale(0.98); }
.prs-act svg { width: 14px; height: 14px; opacity: 0.9; }
.prs-act-blue { background: #2f6fed; border-color: transparent; color: #fff; }
.prs-act-green { background: var(--green); border-color: transparent; color: #fff; }
.prs-act-orange { background: var(--orange); border-color: transparent; color: #fff; }
.prs-act-red { background: var(--red); border-color: transparent; color: #fff; }
.prs-act-accent { background: var(--accent); border-color: transparent; color: #fff; }
.prs-act-gray { background: var(--separator); border-color: transparent; color: var(--text-2); }

/* v3.0.0b 人事申报：独立卡片（类待合并乡镇标签），操作收进弹窗滑块，禁止裸露拖动条 / 一行多按钮 */
.prs-tag {
  display: inline-block; color: #fff; border-radius: 4px;
  padding: 2px 8px; font-size: 11px; line-height: 1.4; white-space: nowrap; flex-shrink: 0;
}
.prs-tag b { font-weight: 700; }

/* 招聘 / 派遣 / 考试 / 改革 卡片：与待合并乡镇卡片同款（bg-card + 细边框 + 圆角 + 阴影），每行一个按钮 */
.prs-recruit-card {
  background: var(--bg-card); border: 1px solid var(--separator-light); border-radius: var(--radius-xs);
  padding: 12px; margin: 6px 0; box-shadow: var(--shadow-xs);
}
.prs-recruit-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
}
.prs-recruit-cap { font-size: 12px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.prs-recruit-summary { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-bottom: 10px; }
.prs-recruit-btn {
  display: block; width: 100%; padding: 9px 12px; font-size: 13px; font-weight: 600; line-height: 1.25;
  border: none; border-radius: 8px; color: #fff; cursor: pointer; text-align: center; white-space: nowrap;
  transition: filter 0.15s, transform 0.05s;
}
.prs-recruit-btn:hover { filter: brightness(0.96); }
.prs-recruit-btn:active { transform: scale(0.98); }
.prs-recruit-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.prs-secondary-btn { background: var(--separator); color: var(--text-2); }
.prs-dismiss-btn { background: var(--red); color: #fff; }

/* 顶部单行状态汇总 + 招聘进行中汇总 + 提示 + 改革进行中列表 */
.prs-status-line {
  font-size: 11px; color: var(--text-3); background: var(--separator-light);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 4px;
}
.prs-status-line b { color: var(--text-1); font-weight: 600; }
.prs-q-summary {
  font-size: 11px; color: var(--accent); background: var(--accent-light);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 2px;
}
.prs-hint { font-size: 10px; color: var(--text-3); margin: 2px 0 0; }
.prs-reform-list { margin-top: 6px; }
.prs-reform-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: var(--separator-light); border-radius: 6px; margin-bottom: 4px; font-size: 11px;
}
.prs-empty { color: var(--text-3); font-size: 12px; }
.prs-pool-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card); border-radius: var(--radius-xs); padding: 8px 12px; margin-bottom: 4px;
  flex-wrap: wrap;
}
.prs-faction-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.prs-faction-chip {
  border-radius: 10px; padding: 2px 10px; font-size: 11px; white-space: nowrap;
}
.prs-summary {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
  padding: 8px 10px; background: var(--bg-card); border-radius: var(--radius-xs);
  box-shadow: var(--shadow-xs);
}
.prs-summary-item {
  display: flex; flex-direction: column; align-items: center; min-width: 52px;
}
.prs-summary-val { font-size: 14px; font-weight: 700; line-height: 1.2; }
.prs-summary-label { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.prs-val-pos { color: var(--green, #4a9a3a); }
.prs-val-neg { color: var(--red, #c44a4a); }
.prs-val-zero { color: var(--text-3); }
.prs-section-title {
  font-size: 13px; font-weight: 600; margin: 12px 0 6px;
  display: flex; align-items: center; gap: 6px; color: var(--text-1);
}
.prs-section-count {
  background: var(--separator); color: var(--text-2); border-radius: 8px;
  padding: 1px 8px; font-size: 11px; font-weight: 600;
}
.prs-bureau-effect {
  font-size: 10px; line-height: 1.3; white-space: nowrap;
}
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-card); border-radius: var(--radius-xs);
  margin-bottom: 4px; box-shadow: var(--shadow-xs);
}
.stat-row .sr-label { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.stat-row .sr-label svg { width: 14px; height: 14px; opacity: 0.65; color: var(--text-3); flex-shrink: 0; }
.stat-row .sr-val { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.stat-row .sr-val.good { color: var(--green); }
.stat-row .sr-val.warn { color: var(--orange); }
.stat-row .sr-val.bad { color: var(--red); }
.stat-bar {
  height: 6px; background: var(--separator-light); border-radius: 3px;
  overflow: hidden; margin-top: 4px;
}
.stat-bar .fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; max-width: 100%; }
/*score card*/
.score-card {
  text-align: center; padding: 24px; margin-bottom: 16px;
  background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.score-card svg { width: 28px; height: 28px; }
.score-card .score-num {
  font-family: var(--font-serif);
  font-size: 48px; font-weight: 900; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.score-card .score-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.score-card .score-grade {
  display: inline-block; padding: 4px 14px; border-radius: 16px;
  font-size: 13px; font-weight: 600; margin-top: 8px;
}
/*policy cards*/
.policy-card {
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); margin-bottom: 8px; box-shadow: var(--shadow-xs);
}
.policy-card .pc-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.policy-card .pc-title svg { width: 15px; height: 15px; opacity: 0.7; color: var(--accent); flex-shrink: 0; }
.policy-card .pc-desc { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.policy-card .pc-control { display: flex; align-items: center; gap: 10px; }
.policy-card input[type="range"] { flex: 1; accent-color: var(--accent); height: 4px; }
.policy-card .pc-value { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 50px; text-align: right; font-size: 14px; }
/* 户籍政策 - 开关样式 */
.toggle-switch { user-select: none; }
.toggle-slider-wrap { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 12px; transition: background 0.3s; pointer-events: none; }
.toggle-slider > span { position: absolute; height: 18px; width: 18px; bottom: 3px; background: white; border-radius: 50%; transition: left 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider > span { left: 24px; }
/*investment card*/
.invest-card {
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); margin-bottom: 8px; box-shadow: var(--shadow-xs);
}
.invest-card.disabled { opacity: 0.5; }
.invest-card .iv-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; display: flex; justify-content: space-between; align-items: center; }
.invest-card .iv-title-left { display: flex; align-items: center; gap: 6px; }
.invest-card .iv-title-left svg { width: 15px; height: 15px; opacity: 0.7; }
.invest-card .iv-cost { color: var(--orange); font-size: 13px; }
.invest-card .iv-desc { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
/*corruption card*/
.corrupt-card {
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); margin-bottom: 8px; box-shadow: var(--shadow-xs);
}
.corrupt-card.disabled { opacity: 0.5; }
.corrupt-card .cc-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.corrupt-card .cc-title svg { width: 15px; height: 15px; opacity: 0.7; }
.corrupt-card .cc-desc { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.corrupt-card .cc-effects { display: flex; flex-wrap: wrap; gap: 6px; }
.corrupt-card .cc-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.corrupt-card .cc-tag.pos { background: var(--green-light); color: var(--green); }
.corrupt-card .cc-tag.neg { background: var(--red-light); color: var(--red); }

/* v2.6.5: 面板解锁标识 - 红色虚线边框 (开发者可见的视觉预警) */
.panel-unlocked {
  border: 1.5px dashed rgba(196, 69, 54, 0.35);
  border-radius: 10px;
  position: relative;
}
.panel-unlocked::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: inset 0 0 0 0.5px rgba(196, 69, 54, 0.08);
}
#build-window {
  position: absolute; top: 60px; right: 60px;
  width: 320px; max-height: 70vh;
  background: var(--bg-glass); backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 25; display: none; flex-direction: column;
  border: 0.5px solid rgba(0,0,0,0.06);
}
#build-window.active { display: flex; }
#demolish-window {
  position: absolute; top: 60px; right: 60px;
  width: 320px; max-height: 70vh;
  background: var(--bg-glass); backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 25; display: none; flex-direction: column;
  border: 0.5px solid rgba(0,0,0,0.06);
}
#demolish-window.active { display: flex; }
#demolish-window .bw-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: move; user-select: none;
  border-bottom: 0.5px solid var(--separator);
  flex-shrink: 0;
}
#demolish-window .bw-title {
  font-family: var(--font-serif); font-size: 16px; font-weight: 900;
  letter-spacing: 0.04em;
}
#demolish-window .bw-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--separator-light); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-2);
}
#demolish-window .bw-body {
  overflow-y: auto; padding: 12px 14px 16px;
  max-height: calc(70vh - 52px);
}
#build-window .bw-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: move; user-select: none;
  border-bottom: 0.5px solid var(--separator);
  flex-shrink: 0;
}
#build-window .bw-title {
  font-family: var(--font-serif); font-size: 16px; font-weight: 900;
  letter-spacing: 0.04em;
}
#build-window .bw-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--separator-light); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-2);
}
#build-window .bw-body {
  overflow-y: auto; padding: 12px 14px 16px;
  max-height: calc(70vh - 52px);
}
#menu-btn, #ret-menu-btn {
  position: absolute; left: 12px; top: calc(var(--safe-top) + 52px + var(--statusbar-offset));
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: none; cursor: pointer;
  box-shadow: var(--shadow-sm), 0 0 0 0.5px rgba(0,0,0,0.03);
  z-index: 20; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
#menu-btn svg, #ret-menu-btn svg { width: 20px; height: 20px; stroke: var(--accent); transition: transform 0.3s; }
#menu-btn.active, #ret-menu-btn.active { background: var(--text); }
#menu-btn.active svg, #ret-menu-btn.active svg { stroke: #fff; transform: rotate(135deg); }
#menu-panel, #ret-menu-panel {
  position: absolute; left: 12px; top: calc(var(--safe-top) + 104px + var(--statusbar-offset));
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - var(--safe-top) - 160px);
  background: var(--bg-glass); backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 35; display: none; flex-direction: column;
  overflow-y: auto; padding: 16px;
  border: 0.5px solid var(--separator);
  -webkit-overflow-scrolling: touch;
}
#menu-panel.active, #ret-menu-panel.active { display: flex; }
#menu-panel .menu-section, #ret-menu-panel .menu-section { margin-bottom: 14px; }
#menu-panel .menu-section h3, #ret-menu-panel .menu-section h3 {
  font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: 0.04em;
  margin-bottom: 8px; padding-left: 4px;
  display: flex; align-items: center; gap: 4px;
}
#menu-panel .menu-btn, #ret-menu-panel .menu-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); border: none; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text);
  margin-bottom: 6px; transition: var(--transition);
  box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
#menu-panel .menu-btn:active, #ret-menu-panel .menu-btn:active { transform: scale(0.98); }
#menu-panel .menu-btn svg, #ret-menu-panel .menu-btn svg { width: 18px; height: 18px; stroke: var(--accent); flex-shrink: 0; }
#menu-mods-section {
  border-bottom: 0.5px solid var(--separator-light);
  padding-bottom: 8px; margin-bottom: 8px;
}
#menu-mods-section .mod-loaded-item {
  padding: 8px 10px; margin-bottom: 4px;
  background: var(--accent-light); border-radius: var(--radius-xs);
  border-left: 3px solid var(--accent);
  min-height: 40px;
}
#menu-mods-section .mod-failed-item {
  padding: 6px 10px; margin-bottom: 3px;
  background: var(--red-light); border-radius: var(--radius-xs);
  font-size: 11px; color: var(--red);
}
@media (max-width: 480px) {
  #menu-panel, #ret-menu-panel {
    left: 6px; right: 6px; width: auto;
    max-height: calc(100vh - var(--safe-top) - 130px);
    border-radius: var(--radius-sm); padding: 12px;
  }
  #menu-panel .menu-btn, #ret-menu-panel .menu-btn {
    padding: 10px 12px; font-size: 13px;
    min-height: 44px;
  }
  #menu-panel .menu-btn svg, #ret-menu-panel .menu-btn svg { width: 16px; height: 16px; }
  #menu-panel .menu-section h3, #ret-menu-panel .menu-section h3 { font-size: 12px; }
  #menu-mods-section .mod-loaded-item { padding: 6px 8px; }
}
#avail-mods-popup {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  background: rgba(42,39,33,0.35);
}
#avail-mods-popup.active { display: flex; }
#avail-mods-popup .avail-mods-card {
  width: 360px; max-height: 70vh;
  background: var(--bg-glass); backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 20px; overflow-y: auto;
  border: 0.5px solid var(--separator);
}
#avail-mods-popup .avail-mods-card h3 {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
#avail-mods-popup .avail-mod-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg-card); border-radius: var(--radius-xs);
  border: 0.5px solid var(--separator-light);
}
#avail-mods-popup .avail-mod-info { flex: 1; min-width: 0; }
#avail-mods-popup .avail-mod-info .ami-name {
  font-size: 13px; font-weight: 600; color: var(--text);
}
#avail-mods-popup .avail-mod-info .ami-meta {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}
#avail-mods-popup .avail-mod-info .ami-desc {
  font-size: 11px; color: var(--text-2); margin-top: 3px;
}
#avail-mods-popup .avail-enable-btn {
  flex-shrink: 0; padding: 6px 14px;
  border-radius: var(--radius-xs); border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #fff;
  background: var(--accent); transition: var(--transition);
}
#avail-mods-popup .avail-enable-btn:active { transform: scale(0.96); }
#avail-mods-popup .avail-enable-btn:disabled {
  background: var(--separator); color: var(--text-3); cursor: not-allowed;
}
#avail-mods-popup .avail-close-btn {
  display: block; width: 100%; margin-top: 12px; padding: 10px;
  border-radius: var(--radius-xs); border: 0.5px solid var(--separator);
  background: var(--bg-card); cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: var(--transition);
}
#avail-mods-popup .avail-close-btn:hover { background: var(--separator-light); }
@media (max-width: 480px) {
  #avail-mods-popup .avail-mods-card {
    width: calc(100vw - 32px); max-height: 75vh;
    border-radius: var(--radius-sm); padding: 16px;
  }
  #avail-mods-popup .avail-mods-card h3 { font-size: 14px; }
  #avail-mods-popup .avail-mod-item {
    padding: 8px 10px; gap: 8px;
  }
  #avail-mods-popup .avail-enable-btn {
    padding: 6px 12px; font-size: 11px;
  }
}
#layers-popup {
  position: absolute; bottom: calc(var(--safe-bottom) + 72px); left: 50%;
  transform: translateX(-50%);
  width: 260px; padding: 12px;
  background: var(--bg-glass); backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 16px; box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  z-index: 21; display: none; flex-direction: column; gap: 6px;
  border: 0.5px solid rgba(0,0,0,0.06);
}
#layers-popup.active { display: flex; }
.gov-subnav {
  display: flex; gap: 4px;
  padding: 4px 0 10px;
  border-bottom: 0.5px solid var(--separator); margin-bottom: 12px;
}
.gov-subnav-btn {
  flex: 1; padding: 8px 4px; border-radius: 8px; border: 1px solid var(--separator);
  background: transparent; font-size: 12px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: var(--transition);
  white-space: nowrap; text-align: center;
}
.gov-subnav-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.policy-group {
  margin-bottom: 10px;
}
.policy-group-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow-xs);
  user-select: none;
}
.policy-group-header svg { width: 14px; height: 14px; opacity: 0.6; transition: transform 0.2s; }
.policy-group-header.open svg { transform: rotate(90deg); }
.policy-group-body { display: none; padding: 6px 0 0; }
.policy-group-body.open { display: block; }
.personal-status {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px; background: var(--bg-card); border-radius: var(--radius-xs);
  margin-bottom: 14px; box-shadow: var(--shadow-xs);
}
.personal-status .ps-item {
  display: flex; flex-direction: column; align-items: center;
  min-width: 70px; flex: 1;
}
.personal-status .ps-val { font-size: 14px; font-weight: 700; }
.personal-status .ps-label { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* ═══ 铁路调图系统 - 调图面板样式 ═══ */

/* --- 调图面板: 顶部信息栏 --- */
.rail-schedule-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}
.rail-schedule-header .rsh-icon {
  width: 42px; height: 42px; border-radius: var(--radius-xs);
  background: var(--accent-light); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rail-schedule-header .rsh-icon svg { width: 22px; height: 22px; stroke: var(--accent); }
.rail-schedule-header .rsh-info { flex: 1; min-width: 0; }
.rail-schedule-header .rsh-name {
  font-family: var(--font-serif); font-size: 16px; font-weight: 900;
  color: var(--text); letter-spacing: 0.03em;
}
.rail-schedule-header .rsh-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* --- 调图面板: 主体区域 --- */
.rail-schedule-body { display: flex; flex-direction: column; gap: 12px; }
.rsb-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.rsb-title svg { width: 16px; height: 16px; opacity: 0.7; color: var(--accent); flex-shrink: 0; }
.rsb-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; margin: 0 0 6px; }

/* --- 滑条区域 --- */
.rsb-slider-wrap {
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); box-shadow: var(--shadow-xs);
}
.rsb-label-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 13px;
}
.rsb-label-row svg { width: 14px; height: 14px; stroke: currentColor; }
.rsb-slider-row {
  display: flex; align-items: center; gap: 8px;
}
.rsb-slider-row .rsb-btn-minus,
.rsb-slider-row .rsb-btn-plus {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--separator); background: var(--bg-card);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.rsb-slider-row .rsb-btn-minus:active,
.rsb-slider-row .rsb-btn-plus:active { transform: scale(0.9); border-color: var(--accent); }
.rsb-slider-row .rsb-btn-minus svg,
.rsb-slider-row .rsb-btn-plus svg { width: 16px; height: 16px; stroke: var(--text-2); }
.rsb-slider-row input[type="range"] {
  flex: 1; accent-color: var(--accent); height: 4px;
  -webkit-appearance: none; appearance: none;
  background: var(--separator); border-radius: 2px; outline: none;
}
.rsb-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: var(--shadow-sm); border: 2px solid #fff;
}
.rsb-slider-row input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: var(--shadow-sm); border: 2px solid #fff;
}

/* --- 占比数值显示 --- */
.rsb-ratio-display {
  display: flex; align-items: center; justify-content: center;
  margin-top: 12px;
}
.rsb-ratio-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
}
.rsb-ri-label { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.rsb-ri-val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rsb-ratio-divider { width: 1px; height: 28px; background: var(--separator); margin: 0 12px; }

/* --- 容量分配显示 --- */
.rsb-capacity-row {
  display: flex; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 0.5px solid var(--separator);
}
.rsb-cap-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px; border-radius: var(--radius-xs);
  background: var(--separator-light);
}
.rsb-ci-label { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.rsb-ci-val { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

/* --- 经济影响预估 --- */
.rsb-impact-section {
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); box-shadow: var(--shadow-xs);
}
.rsb-impact-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.rsb-impact-title svg { width: 16px; height: 16px; opacity: 0.7; color: var(--accent); flex-shrink: 0; }
.rsb-impact-list { display: flex; flex-direction: column; gap: 8px; }
.rsb-impact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-xs);
  background: var(--separator-light);
}
.rsb-ii-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rsb-ii-icon svg { width: 18px; height: 18px; }
.rsb-ii-text { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.rsb-ii-label { font-size: 13px; color: var(--text-2); }
.rsb-ii-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- 费用信息 --- */
.rsb-cost-info {
  padding: 12px 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px;
}
.rsb-cost-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-2);
}
.rsb-cost-row svg { width: 13px; height: 13px; vertical-align: middle; margin-right: 2px; }

/* ═══ 铁路调图系统 - 运行图信息可视化 ═══ */

/* --- 当前车站信息卡 --- */
.rsi-station-card {
  padding: 14px; border-radius: var(--radius-xs);
  background: var(--bg-card); margin-bottom: 12px; box-shadow: var(--shadow-xs);
}
.rsi-station-header {
  display: flex; align-items: center; gap: 12px;
}
.rsi-sh-icon {
  width: 42px; height: 42px; border-radius: var(--radius-xs);
  background: var(--accent-light); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rsi-sh-icon svg { width: 22px; height: 22px; stroke: var(--accent); }
.rsi-sh-info { flex: 1; min-width: 0; }
.rsi-sh-name {
  font-family: var(--font-serif); font-size: 16px; font-weight: 900;
  color: var(--text); letter-spacing: 0.03em;
}
.rsi-sh-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.rsi-sh-barrier {
  font-size: 11px; color: var(--green); margin-top: 4px;
  display: flex; align-items: center; gap: 4px;
}
.rsi-sh-barrier svg { width: 13px; height: 13px; }

/* --- 容量可视化条 --- */
.rsi-cap-section {
  margin-top: 14px; padding-top: 14px;
  border-top: 0.5px solid var(--separator);
  display: flex; flex-direction: column; gap: 10px;
}
.rsi-cap-row {
  display: flex; align-items: center; gap: 8px;
}
.rsi-cap-label {
  font-size: 12px; color: var(--text-2); white-space: nowrap;
  min-width: 80px; display: flex; align-items: center; gap: 4px;
}
.rsi-cap-label svg { width: 13px; height: 13px; }
.rsi-cap-bar-wrap {
  flex: 1; height: 8px; border-radius: 4px;
  background: var(--separator); overflow: hidden;
}
.rsi-cap-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
}
.rsi-cap-val {
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text); min-width: 60px; text-align: right;
}

/* --- 车次列表 --- */
.rsi-trains-section { margin-top: 16px; }
.rsi-trains-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.rsi-trains-title svg { width: 16px; height: 16px; opacity: 0.7; color: var(--accent); flex-shrink: 0; }
.rsi-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 20px 0; }
.rsi-train-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px;
}
.rsi-train-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 6px; border-radius: var(--radius-xs);
  border: 1.5px solid; gap: 2px;
}
.rsi-tc-code { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.rsi-tc-type { font-size: 10px; color: var(--text-3); }

/* --- 辖区车站概览 --- */
.rsi-all-stations-section { margin-top: 16px; }
.rsi-ast-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.rsi-ast-title svg { width: 16px; height: 16px; opacity: 0.7; color: var(--accent); flex-shrink: 0; }
.rsi-ast-list { display: flex; flex-direction: column; gap: 6px; }
.rsi-ast-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-xs);
  background: var(--bg-card); box-shadow: var(--shadow-xs);
  cursor: pointer; transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.rsi-ast-item:active { transform: scale(0.98); }
.rsi-asi-icon {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rsi-asi-icon svg { width: 16px; height: 16px; stroke: #fff; }
.rsi-asi-info { flex: 1; min-width: 0; }
.rsi-asi-name { font-size: 13px; font-weight: 600; color: var(--text); }
.rsi-asi-stats { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.rsi-asi-ratio {
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-2); flex-shrink: 0;
}
