@import url('../vendor/fonts/local-fonts.css');

/* @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;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

*,
*:before,
*:after {
    box-sizing: inherit;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

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

::selection {
    background: transparent;
    color: inherit;
}

::-moz-selection {
    background: transparent;
    color: inherit;
}

input,
textarea,
[contenteditable="true"],
.allow-text-select,
.allow-text-select *,
.text-selectable,
.text-selectable *,
pre,
code {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

#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(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 900px) {
    .masonry-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        padding: 0.5rem 0 3rem 0;
    }
}

@media (min-width: 901px) and (max-width: 1400px) and (orientation: landscape) {
    .masonry-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
        padding: 0.5rem 0 3rem 0;
    }
}

@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: 900px) {
    .exhibition-card {
        border-radius: 18px;
    }

    .card-content-premium {
        padding: 14px 14px 16px;
    }

    .card-title {
        font-size: 1.02rem;
        line-height: 1.18;
        margin-bottom: 4px;
    }

    .card-subtitle {
        font-size: 9px;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .card-tag {
        font-size: 7px;
        letter-spacing: 0.18em;
        margin-bottom: 7px;
        gap: 5px;
    }

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

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

@media (min-width: 901px) and (max-width: 1400px) and (orientation: landscape) {
    .exhibition-card {
        border-radius: 18px;
    }

    .card-content-premium {
        padding: 12px 12px 14px;
    }

    .card-title {
        font-size: 0.98rem;
        line-height: 1.18;
        margin-bottom: 4px;
    }

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

    .card-tag {
        font-size: 6.5px;
        letter-spacing: 0.16em;
        margin-bottom: 6px;
    }

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

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

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

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

    .card-subtitle {
        font-size: 7px;
        line-height: 1.35;
        margin-bottom: 7px;
    }

    .card-tag {
        font-size: 6px;
        margin-bottom: 4px;
        letter-spacing: 0.14em;
    }

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

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

.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);
}

.engine-preview-backdrop {
    background: rgba(2, 6, 23, 0.74);
    backdrop-filter: blur(20px);
}

.engine-preview-shell {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.97) 55%, rgba(241, 245, 249, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 2rem;
    box-shadow: 0 38px 110px -30px rgba(15, 23, 42, 0.58);
    height: auto;
    max-height: calc(100dvh - 2rem);
    isolation: isolate;
}

.engine-preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
    height: auto;
    min-height: 0;
    align-items: stretch;
}

.engine-preview-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.16);
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.engine-preview-close:hover {
    background: #fff;
    transform: translateY(-1px);
}

.engine-preview-visual {
    position: relative;
    min-height: clamp(24rem, 46dvh, 33rem);
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 20%, rgba(251, 191, 36, 0.34), transparent 32%),
        radial-gradient(circle at 78% 18%, rgba(56, 189, 248, 0.22), transparent 28%),
        linear-gradient(140deg, #0f172a 0%, #111827 48%, #1e293b 100%);
}

.engine-preview-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.03);
    filter: saturate(1.08) contrast(1.03);
}

.engine-preview-visual__glow {
    position: absolute;
    right: -8%;
    bottom: -18%;
    width: 17rem;
    height: 17rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.34), transparent 70%);
    filter: blur(10px);
    z-index: 1;
}

.engine-preview-visual__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.12) 0%, rgba(15, 23, 42, 0.2) 38%, rgba(2, 6, 23, 0.76) 100%);
}

.engine-preview-visual__eyebrow {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    backdrop-filter: blur(14px);
}

.engine-preview-visual__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 2rem;
    color: #fff;
}

.engine-preview-visual__code {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.82rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    backdrop-filter: blur(14px);
}

.engine-preview-visual__title {
    margin: 1rem 0 0;
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.engine-preview-visual__subtitle {
    margin: 0.8rem 0 0;
    max-width: 36rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
    line-height: 1.8;
}

.engine-preview-panel {
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 1.35rem 1.55rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.engine-preview-panel__fit {
    --engine-preview-panel-scale: 1;
    display: flex;
    flex-direction: column;
    gap: inherit;
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    transform: none;
}

.engine-preview-scroll {
    flex: 0 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: inherit;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.engine-preview-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.engine-preview-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-right: 3.35rem;
}

.engine-preview-kicker {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.engine-preview-badges {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.engine-preview-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.engine-preview-badge--formula {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.22);
    color: #92400e;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.engine-preview-heading {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.engine-preview-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.68rem, 2.35vw, 2.32rem);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.engine-preview-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.42;
    -webkit-line-clamp: 2;
}

.engine-preview-section {
    display: flex;
    flex-direction: column;
    gap: 0.58rem;
}

.engine-preview-section__label {
    color: #475569;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.engine-preview-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.engine-preview-point {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.62rem 0.75rem;
    border-radius: 0.85rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.92) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.engine-preview-point__index {
    flex: none;
    width: 1.58rem;
    height: 1.58rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.engine-preview-point__text {
    color: #1e293b;
    font-size: 0.84rem;
    line-height: 1.38;
    -webkit-line-clamp: 2;
}

.engine-preview-abstract {
    margin: 0;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.38;
    -webkit-line-clamp: 2;
}

.engine-preview-subtitle,
.engine-preview-point__text,
.engine-preview-abstract {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.engine-preview-footer {
    flex: none;
    margin-top: 0.1rem;
    padding-top: 0.52rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
    z-index: 2;
}

.engine-preview-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.75;
}

.engine-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: nowrap;
}

.engine-preview-secondary,
.engine-preview-primary {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.55rem;
    padding: 0.62rem 0.95rem;
    border-radius: 0.86rem;
    border: 0;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
    text-transform: uppercase;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.engine-preview-secondary {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #334155;
}

.engine-preview-secondary:hover {
    background: #fff;
    transform: translateY(-1px);
}

.engine-preview-primary {
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
    color: #fff;
    box-shadow: 0 18px 42px -18px rgba(15, 23, 42, 0.75);
}

.engine-preview-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 52px -20px rgba(15, 23, 42, 0.78);
}

.engine-preview-primary:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
    box-shadow: none;
}

.engine-preview-shell--compact .engine-preview-panel {
    padding: 1.22rem 1.32rem 0.68rem;
    gap: 0.58rem;
}

.engine-preview-shell--compact .engine-preview-visual__content {
    padding: 1.55rem 1.7rem;
}

.engine-preview-shell--compact .engine-preview-visual__title {
    font-size: clamp(1.7rem, 2.55vw, 2.35rem);
}

.engine-preview-shell--compact .engine-preview-title {
    font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.engine-preview-shell--compact .engine-preview-subtitle,
.engine-preview-shell--compact .engine-preview-abstract,
.engine-preview-shell--compact .engine-preview-point__text {
    font-size: 0.74rem;
    line-height: 1.34;
}

.engine-preview-shell--compact .engine-preview-point {
    padding: 0.48rem 0.62rem;
    gap: 0.5rem;
}

.engine-preview-shell--compact .engine-preview-point__index {
    width: 1.32rem;
    height: 1.32rem;
    font-size: 0.5rem;
}

.engine-preview-shell--compact .engine-preview-section {
    gap: 0.42rem;
}

.engine-preview-shell--compact .engine-preview-points {
    gap: 0.38rem;
}

.engine-preview-shell--compact .engine-preview-footer {
    padding-top: 0.42rem;
    gap: 0.45rem;
}

.engine-preview-shell--compact .engine-preview-abstract,
.engine-preview-shell--compact .engine-preview-point__text {
    -webkit-line-clamp: 3;
}

.engine-preview-shell--compact .engine-preview-hint {
    font-size: 0.78rem;
    line-height: 1.55;
}

.engine-preview-shell--dense .engine-preview-panel {
    padding: 0.98rem 1.08rem 0.58rem;
    gap: 0.42rem;
}

.engine-preview-shell--dense .engine-preview-visual__content {
    padding: 1.2rem 1.35rem;
}

.engine-preview-shell--dense .engine-preview-visual__code {
    padding: 0.42rem 0.62rem;
    font-size: 0.58rem;
}

.engine-preview-shell--dense .engine-preview-visual__title {
    margin-top: 0.62rem;
    font-size: clamp(1.45rem, 2.25vw, 2rem);
}

.engine-preview-shell--dense .engine-preview-visual__subtitle {
    margin-top: 0.5rem;
    font-size: 0.74rem;
    line-height: 1.42;
}

.engine-preview-shell--dense .engine-preview-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
}

.engine-preview-shell--dense .engine-preview-badge {
    min-height: 1.65rem;
    padding: 0.3rem 0.56rem;
    font-size: 0.62rem;
}

.engine-preview-shell--dense .engine-preview-heading {
    gap: 0.42rem;
}

.engine-preview-shell--dense .engine-preview-title {
    font-size: clamp(1.28rem, 1.95vw, 1.72rem);
    line-height: 1.05;
}

.engine-preview-shell--dense .engine-preview-subtitle,
.engine-preview-shell--dense .engine-preview-abstract,
.engine-preview-shell--dense .engine-preview-point__text {
    font-size: 0.66rem;
    line-height: 1.28;
}

.engine-preview-shell--dense .engine-preview-subtitle,
.engine-preview-shell--dense .engine-preview-point__text {
    -webkit-line-clamp: 2;
}

.engine-preview-shell--dense .engine-preview-abstract {
    -webkit-line-clamp: 3;
}

.engine-preview-shell--dense .engine-preview-section {
    gap: 0.34rem;
}

.engine-preview-shell--dense .engine-preview-section__label {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
}

.engine-preview-shell--dense .engine-preview-points {
    gap: 0.32rem;
}

.engine-preview-shell--dense .engine-preview-point {
    padding: 0.38rem 0.5rem;
    gap: 0.42rem;
    border-radius: 0.68rem;
}

.engine-preview-shell--dense .engine-preview-point__index {
    width: 1.18rem;
    height: 1.18rem;
    font-size: 0.46rem;
}

.engine-preview-shell--dense .engine-preview-footer {
    padding-top: 0.34rem;
    gap: 0.34rem;
}

.engine-preview-shell--dense .engine-preview-hint {
    font-size: 0.68rem;
    line-height: 1.42;
}

.engine-preview-shell--dense .engine-preview-secondary,
.engine-preview-shell--dense .engine-preview-primary {
    min-height: 2.18rem;
    padding: 0.46rem 0.68rem;
    font-size: 0.6rem;
}

@media (max-width: 1100px) {
    .engine-preview-shell {
        max-width: min(90vw, 36rem);
        height: auto;
        max-height: calc(100dvh - 1.5rem);
        overflow-x: hidden;
        overflow-y: hidden;
        border-radius: 1.5rem;
    }

    .engine-preview-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: 0;
    }

    .engine-preview-visual {
        height: clamp(9rem, 22vw, 11.5rem);
        min-height: 0;
        aspect-ratio: auto;
    }

    .engine-preview-visual__content {
        padding: 0.95rem 1.05rem 0.9rem;
    }

    .engine-preview-visual__title {
        margin-top: 0.55rem;
        font-size: clamp(1.25rem, 3.6vw, 1.65rem);
    }

    .engine-preview-visual__subtitle {
        margin-top: 0.45rem;
        font-size: 0.74rem;
        line-height: 1.45;
    }

    .engine-preview-panel {
        height: auto;
        min-height: 0;
        padding: 0.95rem 0.95rem 0.9rem;
        gap: 0.68rem;
    }

    .engine-preview-scroll {
        padding-right: 0.08rem;
    }

    .engine-preview-topline {
        gap: 0.55rem;
    }

    .engine-preview-kicker {
        font-size: 0.58rem;
        letter-spacing: 0.18em;
    }

    .engine-preview-heading {
        gap: 0.45rem;
    }

    .engine-preview-section {
        gap: 0.55rem;
    }

    .engine-preview-section__label {
        font-size: 0.62rem;
        letter-spacing: 0.16em;
    }

    .engine-preview-points {
        gap: 0.55rem;
    }

    .engine-preview-title {
        font-size: clamp(1.25rem, 3.8vw, 1.72rem);
    }

    .engine-preview-subtitle,
    .engine-preview-abstract,
    .engine-preview-point__text {
        font-size: 0.78rem;
        line-height: 1.52;
    }

    .engine-preview-point {
        padding: 0.58rem 0.68rem;
        gap: 0.62rem;
        border-radius: 0.85rem;
    }

    .engine-preview-point__index {
        width: 1.55rem;
        height: 1.55rem;
        font-size: 0.58rem;
    }

    .engine-preview-footer {
        padding-top: 0.7rem;
        gap: 0.62rem;
    }

    .engine-preview-hint {
        font-size: 0.72rem;
        line-height: 1.5;
    }

    .engine-preview-secondary,
    .engine-preview-primary {
        min-height: 2.4rem;
        padding: 0.62rem 0.85rem;
        font-size: 0.66rem;
    }
}

@media (min-width: 901px) and (max-width: 1400px) and (orientation: landscape) {
    #enginePreviewModal {
        padding: 1rem 1.5rem;
        align-items: center;
    }

    .engine-preview-shell {
        width: min(88vw, 74rem);
        max-width: 74rem;
        height: auto;
        max-height: calc(100dvh - 2rem);
        border-radius: 1.55rem;
        overflow: hidden;
    }

    .engine-preview-layout {
        grid-template-columns: minmax(0, 0.96fr) minmax(330px, 1.04fr);
        min-height: 0;
        height: auto;
    }

    .engine-preview-close {
        top: 0.8rem;
        right: 0.8rem;
        width: 2.45rem;
        height: 2.45rem;
    }

    .engine-preview-visual {
        min-height: 0;
        height: auto;
        min-height: clamp(24rem, 52dvh, 32rem);
    }

    .engine-preview-visual__eyebrow {
        top: 1.15rem;
        left: 1.15rem;
        padding: 0.56rem 0.82rem;
        font-size: 0.62rem;
        letter-spacing: 0.14em;
    }

    .engine-preview-visual__content {
        padding: 1.35rem 1.45rem 1.35rem;
    }

    .engine-preview-visual__code {
        padding: 0.48rem 0.72rem;
        font-size: 0.64rem;
    }

    .engine-preview-visual__title {
        margin-top: 0.78rem;
        font-size: clamp(1.6rem, 2.9vw, 2.3rem);
        line-height: 1.05;
    }

    .engine-preview-visual__subtitle {
        margin-top: 0.6rem;
        font-size: 0.82rem;
        line-height: 1.55;
    }

    .engine-preview-panel {
        height: auto;
        min-height: 0;
        overflow: hidden;
        padding: 1.35rem 1.45rem 1.25rem;
        gap: 0.85rem;
    }

    .engine-preview-topline {
        gap: 0.7rem;
    }

    .engine-preview-kicker {
        font-size: 0.64rem;
        letter-spacing: 0.2em;
    }

    .engine-preview-badges {
        gap: 0.5rem;
    }

    .engine-preview-badge {
        min-height: 1.85rem;
        padding: 0.38rem 0.68rem;
        font-size: 0.7rem;
    }

    .engine-preview-heading {
        gap: 0.52rem;
    }

    .engine-preview-title {
        font-size: clamp(1.8rem, 3.1vw, 2.45rem);
        line-height: 1.08;
    }

    .engine-preview-subtitle,
    .engine-preview-abstract,
    .engine-preview-point__text {
        font-size: 0.88rem;
        line-height: 1.58;
    }

    .engine-preview-section {
        gap: 0.62rem;
    }

    .engine-preview-section__label {
        font-size: 0.66rem;
        letter-spacing: 0.18em;
    }

    .engine-preview-points {
        gap: 0.58rem;
    }

    .engine-preview-point {
        gap: 0.7rem;
        padding: 0.68rem 0.82rem;
        border-radius: 0.92rem;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
    }

    .engine-preview-point__index {
        width: 1.72rem;
        height: 1.72rem;
        font-size: 0.64rem;
    }

    .engine-preview-footer {
        padding-top: 0.82rem;
        gap: 0.78rem;
    }

    .engine-preview-hint {
        font-size: 0.8rem;
        line-height: 1.55;
    }

    .engine-preview-secondary,
    .engine-preview-primary {
        min-height: 2.65rem;
        padding: 0.72rem 1rem;
        border-radius: 0.9rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    #enginePreviewModal {
        padding: 0.5rem;
        align-items: flex-start;
    }

    .engine-preview-shell {
        max-width: 100%;
        height: auto;
        max-height: calc(100dvh - 1rem);
        border-radius: 1.15rem;
    }

    .engine-preview-close {
        top: 0.55rem;
        right: 0.55rem;
        width: 2.25rem;
        height: 2.25rem;
    }

    .engine-preview-visual {
        display: block;
        width: 100%;
        min-height: 10.5rem;
        height: clamp(10.5rem, 44vw, 13.25rem);
        aspect-ratio: auto;
    }

    .engine-preview-visual__eyebrow {
        top: 0.65rem;
        left: 0.65rem;
        padding: 0.42rem 0.58rem;
        font-size: 0.5rem;
        letter-spacing: 0.1em;
    }

    .engine-preview-visual__content {
        padding: 0.9rem 0.9rem 0.82rem;
    }

    .engine-preview-visual__code {
        font-size: 0.54rem;
        padding: 0.34rem 0.52rem;
    }

    .engine-preview-visual__title {
        margin-top: 0.55rem;
        font-size: 1.16rem;
        letter-spacing: -0.03em;
    }

    .engine-preview-visual__subtitle {
        margin-top: 0.45rem;
        font-size: 0.66rem;
        line-height: 1.45;
    }

    .engine-preview-panel {
        padding: 0.82rem 0.78rem 0.78rem;
        gap: 0.68rem;
    }

    .engine-preview-badges {
        gap: 0.35rem;
    }

    .engine-preview-badge {
        min-height: 1.55rem;
        padding: 0.28rem 0.5rem;
        font-size: 0.56rem;
    }

    .engine-preview-title {
        font-size: 1.22rem;
    }

    .engine-preview-subtitle,
    .engine-preview-abstract,
    .engine-preview-point__text {
        font-size: 0.74rem;
        line-height: 1.52;
    }

    .engine-preview-point {
        padding: 0.55rem 0.62rem;
        gap: 0.55rem;
        border-radius: 0.8rem;
    }

    .engine-preview-point__index {
        width: 1.45rem;
        height: 1.45rem;
        font-size: 0.54rem;
    }

    .engine-preview-hint {
        font-size: 0.68rem;
        line-height: 1.5;
    }

    .engine-preview-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .engine-preview-secondary,
    .engine-preview-primary {
        flex: none;
        width: 100%;
        min-height: 2.45rem;
        padding: 0.65rem 0.85rem;
        font-size: 0.62rem;
    }
}

.engine-preview-shell--fit-tight .engine-preview-panel {
    padding: 1.08rem 1.12rem 0.54rem;
    gap: 0.42rem;
}

.engine-preview-shell--fit-tight .engine-preview-topline,
.engine-preview-shell--fit-tight .engine-preview-heading,
.engine-preview-shell--fit-tight .engine-preview-section {
    gap: 0.34rem;
}

.engine-preview-shell--fit-tight .engine-preview-title {
    font-size: clamp(1.28rem, 1.85vw, 1.72rem);
    line-height: 1.05;
}

.engine-preview-shell--fit-tight .engine-preview-subtitle,
.engine-preview-shell--fit-tight .engine-preview-abstract,
.engine-preview-shell--fit-tight .engine-preview-point__text {
    font-size: 0.64rem;
    line-height: 1.22;
}

.engine-preview-shell--fit-tight .engine-preview-abstract {
    -webkit-line-clamp: 2;
}

.engine-preview-shell--fit-tight .engine-preview-points {
    gap: 0.3rem;
}

.engine-preview-shell--fit-tight .engine-preview-point {
    gap: 0.38rem;
    padding: 0.36rem 0.46rem;
    border-radius: 0.62rem;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.045);
}

.engine-preview-shell--fit-tight .engine-preview-point__index {
    width: 1.08rem;
    height: 1.08rem;
    font-size: 0.42rem;
}

.engine-preview-shell--fit-tight .engine-preview-footer {
    padding-top: 0.28rem;
}

.engine-preview-shell--fit-tight .engine-preview-secondary,
.engine-preview-shell--fit-tight .engine-preview-primary {
    min-height: 2.08rem;
    padding: 0.42rem 0.62rem;
    font-size: 0.58rem;
}

.engine-preview-shell--fit-tighter .engine-preview-panel {
    padding: 0.86rem 0.95rem 0.46rem;
    gap: 0.32rem;
}

.engine-preview-shell--fit-tighter .engine-preview-kicker,
.engine-preview-shell--fit-tighter .engine-preview-section__label {
    font-size: 0.52rem;
    letter-spacing: 0.13em;
}

.engine-preview-shell--fit-tighter .engine-preview-badge {
    min-height: 1.35rem;
    padding: 0.22rem 0.44rem;
    font-size: 0.52rem;
}

.engine-preview-shell--fit-tighter .engine-preview-title {
    font-size: clamp(1.12rem, 1.65vw, 1.48rem);
    -webkit-line-clamp: 1;
}

.engine-preview-shell--fit-tighter .engine-preview-subtitle,
.engine-preview-shell--fit-tighter .engine-preview-abstract,
.engine-preview-shell--fit-tighter .engine-preview-point__text {
    font-size: 0.58rem;
    line-height: 1.16;
}

.engine-preview-shell--fit-tighter .engine-preview-subtitle,
.engine-preview-shell--fit-tighter .engine-preview-abstract,
.engine-preview-shell--fit-tighter .engine-preview-point__text {
    -webkit-line-clamp: 1;
}

.engine-preview-shell--fit-tighter .engine-preview-point {
    padding: 0.3rem 0.4rem;
}

.engine-preview-shell--fit-tighter .engine-preview-point__index {
    width: 0.96rem;
    height: 0.96rem;
    font-size: 0.38rem;
}

.engine-preview-shell--fit-minimal .engine-preview-subtitle {
    display: none;
}

.engine-preview-shell--fit-minimal .engine-preview-section--abstract {
    display: none;
}

.engine-preview-shell--fit-minimal .engine-preview-point:nth-child(3) {
    display: none;
}

.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: 100vh;
    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-header-explanation-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-explanation-btn:hover {
    box-shadow: 0 12px 26px rgba(2, 132, 199, 0.12);
    transform: translateY(-1px);
}

.explanation-shell,
.explanation-shell * {
    box-sizing: border-box;
    min-width: 0;
}

.explanation-shell {
    display: flex;
    flex-direction: column;
}

.explanation-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1rem, 2.4vw, 1.5rem);
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.explanation-kicker {
    color: #0284c7;
    font-size: 0.65rem;
    font-weight: 950;
    letter-spacing: 0.22em;
}

.explanation-title {
    color: #0f172a;
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    line-height: 1.2;
    font-weight: 850;
    margin-top: 0.28rem;
}

.explanation-close {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 1.45rem;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.explanation-close:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: scale(1.04);
}

.explanation-body {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
    gap: clamp(1.25rem, 2.4vw, 2rem);
    padding: clamp(1rem, 2.4vw, 1.5rem);
    background: #f8fafc;
    isolation: isolate;
}

.explanation-stage {
    position: relative;
    z-index: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 1.35rem;
    border: 1px solid #dbeafe;
    background: radial-gradient(circle at 50% 22%, #e0f2fe 0%, #eff6ff 42%, #0f172a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 18px 38px rgba(15, 23, 42, 0.10);
}

.explanation-stage::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 6;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(219, 234, 254, 0.82);
}

.explanation-media,
.explanation-video-shell {
    width: 100%;
    max-width: 100%;
}

.explanation-video-shell {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: min(58vh, 520px);
    background: #020617;
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.explanation-video {
    grid-row: 1;
    grid-column: 1;
    align-self: center;
    justify-self: center;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: calc(92dvh - 190px);
    object-fit: contain;
    background: #020617;
    touch-action: manipulation;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.explanation-video-tap {
    grid-row: 1;
    grid-column: 1;
    align-self: stretch;
    justify-self: stretch;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #ffffff;
    background: rgba(2, 6, 23, 0.08);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s ease, opacity 0.18s ease;
}

.explanation-video-tap span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.25rem;
    min-height: 4.25rem;
    padding: 0 1.1rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.34);
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.explanation-video-shell[data-state="playing"] .explanation-video-tap {
    background: transparent;
}

.explanation-video-shell[data-state="playing"] .explanation-video-tap span,
.explanation-video-shell[data-prompt="hidden"] .explanation-video-tap span {
    visibility: hidden;
    opacity: 0;
    transform: scale(0.92);
}

.explanation-video-shell[data-state="playing"] .explanation-video-tap:hover span,
.explanation-video-shell[data-state="playing"] .explanation-video-tap:focus-visible span,
.explanation-video-shell[data-prompt="hidden"] .explanation-video-tap:hover span,
.explanation-video-shell[data-prompt="hidden"] .explanation-video-tap:focus-visible span {
    visibility: hidden;
    opacity: 0;
    transform: scale(0.92);
}

.explanation-video-message {
    grid-row: 1;
    grid-column: 1;
    z-index: 4;
    align-self: center;
    justify-self: center;
    max-width: min(26rem, calc(100% - 2rem));
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    color: #fee2e2;
    background: rgba(127, 29, 29, 0.88);
    border: 1px solid rgba(254, 202, 202, 0.45);
    text-align: center;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.5;
}

.explanation-image {
    align-self: center;
    justify-self: center;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(92dvh - 180px);
    object-fit: contain;
    background: #ffffff;
}

.explanation-video-controls {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.8rem 1.45rem;
    background: rgba(2, 6, 23, 0.92);
    color: #e2e8f0;
}

.explanation-video-play,
.explanation-video-mute {
    min-height: 2.25rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.85rem;
    padding: 0 0.8rem;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.92);
    font-size: 0.75rem;
    font-weight: 850;
    white-space: nowrap;
}

.explanation-video-progress {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    accent-color: #38bdf8;
}

.explanation-video-time {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: center;
    transform: translateY(1.02rem);
    pointer-events: none;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.explanation-rail {
    position: relative;
    z-index: 3;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.35rem 0.2rem 0.25rem 0.2rem;
    background: #f8fafc;
}

.explanation-thumb {
    position: relative;
    z-index: 1;
    width: 100%;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    padding: 0.85rem;
    text-align: left;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.explanation-thumb:hover,
.explanation-thumb.is-active {
    border-color: #38bdf8;
    background: #eff6ff;
    box-shadow: 0 14px 28px rgba(2, 132, 199, 0.12);
}

.explanation-thumb:hover {
    transform: translateY(-1px);
}

.explanation-thumb.is-active {
    transform: none;
}

.explanation-thumb b,
.explanation-thumb span {
    display: block;
}

.explanation-thumb b {
    font-size: 0.85rem;
    line-height: 1.35;
    font-weight: 900;
}

.explanation-thumb span {
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 760;
}

@media (hover: none) {
    .explanation-video-shell[data-state="playing"] .explanation-video-tap span,
    .explanation-video-shell[data-prompt="hidden"] .explanation-video-tap span {
        visibility: hidden;
        opacity: 0;
    }
}

@media (max-width: 1024px) {
    .sim-header-explanation-btn {
        min-height: 2.25rem;
        padding: 0.5rem 0.8rem;
        font-size: 9px !important;
    }

    .explanation-body {
        grid-template-columns: minmax(0, 1fr) minmax(160px, 210px);
        gap: 1rem;
    }
}

@media (min-width: 761px) {
    .explanation-body {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    }

    .explanation-rail {
        padding-left: 0.35rem;
    }
}

@media (max-width: 760px) {
    #explanationModal {
        align-items: center;
        padding: calc(0.55rem + env(safe-area-inset-top, 0px)) calc(0.55rem + env(safe-area-inset-right, 0px)) calc(0.55rem + env(safe-area-inset-bottom, 0px)) calc(0.55rem + env(safe-area-inset-left, 0px)) !important;
    }

    .explanation-shell {
        width: 100%;
        max-height: calc(100dvh - 1.1rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 1.25rem !important;
    }

    .explanation-header {
        gap: 0.75rem;
        padding: 0.85rem 0.9rem;
    }

    .explanation-kicker {
        font-size: 0.56rem;
        letter-spacing: 0.18em;
    }

    .explanation-title {
        font-size: 1.02rem;
        line-height: 1.22;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .explanation-close {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 1.3rem;
    }

    .explanation-body {
        flex: 0 1 auto;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 0.75rem;
        padding: 0.75rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .explanation-stage {
        align-items: center;
        justify-content: center;
        border-radius: 1rem;
        min-height: min(46dvh, 360px);
    }

    .explanation-video-shell {
        grid-template-rows: minmax(0, 1fr) auto;
        height: min(46dvh, 360px);
        min-height: 0;
    }

    .explanation-video,
    .explanation-image {
        max-height: min(52dvh, 430px);
    }

    .explanation-video {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .explanation-image {
        width: auto;
        height: auto;
        max-width: 100%;
    }

    .explanation-video-controls {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.5rem;
        padding: 0.62rem 0.62rem 1.48rem;
    }

    .explanation-video-play,
    .explanation-video-mute {
        min-height: 2.45rem;
        border-radius: 0.8rem;
        padding: 0 0.68rem;
        font-size: 0.7rem;
    }

    .explanation-video-mute {
        grid-column: 3;
        grid-row: 1;
    }

    .explanation-video-time {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        justify-self: center;
        transform: translateY(1.05rem);
        font-size: 0.7rem;
    }

    .explanation-video-tap span {
        min-width: 3.6rem;
        min-height: 3.6rem;
        font-size: 0.76rem;
    }

    .explanation-rail {
        min-height: 0;
        max-height: 7.2rem;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        gap: 0.55rem;
        padding: 0.05rem 0 0.35rem;
        -webkit-overflow-scrolling: touch;
    }

    .explanation-thumb {
        flex: 0 0 min(78vw, 15rem);
        padding: 0.72rem;
        border-radius: 0.9rem;
    }
}

@media (max-width: 640px) {
    .sim-header-explanation-btn {
        min-height: 2rem;
        padding: 0.45rem 0.7rem;
        letter-spacing: 0.12em !important;
    }
}

@media (max-height: 520px) {
    #explanationModal {
        padding: 0.45rem !important;
    }

    .explanation-shell {
        max-height: calc(100dvh - 0.9rem) !important;
        border-radius: 1rem !important;
    }

    .explanation-header {
        padding: 0.62rem 0.75rem;
    }

    .explanation-title {
        font-size: 0.95rem;
        margin-top: 0.1rem;
    }

    .explanation-kicker {
        font-size: 0.52rem;
    }

    .explanation-body {
        padding: 0.55rem;
        gap: 0.55rem;
    }

    .explanation-video-shell {
        min-height: 0;
        height: min(48dvh, 300px);
    }

    .explanation-video,
    .explanation-image {
        max-height: calc(100dvh - 9.5rem);
    }

    .explanation-video-controls {
        padding: 0.48rem 0.48rem 1.35rem;
    }

    .explanation-video-play,
    .explanation-video-mute {
        min-height: 2.05rem;
        border-radius: 0.7rem;
    }
}

.sim-body {
    flex: 1;
    display: flex;
    --sim-sidebar-width: clamp(460px, 36vw, 620px);
    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);
}

.statics-svg-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}

.statics-svg-layer * {
    vector-effect: non-scaling-stroke;
}

.statics-svg-layer text {
    font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    paint-order: stroke;
    stroke: rgba(15, 23, 42, 0.22);
    stroke-width: 0.4px;
}

.statics-svg-layer .statics-svg-angle text {
    stroke: none;
}

.statics-svg-layer .statics-svg-handle {
    transition: opacity 0.18s ease, transform 0.18s ease;
    transform-box: fill-box;
    transform-origin: center;
}

.statics-svg-layer .statics-svg-handle.is-active {
    transform: scale(1.035);
}

.statics-svg-layer .statics-svg-handle.is-dragging {
    transform: scale(1.06);
}

.statics-svg-layer .statics-svg-force path,
.statics-svg-layer .statics-svg-angle path,
.statics-svg-layer .statics-svg-lesson-focus ellipse {
    transition: opacity 0.18s ease, stroke-width 0.18s ease;
}

#simCanvas {
    position: relative;
    z-index: 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);
    min-width: 0;
}

.sim-controls {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
}

.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;
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
}
.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;
}

.sim-help-content {
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.75;
}

.sim-help-content :where(section, div, p, ul, ol) {
    color: #1e293b !important;
}

.sim-help-content :where(p, li, span) {
    color: #334155 !important;
    font-size: 0.95rem !important;
    line-height: 1.75 !important;
}

.sim-help-content :where(ul, ol) {
    margin-top: 0.35rem;
    padding-left: 1.1rem;
}

.sim-help-content :where(li) {
    margin-top: 0.2rem;
}

.sim-help-content :where(h4, h5, b, strong) {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.sim-help-content :where(h4, h5) {
    margin-bottom: 0.35rem;
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
}

.sim-help-content :where(.text-xs, .text-sm) {
    font-size: 0.95rem !important;
}

.sim-help-content :where(.text-slate-300, .text-slate-400, .text-slate-500, .text-slate-600, .text-slate-700) {
    color: #334155 !important;
}

.sim-help-content :where(.text-amber-300, .text-amber-400, .text-amber-500, .text-amber-600, .text-sky-300, .text-sky-400, .text-emerald-300, .text-emerald-400, .text-rose-400, .text-purple-400) {
    color: #0f172a !important;
}

.sim-help-content > div:last-child {
    border-color: #e2e8f0 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
}

.sim-help-content > div:last-child div {
    color: #0f172a !important;
}

.sim-help-content > div:last-child .font-mono,
.sim-help-content .font-mono {
    color: #0f172a !important;
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
}

.sim-help-content .physics-principle-block {
    color: #334155 !important;
}

.sim-help-content .physics-principle-block p,
.sim-help-content .physics-principle-block li {
    color: #334155 !important;
    font-size: 0.95rem !important;
    line-height: 1.75 !important;
}

.sim-help-content .physics-principle-block h3,
.sim-help-content .physics-principle-block h4,
.sim-help-content .physics-principle-heading {
    margin: 0.85rem 0 0.35rem;
    color: #0f172a !important;
    font-size: 0.98rem !important;
    font-weight: 900 !important;
    line-height: 1.45 !important;
}

.sim-help-content .physics-principle-summary {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.sim-help-content .physics-formula {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0.65rem 0 1rem;
    padding: 0 0 0.15rem;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #0f172a !important;
    font-family: "Times New Roman", "Noto Serif SC", serif;
    font-size: 1rem !important;
    font-weight: 800;
    line-height: 1.8 !important;
    text-align: center;
    white-space: nowrap;
}

.sim-help-content .physics-formula math {
    display: block math;
    width: max-content;
    min-width: fit-content;
    margin: 0 auto;
    color: #0f172a !important;
    font-family: "Times New Roman", "Noto Serif SC", serif;
    font-size: 1.16rem !important;
    font-weight: 900;
    math-style: normal;
    line-height: 1.55 !important;
}

.sim-help-content .physics-formula math * {
    color: #0f172a !important;
}

#simControls[class*="jr-"][class*="-controls"] {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#simControls .control-category,
#simControls [class*="-category"],
#simControls [class*="-safe"] {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sim-sidebar:has(.statics-control-root) {
    width: var(--sim-sidebar-width);
}

.statics-control-root {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.statics-control-root .statics-panel-section {
    margin: 0 !important;
    padding-bottom: 0.9rem;
}

.statics-control-root .statics-panel-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.statics-control-root .statics-status-card {
    border-radius: 1rem;
}

.statics-control-root .control-group {
    margin-bottom: 0.62rem !important;
    padding: 0.66rem 0.72rem !important;
    border-color: #e2e8f0 !important;
    border-radius: 0.85rem !important;
    background: #f8fafc !important;
    box-shadow: none !important;
}

.statics-control-root .control-group:last-of-type {
    margin-bottom: 0 !important;
}

.statics-control-root .control-group .flex {
    gap: 0.55rem;
    margin-bottom: 0.38rem !important;
}

.statics-control-root .control-group label {
    color: #475569 !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.12em !important;
    line-height: 1.25;
}

.statics-control-root .control-group input[type="number"] {
    width: 4.6rem !important;
    min-height: 1.8rem;
    border-color: #cbd5e1 !important;
    border-radius: 0.55rem !important;
    background: #fff !important;
}

.statics-control-root .statics-force-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.statics-control-root .statics-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.statics-control-root .statics-force-card {
    min-height: 3.2rem;
    border-radius: 0.85rem;
}

.statics-control-root .statics-force-card div:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statics-control-root .statics-flow-step,
.statics-control-root .statics-line-item {
    border-radius: 0.85rem;
}

.statics-control-root .statics-flow-step {
    min-height: 5.2rem;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.statics-control-root .statics-flow-step.is-active {
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.statics-control-root .statics-lesson-pace .statics-pace-btn {
    min-width: 0;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.statics-control-root .statics-lesson-pace .statics-pace-btn:hover {
    transform: translateY(-1px);
}

.statics-control-root .statics-lesson-pace .statics-pace-btn.is-active {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.sim-sidebar:has(.statics-control-root) .sim-controls-scroll {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
}

@media (orientation: landscape) and (max-height: 720px) {
    .sim-sidebar:has(.statics-control-root) {
        width: var(--sim-sidebar-width);
    }

    .statics-control-root {
        gap: 0.68rem;
    }

    .statics-control-root .statics-panel-section {
        padding-bottom: 0.68rem;
    }

    .statics-control-root .control-group {
        margin-bottom: 0.48rem !important;
        padding: 0.52rem 0.62rem !important;
    }

    .statics-control-root .statics-force-card {
        min-height: 2.85rem;
    }

    .statics-control-root .statics-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statics-control-root .statics-flow-step {
        min-height: 0;
    }
}

#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);
}

/* 操作面板的文字模块保留选中颜色与边框，不显示点击、聚焦后的发光或弹跳效果。 */
#simOverlay #simControls button,
#simOverlay #tabControls,
#simOverlay #tabHelp,
#simOverlay #simThemeToggle,
#simOverlay #simSidebarToggleBtn {
    -webkit-tap-highlight-color: transparent;
    text-shadow: none;
}

