:root {
  /* 白黑红配色 - 浅色模式 */
  --md-surface: #ffffff;
  --md-surface-container: #f8f8f8;
  --md-surface-container-high: #f0f0f0;
  --md-primary: #e74c3c;
  --md-primary-container: #ffebe9;
  --md-on-surface: #1a1a1a;
  --md-outline: #cccccc;
  --md-shadow: rgba(0, 0, 0, 0.1);
  --md-secondary-container: #fef0ef;
  --md-outline-variant: #e0e0e0;
  
  --red-1: #ffcdc9;
  --red-2: #ff9e96;
  --red-3: #ff6b5c;
  --red-4: #e74c3c;
  --red-5: #c0392b;

  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}

:root[data-theme='dark'] {
  /* 白黑红配色 - 深色模式 */
  --md-surface: #0a0a0a;
  --md-surface-container: #141414;
  --md-surface-container-high: #1f1f1f;
  --md-primary: #e74c3c;
  --md-primary-container: #3a1a15;
  --md-on-surface: #f0f0f0;
  --md-outline: #3a3a3a;
  --md-shadow: rgba(0, 0, 0, 0.5);
  --md-secondary-container: #2a1512;
  --md-outline-variant: #2a2a2a;
  
  --red-1: #3a1a15;
  --red-2: #5c2820;
  --red-3: #8a3a2e;
  --red-4: #e74c3c;
  --red-5: #ff6b5c;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --md-surface: #0a0a0a;
    --md-surface-container: #141414;
    --md-surface-container-high: #1f1f1f;
    --md-primary: #e74c3c;
    --md-primary-container: #3a1a15;
    --md-on-surface: #f0f0f0;
    --md-outline: #3a3a3a;
    --md-shadow: rgba(0, 0, 0, 0.5);
    --md-secondary-container: #2a1512;
    --md-outline-variant: #2a2a2a;
    
    --red-1: #3a1a15;
    --red-2: #5c2820;
    --red-3: #8a3a2e;
    --red-4: #e74c3c;
    --red-5: #ff6b5c;
    color-scheme: dark;
  }
}

:root[data-theme='light'] {
  color-scheme: light;
}

/* ================== 基础重置 ================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--md-surface);
  font-family: "Noto Sans SC", "Noto Sans CJK SC", "Noto Sans CJK", sans-serif;
  color: var(--md-on-surface);
}

body {
  transition: background 220ms ease, color 220ms ease;
}

.seo-header {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================== 滚动条 ================== */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--red-3) var(--md-surface-container);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--md-surface-container);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--red-2), var(--red-4));
  border: 3px solid var(--md-surface-container);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--red-3), var(--red-5));
}

/* ================== 地图核心 ================== */
#map {
  position: relative;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

#mapSvg {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

#mapSvg * {
  -webkit-tap-highlight-color: transparent;
}

.province {
  fill: var(--red-1) !important;
  stroke: #ffffff;
  stroke-width: 1.1;
  cursor: pointer;
  transition: fill 0.2s ease, stroke-width 0.2s ease;
  outline: none !important;
}

.province:hover {
  fill: var(--red-4) !important;
}

.province.selected {
  fill: var(--md-primary) !important;
  stroke: #ffffff;
  stroke-width: 1.8;
}

/* ================== 全局 UI 组件 ================== */
#siteFooter {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 90;
  font-size: 12px;
  transition: transform 320ms var(--ease-spring), opacity 220ms ease;
}

#siteFooter a {
  color: var(--md-primary);
  text-decoration: none;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  border-radius: 999px;
  padding: 4px 10px;
}

#siteFooter.site-footer-hidden {
  opacity: 0;
  transform: translate(-50%, 32px);
  pointer-events: none;
}

#tooltip {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  z-index: 30;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--md-surface-container-high);
  border: 1px solid var(--md-outline);
  color: var(--md-on-surface);
  font-size: 12px;
  box-shadow: 0 4px 12px var(--md-shadow);
}

.md3-card {
  position: absolute;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline-variant);
  border-radius: 24px;
  padding: 16px 18px;
  box-shadow: 0 2px 6px var(--md-shadow), 0 8px 24px rgba(231, 76, 60, 0.1);
  backdrop-filter: blur(12px);
}

