* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #060a12;
  --panel: #0b1220;
  --line: rgba(120, 165, 215, .16);
  --txt: #dce8f8;
  --dim: rgba(178, 202, 230, .55);
  --dim2: rgba(178, 202, 230, .34);
  --cyan: #7fd4ff;
  --warm: #ffd27a;
  --font: 400 13px/1.55 -apple-system, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}
html, body { height: 100%; }
body {
  font: var(--font);
  color: var(--txt);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

#app { display: flex; width: 100vw; height: 100vh; }

/* ---------- 左：地球 60% ---------- */
#earthPane {
  position: relative;
  width: 60%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(78% 68% at 50% 46%, #10223d 0%, #0a1629 44%, #060b15 78%, #04070e 100%);
  border-right: 1px solid rgba(120, 165, 215, .13);
}
#earthPane::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 50%, transparent 55%, rgba(4, 7, 14, .55) 100%);
}
#earthStage { position: absolute; inset: 0; cursor: grab; }
#earthStage.dragging { cursor: grabbing; }
#earthCanvas { display: block; width: 100%; height: 100%; }
#cityLayer, #pinLayer, #focusLayer { position: absolute; inset: 0; pointer-events: none; }

.gl-city {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; will-change: transform, opacity;
}
.gl-city i {
  width: 4px; height: 4px; border-radius: 50%; flex: none;
  background: #8fd8ff; box-shadow: 0 0 7px rgba(120, 205, 255, .8);
}
.gl-city span {
  font-size: 11px; letter-spacing: .2px; color: rgba(222, 238, 255, .78);
  text-shadow: 0 1px 6px #000, 0 0 10px #000;
}
.gl-city.lv3 span { font-size: 10px; color: rgba(222, 238, 255, .5); }

/* 新闻发生地：闪烁坐标 */
.gl-pin {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  will-change: transform, opacity;
}
.gl-pin i {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--warm);
  box-shadow: 0 0 16px rgba(255, 190, 95, 1), 0 0 5px #fff;
  z-index: 2;
}
.gl-pin i::before {
  content: ""; position: absolute; left: -7px; top: -7px; width: 24px; height: 24px;
  border: 1px solid rgba(255, 205, 120, .65); border-radius: 50%;
  animation: glping 2.6s cubic-bezier(.2, .7, .4, 1) infinite;
}
.gl-pin.hot i { background: #ff9a6b; box-shadow: 0 0 16px rgba(255, 130, 80, .95), 0 0 4px #fff; }
.gl-pin b {
  position: absolute; left: 11px; top: -9px; font-size: 10px; font-weight: 500;
  color: rgba(255, 225, 175, .9); text-shadow: 0 1px 5px #000;
}
.gl-pin.active i::before { border-color: #ffd27a; animation-duration: 1.1s; }
.gl-pin.active b { color: #fff; }
@keyframes glping {
  0% { transform: scale(.28); opacity: .95; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}

/* 动态坐标卡 */
#focusLayer { z-index: 3; }
.gl-focus-card {
  position: absolute; left: 24px; top: 50%; transform: translateY(-50%);
  min-width: 168px; padding: 14px 18px 15px 16px;
  border: 1px solid rgba(255, 205, 120, .28);
  border-left: 2px solid rgba(255, 205, 120, .85);
  background: linear-gradient(100deg, rgba(30, 26, 20, .78), rgba(12, 20, 32, .72));
  backdrop-filter: blur(9px);
  animation: fcard .5s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes fcard { from { opacity: 0; transform: translate(-14px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }
.gl-focus-x {
  position: absolute; right: 8px; top: 4px; font-size: 12px; color: rgba(255, 210, 140, .45);
}
.gl-focus-t { font-size: 15px; font-weight: 500; color: #ffe6b8; letter-spacing: .5px; }
.gl-focus-c {
  margin-top: 5px; font-size: 11px; color: rgba(255, 226, 185, .68);
  font-variant-numeric: tabular-nums; letter-spacing: .4px;
}

/* 站点名浮动在地球上方（顶部 10%） */
#masthead {
  position: absolute; left: 0; top: 0; width: 100%; height: 10%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 4.2%; pointer-events: none; z-index: 4;
  background: linear-gradient(180deg, rgba(4, 7, 14, .92) 0%, rgba(4, 7, 14, .45) 62%, transparent 100%);
}
#masthead h1 {
  font-size: clamp(22px, 2.5vw, 40px); font-weight: 700; letter-spacing: 3px;
  color: #f2f7ff; text-shadow: 0 2px 20px rgba(0, 0, 0, .8);
  white-space: nowrap;
}
#masthead h1 em { font-style: normal; color: var(--warm); margin: 0 4px; }
#masthead p {
  margin-top: 3px; font-size: 10px; letter-spacing: 3.4px;
  color: rgba(160, 195, 235, .5); text-transform: uppercase;
}
#earthMeta {
  position: absolute; left: 4.2%; bottom: 26px; z-index: 4;
  display: flex; align-items: center; gap: 11px;
  font-size: 11px; letter-spacing: .4px; color: rgba(190, 215, 245, .68);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
#earthMeta i { width: 3px; height: 3px; border-radius: 50%; background: rgba(160, 195, 235, .4); }
#earthTip {
  position: absolute; right: 4.2%; bottom: 26px; z-index: 4;
  font-size: 10.5px; color: rgba(170, 200, 235, .38); pointer-events: none;
}

/* ---------- 右：新闻 40% ---------- */
#newsPane {
  width: 40%; height: 100%; display: flex; flex-direction: column;
  background:
    radial-gradient(circle, rgba(150, 185, 225, .13) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--panel);
}
#newsHead {
  flex: none; padding: 20px 26px 14px; border-bottom: 1px solid var(--line);
  background: rgba(9, 16, 28, .92);
}
.nh-title { display: flex; align-items: baseline; justify-content: space-between; }
.nh-title h2 { font-size: 19px; font-weight: 600; letter-spacing: 1.5px; }
.nh-title span { font-size: 11px; color: var(--dim2); font-variant-numeric: tabular-nums; }
#newsTabs {
  display: flex; gap: 4px; margin-top: 13px; overflow-x: auto;
  scrollbar-width: none;
}
#newsTabs::-webkit-scrollbar { display: none; }
#newsTabs button {
  flex: none; padding: 5px 11px; border-radius: 3px; white-space: nowrap;
  font-size: 11.5px; color: var(--dim); transition: background .16s, color .16s;
}
#newsTabs button:hover { color: var(--txt); background: rgba(120, 165, 215, .09); }
#newsTabs button.on { color: #08111e; background: var(--cyan); font-weight: 600; }
.nh-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: 10.5px; color: var(--dim2);
}
#newsRefresh {
  width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%;
  font-size: 16px; line-height: 1; color: var(--dim);
  transition: color .16s, border-color .16s;
}
#newsRefresh:hover { color: var(--cyan); border-color: var(--cyan); }
#newsRefresh.spin i, #newsRefresh.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#newsList { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: thin; }
#newsList::-webkit-scrollbar { width: 5px; }
#newsList::-webkit-scrollbar-thumb { background: rgba(120, 165, 215, .22); border-radius: 3px; }

