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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background: #c8d6e2;
  color: #1f2937;
  user-select: none;
}

#app, #scene { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { display: block; }

.hidden { display: none !important; }

/* ---------- 加载 ---------- */
#loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #c8d6e2; z-index: 30;
}
.loading-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: #475569; font-size: 15px;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(71,86,105,.2);
  border-top-color: #475569;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 左上数据面板 ---------- */
.panel {
  position: absolute; top: 18px; left: 18px; z-index: 20;
  width: 272px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 16px;
  padding: 16px 18px 14px;
  box-shadow: 0 10px 30px rgba(30,41,59,.12);
}
.panel h1 { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.panel-sub { font-size: 10.5px; color: #64748b; margin-top: 2px; letter-spacing: .4px; }

.now { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; }
.now-temp { font-size: 40px; font-weight: 300; line-height: 1; color: #0f172a; }
.now-temp .unit { font-size: 15px; font-weight: 400; margin-left: 2px; color: #475569; }
.now-desc { display: flex; flex-direction: column; gap: 3px; }
#condition { font-size: 15px; font-weight: 600; color: #1e293b; }
#localtime { font-size: 11.5px; color: #64748b; }

.metrics { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.metrics li {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 11px; color: #64748b;
}
.metrics b { font-size: 13px; font-weight: 600; color: #1e293b; }

.panel-foot { margin-top: 12px; border-top: 1px solid rgba(100,116,139,.2); padding-top: 8px; }
#mode-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
#mode-flags .flag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: rgba(59,130,246,.14); color: #1d4ed8; font-weight: 600;
}
.updated { font-size: 10.5px; color: #8492a6; line-height: 1.6; }

/* ---------- 错误条 ---------- */
#errorbar {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 25; max-width: 60%;
  background: rgba(220, 38, 38, .92);
  color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(185,28,28,.35);
  text-align: center;
}

/* ---------- 底部控制条 ---------- */
.controls {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 20;
  display: flex; align-items: center; gap: 18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(30,41,59,.12);
}
.ctl-group { display: flex; align-items: center; gap: 8px; }
.ctl-label { font-size: 12px; color: #64748b; font-weight: 600; }
.ctl-buttons { display: flex; gap: 4px; }
.ctl-buttons button {
  border: none; cursor: pointer;
  font-size: 12.5px; color: #475569;
  background: rgba(148,163,184,.16);
  padding: 6px 12px; border-radius: 9px;
  transition: all .15s ease;
  font-family: inherit;
}
.ctl-buttons button:hover { background: rgba(148,163,184,.3); }
.ctl-buttons button.active {
  background: #2563eb; color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.ctl-group.hint { font-size: 11px; color: #94a3b8; }

@media (max-width: 900px) {
  .ctl-group.hint { display: none; }
  .controls { gap: 10px; padding: 10px 12px; }
}