.card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--md-primary);
}

.card-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--md-on-surface);
}

.card-value {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--md-primary);
}

/* ================== 按钮与表单 ================== */
.md3-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  background: var(--md-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(231, 76, 60, 0.25);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.md3-btn:hover {
  background: var(--red-5);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.35);
}

.md3-btn:active {
  transform: translateY(1px) scale(0.99);
}

.md3-btn:focus-visible {
  outline: 3px solid rgba(231, 76, 60, 0.28);
  outline-offset: 2px;
}

.md3-btn-tonal {
  color: var(--md-on-surface);
  background: var(--md-secondary-container);
}

.md3-btn-tonal:hover {
  background: var(--red-1);
}

.md3-input,
.md3-select {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  color: var(--md-on-surface);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
}

.md3-input:focus,
.md3-select:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

.md3-switch {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.md3-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.md3-switch-track {
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--md-surface-container-high);
  border: 2px solid var(--md-outline);
  display: inline-flex;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  transition: background 220ms var(--ease-standard), border-color 220ms var(--ease-standard);
}

.md3-switch-thumb {
  position: absolute;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--md-outline);
  box-shadow: none;
  transition: transform 220ms var(--ease-standard), width 220ms var(--ease-standard), height 220ms var(--ease-standard), background 220ms var(--ease-standard);
}

.md3-switch:hover .md3-switch-track {
  border-color: var(--md-on-surface);
}

.md3-switch:hover .md3-switch-thumb {
  background: var(--md-on-surface);
}

.md3-switch:active .md3-switch-thumb {
  width: 28px;
}

.md3-switch input:checked + .md3-switch-track {
  background: var(--md-primary);
  border-color: var(--md-primary);
}

.md3-switch input:checked + .md3-switch-track .md3-switch-thumb {
  transform: translateX(16px);
  width: 24px;
  height: 24px;
  background: var(--md-surface);
}

.md3-switch:hover input:checked + .md3-switch-track {
  border-color: var(--md-primary);
  background: var(--md-primary);
}

.md3-switch:hover input:checked + .md3-switch-track .md3-switch-thumb {
  background: var(--md-surface-container);
}

.md3-switch:active input:checked + .md3-switch-track .md3-switch-thumb {
  width: 28px;
  transform: translateX(12px);
}

.md3-switch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-on-surface);
}

/* ================== 介绍卡片 ================== */
#introCard {
  top: 16px;
  left: 16px;
  transition: transform 380ms var(--ease-spring), box-shadow 220ms ease;
}

#introCard.collapsed {
  transform: translateX(calc(-100% + 58px));
}

#introCard.collapsed .card-title,
#introCard.collapsed .card-body,
#introCard.collapsed .gpl-text {
  opacity: 0;
  pointer-events: none;
}

#introCard .card-title {
  font-size: 22px;
  line-height: 1.15;
  margin-bottom: 10px;
}

#introLogo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2px 0 10px;
}

#introCounter {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
}

#introCard .card-body {
  font-size: 19px;
  line-height: 1.55;
}

.intro-action-btn,
.intro-expand-btn {
  position: absolute;
  top: 10px;
  border: 1px solid var(--md-outline);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
}

.intro-action-btn {
  right: 10px;
  background: var(--md-surface-container-high);
  color: var(--md-primary);
}

.intro-expand-btn {
  right: 8px;
  background: var(--md-primary);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
}

#introCard.collapsed .intro-action-btn {
  opacity: 0;
  pointer-events: none;
}

#introCard.collapsed .intro-expand-btn {
  opacity: 1;
  pointer-events: auto;
}

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

.github-link,
.feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid var(--md-outline);
  padding: 8px 10px;
  color: var(--md-on-surface);
  background: var(--md-surface-container);
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
}

.github-link img {
  width: 18px;
  height: 18px;
}

.github-link:hover,
.feedback-link:hover {
  background: var(--md-surface-container-high);
}

/* ================== 列表侧边栏 ================== */
#selectedCard {
  top: 16px;
  right: 16px;
  text-align: left;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  transition: height 460ms var(--ease-spring), box-shadow 320ms var(--ease-spring);
}

