/* ========================================
   main.css — 簡報編輯器專用樣式
   需搭配 base.css 使用
   ======================================== */

/* ── 編輯器頁面覆寫 ── */
body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    line-height: 1.6;
}

/* ========================================
   App 容器
   ======================================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h));
    overflow: hidden;
}

/* ========================================
   頂部選單列
   ======================================== */
.menu-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    height: 44px;
    flex-shrink: 0;
}

.menu-left {
    display: flex;
    align-items: center;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon {
    font-size: 22px;
    color: var(--accent-primary);
}

.logo-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
}

/* ── 專案切換器 ── */
.project-switcher {
    position: relative;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.project-current {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.project-current:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.project-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow: hidden;
}

.project-dropdown.open {
    display: block;
    animation: fadeIn 0.15s ease;
}

@keyframes projFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.project-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
}

.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.1s;
}

.project-item:hover {
    background: var(--bg-tertiary);
}

.project-item.active {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    font-weight: 600;
}

.project-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-item-actions {
    display: none;
    gap: 2px;
    margin-left: 8px;
}

.project-item:hover .project-item-actions {
    display: flex;
}

.project-item-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.project-item-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.project-item-btn.delete:hover {
    color: var(--accent-danger);
}

.project-actions {
    border-top: 1px solid var(--border-color);
    padding: 6px;
}

.project-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--accent-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
}

.project-action-btn:hover {
    background: var(--accent-primary-light);
}

.project-action-btn .material-symbols-outlined {
    font-size: 18px;
}

.menu-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    min-width: 120px;
    text-align: center;
    transition: all var(--transition-fast);
    outline: none;
}

.file-name:hover {
    border-color: var(--border-color);
}

.file-name:focus {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.menu-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.menu-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.menu-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.menu-btn .material-symbols-outlined {
    font-size: 20px;
}

/* 用戶狀態 */
.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-status:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========================================
   Ribbon 工具列
   ======================================== */
.ribbon {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.ribbon-tabs {
    display: flex;
    gap: 0;
    padding: 0 var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.ribbon-tab {
    padding: 6px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    position: relative;
}

.ribbon-tab:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.ribbon-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
}

.ribbon-panel {
    display: none;
    padding: 8px var(--spacing-md);
    align-items: stretch;
    gap: 0;
    min-height: 72px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.12) transparent;
}

.ribbon-panel::-webkit-scrollbar {
    height: 3px;
}
.ribbon-panel::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.12);
    border-radius: 4px;
}

.ribbon-panel.active {
    display: flex;
}

/* Ribbon 群組 */
.ribbon-group {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    flex-shrink: 0;
}

.ribbon-group-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ribbon-group-title {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
    padding-top: 3px;
    letter-spacing: 0.04em;
    font-weight: 500;
    text-transform: uppercase;
}

.ribbon-separator {
    width: 1px;
    background: var(--border-light);
    margin: 4px 0;
    align-self: stretch;
}

/* Ribbon 按鈕 */
.ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 44px;
    font-family: var(--font-family);
    position: relative;
}

.ribbon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.ribbon-btn:active {
    transform: scale(0.95);
}

.ribbon-btn .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
}

