:root {
    --primary-color: #6c5ce7;
    --primary-hover: #a29bfe;
    --bg-color: #09090b;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --radius-lg: 32px;
    --radius-md: 16px;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.5);
    --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 背景装饰层 */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.03);
    filter: blur(80px);
    border-radius: 50%;
    z-index: -1;
    animation: move 25s infinite alternate;
}

.blob:nth-child(2) {
    background: rgba(255, 255, 255, 0.02);
    width: 400px;
    height: 400px;
    right: -100px;
    top: -100px;
    animation-duration: 30s;
    animation-delay: -5s;
}

.blob:nth-child(3) {
    background: rgba(255, 255, 255, 0.01);
    width: 600px;
    height: 600px;
    left: -200px;
    bottom: -100px;
    animation-duration: 35s;
    animation-delay: -10s;
}

.blob:nth-child(4) {
    background: rgba(255, 255, 255, 0.05);
    width: 300px;
    height: 300px;
    right: 10%;
    bottom: 10%;
    animation-duration: 20s;
    animation-delay: -15s;
}

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 100px) scale(1.1); }
}

.container {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    max-width: 1100px; /* 增加宽度以适配两列 */
    width: 100%;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.container:hover {
    transform: none;
    box-shadow: none;
}

main {
    padding: 20px 40px 40px; /* 增加顶部边距以补充 header 的缺失 */
}

/* 主页卡片式布局 */
.home-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* 两列布局 */
    gap: 24px;
    align-items: stretch; /* 对齐高度 */
}

.home-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(180%) contrast(110%);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(110%);
    border-radius: 24px; /* 统一圆角 */
    border: 1px solid var(--glass-border);
    box-shadow: 
        var(--glass-highlight),
        var(--shadow-soft);
    padding: 30px; /* 增加内边距更显大气 */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.home-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-strong);
}

.input-card {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: 1fr; /* 平板及手机切回单列 */
        gap: 20px;
    }
    .input-card {
        grid-column: span 1;
    }
    main {
        padding: 0 20px 20px;
    }
    .nav-btn { width: 60px; height: 60px; font-size: 1.5rem; }
    .fs-navigation { padding: 0 20px; }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    .word-text {
        font-size: 3rem;
    }
    .phonetic {
        font-size: 1.2rem;
    }
    .word-meaning {
        font-size: 1.1rem;
    }
    .home-card {
        padding: 24px;
    }
    .input-card {
        padding: 16px 20px;
    }
    .fs-navigation {
        position: static;
        width: 100%;
        height: auto;
        justify-content: center;
        gap: 40px;
        margin-top: 30px;
    }
    .fs-content {
        display: flex;
        flex-direction: column;
        height: 100%;
        justify-content: center;
    }
    .close-fs { top: 20px; right: 20px; width: 50px; height: 50px; }
}

@media (max-width: 480px) {
    .input-section {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    #wordInput {
        width: 100%;
        text-align: center;
        padding: 4px 0;
    }
    .play-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    .input-actions {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding-top: 12px;
        justify-content: center;
        gap: 12px;
    }
    .word-text {
        font-size: 2.5rem;
    }
    .quick-words-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .book-select {
        width: 100%;
    }
    .view-all-btn {
        width: 100%;
        justify-content: center;
    }
    .word-buttons {
        column-count: 1;
    }
}

.input-section {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05); /* 稍微加深背景 */
    padding: 8px 8px 8px 20px; /* 增加内边距 */
    border-radius: 18px; /* 稍微大一点的圆角 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-section:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.input-actions {
    display: flex;
    gap: 8px;
    margin-left: 4px;
    padding-left: 12px;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.auto-play-btn, .settings-toggle, .manage-link {
    width: 42px;
    height: 42px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    /* 初始微弱光效 */
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.1);
}

.auto-play-btn:hover, .manage-link:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    /* 悬停光污染增强 */
    box-shadow: 
        0 0 15px rgba(108, 92, 231, 0.5),
        0 0 30px rgba(108, 92, 231, 0.2);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.settings-toggle:hover {
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px) rotate(45deg);
    box-shadow: 
        0 0 15px rgba(108, 92, 231, 0.5),
        0 0 30px rgba(108, 92, 231, 0.2);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.display-card {
    min-height: 320px;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

.display-card:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}

