:root {
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-card-hover: #1e283d;
    --border-color: #26334d;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-bg: rgba(56, 189, 248, 0.12);
    --accent-border: #38bdf8;
    --success: #10b981;
    --danger: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-chinese: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-size-base: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: 280px;
    background: #0f1523;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 28px;
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    padding: 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.version-tag {
    font-size: 11px;
    background: #1e293b;
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 12px 14px;
    border-radius: 8px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-info {
    margin-top: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
}

.sidebar-info h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.shortcuts-list {
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

kbd {
    background: #222d42;
    border: 1px solid #334360;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 11px;
    font-family: monospace;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 48px;
    max-width: 1100px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

.view-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    margin-bottom: 28px;
}

.panel-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Create Mode Switcher Tabs */
.create-mode-tabs {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.mode-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
    background: var(--accent);
    color: #0b0f19;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

/* URL Input Section */
.url-input-container {
    animation: fadeIn 0.25s ease-in-out;
    margin-bottom: 8px;
}

.url-input-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.url-card-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.url-hint-badge {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.url-input-group {
    display: flex;
    gap: 10px;
}

.url-input-group input[type="text"] {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    font-size: 14px;
}

.btn-extract {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #0b0f19;
    font-weight: 700;
    padding: 0 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.btn-extract:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.5);
}

.btn-extract.loading {
    opacity: 0.8;
    cursor: wait;
}

.platform-badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge-tag {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* URL Extract Result Card */
.url-extract-result {
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 14px;
    animation: fadeIn 0.2s ease;
}

.result-card-inner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
}

.result-thumb-box {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.result-info-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.platform-chip {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.duration-chip {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.sub-status-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.chip-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.chip-info {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-video-title {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.4;
}

.result-sub-notice {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Forms */
.create-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

input[type="text"], select, textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    background: rgba(21, 28, 44, 0.5);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.dropzone-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.dropzone-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.label-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-subtle {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}

.btn-subtle:hover {
    text-decoration: underline;
}

.hint-text {
    font-size: 13px;
    color: var(--accent);
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #0b0f19;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
}

/* Processing indicator */
.processing-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-text h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--accent);
}

.processing-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* History Grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.history-card-title {
    font-size: 16px;
    font-weight: 600;
}

.history-card-lang {
    background: #222d42;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
}

.history-card-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.history-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}

/* History Toolbar & Search */
.history-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.history-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
}

.history-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.history-search-input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.history-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

.history-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-tool {
    background: rgba(30, 41, 59, 0.7);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-tool:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: var(--accent);
    color: #38bdf8;
}

.btn-tool.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
}

/* Folder Tabs */
.folder-tabs-wrapper {
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.folder-tabs-list {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.folder-tab-pill {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.folder-tab-pill:hover {
    background: rgba(51, 65, 85, 0.7);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.folder-tab-pill.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.tab-badge {
    background: rgba(15, 23, 42, 0.6);
    color: inherit;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.folder-tab-pill-wrapper {
    display: inline-flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.folder-tab-pill-wrapper.active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.folder-tab-pill-wrapper .folder-tab-pill {
    background: transparent;
    border: none;
    padding-right: 4px;
}

.folder-tab-settings {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 8px 6px 2px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 0 20px 20px 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.folder-tab-settings:hover {
    opacity: 1;
    color: var(--text-primary);
}

.btn-add-folder-tab {
    border-style: dashed;
    color: var(--text-muted);
}

.btn-add-folder-tab:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Batch Action Bar */
.batch-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--accent);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.2);
    backdrop-filter: blur(10px);
}

.batch-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-count-badge {
    font-weight: 700;
    font-size: 14px;
    color: #38bdf8;
}

.btn-batch-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-batch-link:hover {
    color: var(--text-primary);
}

.batch-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-batch-action {
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-batch-move {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}
.btn-batch-move:hover {
    background: rgba(56, 189, 248, 0.35);
}

.btn-batch-copy {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.4);
}
.btn-batch-copy:hover {
    background: rgba(168, 85, 247, 0.35);
}

.btn-batch-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}
.btn-batch-delete:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* History Card Enhancements */
.history-card.selected {
    border-color: var(--accent);
    background: rgba(30, 41, 59, 0.85);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.history-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.session-select-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    display: none;
}

.history-card.select-mode .session-select-checkbox {
    display: inline-block;
}

.history-card:hover .session-select-checkbox {
    display: inline-block;
}

.session-folder-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.session-folder-chip.has-folder {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.session-folder-chip.has-folder:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
}

.session-folder-chip.no-folder {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    border: 1px dashed rgba(148, 163, 184, 0.3);
}
.session-folder-chip.no-folder:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
}

.history-header-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-card-video {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.history-card-date {
    font-size: 11px;
    color: var(--text-muted);
}

.card-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-card-action {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-action:hover {
    background: rgba(51, 65, 85, 0.9);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-card-action.btn-copy:hover {
    color: #c084fc;
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
}

.btn-card-action.btn-move:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.btn-card-action.btn-delete {
    color: var(--danger);
    background: transparent;
    border-color: transparent;
}
.btn-card-action.btn-delete:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* App Modals */
.app-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

.app-modal-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.app-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.app-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.app-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.app-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.app-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.app-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-folders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.modal-folder-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.15s ease;
}

.modal-folder-option:hover {
    background: rgba(51, 65, 85, 0.6);
    color: var(--text-primary);
}

.modal-folder-option input[type="radio"] {
    accent-color: var(--accent);
}

.modal-input-row {
    position: relative;
    display: flex;
    align-items: center;
}

.modal-input-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    pointer-events: none;
}

.modal-text-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.modal-text-input:focus {
    outline: none;
    border-color: var(--accent);
}

.app-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

.modal-danger-zone {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px dashed rgba(239, 68, 68, 0.3);
}

.danger-title {
    font-size: 13px;
    font-weight: 700;
    color: #f87171;
    margin-bottom: 8px;
}

.danger-actions-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-danger-outline {
    background: transparent;
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.btn-danger-solid {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid #ef4444;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.btn-danger-solid:hover {
    background: #ef4444;
    color: #fff;
}

/* Interactive Player Station */
.player-top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.lesson-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.player-control-hub {
    position: sticky;
    top: 16px;
    background: #141c2c;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    z-index: 100;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #25334d;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0%;
    transition: width 0.05s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: #1e283d;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.control-btn:hover {
    background: #2c3a54;
}

.play-btn {
    background: var(--accent);
    color: #0b0f19;
    font-size: 18px;
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 700;
}

.play-btn:hover {
    background: var(--accent-hover);
}

.practice-modes {
    display: flex;
    gap: 8px;
}

.mode-btn {
    background: #1e283d;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: var(--accent);
}

.mode-btn.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
}

.speed-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-label {
    font-size: 13px;
    color: var(--text-muted);
}

.speed-chips {
    display: flex;
    gap: 4px;
}

.chip {
    background: #1e283d;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.chip.active {
    background: var(--accent);
    color: #0b0f19;
    font-weight: 700;
}

/* Transcript Toolbar */
.transcript-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

.search-box {
    flex: 1;
}

.search-box input {
    width: 100%;
    padding: 8px 14px;
    font-size: 14px;
}

.font-size-adjuster {
    display: flex;
    align-items: center;
    gap: 6px;
}

.font-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

/* Synchronized Transcript Elements */
.transcript-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 60px;
}

.sentence-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 5px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sentence-card:hover {
    background: var(--bg-card-hover);
    border-color: #334360;
}

.sentence-card.active {
    border-left-color: var(--accent);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.1);
    transform: scale(1.008);
}

.sentence-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.sentence-index {
    font-weight: 600;
    color: var(--accent);
}

/* Speaker Badge Tags */
.speaker-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    background: #25334d;
    color: #cbd5e1;
    border: 1px solid #3b4d6b;
}

.speaker-tag.speaker-A, .speaker-tag.speaker-a, .speaker-tag.speaker-Man, .speaker-tag.speaker-男 {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: #38bdf8;
}

.speaker-tag.speaker-B, .speaker-tag.speaker-b, .speaker-tag.speaker-Woman, .speaker-tag.speaker-女 {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border-color: #fb923c;
}

.checkbox-option {
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.sentence-text {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-primary);
}

.sentence-card.active .sentence-text {
    color: #ffffff;
    font-weight: 500;
}

/* Chinese Ruby Pinyin Styles */
ruby {
    ruby-position: over;
    font-family: var(--font-chinese);
}

rt {
    font-size: 0.65em;
    color: var(--accent);
    font-family: var(--font-sans);
    letter-spacing: 0;
    user-select: none;
    -webkit-user-select: none;
}

.hide-pinyin rt {
    display: none;
}

/* Word / Character-level Real-time Karaoke Highlighting */
.word-token {
    display: inline-block;
    padding: 0 2px;
    margin: 0 1px;
    border-radius: 4px;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.word-token:hover {
    background: rgba(56, 189, 248, 0.2);
}

/* Active glowing word/character: BRIGHT FIERY RED */
.word-token.active-word,
.word-token.active-word *,
ruby.word-token.active-word,
ruby.word-token.active-word * {
    color: #ff1a1a !important;
    background-color: rgba(255, 26, 26, 0.25) !important;
    font-weight: 800 !important;
    text-shadow: 0 0 12px rgba(255, 26, 26, 0.9), 0 0 22px rgba(255, 26, 26, 0.6) !important;
    box-shadow: 0 0 14px rgba(255, 26, 26, 0.6) !important;
    transform: scale(1.18);
    z-index: 10;
    position: relative;
    border-radius: 4px;
    padding: 0 3px;
    border-bottom: 2px solid #ff1a1a !important;
}

/* Multi-word combined selection highlight (v1.9.8) */
.word-token.combined-selection,
ruby.word-token.combined-selection {
    background-color: rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
    opacity: 1 !important;
}

.word-token.combined-selection *,
ruby.word-token.combined-selection rt {
    color: #38bdf8 !important;
    opacity: 1 !important;
}

/* Chinese Compound Word Linked Hover Glow (v1.9.9) */
.word-token.compound-hover-active:not(.active-word),
ruby.word-token.compound-hover-active:not(.active-word) {
    background-color: rgba(56, 189, 248, 0.3) !important;
    color: #38bdf8 !important;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
    transition: all 0.12s ease;
    opacity: 1 !important;
}

.word-token.compound-hover-active:not(.active-word) *,
.word-token.compound-hover-active:not(.active-word) rt,
ruby.word-token.compound-hover-active:not(.active-word) rt {
    color: #38bdf8 !important;
    opacity: 1 !important;
}

/* Visible indicator showing linked compound words (v1.9.12) */
.word-token.has-compound {
    border-bottom: 2px solid rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.08);
    border-radius: 3px;
}

.word-token.active-word rt,
ruby.word-token.active-word rt {
    color: #ff3b30 !important;
    font-weight: 800 !important;
}

/* Words already read in the active sentence: clean white */
.sentence-card.active .word-token.passed-word,
.sentence-card.active .word-token.passed-word * {
    color: #f1f5f9 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

/* Future words in active sentence: dimmed so red stands out brilliantly */
.sentence-card.active .word-token:not(.active-word):not(.passed-word),
.sentence-card.active .word-token:not(.active-word):not(.passed-word) * {
    color: #64748b !important;
    opacity: 0.55 !important;
}

/* Dropdown Menu */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #182236;
    min-width: 190px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 120;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    transition: background 0.15s;
}

.dropdown-content a:hover {
    background: #25334d;
    color: var(--accent);
}

.dropdown-content.show {
    display: block;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.toast {
    background: #1c263c;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile Bottom Navigation Bar (Hidden by default on Desktop) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(11, 15, 25, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    gap: 3px;
    height: 100%;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item .nav-icon {
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Compact Sidebar Header on Mobile (Desktop navigation hidden, handled by Mobile Bottom Nav) */
    .sidebar {
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
        box-sizing: border-box;
    }
    .sidebar-nav, .sidebar-info {
        display: none !important;
    }

    /* Main Content with bottom spacing for Mobile Nav + Safe Area Insets on all sides */
    .main-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-top: 12px;
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        margin: 0 auto;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-x: clip;
    }

    .view-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .panel-header h2 {
        font-size: 20px;
        word-break: break-word;
    }
    .subtitle {
        font-size: 13px;
        word-break: break-word;
    }

    /* Sticky Audio Control Hub for seamless scrolling - contained without edge overflow */
    .player-control-hub {
        position: sticky;
        top: 0;
        z-index: 90;
        background: rgba(11, 15, 25, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
        margin: 0 0 14px 0;
        padding: 12px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Touch-friendly Audio Controls */
    .control-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .playback-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        flex-wrap: wrap;
        width: 100%;
        box-sizing: border-box;
    }
    .control-btn {
        min-width: 36px;
        min-height: 38px;
        padding: 6px 8px;
        font-size: 13px;
        box-sizing: border-box;
    }
    .control-btn.play-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    /* Practice modes: clean 2-column grid filling 100% width without horizontal overflow */
    .practice-modes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    .mode-btn {
        width: 100%;
        padding: 7px 6px;
        font-size: 11px;
        font-weight: 600;
        text-align: center;
        justify-content: center;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
    }

    .speed-controls {
        width: 100%;
        justify-content: center;
        gap: 6px;
        box-sizing: border-box;
    }

    .player-top-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .player-top-header h2 {
        font-size: 18px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .export-dropdown {
        width: 100%;
    }
    .export-dropdown .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
    .export-dropdown .dropdown-content {
        width: 100%;
        left: 0;
        right: 0;
        box-sizing: border-box;
    }

    /* Prevent auto-zoom on iOS Safari */
    .dictation-input, #transcriptSearch, select, input[type="text"], textarea {
        font-size: 16px !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Transcript Toolbar */
    .transcript-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    .search-box {
        width: 100%;
    }
    .font-size-adjuster {
        justify-content: center;
    }

    /* Shadowing comparison buttons: 2x2 grid on mobile */
    .comp-btn-row, .comp-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    .comp-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 4px;
        font-size: 11px;
        box-sizing: border-box;
    }
    .comp-btn.btn-seq {
        grid-column: span 2;
    }

    /* Dictation mobile wrap */
    .dictation-box {
        padding: 12px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .dictation-input-row {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        box-sizing: border-box;
    }
    .btn-dictation-submit, .btn-dict-check {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        box-sizing: border-box;
    }

    /* Sentence card touch padding */
    .sentence-card {
        padding: 12px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .sentence-meta {
        flex-wrap: wrap;
        gap: 6px;
    }
    .sentence-text {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .btn-seg-replay, .btn-seg-translate, .btn-seg-record, .btn-seg-dictate {
        min-height: 30px;
        padding: 4px 6px;
        font-size: 11px;
    }

    /* Mobile URL & Create Tab Wrap */
    .create-mode-tabs {
        flex-direction: column;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    .url-input-card {
        padding: 12px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .url-card-label {
        flex-wrap: wrap;
        gap: 6px;
    }
    .url-input-group {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        box-sizing: border-box;
    }
    .url-input-group input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }
    .btn-extract {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }
    .dropzone {
        padding: 24px 12px;
        width: 100%;
        box-sizing: border-box;
    }
    .dropzone-text {
        font-size: 13px;
        word-break: break-word;
    }
    .dropzone-hint {
        font-size: 11px;
        word-break: break-word;
    }
    textarea#transcriptText {
        width: 100%;
        box-sizing: border-box;
    }
    .label-with-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .btn-primary {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    /* History Grid & Cards on Mobile */
    .history-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    .history-search-wrapper {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .history-toolbar-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 6px;
        box-sizing: border-box;
    }
    .history-toolbar-actions .btn-tool {
        flex: 1;
        justify-content: center;
        padding: 8px 4px;
        font-size: 11px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .folder-tabs-wrapper {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: 14px;
    }

    .batch-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .batch-left {
        width: 100%;
        justify-content: space-between;
    }
    .batch-right {
        display: flex;
        width: 100%;
        gap: 6px;
        box-sizing: border-box;
    }
    .btn-batch-action {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 8px 4px;
        font-size: 11px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .history-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .history-card {
        padding: 14px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .history-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .history-header-left {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    .session-folder-chip {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .history-card-title {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .history-card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    .history-card-date {
        font-size: 11px;
    }
    .card-btn-group {
        display: flex;
        width: 100%;
        gap: 6px;
        box-sizing: border-box;
    }
    .btn-card-action {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 7px 4px;
        font-size: 11px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    /* Video Player responsive styles */
    .video-player-stage {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 75;
        background: #060b18;
        padding-top: 2px;
        margin-bottom: 6px;
    }
    .video-player-card {
        padding: 6px 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .video-active-sentence-stage {
        padding: 6px 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-top: 4px;
    }
    .video-sentence-meta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        margin-bottom: 4px;
        padding-bottom: 4px;
    }
    .vid-meta-left {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
        width: auto;
    }
    .vid-meta-actions {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 3px;
        width: auto;
        max-width: 70%;
        justify-content: flex-end;
        box-sizing: border-box;
    }
    .vid-meta-actions::-webkit-scrollbar {
        display: none;
    }
    .btn-vid-action {
        flex: 0 0 auto;
        padding: 4px 6px;
        font-size: 11px;
        text-align: center;
        justify-content: center;
        white-space: nowrap;
        box-sizing: border-box;
    }
    .video-sentence-text {
        font-size: 15px !important;
        line-height: 1.5;
        min-height: 36px;
        max-height: 105px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 2px 4px;
        margin: 2px 0 4px 0;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .video-sentence-translation {
        font-size: 12px;
        line-height: 1.4;
        max-height: 42px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 4px;
        padding-top: 4px;
    }
    .video-wrapper {
        max-height: 200px;
        min-height: 120px;
        width: 100%;
        box-sizing: border-box;
    }
    #mainVideo {
        max-height: 200px;
        width: 100%;
    }
    .video-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        margin-top: 4px;
        padding-top: 4px;
    }
    .video-status-indicator {
        justify-content: flex-start;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .video-tool-buttons {
        width: auto;
        gap: 3px;
        justify-content: flex-end;
    }
    .btn-vid-tool {
        flex: 0 0 auto;
        justify-content: center;
        padding: 4px 6px;
        font-size: 10px;
        white-space: nowrap;
    }

    @media (max-height: 500px) and (max-width: 900px) {
        .video-wrapper, #mainVideo {
            max-height: 135px;
        }
        .video-sentence-text {
            max-height: 65px;
            font-size: 13px !important;
        }
        .video-active-sentence-stage {
            padding: 4px 6px;
            margin-top: 3px;
        }
    }

    /* Mobile Bottom Navigation shown */
    .mobile-bottom-nav {
        display: flex;
        padding-left: max(8px, env(safe-area-inset-left, 0px));
        padding-right: max(8px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }
}

/* ========================================================
   Translation UI Styles: Word Popover & Sentence Translations
   ======================================================== */

.btn-seg-translate {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-seg-translate:hover {
    background: var(--accent);
    color: #0b0f19;
    border-color: var(--accent);
}

.btn-seg-replay {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-seg-replay:hover {
    background: #a855f7;
    color: #ffffff;
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.btn-seg-record {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-seg-record:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-seg-record.active {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
}

.btn-seg-dictate {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-seg-dictate:hover {
    background: #f59e0b;
    color: #0b0f19;
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.btn-seg-dictate.active {
    background: #f59e0b;
    color: #0b0f19;
    font-weight: 700;
}

/* Dictation Panel & Interactive Form */
.dictation-panel {
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(18, 25, 43, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    animation: fadeIn 0.25s ease-out;
}

.dictation-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dictation-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dict-btn-tool {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.dict-btn-tool:hover {
    background: #334155;
    color: #ffffff;
    border-color: #64748b;
}

.dictation-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dictation-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.dictation-input-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.dictation-input {
    flex: 1;
    background: #0b0f19;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 12px;
    color: #f8fafc;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dictation-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.btn-dict-check {
    background: #f59e0b;
    color: #0b0f19;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-dict-check:hover {
    background: #d97706;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.dictation-hint-box {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px dashed rgba(14, 165, 233, 0.35);
    border-radius: 6px;
    font-size: 12px;
    color: #38bdf8;
    line-height: 1.4;
    animation: fadeIn 0.2s ease;
}

.dictation-result-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: #090e1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    animation: fadeIn 0.25s ease;
}

.dict-score-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dict-score-badge {
    font-size: 13px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    color: #0b0f19;
}
.dict-score-badge.badge-perfect {
    background: linear-gradient(135deg, #10b981, #34d399);
}
.dict-score-badge.badge-good {
    background: linear-gradient(135deg, #06b6d4, #38bdf8);
}
.dict-score-badge.badge-fair {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.dict-score-badge.badge-retry {
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    color: #ffffff;
}

.dict-score-feedback {
    font-size: 13px;
    color: #e2e8f0;
}

.dict-tokens-diff {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
}

.dict-token {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.dict-token rt {
    font-size: 10px;
    color: #94a3b8;
}

.dict-token.dict-correct {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.5);
}
.dict-token.dict-correct rt {
    color: #34d399;
}

.dict-token.dict-wrong {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.5);
}
.dict-token.dict-wrong rt {
    color: #f87171;
}

.dict-token.dict-missing {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px dashed rgba(245, 158, 11, 0.5);
    text-decoration: line-through;
}
.dict-token.dict-missing rt {
    color: #fbbf24;
}

/* Masking text when Dictation Mode is active */
.sentence-card.dictation-masked .sentence-text {
    filter: blur(10px);
    opacity: 0.12;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
    cursor: default;
}

.sentence-card.dictation-masked .sentence-text * {
    text-shadow: none !important;
    box-shadow: none !important;
}

.sentence-card.dictation-masked.unmasked .sentence-text {
    filter: none !important;
    opacity: 1 !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    pointer-events: auto !important;
}

.sentence-card.dictation-masked:not(.unmasked) .sentence-translation {
    display: none !important;
}

.sentence-card.dictation-masked.unmasked .sentence-translation {
    display: block !important;
}

.dictation-mask-hint {
    display: none;
    font-size: 12px;
    color: #fbbf24;
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    font-weight: 500;
}

.sentence-card.dictation-masked .dictation-mask-hint {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sentence-card.dictation-masked.unmasked .dictation-mask-hint {
    display: none !important;
}

/* Shadowing Recording & Comparison Panel */
.shadowing-panel {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(13, 21, 39, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-left: 3px solid #10b981;
    border-radius: 8px;
    animation: fadeIn 0.25s ease-out;
}

.shadowing-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shadowing-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shadowing-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.shadowing-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.shadowing-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.btn-mic-record {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-mic-record:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.btn-mic-record.recording {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
    animation: pulseRecording 1.2s infinite;
}

@keyframes pulseRecording {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.recording-timer {
    font-size: 13px;
    font-weight: 700;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.shadowing-comp-box {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.25s ease-out;
}

.comp-btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.comp-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.comp-btn.btn-sample {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
.comp-btn.btn-sample:hover, .comp-btn.btn-sample.playing {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.comp-btn.btn-user {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.comp-btn.btn-user:hover, .comp-btn.btn-user.playing {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.comp-btn.btn-seq {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}
.comp-btn.btn-seq:hover, .comp-btn.btn-seq.playing {
    background: #a855f7;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.comp-btn.btn-ai-eval {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.comp-btn.btn-ai-eval:hover {
    background: #f59e0b;
    color: #0b0f19;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* AI Pronunciation Feedback Container */
.ai-feedback-container {
    margin-top: 10px;
    padding: 10px 12px;
    background: #090e1a;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.ai-score-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.ai-score-badge {
    font-size: 14px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    color: #0b0f19;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ai-score-badge.badge-great {
    background: linear-gradient(135deg, #10b981, #34d399);
}
.ai-score-badge.badge-good {
    background: linear-gradient(135deg, #06b6d4, #38bdf8);
}
.ai-score-badge.badge-fair {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.ai-score-badge.badge-retry {
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    color: #ffffff;
}

.ai-score-rating {
    font-size: 13px;
    color: #e2e8f0;
    font-weight: 500;
}

.ai-recognized-line {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}
.ai-recognized-line strong {
    color: #94a3b8;
}

.ai-tokens-review {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
}

.ai-token {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.ai-token rt {
    font-size: 10px;
    color: #94a3b8;
}

.ai-token.status-correct {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.ai-token.status-correct rt {
    color: #34d399;
}

.ai-token.status-mispronounced {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
}
.ai-token.status-mispronounced rt {
    color: #fbbf24;
}

.ai-token.status-missing {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px dashed rgba(239, 68, 68, 0.5);
    text-decoration: line-through;
}
.ai-token.status-missing rt {
    color: #f87171;
}

.sentence-translation {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.65);
    border-left: 3px solid var(--accent);
    border-radius: 4px 8px 8px 4px;
    animation: fadeIn 0.25s ease-out;
}

.sentence-translation .trans-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sentence-translation .trans-content {
    font-size: 15px;
    color: #e2e8f0;
    line-height: 1.5;
    font-style: normal;
}

/* Floating Word Translation Popover */
.word-translate-popover {
    position: fixed;
    z-index: 1000;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 12px 14px;
    backdrop-filter: blur(8px);
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.popover-word-title {
    display: flex;
    flex-direction: column;
}

.popover-word {
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.5px;
}

.popover-pinyin {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 1px;
}

.popover-actions {
    display: flex;
    gap: 4px;
}

.popover-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.popover-body {
    padding: 10px 0;
}

.popover-meaning {
    font-size: 15px;
    font-weight: 500;
    color: #38bdf8;
    line-height: 1.45;
}

/* Popover Combiner Toolbar (v1.9.8) */
.popover-combine-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.combine-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.combine-mobile-tip {
    font-size: 10px;
    color: #38bdf8;
    text-transform: none;
    font-weight: 500;
    margin-left: 6px;
}

.popover-mobile-handle {
    display: none;
}

.word-translate-backdrop {
    display: none;
}

.combine-btn-group {
    display: flex;
    gap: 4px;
}

.btn-combine {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-combine:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.btn-combine-shrink {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.25);
}

.btn-combine-shrink:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: #f87171;
    color: #fca5a5;
}

/* Smart contextual compound suggestions (v1.9.8) */
.popover-suggestions-box {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.suggestions-title {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 6px;
}

.suggestions-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.suggestion-chip {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fde68a;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.suggestion-chip small {
    font-size: 10px;
    opacity: 0.75;
}

.suggestion-chip:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: #fbbf24;
    color: #fff;
    transform: translateY(-1px);
}

.popover-sentence-box {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(30, 41, 59, 0.7);
    border-left: 3px solid #22c55e;
    border-radius: 6px;
    font-size: 13px;
}

.popover-sentence-title {
    font-size: 11px;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 3px;
}

.popover-sentence-content {
    color: #f1f5f9;
    line-height: 1.4;
}

.popover-footer {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-popover-translate-seg {
    width: 100%;
    padding: 7px 10px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-popover-translate-seg:hover {
    background: var(--accent);
    color: #0b0f19;
}

/* Floating Text Selection Tooltip (v1.9.8) */
.text-selection-tooltip {
    position: fixed;
    z-index: 1001;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #f8fafc;
    cursor: pointer;
    user-select: none;
    animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.text-selection-tooltip:hover {
    background: #1e293b;
    border-color: #38bdf8;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.text-selection-tooltip strong {
    color: #38bdf8;
    font-weight: 600;
}



/* ==========================================================================
   PROGRESS HUBS & PROCESSING STATUS SECTION (v1.8.3)
   ========================================================================== */

/* URL Card Header & Quick Language Selector */
.url-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.url-quick-lang-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 8px;
}

.quick-lang-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.url-quick-lang-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.url-quick-lang-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* URL Extraction Progress Box */
.url-progress-box {
    margin-top: 14px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 12px rgba(56, 189, 248, 0.1);
    animation: fadeInSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.progress-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-spinner-mini {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(56, 189, 248, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.progress-box-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-meta-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.progress-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-secondary);
}

.progress-pct {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(56, 189, 248, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.progress-bar-fill-animated {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
    animation: shimmerMove 2s linear infinite;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

@keyframes shimmerMove {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-steps-list {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.step-bullet {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.step-item.active {
    color: var(--accent);
    font-weight: 600;
}

.step-item.active .step-bullet {
    background: var(--accent);
    color: #0b0f19;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.step-item.done {
    color: var(--success);
    font-weight: 600;
}

.step-item.done .step-bullet {
    background: var(--success);
    color: #0b0f19;
}

/* ==========================================================================
   LESSON PROCESSING HUB (FORM SUBMISSION STATION)
   ========================================================================== */

.processing-hub-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(56, 189, 248, 0.15);
    animation: fadeInSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.processing-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.hub-title-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hub-pulse-ring {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hub-pulse-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.25;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.hub-pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.hub-main-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.hub-sub-title {
    font-size: 13px;
    color: var(--accent);
    margin: 0;
    transition: color 0.3s ease;
}

.hub-meta-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hub-badge-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 5px 10px;
    border-radius: 8px;
    color: #94a3b8;
}

.hub-badge-pct {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 15px;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 5px 12px;
    border-radius: 8px;
    color: var(--accent);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.hub-progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.hub-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
    animation: shimmerMove 2s linear infinite;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.6);
}

.hub-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.hub-step-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.step-status-icon {
    font-size: 20px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.step-details {
    overflow: hidden;
}

.step-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-desc {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Step Card States */
.hub-step-card.active {
    opacity: 1;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
}

.hub-step-card.active .step-name {
    color: var(--accent);
}

.hub-step-card.active .step-status-icon {
    transform: scale(1.15);
}

.hub-step-card.done {
    opacity: 1;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.4);
}

.hub-step-card.done .step-name {
    color: #86efac;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .url-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .url-quick-lang-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .hub-steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .processing-hub-card {
        padding: 18px 14px;
    }

    .hub-step-card {
        padding: 10px;
        gap: 8px;
    }

    .step-status-icon {
        font-size: 16px;
    }

    .step-name {
        font-size: 12px;
    }

    .step-desc {
        font-size: 10px;
    }
}

/* ==============================================================================
   13. INTERACTIVE SHORT VIDEO PLAYER (CHO VIDEO <= 5 PHÚT)
   ============================================================================== */
.video-player-stage {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

.video-player-card {
    background: #0b1329;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    transition: max-width 0.3s ease, padding 0.3s ease;
    max-width: 680px;
    margin: 0 auto;
}

.video-player-card.expanded {
    max-width: 960px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    max-height: 420px;
    min-height: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

#mainVideo {
    max-height: 420px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    cursor: pointer;
    background: #000;
    transition: opacity 0.2s ease;
}

.video-player-card.collapsed-visual .video-wrapper {
    display: none;
}

/* Docked Active Sentence Display Directly Under Video */
.video-active-sentence-stage {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(11, 19, 43, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.video-sentence-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 8px;
}

.vid-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vid-seg-index {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.vid-speaker-tag {
    font-size: 11px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 6px;
}

.vid-time-range {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.vid-meta-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-vid-action {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--text-primary);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-vid-action:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #fff;
}

.btn-vid-action.active {
    background: #f59e0b;
    color: #0b0f19;
    font-weight: 700;
    border-color: #fbbf24;
}

.btn-vid-action.active-record {
    background: #10b981;
    color: #fff;
    font-weight: 700;
    border-color: #34d399;
}

/* Active Sentence Dictation Masking */
.video-active-sentence-stage.dictation-masked .video-sentence-text {
    filter: blur(10px);
    opacity: 0.12;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
    cursor: default;
}

.video-active-sentence-stage.dictation-masked .video-sentence-text * {
    text-shadow: none !important;
    box-shadow: none !important;
}

.video-active-sentence-stage.dictation-masked.unmasked .video-sentence-text {
    filter: none !important;
    opacity: 1 !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    pointer-events: auto !important;
}

.video-active-sentence-stage.dictation-masked:not(.unmasked) .video-sentence-translation {
    display: none !important;
}

.video-active-sentence-stage.dictation-masked .dictation-mask-hint {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-active-sentence-stage.dictation-masked.unmasked .dictation-mask-hint {
    display: none !important;
}

.video-docked-dictation {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-left: 3px solid #f59e0b;
    margin-top: 10px;
    border-radius: 8px;
}

.video-docked-shadowing {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-left: 3px solid #10b981;
    margin-top: 10px;
    border-radius: 8px;
}

.video-sentence-text {
    font-size: 20px;
    line-height: 1.8;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 6px;
    margin: 4px 0 8px 0;
}

.video-sentence-text .word-token {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.08s ease, background-color 0.08s ease, text-shadow 0.08s ease;
}

.video-sentence-text .word-token:hover {
    background-color: rgba(56, 189, 248, 0.2);
}

.video-sentence-translation {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #38bdf8;
    text-align: center;
    line-height: 1.5;
    animation: fadeIn 0.2s ease-out;
}

.video-sentence-translation .trans-flag {
    margin-right: 4px;
}

.video-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 8px;
}

.video-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.video-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.video-tool-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-vid-tool {
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-vid-tool:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
}

/* ========================================================
   FOLDER PLAYLIST STYLES (v1.9.11)
   ======================================================== */

/* 1. History View: Folder Playlist Bar */
.folder-playlist-bar {
    background: linear-gradient(135deg, rgba(21, 28, 44, 0.85) 0%, rgba(30, 41, 59, 0.75) 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

.folder-playlist-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-playlist-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.folder-playlist-icon {
    font-size: 16px;
}

.folder-playlist-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-play-folder {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    color: #ffffff;
    border: none;
    border-radius: 22px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
    transition: all 0.2s ease;
}

.btn-play-folder:hover {
    background: linear-gradient(135deg, #0369a1 0%, #0891b2 100%);
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.5);
    transform: translateY(-1px);
}

.btn-play-folder:active {
    transform: translateY(0);
}

/* 2. Player View: Playlist Banner */
.player-playlist-bar {
    background: rgba(20, 28, 44, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.playlist-bar-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.playlist-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.playlist-pill-folder {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.playlist-pill-counter {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.playlist-track-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pl-nav {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-pl-nav:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.95);
    border-color: #38bdf8;
    color: #38bdf8;
}

.btn-pl-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
}

.playlist-options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-pl-toggle {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pl-toggle.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #38bdf8;
}

.btn-pl-drawer {
    background: rgba(147, 51, 234, 0.2);
    border: 1px solid rgba(147, 51, 234, 0.4);
    color: #c084fc;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pl-drawer:hover {
    background: rgba(147, 51, 234, 0.35);
    border-color: #c084fc;
    color: #fff;
}

/* 3. Playlist Drawer Modal */
.playlist-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-out;
}

.playlist-drawer-card {
    background: #141c2c;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.playlist-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

.playlist-drawer-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.playlist-drawer-icon {
    font-size: 22px;
}

.playlist-drawer-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.playlist-drawer-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.playlist-drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.playlist-drawer-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.playlist-drawer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(30, 41, 59, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.playlist-drawer-hint {
    color: var(--text-secondary);
}

.playlist-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.playlist-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-drawer-item:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.playlist-drawer-item.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.pl-item-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.playlist-drawer-item.active .pl-item-index {
    background: #38bdf8;
    color: #0b0f19;
}

.pl-item-details {
    flex: 1;
    min-width: 0;
}

.pl-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-drawer-item.active .pl-item-title {
    color: #38bdf8;
}

.pl-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pl-item-playing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    flex-shrink: 0;
}

/* Mobile responsive rules for Folder Playlist */
@media (max-width: 768px) {
    .folder-playlist-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .folder-playlist-actions {
        width: 100%;
    }
    .btn-play-folder {
        width: 100%;
        justify-content: center;
    }
    .player-playlist-bar {
        padding: 8px 10px;
    }
    .playlist-bar-main {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .playlist-meta-info {
        justify-content: space-between;
        width: 100%;
    }
    .playlist-track-nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .btn-pl-nav {
        justify-content: center;
    }
    .playlist-options {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .btn-pl-drawer {
        grid-column: 1 / -1;
        text-align: center;
    }

    /* Mobile Bottom Sheet Mode for Word & Phrase Translation (v1.9.12) */
    .word-translate-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1099;
        animation: fadeInBackdrop 0.2s ease;
    }

    @keyframes fadeInBackdrop {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .word-translate-popover {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        border-top: 1px solid rgba(56, 189, 248, 0.45) !important;
        max-height: 82vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 12px 16px 28px !important;
        box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 189, 248, 0.25) !important;
        z-index: 1100 !important;
        animation: slideUpMobile 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes slideUpMobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .popover-mobile-handle {
        display: block !important;
        width: 44px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 2px;
        margin: 0 auto 10px auto;
    }

    .popover-word {
        font-size: 22px !important;
    }

    .popover-pinyin {
        font-size: 14px !important;
    }

    .popover-meaning {
        font-size: 16px !important;
        font-weight: 600 !important;
        padding: 4px 0;
    }

    .popover-combine-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .combine-hint {
        font-size: 12px !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .combine-btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .btn-combine {
        padding: 10px 8px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 42px;
    }

    .popover-suggestions-box {
        margin-top: 12px;
        padding-top: 10px;
    }

    .suggestions-title {
        font-size: 12px !important;
        margin-bottom: 8px;
    }

    .suggestions-chips {
        gap: 8px !important;
    }

    .suggestion-chip {
        font-size: 14px !important;
        padding: 7px 14px !important;
        border-radius: 16px !important;
        min-height: 36px;
    }

    .text-selection-tooltip {
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 22px;
        z-index: 1200;
    }
}



