@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');

/* @keyframes scale-up 和 .scale-up-animation 定义在下方 1150+ 行，此处已移除重复定义 */

:root {
    --sg-gold: #b28e4a;
    --sg-black: #0a0a0c;
    --sg-white: #ffffff;
    --sg-slate-light: #f8fafc;
    --sg-slate-border: #e2e8f0;
    --sg-text-muted: #64748b;
    --sg-accent-glow: rgba(178, 142, 74, 0.15);
    --sg-float-left: 2rem;
    --sg-float-right: 2rem;
    --sg-float-bottom: 2rem;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    position: relative;
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: var(--sg-black);
    -webkit-font-smoothing: antialiased;
}

#homeRoot {
    min-height: 100vh;
    background-color: #ffffff;
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.055) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.055) 1px, transparent 1px),
        linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 44px 44px, 44px 44px, 220px 220px, 220px 220px;
    background-position: 0 0, 0 0, 0 0, 0 0;
}

/* 隐藏全局滚动条但保持功能 */
::-webkit-scrollbar {
    display: none;
    width: 0 !important;
}

* {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.serif-math {
    font-family: 'Times New Roman', 'Georgia', serif;
    font-style: italic;
}

.font-outfit {
    font-family: 'Outfit', sans-serif;
}

/* --- 首页画廊栅格 (必须保留!) --- */
/* --- 黄金四列画廊 (Precision 4-Column Grid) --- */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0.75rem 0 4rem 0;
    /* 极致压缩间距 */
}

@media (max-width: 1536px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 1280px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.5rem 0.5rem 2rem 0.5rem;
        width: 100%;
    }
}

.exhibition-card {
    position: relative;
    background: var(--sg-white);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.exhibition-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.observation-zone {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--sg-slate-light);
    /* 改为淡灰色，杜绝黑影 */
    overflow: hidden;
    position: relative;
}

.observation-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.exhibition-card:hover .observation-zone img {
    transform: scale(1.08);
    filter: saturate(1.1) brightness(1.05);
    opacity: 1;
}

.card-locked {
    filter: grayscale(0.8);
    opacity: 0.85;
    cursor: not-allowed !important;
}

.card-locked:hover {
    transform: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 20;
    opacity: 0;
    transition: all 0.4s ease;
}

.exhibition-card.card-locked .lock-overlay {
    opacity: 1;
}

.lock-icon-box {
    width: 48px;
    height: 48px;
    background: white;
    color: #0f172a;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.75rem;
}

.lock-text {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* --- 卡片信息层 (Card Meta Overlay) --- */
.card-content-premium {
    padding: 24px 28px 32px;
    background: white;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-tag {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sg-accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-tag::before {
    content: '';
    width: 8px;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sg-black);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--sg-slate-500);
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .card-content-premium {
        padding: 10px 12px 14px;
    }

    .card-title {
        font-size: 0.9rem;
        margin-bottom: 2px;
        font-weight: 700;
        line-height: 1.2;
    }

    .card-subtitle {
        font-size: 8px;
        margin-bottom: 10px;
    }

    .card-tag {
        font-size: 7px;
        margin-bottom: 6px;
    }

    .card-footer {
        padding-top: 8px;
    }

    .card-formula {
        font-size: 9px;
    }
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.5s ease;
}

.card-formula {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 12px;
    color: var(--sg-slate-300);
}

.card-btn {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sg-black);
    border-bottom: 2px solid var(--sg-black);
    padding-bottom: 2px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.exhibition-card:hover .card-btn {
    opacity: 1;
    transform: translateX(0);
}

.exhibition-card:hover .card-formula {
    color: var(--sg-black);
}

.nav-link {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: #94a3b8;
    transition: 0.4s;
    padding: 10px 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

@media (max-width: 640px) {
    .nav-link {
        font-size: 7px;
        letter-spacing: 0.15em;
        padding: 8px 0;
    }
}


.nav-link:hover {
    color: var(--sg-black);
}

.nav-link.active {
    color: var(--sg-black);
    border-bottom: 2px solid var(--sg-gold);
}

/* --- 数据监测样式 --- */
.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    color: var(--sg-black);
}

.stat-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--sg-text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- 科学指挥部页眉 (Scientific Laboratory Header) --- */
.header-premium {
    background: transparent;
    backdrop-filter: blur(0px);
    box-shadow: none;
    border-bottom: none;
    position: relative;
    z-index: 1000;
    transition: all 0.5s ease;
}

.brand-logo {
    display: inline-flex;
    align-items: baseline;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, "Inter", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 0 rgba(2, 6, 23, 0.28);
    transition: opacity 220ms ease, color 220ms ease, text-shadow 220ms ease, transform 220ms ease;
}

.brand-logo:hover {
    transform: translateY(-1px);
    text-shadow: 0 2px 0 rgba(2, 6, 23, 0.32);
}

.header-premium.scrolled .brand-logo {
    color: rgba(15, 23, 42, 0.94);
    text-shadow: none;
}

.header-premium.scrolled #identityTag {
    color: rgba(15, 23, 42, 0.52);
}

#homeRoot.theme-dark .brand-logo {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.38);
}

#homeRoot.theme-dark .header-premium.scrolled .brand-logo {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: none;
}

/* === 移动端 Header 极简适配 (针对手机端遮挡/密集问题) === */
@media (max-width: 640px) {
    .header-premium {
        padding: 0.5rem 1rem !important;
    }

    /* 缩小 Logo 防止占位过大 */
    .brand-logo {
        font-size: 1.15rem !important;
    }

    /* 隐藏身份标签（如：Student/教师），只保留名字和勋章 */
    #identityTag {
        display: none !important;
    }

    /* 进一步限制名字宽度 */
    #userName {
        max-width: 45px !important;
        font-size: 11px !important;
    }

    /* 主题按钮：只保留图标，隐藏文字 */
    #themeToggleBtn {
        padding: 0.4rem 0.5rem !important;
    }

    #themeToggleBtn span {
        display: none !important;
    }

    /* 移除不必要的间距 */
    #userInfo {
        gap: 0.5rem !important;
    }

    /* 确保勋章也足够小 */
    #headerTierBadge {
        padding: 1px 3px !important;
        font-size: 6px !important;
        transform: scale(0.9);
    }
}

.brand-shiguang {
    position: relative;
    padding-left: 20px;
}

.brand-shiguang::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--sg-gold);
}

@keyframes shiguang-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.01);
        opacity: 0.95;
    }
}