.display-card .word-display {
    height: 100%;
    margin-bottom: 0;
}

.quick-words {
    margin-top: 0;
}

#wordInput {
    flex: 1;
    padding: 10px 0;
    font-size: 1.25rem;
    border: none;
    outline: none;
    background: transparent;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

#wordInput::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0;
}

.play-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 核心播放按钮的光污染效果 */
    box-shadow: 
        0 0 15px rgba(108, 92, 231, 0.4),
        0 0 30px rgba(108, 92, 231, 0.2);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.play-btn:hover {
    transform: scale(1.02) translateY(-1px);
    box-shadow: 
        0 0 25px rgba(108, 92, 231, 0.7),
        0 0 50px rgba(108, 92, 231, 0.3);
    filter: brightness(1.2);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.play-btn:active {
    transform: scale(0.98);
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 11, 0.4); /* 稍微降低暗度 */
    backdrop-filter: blur(12px); /* 增加背景模糊 */
    -webkit-backdrop-filter: blur(12px);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(12px); }
}

.modal-content {
    background: rgba(20, 20, 20, 0.85); /* 稍微提升黑度 */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    width: 90%;
    max-width: 500px;
    border-radius: 28px; /* 更圆润的边角 */
    box-shadow: 
        0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.modal-close-icon {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close-icon:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 32px;
}

/* 自定义滚动条 */
.list-body::-webkit-scrollbar,
.modal-main::-webkit-scrollbar,
.voice-picker-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.list-body::-webkit-scrollbar-track,
.modal-main::-webkit-scrollbar-track,
.voice-picker-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.list-body::-webkit-scrollbar-thumb,
.modal-main::-webkit-scrollbar-thumb,
.voice-picker-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.list-body::-webkit-scrollbar-thumb:hover,
.modal-main::-webkit-scrollbar-thumb:hover,
.voice-picker-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.modal-footer {
    padding: 20px 32px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 确认按钮光污染 */
    box-shadow: 
        0 0 15px rgba(108, 92, 231, 0.3),
        0 4px 12px rgba(108, 92, 231, 0.2);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 25px rgba(108, 92, 231, 0.6),
        0 8px 20px rgba(108, 92, 231, 0.4);
    filter: brightness(1.1);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.settings-group {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.group-title {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item.full-width {
    grid-column: 1 / -1;
}

.setting-item label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 18px;
    color: #b0b0e0;
}

.styled-range {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: var(--primary-color);
    border-radius: 10px;
    outline: none;
}

.styled-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 3px solid #6c5ce7;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.val-badge {
    display: inline-block;
    background: rgba(108, 92, 231, 0.2);
    color: #a29bfe;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.styled-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* 点击反馈 */
.play-btn:active, 
.view-all-btn:active, 
.sidebar-item:active, 
.voice-source-option:active .option-card,
.btn-confirm:active {
    transform: scale(0.96);
    transition: transform 0.1s;
}

.about-section {
    margin-top: 10px;
    text-align: center;
    padding: 20px 0;
}

.about-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.about-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.about-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: var(--text-main);
    margin-bottom: 12px;
    text-indent: 0.3em; /* 修正因 letter-spacing 导致的中心偏移 */
}

@media (max-width: 768px) {
    .settings-grid { grid-template-columns: 1fr 1fr; }
    .setting-item.full-width { grid-column: span 2; }
}

@media (max-width: 500px) {
    .settings-grid { grid-template-columns: 1fr; }
    .setting-item.full-width { grid-column: span 1; }
    .voice-source-selector { grid-template-columns: 1fr; }
}

.setting-item.inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
}

.setting-item.inline label {
    margin-bottom: 0;
    cursor: pointer;
}

/* 已移除 .about-section 相关的重复定义 */

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 20px 0;
}

.about-section h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

.about-section p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.version-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.settings-select {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.settings-select:hover {
    border-color: var(--primary-color);
}

.settings-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.1);
}

