/* ============================================================
 * solar-universe 页面样式
 * 包含：基础重置、主页面、抽屉、模态、控制面板、地球门牌号等
 * 移动端采用分层 z-index + 底部抽屉式信息卡，避免遮挡主图
 * ============================================================ */

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050608;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #fff;
}

/* ========== 主舞台与画布 ========== */
#stage {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1C2837, #050608);
}

#solarSystemCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#solarSystemCanvas:active {
    cursor: grabbing;
}

/* 名称层：覆盖在主画布之上，绝对定位、不可点击 */
#labelCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 不阻挡主画布的鼠标交互 */
    z-index: 2;
    display: block;
    /* 默认隐藏：等待核心资源就绪后由 JS 移除 hidden 类 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

/* 就绪态：JS 添加 .ready 后淡入显示，避免突兀 */
#labelCanvas.ready {
    opacity: 1;
    visibility: visible;
}

/* ========== 悬浮卡片：显示行星中文名称 ========== */
.planet-tooltip {
    position: fixed;
    pointer-events: none;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transform: translate(-50%, -130%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.planet-tooltip.visible {
    opacity: 1;
}

/* ========== 总控制面板：左下角 ========== */
.control-panel {
    position: fixed;
    left: 20px;
    bottom: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 280px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.control-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: #cfd8ff;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row label {
    color: #d3d8e0;
}

.control-row .value {
    color: #ffd86b;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.btn {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #3a62a8, #2e4c82);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.switch {
    position: relative;
    width: 38px;
    height: 20px;
    background: #555;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.switch.on {
    background: #2a8a5f;
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
}

.switch.on::after {
    left: 20px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 130px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #ffd86b;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #ffd86b;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

/* ========== 模态框：点击行星详情 ========== */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-mask.show {
    display: flex;
}

.modal {
    background: linear-gradient(160deg, #1a2540 0%, #0d1525 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 28px 32px;
    width: 480px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal h2 {
    font-size: 22px;
    margin-bottom: 6px;
    color: #ffd86b;
}

.modal .subtitle {
    font-size: 13px;
    color: #8b95ad;
    margin-bottom: 18px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin-bottom: 18px;
}

.param-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.param-item .label {
    font-size: 12px;
    color: #8b95ad;
    margin-bottom: 4px;
}

.param-item .val {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

/* ========== 右侧抽屉 ========== */
.drawer {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 340px;
    max-width: 90vw;
    background: linear-gradient(180deg, #14213d 0%, #0a1224 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 20px 22px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-header h2 {
    font-size: 18px;
    color: #ffd86b;
}

.drawer-header .close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
}

.drawer-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 抽屉内行星列表导航：水平滚动 + 选中态 */
.drawer-nav {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    scrollbar-width: thin;
    background: rgba(0, 0, 0, 0.15);
}

.planet-chip {
    flex: 0 0 auto;
    padding: 5px 12px;
    font-size: 12px;
    color: #d3d8e0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.planet-chip:hover {
    background: rgba(255, 216, 107, 0.18);
    border-color: rgba(255, 216, 107, 0.5);
    color: #ffd86b;
    transform: translateY(-1px);
}

.planet-chip:active {
    transform: translateY(0) scale(0.96);
}

.planet-chip.active {
    background: linear-gradient(135deg, #ffd86b, #ff9d3f);
    color: #1a1a1a;
    border-color: #ffd86b;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 216, 107, 0.4);
}

.drawer-body {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.7;
    font-size: 14px;
    color: #d3d8e0;
    /* 内容过渡动画 */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.drawer-body.switching {
    opacity: 0;
    transform: translateY(8px);
}

/* 抽屉chip和悬浮卡片显隐过渡 */
.drawer-nav,
.planet-tooltip {
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.drawer-nav.hide-names,
.planet-tooltip.hide-names {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

/* 抽屉标题、抽屉正文 planet-name 字段、chip 文字：可平滑隐藏 */
.drawer-header h2,
.drawer-body .planet-name,
.planet-chip {
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.drawer-header h2.hide-names,
.drawer-body .planet-name.hide-names {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

/* chip被关闭时不显示文字，但保留可点击的占位（无障碍） */
.planet-chip.hide-names {
    color: transparent;
    transition: color 0.25s ease, background 0.2s, border-color 0.2s, transform 0.2s;
}

.drawer-body p {
    margin-bottom: 10px;
}

/* 抽屉内行星标题色块 */
.planet-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-left: 3px solid var(--planet-color, #ffd86b);
    border-radius: 6px;
}

.planet-hero .planet-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.planet-hero .planet-type {
    font-size: 12px;
    color: #8b95ad;
    margin-top: 2px;
}

/* 抽屉内行星展示图：固定尺寸，与名称同行 */
.planet-image-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 56px; /* 不伸缩，固定尺寸 */
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.planet-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 等比缩放填充满，不变形 */
    object-position: center;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.planet-image-wrap img.loaded {
    opacity: 1;
}

.planet-image-wrap:hover img.loaded {
    transform: scale(1.1);
}

/* 图片加载失败时的占位图 */
.planet-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b95ad;
    font-size: 11px;
    gap: 2px;
}

.planet-image-placeholder .ph-icon {
    font-size: 22px;
    opacity: 0.6;
}

.planet-list-btn {
    position: fixed;
    right: 20px;
    top: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
}

.planet-list-btn:hover {
    background: rgba(40, 60, 100, 0.7);
}

/* ========== 性能降级提示 ========== */
.perf-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180, 60, 60, 0.85);
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 12px;
    display: none;
    z-index: 2000;
}

.perf-notice.show {
    display: block;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ========== 加载占位层：核心资源未就绪前显示，过渡更柔和 ========== */
#loadingIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 216, 107, 0.85);
    font-size: 13px;
    letter-spacing: 2px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#loadingIndicator.show {
    opacity: 1;
}

#loadingIndicator .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 3px;
    background: #ffd86b;
    border-radius: 50%;
    animation: blink 1.2s infinite ease-in-out;
}

#loadingIndicator .dot:nth-child(2) { animation-delay: 0.2s; }
#loadingIndicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

/* ============================================================
 * ========== 地球门牌号（宇宙层级）样式 ==========
 * z-index 分级：
 *   canvas(1) < title(18) < breadcrumb(20) < nav-btn(25) < drawer(30) < close/lang(40) < error(50)
 * ============================================================ */

/* 入口按钮：右上角行星介绍按钮左侧（前方），与行星介绍按钮样式保持一致 */
.universe-entry-btn {
    position: fixed;
    right: 130px;
    top: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 90;
}

.universe-entry-btn:hover {
    background: rgba(40, 60, 100, 0.7);
}

/* 宇宙容器：默认隐藏，打开时通过 .show 淡入 */
.universe-container {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1C2837 0%, #050608 70%);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.universe-container.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s linear 0s;
}

/* 宇宙主画布：z-index 显式设为 1，避免覆盖 UI 元素 */
#universeCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    /* 不拦截鼠标事件，让下方按钮可点击 */
    pointer-events: none;
}

/* 路径导航（面包屑）：顶部居中 */
.universe-breadcrumb {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 0 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 13px;
    line-height: 1;
    color: #d3d8e0;
    max-width: 90vw;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.universe-breadcrumb::-webkit-scrollbar { display: none; }

.universe-breadcrumb .crumb {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.universe-breadcrumb .crumb:hover {
    color: #ffd86b;
    background: rgba(255, 216, 107, 0.1);
}

.universe-breadcrumb .crumb.current {
    color: #ffd86b;
    font-weight: 600;
}

.universe-breadcrumb .sep {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

/* 上一级/下一级按钮 */
.universe-nav-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 25;
}

.universe-nav-btn:hover:not(:disabled) {
    background: rgba(93, 173, 226, 0.7);
    border-color: #5DADE2;
    transform: scale(1.05);
}

.universe-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 上一级/下一级按钮组：均位于左侧，左对齐 + 垂直排列 */
.universe-prev-btn { top: 90px; left: 30px; }
/* 下一级按钮：与上一级左对齐（left 一致），垂直间距 20px（48px 按钮 + 20px 间距） */
.universe-next-btn { top: 158px; left: 30px; }

/* 层级信息卡：右下角浮层（桌面端默认形态） */
.universe-info-card {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 320px;
    max-width: calc(100vw - 60px);
    background: linear-gradient(160deg, rgba(20, 33, 61, 0.85) 0%, rgba(10, 18, 36, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 3px solid var(--universe-accent, #5DADE2);
    border-radius: 12px;
    padding: 18px 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    color: #d3d8e0;
    font-size: 13px;
    line-height: 1.6;
    z-index: 30;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.universe-info-card.show {
    opacity: 1;
    transform: translateY(0);
}

.universe-info-card h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 600;
}

.universe-info-card .card-en {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.universe-info-card .card-desc {
    font-size: 12px;
    color: #b0b8c5;
    line-height: 1.6;
    margin-bottom: 12px;
}

.universe-info-card .card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.universe-info-card .card-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 10px;
    border-radius: 6px;
}

.universe-info-card .card-item .label {
    font-size: 11px;
    color: #8b95ad;
    margin-bottom: 2px;
}

.universe-info-card .card-item .value {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

.universe-info-card .card-credit {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 10px;
    text-align: right;
}

/* 层级标题：屏幕底部水平居中 */
.universe-level-title {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    z-index: 18;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.universe-level-title.show { opacity: 1; }

.universe-level-title .title-zh {
    font-size: 22px;
    font-weight: 700;
    color: #FFD86B;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.universe-level-title .level-tag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* 关闭按钮：右上角 */
.universe-close-btn {
    position: absolute;
    top: 24px;
    right: 30px;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.universe-close-btn:hover {
    background: rgba(180, 60, 60, 0.7);
}

/* 语言切换按钮：紧邻关闭按钮 */
.universe-lang-btn {
    position: absolute;
    top: 24px;
    right: 80px;
    height: 40px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.universe-lang-btn:hover {
    background: rgba(93, 173, 226, 0.7);
}

/* 资源加载失败提示：顶部居中浮层 */
.universe-load-error {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 20, 20, 0.92);
    border: 1px solid rgba(255, 120, 120, 0.4);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    color: #ffd0d0;
    z-index: 50;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    box-sizing: border-box;
}

/* 兜底：hidden 属性优先级最高，避免 display:flex 等样式覆盖导致元素仍可见 */
[hidden] { display: none !important; }

.universe-load-error .err-refresh {
    background: rgba(255, 120, 120, 0.2);
    border: 1px solid rgba(255, 150, 150, 0.5);
    color: #fff;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.universe-load-error .err-refresh:hover {
    background: rgba(255, 120, 120, 0.4);
}

/* ============================================================
 * 移动端适配（≤ 768px）：底部抽屉式信息卡，避免遮挡主图
 * ============================================================ */
@media (max-width: 768px) {
    /* 主页面：控制面板占满底部 */
    .control-panel {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    .drawer {
        width: 100%;
    }
    .planet-image-wrap {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }
    .planet-hero .planet-name {
        font-size: 15px;
    }

    /* 宇宙层级：路径导航顶部居中，预留左右空间 */
    .universe-breadcrumb {
        font-size: 11px;
        height: 36px;
        padding: 0 12px;
        top: 12px;
        max-width: calc(100vw - 120px);
    }

    /* 上下级按钮：右下角垂直排列，避开主图（主图居中且较高） */
    .universe-prev-btn {
        top: auto;
        bottom: 130px; /* 抽屉折叠态上方 */
        left: auto;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    .universe-next-btn {
        top: auto;
        bottom: 76px;
        left: auto;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    /* 层级标题：底部抽屉之上，避让主图与按钮 */
    .universe-level-title {
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 32px);
    }
    .universe-level-title .title-zh { font-size: 18px; }

    /* 关闭 / 语言按钮：移动端缩小 */
    .universe-close-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
    .universe-lang-btn {
        top: 12px;
        right: 56px;
        height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

    /* 信息卡：底部抽屉式（吸底），默认仅露出顶部手柄区域 */
    .universe-info-card {
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-top: 3px solid var(--universe-accent, #5DADE2);
        padding: 10px 16px 18px;
        font-size: 12px;
        /* 抽屉高度控制：默认折叠（露出约 80px 顶部手柄），展开后由 max-height 控制 */
        max-height: 80px;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    }
    .universe-info-card.expanded {
        max-height: 60vh; /* 展开后最多占屏 60% */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .universe-info-card h3 { font-size: 16px; }
    .universe-info-card .card-en { margin-bottom: 8px; }
    .universe-info-card .card-desc { font-size: 12px; margin-bottom: 8px; }
    .universe-info-card .card-grid { gap: 6px 8px; }
    .universe-info-card .card-item { padding: 6px 8px; }
    .universe-info-card .card-item .value { font-size: 12px; }

    /* 抽屉顶部手柄：装饰性小条，提示可上滑 */
    .universe-info-card::before {
        content: '';
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 3px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.3);
    }

    /* 抽屉标题区：可点击切换展开/收起 */
    .universe-info-card .card-header {
        cursor: pointer;
        user-select: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 8px;
    }
    .universe-info-card .card-toggle {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.55);
        transition: transform 0.3s ease;
    }
    .universe-info-card.expanded .card-toggle {
        transform: rotate(180deg);
    }

    /* 抽屉展开后内容淡入 */
    .universe-info-card .card-collapsible {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.25s ease 0.05s, max-height 0.3s ease;
    }
    .universe-info-card.expanded .card-collapsible {
        opacity: 1;
        max-height: 1000px;
    }

    /* 加载失败提示：移动端宽度自适应 */
    .universe-load-error {
        top: 60px;
        font-size: 12px;
        padding: 8px 12px;
        gap: 8px;
        max-width: calc(100vw - 24px);
    }
}

/* ============================================================
 * 超小屏适配（≤ 360px）：iPhone SE 等极小屏
 * ============================================================ */
@media (max-width: 360px) {
    .universe-breadcrumb {
        font-size: 10px;
        padding: 0 8px;
        max-width: calc(100vw - 100px);
    }
    .universe-prev-btn,
    .universe-next-btn {
        width: 40px;
        height: 40px;
    }
    .universe-prev-btn { bottom: 120px; right: 12px; }
    .universe-next-btn { bottom: 68px; right: 12px; }
    .universe-level-title { bottom: 72px; }
    .universe-level-title .title-zh { font-size: 16px; }
    .universe-info-card { max-height: 72px; }
}

/* ============================================================
 * 减少动效：禁用所有过渡
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* 地球门牌号专属的减少动效 */
@media (prefers-reduced-motion: reduce) {
    .universe-container,
    .universe-info-card,
    .universe-level-title,
    .universe-breadcrumb .crumb,
    .universe-nav-btn {
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
 * 低性能模式：关闭 GPU 昂贵的 backdrop-filter 和模糊特效
 * ============================================================ */
body.low-perf .control-panel,
body.low-perf .planet-tooltip,
body.low-perf .modal-mask,
body.low-perf .drawer,
body.low-perf .planet-list-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.low-perf canvas {
    will-change: auto !important;
}

body.low-perf .universe-breadcrumb,
body.low-perf .universe-nav-btn,
body.low-perf .universe-info-card,
body.low-perf .universe-close-btn,
body.low-perf .universe-lang-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