.search-container-premium {
    background: var(--sg-slate-light);
    border: 1px solid var(--sg-slate-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-container-premium:focus-within {
    background: white;
    border-color: var(--sg-black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-m1 {
    border-right: 1px solid #f0f0f0;
    width: 340px;
    z-index: 60;
    background: white;
}

.viewport-m1 {
    background: #fdfdfd;
    flex: 1;
    position: relative;
}

.data-panel-m1 {
    border-left: 1px solid #f0f0f0;
    width: 380px;
    z-index: 60;
    background: white;
}

.stage-card {
    background: #f8f9fa;
    border: 1px solid #f0f0f0;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.4s;
}

.stage-card.active {
    border-color: var(--sg-gold);
    background: #fffefb;
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.1);
}

.input-mini-m1 {
    background: transparent;
    border-bottom: 1px solid #ddd;
    width: 55px;
    text-align: center;
    font-family: monospace;
    outline: none;
    color: var(--sg-gold);
    font-weight: bold;
    font-size: 14px;
}

.btn-tab-m1 {
    flex: 1;
    padding: 14px;
    font-size: 11px;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    color: #94a3b8;
    transition: 0.3s;
}

.btn-tab-m1.active {
    color: var(--sg-black);
    border-bottom-color: var(--sg-gold);
    background: white;
}

.btn-primary-m1 {
    background: var(--sg-black);
    color: white;
    padding: 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.2em;
    transition: 0.3s;
}

#simOverlay {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 10000;
    display: none;
    height: 100svh;
}

/* ── 全屏模式：最大化 canvas 区域，隐藏 header ── */
#simOverlay:fullscreen,
#simOverlay:-webkit-full-screen {
    background: #0a0a0a;
}
#simOverlay:fullscreen .sim-header,
#simOverlay:-webkit-full-screen .sim-header {
    display: none !important;
}
#simOverlay:fullscreen .sim-body,
#simOverlay:-webkit-full-screen .sim-body {
    padding: 0.35rem !important;
    gap: 0.35rem !important;
    background: #0a0a0a;
}
#simOverlay:fullscreen .sim-canvas-area,
#simOverlay:-webkit-full-screen .sim-canvas-area {
    border-radius: 0.75rem;
}
/* 全屏时浮动面板位置由 JS 在进入全屏时主动重置（top/right style），CSS 不再强制覆盖 */

.sim-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sim-header {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 4vw, 4rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
}

.sim-title-block {
    min-width: 0;
}

.sim-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}

.sim-title-row > #simTitle {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.sim-header-board-btn {
    flex: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.65rem 0.95rem;
    white-space: nowrap;
    background: #ffffff;
    position: relative;
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.sim-header-board-btn[data-panel-state="open"],
.sim-header-board-btn[data-panel-state="minimized"] {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.sim-header-board-btn[data-panel-state="open"] {
    transform: translateY(-1px);
}

.sim-header-board-btn.is-board-targeting {
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08), 0 16px 38px rgba(15, 23, 42, 0.2);
}

.sim-body {
    flex: 1;
    display: flex;
    --sim-sidebar-width: clamp(320px, 30vw, 440px);
    padding: clamp(0.75rem, 3vw, 2.5rem) clamp(1rem, 4vw, 4rem);
    gap: clamp(1rem, 3vw, 3rem);
    background: #fbfbfb;
    min-height: 0;
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* 基础样式 —— 必须在所有 media query 之前 */
.sim-canvas-area {
    flex: 1;
    background: #111;
    border-radius: 2rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
}
.sim-canvas-area.sim-canvas-light {
    background: #f8fafc;
}
.sim-canvas-area.sim-canvas-light canvas {
    filter: invert(1);
}

.sim-annotation-canvas {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sim-annotation-toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    width: clamp(252px, 24vw, 312px);
    padding: 12px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.95));
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 4px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    color: #0f172a;
    overflow: hidden;
    max-width: min(calc(100% - 24px), 312px);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    transition: width 0.22s ease, padding 0.22s ease, border-radius 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.sim-annotation-toolbar.hidden {
    display: none;
}

.sim-annotation-toolbar.is-minimized {
    padding: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
    overflow: visible;
}

.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__header {
    margin-bottom: 0;
    padding: 8px 12px;
    border-bottom: none;
    justify-content: flex-start;
    gap: 8px;
    cursor: grab;
}

.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__heading {
    gap: 0;
}

.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__title-row {
    gap: 7px;
}

.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__title-row::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a, #475569);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__title {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: none;
}

.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__eyebrow,
.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__status,
.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__actions,
.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__content,
.sim-annotation-toolbar.is-minimized .sim-annotation-toolbar__resize-handle {
    display: none;
}

.sim-annotation-toolbar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    cursor: move;
    touch-action: none;
    user-select: none;
    padding: 2px 2px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.sim-annotation-toolbar__heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-annotation-toolbar__eyebrow {
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.sim-annotation-toolbar__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sim-annotation-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-annotation-toolbar__title {
    min-width: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sim-annotation-toolbar__status {
    flex: none;
    max-width: 112px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sim-annotation-toolbar__icon-btn {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #0f172a;
    color: #f8fafc;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sim-annotation-toolbar__icon-btn--ghost {
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.28);
}

.sim-annotation-toolbar__icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
}

.sim-annotation-toolbar__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 10px;
    overflow: auto;
    padding-right: 2px;
}

.sim-annotation-toolbar__section {
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.94));
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sim-annotation-toolbar__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sim-annotation-toolbar__section-title {
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sim-annotation-toolbar__section-meta,
.sim-annotation-toolbar__size-pill {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.sim-annotation-toolbar__size-pill {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
}

.sim-annotation-toolbar__tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.sim-annotation-toolbar__colors {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.sim-annotation-color-btn {
    aspect-ratio: 1;
    width: 100%;
    min-width: 0;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: var(--swatch);
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sim-annotation-color-btn:hover {
    transform: translateY(-1px) scale(1.04);
}

.sim-annotation-color-btn.is-active {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12), 0 10px 18px rgba(15, 23, 42, 0.16);
}

.sim-annotation-tool-btn {
    min-width: 0;
    min-height: 58px;
    padding: 10px 8px;
    border-radius: 14px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: rgba(255, 255, 255, 0.88);
    color: #334155;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.sim-annotation-tool-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(148, 163, 184, 0.92);
    box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}

.sim-annotation-tool-btn.is-active {
    border-color: rgba(15, 23, 42, 0.8);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92));
    color: #f8fafc;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.sim-annotation-tool-btn__title {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
}

.sim-annotation-tool-btn__meta {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.74;
    line-height: 1.15;
    word-break: break-word;
}

.sim-annotation-toolbar__section--size {
    padding-bottom: 10px;
}

.sim-annotation-toolbar__size-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
}

.sim-annotation-toolbar__range {
    width: 100%;
    margin: 0;
    accent-color: #0f172a;
}