#simOverlay #simControls button:active,
#simOverlay #simControls button:focus,
#simOverlay #simControls button:focus-visible,
#simOverlay #tabControls:active,
#simOverlay #tabControls:focus,
#simOverlay #tabControls:focus-visible,
#simOverlay #tabHelp:active,
#simOverlay #tabHelp:focus,
#simOverlay #tabHelp:focus-visible,
#simOverlay #simThemeToggle:active,
#simOverlay #simThemeToggle:focus,
#simOverlay #simThemeToggle:focus-visible,
#simOverlay #simSidebarToggleBtn:active,
#simOverlay #simSidebarToggleBtn:focus,
#simOverlay #simSidebarToggleBtn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
    transform: none !important;
}

#simOverlay #simControls button.is-active,
#simOverlay #simControls button.is-selected,
#simOverlay #simControls button.is-emphasis,
#simOverlay #simControls button.on,
#simOverlay #simControls button.sel,
#simOverlay #simControls button[aria-pressed="true"] {
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

/* =====================================================
   响应式布局策略 — 以屏幕方向为核心
   · 竖屏 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;
    }

    /* 竖屏不需要侧栏收起功能 */
    #simSidebarToggleBtn,
    .sim-sidebar-resize-handle {
        display: none !important;
    }

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

    .sim-body {
        flex-direction: column;
        overflow: hidden;
        overflow-x: hidden;
        min-height: 0;
    }

    .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;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    /* SVG 课件按自身画布比例显示，避免在竖屏容器内被横向压扁或纵向拉长。 */
    #simOverlay .sim-canvas-area.jr-embedded-stage-native-ratio {
        aspect-ratio: 12 / 7 !important;
        height: auto !important;
        min-height: 220px;
        max-height: min(58dvh, 520px) !important;
    }

    .sim-sidebar {
        /* 控制面板满宽展开，内部滚动，避免滚动时模拟框离开视口 */
        width: 100% !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        border-radius: 1.5rem;
    }

    /* sidebar 内容区域独立滚动，不推动模拟框 */
    .sim-sidebar>.flex-1,
    .sim-sidebar>div.overflow-y-auto,
    .sim-sidebar>div[class*="overflow"] {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 控制面板内部满宽展开 */
    .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;
        min-height: 0 !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(360px, 40vw, 500px);
    }
}

