:root {
  --bg: #070b12;
  --card: #0d1420;
  --card-soft: #111a28;
  --ink: #dce7f5;
  --muted: #93a4b8;
  --brand: #3b82f6;
  --brand-deep: #60a5fa;
  --line: #223047;
  --line-strong: #33435c;
  --good: #22c55e;
  --danger: #f87171;
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.28);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0, rgba(7, 11, 18, 0) 220px),
    var(--bg);
}

button, input, select, textarea { font: inherit; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.back {
  color: var(--brand-deep);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.breadcrumb {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.maint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.maint-btn {
  font-size: 12px;
  padding: 8px 12px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

h1 { margin: 0; font-size: 28px; }

.desc {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.config-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--brand-deep);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.config-tab.active {
  background: var(--brand-deep);
  color: #fff;
  border-color: var(--brand-deep);
}

.section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--card-soft);
  outline: none;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.city-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

.city-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.city-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.city-filter {
  min-width: 150px;
  margin: 0;
}

.city-filter span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.city-search,
.city-tools select,
.batch-bar select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--card-soft);
  outline: none;
}

.city-search {
  flex: 1;
  min-width: 160px;
}

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line) !important;
  border-bottom: 0 !important;
  border-radius: 8px 8px 0 0 !important;
  background: var(--card-soft) !important;
  box-shadow: none !important;
}

.batch-select,
.batch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-bar label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
}

.batch-bar input[type="checkbox"],
.row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.batch-count {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.batch-bar select {
  width: 142px;
  min-height: 38px;
  padding: 8px 10px;
}

.batch-bar .ghost-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.city-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.check-col {
  width: 42px;
  text-align: center;
}

.empty-cell {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 8px 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 0;
  border: 0;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: rgba(154, 83, 37, 0.07);
}

tr:last-child td { border-bottom: 0; }

td input, td select {
  width: 100%;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--card-soft);
  outline: none;
}

td input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}

.ghost-btn {
  background: var(--card-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-btn {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.32);
  padding: 8px 10px;
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.status.good { color: var(--good); }
.status.error { color: var(--danger); }

/* 城市管理：主操作行 / 脏行标记 / 开通弹窗 */
.city-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.city-actions .ghost-btn {
  padding: 9px 14px;
  font-size: 13px;
}

tr.dirty td {
  background: rgba(251, 191, 36, 0.07);
}

tr.dirty td:first-child {
  box-shadow: inset 3px 0 0 #fbbf24;
}

.city-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 12, 0.62);
  backdrop-filter: blur(2px);
}

.city-modal {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.city-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.city-modal-title {
  font-size: 17px;
  font-weight: 800;
}

.city-modal-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}

.city-modal-search {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--card-soft);
  outline: none;
}

.city-modal-list {
  margin-top: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.city-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
}

.city-modal-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.city-modal-item-main strong { font-size: 14px; }

.city-modal-item-main span {
  font-size: 12px;
  color: var(--muted);
}

.city-modal-item-actions {
  display: flex;
  gap: 8px;
}

.city-modal-item-actions button {
  padding: 7px 12px;
  font-size: 12px;
}

.city-modal-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .batch-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-select,
  .batch-controls {
    width: 100%;
  }

  .batch-controls {
    flex-wrap: nowrap;
  }

  .batch-controls select,
  .batch-controls button {
    flex: 1;
    min-width: 0;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}