.sim-annotation-toolbar__preview {
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(226,232,240,0.9));
    border: 1px solid rgba(203, 213, 225, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sim-annotation-toolbar__preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f8fafc;
    transition: width 0.18s ease, height 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.sim-annotation-clear-btn {
    min-height: 42px;
    border-radius: 15px;
    border: 1px solid rgba(248, 113, 113, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(254, 242, 242, 0.98));
    color: #b91c1c;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sim-annotation-clear-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(239, 68, 68, 0.36);
    box-shadow: 0 10px 18px rgba(248, 113, 113, 0.14);
}

.sim-annotation-toolbar__resize-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 18px;
    height: 18px;
    border-radius: 0 0 12px 0;
    cursor: nwse-resize;
    touch-action: none;
    opacity: 0.72;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.sim-annotation-toolbar__resize-handle::before {
    content: '';
    position: absolute;
    inset: 3px;
    background:
        linear-gradient(135deg, transparent 0 38%, rgba(100, 116, 139, 0.78) 38% 48%, transparent 48% 58%, rgba(100, 116, 139, 0.58) 58% 68%, transparent 68%);
}

.sim-annotation-toolbar:hover .sim-annotation-toolbar__resize-handle,
.sim-annotation-toolbar.is-resizing .sim-annotation-toolbar__resize-handle {
    opacity: 1;
}

.sim-annotation-toolbar.is-resizing {
    user-select: none;
}

@media (max-width: 768px) {
    .sim-annotation-toolbar {
        width: min(calc(100% - 20px), 288px);
        padding: 10px;
        border-radius: 18px;
    }

    .sim-annotation-toolbar__tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sim-annotation-toolbar__colors {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sim-annotation-toolbar__title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .sim-annotation-toolbar__status {
        max-width: none;
    }

    .sim-annotation-toolbar__resize-handle {
        width: 20px;
        height: 20px;
    }
}

.sim-sidebar {
    width: var(--sim-sidebar-width);
}

.sim-controls {
    width: 100%;
    max-width: 320px;
    height: 100%;
    overflow-y: auto;
    padding-right: 1rem;
}

.sim-controls::-webkit-scrollbar {
    width: 4px;
}

.sim-controls::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}

/* 操作面板可见滚动条（覆盖全局隐藏） */
.sim-controls-scroll {
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.sim-controls-scroll::-webkit-scrollbar {
    display: block !important;
    width: 8px !important;
}
.sim-controls-scroll::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.04);
    border-radius: 4px;
}
.sim-controls-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.sim-controls-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#simControls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    position: relative;
    z-index: 2;
    width: 100%;
    height: 1.35rem;
    padding: 0.35rem 0;
    margin-top: 0.15rem;
    border-radius: 999px;
    background: transparent;
    cursor: ew-resize;
    touch-action: pan-x;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

#simControls input[type="range"]::-webkit-slider-runnable-track {
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(71, 85, 105, 0.58), rgba(203, 213, 225, 0.28));
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.28);
}

#simControls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -7px;
    border: 3px solid #f8fafc;
    border-radius: 999px;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}

#simControls input[type="range"]::-moz-range-track {
    height: 0.6rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(71, 85, 105, 0.58), rgba(203, 213, 225, 0.28));
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.28);
}

#simControls input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 3px solid #f8fafc;
    border-radius: 999px;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}

#simControls input[type="range"]:focus-visible {
    outline: none;
}

#simControls input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.22), 0 2px 10px rgba(15, 23, 42, 0.18);
}

#simControls input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.22), 0 2px 10px rgba(15, 23, 42, 0.18);
}

/* =====================================================
   响应式布局策略 — 以屏幕方向为核心
   · 竖屏 portrait  → 上: canvas(满宽)  下: 控制面板(展开)
   · 横屏 landscape → 左: canvas        右: 控制面板(侧栏)
   ===================================================== */

/* --- ① 通用收紧（≤1024px 所有方向） --- */
@media (max-width: 1024px) {
    .sim-header {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .sim-title-row {
        gap: 0.5rem;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .sim-header-board-btn {
        min-height: 2.25rem;
        padding: 0.5rem 0.8rem;
        font-size: 9px !important;
    }

    .sim-header .flex.items-center.gap-8 {
        gap: 0.75rem;
    }

    .sim-body {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .formula-display {
        font-size: 13px;
        padding: 4px 8px;
    }
}

/* --- ② 竖屏布局（所有竖屏设备，含 iPad 竖屏） --- */
@media (orientation: portrait) {
    .sim-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sim-title-row {
        width: 100%;
    }

    .sim-header .flex.items-center.gap-8 {
        width: 100%;
        justify-content: space-between;
    }

    /* 竖屏不需要全屏与收起功能 */
    #simFullscreenBtn,
    .sidebar-collapse-btn,
    .sim-sidebar-resize-handle {
        display: none !important;
    }

    #simOverlay .sim-header-portrait-hide,
    #simForceReloader,
    #simHelpBtn,
    #simPerfBtn {
        display: none !important;
    }

    .sim-body {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .sim-canvas-area {
        /*
         * 竖屏适配核心策略：
         * 保持 8:5 横向比例（= BaseEngine REF_W:REF_H = 800:500）
         * 让物理引擎的坐标系与 canvas 完全匹配，场景不留黑边。
         * max-height 避免在超高设备上 canvas 占据过多空间。
         */
        flex: none;
        width: 100%;
        aspect-ratio: 8 / 5;
        height: auto;
        max-height: 60vh;
        min-height: 220px;
        border-radius: 1.5rem;
    }

    .sim-sidebar {
        /* 控制面板满宽展开，自然高度，不做限高 */
        width: 100% !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        border-radius: 1.5rem;
    }

    /* sidebar 内容区域也要自然展开，不做内部滚动 */
    .sim-sidebar>.flex-1,
    .sim-sidebar>div.overflow-y-auto,
    .sim-sidebar>div[class*="overflow"] {
        flex: none !important;
        overflow: visible !important;
        max-height: none !important;
        min-height: 0 !important;
    }

    /* 控制面板内部满宽展开 */
    .sim-controls {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        overflow-y: visible !important;
        padding-right: 0;
    }
    /* 操作面板保持可滚动 */
    .sim-sidebar .sim-controls-scroll {
        overflow-y: auto !important;
    }
}

/* --- ③ 横屏布局（所有横屏设备） --- */
@media (orientation: landscape) {
    .sim-body {
        flex-direction: row;
        overflow: hidden;
        gap: clamp(0.35rem, 0.9vw, 0.85rem);
    }

    .sim-canvas-area {
        flex: 1;
        min-height: 0;
    }

    .sim-sidebar {
        flex: none;
        overflow-y: auto;
    }
}

/* --- ④ 横屏 + 中小屏（平板横屏、手机横屏）：侧栏窄化 --- */
@media (orientation: landscape) and (max-width: 1024px) {
    .sim-body {
        --sim-sidebar-width: clamp(260px, 30vw, 380px);
    }
}

/* --- ⑤ 横屏 + 极矮屏（手机横屏）：极致紧凑 --- */
@media (orientation: landscape) and (max-height: 500px) {
    .sim-body {
        --sim-sidebar-width: clamp(220px, 32vw, 300px);
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .sim-canvas-area {
        height: calc(100svh - 50px - 1rem);
    }

    .sim-sidebar {
        height: calc(100svh - 50px - 1rem) !important;
        max-height: none !important;
    }

    .sim-header {
        padding: 0.35rem 0.75rem;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem;
    }

    #simOverlay .sim-header-portrait-hide,
    #simForceReloader,
    #simHelpBtn,
    #simPerfBtn {
        display: none !important;
    }
}

/* --- ⑥ 竖屏 + 小屏手机（≤640px）：进一步压缩 --- */
@media (orientation: portrait) and (max-width: 640px) {
    .sim-header {
        padding: 0.5rem 0.75rem;
        gap: 0.35rem;
    }

    .sim-title-row {
        gap: 0.4rem;
    }

    .sim-header-board-btn {
        min-height: 2rem;
        padding: 0.45rem 0.7rem;
    }

    .sim-body {
        padding: 0.5rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        gap: 0.5rem;
    }

    .sim-canvas-area {
        /* 小手机：同样保持 8:5 比例，但高度上限更低 */
        aspect-ratio: 8 / 5;
        height: auto;
        max-height: 50vh;
        min-height: 180px;
        border-radius: 1.25rem;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    }

    .sim-sidebar {
        border-radius: 1.25rem;
    }

    #simOverlay .sim-sidebar .p-6 {
        padding: 0.75rem;
    }

    #simOverlay .sim-sidebar .p-6.border-t {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    #simOverlay .sim-header-portrait-hide,
    #simForceReloader,
    #simHelpBtn,
    #simPerfBtn {
        display: none !important;
    }
}



canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* 仅在横屏矮屏（如手机横屏）收紧内边距，避免覆盖竖屏的 safe-area-inset-bottom */
@media (max-height: 720px) and (orientation: landscape) {
    .sim-body {
        padding-top: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

@media (max-width: 768px) {
    #simControls .control-group {
        padding: 0.9rem;
    }

    #simControls .control-group label {
        font-size: 12px;
        letter-spacing: 0.14em;
    }

    #simControls input[type="number"] {
        width: 5.5rem;
        font-size: 13px;
        padding: 0.35rem 0.4rem;
    }

    #simControls input[type="range"] {
        height: 1.5rem;
        padding: 0.4rem 0;
    }

    #simControls input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
        margin-top: -9px;
    }

    #simControls input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }

    #simControls button {
        min-height: 44px;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        font-size: 12px;
        letter-spacing: 0.18em;
    }
}

