/* ===== 基础重置 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: #000;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    font-family:
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    /* 底部留出空间（右侧面板不占底部空间了）*/
    padding-bottom: 20px;
}

/* ===== 封面区域 ===== */
#introwrap {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 4;
}

#titlecard {
    text-align: center;
    padding: 0 20px;
}

#titlecard h1 {
    font-size: clamp(1.4rem, 5vw, 2.8rem);
    color: #eaeaea;
    font-weight: 200;
    letter-spacing: 0.05em;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

#titlecard h1 span {
    display: block;
    font-size: 0.55em;
    color: #888;
    margin-top: 0.5em;
    letter-spacing: 0.02em;
}

.scalewrap {
    margin-top: 2.5rem;
    text-align: center;
}

.scalewrap img {
    display: none;
}

/* 比例尺卡片 */
.scale-card {
    display: inline-block;
    border: 1px solid #1e3a3f;
    border-radius: 10px;
    padding: 18px 28px;
    background: rgba(10, 30, 35, 0.6);
    text-align: left;
    max-width: min(420px, 88vw);
}

.scale-card .sc-title {
    font-size: 0.7rem;
    color: #3a7a85;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.scale-card .sc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.scale-card .sc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.scale-card .sc-label {
    font-size: 0.82rem;
    color: #7ab8c2;
    flex: 1;
}

.scale-card .sc-val {
    font-size: 0.82rem;
    color: #3d6e75;
    text-align: right;
    white-space: nowrap;
}

.scale-card .sc-divider {
    height: 1px;
    background: #1a3035;
    margin: 12px 0;
}

.scale-card .sc-footnote {
    font-size: 0.72rem;
    color: #2e5a62;
    line-height: 1.7;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounce 2s infinite;
}

.scroll-hint::after {
    content: "▼";
    font-size: 1rem;
    color: #444;
    margin-top: 4px;
}

@keyframes bounce {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(6px);
    }
}

/* ===== 大空间：竖向展开 ===== */
#bigspace {
    position: relative;
    width: 100%;
    height: 1702774px;
    background-color: #000;
}

/* 行星/天体都沿竖轴排列，水平居中 */
.planetwrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
}

/* ===== 行星点 ===== */
.planet-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== 标签文字（统一右侧）===== */
.labeltext {
    position: absolute;
    left: calc(50% + 24px);
    font-weight: 200;
    font-size: 2em;
    color: #eaeaea;
    text-transform: uppercase;
    white-space: nowrap;
}

.labeltext img.arrow {
    display: none; /* 竖版箭头不需要 */
}

/* 月球标签在左侧（因为月球紧挨地球，右侧会和地球标签重叠） */
#moontxt {
    left: auto;
    right: calc(50% + 24px);
    text-align: right;
    font-size: 1.6em;
}

/* 太阳文字居中在圆内，覆盖 .labeltext 的右侧定位 */
#suntxt {
    left: 0 !important;
    transform: none !important;
    width: 400px;
    text-align: center;
    color: #000;
    font-size: 2em;
    top: 184px;
}

/* 木星卫星、土星卫星标签 */
#jupitermoons,
#saturnmoons {
    position: absolute;
    left: calc(50% + 50px);
    font-size: 0.4em;
    color: #f0e8e0;
}

#jupitermoons span,
#saturnmoons span {
    display: block;
    margin: 4px 0;
}

/* ===== 文章段落 ===== */
.essay {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, 88vw);
    font-size: 0.95em;
    color: #cdcdcd;
    line-height: 1.8;
    text-align: justify;
}

.essay a {
    color: #fff;
    text-decoration: none;
}

/* ===== 固定 UI 元素 ===== */

/* 距离计数器 — 左上角 */
#distance-counter {
    position: fixed;
    top: 16px;
    left: 16px;
    color: #aaa;
    font-size: 13px;
    z-index: 100;
    cursor: pointer;
    user-select: none;
}

#counter {
    display: inline;
    cursor: pointer;
}

#selectarrow svg,
#explore-toggle svg {
    display: inline;
    vertical-align: middle;
    opacity: 0.7;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    cursor: pointer;
}

#unitselect {
    position: absolute;
    top: 24px;
    left: 0;
    display: none;
    background: #000;
    border: 1px solid #333;
    z-index: 200;
    min-width: 200px;
}

#unit-footnote {
    font-size: 11px;
    color: #555;
    padding: 4px 12px 8px;
    border-top: 1px solid #1a1a1a;
}

#unitselect ul,
#langselect ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

#unitselect li a {
    display: block;
    font-size: 13px;
    padding: 6px 12px;
    color: #aaa;
    text-decoration: none;
    white-space: nowrap;
}

#unitselect li a:hover {
    color: #fff;
}

/* 版权信息 — 右上角 */
#credit {
    position: fixed;
    top: 12px;
    right: 16px;
    font-size: 11px;
    color: #555;
    z-index: 100;
}

/* ===== 右侧悬浮面板（替代底部导航）===== */
#side-panel {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

/* 面板主体（可展开/收起）*/
#side-panel-inner {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #222;
    border-right: none;
    border-radius: 8px 0 0 8px;
    overflow: hidden;
    max-height: 0;
    transition:
        max-height 0.35s ease,
        opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

#side-panel.open #side-panel-inner {
    max-height: 520px;
    opacity: 1;
    pointer-events: auto;
}

#side-panel-inner ul {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

