:root {
    --accent-color: #4981ef;
    --accent-rgb: 73, 129, 239;
    --accent-strong: #2f5fc8;
    --glass-bg: rgb(238 238 238);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #4f4f4f;
    --text-secondary: #4f4f4f;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    background: #F8F8F8;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    margin: 0;
    overflow: hidden;
    color: var(--text-primary);
}

body > canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
}

body:not(.search-started) > canvas {
    cursor: default;
}

body.search-started > canvas {
    cursor: grab;
}

body.search-started > canvas.model-dragging {
    cursor: grabbing;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-notice-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: min(700px, calc(100dvh - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: var(--text-primary);
    background: #fff;
    box-shadow: 0 18px 58px rgba(0, 0, 0, 0.35);
}

.site-notice-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.site-notice-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 18px;
}

.site-notice-content {
    max-height: min(600px, calc(100dvh - 108px));
    padding: 4px 18px 20px;
    overflow-y: auto;
    line-height: 1.65;
}

.privacy-preference {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    cursor: pointer;
}

.privacy-preference input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.site-notice-content h2 {
    margin: 18px 0 6px;
    color: var(--text-primary);
    font-size: 16px;
}

.site-notice-content p {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

button:focus-visible,
input:focus-visible,
[role="option"]:focus-visible {
    outline: 3px solid rgba(var(--accent-rgb), 0.42);
    outline-offset: 2px;
}

/* 品牌首屏：搜索前提供清晰的产品身份，搜索后收拢为工作区标识。 */
.brand-hero {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
}

.brand-lockup {
    position: fixed;
    top: clamp(72px, 13vh, 120px);
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 18px;
    color: #2f3033;
    text-decoration: none;
    transform: translateX(-50%);
    transform-origin: left top;
    pointer-events: auto;
    transition:
        top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        gap 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo {
    display: block;
    width: clamp(82px, 7.2vw, 90px);
    height: clamp(82px, 7.2vw, 90px);
    object-fit: contain;
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-name {
    color: #253858;
    font-size: clamp(42px, 4vw, 58px);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1;
    white-space: nowrap;
    transition: font-size 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-description {
    position: fixed;
    left: 50%;
    width: min(90vw, 760px);
    margin: 0;
    text-align: center;
    transform: translateX(-50%);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.32s ease;
}

.brand-description {
    top: clamp(350px, 45vh, 410px);
    color: rgba(47, 48, 51, 0.48);
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 400;
    line-height: 1.6;
}

body.search-started .brand-lockup {
    top: 18px;
    left: 24px;
    gap: 9px;
    transform: none;
}

body.search-started .brand-logo {
    width: 40px;
    height: 40px;
}

body.search-started .brand-name {
    font-size: 24px;
    letter-spacing: -0.035em;
}

body.search-started .brand-description {
    visibility: hidden;
    opacity: 0;
    transform: translate(-50%, -10px);
}

/* 搜索栏布局调整 - 采用稳健的 margin 居中，避免 transform 导致的半像素偏移 */
.search-container {
    position: absolute;
    top: clamp(238px, 31vh, 290px);
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 1000;
    width: 90%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    transition: top 0.32s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

body.search-started .search-container {
    top: 20px;
    max-width: 600px;
}

@media (min-width: 769px) {
    body:not(.search-started) .search-container {
        width: 72%;
        max-width: 608px;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    body.search-started .brand-name {
        display: none;
    }
}

/* 搜索输入框一体化包装器 - 弃用 border 改用 shadow 确保像素对齐 */
.search-input-wrapper {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    background: var(--glass-bg);
    /* 使用 spread radius 模拟 1px 边框，解决物理对齐偏差 */
    box-shadow: 0 0 0 1px var(--glass-border);
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-sizing: border-box;
}

/* 激活状态：向上生长感，底边圆角消失 */
.search-container.suggestions-active .search-input-wrapper {
    border-radius: 24px 24px 0 0;
    background: rgb(238 238 238);
    /* 激活时，底部不显示模拟边条，由建议列表接管 */
    box-shadow:
        -1px 0 0 var(--glass-border),
        1px 0 0 var(--glass-border),
        0 -1px 0 var(--glass-border),
        0 10px 30px rgba(0, 0, 0, 0.6);
}

.search-input-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    padding: 14px 24px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    box-shadow: none !important;
}

/* 联想词面板样式 - 极致对齐方案 (Shadow-Border 渲染) */
#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgb(238 238 238);
    border: none;
    /* 移除 border 以防浏览器渲染偏移 */
    border-radius: 0 0 24px 24px;
    backdrop-filter: blur(20px);
    max-height: 380px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    /* 使用多重阴影模拟外部边框，实现物理对齐 */
    box-shadow:
        -1px 0 0 var(--glass-border),
        /* 左侧模拟线 */
        1px 0 0 var(--glass-border),
        /* 右侧模拟线 */
        0 1px 0 var(--glass-border),
        /* 底部模拟线 */
        0 15px 30px rgba(0, 0, 0, 0.5);
    /* 整体投影 */
    box-sizing: border-box;
    background-clip: padding-box;
    transform: translateZ(0);
    /* 强制开启硬件加速，提高边框渲染精度 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 隐藏滚动条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#search-suggestions::-webkit-scrollbar {
    display: none;
}

/* 建议列表内部的分割线 */
#search-suggestions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* 联想项基础样式 - 紧凑单行版 */
.suggestion-item {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.quick-examples {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.quick-examples[hidden],
.suggestions-active .quick-examples {
    display: none;
}

.quick-examples-label {
    flex: 0 0 auto;
    opacity: 0.7;
}

.quick-examples-list {
    display: flex;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.quick-examples-list::-webkit-scrollbar {
    display: none;
}

.quick-example-btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: 999px;
    background: rgba(238, 238, 238, 0.78);
    color: var(--text-secondary);
    font: inherit;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.quick-example-btn:hover,
.quick-example-btn:focus-visible {
    border-color: rgba(var(--accent-rgb), 0.48);
    background: rgb(238 238 238);
    color: var(--accent-color);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 28px;
    /* 轻微位移反馈 */
}

.suggestion-item.active {
    background: rgba(59, 59, 59, 0.12);
    box-shadow: inset 4px 0 0 var(--accent-color);
}

.suggestion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.suggestion-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-display-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-color);
}

/* 中文名后的英文名括号提示 */
.suggestion-en-name {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-left: 2px;
}

.suggestion-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.suggestion-formula {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.suggestion-formula sub {
    font-size: 0.68em;
    line-height: 0;
}

.suggestion-action {
    color: var(--accent-color);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
    opacity: 0.62;
    transition: opacity 0.3s ease;
}

.suggestion-item:hover .suggestion-action,
.suggestion-item.active .suggestion-action {
    opacity: 1;
}

.entry-type-badge,
.entry-status-badge,
.entry-type-summary {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
}

.entry-type-badge {
    padding: 2px 8px;
    color: var(--text-secondary);
    background: rgba(var(--accent-rgb), 0.09);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
}

.entry-status-badge {
    padding: 2px 8px;
    color: #875d13;
    background: rgba(219, 155, 43, 0.11);
    border: 1px solid rgba(181, 121, 20, 0.2);
}

.suggestion-note {
    margin-top: 6px;
    color: #6b5a3a;
    font-size: 11px;
    line-height: 1.45;
}

.entry-type-summary {
    margin: 8px auto 2px;
    padding: 3px 10px;
    color: var(--text-secondary);
    background: rgba(var(--accent-rgb), 0.09);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
}

.entry-type-summary.non-renderable {
    color: #76500e;
    background: rgba(219, 155, 43, 0.1);
    border-color: rgba(181, 121, 20, 0.2);
}

.match-feedback {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    z-index: 999;
    max-width: min(90vw, 600px);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgb(238 238 238);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.match-feedback.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 状态与加载提示 */
.suggestion-status {
    padding: 20px;
    text-align: center;
    color: var(--accent-color);
    font-size: 14px;
    opacity: 0.7;
}

.correction-summary {
    padding: 18px 20px 6px;
    text-align: left;
    color: var(--text-secondary);
    font-size: 14px;
}

.correction-intro {
    padding: 4px 20px 8px;
    color: var(--accent-color);
    font-size: 15px;
    font-weight: 600;
}

.formula-correction-item {
    padding-top: 12px;
    padding-bottom: 12px;
}

@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

.loading-pulse {
    animation: pulse 1.5s infinite;
}

/* 悬停与聚焦状态：触发高亮阴影 */
.search-input-wrapper:hover,
.search-input-wrapper:focus-within {
    box-shadow: 0 0 0 1px var(--accent-color), 0 0 18px rgba(var(--accent-rgb), 0.09);
    background: rgb(238 238 238);
}

/* 当联想框激活时，强制同步高亮阴影边框 */
.suggestions-active .search-input-wrapper {
    box-shadow:
        -1px 0 0 var(--accent-color),
        1px 0 0 var(--accent-color),
        0 -1px 0 var(--accent-color),
        0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.suggestions-active #search-suggestions {
    box-shadow:
        -1px 0 0 var(--accent-color),
        1px 0 0 var(--accent-color),
        0 1px 0 var(--accent-color),
        0 15px 30px rgba(0, 0, 0, 0.5) !important;
}

/* 搜索按钮 - 内嵌于搜索框右侧 (Google 风格) */
.search-container button#search-btn {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 18px;
    padding: 0 16px;
    margin: 6px;
    height: 36px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex: 0 0 auto;
}

.search-container button#search-btn:hover {
    background: var(--accent-color);
    color: #1a1a2e;
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.18);
    transform: scale(1.05);
}

.search-container button#search-btn:active {
    transform: scale(0.95);
}

/* 结果信息卡片 */
#molecule-info {
    position: absolute;
    top: 100px;
    left: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    max-width: 320px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 100;
    font-family: inherit;
}

#molecule-info.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.molecule-info-heading {
    min-width: 0;
}

.molecule-name-stack {
    min-width: 0;
}

.molecule-info-toggle {
    display: none;
}

.molecule-title {
    font-size: clamp(24px, 2.5vw, 30px);
    font-weight: 650;
    line-height: 1.15;
    color: var(--accent-color);
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.molecule-english-name {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 450;
    line-height: 1.35;
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
}

.molecule-english-name[hidden] {
    display: none;
}

.molecule-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 14px;
}

.molecule-meta-line .entry-type-summary {
    margin: 0;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 600;
}

.molecule-formula {
    font-family: inherit;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.molecule-formula sub {
    font-size: 0.68em;
    line-height: 0;
}

.molecule-description {
    margin: 0 0 14px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.molecule-description[hidden] {
    display: none;
}

.material-form-panel {
    margin: 16px -4px 14px;
    padding: 14px;
    border: 1px solid rgba(73, 129, 239, 0.25);
    border-radius: 14px;
    background: rgba(73, 129, 239, 0.06);
}

.material-form-heading {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.material-form-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.material-form-tab {
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid rgba(79, 79, 79, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.54);
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.material-form-tab span,
.material-form-tab small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-form-tab span {
    font-size: 12px;
    font-weight: 700;
}

.material-form-tab small {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 10px;
}

.material-form-tab:hover:not(:disabled),
.material-form-tab.active {
    border-color: var(--accent-color);
    background: rgba(73, 129, 239, 0.16);
    color: var(--accent-strong);
}


.legend {
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 10px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(79, 79, 79, 0.08);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.legend-color {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    overflow: visible;
}

.download-container {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 4px;
    background: rgb(238 238 238);
    border: 1px solid transparent;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.download-container[hidden] {
    display: none !important;
}

.download-container.download-expanded {
    border-color: rgba(var(--accent-rgb), 0.16);
}

.download-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: #4f4f4f;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.download-trigger:hover,
.download-trigger:focus-visible,
.download-trigger[aria-expanded="true"] {
    background: rgba(var(--accent-rgb), 0.1);
}

.download-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 0;
    margin-right: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition: max-width 0.28s ease, opacity 0.18s ease, margin-right 0.28s ease;
}

.download-actions-group.is-expanded {
    max-width: 260px;
    margin-right: 2px;
    opacity: 1;
    pointer-events: auto;
}

.download-action {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 30px;
    padding: 2px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.download-action:hover,
.download-action:focus-visible {
    background: rgba(var(--accent-rgb), 0.09);
    color: var(--accent-color);
}


/* 全局居中加载动画 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin-simple 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    /* 增加科技感光晕 */
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.09);
}

.loading-text {
    color: var(--accent-color);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.24);
    font-weight: 500;
}

@keyframes spin-simple {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


@keyframes center-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* AI 助手按钮与面板 */
.ai-assistant {
    position: absolute;
    right: 30px;
    top: 100px;
    z-index: 1001;
}

#ai-trigger {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-strong) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.18);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ai-trigger:hover {
    transform: scale(1.1) rotate(15deg);
}

#ai-trigger svg {
    color: white;
    width: 28px;
    height: 28px;
}

#ai-panel {
    position: absolute;
    right: 0;
    top: 60px;
    width: 300px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: scale(0.9) translateX(20px);
    transform-origin: top right;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    color: var(--text-primary);
}

#ai-panel.visible {
    opacity: 1;
    transform: scale(1) translateX(0);
    pointer-events: all;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
    font-size: 16px;
}

.ai-content {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
    max-height: 300px;
    overflow-y: auto;
}

.ai-loading-dots {
    display: inline-block;
}

.ai-loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* 隐藏滚动条 */
.ai-content::-webkit-scrollbar {
    width: 4px;
}

.ai-content::-webkit-scrollbar-track {
    background: transparent;
}

.ai-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* 旋转控制按钮 - 放在右上角，替代原来的 AI 助手位置 */
.rotation-btn {
    position: absolute;
    right: 30px;
    top: 100px;
    background: rgb(238 238 238);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #4f4f4f;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 1001;
    font-size: 14px;
    outline: none;
}

.rotation-btn[hidden] {
    display: none;
}

.rotation-btn:hover {
    background: rgb(238 238 238);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.14);
}

.rotation-btn.active {
    background: rgb(238 238 238);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.1);
    color: var(--accent-color);
}

.rotation-btn svg {
    transition: transform 0.5s ease;
}

.rotation-btn:hover svg {
    transform: rotate(180deg);
}

.rotation-btn:active {
    transform: scale(0.95);
}

/* 紧凑来源栏：常态仅占一行，详细科学字段向上展开。 */
.scientific-disclosure {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    max-width: min(680px, calc(100vw - 260px));
}

.scientific-sheet-heading,
.scientific-sheet-back,
.scientific-sheet-close {
    display: none;
}

.scientific-summary-row {
    display: flex;
    align-items: center;
    min-height: 30px;
    background: rgb(238 238 238);
    padding: 4px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.scientific-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #4f4f4f;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.scientific-menu-trigger:hover,
.scientific-menu-trigger:focus-visible,
.scientific-menu-trigger[aria-expanded="true"] {
    background: rgba(var(--accent-rgb), 0.1);
}

.scientific-menu-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.scientific-menu-trigger svg {
    transition: transform 0.25s ease;
}

.scientific-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition: max-width 0.28s ease, opacity 0.18s ease, margin-left 0.28s ease;
}

.scientific-actions-group.is-expanded {
    max-width: min(620px, calc(100vw - 320px));
    margin-left: 2px;
    opacity: 1;
    pointer-events: auto;
}

/* Keep the compact desktop expansion visually aligned with the mobile drawer. */
.scientific-disclosure.expanded .scientific-summary-row {
    background: rgb(238 238 238);
    border: 1px solid rgba(var(--accent-rgb), 0.16);
}

.data-source {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 280px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.data-source[href]:hover,
.data-source[href]:focus-visible {
    color: var(--accent-color);
    text-decoration: underline;
}

.result-variant-labels {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
}

.variant-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 650;
    color: var(--text-secondary);
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    background: rgba(var(--accent-rgb), 0.07);
    white-space: nowrap;
}

.scientific-action {
    flex: 0 0 auto;
    min-height: 24px;
    padding: 2px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
}

.scientific-action:hover,
.scientific-action:focus-visible,
.scientific-action[aria-expanded="true"] {
    color: var(--accent-color);
    background: rgba(var(--accent-rgb), 0.09);
}

.scientific-details {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    width: min(420px, calc(100vw - 48px));
    padding: 10px 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 10px;
    background: rgba(245, 245, 245, 0.97);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
}

.scientific-details dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 10px;
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
}