.mobile-sheet-handle {
  display: none;
}

.mobile-sheet-bar {
  display: block;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--md-primary) 32%, transparent);
  margin: 0 auto 8px;
}

#selectedCard.switching {
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(231, 76, 60, 0.2), 0 10px 28px rgba(231, 76, 60, 0.12);
}

.side-toggle-btn {
  position: absolute;
  z-index: 22;
  top: 22px;
  right: 392px;
  height: 44px;
  min-width: 72px;
  border: 1px solid var(--md-outline);
}

.secondary-toggle-btn {
  top: 74px;
}

.tertiary-toggle-btn {
  top: 126px;
}

/* ================== 日历模态框 ================== */
.calendar-modal,
.event-poster-modal {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms var(--ease-spring), visibility 260ms step-end;
}

.calendar-modal.open,
.event-poster-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 260ms var(--ease-spring), visibility 0ms;
}

.calendar-modal-card,
.event-poster-card {
  position: relative;
  width: min(92vw, 760px);
  max-height: min(86vh, 760px);
  overflow: hidden;
  border-radius: 20px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  padding: 18px;
  transform: translateY(16px) scale(0.92);
  opacity: 0;
  transition: transform 320ms var(--ease-spring), opacity 240ms ease, height 380ms var(--ease-spring);
  will-change: transform, opacity, height;
}

.calendar-modal-card.resizing {
  overflow: hidden;
}

.calendar-modal-scroll,
.event-poster-scroll {
  max-height: calc(min(86vh, 760px) - 20px);
  overflow: auto;
  padding-right: 4px;
  border-radius: 16px;
}

.calendar-modal.open .calendar-modal-card,
.event-poster-modal.open .event-poster-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.calendar-modal-close,
.event-poster-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: var(--md-surface-container-high);
  color: var(--md-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.calendar-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  margin-bottom: 14px;
}

.calendar-nav-btn {
  height: 36px;
  border: 1px solid var(--md-outline);
  border-radius: 999px;
  background: var(--md-surface);
  color: var(--md-primary);
  font-size: 20px;
  cursor: pointer;
}

.calendar-title,
.event-poster-title {
  margin: 0;
  text-align: center;
  color: var(--md-primary);
  font-size: 20px;
  font-weight: 700;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.calendar-weekday,
.calendar-cell {
  min-height: 58px;
  border-radius: 14px;
  display: grid;
  justify-items: center;
}

.calendar-weekday {
  min-height: 32px;
  font-size: 12px;
  color: var(--md-primary);
  font-weight: 700;
}

.calendar-cell {
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.calendar-cell.empty {
  visibility: hidden;
}

.calendar-cell.has-event {
  background: var(--md-secondary-container);
  border-color: var(--md-primary);
  grid-template-rows: 1fr auto;
  padding-top: 10px;
}

.calendar-cell:hover:not(.empty),
.calendar-cell:focus-visible:not(.empty) {
  background: color-mix(in srgb, var(--md-primary) 10%, var(--md-surface));
  border-color: var(--md-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(231, 76, 60, 0.14);
}

.calendar-cell.has-event:hover,
.calendar-cell.has-event:focus-visible {
  background: color-mix(in srgb, var(--md-primary) 14%, var(--md-secondary-container));
}

.calendar-cell:not(.has-event) {
  place-items: center;
}

.calendar-dot-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  align-self: end;
  margin-bottom: 6px;
}

.calendar-cell.selected {
  background: color-mix(in srgb, var(--md-primary) 16%, var(--md-surface));
  border-color: var(--md-primary);
  box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.15);
}

.calendar-cell.selected:hover,
.calendar-cell.selected:focus-visible {
  background: color-mix(in srgb, var(--md-primary) 24%, var(--md-surface));
  border-color: var(--md-primary);
  box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.15), 0 8px 18px rgba(231, 76, 60, 0.18);
}

.calendar-day {
  align-self: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--md-on-surface);
}

.calendar-dot {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--md-primary);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.official-dot {
  background: #2980b9;
}

.calendar-event-list {
  display: grid;
  gap: 10px;
}

