/* ============================================================
   components.css — 组件与视图样式
   阶段进度条、落地三环节、项目卡片、动态卡片、图片上传、
   地图与打点、表单、模态框、toast、空状态、错误状态等
   ============================================================ */

/* ---------------- 通用状态盒（加载/错误/空状态） ---------------- */

.state-box {
  text-align: center;
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.state-box .state-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 4px;
}

.state-box h2 {
  font-size: 1.1rem;
}

.state-box .text-secondary {
  max-width: 360px;
}

.loading-box {
  text-align: center;
  padding: 36px 16px;
  color: var(--color-text-muted);
}

.loading-box .spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid var(--color-border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- 阶段进度条 stage-bar ---------------- */

.stage-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
}

.stage-bar-track {
  display: flex;
  align-items: flex-start;
  min-width: 540px;
  gap: 0;
  position: relative;
}

.stage-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-width: 70px;
}

.stage-node-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--color-text-muted);
  z-index: 1;
  transition: all 0.15s ease;
}

/* 节点之间的连线 */
.stage-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}

.stage-node.completed .stage-node-dot,
.stage-node.current .stage-node-dot {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.stage-node.completed .stage-node-dot {
  background: var(--color-success);
  border-color: var(--color-success);
}

.stage-node:not(:last-child).completed::after {
  background: var(--color-success);
}

.stage-node.current .stage-node-dot {
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.18);
}

.stage-node-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.stage-node.completed .stage-node-label,
.stage-node.current .stage-node-label {
  color: var(--color-text);
  font-weight: 500;
}

/* 迷你版（卡片摘要用） */
.stage-bar.mini .stage-node-dot {
  width: 18px;
  height: 18px;
  border-width: 2px;
  font-size: 9px;
}

.stage-bar.mini .stage-node:not(:last-child)::after {
  top: 8px;
}

.stage-bar.mini .stage-node-label {
  display: none;
}

.stage-bar.mini .stage-bar-track {
  min-width: auto;
  gap: 4px;
}

.stage-bar.mini {
  padding: 2px 0;
}

/* ---------------- 落地三环节 landing-steps ---------------- */

.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.landing-step {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  background: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.landing-step.done {
  background: var(--color-success-light);
  border-color: var(--color-success);
}

.landing-step.todo {
  background: var(--color-bg);
  border-color: var(--color-border);
}

.landing-step.inactive {
  opacity: 0.45;
  background: var(--color-bg);
}

.landing-step-icon {
  font-size: 20px;
  line-height: 1;
}

.landing-step.done .landing-step-icon { color: var(--color-success); }
.landing-step.todo .landing-step-icon { color: var(--color-text-muted); }
.landing-step.inactive .landing-step-icon { color: var(--color-text-muted); }

.landing-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

.landing-step.inactive .landing-step-label {
  color: var(--color-text-muted);
  font-weight: 400;
}

.landing-step-status {
  font-size: 12px;
  color: var(--color-text-muted);
}

.landing-step.done .landing-step-status { color: var(--color-success); }

@media (max-width: 380px) {
  .landing-steps {
    grid-template-columns: 1fr;
  }
}

/* ---------------- 项目列表与卡片 ---------------- */

/* 项目名称搜索框 */
.project-search {
  margin-bottom: 14px;
}

.project-search-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  font-size: 14px;
}

/* 分页控件 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.pagination-info {
  font-size: 13px;
  color: var(--color-text-muted);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 36px;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.stage-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

/* 县区/行业过滤行：左侧维度标签 + 横向滚动按钮组 */
.attr-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.attr-filter-label {
  flex: none;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-right: 2px;
  white-space: nowrap;
}
.attr-filter .stage-tab {
  white-space: nowrap;
}

.stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.stage-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.stage-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.stage-tab.active .stage-tab-count {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
}

