:root {
  color-scheme: light;
  --bg: #f6f8ff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: #eef3ff;
  --text: #121827;
  --muted: #667085;
  --line: rgba(20, 28, 48, 0.12);
  --primary: #0b57d0;
  --primary-ink: #ffffff;
  --danger: #c5221f;
  --ok: #16794c;
  --shadow: 0 24px 80px rgba(31, 41, 55, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --toolbar-h: 72px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(116, 119, 255, .18), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(11, 87, 208, .16), transparent 24rem),
    radial-gradient(circle at 75% 92%, rgba(52, 211, 153, .15), transparent 26rem),
    var(--bg);
  overflow: hidden;
}

button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }

.app-shell { min-height: 100vh; }
.route-app {
  display: grid;
  grid-template-rows: var(--toolbar-h) 1fr;
  height: 100vh;
  padding: 14px;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 12px 40px rgba(31,41,55,.09);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.brand-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: white;
  background:
    linear-gradient(135deg, var(--primary), #8b1dce 70%),
    var(--primary);
  box-shadow: 0 16px 32px rgba(11, 87, 208, .25);
}
.brand h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.toolbar-actions, .mini-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.main-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr) 344px;
  gap: 14px;
}

.panel, .canvas-card {
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.18);
  box-shadow: var(--shadow);
  min-height: 0;
}
.panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}
.panel-title { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: -.01em; }
.panel-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-scroll { overflow: auto; padding: 0 18px 18px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(255,255,255,.62);
  margin-bottom: 12px;
}
.card.compact { padding: 10px; }
.card h3 { margin: 0 0 10px; font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  transition: .18s transform, .18s background, .18s box-shadow;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); background: white; box-shadow: 0 12px 22px rgba(31,41,55,.08); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { color: var(--primary-ink); border-color: transparent; background: var(--primary); box-shadow: 0 14px 26px rgba(11,87,208,.2); }
.btn.tonal { background: #edf3ff; color: #0b57d0; border-color: transparent; }
.btn.danger { background: #fff0f0; color: var(--danger); border-color: rgba(197,34,31,.12); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.btn.square { width: 42px; padding: 0; }

.icon { width: 18px; height: 18px; display: inline-block; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  min-height: 94px;
  text-align: left;
  background: rgba(255,255,255,.58);
  transition: .18s transform, .18s background, .18s border-color;
}
.tool-card:hover { transform: translateY(-2px); background: #fff; }
.tool-card.active { border-color: var(--primary); background: #eef4ff; }
.tool-card b { display: block; margin: 9px 0 3px; }
.tool-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.list { display: grid; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(255,255,255,.52);
  text-align: left;
}
.item:hover { background: white; }
.item.active { border-color: var(--primary); background: #eef4ff; }
.item-main { min-width: 0; flex: 1; }
.item-title { font-size: 13px; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--muted); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 20px; height: 20px; border-radius: 10px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.75); flex: 0 0 auto; }
.dot { width: 14px; height: 14px; border-radius: 999px; border: 3px solid var(--primary); background: white; flex: 0 0 auto; }

.canvas-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
}
.canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}
.title-edit { min-width: 0; }
.title-edit input {
  width: min(520px, 58vw);
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -.035em;
}
.title-edit textarea {
  display: block;
  width: min(560px, 62vw);
  margin-top: 3px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.canvas-wrap {
  min-height: 0;
  margin: 0 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: var(--map-bg, #f5faff);
  position: relative;
}
#mapSvg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  touch-action: none;
  user-select: none;
}
.svg-bg { fill: var(--map-bg, #f5faff); }
.grid-line { stroke: currentColor; opacity: .075; stroke-width: 1; }
.backdrop-river { fill: #d6ecf7; opacity: .92; }
.backdrop-road { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.backdrop-road.major { stroke: #dfd2bf; stroke-width: 10; opacity: .68; }
.backdrop-road.minor { stroke: #e9e2d6; stroke-width: 5; opacity: .95; }
.backdrop-label { fill: #6f746f; font-size: 13px; font-weight: 800; opacity: .82; pointer-events:none; }
.route-halo { stroke: white; stroke-linecap: round; stroke-linejoin: round; opacity: .94; fill: none; }
.route-line { stroke-linecap: round; stroke-linejoin: round; fill: none; }
.route-rail-inner { stroke-linecap: round; stroke-linejoin: round; fill: none; opacity: .92; }
.station-node { cursor: grab; transition: filter .15s; }
.station-node:active { cursor: grabbing; }
.station-node.selected { filter: drop-shadow(0 8px 12px rgba(11,87,208,.28)); }
.station-label { font-weight: 900; letter-spacing: -.02em; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.canvas-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px 16px;
  color: var(--muted);
  font-size: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.64);
  border: 1px solid var(--line);
  font-weight: 750;
}

.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: 0;
  padding: 11px 13px;
  color: var(--text);
  background: rgba(255,255,255,.7);
  transition: .16s border-color, .16s box-shadow, .16s background;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 5px rgba(11,87,208,.1);
}
.textarea { resize: vertical; min-height: 78px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 3px solid white;
  box-shadow: 0 0 0 1px var(--line), 0 8px 18px rgba(31,41,55,.1);
}
.color-btn.active { box-shadow: 0 0 0 3px var(--primary), 0 8px 18px rgba(31,41,55,.12); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 10px;
  border: 0;
  border-bottom: 1px solid rgba(20,28,48,.07);
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.switch-row:hover { background: rgba(11,87,208,.06); }
.switch-row:last-child { border-bottom: 0; }
.switch-text { min-width: 0; }
.switch-text b { display: block; font-size: 13px; line-height: 1.25; }
.switch-text span { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 2px; }
.toggle {
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #d5dbe8;
  flex: 0 0 auto;
  transition: .18s background;
}
.toggle::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 4px;
  top: 4px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  transition: .18s transform;
}
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(20px); }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-btn {
  min-height: 66px;
  border-radius: 22px;
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
  background: rgba(255,255,255,.55);
  overflow: hidden;
}
.theme-btn.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.theme-preview { height: 22px; border-radius: 999px; margin-bottom: 7px; display: flex; overflow: hidden; }
.theme-preview span { flex: 1; }
.theme-btn b { font-size: 12px; display:block; }
.theme-btn small { display:block; margin-top:4px; color: var(--muted); font-size: 10px; font-weight: 800; }

.station-route-list { display: grid; gap: 8px; }
.route-station {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 16px;
  padding: 7px 7px 7px 10px;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--line);
}
.route-index { color: var(--muted); font-size: 11px; font-weight: 900; }
.route-station b { font-size: 12px; }

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 40;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: min(460px, 88vw);
  padding: 13px 16px;
  border-radius: 20px;
  color: white;
  background: rgba(18,24,39,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  font-weight: 760;
  animation: toastIn .22s ease both;
}
.toast.ok { background: rgba(22,121,76,.94); }
.toast.err { background: rgba(197,34,31,.94); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(9, 13, 24, .35);
  backdrop-filter: blur(10px);
}
.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.62);
  background: rgba(255,255,255,.9);
  box-shadow: 0 30px 90px rgba(0,0,0,.25);
}
.modal-head, .modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 0 18px 18px; overflow: auto; max-height: 520px; }
.codebox {
  width: 100%; min-height: 280px; resize: vertical;
  border: 1px solid var(--line); border-radius: 22px; padding: 14px;
  background: #0d111a; color: #e6edf8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px;
}

.empty { color: var(--muted); font-size: 13px; line-height: 1.65; padding: 14px; border: 1px dashed var(--line); border-radius: 20px; background: rgba(255,255,255,.42); }
.hidden-file { display: none; }

@media (max-width: 1180px) {
  body { overflow: auto; }
  .route-app { height: auto; min-height: 100vh; }
  .main-grid { grid-template-columns: 1fr; }
  .panel { max-height: none; }
  #mapSvg { min-height: 520px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
}

@media (max-width: 640px) {
  .route-app { padding: 10px; gap: 10px; }
  .topbar, .panel, .canvas-card { border-radius: 24px; }
  .brand { min-width: 0; }
  .brand h1 { font-size: 16px; }
  .btn { min-height: 40px; padding-inline: 12px; }
  .tool-grid, .theme-grid, .form-row { grid-template-columns: 1fr; }
  .canvas-head, .canvas-foot { flex-direction: column; align-items: stretch; }
  .title-edit input, .title-edit textarea { width: 100%; }
  #mapSvg { min-height: 430px; }
}

/* SSO + custom app icon */
a.btn { text-decoration: none; }
.brand-badge.image { overflow: hidden; background: #fff; padding: 0; }
.brand-badge.image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 320px;
  padding: 7px 8px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.66);
}
.auth-card.guest { min-width: 300px; }
.auth-card .avatar {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  object-fit: cover;
  background: white;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 18px rgba(31,41,55,.10);
  flex: 0 0 auto;
}
.auth-copy { min-width: 0; flex: 1; display: grid; line-height: 1.22; }
.auth-copy b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; height: auto; }
  .auth-card { margin-left: auto; }
  .route-app { grid-template-rows: auto 1fr; }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .route-app { min-height: 100vh; height: auto; }
  .auth-card, .auth-card.guest { width: 100%; max-width: none; min-width: 0; }
  .toolbar-actions { width: 100%; overflow: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}