/* 横屏平板通常具有桌面级 CSS 宽度，但触控操作不需要桌面侧栏的 460px 下限。 */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) and (min-height: 501px) {
    .sim-body {
        --sim-sidebar-width: clamp(340px, 34vw, 420px);
    }
}

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

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

    .sim-sidebar {
        height: calc(100vh - 50px - 1rem) !important;
        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;
    }
}

/* mobile-portrait-courseware-frame: embedded physics courseware needs more vertical room than the old 8:5 canvas ratio. */
@media (orientation: portrait) and (max-width: 640px) {
    #simOverlay .sim-canvas-area {
        aspect-ratio: auto !important;
        height: clamp(280px, 42dvh, 360px) !important;
        min-height: 280px !important;
        max-height: 360px !important;
        position: sticky;
        top: 0;
    }

    #simOverlay .sim-sidebar {
        flex: 1 1 auto !important;
        max-height: min(52dvh, 420px) !important;
        min-height: 260px !important;
    }

    #simOverlay .sim-sidebar .sim-controls-scroll {
        max-height: calc(min(52dvh, 420px) - 108px) !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 侧边栏宽度与收起状态
   ============================================================ */

.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));
}
/* 横屏时显示 */
@media (orientation: landscape) {
    .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;
    }
}

/* ============================================ */
/* === 首页星云图入口按钮 === */
/* ============================================ */
#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);
}

