/* layout.css - 布局样式 */

/* =============================================
   侧边栏布局（对齐设计稿 sidebar-v5）
   ============================================= */
:root { --sidebar-width: 264px; }
body.sidebar-collapsed { --sidebar-width: 72px; }

/* 侧边栏 */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--study-card);
    border-right: 1px solid var(--study-border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 12px 16px;
    transition: justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar-logo {
    width: 28px;
    height: 28px;
    color: var(--study-primary);
    flex-shrink: 0;
}

.app-sidebar-title {
    font-family: var(--study-font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--study-foreground);
    letter-spacing: -0.01em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.25s ease 0.05s, max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar-divider {
    height: 1px;
    background: var(--study-border);
    margin: 0 20px;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 12px;
}

/* 导航标签 */
.sidebar-nav-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--study-font-sans);
    color: var(--study-muted-foreground);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease, padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), gap 0.3s cubic-bezier(0.4, 0, 0.2, 1), justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav-tab:hover { background: var(--study-muted); color: var(--study-foreground); }
.sidebar-nav-tab:focus-visible { outline: 2px solid var(--study-ring); outline-offset: 2px; }

.sidebar-nav-tab.active {
    background: var(--study-primary);
    color: var(--study-primary-foreground);
}

.sidebar-nav-tab .sidebar-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
}

.sidebar-nav-tab .sidebar-nav-label {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.25s ease 0.05s, max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 记忆模式特殊样式 —— 与设计稿一致 */
.sidebar-nav-tab.memory-special {
    background: linear-gradient(135deg, #EEF1F5, #F8F9FB);
    border: 1px solid var(--study-primary);
    border-radius: 6px;
}
.sidebar-nav-tab.memory-special:hover { background: var(--study-accent); border-color: var(--study-accent); color: var(--study-accent-foreground); }
.sidebar-nav-tab.memory-special.active { background: var(--study-primary); color: var(--study-primary-foreground); }

/* 侧边栏底部 */
.app-sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--study-border);
    flex-shrink: 0;
}

.sidebar-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    margin-top: 12px;
}

.api-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--study-muted-foreground);
    font-size: 12px;
}
.api-status-badge .status-dot { margin: 0; transition: opacity 0.25s ease 0.05s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.api-status-badge .status-dot,
.api-status-badge span#apiStatusText {
    transition: opacity 0.25s ease 0.05s, max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), line-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* 折叠交互 */
.sidebar-nav-tab .sidebar-nav-label,
.app-sidebar-title {
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.25s ease 0.05s, max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .app-sidebar-header { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
body.sidebar-collapsed .sidebar-nav-tab { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
body.sidebar-collapsed .sidebar-nav-tab .sidebar-nav-icon { width: 20px; height: 20px; }
body.sidebar-collapsed .sidebar-nav-tab .sidebar-nav-label,
body.sidebar-collapsed .app-sidebar-title {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* =============================================
   设置滑动面板（对齐设计稿）
   ============================================= */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32, 32, 32, 0.3);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.settings-overlay.open { opacity: 1; pointer-events: auto; }

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--study-card);
    z-index: 60;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--study-shadow-lg);
    display: flex;
    flex-direction: column;
}
.settings-panel.open { transform: translateX(0); }

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--study-border);
    flex-shrink: 0;
}
.settings-panel-header .app-sidebar-title {
    font-family: var(--study-font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--study-foreground);
    letter-spacing: -0.01em;
}
.settings-panel .settings-close-btn {
    background: var(--study-muted);
    color: var(--study-muted-foreground);
}
.settings-panel .settings-close-btn:hover {
    background: var(--study-border);
    color: var(--study-foreground);
}

.settings-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.settings-panel-body::-webkit-scrollbar { display: none; }

.settings-panel-body .modal-content {
    display: block;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
}
.settings-panel-body .modal-content h3 {
    font-family: var(--study-font-sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--study-muted-foreground);
    margin: 0 0 12px;
}
.settings-panel-body .modal-content > * + h3 { margin-top: 24px; }
.settings-panel-body .modal-content label {
    display: block;
    font-size: 13px;
    color: var(--study-muted-foreground);
    margin-bottom: 6px;
}
.settings-panel-body .modal-content input[type="text"],
.settings-panel-body .modal-content input[type="password"] {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid var(--study-border);
    border-radius: var(--study-radius-md);
    background: var(--study-background);
    color: var(--study-foreground);
    margin-bottom: 12px;
    box-sizing: border-box;
}
.settings-panel-body .modal-content input:focus {
    outline: 2px solid var(--study-ring);
    outline-offset: -1px;
    border-color: transparent;
}
.settings-panel-body .modal-content .button-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.settings-panel-body .modal-content button {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--study-border);
    border-radius: var(--study-radius-md);
    background: var(--study-primary);
    color: var(--study-primary-foreground);
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.settings-panel-body .modal-content button:hover { background: var(--study-accent); }
.settings-panel-body .modal-content button.secondary {
    background: var(--study-muted);
    color: var(--study-foreground);
    border-color: var(--study-border);
}
.settings-panel-body .modal-content button.secondary:hover { background: var(--study-border); }