.ribbon-btn-label {
    font-size: 0.5625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Mini 按鈕 (行內工具) */
.ribbon-btn.mini {
    padding: 4px 6px;
    min-width: 30px;
    flex-direction: row;
}

.ribbon-btn.mini .material-symbols-outlined {
    font-size: 18px;
}

.ribbon-mini-divider {
    width: 1px;
    height: 20px;
    background: var(--border-light);
    margin: 0 2px;
}

/* Ribbon 行 */
.ribbon-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ribbon-row+.ribbon-row {
    margin-top: 2px;
}

/* Ribbon 下拉選單 */
.ribbon-select {
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    outline: none;
}

.ribbon-select:hover,
.ribbon-select:focus {
    border-color: var(--accent-primary);
}

.ribbon-select.font-family {
    width: 120px;
}

.ribbon-select.font-size {
    width: 54px;
}

.ribbon-select.slide-size {
    width: 140px;
}

/* 顏色按鈕 */
.color-btn {
    position: relative;
    cursor: pointer;
}

.hidden-color-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.color-indicator {
    display: block;
    width: 18px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 1px;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

/* 互動/作業按鈕高亮 */
.ribbon-btn.interactive-btn:hover {
    background: rgba(124, 92, 191, 0.1);
    color: var(--accent-interactive);
}

.ribbon-btn.homework-btn:hover {
    background: rgba(232, 138, 60, 0.1);
    color: var(--accent-homework);
}

/* 強調按鈕 */
.ribbon-btn.accent {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
}

.ribbon-btn.accent:hover {
    box-shadow: 0 2px 10px rgba(74, 122, 232, 0.3);
}

.ribbon-btn.accent .material-symbols-outlined {
    color: var(--text-inverse);
}

.ribbon-btn.accent .ribbon-btn-label {
    color: var(--text-inverse);
}

/* AI 階段按鈕 */
.ai-phase-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 14px 5px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    position: relative;
    min-width: 64px;
}

.ai-phase-btn:hover {
    border-color: #a8c7fa;
    background: #f8f7ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(26, 115, 232, 0.12);
}

.ai-phase-btn:active {
    transform: scale(0.97);
}

.ai-phase-num {
    position: absolute;
    top: -6px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ai-phase-label {
    font-size: .65rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ai-phase-arrow {
    color: var(--text-muted);
    font-size: .75rem;
    align-self: center;
    opacity: 0.5;
}

/* Prompt 手風琴 */
.ai-prompt-accordion {
    border: 1.5px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.ai-prompt-accordion summary {
    padding: 8px 14px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    background: var(--bg-secondary);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-prompt-accordion summary::before {
    content: '⚙';
    font-size: .7rem;
}

.ai-prompt-accordion[open] summary {
    border-bottom: 1px solid var(--border-light);
}

.ai-prompt-textarea {
    width: 100%;
    padding: 10px 12px;
    border: none;
    font-size: .75rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    line-height: 1.6;
    resize: vertical;
    background: #fafbfc;
    color: var(--text-primary);
}

.ai-prompt-textarea:focus {
    outline: none;
    background: #fff;
}

/* 佈局風格卡片 */
.ai-layout-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.ai-layout-card:hover {
    border-color: #a8c7fa;
    background: #fafaff;
}

.ai-layout-card.selected {
    border-color: #1a73e8;
    background: #eff0ff;
}

.ai-layout-card .material-symbols-outlined {
    font-size: 22px;
    color: var(--text-secondary);
}

.ai-layout-card.selected .material-symbols-outlined {
    color: #1a73e8;
}

.ai-layout-card span:last-child {
    font-size: .6rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

/* 主題色板 */
.theme-swatches {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    max-width: 340px;
}

.theme-swatch {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-swatch:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.theme-swatch.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(74, 122, 232, 0.25);
}

/* 動態漸層色板 */
.theme-swatch.animated-swatch {
    position: relative;
}

.theme-swatch.animated-swatch::after {
    content: '✦';
    position: absolute;
    top: -3px;
    right: -3px;
    font-size: 8px;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    pointer-events: none;
}

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

/* ========================================
   主要內容區
   ======================================== */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   側邊面板 - 投影片清單
   ======================================== */
.slide-panel {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    min-height: 0;
    transition: width 0.25s ease, min-width 0.25s ease;
    position: relative;
}

.slide-panel.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.slide-panel.collapsed .panel-header,
.slide-panel.collapsed .slide-list {
    opacity: 0;
    pointer-events: none;
}

/* 收合按鈕 */
.panel-collapse-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.panel-collapse-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.panel-collapse-btn .material-symbols-outlined {
    font-size: 16px;
    transition: transform 0.25s;
}

/* 展開按鈕（收合時出現） */
.panel-expand-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 20px;
    height: 48px;
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.panel-expand-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    width: 24px;
}

.panel-expand-btn .material-symbols-outlined {
    font-size: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.add-slide-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-xs);
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-slide-btn .material-symbols-outlined {
    font-size: 16px;
}

.add-slide-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.slide-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slide-thumbnail {
    aspect-ratio: 16 / 9;
    width: 100%;
    flex-shrink: 0;
    background: white;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.slide-thumbnail:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.slide-thumbnail.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 122, 232, 0.2);
}

.slide-thumbnail.dragging {
    opacity: 0.4;
}

.slide-thumbnail.drag-over-top {
    border-top: 3px solid var(--accent-primary);
    margin-top: -1px;
}

.slide-thumbnail.drag-over-bottom {
    border-bottom: 3px solid var(--accent-primary);
    margin-bottom: -1px;
}

.slide-thumbnail.multi-selected {
    border-color: #1a73e8;
    background: rgba(26, 115, 232, 0.08);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.25);
}

.slide-thumbnail-number {
    position: absolute;
    bottom: 3px;
    left: 3px;
    font-size: 0.6rem;
    padding: 1px 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    color: white;
    font-weight: 500;
}

.slide-thumbnail-content {
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scale(0.18);
    transform-origin: top left;
}

.slide-thumbnail-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 960px;
    height: 540px;
    transform-origin: top left;
    background: white;
    overflow: hidden;
}

.mini-element {
    position: absolute;
    overflow: hidden;
    border-radius: 2px;
}

.mini-text {
    display: flex;
    align-items: flex-start;
}

.mini-text-content {
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    word-break: break-all;
}

.mini-image {
    background: #e8eaed;
}

.mini-shape {
    border-radius: 2px;
}

.mini-matching,
.mini-fillblank,
.mini-homework,
.mini-copycard {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.mini-video {
    border-radius: 2px;
}

.empty-slide-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    color: var(--text-muted);
}

/* ========================================
   中央畫布區
   ======================================== */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-canvas);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

.slide-canvas {
    width: 960px;
    height: 540px;
    background: white;
    border-radius: 2px;
    box-shadow: var(--shadow-canvas);
    position: relative;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.canvas-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.canvas-content.slide-transition-fade {
    animation: slideFade 0.25s ease-out;
}

.canvas-content.slide-transition-slide-left {
    animation: slideLeft 0.35s ease-out;
}

.canvas-content.slide-transition-zoom {
    animation: slideZoom 0.3s ease-out;
}

@keyframes slideFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

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

@keyframes slideZoom {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

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

/* 過場按鈕 active */
.transition-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

.transition-btn.active .material-symbols-outlined {
    color: #fff;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9375rem;
    pointer-events: none;
}

/* ========================================
   投影片導航
   ======================================== */
.slide-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: 12px;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn .material-symbols-outlined {
    font-size: 20px;
}

.nav-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ── Speaker Notes ── */
.speaker-notes-panel {
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.speaker-notes-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.speaker-notes-header:hover {
    background: var(--bg-tertiary);
}

.speaker-notes-chevron {
    margin-left: auto;
    font-size: 18px;
    transition: transform 0.2s;
}

.speaker-notes-panel.open .speaker-notes-chevron {
    transform: rotate(180deg);
}

.speaker-notes-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 160px;
    padding: 10px 12px;
    border: none;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

.speaker-notes-textarea::placeholder {
    color: var(--text-muted);
}

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

.slide-counter {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   右側屬性面板
   ======================================== */
.property-panel {
    width: 260px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.property-content {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    overflow-x: hidden;
}

/* 右側面板子頁簽 */
.right-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.right-panel-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    font-family: inherit;
}

.right-panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.right-panel-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.right-panel-body {
    flex: 1;
    overflow-y: auto;
}

/* 投影片縮圖備註標記 */
.slide-notes-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4285f4;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
}

/* ── 投影片分組標頭 ── */
.slide-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-top: 4px;
    margin-bottom: 2px;
    border-radius: 6px;
    background: rgba(26, 115, 232, 0.08);
    border: 1px solid rgba(26, 115, 232, 0.15);
    cursor: grab;
    flex-shrink: 0;
    position: relative;
    transition: opacity 0.2s;
}

.slide-section-header.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.slide-section-header:first-child {
    margin-top: 0;
}

.section-color-bar {
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: #1a73e8;
    flex-shrink: 0;
}

.section-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4338ca;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
}

.section-name-input {
    width: 100%;
    padding: 2px 6px;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #4338ca;
    background: #fff;
    outline: none;
    font-family: inherit;
}

.section-remove-btn {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #80868b;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    opacity: 0;
}

.slide-section-header:hover .section-remove-btn {
    opacity: 1;
}

.section-remove-btn:hover {
    background: rgba(217, 48, 37, 0.1);
    color: #c5221f;
}

/* (按鈕樣式已統一至 base.css) */

/* (模態對話框樣式已統一至 base.css) */

/* ========================================
   簡報模式
   ======================================== */
.presentation-mode {
    position: fixed;
    inset: 0;
    background: #1a1a2e;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: padding-right 0.4s cubic-bezier(0.32, 0.72, 0, 1), top 0.3s ease;
}

.presentation-mode.active {
    display: flex;
}
/* ── presTopBar ── */
.pres-top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 42px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.pres-top-bar.visible {
    opacity: 1;
    pointer-events: auto;
}

.pres-top-bar.broadcast-locked {
    opacity: 1;
    pointer-events: auto;
}

/* 群組容器 */
.pres-bar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
}

/* 分隔線 */
.pres-bar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

/* ── 廣播狀態 ── */
.pres-broadcast-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #86efac;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.pres-broadcast-dot {
    width: 6px;
    height: 6px;
    background: #86efac;
    border-radius: 50%;
    animation: broadcastPulse 1.2s ease-in-out infinite;
}