.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;
    }

}

@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;
    }
}

/* Unified course catalog: the physics runtime stays independent, while its
   selection surface follows the platform's math-card information hierarchy. */
#homeRoot {
    --physics-catalog-header-height: 56px;
    --physics-catalog-filter-height: 58px;
    /* Keep the category tabs on the same left baseline as the card grid. */
    --physics-catalog-content-width: min(100% - 64px, 1280px);
    --physics-catalog-content-inset-left: 16px;
    min-height: 100dvh;
    padding-top: calc(var(--physics-catalog-header-height) + var(--physics-catalog-filter-height));
    background: #05080d;
    color: #f8fafc;
}

/* The legacy side destinations obscure the unified selection grid. */
#leftFloatColumn,
#labFloatEntry {
    display: none !important;
}

.physics-catalog-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: 100%;
    height: var(--physics-catalog-header-height);
    min-height: var(--physics-catalog-header-height);
    box-sizing: border-box;
    background: rgba(5, 8, 13, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.physics-catalog-header .text-white {
    color: #f8fafc !important;
}

/* Match the math catalog's 32px subject mark. Physics intentionally renders
   only the subject glyph, without the platform brand wordmark. */
.physics-catalog-subject-mark {
    display: flex;
    width: 32px;
    height: 32px;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(100, 116, 139, 0.6);
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.1);
}