/* v1.3: My projects + merged export */
.modal-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
}
.tab-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.62);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}
.tab-btn.active {
  color: var(--primary-ink);
  background: var(--primary);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(11,87,208,.16);
}
.small-modal { width: min(560px, calc(100vw - 32px)); }
.export-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.export-card {
  min-height: 128px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(238,243,255,.72));
  padding: 18px;
  text-align: left;
  color: var(--text);
  transition: .18s transform, .18s box-shadow, .18s border-color;
}
.export-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 18px 34px rgba(31,41,55,.10);
}
.export-card b {
  display: block;
  font-size: 22px;
  letter-spacing: -.03em;
}
.export-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .export-grid { grid-template-columns: 1fr; }
  .modal-tabs { overflow: auto; }
}

/* v1.4: 独立“我的项目”页面 */
body.my-page-body {
  overflow: auto;
}
.my-app-shell {
  min-height: 100vh;
}
.my-app {
  min-height: 100vh;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}
.my-topbar {
  min-height: var(--toolbar-h);
}
.my-main {
  display: grid;
  gap: 14px;
}
.my-hero,
.library-panel {
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.18);
  box-shadow: var(--shadow);
}
.my-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: clamp(18px, 3vw, 34px);
  position: relative;
  overflow: hidden;
}
.my-hero::before {
  content: "";
  position: absolute;
  inset: -40% -15% auto auto;
  width: 460px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(11,87,208,.18), transparent 65%);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0b57d0;
  background: #edf3ff;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 12px;
}
.my-hero h2 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(26px, 4.2vw, 52px);
  line-height: 1.04;
  letter-spacing: -.055em;
}
.my-hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 14px;
}
.my-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
}
.my-stats div {
  min-height: 96px;
  padding: 16px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.62);
}
.my-stats b {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  letter-spacing: -.03em;
}
.my-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.library-panel {
  padding: 18px;
}
.library-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.my-tabs {
  padding: 0;
}
.tab-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(440px, 100%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
}
.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.project-grid,
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.project-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(238,243,255,.54));
  box-shadow: 0 12px 28px rgba(31,41,55,.06);
  transition: .18s transform, .18s box-shadow, .18s border-color;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11,87,208,.35);
  box-shadow: 0 18px 42px rgba(31,41,55,.10);
}
.project-card-top {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.project-avatar {
  width: 52px;
  height: 52px;
  border-radius: 20px;
  object-fit: cover;
  flex: 0 0 auto;
  background: white;
  border: 2px solid rgba(255,255,255,.88);
  box-shadow: 0 10px 20px rgba(31,41,55,.08);
}
.project-title-wrap {
  min-width: 0;
}
.project-title-wrap h3 {
  margin: 2px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  letter-spacing: -.025em;
}
.project-title-wrap p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-meta {
  display: grid;
  gap: 6px;
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}
.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.my-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
}
.delete-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(197,34,31,.14);
  background: #fff0f0;
  color: var(--danger);
  font-weight: 900;
  line-height: 1.7;
}
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.54);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: skeletonMove 1.3s infinite;
}
@keyframes skeletonMove {
  to { transform: translateX(100%); }
}
@media (max-width: 1180px) {
  .project-grid,
  .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .my-app { padding: 10px; }
  .library-head { align-items: stretch; flex-direction: column; }
  .project-grid,
  .skeleton-grid { grid-template-columns: 1fr; }
  .my-stats { grid-template-columns: 1fr; }
  .my-hero h2 { font-size: 30px; }
}


