/* ==========================================================================
   系外行星大气 / Atmosphere Lab
   ========================================================================== */

:root {
  --bg: #030609;
  --text: #eae7df;
  --line: rgba(235, 240, 242, .12);
  --line-soft: rgba(235, 240, 242, .065);
  --accent: #c8dbe0;
  --sans: "Avenir Next", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { color: inherit; font: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid rgba(200,219,224,.9); outline-offset: 4px; }
::selection { color: #0b1517; background: var(--accent); }
svg { display: block; }

/* Loading ------------------------------------------------------------------ */

.atmo-loading {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: #030609; transition: opacity .7s var(--ease), visibility .7s;
}
.atmo-loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.atmo-loading-mark { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.atmo-loading-mark i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px rgba(200,219,224,.8); }
.atmo-loading-mark i:nth-child(1) { animation: atmo-orbit 2.7s linear infinite; }
.atmo-loading-mark i:nth-child(2) { animation: atmo-orbit 2.7s linear infinite reverse; animation-delay: -1s; opacity: .6; }
.atmo-loading-mark i:nth-child(3) { width: 3px; height: 3px; opacity: .4; }
@keyframes atmo-orbit { 0% { transform: rotate(0) translateX(23px); } 100% { transform: rotate(360deg) translateX(23px); } }
.atmo-loading > span { font-family: var(--mono); font-size: 8px; letter-spacing: .18em; color: rgba(190,186,172,.7); }
.atmo-loading > b { font-family: var(--mono); font-size: 7px; font-weight: 400; color: rgba(200,219,224,.65); }

/* Scene -------------------------------------------------------------------- */

.atmo-scene { position: fixed; inset: 0; z-index: 0; background: #030609; }
.atmo-scene canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.atmo-scene canvas.is-dragging { cursor: grabbing; }
.atmo-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 48% 46%, transparent 30%, rgba(3,6,9,.28) 100%),
    linear-gradient(90deg, rgba(3,6,9,.66) 0%, transparent 31%, transparent 67%, rgba(3,6,9,.62) 100%),
    linear-gradient(0deg, rgba(3,6,9,.74) 0%, transparent 22%);
}

/* Topbar ------------------------------------------------------------------- */

.atmo-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 82px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 34px; pointer-events: none;
}
.atmo-brand { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.atmo-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(200,219,224,.3); border-radius: 50%;
  color: rgba(206,229,233,.96);
}
.atmo-mark svg { width: 30px; height: 30px; }
.atmo-brand-copy { display: flex; flex-direction: column; gap: 4px; }
.atmo-brand-copy > span { font-size: 15px; font-weight: 500; letter-spacing: .09em; color: rgba(244,239,228,.95); }
.atmo-brand-copy small { font-family: var(--mono); font-size: 6px; letter-spacing: .2em; color: rgba(150,160,160,.8); }
.atmo-status {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 7px; letter-spacing: .1em;
  color: rgba(160,168,166,.75); white-space: nowrap;
}
.atmo-status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(200,219,224,.7); }
.atmo-status i { width: 26px; height: 1px; background: rgba(235,240,242,.15); }
.atmo-status span:last-child { color: rgba(210,226,225,.86); }
.atmo-actions { display: flex; align-items: center; gap: 5px; pointer-events: auto; }
.atmo-actions a {
  display: flex; align-items: center; gap: 6px; height: 33px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(5,9,13,.52);
  font-family: var(--mono); font-size: 7.5px; color: rgba(211,205,193,.8);
  backdrop-filter: blur(13px); transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.atmo-actions a span { opacity: .55; }
.atmo-actions a:hover { border-color: rgba(200,219,224,.48); color: var(--text-bright); background: rgba(14,21,23,.7); }

/* Copy --------------------------------------------------------------------- */

.atmo-copy { position: fixed; left: 44px; top: 128px; z-index: 8; width: 420px; max-width: 44vw; pointer-events: none; }
.atmo-kicker { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 7px; letter-spacing: .16em; color: rgba(175,205,209,.8); }
.atmo-kicker i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(200,219,224,.7); }
.atmo-copy h1 { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(39px, 4.4vw, 62px); font-weight: 400; line-height: 1.06; letter-spacing: .02em; color: rgba(247,243,232,.97); overflow-wrap: anywhere; }
.atmo-star { display: block; margin-top: 7px; font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em; color: rgba(177,207,210,.78); }
.atmo-copy > p { margin: 16px 0 0; max-width: 340px; font-size: 11.5px; line-height: 1.8; color: rgba(151,160,162,.92); }
.atmo-meta { display: flex; align-items: center; gap: 12px; margin-top: 17px; font-family: var(--mono); font-size: 8px; color: rgba(190,181,164,.86); }
.atmo-meta span + span::before { content: "·"; margin-right: 12px; color: rgba(109,119,120,.7); }
.atmo-hint { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-family: var(--mono); font-size: 6.5px; letter-spacing: .05em; color: rgba(116,126,130,.7); }
.atmo-hint i { width: 17px; height: 1px; background: rgba(200,219,224,.4); }