.pres-broadcast-code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.pres-broadcast-viewers {
    font-size: 11px;
    opacity: 0.6;
}

.pres-info-text {
    font-size: 11px;
    opacity: 0.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 跟隨/自由 切換 ── */
.pres-follow-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px;
    pointer-events: auto;
}

.pres-follow-btn {
    padding: 3px 12px;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
}

.pres-follow-btn .material-symbols-outlined {
    font-size: 13px;
}

.pres-follow-btn.active {
    background: #fff;
    color: #1f1f1f;
}

/* ── 文字按鈕（統一樣式） ── */
.pres-bar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s;
}

.pres-bar-btn .material-symbols-outlined {
    font-size: 14px;
}

.pres-bar-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.pres-bar-btn.active {
    background: rgba(26, 115, 232, 0.3);
    border-color: rgba(26, 115, 232, 0.5);
    color: #a8c7fa;
}

.pres-bar-btn.unsupported {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 危險按鈕（停止廣播） */
.pres-btn-danger {
    background: rgba(217, 48, 37, 0.15);
    border-color: rgba(217, 48, 37, 0.35);
    color: #fca5a5;
}

.pres-btn-danger:hover {
    background: rgba(217, 48, 37, 0.3);
    border-color: rgba(217, 48, 37, 0.5);
    color: #fecaca;
}

/* ── 純圖示按鈕 ── */
.pres-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 5px;
    transition: all 0.2s;
}