/* v1.7: 高铁路线图主题 + 手机版优化 */
@media (max-width: 900px) {
  .route-app { grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .topbar { position: sticky; top: 8px; z-index: 12; }
  .toolbar-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .toolbar-actions .btn, .toolbar-actions a.btn { min-width: 0; width: 100%; padding-inline: 10px; }
  .toolbar-actions .btn .icon, .toolbar-actions a.btn .icon { width: 16px; height: 16px; }
  .canvas-wrap { min-height: 58vh; }
  #mapSvg { min-height: 58vh; }
  .panel-header { padding: 16px 16px 10px; }
  .panel-scroll { padding: 0 16px 16px; }
  .card { padding: 12px; }
  .canvas-head { padding: 14px 14px 8px; }
  .canvas-foot { padding: 8px 14px 14px; }
}

@media (max-width: 720px) {
  :root { --toolbar-h: auto; }
  .topbar { gap: 12px; padding: 12px; border-radius: 22px; }
  .brand { width: 100%; }
  .brand-badge { width: 44px; height: 44px; border-radius: 16px; }
  .toolbar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-actions .btn, .toolbar-actions a.btn { font-size: 12px; min-height: 42px; }
  .auth-card, .auth-card.guest { width: 100%; max-width: none; min-width: 0; }
  .main-grid { gap: 10px; }
  .canvas-card, .panel { border-radius: 22px; }
  .canvas-head, .canvas-foot { flex-direction: column; align-items: stretch; }
  .canvas-head .mini-actions, .canvas-foot .mini-actions { width: 100%; }
  .canvas-foot .mini-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .canvas-foot .mini-actions .btn { width: 100%; min-width: 0; }
  .status-pill { width: 100%; justify-content: center; text-align: center; }
  .title-edit input { font-size: 18px; }
  .title-edit textarea { font-size: 12px; }
  .switch-row { padding: 12px; min-height: 60px; }
  .switch-text b { font-size: 14px; }
  .switch-text span { font-size: 12px; }
  .tool-grid, .theme-grid, .form-row { grid-template-columns: 1fr; }
  .theme-grid { gap: 10px; }
  .route-station { grid-template-columns: 24px 1fr; }
  .route-station .mini-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .my-topbar .toolbar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-hero { padding: 18px; }
  .my-hero p { font-size: 13px; line-height: 1.65; }
  .library-panel { padding: 14px; }
}

@media (max-width: 420px) {
  .toolbar-actions { grid-template-columns: 1fr 1fr; }
  .canvas-foot .mini-actions { grid-template-columns: 1fr; }
  .btn { gap: 6px; }
  .modal { width: min(100vw - 16px, 760px); border-radius: 26px; }
}

/* v1.8: 会员/CDK后台 + 项目限制提示 */
.member-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(237,243,255,.72));
  backdrop-filter: blur(24px) saturate(1.18);
  box-shadow: var(--shadow);
}
.member-panel h3 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.member-panel p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.member-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.member-form .input { width: min(420px, 60vw); }
.admin-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px auto auto;
  gap: 12px;
  align-items: end;
}
.admin-panel .codebox { margin-top: 14px; min-height: 150px; }
.table-wrap { width: 100%; overflow: auto; border-radius: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.58); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid rgba(20,28,48,.08); font-size: 13px; }
.admin-table th { color: var(--muted); font-weight: 900; background: rgba(237,243,255,.72); }
.admin-table code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 900; color: var(--primary); }
.admin-app .my-hero h2 { max-width: 720px; }
@media (max-width: 860px) {
  .member-panel { grid-template-columns: 1fr; }
  .member-form { justify-content: stretch; }
  .member-form .input, .member-form .btn, .member-form a.btn { width: 100%; }
  .admin-form { grid-template-columns: 1fr; }
}

