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

html, body {
  width: 100%;
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: #050b1f;
  color: #e6f0ff;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
}

/* ========== 页面容器 ========== */
.screen {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at top, #0a1e4a 0%, #050b1f 60%),
    linear-gradient(180deg, #050b1f 0%, #02060f 100%);
  display: flex;
  flex-direction: column;
  padding: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  gap: 10px;
}

/* ========== 顶部标题栏 ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(0, 84, 200, 0.3), rgba(0, 84, 200, 0.05));
  border: 1px solid rgba(64, 158, 255, 0.3);
  border-radius: 6px;
  flex-shrink: 0;
}

.header h1 {
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #7ec8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  flex-shrink: 0;
}

.clock-time {
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 700;
  color: #40c8ff;
  font-family: "SF Mono", "Consolas", "Menlo", monospace;
  letter-spacing: 1px;
}

.clock-date {
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 600;
  color: #40c8ff;
  margin-top: 2px;
  opacity: 0.85;
}

/* ========== 主体 ========== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ========== 面板 ========== */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 30, 74, 0.6), rgba(5, 11, 31, 0.88));
  border: 1px solid rgba(64, 158, 255, 0.3);
  border-radius: 6px;
  padding: 12px;
  gap: 10px;
}

.panel-title {
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 600;
  color: #e6f0ff;
  padding: 6px 12px;
  border-left: 3px solid #40c8ff;
  background: rgba(0, 84, 200, 0.2);
  border-radius: 3px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.panel-title.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
  color: #ffd980;
  font-size: clamp(12px, 3.4vw, 14px);
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 10px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.panel-title.notice-bar.manual {
  background: rgba(64, 200, 255, 0.1);
  border-left-color: #40c8ff;
  color: #7ec8ff;
}

.notice-bar .notice-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #ffc107;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.panel-title.notice-bar.manual .notice-icon {
  color: #40c8ff;
}

.notice-bar .notice-text {
  flex: 1;
  min-width: 0;
}

/* ========== 点位列表 ========== */
.point-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ========== 路线分组 ========== */
.route-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-group[data-route="徒步登山"] {
  /* single card, don't stretch */
}

.route-title {
  font-size: 13px;
  font-weight: 600;
  color: #8fbfff;
  padding: 4px 10px;
  border-left: 3px solid #40c8ff;
  background: rgba(0, 84, 200, 0.15);
  border-radius: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.route-group[data-route="东线区域"] .route-title {
  border-left-color: #00e676;
}

.route-group[data-route="西线区域"] .route-title {
  border-left-color: #ffc107;
}

.route-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-group[data-route="徒步登山"] .route-cards {
  /* same as default single column */
}

/* ========== 点位卡片 ========== */
.point-card {
  background: linear-gradient(135deg, rgba(0, 84, 200, 0.18), rgba(0, 84, 200, 0.04));
  border-left: 5px solid #40c8ff;
  border-radius: 4px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 44px;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(64, 200, 255, 0.15);
}

.point-card:active {
  background: rgba(0, 130, 255, 0.25);
  transform: scale(0.985);
}

.point-card.green {
  border-left-color: #00e676;
}

.point-card.yellow {
  border-left-color: #ffc107;
}

.point-card.red {
  border-left-color: #ff5252;
}

.point-card.gray {
  border-left-color: #607d8b;
  background: linear-gradient(135deg, rgba(96, 125, 139, 0.12), rgba(96, 125, 139, 0.04));
  opacity: 0.72;
}

.point-card.gray .point-name,
.point-card.gray .point-area-tag,
.point-card.gray .point-code {
  color: #90a4ae;
}

.point-card.gray .stat-value {
  color: #90a4ae;
}

/* ========== 卡片头部 ========== */
.point-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.point-name {
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 600;
  color: #e6f0ff;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.point-area-tag {
  font-size: 11px;
  color: #ffd980;
  padding: 2px 6px;
  background: rgba(255, 217, 128, 0.1);
  border: 1px solid rgba(255, 217, 128, 0.3);
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.point-code {
  font-size: 11px;
  color: #6b8fc4;
  padding: 2px 6px;
  background: rgba(64, 158, 255, 0.18);
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}

/* ========== 数据区 ========== */
.point-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: baseline;
}

.stat-block {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
}

.stat-value {
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.stat-value.green  { color: #00e676; }
.stat-value.yellow { color: #ffc107; }
.stat-value.red    { color: #ff5252; }
.stat-value.cyan   { color: #40c8ff; }

.stat-unit {
  font-size: 11px;
  color: #8fbfff;
  font-weight: 400;
  white-space: nowrap;
}

/* ========== 加载骨架屏 ============ */
.skel-title {
  height: 24px;
  border-left: 3px solid rgba(64, 158, 255, 0.18);
  background: rgba(0, 84, 200, 0.10);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.skel-card {
  background: linear-gradient(135deg, rgba(0, 84, 200, 0.12), rgba(0, 84, 200, 0.03));
  border-left: 5px solid rgba(64, 158, 255, 0.16);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  min-height: 68px;
}

.skel-title::after,
.skel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(64, 200, 255, 0.04) 35%,
    rgba(64, 200, 255, 0.10) 50%,
    rgba(64, 200, 255, 0.04) 65%,
    transparent 100%
  );
  animation: skel-shimmer 1.8s ease-in-out infinite;
}

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

.skel-loading-text {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(64, 200, 255, 0.55);
  letter-spacing: 0.1em;
  padding: 10px 0 4px 0;
  animation: skel-pulse 2s ease-in-out infinite;
}

@keyframes skel-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}

/* ========== 无障碍 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

::selection {
  background: rgba(64, 200, 255, 0.4);
  color: #fff;
}

*:focus-visible {
  outline: 2px solid #40c8ff;
  outline-offset: 2px;
}

/* ========== 横屏适配 ========== */
@media (orientation: landscape) {
  .route-cards {
    gap: 12px;
  }

  .route-group[data-route="徒步登山"] .route-cards {
    grid-template-columns: 1fr;
  }
}

/* ========== 稍大屏幕 (平板) ========== */
@media (min-width: 600px) {
  .screen {
    padding: 16px;
    gap: 14px;
  }

  .route-cards {
    gap: 14px;
  }

  .route-group[data-route="徒步登山"] .route-cards {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .screen {
    max-width: 480px;
    margin: 0 auto;
  }
}