.calendar-event-item {
  text-align: left;
  width: 100%;
  border: 1px solid var(--md-outline);
  border-radius: 16px;
  background: var(--md-surface);
  padding: 12px 14px;
  cursor: pointer;
}

.calendar-event-item.official {
  background: var(--md-secondary-container);
  border-color: var(--md-primary);
}

.calendar-event-date {
  font-size: 12px;
  color: var(--md-primary);
  margin-bottom: 4px;
}

.calendar-event-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--md-primary);
  margin-bottom: 4px;
}

.calendar-event-text,
.event-poster-text,
.calendar-empty {
  font-size: 13px;
  color: var(--md-on-surface);
  line-height: 1.5;
}

.event-poster-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 14px 0 10px;
}

.side-toggle-btn.active {
  color: #ffffff;
  background: var(--md-primary);
}

.side-toggle-btn.mobile-inside {
  position: static;
  z-index: auto;
  margin: 0 0 10px;
  width: 100%;
  height: 40px;
  border-radius: 12px;
}

.list-tools {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--md-outline);
  border-radius: 14px;
  background: var(--md-surface);
}

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

.search-mode-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--md-outline);
  border-radius: 999px;
  background: var(--md-surface);
  color: var(--md-primary);
  cursor: pointer;
  padding: 0;
  transition: width 280ms var(--ease-spring), background-color 220ms var(--ease-spring), border-color 220ms var(--ease-spring), color 220ms var(--ease-spring), box-shadow 220ms var(--ease-spring);
}

.search-mode-btn:hover,
.search-mode-btn.active {
  width: 94px;
}

.search-mode-btn.active {
  background: var(--md-primary);
  border-color: var(--md-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.28);
}

.search-icon {
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
  max-width: 16px;
  transition: opacity 180ms ease, max-width 220ms var(--ease-spring);
}

.search-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: max-width 240ms var(--ease-spring), opacity 200ms ease, transform 240ms var(--ease-spring);
}

.search-mode-btn:hover .search-label,
.search-mode-btn.active .search-label {
  max-width: 64px;
  opacity: 1;
  transform: translateX(0);
}

.search-mode-btn:hover .search-icon,
.search-mode-btn.active .search-icon {
  opacity: 0;
  max-width: 0;
}

.tool-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
}

.tool-label {
  font-size: 12px;
  color: var(--md-on-surface);
  font-weight: 600;
}

.sort-bar {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.sort-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  color: var(--md-on-surface);
  border-radius: 999px;
  padding: 5px 7px;
  font-size: 11px;
  min-height: 28px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms var(--ease-spring), background-color 220ms var(--ease-spring), color 220ms var(--ease-spring), border-color 220ms var(--ease-spring), box-shadow 220ms var(--ease-spring);
}

.sort-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.16);
}

.sort-btn:active {
  transform: translateY(0) scale(0.97);
}

.sort-btn.active {
  background: var(--md-primary);
  color: #fff;
  border-color: var(--md-primary);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.26);
  animation: sortBtnActivate 220ms var(--ease-spring);
}

@keyframes sortBtnActivate {
  0% { transform: scale(0.92); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 列表项 */
.group-list {
  margin-top: 12px;
  max-height: calc(100vh - 262px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
  border-top: 1px solid var(--md-outline-variant);
  padding-top: 10px;
  padding-bottom: 34px;
  transition: opacity 420ms cubic-bezier(0.16, 1, 0.3, 1), transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

#selectedCard.switching .group-list {
  opacity: 0.35;
  transform: translateY(8px) scale(0.985);
}

.group-item {
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), opacity 320ms var(--ease-spring);
}

.group-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.group-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--md-on-surface);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.group-chip {
  display: inline-block;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--md-secondary-container);
  color: var(--md-primary);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 40px;
  text-align: center;
}

.group-info,
.group-meta,
.empty-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: color-mix(in srgb, var(--md-on-surface) 82%, transparent);
  word-break: break-all;
}

.group-info {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-primary);
  letter-spacing: 0.2px;
}

.copy-number {
  cursor: pointer;
  user-select: none;
  transition: color 0.16s ease, transform 0.1s ease;
}

.copy-number:hover {
  color: var(--red-5);
}