.pres-icon-btn .material-symbols-outlined {
    font-size: 18px;
}

.pres-icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.pres-icon-btn.active {
    color: #fff;
    background: rgba(26, 115, 232, 0.35);
}

/* 顏色選擇器 */
.pres-color-input {
    width: 22px;
    height: 22px;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    background: none;
}


/* 排行榜開啟時，簡報往左偏移但保持原尺寸 */
.presentation-mode.lb-active {
    padding-right: 280px;
}

.presentation-slide {
    width: 960px;
    height: 540px;
    background: white;
    position: relative;
    overflow: hidden;
    transform-origin: center center;
    border-radius: 2px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

/* 簡報圖片清晰度優化 */
.presentation-slide img,
.presentation-element img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ── 頂部浮動工具列 ── */
.pres-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2010;
}

.presentation-mode:hover .pres-toolbar {
    opacity: 1;
}

.pres-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pres-tool-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pres-tool-btn .material-symbols-outlined {
    font-size: 20px;
}

.pres-slide-counter {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-family: var(--font-family);
}

/* ── 底部導航 ── */
.presentation-nav {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.presentation-mode:hover .presentation-nav {
    opacity: 1;
}

.pres-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pres-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pres-nav-btn .material-symbols-outlined {
    font-size: 24px;
}

/* ── 工具列播放按鈕 ── */
.menu-btn.play-btn {
    background: #4A7AE8;
    color: white;
    border-radius: 6px;
    padding: 4px 10px;
    margin-left: 4px;
}

.menu-btn.play-btn:hover {
    background: #3b6ad8;
}

/* ========================================
   形狀選擇器
   ======================================== */
.shape-picker {
    position: fixed;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 100;
    min-width: 140px;
}

.shape-picker.active {
    display: flex;
}

.shape-option {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-family: var(--font-family);
}

.shape-option .material-symbols-outlined {
    font-size: 18px;
    color: var(--text-secondary);
}

.shape-option:hover {
    background: var(--bg-tertiary);
}

/* ========================================
   右鍵選單
   ======================================== */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 999;
    min-width: 160px;
}