/* Toggle Switch 现代开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px #18181b;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

@media (max-width: 500px) {
    .settings-grid { grid-template-columns: 1fr; }
}

.auto-play-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.auto-play-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(24, 24, 27, 0.4);
}

.auto-play-btn.active .icon {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 单词展示卡片 */
.word-display {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(180%) contrast(110%);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(110%);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 0;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 
        var(--glass-highlight),
        var(--shadow-soft);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
}

.word-display:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.fullscreen-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.7;
    z-index: 10;
}

.fullscreen-toggle:hover {
    opacity: 1;
    color: #09090b;
    background: var(--primary-color);
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.word-display::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    z-index: 5;
}

/* 统一进度条：倒计时时从 0% 增长到 100% */
.word-display.countdown::after {
    transform: scaleX(1);
    transition: transform var(--interval, 3s) linear;
}

/* 播放发音时进度条保持充满态或瞬间重置 */
.word-display.playing::after {
    transform: scaleX(0);
    transition: none;
}

/* 优化主单词的光污染，使其与全屏保持一致 */
.word-text {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), text-shadow 0.5s ease;
    display: inline-block;
    text-shadow: none; /* 默认关闭，由类名控制 */
}

/* 统一光效类：适用于主界面和全屏 */
.word-text.glow-active,
.fs-word.glow-active {
    text-shadow: 
        0 0 15px rgba(162, 155, 254, 1),
        0 0 30px rgba(108, 92, 231, 0.9),
        0 0 50px rgba(108, 92, 231, 0.7),
        0 0 90px rgba(108, 92, 231, 0.4);
}

.word-text.glow-fade-out,
.fs-word.glow-fade-out {
    animation: glowFadeOut var(--interval, 3.5s) linear forwards;
}


/* 播放发音时的单词动画效果 (增强光效) */
.word-display.playing .word-text,
.fullscreen-overlay.playing .fs-word {
    transform: translateY(-20px) scale(1.18);
    color: #fff;
}

/* 乱码加载效果 (Glitch Loading) */
@keyframes glitchText {
    0% { content: "#"; }
    5% { content: "."; }
    10% { content: "^{"; }
    15% { content: "-!"; }
    20% { content: "#$_"; }
    25% { content: "№:0"; }
    30% { content: "#{+."; }
    35% { content: "@}-?"; }
    40% { content: "?{4@%"; }
    45% { content: "=.,^!"; }
    50% { content: "?2@%"; }
    55% { content: "\;1}]"; }
    60% { content: "?{%:%"; right: 0; }
    65% { content: "|{f[4"; right: 0; }
    70% { content: "{4%0%"; right: 0; }
    75% { content: "'1_0<"; right: 0; }
    80% { content: "{0%"; right: 0; }
    85% { content: "]>'"; right: 0; }
    90% { content: "4"; right: 0; }
    95% { content: "2"; right: 0; }
    100% { content: ""; right: 0; }
}

.loading-glitch {
    position: relative;
    display: inline-block;
    color: transparent !important;
    min-width: 40px;
    user-select: none;
    pointer-events: none;
}

.loading-glitch::before {
    content: "#";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: var(--primary-color);
    animation: glitchText 1s infinite steps(1);
    white-space: nowrap;
    opacity: 0.8;
}

/* 释义部分的乱码颜色稍淡 */
.word-meaning.loading-glitch::before,
.fs-meaning.loading-glitch::before {
    color: var(--text-muted);
}

/* 打字机光标效果 */
.typing-active::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--primary-color);
    margin-left: 4px;
    vertical-align: middle;
    animation: cursorBlink 0.8s infinite;
}