/* Panel -------------------------------------------------------------------- */

.atmo-panel {
  position: fixed; top: 102px; right: 32px; bottom: 72px; z-index: 20;
  width: 358px; padding: 17px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 3px;
  background: rgba(6,9,12,.84);
  box-shadow: 0 22px 70px rgba(0,0,0,.3);
  backdrop-filter: blur(22px) saturate(.9); -webkit-backdrop-filter: blur(22px) saturate(.9);
  scrollbar-width: thin; scrollbar-color: rgba(170,196,200,.26) transparent;
  pointer-events: auto;
}
.atmo-panel-head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 6.5px; letter-spacing: .12em; color: rgba(140,149,149,.7); }
.atmo-select { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.atmo-select span { font-family: var(--mono); font-size: 6px; letter-spacing: .05em; color: rgba(117,127,128,.82); }
.atmo-select select, .atmo-control select {
  width: 100%; height: 33px; padding: 0 7px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 2px; outline: none;
  background: rgba(255,255,255,.025); font-family: var(--mono); font-size: 8.5px; color: rgba(230,226,216,.92);
}
.atmo-select option, .atmo-control option { background: #0a1014; color: #e9e5db; }
.atmo-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 14px;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.atmo-stats div { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; border-bottom: 1px solid rgba(235,240,242,.035); }
.atmo-stats div:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line-soft); }
.atmo-stats div:nth-last-child(-n+2) { border-bottom: 0; }
.atmo-stats span { font-family: var(--mono); font-size: 6px; letter-spacing: .05em; color: rgba(114,124,125,.86); }
.atmo-stats strong { font-family: var(--mono); font-size: 8.5px; font-weight: 400; color: rgba(225,221,211,.92); }

.atmo-controls { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.atmo-control { display: flex; flex-direction: column; gap: 4px; }
.atmo-control > span { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 6.5px; color: rgba(132,140,139,.82); }
.atmo-control b { font-weight: 400; }
.atmo-control em { font-style: normal; color: rgba(204,222,220,.9); }
.atmo-control input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 15px; margin: 0; background: transparent; cursor: pointer; }
.atmo-control input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: rgba(171,202,205,.32); }
.atmo-control input[type="range"]::-moz-range-track { height: 1px; background: rgba(171,202,205,.32); }
.atmo-control input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: #cfe1e1; box-shadow: 0 0 0 3px rgba(200,219,224,.12); }
.atmo-control input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: #cfe1e1; box-shadow: 0 0 0 3px rgba(200,219,224,.12); }
.atmo-select-inline { margin-top: 2px; }
.atmo-select-inline select { height: 31px; font-size: 8px; }