.physics-catalog-subject-mark #siteLogo {
    color: #94a3b8;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, "Inter", sans-serif;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(0.5px);
}

/* Mirror the math catalog's compact top-bar actions. */
.physics-catalog-header #themeToggleBtn {
    display: none;
}

/* Physics account center mirrors the math workbench account overlay while
   retaining the physics account IDs and event bindings. */
.physics-account-shell {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 34px;
    background: rgba(7, 17, 15, 0.96);
    color: #f8fafc;
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.45);
}

.physics-account-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.physics-account-eyebrow {
    color: rgba(203, 213, 225, 0.9);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.34em;
}

.physics-account-title {
    margin: 8px 0 0;
    color: #fff;
    font-size: 30px;
    font-style: italic;
    font-weight: 900;
    line-height: 1;
}

.physics-account-subtitle {
    max-width: 720px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.75;
}

.physics-account-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.physics-account-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.04);
}

.physics-account-content {
    max-height: min(760px, calc(100vh - 148px));
    padding: 20px 28px 28px;
    overflow-y: auto;
}

.physics-account-summary,
.physics-account-section {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.04);
}

.physics-account-summary {
    align-items: center;
}

/* The legacy profile tiers paint light membership gradients. Inside the
   unified dark account shell, tier remains semantic data rather than a card skin. */