@media (min-width: 560px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  min-width: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* 变化标签（近 2 天有更新，卡片右上角） */
.project-card-new {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 0 var(--radius-md) 0 var(--radius-md);
  box-shadow: 0 1px 3px rgba(245, 124, 0, 0.4);
  pointer-events: none;
  white-space: nowrap;
}

.project-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card-name {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.project-card-stage {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
  margin-top: -4px;
}

/* 卡片归属行：县区 · 行业小标签 */
.project-card-attribution {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12px;
}
.project-card-attribution:empty {
  display: none;
}
.project-card-county,
.project-card-industry {
  color: var(--color-text-secondary);
}
.project-card-county::before {
  content: '📍 ';
}
.project-card-industry::before {
  content: '🏷️ ';
}
.project-card-industry + * {
  margin-left: 0;
}

.project-card-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.6em;
}

.project-card-footer {
  margin-top: auto;
}

/* ---------------- 骨架屏 skeleton ---------------- */

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.project-card-skeleton {
  pointer-events: none;
}

.skeleton-line {
  background: var(--color-bg-muted, #e8e8e8);
  border-radius: 4px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  margin-bottom: 10px;
}

.skeleton-title {
  height: 20px;
  width: 70%;
}

.skeleton-stage {
  height: 14px;
  width: 45%;
}

.skeleton-desc {
  height: 14px;
  width: 90%;
}

.skeleton-desc:last-of-type {
  width: 75%;
}

.skeleton-footer {
  height: 8px;
  width: 100%;
  margin-top: auto;
}

/* ---------------- 项目详情 detail-view ---------------- */

.detail-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title .badge {
  font-weight: 400;
}

.project-description {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

/* 项目归属（县区 / 行业） */
.project-attribution {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  background: var(--color-bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}
.project-attribution-edit {
  align-items: center;
}
.attribution-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.attribution-label {
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.attribution-value {
  color: var(--color-text);
  font-weight: 500;
}
.attribution-empty {
  color: var(--color-text-placeholder, #aaa);
  font-weight: 400;
}
@media (max-width: 560px) {
  .project-attribution-edit .attribution-item {
    width: 100%;
  }
}

/* 图片画廊 */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 560px) {
  .project-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.project-gallery img:hover {
  transform: scale(1.03);
}

@media (min-width: 560px) {
  .project-gallery img {
    height: 150px;
  }
}

.gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 13px;
}

.gallery-placeholder img {
  width: 60px;
  height: 60px;
  opacity: 0.4;
}

/* 非公开信息框 */
.non-public-box {
  background: linear-gradient(135deg, #fff8e6 0%, #fff4d6 100%);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}

.non-public-box::before {
  content: '🔒';
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 18px;
  opacity: 0.5;
}

.non-public-box h3 {
  color: #7a5a10;
  font-size: 0.95rem;
  margin-bottom: 8px;
  padding-right: 28px;
}

.non-public-box-content {
  font-size: 14px;
  line-height: 1.7;
  color: #5a4208;
  white-space: pre-wrap;
  word-break: break-word;
}

.non-public-box-empty {
  color: var(--color-text-muted);
  font-size: 13px;
  font-style: italic;
}

/* 非公开信息编辑历史 */
.non-public-history-container {
  margin-top: 12px;
  border-top: 1px dashed #d9b65c;
  padding-top: 8px;
}

.non-public-history-toggle {
  padding: 0;
  color: #7a5a10;
  font-size: 12px;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.non-public-history-toggle:hover {
  color: #5a4208;
}

.non-public-history-list {
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.non-public-history-item {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #e8d79a;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.non-public-history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #7a5a10;
}

.non-public-history-editor {
  font-weight: 600;
}

.non-public-history-time {
  color: #9a7a30;
  font-size: 11px;
}

.non-public-history-content {
  font-size: 13px;
  line-height: 1.6;
  color: #5a4208;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}

/* 发布动态框 */
.publish-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
}

.publish-box textarea {
  width: 100%;
  min-height: 90px;
  margin-bottom: 10px;
}

.publish-login-hint {
  text-align: center;
  padding: 24px 16px;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 14px;
}

.publish-login-hint a {
  font-weight: 500;
}

/* ---------------- 动态卡片 update-card ---------------- */

.update-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.update-card.pending {
  border-color: var(--color-warning);
  background: var(--color-warning-light);
}

.update-card.rejected {
  border-color: var(--color-danger);
  background: var(--color-danger-light);
}

.update-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 13px;
}

.update-author {
  font-weight: 500;
  color: var(--color-text);
}

.update-time {
  color: var(--color-text-muted);
  font-size: 12px;
}

.update-status-badge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.update-status-badge.pending {
  background: var(--color-warning);
  color: #fff;
}

.update-status-badge.rejected {
  background: var(--color-danger);
  color: #fff;
}

.update-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

/* 图片九宫格 */
.update-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 360px;
}

.update-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border-light);
  cursor: pointer;
}

.update-project-name {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ---------------- 图片上传 image-uploader ---------------- */

.image-uploader {
  margin-bottom: 12px;
}

.uploader-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

@media (min-width: 560px) {
  .uploader-previews {
    grid-template-columns: repeat(5, 1fr);
  }
}

.uploader-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.uploader-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploader-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.uploader-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}

.uploader-add {
  aspect-ratio: 1;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.uploader-add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.uploader-add.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.uploader-add-icon {
  font-size: 24px;
  line-height: 1;
}

.uploader-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ---------------- 地图视图 map-view（Leaflet） ---------------- */

.leaflet-map-container {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 420px;
  background: #f5f7fa;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.leaflet-map-container .leaflet-container {
  background: #f5f7fa;
  font: inherit;
}

/* 项目打点图标 */
.leaflet-pin-icon {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  transition: transform 0.15s ease;
}

.leaflet-pin-icon:hover {
  transform: scale(1.2);
  z-index: 1000;
}

.leaflet-pin-icon svg {
  width: 100%;
  height: 100%;
}

/* 隐藏项目打点（仅管理员可见）：半透明灰 */
.leaflet-pin-hidden {
  opacity: 0.55;
}

/* 地图弹窗中的已隐藏标记 */
.map-popup-hidden {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* 乡镇名标签（缩放到足够级别时显示） */
.township-label {
  background: transparent;
  border: none;
  color: #3d5a44;
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 1px 2px #fff, 0 -1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff;
  white-space: nowrap;
  pointer-events: none;
}

/* 顶点手柄（编辑器） */
.leaflet-vertex-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1f6feb;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.leaflet-vertex-icon:active {
  cursor: grabbing;
}

.leaflet-vertex-icon.draw-vertex {
  background: #1f6feb;
  border-color: #fff;
  box-shadow: 0 0 0 2px #1f6feb;
}

/* 弹出气泡 */
.map-popup {
  min-width: 160px;
  max-width: 220px;
}

.map-popup-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.map-popup-stage {
  font-size: 12px;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.map-popup-attr {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.map-popup-link {
  font-size: 13px;
  cursor: pointer;
}

.map-empty-hint {
  padding: 20px;
}

/* ---------------- 审核列表 review-view ---------------- */

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.review-item-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-item-project {
  font-weight: 500;
  color: var(--color-text);
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ---------------- 账号管理 admin-view ---------------- */

.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

.user-row-username {
  font-weight: 500;
}

.user-row-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.user-row-disabled .user-row-username {
  color: var(--color-text-muted);
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-disabled {
  background: var(--color-bg-hover, #f0f0f0);
  color: var(--color-text-muted);
}

.role-select {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  background: #fff;
  transition: all 0.15s ease;
}

.role-option input {
  margin: 0;
}

.role-option:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ---------------- toast 提示 ---------------- */

.toast-container {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: 92vw;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 100%;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  font-weight: 700;
  font-size: 15px;
}

.toast-info { border-left: 3px solid var(--color-info); }
.toast-info .toast-icon { color: var(--color-info); }
.toast-success { border-left: 3px solid var(--color-success); }
.toast-success .toast-icon { color: var(--color-success); }
.toast-error { border-left: 3px solid var(--color-danger); }
.toast-error .toast-icon { color: var(--color-danger); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-warning .toast-icon { color: var(--color-warning); }

/* ---------------- 模态框 ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 41, 47, 0.45);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 0.15s ease;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  max-width: 420px;
  width: 100%;
  animation: pop-in 0.18s ease;
}

.modal-title {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.modal-message {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 驳回理由输入弹窗 */
.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  animation: pop-in 0.18s ease;
  overflow: hidden;
}
.modal-dialog .modal-header {
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--color-border-light);
}
.modal-dialog .modal-header h3 {
  font-size: 1.05rem;
  margin: 0;
}
.modal-dialog .modal-body {
  padding: 16px 20px;
}
.modal-dialog .modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 导航栏待审核数量徽标 */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  background: var(--color-danger, #d32f2f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  vertical-align: middle;
}

/* 动态卡片驳回理由 */
.update-reject-reason {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(211, 47, 47, 0.08);
  border-left: 3px solid var(--color-danger, #d32f2f);
  border-radius: var(--radius-sm, 4px);
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.update-reject-reason-label {
  font-weight: 600;
  color: var(--color-danger, #d32f2f);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------------- 图片预览灯箱 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ---------------- 表单错误提示 ---------------- */

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-danger);
}

.input-error {
  border-color: var(--color-danger) !important;
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(217, 54, 62, 0.15) !important;
}

/* ---------------- 角色徽章 ---------------- */

.role-admin { background: var(--role-admin-bg); color: var(--role-admin-fg); }
.role-enterprise { background: var(--role-enterprise-bg); color: var(--role-enterprise-fg); }
.role-government { background: var(--role-government-bg); color: var(--role-government-fg); }
.role-public { background: var(--role-public-bg); color: var(--role-public-fg); }

/* ---------------- 地图编辑器布局 ---------------- */

.map-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .map-editor {
    grid-template-columns: 1fr 300px;
  }
}

.map-editor-area {
  min-width: 0;
}

/* 编辑器画布在绘制模式下使用十字光标 */
.map-editor-canvas.leaflet-map-container {
  height: 70vh;
  min-height: 420px;
}

/* 控制面板 */
.map-editor-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  max-height: 70vh;
  overflow-y: auto;
}

.panel-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.panel-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.editor-mode-row {
  display: flex;
  gap: 6px;
}

.editor-mode-row .btn {
  flex: 1;
}

.panel-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 6px 0;
}

.form-control-sm {
  padding: 5px 8px;
  font-size: 13px;
}

/* 区域列表 */
.region-row {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
  background: #fff;
}

.region-row.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}

.region-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}

.region-row-header:hover {
  background: var(--color-bg-hover);
}

.region-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------------- 编辑功能样式 ---------------- */

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 13px;
}

.btn-link:hover:not(:disabled) {
  text-decoration: underline;
}

.btn-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 项目配图编辑 */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.gallery-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-remove {
  opacity: 1;
}

/* 动态编辑 */
.update-edit-btn {
  margin-left: auto;
}

.update-image-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.update-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.update-image-item:hover .update-image-remove {
  opacity: 1;
}

/* ---------------- 项目编辑权限设置 ---------------- */

/* 账号列表：折叠标题 + 滚动区域 */
.section-header-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-list-scroll {
  margin-top: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.user-list-scroll .form-control {
  margin-bottom: 10px;
}

/* 权限面板：手风琴 */
.perm-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.perm-item {
  padding: 0;
  overflow: hidden;
}

.perm-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.perm-item-header:hover {
  background: var(--color-bg-hover);
}

/* 手风琴项右侧操作区（可见性切换 + 已授权计数） */
.perm-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.perm-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.perm-item-arrow {
  display: inline-block;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}

.perm-item.open .perm-item-arrow {
  transform: rotate(90deg);
}

.perm-item-body {
  padding: 4px 14px 12px;
  border-top: 1px solid var(--color-border-light);
}

.perm-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.perm-search {
  flex: 1 1 160px;
  max-width: 260px;
}

.perm-users-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

.project-perm-name {
  font-weight: 500;
  font-size: 15px;
}

.project-perm-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
}

.project-perm-user input[type="checkbox"] {
  cursor: pointer;
}

.update-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.region-row-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-row-vertices {
  font-size: 11px;
  color: var(--color-text-muted);
}

.region-edit {
  padding: 8px 10px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.region-edit .form-control-sm {
  flex: 1;
  min-width: 80px;
}

.color-input {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

/* 放置打点模式 — 地图光标 */
.leaflet-container.placing,
.leaflet-container.placing .leaflet-interactive {
  cursor: crosshair !important;
}

/* 放置中提示条（面板顶部醒目区） */
.placing-hint {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.placing-hint-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #8a6d1f;
  font-weight: 500;
}

.placing-hint .state-icon {
  font-size: 18px;
  line-height: 1;
}

/* 未标注项目列表 */
.unpinned-list {
  margin-top: 8px;
}

.unpinned-title {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.place-pin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle, #f6f8fa);
  margin-bottom: 4px;
}

.place-pin-name {
  font-size: 13px;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 数据导入/导出 ---------------- */

.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--color-bg);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: var(--color-success);
  background: var(--color-success-light);
}

.drop-zone-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.drop-zone-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.drop-zone-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.import-result {
  margin-top: 16px;
}

.import-summary {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--color-bg-card);
}

.import-summary.has-warnings {
  border-color: var(--color-warning);
}

.import-summary-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-box {
  text-align: center;
  flex: 1;
  min-width: 64px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.stat-success .stat-value { color: var(--color-success); }
.stat-info .stat-value { color: var(--color-primary); }
.stat-danger .stat-value { color: var(--color-danger); }
.stat-muted .stat-value { color: var(--color-text-muted); }

.import-error-list {
  margin-top: 12px;
  padding: 12px 16px 12px 32px;
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-danger);
  max-height: 200px;
  overflow-y: auto;
}

.import-error-list li {
  margin-bottom: 4px;
}