.atmo-spectrum-wrap { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.atmo-spectrum-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 6px; letter-spacing: .05em; color: rgba(126,137,137,.82); }
#atmo-spectrum { width: 100%; height: auto; display: block; margin-top: 5px; border-radius: 2px; }
.atmo-habit {
  display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08); border-left: 2px solid rgba(200,219,224,.45);
  background: rgba(255,255,255,.015);
}
.atmo-habit span { font-family: var(--mono); font-size: 6px; letter-spacing: .07em; color: rgba(117,127,128,.82); }
.atmo-habit strong { font-size: 11px; font-weight: 500; color: rgba(222,229,222,.92); }
.atmo-habit.is-habitable { border-left-color: rgba(137,193,169,.9); }
.atmo-habit.is-hot { border-left-color: rgba(216,135,91,.9); }
.atmo-habit.is-cold { border-left-color: rgba(139,171,208,.9); }
.atmo-note { margin: 11px 0 0; font-size: 8px; line-height: 1.6; color: rgba(100,110,111,.72); }

/* Footer ------------------------------------------------------------------- */

.atmo-footer {
  position: fixed; left: 34px; right: 34px; bottom: 17px; z-index: 10;
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 6px; letter-spacing: .07em; color: rgba(112,122,123,.6);
  pointer-events: none;
}
.atmo-footer i { width: 16px; height: 1px; background: rgba(200,219,224,.2); }

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1120px) {
  .atmo-copy { left: 30px; width: 360px; }
  .atmo-panel { right: 22px; width: 330px; }
  .atmo-topbar { padding: 0 24px; }
  .atmo-footer { left: 24px; right: 24px; }
}

@media (max-width: 900px) {
  .atmo-topbar { height: 66px; padding: 0 14px; }
  .atmo-mark { width: 35px; height: 35px; }
  .atmo-mark svg { width: 25px; height: 25px; }
  .atmo-brand-copy > span { font-size: 13px; }
  .atmo-brand-copy small { font-size: 5px; }
  .atmo-status { display: none; }
  .atmo-actions a { height: 30px; padding: 0 8px; font-size: 6.5px; }
  .atmo-actions a span { display: none; }
  .atmo-copy { top: 84px; left: 18px; width: min(320px, 84vw); max-width: none; }
  .atmo-copy h1 { font-size: 38px; }
  .atmo-copy > p { max-width: 290px; font-size: 10px; line-height: 1.7; }
  .atmo-hint { display: none; }
  .atmo-panel {
    top: auto; left: 8px; right: 8px; bottom: 38px;
    width: auto; max-height: min(46vh, 370px); padding: 14px;
  }
  .atmo-footer { left: 14px; right: 14px; bottom: 10px; font-size: 5.5px; }
}

@media (max-width: 560px) {
  .atmo-copy { top: 76px; width: min(285px, 82vw); }
  .atmo-copy h1 { font-size: 33px; }
  .atmo-copy > p { font-size: 9.5px; }
  .atmo-actions a { font-size: 6.2px; padding: 0 7px; }
  .atmo-panel { bottom: 32px; max-height: min(46vh, 360px); padding: 13px; }
  .atmo-stats strong { font-size: 8px; }
  .atmo-footer { bottom: 7px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .atmo-topbar { height: 51px; }
  .atmo-copy { top: 58px; left: 14px; width: 250px; }
  .atmo-copy h1 { font-size: 29px; }
  .atmo-copy > p, .atmo-hint { display: none; }
  .atmo-panel { top: 52px; right: 8px; left: auto; bottom: auto; width: 285px; max-height: 66vh; }
  .atmo-footer { display: none; }
}

.atmo-copy h1.is-long {
  font-size: clamp(29px, 3.3vw, 46px);
  letter-spacing: 0.01em;
}
@media (max-width: 900px) {
  .atmo-copy h1.is-long { font-size: 31px; }
}
@media (max-width: 560px) {
  .atmo-copy h1.is-long { font-size: 27px; }
}