.physics-account-shell #profileMemberCard,
.physics-account-shell #profileMemberCard.tier-trial,
.physics-account-shell #profileMemberCard.tier-regular,
.physics-account-shell #profileMemberCard.tier-founding,
.physics-account-shell #profileMemberCard.tier-none {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: none !important;
}

.physics-account-shell #profileMemberCard::before,
.physics-account-shell #profileMemberCard::after {
    display: none !important;
}

.physics-account-shell #profileMemberCard #profileMemberId,
.physics-account-shell #profileMemberCard[data-identity="teacher"] #profileMemberId,
.physics-account-shell #profileMemberCard[data-identity="student"] #profileMemberId {
    color: #f8fafc !important;
}

.physics-account-shell #profileAnnouncementsList {
    scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
}

.physics-account-shell #profileAnnouncementsList .text-slate-400,
.physics-account-shell #profileAnnouncementsList .text-slate-500 {
    color: rgba(255, 255, 255, 0.52) !important;
}

@media (max-width: 640px) {
    .physics-account-shell {
        border-radius: 24px;
    }

    .physics-account-header {
        padding: 16px;
    }

    .physics-account-title {
        font-size: 24px;
    }

    .physics-account-subtitle {
        font-size: 12px;
        line-height: 1.6;
    }

    .physics-account-content {
        max-height: calc(100vh - 122px);
        padding: 16px;
    }

    .physics-account-summary,
    .physics-account-section {
        padding: 16px;
        border-radius: 20px;
    }
}