/* --- Auth Forms Tweaks --- */
#loginForm,
#registerForm {
    max-height: 90vh;
    overflow-y: auto;
    width: 95%;
    margin: auto;
}


/* --- Founding Member Premium Styles (Integrated Card Design) --- */
#premiumMemberCard {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(251, 191, 36, 0.1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#premiumMemberCard:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(251, 191, 36, 0.2);
}

.member-card-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(100deg,
            rgba(255, 255, 255, 0) 20%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 80%);
    animation: member-shimmer 4s infinite linear;
}

@keyframes member-shimmer {
    from {
        transform: translateX(-50%);
    }

    to {
        transform: translateX(50%);
    }
}

#memberIdDisp {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Hexagon Crown Badge (Inspired by User Image) */
.premium-hexagon {
    position: relative;
    width: 30px;
    height: 34px;
    background: linear-gradient(180deg, #ffd37a 0%, #d97706 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
}

.hexagon-inner {
    position: absolute;
    inset: 1px;
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hexagon-inner::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 2;
}

.hexagon-inner i {
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    animation: crown-pulse 2s infinite ease-in-out;
}

.hexagon-mark {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    color: #f43f5e;
    font-size: 6px;
    font-weight: 950;
    z-index: 4;
}

.hexagon-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.star-tiny {
    position: absolute;
    color: #fff;
    font-size: 6px;
    animation: star-twinkle 1.5s infinite alternate;
}

.star-tiny.s1 {
    top: 15%;
    right: 15%;
}

.star-tiny.s2 {
    bottom: 20%;
    left: 10%;
    animation-delay: 0.5s;
}

@keyframes crown-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

@keyframes star-twinkle {
    from {
        opacity: 0.2;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Identity-specific color themes for the card ID */
#premiumMemberCard[data-identity="teacher"] #memberIdDisp {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

#premiumMemberCard[data-identity="student"] #memberIdDisp {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

#profileMemberCard[data-identity="teacher"] #profileMemberId {
    color: #d97706;
    font-weight: 800;
}

#profileMemberCard[data-identity="student"] #profileMemberId {
    color: #2563eb;
    font-weight: 800;
}

/* Auth Modal responsive fix */
@media (max-width: 640px) {
    #authModal section {
        padding: 1rem;
    }
}

/* Status colors (Chinese) */
.status-teacher {
    color: #d97706;
}

.status-student {
    color: #2563eb;
}

/* Ensuring smooth transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* New Animations for Excitement */
@keyframes scale-up {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-up-animation {
    animation: scale-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shimmer-text {
    background: linear-gradient(to right,
            #fff 20%,
            #fbbf24 40%,
            #fff 60%,
            #fbbf24 80%);
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: text-shimmer 3s linear infinite;
}

@keyframes text-shimmer {
    to {
        background-position: 200% center;
    }
}

/* ============================================ */
/* === 暗色主题 (Dark Mode) === */
/* ============================================ */
.theme-dark {
    color-scheme: dark;
}

.theme-dark body {
    background-color: #0b0f1a;
    color: #e5e7eb;
}

/* 暗色模式导航栏 */
#homeRoot.theme-dark {
    background-color: #0b0f1a;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
        linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 44px 44px, 44px 44px, 220px 220px, 220px 220px;
    background-position: 0 0, 0 0, 0 0, 0 0;
}



.theme-dark nav {
    background: #0b0f1a !important;
    border-bottom-color: #1f2937 !important;
}

.theme-dark .search-container-premium {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.theme-dark .nav-link {
    color: #94a3b8;
}

.theme-dark .nav-link:hover,
.theme-dark .nav-link.active {
    color: #e5e7eb;
    border-bottom-color: #b28e4a;
}

.theme-dark input::placeholder {
    color: #94a3b8;
}

.theme-dark .card-content-premium {
    background-color: transparent !important;
}

.theme-dark .bg-slate-50 {
    background-color: #0f172a !important;
}

.theme-dark .exhibition-card .observation-zone {
    background-color: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.theme-dark .border-slate-50,
.theme-dark .border-slate-100 {
    border-color: #1f2937 !important;
}

.theme-dark .shadow-2xl,
.theme-dark .shadow-xl,
.theme-dark .shadow-lh,
.theme-dark .shadow-sm {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.theme-dark .text-slate-900,
.theme-dark .text-slate-800 {
    color: #e5e7eb !important;
}

.theme-dark .text-slate-700 {
    color: #cbd5e1 !important;
}

.theme-dark .text-slate-500,
.theme-dark .text-slate-400 {
    color: #94a3b8 !important;
}

.theme-dark .text-slate-300 {
    color: #64748b !important;
}

.theme-dark .exhibition-card {
    background-color: #111827 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8;
}

.theme-dark .exhibition-card .card-btn {
    color: #fbbf24;
    border-bottom-color: rgba(251, 191, 36, 0.3);
    opacity: 0.8;
    transform: none;
}

.theme-dark .exhibition-card .card-title {
    color: #fff !important;
}

.theme-dark .exhibition-card .card-subtitle {
    color: #64748b;
}

.theme-dark .exhibition-card .card-tag {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.theme-dark .exhibition-card .card-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* 暗色模式小字优化对比 */
.theme-dark .text-\[7px\],
.theme-dark .text-\[8px\],
.theme-dark .text-\[9px\],
.theme-dark .text-xs {
    color: #e5e7eb !important;
}

.theme-dark .exhibition-card .text-\[7px\],
.theme-dark .exhibition-card .text-\[8px\],
.theme-dark .exhibition-card .text-\[9px\],
.theme-dark .exhibition-card .text-xs {
    color: #64748b !important;
}

/* 暗色模式 Focus 样式修复 */
.theme-dark :focus-visible {
    outline: 2px solid #b28e4a;
    outline-offset: 2px;
}

/* 暗色背景 bg-slate-900 修复 */
.theme-dark .bg-slate-900 {
    background-color: #0b0f1a !important;
    border: 1px solid #334155 !important;
}

/* ============================================ */
/* === 全覆盖 Hero 和透明页眉 === */
/* ============================================ */

.header-premium.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

.header-premium.scrolled .text-white {
    color: var(--sg-black) !important;
}

.theme-dark .header-premium.scrolled .text-white {
    color: #ffffff !important;
}

.theme-dark .header-premium.scrolled {
    background: rgba(15, 23, 42, 0.95) !important;
}

.hero-premium {
    height: 380px;
    min-height: 380px;
    padding-top: 5.5rem; /* 为顶部导航栏/搜索框预留空间，避免遮挡主标题 */
    box-sizing: border-box;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    margin-top: 0;
    /* 超宽视觉 */
    background-image: radial-gradient(1200px 600px at 18% 30%, rgba(56, 189, 248, 0.12), transparent 55%),
        radial-gradient(900px 520px at 82% 24%, rgba(245, 158, 11, 0.12), transparent 60%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.46));
}

.theme-light .hero-premium {
    background-image: radial-gradient(1100px 560px at 20% 35%, rgba(59, 130, 246, 0.12), transparent 58%),
        radial-gradient(900px 520px at 80% 25%, rgba(245, 158, 11, 0.1), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12));
}

.theme-dark .hero-premium {
    background-image: radial-gradient(1200px 600px at 18% 30%, rgba(56, 189, 248, 0.14), transparent 55%),
        radial-gradient(900px 520px at 82% 24%, rgba(245, 158, 11, 0.12), transparent 60%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.48), rgba(2, 6, 23, 0.58));
}


.hero-bg-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.animate-fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(251, 191, 36, 0.3);
    color: #fff !important;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .hero-premium h1 {
        font-size: 2rem;
    }

    .hero-premium p {
        font-size: 0.85rem;
    }
}

/* === 手机端全局适配 === */
@media (max-width: 640px) {

    /* 页眉滚动状态适配 */
    .header-premium.scrolled {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Hero区高度适配（手机端更紧凑） */
    .hero-premium {
        height: auto;
        min-height: 360px;
        padding: 80px 20px 28px 20px !important;
        text-align: center;
    }

    .hero-premium h1 {
        font-size: 2.35rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem;
    }

    .hero-premium p {
        font-size: 1rem !important;
        line-height: 1.8 !important;
        max-width: 100% !important;
        margin: 0 auto;
    }

    .hero-premium .max-w-7xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 按钮容器居中 */
    .hero-premium .flex-col.items-center {
        align-items: center !important;
        margin-top: 1.5rem;
    }

    /* 轮播点居下一些 */
    #heroDots {
        bottom: 20px !important;
    }

    /* 导航栏手机端优化 */
    nav {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    /* 卡片圆角手机端缩小 */
    .exhibition-card {
        border-radius: 14px;
    }

    .observation-zone {
        border-radius: 14px 14px 0 0;
    }

    /* 会员标识徽章手机端微调 */
    #headerTierBadge {
        padding: 2px 5px;
        font-size: 6px;
        letter-spacing: 0.1em;
    }
}

@media (max-width: 640px) and (orientation: portrait) {
    .hero-premium {
        padding: 80px 14px 28px 14px !important;
    }

    .hero-premium .max-w-7xl {
        width: 100%;
    }

    .hero-premium .space-y-2 {
        width: 100%;
    }

    .hero-title,
    .hero-subtitle {
        display: block;
        width: 100%;
        max-width: none !important;
        white-space: nowrap;
        text-wrap: nowrap;
        overflow: visible;
    }

    .hero-title {
        line-height: 1.05 !important;
    }

    .hero-subtitle {
        line-height: 1.25 !important;
    }
}

.hero-premium h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.1;
}

