:root {
  color-scheme: dark;
  --ink: #f3f0ff;
  --muted: #aaa4c4;
  --surface: #18152a;
  --line: rgba(255, 255, 255, 0.11);
  --violet: #a98cff;
  --mint: #76f0c4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(115, 82, 205, .32), transparent 33rem),
    radial-gradient(circle at 90% 45%, rgba(35, 150, 133, .15), transparent 28rem),
    #0c0a16;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: radial-gradient(#fff 0.7px, transparent 0.7px);
  background-size: 25px 25px;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 40px; }
.hero { position: relative; padding-left: 88px; margin-bottom: 36px; }
.brand { position: absolute; left: 0; top: 4px; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 50%; }
.brand::before { content: ""; position: absolute; width: 42px; height: 42px; left: 8px; top: 5px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 28px rgba(169, 140, 255, .6); }
.brand span { position: absolute; width: 38px; height: 38px; left: 21px; top: 1px; border-radius: 50%; background: #0d0b17; }
.eyebrow { margin: 0 0 8px; color: var(--mint); font-size: 11px; letter-spacing: .18em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 68px); letter-spacing: -.055em; line-height: 1.06; }
.lead { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

.calculator, .results {
  border: 1px solid var(--line);
  background: rgba(24, 21, 42, .82);
  backdrop-filter: blur(12px);
}
.calculator { display: grid; grid-template-columns: 220px 1fr; min-height: 238px; }
.mode-switch { display: flex; flex-direction: column; padding: 24px; border-right: 1px solid var(--line); gap: 10px; }
.mode { cursor: pointer; text-align: left; border: 0; border-radius: 12px; padding: 15px 16px; color: var(--muted); background: transparent; transition: .2s ease; }
.mode:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.mode.active { color: #13101e; background: var(--ink); font-weight: 800; }
.input-panel { align-self: center; padding: 36px clamp(24px, 6vw, 64px); }
.input-panel label, .now-label { display: block; margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.time-row { display: flex; gap: 12px; }
input[type="time"] { min-width: 0; flex: 1; height: 56px; padding: 0 16px; color: var(--ink); background: #0f0d1a; border: 1px solid var(--line); border-radius: 12px; font-size: 26px; outline: none; }
input[type="time"]:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(169,140,255,.15); }
.primary { cursor: pointer; border: 0; border-radius: 12px; padding: 0 24px; min-height: 56px; color: #100c1a; background: var(--violet); font-weight: 900; }
.primary:hover { filter: brightness(1.09); transform: translateY(-1px); }
.primary.full { width: 100%; }
.hint { margin: 12px 0 0; color: #77718f; font-size: 12px; }
.now-time { margin: -4px 0 18px; font-size: 48px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.hidden { display: none; }

.results { margin-top: 18px; padding: clamp(24px, 5vw, 42px); }
.results-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
h2 { margin: 0; font-size: clamp(22px, 4vw, 32px); letter-spacing: -.03em; }
.legend { color: var(--muted); font-size: 12px; white-space: nowrap; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-card { position: relative; padding: 20px; min-height: 124px; border: 1px solid var(--line); background: rgba(10, 8, 20, .45); overflow: hidden; }
.time-card.recommended { border-color: rgba(118, 240, 196, .42); }
.time-card.recommended::after { content: ""; position: absolute; right: -28px; top: -28px; width: 64px; height: 64px; border-radius: 50%; background: rgba(118,240,196,.12); }
.time { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.cycle { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.day-mark { color: var(--violet); }
footer { margin: 18px 0 0; padding: 0 6px; color: #77718f; font-size: 12px; line-height: 1.7; }
footer strong { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .shell { padding-top: 34px; }
  .hero { padding-left: 0; padding-top: 74px; }
  .brand { top: 0; }
  .calculator { grid-template-columns: 1fr; }
  .mode-switch { flex-direction: row; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .mode { flex: 1; text-align: center; padding: 12px 8px; }
  .input-panel { padding: 26px 20px 30px; }
  .time-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 430px) {
  .time-row { flex-direction: column; }
  .primary { width: 100%; }
  .time-card { padding: 16px 12px; min-height: 112px; }
  .time { font-size: 26px; }
  .results { padding: 22px 16px; }
}