/* 释义部分的光标颜色同步 */
.word-meaning.typing-active::after,
.fs-meaning.typing-active::after {
    background-color: var(--text-muted);
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 内容加载后的淡入效果 */
.content-loaded {
    animation: glitchFadeIn 0.3s ease-out forwards;
}

@keyframes glitchFadeIn {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 切换单词时的弹出动画 */
@keyframes wordPopIn {
    0% { transform: translateY(15px) scale(0.92); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.word-pop {
    animation: wordPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.phonetic {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    margin-bottom: 15px;
}

.word-meaning {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* 词书选择 */
.quick-words-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.quick-words-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.book-select-trigger {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    max-width: 180px;
    overflow: hidden;
}

.book-select-trigger:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.book-select-trigger .icon {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.book-select-trigger #currentBookName {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-all-btn {
    padding: 8px 14px;
    background: rgba(108, 92, 231, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.1);
}

.view-all-btn:hover {
    border-color: var(--primary-color);
    color: #fff;
    background: rgba(108, 92, 231, 0.2);
    transform: translateY(-1px);
    box-shadow: 
        0 0 15px rgba(108, 92, 231, 0.4),
        0 0 30px rgba(108, 92, 231, 0.1);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.view-all-btn .icon {
    font-size: 1rem;
}

/* 单词按钮瀑布流布局 */
.word-buttons {
    column-count: 2;
    column-gap: 12px;
    margin-bottom: 0;
}

.word-btn {
    display: inline-flex;
    width: 100%;
    margin-bottom: 12px;
    break-inside: avoid;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.word-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.word-btn > * {
    position: relative;
    z-index: 1;
}

.word-btn:hover {
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(24, 24, 27, 0.2);
    border-color: transparent;
}

.word-btn:hover::before {
    opacity: 1;
}

.word-btn .btn-w {
    font-size: 1.1rem;
    font-weight: 700;
}

.word-btn .btn-m {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
    line-height: 1.4;
    word-break: break-all;
}

.word-btn:hover .btn-m {
    color: rgba(255, 255, 255, 0.8);
}

/* 提示列表样式 (在设置弹窗中) */
.info-box-content ul {
    list-style: none;
    padding: 0;
}

.info-box-content li {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.info-box-content li:last-child {
    border-bottom: none;
}

.info-box-content li::before {
    content: '✓';
    color: var(--primary-color);
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 2px;
}

.about-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.6;
}

/* 全屏遮罩层 */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 11, 0.8);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(60px) saturate(210%);
    -webkit-backdrop-filter: blur(60px) saturate(210%);
}

.fullscreen-overlay.active {
    display: flex;
    animation: fsFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 全屏进度条 */
.fs-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: none;
}

.fs-progress-container.active {
    display: block;
}

.fs-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(24, 24, 27, 0.6);
    border-radius: 0 3px 3px 0;
}

@keyframes fsFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(60px); }
}

.fs-content {
    text-align: center;
    width: 90%;
    max-width: 1200px;
    animation: fsContentPop 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 5;
}

@keyframes fsContentPop {
    from { transform: translateY(60px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.fs-word {
    font-size: clamp(4rem, 15vw, 11rem);
    font-weight: 850;
    color: #fff;
    letter-spacing: -0.05em;
    margin-bottom: 25px;
    cursor: pointer;
    /* 增加 text-shadow 过渡，让光影变化更平滑 */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.5s, text-shadow 0.5s ease;
    word-wrap: break-word;
    display: inline-block;
    position: relative;
    text-shadow: none;
}

/* 统一的高亮光效状态：用于播放中和切换瞬间 */
.fs-word.glow-active {
    text-shadow: 
        0 0 15px rgba(162, 155, 254, 1),
        0 0 30px rgba(108, 92, 231, 0.9),
        0 0 50px rgba(108, 92, 231, 0.7),
        0 0 90px rgba(108, 92, 231, 0.4);
}

/* 切换时的弹出动画：保持高亮 */
.fs-word.word-pop {
    animation: wordPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 单词呼吸效果动画 (增强) */
@keyframes wordBreathingGlow {
    0%, 100% {
        text-shadow: 
            0 0 15px rgba(108, 92, 231, 0.4),
            0 0 30px rgba(108, 92, 231, 0.2);
        transform: scale(1);
    }
    50% {
        text-shadow: 
            0 0 25px rgba(162, 155, 254, 0.9),
            0 0 50px rgba(108, 92, 231, 0.6),
            0 0 80px rgba(108, 92, 231, 0.3);
        transform: scale(1.03);
    }
}

.fs-word.breathing, 
.word-text.breathing {
    animation: wordBreathingGlow 2.5s ease-in-out infinite;
}

/* 倒计时期间或播放结束后的逐渐消失动画 */
@keyframes glowFadeOut {
    0% {
        text-shadow: 
            0 0 15px rgba(162, 155, 254, 1),
            0 0 30px rgba(108, 92, 231, 0.9),
            0 0 50px rgba(108, 92, 231, 0.7),
            0 0 90px rgba(108, 92, 231, 0.4);
    }
    100% {
        text-shadow: 0 0 0 rgba(108, 92, 231, 0);
    }
}

.fs-word:hover {
    transform: scale(1.05);
    color: #fff;
    /* 悬停时光晕进一步扩散 */
    text-shadow: 
        0 0 15px rgba(162, 155, 254, 1),
        0 0 35px rgba(108, 92, 231, 0.9),
        0 0 60px rgba(108, 92, 231, 0.7),
        0 0 100px rgba(108, 92, 231, 0.4),
        0 0 150px rgba(108, 92, 231, 0.2);
}

.fs-phonetic {
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 30px;
    opacity: 0.9;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.05em;
}

.fs-meaning {
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 全屏导航按钮 */
.fs-navigation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none; /* 隐藏左右切换按钮 */
    justify-content: space-between;
    align-items: center;
    padding: 0 60px;
    z-index: 10; /* 提升层级，确保在 fs-content 之上 */
}

.nav-btn {
    pointer-events: auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 1px solid rgba(108, 92, 231, 0.3);
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    /* 导航按钮光效 */
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 
        0 0 30px rgba(108, 92, 231, 0.6),
        0 0 60px rgba(108, 92, 231, 0.3);
    border-color: var(--primary-color);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.nav-btn:active {
    transform: scale(0.95);
}

.fs-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.fs-control-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.fs-auto-play-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 1px solid rgba(108, 92, 231, 0.3);
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.fs-auto-play-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 
        0 0 30px rgba(108, 92, 231, 0.6),
        0 0 60px rgba(108, 92, 231, 0.3);
    border-color: var(--primary-color);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.fs-auto-play-btn:active {
    transform: scale(0.95);
}

.fs-auto-play-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(24, 24, 27, 0.4);
}

.fs-auto-play-btn.active .icon {
    animation: rotate 2s linear infinite;
}

.fs-status {
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.fs-tip {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.5;
    letter-spacing: 0.02em;
    transition: opacity 1s ease, visibility 1s ease;
}

.fs-tip.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.close-fs {
    position: absolute;
    top: 50px;
    right: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    color: var(--text-main);
    z-index: 1010;
}

.close-fs:hover {
    transform: rotate(180deg) scale(1.1);
    background: #ef4444;
    color: white;
    border-color: transparent;
    box-shadow: 
        0 0 30px rgba(239, 68, 68, 0.6),
        0 0 60px rgba(239, 68, 68, 0.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.current-time {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-soft);
    z-index: 2000;
    pointer-events: none;
    letter-spacing: 0.05em;
    /* 时间光污染与呼吸效果 */
    text-shadow: 
        0 0 8px rgba(108, 92, 231, 0.8),
        0 0 16px rgba(108, 92, 231, 0.4);
    animation: timeBreathing 3s ease-in-out infinite;
}

@keyframes timeBreathing {
    0%, 100% {
        text-shadow: 
            0 0 8px rgba(108, 92, 231, 0.8),
            0 0 16px rgba(108, 92, 231, 0.4);
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        text-shadow: 
            0 0 15px rgba(162, 155, 254, 1),
            0 0 30px rgba(108, 92, 231, 0.8),
            0 0 45px rgba(108, 92, 231, 0.6);
        opacity: 1;
        transform: scale(1.05);
    }
}



/* 播放动画 */
@keyframes word-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.playing .word-text {
    animation: word-pop 0.5s ease-out;
}

/* 词书列表弹窗专用样式 */
.word-list-modal {
    max-width: 700px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.header-title-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.word-count-badge {
    font-size: 0.85rem;
    background: #f4f4f5;
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.modal-search-bar {
    padding: 18px 24px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
}

#modalSearch {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#modalSearch::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

#modalSearch:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}

.search-icon {
    position: absolute;
    right: 38px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-word-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-word-item {
    flex: 0 1 auto;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 20px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.modal-word-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.modal-word-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-word-item:hover::before {
    opacity: 1;
}

.modal-word-item .mw-word {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.modal-word-item .mw-meaning {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

.modal-tip::before {
    content: '💡';
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .modal-word-grid {
        grid-template-columns: 1fr;
    }
    .word-list-modal {
        height: 90vh;
    }
}

/* 设置弹窗 v2 - 侧边栏布局 */
.settings-modal-v2 {
    width: 95%;
    max-width: 1000px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 85vh; /* 稍微增加高度 */
}

.modal-container {
    display: flex;
    flex: 1;
    min-height: 0; /* 允许子元素滚动 */
    background: #141414;
}

.sidebar-brand {
    padding: 12px 16px 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-brand .logo {
    font-size: 1.8rem;
    filter: drop-shadow(0 4px 6px rgba(24, 24, 27, 0.3));
}

.brand-text h3 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    opacity: 0.7;
}

.modal-sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-right: none;
}

.modal-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #141414;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 移动端适配 */
/* 语音源选择器 */
.voice-source-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.voice-source-option {
    cursor: pointer;
}

.voice-source-option input[type="radio"] {
    display: none;
}

.voice-source-option .option-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* 卡片选中状态 */
.voice-source-option input[type="radio"]:checked + .option-card {
    border-color: #6c5ce7;
    background: rgba(40, 40, 70, 0.9);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.voice-source-option input[type="radio"]:checked + .option-card::before {
    transform: scaleX(1);
}

.option-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.option-label {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.option-desc {
    font-size: 14px;
    color: #a0a0d0;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-rating {
    color: #f9c74f;
    margin-bottom: 15px;
    font-size: 14px;
    margin-top: auto;
}

/* 标签容器 */
.badge-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.voice-option-badge {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.btn-trial {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.3s ease;
}

.voice-source-option input[type="radio"]:checked + .option-card .option-label {
    color: var(--primary-color);
}

/* 发音人选择触发器 */
.voice-select-trigger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-select-trigger:hover {
    border-color: #6c5ce7;
    background: rgba(40, 40, 70, 0.9);
}

.voice-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.voice-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.voice-lang-tag {
    display: inline-block;
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    align-self: flex-start;
}

/* 词书选择弹窗专用样式 */
.book-picker-modal {
    max-width: 600px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.book-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.book-option.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05), 0 8px 16px rgba(0, 0, 0, 0.4);
}

.book-option .b-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.book-option .b-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.book-option.active .b-name {
    color: var(--primary-color);
}

@media (max-width: 640px) {
    .book-grid {
        grid-template-columns: 1fr;
    }
}

/* 发音人选择弹窗专用样式 */
.picker-overlay {
    z-index: 3000; /* 高于设置弹窗 */
}

.voice-picker-modal {
    max-width: 600px;
    height: 70vh;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.voice-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.voice-option.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05), 0 8px 16px rgba(0, 0, 0, 0.4);
}

.voice-option .v-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.voice-option .v-lang {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.voice-option.active .v-name {
    color: var(--primary-color);
}

@media (max-width: 640px) {
    .voice-grid {
        grid-template-columns: 1fr;
    }
    .settings-modal-v2 {
        height: 90vh;
    }
    
    .modal-container {
        flex-direction: column;
    }
    
    .modal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e4e4e7;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
    
    .sidebar-item {
        padding: 8px 16px;
        white-space: nowrap;
        border-right: none !important;
        border-bottom: 2px solid transparent;
        width: auto;
    }
    
    .sidebar-item.active {
        border-bottom-color: var(--primary-color);
    }

    .modal-main {
        padding: 20px;
    }
    
    .settings-grid {
        gap: 16px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 12px 20px;
        display: flex;
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn-confirm {
        width: 100%;
    }
}