.hero-premium p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    max-width: 800px;
}

.theme-dark .hero-title {
    color: #ffffff;
}

.hero-title-gradient {
    background-image: linear-gradient(135deg, #ffffff 0%, #c0f2fe 45%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 24px rgba(255, 255, 255, 0.25));
}

.theme-dark .hero-premium .hero-title-gradient {
    color: transparent !important;
    background-image: linear-gradient(135deg, #ffffff 0%, #c7d2fe 40%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 8px 30px rgba(255, 255, 255, 0.35));
}

.hero-subtitle {
    font-weight: 600;
    font-size: clamp(16px, 2.4vw, 28px);
    line-height: 1.6;
    color: #334155;
    opacity: 0.9;
}

.theme-dark .hero-subtitle {
    color: rgba(255, 255, 255, 0.78);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.05rem 1.9rem;
    border-radius: 1.25rem;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.78) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    letter-spacing: 0.18em;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.hero-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(120px 90px at 18% 30%, rgba(56, 189, 248, 0.35), transparent 62%),
        radial-gradient(120px 90px at 82% 55%, rgba(245, 158, 11, 0.26), transparent 64%),
        radial-gradient(160px 120px at 50% 120%, rgba(255, 255, 255, 0.10), transparent 60%);
    opacity: 0.7;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.22s ease;
}

.hero-cta::after {
    content: '';
    position: absolute;
    inset: -30% -40%;
    border-radius: 999px;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 45%, transparent 60%);
    transform: translateX(-60%) rotate(12deg);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.hero-cta:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 34px 90px rgba(2, 6, 23, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.theme-dark .hero-cta {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
}

.theme-dark .hero-cta:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.10) 100%);
}

.hero-cta:hover::before {
    opacity: 0.86;
}

.hero-cta:hover::after {
    transform: translateX(60%) rotate(12deg);
    opacity: 0.55;
}

.hero-cta:active {
    transform: translateY(0) scale(0.985);
}

#modelGrid {
    scroll-margin-top: 110px;
}

/* ============================================ */
/* === 首页会员身份标识 (Header Identity Badges) === */
/* ============================================ */
#headerTierBadge.tier-trial {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

#headerTierBadge.tier-regular {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.26);
}

#headerTierBadge.tier-founding {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

#profileMemberCard::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
}

#profileMemberCard::after {
    content: '';
    position: absolute;
    inset: -40% -30%;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-30%) rotate(12deg);
}

#profileMemberCard.tier-none::before {
    opacity: 0.25;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(148, 163, 184, 0.06));
}

#profileMemberCard.tier-trial {
    border-color: rgba(148, 163, 184, 0.28);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.72));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

#profileMemberCard.tier-trial::before {
    opacity: 1;
    background:
        radial-gradient(120px 80px at 18% 22%, rgba(148, 163, 184, 0.22), transparent 60%),
        radial-gradient(150px 90px at 88% 12%, rgba(56, 189, 248, 0.12), transparent 62%),
        linear-gradient(135deg, rgba(148, 163, 184, 0.06), transparent);
}

#profileMemberCard.tier-regular {
    border-color: rgba(16, 185, 129, 0.22);
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.92), rgba(236, 253, 245, 0.7));
    box-shadow: 0 22px 60px rgba(16, 185, 129, 0.08);
}

#profileMemberCard.tier-regular::before {
    opacity: 1;
    background:
        radial-gradient(150px 90px at 18% 20%, rgba(16, 185, 129, 0.18), transparent 60%),
        radial-gradient(170px 110px at 88% 18%, rgba(59, 130, 246, 0.12), transparent 65%),
        linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}

#profileMemberCard.tier-founding {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(254, 243, 199, 0.76));
    box-shadow: 0 26px 80px rgba(245, 158, 11, 0.14);
}