.context-menu-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.8125rem;
    border-radius: var(--radius-xs);
    transition: background var(--transition-fast);
    color: var(--text-primary);
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
}

.context-menu-item.danger {
    color: var(--accent-danger);
}

.context-menu-item.danger:hover {
    background: rgba(231, 76, 94, 0.08);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 8px;
}

/* (表單元素樣式已統一至 base.css) */

/* (滾動條樣式已統一至 base.css) */

/* ── 廣播 ── */

/* 按鈕 loading 狀態 */
.ribbon-btn.broadcast-loading {
    pointer-events: none;
    opacity: 0.7;
}

.ribbon-btn.broadcast-loading .material-symbols-outlined {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 按鈕廣播中狀態 */
.ribbon-btn.broadcasting {
    background: linear-gradient(135deg, #e6f4ea, #bbf7d0);
    color: #15803d;
    border-color: #86efac;
}

.ribbon-btn.broadcasting .material-symbols-outlined {
    color: #15803d;
    animation: broadcastPulse 1.5s ease-in-out infinite;
}

/* ── 頂部廣播狀態列 ── */
.broadcast-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    height: 40px;
    background: linear-gradient(135deg, #15803d, #1e8e3e);
    color: #fff;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-family);
    box-shadow: 0 2px 12px rgba(21, 128, 61, 0.3);
    animation: broadcastBarIn 0.4s ease-out;
}

.broadcast-bar.active {
    display: none;
}

@keyframes broadcastBarIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

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

.broadcast-bar-left,
.broadcast-bar-center,
.broadcast-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.broadcast-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: broadcastPulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

.broadcast-bar-label {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.broadcast-bar-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

.broadcast-bar-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 6px;
}

.broadcast-bar-copy,
.broadcast-bar-stop {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.broadcast-bar-copy {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.broadcast-bar-copy:hover {
    background: rgba(255, 255, 255, 0.35);
}

.broadcast-bar-stop {
    background: rgba(255, 255, 255, 0.9);
    color: #c5221f;
}

.broadcast-bar-stop:hover {
    background: #fff;
}

@keyframes broadcastPulse {

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

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

/* ========================================
   PDF 匯入 Modal
   ======================================== */
.pdf-import-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.pdf-import-overlay.active {
    display: flex;
}

.pdf-import-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 520px;
    max-width: 90vw;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

.pdf-import-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
}

.pdf-import-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.pdf-import-header h3 .material-symbols-outlined {
    color: #e65100;
}

.pdf-import-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}

.pdf-import-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pdf-import-body {
    padding: 12px 24px 20px;
}

.pdf-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.pdf-drop-zone:hover,
.pdf-drop-zone.drag-over {
    border-color: #e65100;
    background: #fff3e0;
}

.pdf-drop-zone p {
    margin: 8px 0 4px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.pdf-drop-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pdf-drop-zone.has-file {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.pdf-drop-zone.has-file p {
    color: #2e7d32;
    font-weight: 500;
}

.pdf-import-options {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.pdf-option:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.pdf-option input[type="radio"] {
    margin-top: 3px;
    accent-color: #e65100;
}

.pdf-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pdf-option-info strong {
    font-size: 0.88rem;
    color: var(--text-primary);
}

.pdf-option-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pdf-import-progress {
    display: none;
    margin-top: 16px;
}

.pdf-import-progress.active {
    display: block;
}

.pdf-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pdf-progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e65100, #ff9800);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

.pdf-import-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px 20px;
}

/* ── 連結卡片元素 ── */
.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 100%;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 1.5px solid rgba(26, 115, 232, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.06);
}

.link-card:hover {
    border-color: rgba(26, 115, 232, 0.4);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.12);
    transform: translateY(-1px);
}

.link-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.link-card-icon .material-symbols-outlined {
    font-size: 22px;
}

.link-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-card-label {
    font-size: 15px;
    font-weight: 700;
    color: #1f1f1f;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-desc {
    font-size: 12px;
    color: #444746;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card-url {
    font-size: 11px;
    color: #1a73e8;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
}

.link-card-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(26, 115, 232, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1a73e8;
    transition: all 0.25s;
}

.link-card:hover .link-card-arrow {
    background: #1a73e8;
    color: white;
    transform: translateX(2px);
}

.link-card-arrow .material-symbols-outlined {
    font-size: 18px;
}

/* ========================================
   即時語音字幕
   ======================================== */
.live-caption-bar {
    position: absolute;
    bottom: 48px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 40px;
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 1px;
    z-index: 5000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.live-caption-bar.visible {
    opacity: 1;
}

.live-caption-mic {
    display: none;
}

.live-caption-text {
    max-width: 90%;
    word-break: break-word;
    max-height: 3.2em;
    overflow: hidden;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 255, 255, 0.15);
}

.live-caption-text.interim {
    color: rgba(255, 255, 255, 0.5);
}

/* 學員端字幕條 */
.student-caption {
    font-size: 36px;
    padding: 14px 32px;
    bottom: 36px;
}

.student-caption .live-caption-mic {
    display: none;
}

/* 專有名詞設定面板 */
.caption-settings-panel {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: auto;
}

.caption-settings-panel.visible {
    opacity: 1;
}

.caption-settings-inner {
    background: #1f1f1f;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #f1f3f4;
}

.caption-settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.caption-settings-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #80868b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
}

.caption-settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.caption-settings-desc {
    font-size: 13px;
    color: #80868b;
    line-height: 1.5;
    margin-bottom: 12px;
}

.caption-settings-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    color: #f1f3f4;
    font-size: 14px;
    font-family: inherit;
    padding: 12px;
    resize: vertical;
    line-height: 1.6;
    box-sizing: border-box;
}

.caption-settings-input:focus {
    outline: none;
    border-color: #1a73e8;
}

.caption-settings-input::placeholder {
    color: #444746;
}

.caption-settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.caption-settings-save {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.caption-settings-save:hover {
    background: #1765cc;
}