/* =============================================
   侧边栏折叠按钮
   ============================================= */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--study-font-sans);
    color: var(--study-muted-foreground);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s ease, color 0.15s ease, justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1), gap 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-collapse-btn:hover { background: var(--study-muted); color: var(--study-foreground); }
.sidebar-collapse-btn .sidebar-collapse-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.sidebar-collapse-icon-right { display: none; }
.sidebar-collapse-label {
    white-space: nowrap;
    overflow: hidden;
    text-align: left;
    transition: opacity 0.25s ease 0.05s, max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.sidebar-collapsed .sidebar-collapse-icon-left { display: none; }
body.sidebar-collapsed .sidebar-collapse-icon-right { display: inline-block; }
body.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
body.sidebar-collapsed .sidebar-collapse-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
}
body.sidebar-collapsed .api-status-badge {
    gap: 0;
}
body.sidebar-collapsed .api-status-badge .status-dot {
    opacity: 0;
    transform: scale(0);
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}
body.sidebar-collapsed .api-status-badge span#apiStatusText {
    opacity: 0;
    max-width: 0;
    line-height: 0;
    font-size: 0;
    height: 0;
    padding: 0;
    margin: 0;
}
/* 折叠时底部排列居中，避免 dot 与齿轮在窄侧栏内挤在一起/错位 */
body.sidebar-collapsed .sidebar-status-row {
    justify-content: center;
    gap: 10px;
    padding: 0;
}
/* 折叠时：状态点隐藏，绿光转移到设置按钮（带过渡动画） */
body.sidebar-collapsed button.settings-btn {
    border-radius: 50%;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent),
                0 0 12px 2px color-mix(in srgb, var(--success) 55%, transparent);
    animation: settings-btn-glow-pulse 2.4s ease-in-out infinite;
}
body.sidebar-collapsed[data-api-status="error"] button.settings-btn {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent),
                0 0 12px 2px color-mix(in srgb, var(--danger) 55%, transparent);
    animation: none;
}
@keyframes settings-btn-glow-pulse {
    0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent),
                            0 0 10px 1px color-mix(in srgb, var(--success) 45%, transparent); }
    50%      { box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 45%, transparent),
                            0 0 16px 4px color-mix(in srgb, var(--success) 65%, transparent); }
}
/* 记忆模式二级界面：隐藏侧边栏，主内容区占满整行 */
body.mode-sub-interface .app-sidebar,
body.mode-sub-interface .sidebar-collapse-btn {
    display: none !important;
}
body.mode-sub-interface .main-content {
    margin-left: 0;
}

/* 模块化容器样式 */
.app-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-header {
    width: 100%;
    position: sticky;
    top: 6px;
    z-index: 100;
}