#profileMemberCard.tier-founding::before {
    opacity: 1;
    background:
        radial-gradient(160px 100px at 20% 16%, rgba(245, 158, 11, 0.24), transparent 62%),
        radial-gradient(200px 120px at 88% 18%, rgba(251, 191, 36, 0.18), transparent 68%),
        radial-gradient(120px 90px at 70% 82%, rgba(236, 72, 153, 0.08), transparent 62%),
        linear-gradient(135deg, rgba(245, 158, 11, 0.08), transparent);
}

#profileMemberCard.tier-founding::after {
    opacity: 0.8;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: sgProfileShimmer 2400ms ease-in-out infinite;
}

@keyframes sgProfileShimmer {
    0% {
        transform: translateX(-45%) rotate(12deg);
    }

    60% {
        transform: translateX(35%) rotate(12deg);
    }

    100% {
        transform: translateX(35%) rotate(12deg);
    }
}

/* Guide Modal Specific Tweaks */
#guideModal .no-scrollbar::-webkit-scrollbar {
    display: none;
}

#guideModal .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#guideModal .rounded-3xl {
    border-radius: 1.5rem;
}

#guideModal .rounded-\[2\.5rem\] {
    border-radius: 2.5rem;
}

/* Hover effects for guide steps */
#guideModal .grid>div {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

#guideModal .grid>div:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 0, 0, 0.05) !important;
}

/* Night theme for tip area */
#guideModal .bg-slate-900 {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* 手机端指引弹窗优化 */
@media (max-width: 640px) {
    #guideModal .max-w-3xl {
        max-width: 100%;
        max-height: 88vh;
        border-radius: 2rem !important;
    }

    #guideModal .p-10 {
        padding: 1.5rem !important;
    }

    #guideModal h3.text-4xl {
        font-size: 1.5rem !important;
    }

    #guideModal p.text-slate-500 {
        font-size: 0.75rem !important;
    }

    #guideModal .space-y-10 {
        /* 缩短步骤间距 */
        gap: 1.5rem !important;
        display: flex;
        flex-direction: column;
    }

    #guideModal .flex.gap-8 {
        gap: 1rem !important;
    }

    #guideModal .w-14.h-14 {
        width: 2.75rem !important;
        height: 2.75rem !important;
    }

    #guideModal .w-14.h-14 i {
        font-size: 1rem !important;
    }

    #guideModal h4.text-lg {
        font-size: 1rem !important;
    }

    #guideModal .mt-12.p-8 {
        margin-top: 2rem !important;
        padding: 1.25rem !important;
        gap: 1rem !important;
    }

    #guideModal .w-16.h-16 {
        width: 2.75rem !important;
        height: 2.75rem !important;
    }

    /* 竖线隐藏防止空间局促 */
    #guideModal div[class*="absolute top-14"] {
        display: none !important;
    }
}

/* ============================================================
   浮动操作板（可拖拽 / 可缩放）
   ============================================================ */
.floating-ctrl-panel {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 300px;
    min-width: 200px;
    max-width: 500px;
    min-height: 120px;
    max-height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10050;
    /* 最小化时只保留 header */
    transition: height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.floating-ctrl-panel.hidden {
    display: none !important;
}
.floating-ctrl-panel.minimized .floating-ctrl-body,
.floating-ctrl-panel.minimized .floating-ctrl-resize-handle {
    display: none !important;
}
.floating-ctrl-panel.minimized {
    height: auto !important;
    min-height: 0 !important;
    border-radius: 0.875rem;
}

/* 拖拽把手（深色标题栏） */
.floating-ctrl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1e293b;
    color: #fff;
    cursor: grab;
    user-select: none;
    border-radius: 1.25rem 1.25rem 0 0;
    flex-shrink: 0;
    transition: border-radius 0.22s;
}
.floating-ctrl-panel.minimized .floating-ctrl-header {
    border-radius: 0.875rem;
    cursor: grab;
}
.floating-ctrl-header:active { cursor: grabbing; }

.floating-ctrl-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    flex: 1;
}
.floating-ctrl-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.floating-ctrl-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.15s;
    touch-action: manipulation;
}
.floating-ctrl-action-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* 内容区域 */
.floating-ctrl-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.floating-ctrl-body::-webkit-scrollbar { width: 4px; }
.floating-ctrl-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.floating-ctrl-body::-webkit-scrollbar-track { background: transparent; }

/* 右下角缩放把手 */
.floating-ctrl-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    border-radius: 0 0 1.25rem 0;
    background:
        linear-gradient(135deg,
            transparent 30%,
            rgba(148,163,184,0.6) 30%, rgba(148,163,184,0.6) 40%,
            transparent 40%,
            transparent 55%,
            rgba(148,163,184,0.6) 55%, rgba(148,163,184,0.6) 65%,
            transparent 65%,
            transparent 80%,
            rgba(148,163,184,0.6) 80%, rgba(148,163,184,0.6) 90%,
            transparent 90%
        );
    z-index: 2;
}

/* ============================================================
   横屏 HUD 侧边栏收起/展开
   ============================================================ */

/* 按钮作为 flex 子项，夹在 canvas 和 sidebar 之间 */
.sidebar-collapse-btn {
    flex: none;
    align-self: center;
    display: none;           /* 默认隐藏，横屏覆盖 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 18px;
    height: 68px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: background 0.15s ease, width 0.15s ease, box-shadow 0.15s ease;
    z-index: 10;
    margin-inline: -0.1rem;
}
.sim-sidebar-resize-handle {
    display: none;
    flex: none;
    align-self: stretch;
    width: 8px;
    min-width: 8px;
    position: relative;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s ease,
                transform 0.22s ease;
    z-index: 9;
    margin-inline: -0.12rem -0.05rem;
}
.sim-sidebar-resize-handle::before {
    content: '';
    position: absolute;
    top: clamp(1rem, 6%, 2.25rem);
    bottom: clamp(1rem, 6%, 2.25rem);
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(71, 85, 105, 0.68), rgba(148, 163, 184, 0.12));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
    opacity: 0.72;
    transition: opacity 0.18s ease, width 0.18s ease, background 0.18s ease;
}
.sim-sidebar-resize-handle:hover::before,
.sim-sidebar-resize-handle.is-dragging::before {
    width: 3px;
    opacity: 1;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.82), rgba(59, 130, 246, 0.18));
}
.sidebar-collapse-btn:hover {
    background: #0f172a;
    width: 26px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.4);
}
.sidebar-collapse-btn .sidebar-collapse-icon {
    font-size: 9px;
    line-height: 1;
    transition: transform 0.3s ease;
}
.sidebar-collapse-btn .sidebar-collapse-label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    line-height: 1;
    opacity: 0.75;
}

/* 横屏时显示 */
@media (orientation: landscape) {
    .sidebar-collapse-btn {
        display: flex !important;
    }

    .sim-sidebar-resize-handle {
        display: block;
    }
}

/* 收起状态：sidebar 宽度缩为 0，内容隐藏 */
@media (orientation: landscape) {
    .sim-sidebar {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.25s ease;
        will-change: width;
    }

    .sim-body.sidebar-is-collapsed .sim-sidebar {
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        opacity: 0;
        pointer-events: none;
        border: none;
    }

    .sim-body.sidebar-is-collapsed .sim-sidebar-resize-handle {
        width: 0 !important;
        min-width: 0 !important;
        opacity: 0;
        pointer-events: none;
        transform: scaleX(0);
    }

    /* canvas 区域平滑扩展（flex-grow 可动画，flex 简写不可） */
    .sim-canvas-area {
        transition: flex-grow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sim-body.sidebar-is-resizing .sim-sidebar,
    .sim-body.sidebar-is-resizing .sim-canvas-area,
    .sim-body.sidebar-is-resizing .sim-sidebar-resize-handle {
        transition: none !important;
    }

    /* 收起时按钮箭头翻转（指向右侧 = 展开方向） */
    .sim-body.sidebar-is-collapsed .sidebar-collapse-icon {
        transform: rotate(180deg);
    }
}

/* ============================================ */
/* === 首页星云图入口按钮 === */
/* ============================================ */
#lsaFloatBadge {
    left: var(--sg-float-left, 2rem) !important;
    bottom: var(--sg-float-bottom, 2rem) !important;
}

#floatSubContainer {
    right: var(--sg-float-right, 2rem) !important;
    bottom: var(--sg-float-bottom, 2rem) !important;
}