.news-item {
  display: block; position: relative; padding: 15px 26px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .18s;
}
.news-item:hover { background: rgba(127, 212, 255, .045); }
.news-item.active { background: rgba(255, 205, 120, .055); }
.news-item.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--warm);
}
.news-item.is-new { animation: nin .55s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes nin {
  from { opacity: 0; transform: translateY(-10px); background: rgba(127, 212, 255, .12); }
  to { opacity: 1; transform: none; }
}
.n-meta { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--dim2); }
.n-tag {
  padding: 1px 6px; border: 1px solid rgba(127, 212, 255, .28); border-radius: 2px;
  color: var(--cyan); font-size: 10px;
}
.n-place { color: var(--warm); opacity: .8; }
.n-place::before { content: "⌖ "; }
.n-t { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--txt); }
.n-snippet {
  margin-top: 4px; font-size: 11.5px; line-height: 1.55;
  color: rgba(178, 202, 230, .48);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.news-item.open .n-snippet { display: none; }
.n-en { display: block; margin-top: 3px; font-size: 11.5px; color: var(--dim2); }
.n-body {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .35s ease, opacity .28s ease, margin .28s ease;
}
.news-item.open .n-body { max-height: 340px; opacity: 1; margin-top: 10px; }
.n-summary { font-size: 12px; line-height: 1.75; color: rgba(205, 224, 246, .72); }
.n-link {
  display: inline-block; margin-top: 10px; font-size: 11px; color: var(--cyan);
  text-decoration: none; border-bottom: 1px solid rgba(127, 212, 255, .35);
}
.n-link:hover { color: #fff; }

.news-loading { display: flex; gap: 5px; justify-content: center; padding: 36px 0; }
.news-loading i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); opacity: .3;
  animation: blink 1.1s infinite alternate;
}
.news-loading i:nth-child(2) { animation-delay: .18s; }
.news-loading i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { to { opacity: 1; transform: translateY(-3px); } }

.news-newbar {
  position: sticky; top: 0; z-index: 5; display: block; width: 100%;
  padding: 9px; text-align: center; font-size: 11.5px;
  color: #08111e; background: var(--warm); border: 0;
}
.news-empty { padding: 40px 26px; text-align: center; color: var(--dim2); font-size: 12px; }

#newsFoot {
  flex: none; display: flex; justify-content: space-between; align-items: center;
  padding: 11px 26px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--dim2); background: rgba(9, 16, 28, .92);
  font-variant-numeric: tabular-nums;
}
#newsNext.soon { color: var(--warm); }
#newsRefresh.busy { color: var(--warm); }
#adminLink {
  color: var(--dim2); text-decoration: none; border-bottom: 1px solid transparent;
  transition: color .16s, border-color .16s;
}
#adminLink:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------- 窄屏：上下堆叠 ---------- */
@media (max-width: 860px) {
  body { overflow: auto; }
  #app { flex-direction: column; height: auto; min-height: 100vh; }
  #earthPane { width: 100%; height: 58vh; min-height: 340px; }
  #newsPane { width: 100%; height: auto; min-height: 60vh; }
  #masthead { height: 13%; }
  #earthTip { display: none; }
  #newsList { max-height: 62vh; }
}