#side-panel-inner li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px 7px 12px;
    color: #aaa;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 0.15s,
        background 0.15s;
}

#side-panel-inner li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

#side-panel-inner li a img,
#side-panel-inner li a svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    flex-shrink: 0;
    overflow: visible;
}

#side-panel-inner li a:hover img,
#side-panel-inner li a:hover svg {
    opacity: 1;
}

#side-panel-inner .panel-divider {
    height: 1px;
    background: #1e1e1e;
    margin: 4px 12px;
}

/* 切换按钮（竖排文字）*/
#side-toggle {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #222;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #666;
    font-size: 11px;
    letter-spacing: 0.15em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 12px 8px;
    cursor: pointer;
    user-select: none;
    transition:
        color 0.2s,
        background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

#side-toggle:hover {
    color: #ccc;
    background: rgba(20, 20, 20, 0.95);
}

#side-toggle .toggle-arrow {
    font-size: 10px;
    writing-mode: horizontal-tb;
    transition: transform 0.3s;
}

#side-panel.open #side-toggle .toggle-arrow {
    transform: rotate(180deg);
}

/* ===== 探索更多 — 右上角下拉 ===== */
#explore-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    font-size: 13px;
    z-index: 200;
}

#explore-toggle {
    color: #aaa;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

#explore-toggle:hover {
    color: #aaa;
}

#explore-panel-inner {
    position: absolute;
    top: 22px;
    right: 0;
    background: #000;
    border: 1px solid #333;
    display: none;
    min-width: 160px;
    z-index: 201;
}

#explore-panel.open #explore-panel-inner {
    display: block;
}

#explore-panel-inner ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

#explore-panel-inner li a {
    display: block;
    padding: 6px 12px;
    color: #aaa;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

#explore-panel-inner li a:hover {
    color: #fff;
}

/* 下一个目标提示条（右下角，可点击跳转）*/
#next-hint {
    position: fixed;
    bottom: 40px;
    right: 70px;
    color: #fff;
    font-size: 11px;
    text-align: right;
    z-index: 100;
    line-height: 1.6;
    pointer-events: auto;
    cursor: pointer;
}

#next-hint:hover .hint-label {
    color: #888;
}
#next-hint:hover .hint-name {
    color: #aaa;
}

/* ===== 各天体定位 (top 对应原 left 值) ===== */
#sunwrap {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 400px;
}

#sun {
    position: relative;
    height: 400px;
    width: 400px;
    fill: #fde301;
    display: block;
}

#mercury {
    top: 16666px;
    height: 1px;
    width: 1px;
    fill: #ffcc00;
}
#merctxt {
    top: 16560px;
}
#venus {
    top: 31138px;
    height: 4px;
    width: 4px;
    fill: #86ffca;
}
#venustxt {
    top: 31040px;
}
#earth {
    top: 43053px;
    height: 3px;
    width: 3px;
    fill: #01fdfa;
}
#earthtxt {
    top: 43000px;
}
#moon {
    top: 43164px;
    height: 1px;
    width: 1px;
    fill: #fff;
}
#moontxt {
    top: 43175px;
}
#mars {
    top: 65586px;
    height: 2px;
    width: 2px;
    fill: #ff7443;
}
#marstxt {
    top: 65480px;
}
#jupiter {
    top: 224041px;
    height: 40px;
    width: 40px;
    fill: #ffa043;
}
#jupitertxt {
    top: 224090px;
}
#jupitermoons {
    top: 224162px;
}
#io {
    top: 0;
}
#europa {
    top: 30px;
}
#ganymede {
    top: 60px;
}
#callisto {
    top: 90px;
}
#saturn {
    position: absolute;
    top: 412397px;
    height: 34px;
    width: 65px;
    left: 50%;
    transform: translateX(-50%);
}
#saturntxt {
    top: 412450px;
}
#saturnmoons {
    top: 412742px;
}
#titan {
    top: 0;
}
#uranus {
    top: 827961px;
    height: 14px;
    width: 14px;
    fill: #18e6ff;
}
#uranustxt {
    top: 828000px;
}
#neptune {
    top: 1295901px;
    height: 14px;
    width: 14px;
    fill: #45b9ff;
}
#neptunetxt {
    top: 1295940px;
}
#pluto {
    top: 1699774px;
    height: 1px;
    width: 1px;
    fill: #d9f5ff;
}
#plutotxt {
    top: 1699800px;
}

/* 颜色 */
#merctxt {
    color: #ffcc00;
}
#venustxt {
    color: #86ffca;
}
#earthtxt {
    color: #01fdfa;
}
#marstxt {
    color: #ff7443;
}
#jupitertxt {
    color: #ffa043;
}
#saturntxt {
    color: #f9d293;
}
#uranustxt {
    color: #18e6ff;
}
#neptunetxt {
    color: #45b9ff;
}
#plutotxt {
    color: #d9f5ff;
}

/* 冥王星附注 */
#we-still-love {
    font-size: 0.25em;
    text-transform: none;
    display: block;
}

/* ===== 手机响应式微调 ===== */
@media (max-width: 480px) {
    .labeltext {
        font-size: 1.4em;
    }
    .essay {
        font-size: 0.85em;
    }
    #titlecard h1 {
        font-size: 1.3rem;
    }
}

#beian {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: #2e5a62;
    z-index: 100;
}

#beian a {
    color: #2e5a62;
    text-decoration: none;
}

#beian a:hover {
    color: #7ab8c2;
}