.physics-catalog-filters {
    position: fixed;
    top: var(--physics-catalog-header-height);
    left: 0;
    z-index: 1000;
    width: 100%;
    height: var(--physics-catalog-filter-height);
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 8, 13, 0.96);
    backdrop-filter: blur(18px);
}

.physics-catalog-filters__inner {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 12px 24px 10px;
}

.physics-catalog-filter-top {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.physics-catalog-filter-top .physics-catalog-filter-row {
    flex: 1 1 auto;
    min-width: 0;
}

.physics-catalog-filter-summary {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    color: rgba(226, 232, 240, 0.46);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    white-space: nowrap;
}

.physics-catalog-filter-summary strong {
    color: #f8fafc;
    font-size: 11px;
    letter-spacing: 0.06em;
}

.physics-catalog-filter-summary strong span {
    color: #7dd3fc;
}

.physics-catalog-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 1px 6px;
    scrollbar-width: none;
}

.physics-catalog-filter-row::-webkit-scrollbar {
    display: none;
}

.physics-catalog-filter-row--secondary {
    padding-bottom: 0;
}

.physics-catalog-chip,
.physics-catalog-category {
    flex: none;
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(226, 232, 240, 0.68);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.physics-catalog-chip {
    padding: 0 14px;
}

.physics-catalog-category {
    min-height: 34px;
    padding: 0 16px;
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
    font-size: 11px;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.physics-catalog-chip:hover,
.physics-catalog-category:hover,
.physics-catalog-chip:focus-visible,
.physics-catalog-category:focus-visible {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.physics-catalog-chip:active,
.physics-catalog-category:active {
    transform: scale(0.97);
}

.physics-catalog-chip.is-active {
    border-color: #7dd3fc;
    background: #7dd3fc;
    color: #06202f;
}

.physics-catalog-category.is-active {
    border-color: #94a3b8;
    background: #94a3b8;
    color: #020617;
}

.physics-catalog-category.is-active:hover,
.physics-catalog-category.is-active:focus-visible {
    border-color: #cbd5e1;
    background: #cbd5e1;
    color: #020617;
}

.physics-catalog-main {
    box-sizing: border-box;
    width: var(--physics-catalog-content-width);
    margin: 0 auto;
    padding: 20px 28px 42px var(--physics-catalog-content-inset-left);
}

.physics-catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.physics-catalog-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 290px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 34px;
    background: #0b111a;
    color: #f8fafc;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.physics-catalog-card:hover,
.physics-catalog-card:focus-visible {
    z-index: 1;
    border-color: rgba(125, 211, 252, 0.72);
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    outline: none;
}

.physics-catalog-card__media,
.physics-catalog-card__content {
    position: absolute;
    inset: 0;
}

.physics-catalog-card__media {
    background: #111827;
}

.physics-catalog-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 420ms ease, filter 220ms ease;
}

.physics-catalog-card:hover .physics-catalog-card__media img,
.physics-catalog-card:focus-visible .physics-catalog-card__media img {
    transform: scale(1.04);
    filter: brightness(1.05);
}

.physics-catalog-card__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 8, 13, 0.18) 0%, rgba(5, 8, 13, 0.4) 45%, rgba(5, 8, 13, 0.96) 100%);
}