.copy-number.link-like {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.copy-number:active {
  transform: translateY(1px);
}

.group-info-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-info-row .group-info {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.copy-btn {
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  color: var(--md-primary);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, transform 0.1s ease;
}

.copy-btn:hover {
  background: var(--md-secondary-container);
}

.copy-btn:active {
  transform: translateY(1px);
}

.copy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ================== 控制面板 ================== */
#controlCard.mobile-hidden {
  display: none !important;
}

#controlCard {
  left: 16px;
  bottom: 16px;
  width: auto;
  min-width: 280px;
}

.control-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================== 地图相关 Badge & 气泡 ================== */
.count-badge {
  cursor: pointer;
}

.count-badge circle {
  fill: var(--md-primary);
  stroke: #ffffff;
  stroke-width: 1.5;
  pointer-events: auto;
  transition: transform 180ms var(--ease-spring), fill 180ms ease;
}

.count-badge:hover circle {
  transform: scale(1.06);
}

.count-badge text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.map-bubble {
  position: absolute;
  z-index: 26;
  min-width: 220px;
  max-width: 360px;
  max-height: 280px;
  overflow: hidden;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--md-outline);
  background: var(--md-surface-container);
  box-shadow: 0 8px 26px rgba(231, 76, 60, 0.22);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.12);
  transform-origin: center center;
  pointer-events: none;
  will-change: transform, opacity;
  transition: left 420ms var(--ease-spring), top 420ms var(--ease-spring), width 380ms var(--ease-spring), height 380ms var(--ease-spring), transform 360ms var(--ease-spring), opacity 220ms ease;
}

.map-bubble.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.map-bubble.instant-place {
  transition: width 380ms var(--ease-spring), height 380ms var(--ease-spring), transform 360ms var(--ease-spring), opacity 220ms ease !important;
}

.map-bubble-scroll {
  max-height: 260px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px;
  border-radius: 12px;
}

.map-bubble-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--md-primary);
}

.map-bubble-item {
  margin-bottom: 8px;
  border: 1px solid var(--md-outline);
  background: var(--md-surface);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
}

.map-bubble-item:hover {
  background: var(--md-surface-container-high);
}

.bubble-name-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.bubble-name {
  display: inline-block;
  min-width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--md-on-surface);
  white-space: nowrap;
}

.bubble-name.marquee {
  padding-left: 100%;
  animation: bubbleMarquee 8s linear infinite;
}

.bubble-id {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--md-primary);
}

@keyframes bubbleMarquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-100%); }
}

/* ================== 模态框 ================== */
.feedback-modal, .easter-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms var(--ease-spring), visibility 260ms step-end;
  will-change: opacity, visibility;
}

.easter-modal {
  z-index: 85;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.feedback-modal.open, .easter-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 260ms var(--ease-spring), visibility 0ms;
}

.feedback-modal-card, .easter-modal-card {
  position: relative;
  border-radius: 20px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  transform: translateY(16px) scale(0.92);
  opacity: 0;
  transition: transform 320ms var(--ease-spring), opacity 240ms ease;
  will-change: transform, opacity;
}

.feedback-modal-card {
  width: min(92vw, 420px);
  padding: 16px 16px 14px;
}

.easter-modal-card {
  width: min(92vw, 640px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  padding: 18px 18px 16px;
  border-color: var(--md-primary);
}

.feedback-modal.open .feedback-modal-card,
.easter-modal.open .easter-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.feedback-modal-close, .easter-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: var(--md-surface-container-high);
  color: var(--md-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.feedback-modal-image {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.feedback-modal-link {
  display: inline-flex;
  margin-top: 12px;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 12px;
  background: var(--md-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.feedback-modal-link:hover {
  background: var(--red-5);
}

.easter-title {
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--md-primary);
}

.easter-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--md-on-surface);
  font-size: 14px;
}

/* ================== 刷新按钮 ================== */
.context-refresh-btn {
  position: fixed;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--md-outline);
  border-radius: 999px;
  background: var(--md-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.32);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.9);
  transition: left 260ms var(--ease-spring), top 260ms var(--ease-spring), opacity 200ms var(--ease-spring), transform 240ms var(--ease-spring), visibility 240ms step-end;
}