.scientific-details dt {
    opacity: 0.68;
}

.scientific-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.computed-property-note {
    margin: 8px 0 0;
    padding-top: 7px;
    border-top: 1px solid rgba(var(--accent-rgb), 0.12);
    font-size: 10px;
    line-height: 1.45;
    color: #76500e;
}

.feedback-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: 14px;
    background: #f6f6f6;
    color: var(--text-secondary);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.feedback-dialog::backdrop {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.feedback-dialog form,
.scientific-secondary-feedback-form {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.feedback-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.feedback-intro {
    margin: -2px 0 2px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-tertiary, #666);
}

.feedback-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
}

.feedback-dialog label,
.scientific-secondary-feedback-form label,
.feedback-status {
    font-size: 12px;
}

.feedback-dialog textarea,
.scientific-secondary-feedback-form textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: 8px;
    background: white;
    color: inherit;
    font: inherit;
}

.feedback-current-molecule {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.feedback-current-molecule-label {
    font-size: 12px;
    color: var(--text-tertiary, #666);
}

.feedback-current-molecule-name {
    color: var(--accent-color);
    font-size: 15px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.feedback-dialog textarea {
    resize: vertical;
}

.feedback-submit {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: var(--accent-color);
    color: white;
    font-weight: 650;
    cursor: pointer;
}

.feedback-submit:disabled {
    opacity: 0.55;
    cursor: wait;
}

.feedback-submit.is-success,
.feedback-submit.is-success:disabled {
    background: #2f9d61;
    opacity: 1;
    cursor: default;
}

/* 晶体控制按钮样式 */
.crystal-controls {
    position: absolute;
    right: 30px;
    top: 160px;
    /* 放在旋转按钮下方 */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    display: none;
    /* 默认隐藏，仅在晶体模式下显示 */
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.crystal-controls.visible {
    display: flex;
}

.control-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}

.crystal-controls-toggle {
    display: none;
}

.crystal-controls-content {
    display: contents;
}

.control-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(79, 79, 79, 0.18);
    color: #4f4f4f;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: #1a1a2e;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.14);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cell-face-intensity {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 156px;
    color: var(--text-secondary);
    font-size: 11px;
}

.cell-face-intensity span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cell-face-intensity output {
    color: var(--accent-color);
    font-variant-numeric: tabular-nums;
}

.cell-face-intensity input {
    width: 100%;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.mp-metadata .meta-item.teaching-cell {
    background: rgba(83, 127, 255, 0.11);
    border-color: rgba(83, 127, 255, 0.24);
    color: #8facff;
}

/* 平板和手机：保留全屏 3D 舞台，并把交互控件限制在安全区内。 */
@media (max-width: 768px) {
    body {
        min-height: 100svh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .brand-lockup {
        top: clamp(54px, 9vh, 76px);
        gap: 12px;
    }

    .brand-logo {
        width: 76px;
        height: 76px;
    }

    .brand-name {
        font-size: clamp(32px, 9vw, 42px);
    }

    .brand-description {
        top: calc(clamp(170px, 23vh, 210px) + 124px);
        padding-inline: 24px;
        color: rgba(47, 48, 51, 0.42);
        font-size: 13px;
    }

    .search-container {
        position: fixed;
        top: clamp(170px, 23vh, 210px);
        width: calc(100% - 24px);
        max-width: none;
    }

    body.search-started .brand-lockup {
        top: max(8px, env(safe-area-inset-top));
        left: 50%;
        gap: 7px;
        transform: translateX(-50%);
    }

    body.search-started .brand-logo {
        width: 34px;
        height: 34px;
    }

    body.search-started .brand-name {
        display: inline;
        font-size: 21px;
    }

    body.search-started .search-container {
        top: calc(max(12px, env(safe-area-inset-top)) + 48px);
        max-width: none;
    }

    .search-input-wrapper input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .search-container button#search-btn {
        min-height: 44px;
        padding-inline: 13px;
        margin: 4px;
    }

    .quick-example-btn {
        min-height: 36px;
        padding-inline: 12px;
    }

    #search-suggestions {
        max-height: min(380px, calc(100dvh - 84px - env(safe-area-inset-bottom)));
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .suggestion-item {
        min-height: 44px;
    }

    .suggestion-item {
        padding: 11px 16px;
    }

    .suggestion-item:hover,
    .suggestion-item.active {
        padding-left: 20px;
    }

    .suggestion-header {
        gap: 8px;
    }

    .suggestion-name {
        min-width: 0;
        overflow-wrap: normal;
    }

    .match-feedback {
        position: fixed;
        top: calc(max(12px, env(safe-area-inset-top)) + 112px);
        max-width: calc(100vw - 24px);
        text-align: center;
    }

    .rotation-btn {
        position: fixed;
        top: calc(max(12px, env(safe-area-inset-top)) + 116px);
        right: 12px;
        min-height: 44px;
        padding: 10px 14px;
    }

    .crystal-controls {
        position: fixed;
        top: calc(max(12px, env(safe-area-inset-top)) + 172px);
        right: 12px;
        max-width: calc(100vw - 24px);
        padding: 10px;
        gap: 8px;
        border-radius: 16px;
    }

    .control-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .crystal-controls-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        margin: -4px -4px -4px 0;
        padding: 0;
        border: 0;
        border-radius: 9px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-color);
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .crystal-controls-toggle:hover,
    .crystal-controls-toggle:focus-visible {
        background: rgba(var(--accent-rgb), 0.2);
        color: var(--accent-strong);
    }

    .crystal-controls-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 0.2s ease;
    }

    .crystal-controls.mobile-crystal-controls-expanded .crystal-controls-toggle svg {
        transform: rotate(180deg);
    }

    .crystal-controls:not(.mobile-crystal-controls-expanded) .crystal-controls-content {
        display: none;
    }

    .control-btn {
        width: 44px;
        height: 44px;
    }

    .cell-face-intensity input {
        min-height: 44px;
    }

    #molecule-info {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
        max-height: min(38dvh, 320px);
        padding: 16px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .molecule-info-heading {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .molecule-name-stack {
        flex: 1 1 auto;
    }

    .molecule-info-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        margin: -3px -3px 0 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-color);
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .molecule-info-toggle:hover,
    .molecule-info-toggle:focus-visible {
        background: rgba(var(--accent-rgb), 0.2);
        color: var(--accent-strong);
    }

    .molecule-info-toggle svg {
        width: 20px;
        height: 20px;
        transform: rotate(180deg);
        transition: transform 0.2s ease;
    }

    #molecule-info.mobile-info-expanded .molecule-info-toggle svg {
        transform: rotate(0deg);
    }

    #molecule-info:not(.mobile-info-expanded) .molecule-info-details {
        display: none;
    }

    .molecule-title {
        font-size: 24px;
    }

    .molecule-english-name {
        font-size: 15px;
    }

    .molecule-meta-line {
        gap: 8px;
        margin-bottom: 12px;
    }

    .molecule-formula {
        font-size: 20px;
    }

    .download-container {
        position: fixed;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        min-height: 48px;
    }

    .download-trigger,
    .download-action {
        min-height: 46px;
    }

    .download-trigger {
        padding: 10px 14px;
    }

    .download-actions-group.is-expanded {
        max-width: calc(100vw - 118px);
    }

    .scientific-disclosure {
        position: fixed;
        left: 12px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 220px);
    }

    .scientific-disclosure.expanded {
        bottom: calc(72px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 24px);
    }

    .scientific-summary-row {
        overflow: hidden;
    }

    .result-variant-labels {
        display: none;
    }

    .scientific-action {
        padding-inline: 6px;
    }

    .scientific-actions-group.is-expanded {
        max-width: calc(100vw - 68px);
    }

    .data-source {
        max-width: min(42vw, 180px);
    }

    .scientific-details {
        width: min(360px, calc(100vw - 24px));
    }
}