.physics-catalog-card__content {
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 32px;
    pointer-events: none;
}

.physics-catalog-card__eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: rgba(224, 242, 254, 0.82);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
}

.physics-catalog-card__eyebrow span:last-child {
    max-width: 46%;
    overflow: hidden;
    color: rgba(226, 232, 240, 0.62);
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.physics-catalog-card__title {
    display: -webkit-box;
    max-height: 2.45em;
    margin: auto 0 0;
    overflow: hidden;
    color: #ffffff;
    font-size: clamp(18px, 1.55vw, 25px);
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.physics-catalog-card__tags {
    display: flex;
    gap: 6px;
    min-height: 24px;
    margin-top: 11px;
    overflow: hidden;
}

.physics-catalog-card__tags span {
    max-width: 100%;
    overflow: hidden;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(5, 8, 13, 0.58);
    color: rgba(226, 232, 240, 0.78);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.physics-catalog-card__tags span:nth-child(n + 3) {
    display: none;
}

.physics-catalog-card__footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    min-height: 26px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.physics-catalog-card__formula {
    max-width: 60%;
    overflow: hidden;
    color: rgba(224, 242, 254, 0.8);
    font-family: 'Playfair Display', 'Noto Serif SC', serif;
    font-size: 11px;
    font-style: italic;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.physics-catalog-card__action {
    flex: none;
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.physics-catalog-card__action i {
    margin-left: 3px;
}

.physics-catalog-card__lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(5, 8, 13, 0.64);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
}

.physics-catalog-card.card-locked {
    cursor: not-allowed;
}

.physics-catalog-card.card-locked:hover,
.physics-catalog-card.card-locked:focus-visible {
    border-color: rgba(255, 255, 255, 0.11);
    box-shadow: none;
    transform: none;
}

.physics-catalog-empty-state {
    grid-column: 1 / -1;
    padding: 52px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: #0b111a;
    color: rgba(226, 232, 240, 0.75);
    text-align: center;
}

@media (max-width: 640px) {
    #homeRoot {
        --physics-catalog-header-height: 48px;
        --physics-catalog-filter-height: 46px;
        --physics-catalog-content-width: min(100% - 40px, 1680px);
        --physics-catalog-content-inset-left: 0;
    }

    .physics-catalog-header {
        height: var(--physics-catalog-header-height);
        min-height: 48px;
    }

    .physics-catalog-filters__inner {
        width: 100%;
        padding: 8px 20px;
    }

    .physics-catalog-filter-top {
        gap: 8px;
    }

    .physics-catalog-filter-summary {
        display: none;
    }

    .physics-catalog-filter-row {
        gap: 6px;
        padding-bottom: 5px;
    }

    .physics-catalog-chip {
        min-height: 28px;
        padding: 0 10px;
        font-size: 9px;
    }

    .physics-catalog-category {
        min-height: 28px;
        padding: 0 10px;
        font-size: 9px;
        letter-spacing: 0;
    }

    .physics-catalog-main {
        padding: 12px 0 28px;
    }

    .physics-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .physics-catalog-card {
        min-height: 126px;
        border-radius: 18px;
    }

    .physics-catalog-card__content {
        padding: 12px;
    }

    .physics-catalog-card__eyebrow {
        gap: 4px;
        font-size: 7px;
    }

    .physics-catalog-card__eyebrow span:last-child {
        max-width: 43%;
    }

    .physics-catalog-card__title {
        max-height: 2.36em;
        margin-top: 6px;
        font-size: 15px;
        line-height: 1.18;
    }

    .physics-catalog-card__tags {
        display: none;
    }

    .physics-catalog-card__tags span {
        padding: 3px 4px;
        font-size: 7px;
    }

    .physics-catalog-card__tags span:nth-child(n + 2) {
        display: none;
    }

    .physics-catalog-card__footer {
        display: none;
    }

    .physics-catalog-card__formula {
        max-width: 54%;
        font-size: 8px;
    }

    .physics-catalog-card__action {
        font-size: 8px;
    }
}

/* Match the math catalog's responsive card-density profiles. */
@media (orientation: portrait) {
    .physics-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .physics-catalog-card {
        min-height: 126px;
        border-radius: 18px;
    }

    .physics-catalog-card__content {
        padding: 12px;
    }

    .physics-catalog-card__title {
        margin-top: 6px;
        font-size: 15px;
        line-height: 1.18;
    }

    .physics-catalog-card__tags,
    .physics-catalog-card__footer {
        display: none;
    }
}

@media (orientation: portrait) and (min-width: 744px) {
    .physics-catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (orientation: landscape) and (max-width: 980px) {
    .physics-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .physics-catalog-card {
        min-height: 136px;
        border-radius: 20px;
    }

    .physics-catalog-card__content {
        padding: 16px;
    }
}

@media (orientation: landscape) and (min-width: 981px) and (max-width: 1296px) {
    /* Keep the usable grid width aligned with the math catalog at this profile. */
    #homeRoot {
        --physics-catalog-content-inset-left: 0;
    }

    .physics-catalog-main {
        padding-right: 10px;
        padding-left: 0;
    }

    .physics-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .physics-catalog-card {
        min-height: 230px;
        border-radius: 26px;
    }

    .physics-catalog-card__content {
        padding: 24px;
    }
}

@media (orientation: landscape) and (min-width: 1476px) {
    .physics-catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (orientation: landscape) and (min-width: 1556px) and (min-height: 860px) {
    #homeRoot {
        --physics-catalog-content-width: min(100% - 72px, 1660px);
        --physics-catalog-content-inset-left: 18px;
    }

    .physics-catalog-main {
        padding-right: 30px;
    }

    .physics-catalog-grid {
        gap: 22px;
    }

    .physics-catalog-card {
        min-height: 330px;
        border-radius: 40px;
    }

    .physics-catalog-card__content {
        padding: 40px;
    }
}

@media (orientation: landscape) and (min-width: 1440px) and (min-aspect-ratio: 205 / 100) {
    #homeRoot {
        --physics-catalog-content-width: min(100% - 88px, 1840px);
        --physics-catalog-content-inset-left: 20px;
    }

    .physics-catalog-main {
        padding-right: 32px;
    }

    .physics-catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }

    .physics-catalog-card {
        min-height: 330px;
        border-radius: 40px;
    }

    .physics-catalog-card__content {
        padding: 40px;
    }
}

.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;
    }
}