/* v1.8: 中国大陆高铁/铁路示意图视觉 */
.theme-backdrop { pointer-events: none; }
.backdrop-paper { fill: #f6f1e9; }
.route-rail-main { stroke: #111; }
.route-rail-dash { stroke-linecap: butt; opacity: .98; }
[data-tool="pan"].active, .canvas-wrap:has(#mapSvg) { }


/* v1.8.3: “我的”页面紧凑重写，减少大面积空白 */
.my-app-compact {
  gap: 10px;
  padding: 10px;
}
.compact-topbar {
  min-height: 62px;
  padding: 8px 10px 8px 12px;
  border-radius: 24px;
}
.compact-topbar .brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 16px;
}
.compact-topbar .brand h1 {
  font-size: 18px;
}
.compact-topbar .brand p {
  font-size: 11px;
}
.compact-my-main {
  gap: 10px;
}
.my-dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(210px, .7fr) minmax(360px, 1fr);
  gap: 10px;
}
.dashboard-card {
  min-height: 116px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(1.12);
  box-shadow: 0 10px 34px rgba(31,41,55,.08);
}
.dash-card-head {
  display: grid;
  gap: 8px;
}
.dash-card-head b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.04em;
}
.dash-chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: #0b57d0;
  background: #edf3ff;
  font-size: 11px;
  font-weight: 900;
}
.dashboard-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.member-card .member-form.compact {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  justify-content: stretch;
}
.member-card .member-form.compact .input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
}
.compact-library-panel {
  padding: 14px;
  border-radius: 26px;
}
.compact-library-head {
  margin-bottom: 12px;
}
.compact-search-box {
  min-width: min(380px, 100%);
  padding: 6px 10px;
}
.compact-search-box input {
  font-size: 13px;
}
.project-grid,
.skeleton-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}
.project-card {
  min-height: 150px;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
}
.project-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
}
.project-title-wrap h3 {
  font-size: 15px;
  margin-bottom: 4px;
}
.project-title-wrap p {
  -webkit-line-clamp: 1;
  line-height: 1.45;
}
.project-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font-size: 11px;
}
.project-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-actions .btn {
  min-height: 32px;
}
.my-empty {
  min-height: 96px;
}

@media (max-width: 1180px) {
  .my-dashboard {
    grid-template-columns: 1fr 1fr;
  }
  .member-card {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .my-app-compact { padding: 8px; }
  .compact-topbar { position: sticky; top: 8px; z-index: 12; }
  .my-dashboard { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 0; padding: 12px; border-radius: 20px; }
  .dash-card-head b { font-size: 20px; }
  .member-card .member-form.compact { grid-template-columns: 1fr; }
  .member-card .member-form.compact .btn,
  .member-card .member-form.compact a.btn { width: 100%; }
  .compact-library-head { flex-direction: column; align-items: stretch; }
  .project-grid,
  .skeleton-grid { grid-template-columns: 1fr; }
  .project-meta { grid-template-columns: 1fr; }
}