/* 矮屏/横屏：信息卡靠左、控制区靠右，避免争抢垂直空间。 */
@media (max-width: 932px) and (max-height: 600px) {
    .brand-lockup {
        top: 16px;
        gap: 9px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }

    .brand-name {
        font-size: 27px;
    }

    .brand-description {
        display: none;
    }

    .search-container {
        top: 78px;
        width: calc(100% - 16px);
        max-width: 600px;
    }

    body.search-started .brand-lockup {
        visibility: hidden;
        opacity: 0;
    }

    body.search-started .search-container {
        top: max(8px, env(safe-area-inset-top));
        max-width: 600px;
    }

    .rotation-btn {
        top: calc(max(8px, env(safe-area-inset-top)) + 60px);
        right: 8px;
    }

    .crystal-controls {
        top: calc(max(8px, env(safe-area-inset-top)) + 112px);
        right: 8px;
    }

    .control-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .crystal-controls-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        margin: -4px -4px -4px 0;
        padding: 0;
        border: 0;
        border-radius: 9px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-color);
        cursor: pointer;
    }

    .crystal-controls-toggle svg {
        width: 18px;
        height: 18px;
        transition: transform 0.2s ease;
    }

    .crystal-controls.mobile-crystal-controls-expanded .crystal-controls-toggle svg {
        transform: rotate(180deg);
    }

    .crystal-controls:not(.mobile-crystal-controls-expanded) .crystal-controls-content {
        display: none;
    }

    #molecule-info {
        top: calc(max(8px, env(safe-area-inset-top)) + 60px);
        bottom: calc(64px + env(safe-area-inset-bottom));
        left: 8px;
        right: auto;
        width: min(42vw, 320px);
        max-height: none;
    }

    .molecule-info-heading {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .molecule-name-stack {
        flex: 1 1 auto;
    }

    .molecule-info-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        margin: -3px -3px 0 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-color);
        cursor: pointer;
    }

    .molecule-info-toggle svg {
        width: 20px;
        height: 20px;
        transform: rotate(180deg);
        transition: transform 0.2s ease;
    }

    #molecule-info.mobile-info-expanded .molecule-info-toggle svg {
        transform: rotate(0deg);
    }

    #molecule-info:not(.mobile-info-expanded) .molecule-info-details {
        display: none;
    }

    .download-container {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Mobile data-source drawer: keep the trigger compact and avoid competing with downloads. */
@media (max-width: 768px), (max-width: 932px) and (max-height: 600px) {
    .scientific-disclosure.expanded {
        right: 12px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        left: 12px;
        max-width: none;
        max-height: min(72dvh, 620px);
        padding: 14px;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid rgba(var(--accent-rgb), 0.16);
        border-radius: 22px;
        background: rgb(238 238 238);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
        -webkit-overflow-scrolling: touch;
    }

    .scientific-disclosure.expanded .scientific-sheet-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
        color: var(--text-primary);
        font-size: 15px;
        font-weight: 650;
    }

    .scientific-disclosure.expanded.details-view .scientific-sheet-heading {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) 36px;
    }

    .scientific-disclosure.expanded.details-view #scientific-sheet-title {
        text-align: center;
    }

    .scientific-disclosure.expanded .scientific-sheet-close,
    .scientific-disclosure.expanded.details-view .scientific-sheet-back {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        margin: -4px -4px -4px 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-color);
        cursor: pointer;
    }

    .scientific-sheet-close svg {
        width: 18px;
        height: 18px;
    }

    .scientific-sheet-back svg {
        width: 20px;
        height: 20px;
    }

    .scientific-disclosure.expanded .scientific-summary-row {
        display: block;
        min-height: 36px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .scientific-disclosure.expanded .scientific-menu-trigger {
        display: none;
    }

    .scientific-disclosure.expanded.details-view .scientific-summary-row {
        display: none;
    }

    .scientific-disclosure.expanded .scientific-actions-group.is-expanded {
        display: grid;
        width: 100%;
        max-width: none;
        margin: 8px 0 0;
        gap: 6px;
        overflow: visible;
        opacity: 1;
        white-space: normal;
    }

    .scientific-disclosure.expanded .data-source,
    .scientific-disclosure.expanded .scientific-action {
        display: flex;
        align-items: center;
        width: 100%;
        max-width: none;
        min-height: 42px;
        padding: 10px 12px;
        border: 1px solid rgba(79, 79, 79, 0.13);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.42);
        color: var(--text-secondary);
        font: inherit;
        font-size: 13px;
        line-height: 1.35;
        text-align: left;
        white-space: normal;
    }

    .scientific-disclosure.expanded .data-source {
        text-overflow: clip;
    }

    .scientific-disclosure.expanded .result-variant-labels {
        flex-wrap: wrap;
        padding: 3px 0;
    }

    .scientific-disclosure.expanded .scientific-details {
        position: static;
        width: auto;
        margin-top: 10px;
        padding: 10px 12px;
    }

    .scientific-disclosure.expanded.details-view .scientific-details {
        margin-top: 0;
    }

    .scientific-disclosure.expanded.details-view .scientific-secondary-view:not([hidden]) {
        display: block;
    }

    .scientific-secondary-feedback-form {
        gap: 10px;
        padding: 0;
    }

    .scientific-secondary-view .site-notice-content {
        max-height: none;
        padding: 0;
        overflow: visible;
    }

    .scientific-disclosure.expanded ~ .download-container {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
