/* ================= 极光实时带 · 样式 ================= */
* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05080f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #e6f0ff;
  -webkit-font-smoothing: antialiased;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#sky:active { cursor: grabbing; }

/* 背景径向辉光,让画面不显死黑 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(60, 40, 120, .28), transparent 70%),
    radial-gradient(ellipse 45% 35% at 78% 12%, rgba(20, 90, 130, .18), transparent 72%);
  z-index: 0;
}

.glass {
  background: rgba(12, 20, 36, .60);
  border: 1px solid rgba(120, 170, 240, .14);
  border-radius: 14px;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .38);
}

/* ---------------- 顶部 ---------------- */
.top {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 9px;
}
.brand-ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1px rgba(160, 130, 255, .28), 0 0 14px rgba(150, 100, 255, .32);
}
.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .3px;
  line-height: 1.2;
}
.brand p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: #7f93b0;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.brand p.stale { color: #ff7676; }

.acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.acts button {
  appearance: none;
  border: 1px solid rgba(120, 170, 240, .18);
  background: rgba(12, 20, 36, .60);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #a9bcd6;
  font-size: 11.5px;
  font-family: inherit;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
  line-height: 1.3;
}
.acts button:hover { color: #e6f0ff; border-color: rgba(150, 200, 255, .35); }
.acts button.on {
  color: #0a1a16;
  background: linear-gradient(135deg, #8ef2c4, #46d39a);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(70, 211, 154, .32);
}

/* ---------------- 数据面板 ---------------- */
.panel {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 246px;
  padding: 12px 13px 10px;
  z-index: 20;
}

.kp { padding-bottom: 10px; border-bottom: 1px solid rgba(120, 170, 240, .12); }
.kp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kp-k { font-size: 11px; color: #7f93b0; letter-spacing: .4px; }
.kp-tag {
  font-size: 10px;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: rgba(120, 170, 240, .14);
  color: #9fb8d6;
  line-height: 1.5;
}
.kp-v {
  font-size: 30px;
  font-weight: 650;
  line-height: 1.15;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  color: #8ef2c4;
  transition: color .3s ease;
}
.kp-scale {
  height: 4px;
  border-radius: 999px;
  background: rgba(120, 170, 240, .14);
  overflow: hidden;
  margin-top: 6px;
}
.kp-scale i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #46d39a, #e8d24a, #f08a3c, #e35555);
  transition: width .5s cubic-bezier(.3, .8, .3, 1);
}
.kp-note {
  font-size: 10.5px;
  color: #6f83a0;
  margin-top: 6px;
  line-height: 1.45;
}

.rows { padding-top: 9px; display: grid; gap: 5px; }
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11.5px;
  line-height: 1.4;
}
.row span { color: #7f93b0; }
.row b {
  font-weight: 500;
  color: #d7e5f7;
  font-variant-numeric: tabular-nums;
}
.row b.hot { color: #ff9f6b; }
.row b.cool { color: #7fd4ff; }

.foot {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(120, 170, 240, .12);
  font-size: 10px;
  color: #5c6f8a;
  line-height: 1.5;
}

/* ---------------- 图例 / 提示 ---------------- */
.legend {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 12px;
  padding: 7px 12px;
  font-size: 10.5px;
  color: #8ba0bd;
  z-index: 20;
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot.g { background: #3ef2a0; box-shadow: 0 0 7px #3ef2a0; }
.dot.y { background: #b9f06a; box-shadow: 0 0 7px #b9f06a; }
.dot.p { background: #b06bff; box-shadow: 0 0 7px #b06bff; }

.hint {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: #4e6180;
  z-index: 15;
  pointer-events: none;
  transition: opacity .8s ease;
  white-space: nowrap;
}
.hint.off { opacity: 0; }

/* ---------------- 分享隐藏图 ---------------- */
.shareimg {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 300px;
  height: 300px;
  overflow: hidden;
  pointer-events: none;
}

/* 加载态 */
#sky { transition: opacity .7s ease; }
body.loading #sky { opacity: 0; }
body.ready #sky { opacity: 1; }

body.loading .panel,
body.loading .legend { opacity: .35; transition: opacity .4s ease; }

/* ================= 手机 ================= */
@media (max-width: 720px) {
  .top {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    gap: 8px;
  }
  .brand { padding: 7px 11px 7px 7px; border-radius: 12px; gap: 8px; }
  .brand-ico { width: 24px; height: 24px; }
  .brand h1 { font-size: 13.5px; }
  .brand p { font-size: 10px; margin-top: 2px; }

  .acts { gap: 5px; }
  .acts button { font-size: 10.5px; padding: 5px 9px; }

  /* 面板改成贴底横向,不挡地球 */
  .panel {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    padding: 9px 11px 8px;
    border-radius: 12px;
  }
  .kp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .kp-head { flex-direction: column; align-items: flex-start; gap: 1px; }
  .kp-k { font-size: 10px; }
  .kp-tag { font-size: 9px; padding: 1px 5px; }
  .kp-v { font-size: 21px; margin-top: 0; flex: none; }
  .kp-scale { flex: 1; margin-top: 0; height: 3px; }
  .kp-note { display: none; }

  .rows {
    padding-top: 7px;
    margin-top: 7px;
    border-top: 1px solid rgba(120, 170, 240, .12);
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
  }
  .row { font-size: 10.5px; }
  /* 手机只留四项,动压省掉 */
  #rows .row:nth-child(4) { display: none; }
  /* ★ foot 不能再隐藏:L1 提前量(太阳风还有多少分钟到地球)是这个应用最有价值的一条,
     藏掉等于手机端丢了核心信息。压成一行小字保留。 */
  .foot {
    margin-top: 6px;
    padding-top: 5px;
    font-size: 9.5px;
    line-height: 1.45;
  }

  .legend {
    display: none;
  }
  .hint {
    bottom: calc(150px + env(safe-area-inset-bottom));
    font-size: 10px;
  }
}

/* 360px 这类窄屏:四个按钮必须挤在一行,否则换行很丑 */
@media (max-width: 382px) {
  .brand { padding: 6px 9px 6px 6px; gap: 7px; }
  .brand-ico { width: 22px; height: 22px; }
  .brand h1 { font-size: 12.5px; }
  .brand p { font-size: 9.5px; }
  .acts { gap: 4px; }
  .acts button { font-size: 10px; padding: 4px 7px; }
}

/* 320px 极窄屏(SE 一代/老安卓):再收一档,保证按钮仍是一行
   ★ 实测 320 时 brand 136 + gap 8 + acts 155.9 = 300 刚好撑满,
     acts 需要 159.6 被 flex 压到 155.9 → 换行。把 gap 与 padding 各收一点即可。 */
@media (max-width: 340px) {
  .brand { padding: 5px 7px 5px 5px; gap: 5px; }
  .brand-ico { width: 20px; height: 20px; }
  .brand h1 { font-size: 12px; }
  .brand p { font-size: 9px; }
  .acts { gap: 2px; }
  .acts button { font-size: 9.5px; padding: 4px 5px; }
  .foot { font-size: 9px; }
}

/* 矮屏(横屏手机)时把面板收得更紧 */
@media (max-height: 460px) and (max-width: 900px) {
  .panel { left: 10px; right: auto; width: 220px; bottom: 10px; }
  .kp { display: block; }
  .kp-v { font-size: 22px; }
  .rows { grid-template-columns: 1fr; border-top: 1px solid rgba(120, 170, 240, .12); }
  .rows .row:nth-child(4) { display: none; }
  .legend { display: none; }
  .hint { display: none; }
}