#leftFloatColumn {
    left: calc(env(safe-area-inset-left, 0px) + var(--sg-float-left, 2rem)) !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sg-float-bottom, 2rem)) !important;
}

.lab-float-entry {
    position: relative;
    isolation: isolate;
    transform: translateZ(0);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lab-float-expand {
    display: none;
    align-items: center;
    gap: 0.9rem;
    padding-left: 0;
    transform-origin: center bottom;
}

.lab-float-entry.lab-float-entry--open .lab-float-expand {
    display: flex;
}

.lab-float-sub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    width: 100%;
}

.lab-float-sub__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow:
        0 12px 24px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.84);
    color: rgba(15, 23, 42, 0.84);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.1em;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.lab-float-main-btn {
    position: relative;
    min-width: 6.3rem;
    height: 3rem;
    padding: 0 1rem 0 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    overflow: hidden;
    cursor: pointer;
    color: #f8fafc;
    background:
        radial-gradient(circle at 18% 18%, rgba(250, 204, 21, 0.22), transparent 34%),
        radial-gradient(circle at 78% 84%, rgba(56, 189, 248, 0.12), transparent 42%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.95) 52%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    text-decoration: none;
    outline: none;
    transform: translateZ(0);
    transition:
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 240ms ease,
        filter 240ms ease;
}

.lab-float-main-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.1), transparent 46%);
    pointer-events: none;
}

.lab-float-main-btn:hover,
.lab-float-main-btn:focus-visible {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(250, 204, 21, 0.34);
    box-shadow:
        0 24px 54px rgba(15, 23, 42, 0.28),
        0 0 26px rgba(250, 204, 21, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.lab-float-main-btn:active {
    transform: scale(0.97);
}

.lab-float-main-btn[aria-expanded="true"] {
    border-color: rgba(250, 204, 21, 0.4);
    box-shadow:
        0 22px 50px rgba(15, 23, 42, 0.3),
        0 0 30px rgba(250, 204, 21, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lab-float-main-btn__icon,
.lab-float-main-btn__text {
    position: relative;
    z-index: 1;
}

.lab-float-main-btn__icon {
    font-size: 0.95rem;
    color: #f8fafc;
    text-shadow: 0 0 16px rgba(250, 204, 21, 0.24);
}

.lab-float-main-btn__text {
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    white-space: nowrap;
}

.lab-float-sub__btn {
    position: relative;
    width: 3.15rem;
    height: 3.15rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.05rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    overflow: visible;
    isolation: isolate;
    cursor: pointer;
    color: #f8fafc;
    text-decoration: none;
    outline: none;
    box-shadow:
        0 18px 36px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transform: translateZ(0);
    transition:
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 220ms ease;
}

.lab-float-sub__btn:hover,
.lab-float-sub__btn:focus-visible {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 22px 42px rgba(15, 23, 42, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.lab-float-sub__btn:active {
    transform: scale(0.97);
}

.lab-float-sub__icon {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.lab-float-sub__btn--nebula {
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.32), transparent 32%),
        radial-gradient(circle at 70% 76%, rgba(56, 189, 248, 0.18), transparent 38%),
        linear-gradient(145deg, rgba(7, 12, 28, 0.96) 0%, rgba(17, 33, 61, 0.94) 52%, rgba(6, 15, 32, 0.98) 100%);
    border-color: rgba(136, 207, 255, 0.24);
    box-shadow:
        0 22px 46px rgba(2, 6, 23, 0.42),
        0 0 0 1px rgba(76, 109, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lab-float-sub__btn--nebula .lab-float-sub__icon {
    color: rgba(246, 250, 255, 0.96);
    text-shadow: 0 0 12px rgba(125, 211, 252, 0.28);
    transition:
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
        text-shadow 260ms ease;
}

.lab-float-sub__btn--nebula:hover .lab-float-sub__icon,
.lab-float-sub__btn--nebula:focus-visible .lab-float-sub__icon {
    transform: scale(1.07) rotate(-8deg);
    text-shadow: 0 0 18px rgba(186, 230, 253, 0.45);
}

.lab-float-sub__btn--archive211 {
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.54), transparent 32%),
        linear-gradient(155deg, rgba(255, 251, 235, 0.98) 0%, rgba(253, 230, 138, 0.98) 55%, rgba(245, 158, 11, 0.96) 100%);
    border-color: rgba(217, 119, 6, 0.2);
    color: #78350f;
    box-shadow:
        0 18px 34px rgba(245, 158, 11, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.lab-float-sub__btn--archive211 .lab-float-sub__icon {
    color: #78350f;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.24);
}

.lab-float-sub__btn--practice {
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.26), transparent 30%),
        linear-gradient(155deg, rgba(251, 191, 36, 0.98) 0%, rgba(245, 158, 11, 0.98) 58%, rgba(180, 83, 9, 0.98) 100%);
    border-color: rgba(217, 119, 6, 0.18);
    color: #fffdf7;
    box-shadow:
        0 18px 36px rgba(245, 158, 11, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.lab-float-sub__btn--practice .lab-float-sub__icon {
    color: #fffdf7;
    text-shadow: 0 0 12px rgba(255, 251, 235, 0.28);
}

#practiceFloatButtonText {
    position: relative;
    z-index: 1;
    margin-top: 0.02rem;
    font-size: 0.42rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1;
    color: rgba(255, 251, 235, 0.96);
    white-space: nowrap;
}

.nebula-float-btn__aura,
.nebula-float-btn__ring,
.nebula-float-btn__core,
.nebula-float-btn__spark {
    position: absolute;
    pointer-events: none;
}

.nebula-float-btn__aura {
    inset: -16px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 50%, rgba(92, 215, 255, 0.24) 0%, rgba(92, 215, 255, 0.12) 34%, transparent 70%),
        radial-gradient(circle at 70% 30%, rgba(255, 195, 113, 0.14), transparent 44%),
        radial-gradient(circle at 30% 75%, rgba(149, 132, 255, 0.14), transparent 44%);
    filter: blur(12px);
    opacity: 0.92;
    z-index: -3;
}

.nebula-float-btn__ring {
    inset: -5px;
    border-radius: inherit;
    border: 1px solid rgba(149, 203, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    opacity: 0.82;
    animation: nebulaFloatSpin 12s linear infinite;
}

.nebula-float-btn__ring::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background:
        conic-gradient(from 90deg,
            transparent 0deg,
            rgba(120, 220, 255, 0.04) 35deg,
            rgba(120, 220, 255, 0.42) 64deg,
            transparent 112deg,
            transparent 220deg,
            rgba(255, 197, 122, 0.36) 258deg,
            transparent 298deg,
            transparent 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
}

.nebula-float-btn__ring--inner {
    inset: 5px;
    opacity: 0.72;
    border-color: rgba(164, 226, 255, 0.16);
    animation-duration: 7.5s;
    animation-direction: reverse;
}

.nebula-float-btn__ring--inner::before {
    background:
        conic-gradient(from 180deg,
            transparent 0deg,
            rgba(96, 188, 255, 0.32) 58deg,
            transparent 118deg,
            transparent 240deg,
            rgba(255, 214, 139, 0.26) 292deg,
            transparent 336deg,
            transparent 360deg);
}

.nebula-float-btn__core {
    inset: 6px;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.2), transparent 38%),
        radial-gradient(circle at 50% 50%, rgba(122, 212, 255, 0.3), rgba(18, 33, 62, 0.42) 50%, rgba(5, 10, 22, 0.96) 100%);
    box-shadow:
        inset 0 0 26px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 16px rgba(84, 200, 255, 0.16);
}

.nebula-float-btn__core::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.16), transparent 46%),
        radial-gradient(circle at 50% 90%, rgba(255, 195, 113, 0.18), transparent 42%);
    opacity: 0.76;
}

.nebula-float-btn__spark {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 247, 237, 0.92);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.nebula-float-btn__spark--a {
    top: 3px;
    right: 7px;
    opacity: 0.85;
}

.nebula-float-btn__spark--b {
    left: 6px;
    bottom: 7px;
    width: 3px;
    height: 3px;
    opacity: 0.62;
}

@keyframes nebulaFloatSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    #leftFloatColumn {
        left: calc(env(safe-area-inset-left, 0px) + 1rem) !important;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem) !important;
        gap: 0.7rem !important;
    }

    .lab-float-expand {
        align-items: center;
        gap: 0.72rem;
        padding-left: 0;
    }

    .lab-float-sub {
        gap: 0.34rem;
    }

    .lab-float-sub__label {
        min-width: 0;
        padding: 0.22rem 0.48rem;
        font-size: 8px;
        letter-spacing: 0.06em;
    }

    .lab-float-main-btn {
        min-width: 5.65rem;
        height: 2.75rem;
        padding: 0 0.88rem 0 0.82rem;
        gap: 0.48rem;
    }

    .lab-float-main-btn__icon {
        font-size: 0.88rem;
    }

    .lab-float-main-btn__text {
        font-size: 0.74rem;
        letter-spacing: 0.1em;
    }

    .lab-float-sub__btn {
        width: 2.8rem;
        height: 2.8rem;
        border-radius: 0.95rem;
    }

    .lab-float-sub__icon {
        font-size: 0.9rem;
    }

    #practiceFloatButtonText {
        font-size: 0.38rem;
    }

}