.main-content {
    flex: 1;
    min-height: 0;
    margin-left: var(--sidebar-width, 264px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content::-webkit-scrollbar {
    display: none;
}

.deep-parse-section {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.content-section {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.content-area {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.secondary-panel {
    width: 100%;
}

.global-components {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.global-components > * {
    pointer-events: auto;
}

template {
    display: none;
}

/* =============================================
   深度解析 —— 杂志式居中阅读栏布局
   结构：顶部输入区（栏眉 + 编辑纸卡）+ 下方阅读精解栏（居中正文列）
   ============================================= */
.two-column-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 24px;
    flex: 1;
    min-height: 0;
    padding: 24px 28px 48px;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.two-column-container::-webkit-scrollbar { display: none; }

/* 顶部输入区 —— 粗格随界面自由伸缩 */
.input-panel-section {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 编辑纸卡 */
.input-panel {
    background: var(--card-bg);
    border: 1px solid var(--study-border);
    border-top: 2px solid var(--study-primary);
    border-radius: 4px 4px 14px 14px;
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

/* 输入面板内容区域 - 处理滚动 */
.input-panel-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.input-panel-content::-webkit-scrollbar { display: none; }

/* 阅读栏眉右侧的面板切换按钮（圆形小按钮） */
.panel-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--study-muted);
    color: var(--study-muted-foreground);
    border: 1px solid var(--study-border);
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s var(--ease-smooth);
}
.panel-toggle-btn:hover {
    background: var(--study-border);
    color: var(--study-foreground);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.panel-toggle-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* 阅读精解栏 —— 随内容自然撑开，整页统一滚动 */
.sentences-panel-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.35s var(--ease-smooth), visibility 0.35s var(--ease-smooth), max-height 0.35s var(--ease-smooth);
}

/* 阅读栏眉 */
.reading-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--study-border);
}
.reading-toolbar-label {
    font-family: var(--study-font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--study-foreground);
    letter-spacing: -0.01em;
}

/* 解析后：阅读栏显示，随内容自然增长，交给 main-content 整页滚动 */
.two-column-container.has-sentences .sentences-panel-section {
    opacity: 1;
    visibility: visible;
    max-height: none;
    overflow: visible;
}

/* 折叠输入面板时：输入区隐藏，阅读栏独占全文 */
.two-column-container.collapsed .input-panel-section {
    display: none;
}

/* 句子区域：不设内部滚动，随内容自然撑开，整页滚动 */
#deepParseSentencesContainer {
    flex: 1;
    width: 100%;
    overflow: visible;
    padding: 4px 2px 32px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#deepParseSentencesContainer::-webkit-scrollbar { display: none; }

/* 内容区域 */
.content-area {
    width: 100%;
    height: 100%;
}

.sentences-list {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sentences-list::-webkit-scrollbar {
    display: none;
}

/* 二级分析面板 */
.secondary-analysis {
    display: none;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.secondary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-page);
}

.collapse-info-btn {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.collapse-info-btn.collapsed svg {
    transform: rotate(180deg);
}

/* 历史记录高亮按钮 - 激活状态 */
#historyHighlightBtn.active {
    background: var(--accent);
    color: white;
}

/* 折叠信息区的平滑过渡动画 */
.original-text,
.secondary-translation {
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
}

.secondary-analysis.collapsed .original-text,
.secondary-analysis.collapsed .secondary-translation {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-bottom-width: 0;
}

.secondary-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.original-text {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
}

.text-content {
    flex: 1;
    min-width: 0;
}

.text-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.text-body {
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
}

.secondary-translation {
    padding: 16px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
}

.translation-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.translation-content {
    color: var(--text-light);
    line-height: 1.6;
    word-break: break-word;
}

/* 带序号的翻译条目（点击跳转到对应句子） */
.translation-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 8px;
    margin: 3px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-smooth), color var(--duration-normal) var(--ease-smooth);
}
.translation-item:hover {
    background: var(--card-bg);
}
.translation-item:hover .translation-seq {
    background: var(--study-primary);
    color: #fff;
}
.translation-seq {
    flex: 0 0 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    border-radius: 50%;
    font-family: var(--study-font-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--study-accent);
    background: var(--study-muted);
    border: 1px solid var(--study-border);
    transition: background var(--duration-normal) var(--ease-smooth), color var(--duration-normal) var(--ease-smooth);
}
.translation-item-text {
    flex: 1;
    min-width: 0;
}

.secondary-sentences {
    padding: 16px;
    height: calc(100% - 200px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.secondary-sentences::-webkit-scrollbar {
    display: none;
}

.full-translation {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-page);
    border-radius: 12px;
}

#fullTranslationArea {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-page);
    border-radius: 12px;
}

#fullTranslationArea strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

#fullTranslationArea span {
    color: var(--text-light);
    line-height: 1.6;
}

/* ========== 全文翻译加载状态：旋转指示 + 段落骨架 ========== */
.translation-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 14px;
    font-family: var(--study-font-sans, var(--font-body));
    font-size: 13px;
    color: var(--text-muted);
}

.translation-loading-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--study-primary) 18%, transparent);
    border-top-color: var(--study-primary);
    animation: study-spin 0.8s linear infinite;
}

.translation-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.translation-skeleton span {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--study-primary) 6%, transparent) 25%,
        color-mix(in srgb, var(--study-primary) 15%, transparent) 37%,
        color-mix(in srgb, var(--study-primary) 6%, transparent) 63%);
    background-size: 400% 100%;
    animation: study-shimmer 1.5s ease-in-out infinite;
}

.translation-skeleton span:nth-child(2) { width: 92%; animation-delay: 0.08s; }
.translation-skeleton span:nth-child(3) { width: 96%; animation-delay: 0.16s; }
.translation-skeleton span:nth-child(4) { width: 74%; animation-delay: 0.24s; }

@keyframes study-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ========== 一键回到顶部按钮 ========== */
.back-to-top-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--study-border);
    background: var(--study-card);
    color: var(--study-muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s ease, color 0.15s ease;
}

.back-to-top-btn svg {
    width: 20px;
    height: 20px;
}

.back-to-top-btn:hover {
    background: var(--study-primary);
    color: var(--study-primary-foreground);
}

.back-to-top-btn:focus-visible {
    outline: 2px solid var(--study-ring);
    outline-offset: 2px;
}

.back-to-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

