:root {
  --sidebar-w: 220px;
  --primary: #1e88e5;
  --primary-light: #e3f2fd;
  --red: #c62828;
  --orange: #e65100;
  --yellow: #f9a825;
  --green: #2e7d32;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #333;
  --text2: #666;
  --text3: #999;
  --border: #e8e8e8;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); display: flex; height: 100%; overflow: hidden; }
@supports (height: 100dvh) {
  html { height: 100dvh; }
  body { height: 100dvh; }
}

/* 侧边栏 - 左右折叠式（桌面端常驻左侧，收起时内容区自动展开） */
.sidebar { width: var(--sidebar-w, 220px); background: #1e1e2e; color: #a0a0b0; display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; transition: margin-left .25s ease, width .25s ease; }
body.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w, 220px)); }
.sidebar-title { color: #fff; font-size: 16px; font-weight: 600; padding: 24px 20px 6px; }
.sidebar-version { color: #666680; font-size: 11px; padding: 0 20px 20px; }
.nav-item { display: block; width: 100%; text-align: left; padding: 12px 20px; font-size: 14px; border: none; background: transparent; color: #a0a0b0; cursor: pointer; transition: .2s; }
.nav-item:hover { background: #2d2d3f; color: #fff; }
.nav-item.active { background: #3d3d5c; color: #4fc3f7; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 12px 20px; color: #444460; font-size: 11px; }

/* 主内容 */
.main { flex: 1; overflow-y: auto; padding: 56px 28px 80px; }
.page { display: none; }
.page.active { display: block; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.page-title .actions { margin-left: auto; display: flex; gap: 8px; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-header { padding: 14px 20px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px 20px 20px; }

/* 指标卡片行 */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-card .label { font-size: 13px; color: var(--text3); margin-bottom: 6px; }
.stat-card .value { font-size: 32px; font-weight: 700; }

/* 双栏 */
.row-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 16px; }
.row-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafafa; color: var(--text2); font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: var(--primary-light); }
.table-wrap { overflow-x: auto; }

/* 排序表头 */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #e8e8f0; }
.sort-icon { margin-left: 2px; font-size: 11px; color: #aaa; }
th.sortable.asc .sort-icon::after { content: '▲'; color: var(--primary); }
th.sortable.desc .sort-icon::after { content: '▼'; color: var(--primary); }

/* 筛选栏 */
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar label { font-size: 13px; color: var(--text2); }
.filter-bar select, .filter-bar input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; min-width: 80px; }
.filter-bar input { min-width: 160px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 16px; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1565c0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-warning { background: var(--orange); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* 预警等级标签 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-red { background: #ffebee; color: var(--red); }
.badge-orange { background: #fff3e0; color: var(--orange); }
.badge-yellow { background: #fffde7; color: #c49000; }
.badge-grey { background: #f5f5f5; color: #78909c; }
.badge-none { background: #f5f5f5; color: #999; }
.badge-green { background: #e8f5e9; color: var(--green); }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warn { background: #fff3e0; color: #e65100; }
.badge-danger { background: #ffebee; color: #c62828; }
/* 轨道标签 */
.badge-track-bid { background: #e3f2fd; color: #1565c0; }
.badge-track-direct { background: #fce4ec; color: #c62828; }
.badge-track-unknown { background: #f5f5f5; color: #999; }

/* 时间线 */
.timeline { padding-left: 20px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 8px 0 8px 24px; }
.timeline-item::before { content: ''; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid; background: #fff; }
.timeline-item.stage-备案::before { border-color: #42a5f5; }
.timeline-item.stage-规划许可::before { border-color: #66bb6a; }
.timeline-item.stage-施工许可::before { border-color: #ffa726; }
.timeline-item.stage-招标公告::before { border-color: #ef5350; }
.timeline-item.stage-中标::before { border-color: #ab47bc; }
.timeline-item.stage-签约::before { border-color: #26c6da; }
.timeline-item.stage-在建::before { border-color: #78909c; }
.timeline-item.stage-竣工::before { border-color: #8d6e63; }
.timeline-item .tl-stage { font-weight: 600; font-size: 14px; }
.timeline-item .tl-time { font-size: 12px; color: var(--text3); }
.timeline-item .tl-detail { font-size: 13px; color: var(--text2); }

/* 详情页 */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; }
.detail-grid .field-label { font-size: 12px; color: var(--text3); }
.detail-grid .field-value { font-size: 14px; }

/* 跟进记录 */
.follow-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.follow-item:last-child { border: none; }
.follow-content { font-size: 14px; }
.follow-meta { font-size: 12px; color: var(--text3); margin-top: 4px; }
.follow-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; margin-right: 8px; }
.follow-status-待跟进 { background: #f0f0f0; color: #666; }
.follow-status-跟进中 { background: #e6f7ff; color: #1890ff; }
.follow-status-已放弃 { background: #fff1f0; color: #ff4d4f; }
.follow-status-已签约 { background: #f6ffed; color: #52c41a; }

/* 内联编辑输入框 */
.inline-edit { border: 1px solid transparent; background: transparent; padding: 2px 6px; border-radius: 4px; font-size: 13px; width: 100%; min-width: 70px; transition: border-color 0.2s; }
.inline-edit:hover { border-color: var(--border); background: #fff; }
.inline-edit:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }

/* 阶段弹窗Tab */
.stage-modal-tab { padding: 10px 20px; font-size: 14px; border: none; background: none; cursor: pointer; color: #999; border-bottom: 2px solid transparent; transition: all 0.2s; }
.stage-modal-tab:hover { color: #333; }
.stage-modal-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* 返回按钮 */
.back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 14px; color: var(--primary); cursor: pointer; background: none; border: none; }
.back-btn:hover { text-decoration: underline; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 0 8px; font-size: 13px; color: var(--text2); }
.pagination .pg-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.pagination .pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination .pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .pg-btn:disabled { opacity: .4; cursor: default; }
.pagination .pg-info { margin-left: 8px; }

/* 提示 */
.toast { position: fixed; top: 20px; right: 20px; background: var(--green); color: #fff; padding: 12px 20px; border-radius: 6px; font-size: 14px; z-index: 9999; opacity: 0; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* 刷新按钮旋转动画 */
.spinning { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 汉堡按钮（桌面端展开时悬于侧边栏右边缘可折叠；折叠后收成左侧边缘细窄把手、不占头部空间；移动端悬浮） */
.hamburger { display: flex; position: fixed; top: 12px; left: calc(var(--sidebar-w, 220px) - 20px); z-index: 1001; width: 40px; height: 40px; border-radius: 8px; background: #1e1e2e; color: #fff; border: none; font-size: 20px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); align-items: center; justify-content: center; transition: all .25s ease; }
body.sidebar-collapsed .hamburger { left: 0; top: 50%; width: 20px; height: 56px; border-radius: 0 8px 8px 0; font-size: 12px; transform: translateY(-50%); box-shadow: 2px 0 6px rgba(0,0,0,.25); }

/* 折叠时主内容贴顶，不再为汉堡预留头部空间 */
body.sidebar-collapsed .main { padding-top: 24px; }

/* 遮罩层（仅移动端抽屉模式使用） */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 998; }
body.sidebar-open .sidebar-overlay { display: block; }

/* 响应式 */
@media (max-width: 1200px) {
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .row-2, .row-2-eq { grid-template-columns: 1fr; }
  .row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* 主内容全宽 */
  .main { padding: 56px 12px 12px; width: 100%; }

  /* 侧边栏改为抽屉模式（移动端） */
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 999; width: 240px; margin-left: 0; transform: translateX(-100%); transition: transform .25s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-collapsed .sidebar { margin-left: 0; }
  .hamburger { display: flex; left: 12px; top: 12px; width: 40px; height: 40px; border-radius: 8px; font-size: 20px; transform: none; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
  body.sidebar-open .hamburger { display: none; }
  body.sidebar-collapsed .main { padding-top: 56px; }

  /* 页面标题 */
  .page-title { font-size: 18px; flex-wrap: wrap; }
  .page-title .actions { margin-left: 0; width: 100%; justify-content: flex-end; margin-top: 8px; }

  /* 指标卡片 2列 */
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .value { font-size: 24px; }

  /* 双栏变单列 */
  .row-2, .row-2-eq { grid-template-columns: 1fr; }

  /* 筛选栏紧凑 */
  .filter-bar { gap: 8px; }
  .filter-bar select, .filter-bar input { min-width: 60px; font-size: 14px; }
  .filter-bar input { min-width: 100px; }

  /* 卡片内边距 */
  .card-body { padding: 12px 14px; }
  .card-header { padding: 10px 14px; font-size: 14px; }

  /* 表格横向滚动 */
  .table-wrap { max-height: none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
  #signing-table { min-width: 1100px; }

  /* 详情页档案网格 */
  .detail-grid { grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }

  /* 分页控件适配 */
  .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .pagination .pg-btn { min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center; }
  .pagination .pg-info { width: 100%; text-align: center; margin-left: 0; margin-top: 4px; }

  /* 按钮加大点击区域 */
  .btn { padding: 8px 14px; }
  .btn-sm { padding: 6px 12px; }

  /* 吐司提示下移 */
  .toast { top: auto; bottom: 20px; right: 12px; left: 12px; text-align: center; }
}

/* 区县详情页 */
.district-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.district-btn { padding: 8px 18px; border: 2px solid var(--border); border-radius: 20px; background: #fff; font-size: 14px; cursor: pointer; transition: .15s; color: var(--text2); }
.district-btn:hover { border-color: var(--primary); color: var(--primary); }
.district-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.district-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.district-tab { padding: 10px 20px; font-size: 14px; color: var(--text2); cursor: pointer; border-bottom: 3px solid transparent; transition: .15s; white-space: nowrap; }
.district-tab:hover { color: var(--primary); }
.district-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.district-tab .tab-count { font-size: 12px; color: var(--text3); margin-left: 4px; }
.district-tab.active .tab-count { color: var(--primary); }
.sub-tabs { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; background: #f5f5f5; border-radius: 6px; }
.sub-tab { padding: 6px 14px; font-size: 13px; color: var(--text2); cursor: pointer; border-radius: 4px; transition: .15s; }
.sub-tab:hover { color: var(--primary); }
.sub-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.sub-tab .sub-count { font-size: 11px; color: var(--text3); margin-left: 3px; }
.sub-tab.active .sub-count { color: #fff; }
.district-overview { margin-bottom: 24px; }
#district-section-divider { text-align:center; padding:8px 0; margin:0 0 16px; cursor:pointer; font-size:13px; color:var(--text3); border-top:1px dashed #ddd; border-bottom:1px dashed #ddd; transition:background .15s; user-select:none; }
#district-section-divider:hover { background:#f5f5f5; color:var(--primary); }
#district-upper-section.collapsed { display:none; }

/* 单位详情模态弹窗 */
.builder-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1099; justify-content: center; align-items: flex-start; padding-top: 40px; }
.builder-modal-overlay.open { display: flex; }
.builder-modal { width: 90vw; max-width: 900vw; max-height: 92vh; background: #fff; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.2); overflow: hidden; display: flex; flex-direction: column; animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.builder-modal-header { background: #1e1e2e; color: #fff; padding: 18px 24px; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.builder-modal-header .close-btn { margin-left: auto; background: none; border: none; color: #aaa; font-size: 24px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 4px; transition: .15s; }
.builder-modal-header .close-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.builder-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.builder-modal-body .stat-row { grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.builder-modal-body .card { margin-bottom: 16px; }
.builder-modal-body .table-wrap { max-height: 320px; }
.builder-modal-body .row-2-eq { gap: 16px; margin-bottom: 16px; }
.builder-modal-body .stat-card .value { font-size: 22px; }
.builder-modal-body .stat-card .label { font-size: 12px; }
@media (max-width: 768px) {
  .builder-modal-overlay { padding-top: 12px; }
  .builder-modal { max-width: 100vw; border-radius: 8px; max-height: 94vh; }
  .builder-modal-body .stat-row { grid-template-columns: repeat(2, 1fr); }
  .builder-modal-body .row-2-eq { grid-template-columns: 1fr; }
}

/* 项目阶段流程图 */
.stage-flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.stage-node { width: 100%; max-width: 460px; position: relative; }
.stage-box { border: 2px solid #e0e0e0; border-radius: 8px; padding: 12px 16px; background: #fafafa; transition: .2s; }
.stage-box.done { border-color: #43a047; background: #e8f5e9; }
.stage-box.active { border-color: #1e88e5; background: #e3f2fd; box-shadow: 0 0 0 3px rgba(30,136,229,.15); }
.stage-box.check { border-radius: 8px; transform: none; }
.stage-box .s-name { font-size: 15px; font-weight: 600; color: #333; }
.stage-box .s-platform { font-size: 12px; color: #999; margin-top: 2px; }
.stage-box.done .s-name { color: #2e7d32; }
.stage-box .s-icon { float: right; font-size: 18px; }
.stage-box.done .s-icon { color: #43a047; }
.stage-box.active .s-icon { color: #1e88e5; }
.stage-arrow { text-align: center; color: #bdbdbd; font-size: 20px; line-height: 1; padding: 4px 0; }
.stage-records { margin-top: 8px; padding: 10px 12px; background: #fff; border-radius: 6px; font-size: 13px; border: 1px solid #e8e8e8; }
.stage-records table { font-size: 12px; border-collapse: collapse; }
.stage-records th { padding: 6px 10px; background: #f5f5f5; border-right: 1px solid #e0e0e0; white-space: nowrap; font-size: 12px; }
.stage-records th:last-child { border-right: none; }
.stage-records td { padding: 6px 10px; border-right: 1px solid #f0f0f0; line-height: 1.6; word-break: break-all; white-space: normal; }
.stage-records td:last-child { border-right: none; }
.stage-records tr + tr td { border-top: 1px solid #f0f0f0; }
.stage-records .cell-amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-records .cell-name { max-width: 260px; word-break: break-all; white-space: normal; }


/* 防泄密水印 */
.watermark-layer { position: fixed; inset: 0; z-index: 9998; pointer-events: none; overflow: hidden; }
.watermark-layer.hidden { display: none; }
.watermark-layer[data-wm] { background-repeat: repeat !important; }

/* 登录页 */
.login-page { position: fixed; inset: 0; z-index: 9999; background: linear-gradient(135deg, rgba(10,25,45,0.82) 0%, rgba(10,25,45,0.88) 100%), url('../images/login-bg.jpg') center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.login-page.hidden { display: none; }
.login-box { background: rgba(255,255,255,0.08); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; padding: 48px 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-box h2 { text-align: center; font-size: 26px; margin-bottom: 8px; color: #fff; letter-spacing: 2px; }
.login-box .sub { text-align: center; color: rgba(255,255,255,0.5); font-size: 13px; margin-bottom: 32px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box label { display: block; font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.login-box input { width: 100%; padding: 10px 14px; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; font-size: 14px; background: rgba(255,255,255,0.06); color: #fff; transition: .2s; }
.login-box input::placeholder { color: rgba(255,255,255,0.3); }
.login-box input:focus { outline: none; border-color: #4fc3f7; box-shadow: 0 0 0 3px rgba(79,195,247,.2); background: rgba(255,255,255,0.1); }
.login-box .login-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: .2s; margin-top: 8px; box-shadow: 0 4px 16px rgba(79,195,247,.3); }
.login-box .login-btn:hover { background: linear-gradient(135deg, #29b6f6 0%, #039be5 100%); }
.login-box .login-btn:disabled { background: #555; cursor: not-allowed; box-shadow: none; }
.login-box .error-msg { color: #ef5350; font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px; }
/* 用户管理页 */
.user-table td, .user-table th { text-align: center; }
.user-table input, .user-table select { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }

/* 角色权限控制 */
/* 副总：隐藏所有写操作按钮 */
body.role-副总 .edit-only,
body.role-副总 .btn-edit,
body.role-副总 [data-perm="write"] { display: none !important; }
/* 项目专职负责人：隐藏轨道切换、跟进人修改、预警暂缓 */
body.role-项目专职负责人 .perm-track-edit,
body.role-项目专职负责人 .perm-person-edit,
body.role-项目专职负责人 .perm-warning-action { display: none !important; }
/* 只读模式下隐藏内联编辑框 */
body.role-副总 .inline-edit { pointer-events: none; opacity: 0.6; border: none; background: transparent; }
/* 项目专职负责人：隐藏热刷新 */
body.role-项目专职负责人 .perm-reload { display: none !important; }

/* ==================== 区县商机管理重构 ==================== */
/* 顶部渐变指标大卡 */
.dm-hero { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.dm-hero-card { border-radius: 10px; padding: 20px 22px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.dm-hero-card::after { content: ''; position: absolute; right: -10px; bottom: -10px; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.12); }
.dm-hero-card .h-label { font-size: 13px; opacity: .85; margin-bottom: 8px; letter-spacing: 1px; }
.dm-hero-card .h-value { font-size: 36px; font-weight: 800; line-height: 1; }
.dm-hero-card .h-sub { font-size: 12px; opacity: .7; margin-top: 6px; }
.dm-hero-card.total { background: linear-gradient(135deg, #1e88e5, #1565c0); }
.dm-hero-card.wait { background: linear-gradient(135deg, #78909c, #546e7a); }
.dm-hero-card.following { background: linear-gradient(135deg, #f57c00, #e65100); }
.dm-hero-card.signed { background: linear-gradient(135deg, #43a047, #2e7d32); }
.dm-hero-card.must { background: linear-gradient(135deg, #c62828, #b71c1c); }

/* 区县小卡片网格 */
.dm-dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin-bottom: 20px; }
.dm-dist-card { background: var(--card); border-radius: 8px; padding: 12px 14px; cursor: pointer; border: 1px solid var(--border); transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.dm-dist-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(30,136,229,.12); transform: translateY(-1px); }
.dm-dist-card .dc-name { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.dm-dist-card .dc-name .dc-num { color: var(--primary); font-size: 18px; }
.dm-dist-card .dc-stats { font-size: 12px; color: var(--text3); margin-top: 4px; display: flex; gap: 8px; }
.dm-dist-card .dc-stats span { display: inline-flex; align-items: center; gap: 2px; }
.dm-dist-card .dc-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.dm-dist-card .dc-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--primary), #42a5f5); transition: width .3s; }

/* 主Tab卡片 */
.dm-main-card .dm-tabs { display: flex; border-bottom: 2px solid var(--border); padding: 0 20px; background: #fafbfc; border-radius: var(--radius) var(--radius) 0 0; }
.dm-tab { padding: 14px 24px; font-size: 14px; color: var(--text3); cursor: pointer; border-bottom: 3px solid transparent; transition: .2s; background: none; border-top: none; border-left: none; border-right: none; font-weight: 500; }
.dm-tab:hover { color: var(--primary); }
.dm-tab.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }
.dm-panel { padding: 0; }

/* 筛选栏 */
.dm-filter-bar { display: flex; align-items: center; gap: 12px; margin: 16px 20px 0; flex-wrap: wrap; }
.dm-filter-bar label { font-size: 13px; color: var(--text2); }
.dm-filter-bar select, .dm-filter-bar input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; min-width: 80px; background: #fff; }
.dm-filter-bar input { min-width: 160px; }

/* 列表子Tab头 */
.dm-sub-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px 0; font-weight: 600; font-size: 15px; }
.dm-opp-tabs { display: inline-flex; gap: 4px; margin-left: 12px; padding: 3px; background: #f5f5f5; border-radius: 6px; }
.dm-opp-tab { padding: 5px 14px; font-size: 13px; color: var(--text2); cursor: pointer; border-radius: 4px; transition: .15s; font-weight: 500; }
.dm-opp-tab:hover { color: var(--primary); }
.dm-opp-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.dm-opp-count { font-size: 11px; margin-left: 3px; }

/* 表格区 */
.dm-table-wrap { padding: 0 20px; overflow-x: auto; }
.dm-table-wrap table { font-size: 13px; }
.dm-table-wrap th { background: #f7f8fa; font-size: 12px; letter-spacing: .5px; }

/* 图表区 */
.dm-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px; }

/* 响应式 */
@media (max-width: 1200px) {
  .dm-hero { grid-template-columns: repeat(3, 1fr); }
  .dm-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dm-hero { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dm-hero-card { padding: 14px 16px; }
  .dm-hero-card .h-value { font-size: 28px; }
  .dm-dist-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dm-filter-bar { gap: 8px; }
  .dm-filter-bar select, .dm-filter-bar input { min-width: 60px; font-size: 14px; }
  .dm-filter-bar input { min-width: 100px; }
}

/* 全市数据导出 */
.cw-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 16px; flex-wrap: wrap; }
.cw-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; background: #f5f5f5; color: var(--text2); }
.cw-stat-chip .chip-val { font-weight: 700; color: var(--primary); }
.cw-actions { display: flex; align-items: center; gap: 8px; }
.cw-search { display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid #e0e0e0; border-radius: 20px; background: #fff; transition: border-color .15s; }
.cw-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,136,229,.1); }
.cw-search input { border: none; outline: none; padding: 7px 0; font-size: 13px; width: 180px; background: transparent; }
.cw-content-card { border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.cw-content-card .card-header { font-size: 15px; font-weight: 600; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #fafbfc; border-radius: 10px 10px 0 0; }
.cw-content-card .card-body { border-radius: 0 0 10px 10px; }
#citywide-tabs { border-bottom: 2px solid #e8e8e8; }
#citywide-tabs .district-tab { position: relative; }
#citywide-tabs .district-tab::after { content: ''; position: absolute; bottom: -2px; left: 50%; width: 0; height: 3px; background: var(--primary); border-radius: 2px; transition: all .2s; transform: translateX(-50%); }
#citywide-tabs .district-tab.active::after { width: 70%; }
#citywide-tabs .district-tab .tab-count { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; border-radius: 9px; background: #e8e8e8; font-size: 11px; font-weight: 600; color: var(--text3); margin-left: 5px; transition: .15s; }
#citywide-tabs .district-tab.active .tab-count { background: rgba(30,136,229,.12); color: var(--primary); }
@media (max-width: 1200px) { .cw-search input { width: 140px; } }
@media (max-width: 768px) {
  .cw-toolbar { flex-direction: column; align-items: stretch; }
  .cw-actions { flex-wrap: wrap; }
  .cw-search input { width: 120px; }
  .cw-stats { gap: 4px; }
}
/* 收藏星标 */
.fav-star { cursor: pointer; user-select: none; transition: color 0.2s, transform 0.15s; }
.fav-star:active { transform: scale(1.3); }
.fav-star.fav-on { color: #ffc107 !important; }