.context-refresh-btn.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: left 260ms var(--ease-spring), top 260ms var(--ease-spring), opacity 180ms var(--ease-spring), transform 220ms var(--ease-spring), visibility 0ms;
}

.context-refresh-btn.instant-place { transition: none !important; }
.context-refresh-btn:hover { background: var(--red-5); }
.context-refresh-btn:active { transform: translateY(1px) scale(0.98); }

/* ================== 响应式适配 ================== */
@media (max-width: 720px) {
  #tooltip { display: none; }

  .md3-card {
    width: calc(100vw - 24px);
    border-radius: 18px;
    padding: 12px;
  }

  #introCard {
    top: 8px;
    left: 8px;
    width: calc(100vw - 16px);
    max-height: 40vh;
    overflow: auto;
  }

  #introCard.collapsed { transform: translateX(calc(-100% + 54px)); }
  #introCard .card-title { font-size: 20px; }
  #introLogo { margin-bottom: 8px; }
  #introCard .card-body { font-size: 14px; }
  
  .md3-switch-label { font-size: 13px; }

  .github-link, .feedback-link {
    width: 100%;
    justify-content: center;
    font-size: 12px;
  }

  #selectedCard {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: 46vh;
    max-height: none;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
  }

  .mobile-sheet-handle {
    display: block;
    padding: 2px 0 4px;
    touch-action: none;
    cursor: ns-resize;
  }

  .side-toggle-btn {
    right: 8px;
    bottom: calc(46vh + 18px);
    top: auto;
    min-width: 68px;
    height: 42px;
  }

  .secondary-toggle-btn {
    bottom: calc(46vh + 64px);
    top: auto;
  }

  .tertiary-toggle-btn {
    bottom: calc(46vh + 110px);
    top: auto;
  }

  .side-toggle-btn.mobile-inside {
    right: auto;
    bottom: auto;
    min-width: 0;
    height: 38px;
  }

  .secondary-toggle-btn.mobile-inside,
  .tertiary-toggle-btn.mobile-inside {
    margin-top: 8px;
  }

  #controlCard {
    left: 8px;
    bottom: calc(46vh + 18px);
    min-width: 0;
    max-width: calc(100vw - 86px);
    padding: 10px;
  }

  #controlCard .card-title { font-size: 13px; margin-bottom: 6px; }

  .md3-btn { min-height: 38px; padding: 9px 12px; font-size: 12px; }

  .group-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding-bottom: 0px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .list-tools { padding: 8px; gap: 6px; }

  .search-mode-btn { width: 32px; height: 32px; padding: 0 9px; }
  .search-mode-btn:hover, .search-mode-btn.active { width: 82px; }
  .search-label { font-size: 11px; }

  .tool-row { grid-template-columns: 38px 1fr; }
  .md3-input, .md3-select { min-height: 32px; font-size: 12px; padding: 6px 8px; }

  .sort-bar { gap: 4px; }
  .sort-btn { font-size: 10px; padding: 4px 6px; }

  .group-name { font-size: 13px; }
  .group-info { font-size: 14px; }
  .copy-btn { min-height: 30px; }

  .map-bubble {
    min-width: 180px;
    max-width: calc(100vw - 20px);
    max-height: 44vh;
    padding: 8px;
    border-radius: 14px;
  }

  .map-bubble-scroll { max-height: calc(44vh - 18px); }
  .map-bubble-title { font-size: 13px; }
  .bubble-name { font-size: 12px; }
  .bubble-id { font-size: 13px; }

  .count-badge text { font-size: 9px; }

  .feedback-modal-card {
    width: min(94vw, 390px);
    border-radius: 16px;
    padding: 12px 12px 10px;
  }

  .feedback-modal-close { width: 30px; height: 30px; font-size: 18px; }

  .context-refresh-btn {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  #introCard .card-title { font-size: 18px; }
  #introCard .card-body { font-size: 13px; }

  .md3-switch-track { width: 48px; height: 30px; }
  .md3-switch-thumb { width: 20px; height: 20px; }
  .md3-switch input:checked + .md3-switch-track .md3-switch-thumb { transform: translateX(18px); }
}