/* ==========================================================================
   同学分布地图 (蹭饭地图) - 浅色暖橙色主题 & 自由可拖拽画布 Design
   ========================================================================== */

:root {
  --bg-dark: #f8fafc;
  --bg-viewport: #f1f5f9;
  --bg-panel: rgba(255, 255, 255, 0.95);
  --bg-card-inner: #fff7ed;
  
  --primary-orange: #ea580c;
  --orange-light: #f97316;
  --orange-badge: #ffedd5;
  --orange-border: rgba(234, 88, 12, 0.25);
  
  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  
  --border-line: rgba(226, 232, 240, 0.85);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(234, 88, 12, 0.18);
  
  --font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --radius-md: 6px;
  --radius-sm: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

/* 16:9 视口容器 */
#app-viewport {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%);
}

#aspect-ratio-box {
  position: relative;
  width: 100vw;
  height: 56.25vw; /* 16:9 宽高比 */
  max-height: 100vh;
  max-width: 177.78vh; /* 16:9 宽高比 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.6);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

/* 头部 Header */
.app-header {
  height: 48px;
  min-height: 48px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  color: var(--primary-orange);
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 4px rgba(234, 88, 12, 0.2));
}

.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.app-header h1 .sub-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-orange);
  margin-left: 6px;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff7ed;
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid var(--orange-border);
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-orange);
  background: #ffffff;
  border: 1px solid var(--primary-orange);
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background: var(--primary-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-orange);
}

.stat-label {
  font-size: 11px;
  color: var(--text-sub);
}

.stat-divider {
  width: 1px;
  height: 12px;
  background: rgba(234, 88, 12, 0.2);
}

/* 主展示区域 */
.stage-container {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100% - 72px);
  overflow: hidden;
  display: flex;
}

/* SVG 矢量连线层 */
#svg-leader-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.leader-line-path {
  fill: none;
  stroke: url(#lineGrad);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  transition: opacity 0.2s ease;
  opacity: 0.35;
}

.leader-line-path.active {
  stroke: var(--primary-orange);
  stroke-width: 2.5;
  stroke-dasharray: none;
  opacity: 1;
  filter: drop-shadow(0 2px 6px rgba(234, 88, 12, 0.4));
}

.leader-line-dot {
  fill: #fff7ed;
  stroke: #ff9800;
  stroke-width: 1.5;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.leader-line-dot.active {
  fill: #ff9800;
  stroke: #ea580c;
  r: 5;
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 152, 0, 0.5));
}

/* 中央 ECharts 地图容器 */
#map-chart-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  height: 75%;
  z-index: 5;
  pointer-events: auto;
}

#china-map {
  width: 100%;
  height: 100%;
}

/* 自由拖拽画布容器 */
.draggable-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* 自由拖拽式省份一级卡片 (Draggable Card) */
.province-card.draggable-card {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 6px 9px;
  width: 190px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.province-card.draggable-card:hover {
  border-color: var(--primary-orange);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: #ffffff;
}

/* 正在拖拽抓取状态 (Is Dragging) */
.province-card.draggable-card.is-dragging {
  cursor: grabbing !important;
  z-index: 100 !important;
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.25);
  border-color: var(--primary-orange);
  background: #ffffff;
}

/* 卡片 Header / Drag Handle */
.province-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 3px;
  border-bottom: 1px stroke rgba(226, 232, 240, 0.85);
  cursor: grab;
}

.province-card-header:active {
  cursor: grabbing;
}

.province-name {
  font-size: 13px; /* 13px 加粗大字 */
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.province-name::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: rgba(234, 88, 12, 0.5);
  margin-right: 6px;
}

.province-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-orange);
  background: var(--orange-badge);
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--orange-border);
}

/* 城市二级卡片列表 */
.cities-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 城市二级卡片 */
.city-card {
  background: var(--bg-card-inner);
  border-left: 2.5px solid var(--primary-orange);
  border-radius: 4px;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.city-name {
  font-size: 11px;
  font-weight: 700;
  color: #ea580c;
}

/* 同学 Tag (大字号) */
.students-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.student-tag {
  font-size: 11px;
  color: var(--text-main);
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.student-tag .student-name {
  font-weight: 600;
}

/* 同学姓名右侧 15px 真实官方高清校徽 Icon */
.student-tag .uni-logo {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  border-radius: 50%;
  object-fit: contain;
  margin-left: 3px;
  margin-right: 2px;
  vertical-align: middle;
  display: inline-block;
  background: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.student-tag .uni-name {
  color: var(--text-muted);
  font-size: 10px;
  max-width: 135px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.student-tag:hover {
  background: var(--orange-badge);
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

/* 底部 Footer */
.app-footer {
  height: 24px;
  min-height: 24px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-top: 1px solid var(--border-line);
  font-size: 10px;
  color: var(--text-muted);
  z-index: 20;
}


