		:root {
		    color-scheme: light;
		    --bg: #f2efe6;
		    --panel: rgba(30, 19, 7, 0.72);
		    --panel-border: rgba(255, 255, 255, 0.14);
		    --ink: #32261a;
		    --muted: #776551;
		    --accent: #e08b2f;
		    --accent-strong: #c45c18;
		    --good: #1f8b4c;
		    --bad: #c4432a;
		    --grid: rgba(50, 38, 26, 0.08);
		    --shadow: 0 18px 48px rgba(75, 50, 18, 0.18);
		    --radius: 24px;
		}

		* {
		    box-sizing: border-box;
		}

		body {
		    margin: 0;
		    min-height: 100vh;
		    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI", sans-serif;
		    color: var(--ink);
		    transition: background 360ms ease, color 260ms ease;
		    background:
		        radial-gradient(circle at top left, rgba(255, 220, 156, 0.8), transparent 30%),
		        radial-gradient(circle at right 15%, rgba(255, 182, 120, 0.45), transparent 28%),
		        linear-gradient(145deg, #f8f5ee 0%, #efe7d8 48%, #e5d7bd 100%);
		}

		body.twilight-mode {
		    background:
		        radial-gradient(circle at top left, rgba(255, 184, 128, 0.3), transparent 28%),
		        radial-gradient(circle at right 15%, rgba(122, 98, 198, 0.22), transparent 30%),
		        linear-gradient(160deg, #f0d2b2 0%, #9c7da7 42%, #3e456c 100%);
		}

		body.night-mode {
		    color: #e8edf9;
		    background:
		        radial-gradient(circle at 18% 12%, rgba(198, 217, 255, 0.18), transparent 18%),
		        radial-gradient(circle at 78% 14%, rgba(147, 182, 255, 0.16), transparent 16%),
		        linear-gradient(165deg, #0f1830 0%, #14274b 38%, #050814 100%);
		}

		body::before {
		    content: "";
		    position: fixed;
		    inset: 0;
		    pointer-events: none;
		    background-image:
		        linear-gradient(var(--grid) 1px, transparent 1px),
		        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
		    background-size: 30px 30px;
		    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 80%);
		}

		.app {
		    position: relative;
		    min-height: 100vh;
		    overflow: hidden;
		}

		.panel {
		    position: absolute;
		    top: 12px;
		    left: 12px;
		    z-index: 6;
		    display: grid;
		    grid-template-columns: 1fr;
		    align-items: start;
		    gap: 10px;
		    width: min(332px, calc(100vw - 24px));
		    max-height: calc(100vh - 24px);
		    padding: 16px;
		    border: 1px solid var(--panel-border);
		    border-radius: 28px;
		    background: var(--panel);
		    box-shadow: var(--shadow);
		    backdrop-filter: blur(18px) saturate(1.08);
		    overflow-x: hidden;
		    overflow-y: auto;
		    pointer-events: auto;
		    transition: transform 220ms ease, opacity 220ms ease;
		}

		.panel::-webkit-scrollbar {
		    width: 6px;
		}

		.panel::-webkit-scrollbar-thumb {
		    background: rgba(255, 255, 255, 0.22);
		    border-radius: 999px;
		}

		.hero {
		    display: grid;
		    gap: 12px;
		    padding: 2px 2px 6px;
		}

		.eyebrow {
		    display: inline-flex;
		    align-items: center;
		    width: fit-content;
		    gap: 8px;
		    padding: 6px 12px;
		    border-radius: 999px;
		    background: rgba(255, 255, 255, 0.08);
		    color: #fdf8ef;
		    font-size: 11px;
		    letter-spacing: 0.08em;
		    text-transform: uppercase;
		}

		h1 {
		    margin: 0;
		    font-size: clamp(30px, 4vw, 38px);
		    line-height: 1.05;
		    color: #fdf8ef;
		}

		.hero p {
		    margin: 0;
		    color: rgba(253, 248, 239, 0.82);
		    line-height: 1.6;
		}

		.hero-grid {
		    display: grid;
		    grid-template-columns: repeat(3, minmax(0, 1fr));
		    gap: 8px;
		}

		.hero-metric {
		    display: grid;
		    gap: 4px;
		    padding: 10px 12px;
		    border-radius: 16px;
		    background: rgba(255, 255, 255, 0.08);
		    border: 1px solid rgba(255, 255, 255, 0.1);
		}

		.hero-metric strong {
		    font-size: 11px;
		    color: #fff;
		    font-weight: 700;
		}

		.hero-metric span {
		    font-size: 10px;
		    color: rgba(253, 248, 239, 0.72);
		}

		.section p,
		.hint {
		    margin: 0;
		    color: var(--muted);
		    line-height: 1.55;
		}

		.section {
		    display: grid;
		    gap: 8px;
		    padding: 12px 14px;
		    min-width: 0;
		    border-radius: 18px;
		    background: rgba(255, 255, 255, 0.08);
		    border: 1px solid rgba(255, 255, 255, 0.1);
		    backdrop-filter: blur(12px);
		}

		.section-head {
		    display: flex;
		    align-items: flex-start;
		    justify-content: space-between;
		    gap: 10px;
		}

		.section-title {
		    display: flex;
		    align-items: center;
		    justify-content: space-between;
		    gap: 6px;
		    margin: 0;
		    font-size: 12px;
		    color: #fdf8ef;
		    letter-spacing: 0.04em;
		}

		.section-subtitle {
		    margin: 4px 0 0;
		    font-size: 11px;
		    line-height: 1.5;
		    color: rgba(253, 248, 239, 0.72);
		}

		.grid {
		    display: grid;
		    grid-template-columns: 1fr 1fr;
		    gap: 6px;
		}

		label {
		    display: grid;
		    gap: 4px;
		    font-size: 11px;
		    color: rgba(253, 248, 239, 0.82);
		}

		input,
		button {
		    font: inherit;
		}

		input[type="number"],
		input[type="date"] {
		    width: 100%;
		    border: 1px solid rgba(255, 255, 255, 0.14);
		    border-radius: 12px;
		    padding: 8px 10px;
		    color: #fdf8ef;
		    background: rgba(255, 255, 255, 0.08);
		    outline: none;
		    transition: border-color 160ms ease, box-shadow 160ms ease;
		    font-size: 12px;
		}

		input[type="number"]::placeholder,
		input[type="date"]::placeholder {
		    color: rgba(253, 248, 239, 0.5);
		}

		input[type="range"] {
		    width: 100%;
		    accent-color: var(--accent);
		}

		input:focus {
		    border-color: rgba(224, 139, 47, 0.72);
		    box-shadow: 0 0 0 3px rgba(224, 139, 47, 0.12);
		}

		button {
		    border: none;
		    border-radius: 12px;
		    padding: 8px 10px;
		    color: #fff;
		    cursor: pointer;
		    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
		    box-shadow: none;
		    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
		    font-size: 12px;
		}

		button:hover {
		    transform: translateY(-1px);
		    box-shadow: 0 16px 28px rgba(196, 92, 24, 0.28);
		    filter: saturate(1.05);
		}

		button.secondary {
		    color: #fdf8ef;
		    background: rgba(255, 255, 255, 0.08);
		    box-shadow: none;
		    border: 1px solid rgba(255, 255, 255, 0.14);
		}

		.button-row {
		    display: grid;
		    grid-template-columns: 1fr 1fr;
		    gap: 6px;
		}

		.button-row.mode-toggle {
		    grid-template-columns: repeat(3, 1fr);
		}

		.time-row {
		    display: grid;
		    gap: 6px;
		}

		.time-meta,
		.stats {
		    display: flex;
		    align-items: center;
		    justify-content: space-between;
		    gap: 8px;
		    flex-wrap: wrap;
		}

		.chip,
		.status-pill {
		    display: inline-flex;
		    align-items: center;
		    gap: 6px;
		    border-radius: 999px;
		    padding: 6px 10px;
		    font-size: 11px;
		    font-weight: 600;
		}

		.chip {
		    color: #fdf8ef;
		    background: rgba(255, 255, 255, 0.08);
		}

		.status-pill.sun {
		    color: #fff;
		    background: linear-gradient(135deg, var(--good) 0%, #56a948 100%);
		}

		.status-pill.moon {
		    color: #fff;
		    background: linear-gradient(135deg, #5578c8 0%, #86aee8 100%);
		}

		.status-pill.shade {
		    color: #fff;
		    background: linear-gradient(135deg, var(--bad) 0%, #7d1f19 100%);
		}

		.status-stack,
		.result-badges {
		    display: grid;
		    gap: 6px;
		    justify-items: end;
		}

		.result-summary {
		    display: grid;
		    gap: 6px;
		    padding: 12px;
		    border-radius: 16px;
		    background: linear-gradient(135deg, rgba(224, 139, 47, 0.16), rgba(255, 255, 255, 0.05));
		    border: 1px solid rgba(255, 255, 255, 0.1);
		}

		.result-kicker {
		    margin: 0;
		    font-size: 10px;
		    font-weight: 700;
		    letter-spacing: 0.08em;
		    text-transform: uppercase;
		    color: rgba(253, 248, 239, 0.64);
		}

		.is-hidden {
		    display: none !important;
		}

		.mode-toggle button.active {
		    color: #fff;
		    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
		    border-color: transparent;
		}

		.stats {
		    display: grid;
		    grid-template-columns: repeat(2, minmax(0, 1fr));
		    gap: 8px;
		}

		.stat {
		    min-width: 0;
		    padding: 10px 12px;
		    border-radius: 14px;
		    background: rgba(255, 255, 255, 0.08);
		    border: 1px solid rgba(255, 255, 255, 0.1);
		}

		.stat strong {
		    display: block;
		    margin-bottom: 2px;
		    font-size: 10px;
		    color: rgba(253, 248, 239, 0.7);
		    font-weight: 600;
		}

		.stat span {
		    font-size: 13px;
		    color: #fdf8ef;
		    font-weight: 700;
		}

		.section p {
		    display: none;
		}

		.hero p,
		.section-tip,
		#locationFeedback,
		#orientationFeedback,
		#resultText {
		    display: block;
		}

		#resultText {
		    margin: 0;
		    color: #fdf8ef;
		    line-height: 1.65;
		    font-size: 13px;
		    font-weight: 600;
		}

		.section-tip {
		    font-size: 11px;
		    color: rgba(253, 248, 239, 0.78) !important;
		}

		.section-subtitle {
		    display: block !important;
		}

		.result-kicker {
		    display: block !important;
		}

		.value-note {
		    display: block;
		    font-size: 11px;
		    color: rgba(253, 248, 239, 0.72);
		    line-height: 1.45;
		}

		#locationFeedback,
		#orientationFeedback {
		    margin: 0;
		    min-height: 1.4em;
		    font-size: 11px;
		    line-height: 1.4;
		    color: rgba(253, 248, 239, 0.82);
		    word-break: break-word;
		}

		.viewport {
		    position: fixed;
		    inset: 0;
		    overflow: hidden;
		    border-radius: 0;
		    border: none;
		    transition: background 360ms ease, box-shadow 360ms ease;
		    background:
		        radial-gradient(circle at top, rgba(255, 240, 206, 0.4), transparent 30%),
		        linear-gradient(180deg, #f9f0dd 0%, #efe0c4 32%, #c7b59b 100%);
		}

		.viewport.twilight {
		    background:
		        radial-gradient(circle at top, rgba(255, 199, 132, 0.24), transparent 28%),
		        radial-gradient(circle at 50% 0%, rgba(161, 176, 255, 0.18), transparent 42%),
		        linear-gradient(180deg, #efc696 0%, #8f7595 35%, #4a4f6c 100%);
		}

		.viewport.night {
		    background:
		        radial-gradient(circle at 50% 8%, rgba(182, 206, 255, 0.18), transparent 24%),
		        radial-gradient(circle at 18% 20%, rgba(103, 141, 234, 0.14), transparent 30%),
		        linear-gradient(180deg, #15284c 0%, #101c38 30%, #09111f 100%);
		    box-shadow: inset 0 0 180px rgba(2, 6, 20, 0.38);
		}

		#scene {
		    position: absolute;
		    inset: 0;
		}

		.overlay {
		    position: absolute;
		    inset: 0;
		    pointer-events: none;
		    padding: 12px;
		    transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
		}

		.overlay-hidden {
		    opacity: 0;
		    transform: translate3d(0, 10px, 0);
		    filter: blur(2px);
		}

		.overlay-actions {
		    position: absolute;
		    top: 12px;
		    right: 12px;
		    display: flex;
		    gap: 8px;
		    pointer-events: auto;
		}

		.overlay-actions button {
		    padding-inline: 12px;
		    background: rgba(30, 19, 7, 0.58);
		    border: 1px solid rgba(255, 255, 255, 0.16);
		    backdrop-filter: blur(12px);
		}

		.panel-toggle {
		    display: none;
		}

		.fullscreen-toggle {
		    display: none;
		}

		.overlay-top,
		.overlay-bottom {
		    display: flex;
		    flex-direction: column;
		    align-items: flex-end;
		    justify-content: flex-start;
		    gap: 6px;
		    flex-wrap: nowrap;
		}

		.overlay-top {
		    position: absolute;
		    right: 12px;
		    bottom: 12px;
		}

		.overlay-card {
		    max-width: min(280px, 100%);
		    padding: 10px 12px;
		    border-radius: 16px;
		    color: #fdf8ef;
		    background: rgba(30, 19, 7, 0.55);
		    border: 1px solid rgba(255, 255, 255, 0.14);
		    backdrop-filter: blur(12px);
		}

		.overlay-card h2 {
		    margin: 0 0 2px;
		    font-size: 12px;
		    letter-spacing: 0.03em;
		    text-transform: none;
		}

		.overlay-card p {
		    margin: 0;
		    font-size: 11px;
		    line-height: 1.5;
		    color: rgba(253, 248, 239, 0.86);
		}

		.hint-desktop,
		.hint-touch {
		    display: none;
		}

		.legend {
		    display: grid;
		    gap: 6px;
		    font-size: 11px;
		    justify-items: end;
		}

		.legend span {
		    display: inline-flex;
		    align-items: center;
		    gap: 6px;
		    padding: 6px 10px;
		    border-radius: 999px;
		    background: rgba(30, 19, 7, 0.55);
		    color: #fdf8ef;
		}

		.dot {
		    width: 8px;
		    height: 8px;
		    border-radius: 50%;
		}

		.dot.sun {
		    background: #ffc14f;
		}

		.dot.moon {
		    background: #d3e0ff;
		}

		.dot.track {
		    background: #78b7ff;
		}

		.dot.moon-track {
		    background: #8faeff;
		}

		.dot.window {
		    background: #9de2ff;
		}

		@media (max-width: 1100px) {
		    .panel {
		        width: min(320px, calc(100vw - 20px));
		        top: 12px;
		        left: 12px;
		        max-height: calc(100vh - 24px);
		    }

		    .overlay {
		        padding-bottom: 12px;
		    }

		    .overlay-top {
		        right: 12px;
		        bottom: 12px;
		    }
		}

		@media (hover: hover) and (pointer: fine) {
		    .hint-desktop {
		        display: block;
		    }
		}

		@media (hover: none), (pointer: coarse) {
		    .hint-touch {
		        display: block;
		    }
		}

		@media (max-width: 720px) {
		    .app {
		        display: grid;
		        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
		        height: 100svh;
		        min-height: 100svh;
		    }

		    body {
		        overflow: hidden;
		    }

		    .viewport {
		        position: relative;
		        min-height: 0;
		    }

		    .panel {
		        position: relative;
		        top: auto;
		        left: auto;
		        width: 100%;
		        max-height: none;
		        height: 100%;
		        padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
		        border-top: 1px solid rgba(255, 255, 255, 0.14);
		        border-radius: 24px 24px 0 0;
		        background: rgba(30, 19, 7, 0.72);
		        box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.18);
		        backdrop-filter: blur(14px);
		        overflow-x: hidden;
		        overflow-y: auto;
		    }

		    .grid,
		    .button-row {
		        grid-template-columns: 1fr;
		    }

		    .panel-toggle {
		        display: none;
		    }

			.fullscreen-toggle {
			    display: inline-flex;
			}

		    .overlay {
		        padding: 10px;
		    }

		    .overlay-top {
		        right: 10px;
		        bottom: 10px;
		    }

		    .overlay-top,
		    .overlay-card,
		    .legend,
		    .status-stack {
		        max-width: calc(100vw - 20px);
		    }

		    .hero,
		    .section {
		        min-width: 0;
		        max-width: none;
		    }

		    .hero-grid,
		    .stats {
		        grid-template-columns: 1fr;
		    }

		    .section-head {
		        flex-direction: column;
		    }

		    .result-badges {
		        justify-items: start;
		    }
		}