@media (pointer: coarse) and (orientation: landscape) {
    #leftFloatColumn {
        bottom: max(calc(env(safe-area-inset-bottom, 0px) + 1rem), 3.25rem) !important;
    }

    #lsaFloatBadge {
        bottom: max(var(--sg-float-bottom, 2rem), 3.25rem) !important;
    }

    #floatSubContainer {
        bottom: max(var(--sg-float-bottom, 2rem), 3.25rem) !important;
    }

}

@media (prefers-reduced-motion: reduce) {
    .lab-float-main-btn,
    .lab-float-sub__btn,
    .lab-float-sub__btn--nebula .lab-float-sub__icon {
        transition: none !important;
    }

    .nebula-float-btn__ring {
        transition: none !important;
        animation: none !important;
    }
}

.trial-activity-trigger-btn {
    position: relative;
    width: 100%;
    min-height: 4.75rem;
    padding: 0.95rem 1rem;
    border-radius: 1.4rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #f8fafc;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 16% 24%, rgba(250, 204, 21, 0.22), transparent 34%),
        radial-gradient(circle at 84% 76%, rgba(56, 189, 248, 0.16), transparent 40%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(23, 37, 84, 0.95) 48%, rgba(15, 23, 42, 0.99) 100%);
    box-shadow:
        0 20px 44px rgba(15, 23, 42, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition:
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms ease,
        border-color 220ms ease;
}

.trial-activity-trigger-btn::before,
.trial-activity-trigger-btn::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.trial-activity-trigger-btn::before {
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.12), transparent 44%);
    z-index: 0;
}

.trial-activity-trigger-btn::after {
    inset: -35% auto auto -20%;
    width: 48%;
    height: 170%;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.14) 48%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(14deg);
    opacity: 0.7;
    z-index: 0;
    transition: transform 360ms ease, opacity 260ms ease;
}

.trial-activity-trigger-btn:hover,
.trial-activity-trigger-btn:focus-visible {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(250, 204, 21, 0.28);
    box-shadow:
        0 24px 56px rgba(15, 23, 42, 0.28),
        0 0 24px rgba(56, 189, 248, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.trial-activity-trigger-btn:hover::after,
.trial-activity-trigger-btn:focus-visible::after {
    transform: translateX(145%) rotate(14deg);
    opacity: 0.95;
}

.trial-activity-trigger-btn:active {
    transform: scale(0.98);
}

.trial-activity-trigger-btn__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.trial-activity-trigger-btn__badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.96), rgba(245, 158, 11, 0.94));
    color: #fffaf0;
    box-shadow:
        0 10px 20px rgba(245, 158, 11, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    white-space: nowrap;
}

.trial-activity-trigger-btn__copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    text-align: left;
}

.trial-activity-trigger-btn__title {
    display: block;
    font-size: 0.84rem;
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #f8fafc;
    white-space: nowrap;
}

.trial-activity-trigger-btn__desc {
    display: block;
    font-size: 0.65rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trial-activity-trigger-btn__arrow {
    flex: none;
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(248, 250, 252, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease;
}

.trial-activity-trigger-btn:hover .trial-activity-trigger-btn__arrow,
.trial-activity-trigger-btn:focus-visible .trial-activity-trigger-btn__arrow {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
    .trial-activity-trigger-btn {
        min-height: 4.5rem;
        padding: 0.88rem 0.92rem;
        border-radius: 1.3rem;
    }

    .trial-activity-trigger-btn__inner {
        gap: 0.7rem;
    }

    .trial-activity-trigger-btn__badge {
        padding: 0.34rem 0.55rem;
        font-size: 0.54rem;
        letter-spacing: 0.12em;
    }

    .trial-activity-trigger-btn__title {
        font-size: 0.77rem;
        letter-spacing: 0.1em;
    }

    .trial-activity-trigger-btn__desc {
        font-size: 0.6rem;
    }

    .trial-activity-trigger-btn__arrow {
        width: 2rem;
        height: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trial-activity-trigger-btn,
    .trial-activity-trigger-btn::after,
    .trial-activity-trigger-btn__arrow {
        transition: none !important;
    }
}
