:root {
  color-scheme: dark;
  --bg: #050b12;
  --panel: rgba(8, 19, 30, .82);
  --line: rgba(181, 225, 255, .18);
  --text: #edf7ff;
  --muted: #a8bbce;
  --accent: #79dbff;
  --mint: #aef3d1;
  --bad: #ff9da6;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button, input, select, textarea { font: inherit; }

.app-shell {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 14px;
  overflow: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 70% 14%, rgba(255, 239, 184, .14), transparent 12%),
    radial-gradient(circle at 26% 76%, rgba(82, 180, 157, .12), transparent 18%),
    linear-gradient(180deg, #020307 0%, #07111d 50%, #07130f 100%);
}

.moon {
  position: absolute;
  top: 9vh;
  right: 15vw;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0 18%, #fff4ca 58%, #ceb971 100%);
  box-shadow: 0 0 24px rgba(255,244,199,.52), 0 0 80px rgba(255,230,156,.2);
}

.mist {
  position: absolute;
  left: -10vw;
  right: -10vw;
  height: 18vh;
  border-radius: 50%;
  background: rgba(119, 219, 255, .08);
  filter: blur(36px);
}
.mist-a { bottom: 28vh; transform: rotate(-3deg); }
.mist-b { bottom: 14vh; background: rgba(174, 243, 209, .07); transform: rotate(4deg); }
.horizon { position: absolute; left: 0; bottom: 0; width: 100%; height: 58vh; }
.mountain.back { fill: rgba(10, 25, 30, .78); }
.mountain.front { fill: rgba(3, 13, 16, .96); }
.lake { fill: rgba(1, 6, 8, .98); }

.panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background: linear-gradient(180deg, rgba(12, 29, 45, .88), var(--panel));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .44);
  backdrop-filter: blur(20px);
}

.hero { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.hero p { margin: 0 0 4px; color: var(--mint); font-size: 12px; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(30px, 6vw, 44px); line-height: 1.05; }
.mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(121, 219, 255, .1);
  border: 1px solid rgba(121, 219, 255, .26);
}
.mark span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 24px var(--accent); }

.tabs, .segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.segmented { grid-template-columns: repeat(2, 1fr); }
.tab, .segment, .small-button, .icon-button {
  border: 1px solid rgba(181, 225, 255, .16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,.07);
  cursor: pointer;
}
.tab, .segment { height: 42px; }
.tab.is-active, .segment.is-active { color: #06121a; background: linear-gradient(135deg, var(--accent), var(--mint)); font-weight: 700; }

.tab-panel, .mode-panel { display: none; }
.tab-panel.is-active, .mode-panel.is-active { display: grid; gap: 12px; }

label { color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(181, 225, 255, .18);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--text);
  background: rgba(1, 8, 15, .44);
  outline: none;
}
input, select { height: 46px; }
textarea { min-height: 92px; padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(121, 219, 255, .12); }

.inline-row { display: grid; grid-template-columns: 1fr 56px; gap: 10px; }
.icon-button, .small-button { height: 46px; }
.small-button { padding: 0 14px; }
.primary-button {
  height: 50px;
  border: 0;
  border-radius: 8px;
  color: #04131b;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--mint));
  cursor: pointer;
}
.primary-button:disabled { opacity: .68; cursor: wait; }

.message { min-height: 22px; color: var(--muted); font-size: 14px; }
.message.good { color: var(--mint); }
.message.error { color: var(--bad); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.result-grid div {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(181, 225, 255, .14);
  background: rgba(255,255,255,.055);
}
.result-grid span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.result-grid strong { display: block; overflow-wrap: anywhere; font-size: 17px; line-height: 1.35; }
.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; }
.hint { color: var(--mint); font-size: 13px; }
.is-hidden { display: none !important; }

@media (max-width: 620px) {
  .app-shell { align-items: start; padding: 16px 12px; }
  .panel { padding: 20px; }
  .tabs { grid-template-columns: 1fr; }
  .hero h1 { font-size: 31px; }
  .moon { width: 62px; right: 8vw; }
  .horizon { height: 43vh; }
  .inline-row { grid-template-columns: 1fr 48px; gap: 8px; }
  .result-grid, .two-col { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
}
