* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a0633 0%, #3c1053 100%);
    color: #f0e6ff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景和遮罩 */
.jacaranda-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://sf7.oss-rg-china-mainland.aliyuncs.com/site/bg1.jpeg') no-repeat center center;
    background-size: cover;
    opacity: 1;
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(58, 12, 83, 0.1) 0%, rgba(26, 6, 51, 0.9) 100%);
    z-index: -1;
}

/* 顶部导航栏 */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(58, 12, 83, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(199, 125, 255, 0.3);
    z-index: 1001;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
}

/* navbar 顶部控制区域（第一行） */
.top-navbar > .navbar-controls,
.top-navbar > .navbar-nav {
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* menu-toggle 不需要 padding，保持正圆形 */
.top-navbar > .menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0aaff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    position: absolute;
    left: 20px;
}

.navbar-logo i {
    color: #c77dff;
    font-size: 1.4rem;
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 翻页为核心功能，始终可见 */
.pagination-controls {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.pagination-page-input {
    width: 2.8em;
    padding: 2px 6px;
    margin: 0 2px;
    border: 1px solid rgba(199, 125, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f0e6ff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pagination-page-input:focus {
    outline: none;
    border-color: #c77dff;
    box-shadow: 0 0 8px rgba(199, 125, 255, 0.35);
}

.pagination-page-input::-webkit-outer-spin-button,
.pagination-page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 搜索功能样式 */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 20px;
    padding: 8px 45px 8px 15px;
    color: #f0e6ff;
    font-size: 0.9rem;
    width: 140px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: #c77dff;
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
    /* 保持宽度不变，去掉 focus 后长度变化 */
}

.search-input::placeholder {
    color: rgba(240, 230, 255, 0.6);
}

.search-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #c77dff;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: rgba(199, 125, 255, 0.2);
    color: #e0aaff;
}

.search-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #c77dff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    /* 确保是正圆形，内容居中 */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0;
}

.search-toggle:hover {
    background: rgba(199, 125, 255, 0.2);
    color: #e0aaff;
    /* 确保hover时也是正圆形 */
    border-radius: 50%;
}

.search-toggle i {
    font-size: 1.1rem;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    position: absolute;
    right: 10px;
}

.nav-link {
    color: #d0b3ff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #fff;
    background: rgba(199, 125, 255, 0.2);
}

.nav-link.active {
    color: #fff;
    background: rgba(199, 125, 255, 0.3);
}

/* 侧边菜单 */
.menu-toggle {
    display: none;
    position: absolute;
    top: 5px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(199, 125, 255, 0.3);
    border: 1px solid rgba(199, 125, 255, 0.5);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    /* 确保是正圆形，移除可能影响形状的样式 */
    padding: 0;
    box-sizing: border-box;
}

.menu-toggle:hover {
    background: rgba(199, 125, 255, 0.5);
    /* 确保hover时也是正圆形 */
    border-radius: 50%;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 250px;
    height: 100vh;
    background: rgba(58, 12, 83, 0.98);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(199, 125, 255, 0.3);
    z-index: 2000;
    transition: right 0.3s ease;
    padding: 80px 20px 20px;
}

.side-menu.open {
    right: 0;
}

.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.side-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.side-nav-link {
    display: block;
    color: #d0b3ff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.side-nav-link:hover {
    color: #fff;
    background: rgba(199, 125, 255, 0.2);
}

.side-nav-link i {
    margin-right: 10px;
    width: 20px;
}

/* 学习统计控制面板（在navbar内部） */
.stats-panel {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 兼容旧的 control-panel 类名（已废弃，保留以兼容旧代码） */



.stats-container {
    background: rgba(70, 20, 100, 0.6);
    border-radius: 15px;
    padding: 0;
}

.stats-data-section {
    /* 统计数据显示区域 */
    display: block;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-display {
    background: rgba(157, 78, 221, 0.8);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.user-display:hover {
    background: rgba(157, 78, 221, 1);
    transform: translateY(-2px);
}

.user-display i {
    font-size: 14px;
    opacity: 0.8;
}

.user-display span {
    font-size: 14px;
}

.control-btn {
    background: linear-gradient(90deg, #9d4edd, #7b2cbf);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(157, 78, 221, 0.4);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(157, 78, 221, 0.6);
}

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(199, 125, 255, 0.3);
    border: 1px solid rgba(199, 125, 255, 0.5);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn i {
    color: #fff;
}

.icon-btn:hover {
    background: rgba(199, 125, 255, 0.5);
    transform: scale(1.1);
}

button.icon-btn {
    padding: 0;
    font: inherit;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}

a.icon-btn {
    text-decoration: none;
    flex-shrink: 0;
}

a.icon-btn,
a.icon-btn:visited,
a.icon-btn:hover {
    color: #fff;
}

a.icon-btn i {
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    font-size: 1rem;
}

.stat-item {
    background: linear-gradient(135deg, rgba(199, 125, 255, 0.15), rgba(157, 78, 221, 0.1));
    padding: 8px 4px;
    border-radius: 12px;
    border: 2px solid rgba(199, 125, 255, 0.3);
    color: #e0aaff;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(199, 125, 255, 0.2);
    min-width: 0;
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: rgba(199, 125, 255, 0.6);
    box-shadow: 0 10px 25px rgba(199, 125, 255, 0.4);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-label {
    font-size: 0.8rem;
    color: #d0b3ff;
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #c77dff;
    text-shadow: 0 2px 4px rgba(199, 125, 255, 0.3);
}

.stat-progress {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(45deg, #c77dff, #e0aaff, #9d4edd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 3px 6px rgba(199, 125, 255, 0.4);
}

.stat-completed {
    font-size: 1rem;
    font-weight: 700;
    color: #4CAF50;
    text-shadow: 0 2px 4px rgba(76, 175, 80, 0.4);
}

.stat-total-times {
    font-size: 1rem;
    font-weight: 700;
    color: #FF9800;
    text-shadow: 0 2px 4px rgba(255, 152, 0, 0.4);
}

@keyframes statPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes progressGlow {
    0%, 100% {
        text-shadow: 0 3px 6px rgba(199, 125, 255, 0.4);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 5px 15px rgba(199, 125, 255, 0.8);
        transform: scale(1.1);
    }
}

@keyframes completedBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes timesFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.achievement-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
    animation: badgeRotate 3s linear infinite;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.5);
}

@keyframes badgeRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}



/* 主要内容区域 */
.main-content {
    /* margin-top 由 JavaScript 动态设置，基于 navbar 的实际高度 */
    /* 设置默认最小 margin-top 作为后备，防止重叠 */
    margin-top: 80px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

/* .main-content.with-stats 的 margin-top 由 JavaScript 动态设置 */

.word-list-panel {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 220px;
}

.word-list-loading {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(20, 8, 35, 0.55);
    backdrop-filter: blur(2px);
    border-radius: 15px;
    color: #d0b3ff;
    font-size: 15px;
}

.word-list-loading.show {
    display: flex;
}

.word-list-loading i {
    font-size: 28px;
    animation: spin 1s linear infinite;
}

.word-list {
    display: grid;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.word-card {
    background: rgba(58, 12, 83, 0.2);
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 15px;
    padding-top: 0;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
    position: relative;
    z-index: 1;
}

/* 打开录音历史时抬高层级，避免被下一词卡片盖住导致闪烁 */
.word-card.recording-history-open {
    z-index: 40;
}

.word-card.has-floating-play .word-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding-left: 0;
    padding-top: 0;
}

.word-side-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
    position: relative;
    margin-top: 2px;
    z-index: 2;
}

.word-side-top-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.word-main-play-btn {
    position: static;
    opacity: 0.75;
    flex: 0 0 auto;
    margin-top: 0;
}

.word-record-btn {
    opacity: 0.7;
    flex: 0 0 auto;
}

.word-record-btn.recording {
    opacity: 1;
    background: rgba(220, 60, 70, 0.75);
    border-color: rgba(255, 120, 130, 0.7);
    animation: word-mic-pulse 1.1s ease-in-out infinite;
}

.word-record-btn.uploading {
    opacity: 0.5;
    cursor: wait;
}

@keyframes word-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 60, 70, 0.45); }
    50% { box-shadow: 0 0 0 8px rgba(220, 60, 70, 0); }
}

.word-recording-playback {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    position: relative;
}

.word-recording-score {
    min-width: 22px;
    padding: 2px 5px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(199, 125, 255, 0.35);
    text-align: center;
}

.word-recording-score.score-high {
    background: rgba(46, 160, 90, 0.55);
}

.word-recording-score.score-mid {
    background: rgba(210, 160, 50, 0.55);
}

.word-recording-score.score-low {
    background: rgba(200, 70, 70, 0.55);
}

.word-recording-score.vendor-microsoft {
    box-shadow: inset 0 0 0 1px rgba(0, 120, 212, 0.45);
}

.word-recording-score.vendor-tencent {
    box-shadow: inset 0 0 0 1px rgba(0, 82, 217, 0.25);
}

.word-recording-play-btn,
.word-recording-history-btn {
    opacity: 0.28;
    background: rgba(120, 120, 130, 0.28);
    border-color: rgba(140, 140, 150, 0.3);
    color: rgba(200, 200, 210, 0.55);
}

.word-recording-play-btn.has-recording,
.word-recording-history-btn.has-recording {
    opacity: 0.75;
    background: rgba(199, 125, 255, 0.3);
    border-color: rgba(199, 125, 255, 0.4);
    color: white;
}

.word-recording-play-btn.playing {
    opacity: 1;
    background: rgba(199, 125, 255, 0.55);
}

.word-recording-play-btn:disabled,
.word-recording-history-btn:disabled {
    cursor: default;
    pointer-events: none;
}

/* 无录音时保持灰色，不被卡片 hover/active 提亮 */
.word-card:hover .word-recording-play-btn:disabled,
.word-card:hover .word-recording-history-btn:disabled,
.word-card.active .word-recording-play-btn:disabled,
.word-card.active .word-recording-history-btn:disabled,
.word-card:hover .word-recording-play-btn:not(.has-recording),
.word-card:hover .word-recording-history-btn:not(.has-recording),
.word-card.active .word-recording-play-btn:not(.has-recording),
.word-card.active .word-recording-history-btn:not(.has-recording) {
    opacity: 0.28;
    background: rgba(120, 120, 130, 0.28);
    border-color: rgba(140, 140, 150, 0.3);
    color: rgba(200, 200, 210, 0.55);
    box-shadow: none;
}

.word-recording-history {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 520px;
    max-width: 92vw;
    max-height: min(380px, 70vh);
    overflow: auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(22, 6, 36, 0.98);
    border: 1px solid rgba(199, 125, 255, 0.45);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    z-index: 10050;
    pointer-events: auto;
    box-sizing: border-box;
}

.word-recording-history.open {
    display: block;
}

.word-recording-history-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    padding: 10px 12px;
}

.word-eval-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 8px;
    padding: 0 2px 6px;
    font-size: 0.72rem;
    color: rgba(220, 210, 235, 0.8);
    border-bottom: 1px solid rgba(199, 125, 255, 0.2);
}

.word-eval-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.word-eval-legend .dot.tone-good { background: #3ecf7a; }
.word-eval-legend .dot.tone-mid { background: #e0b33a; }
.word-eval-legend .dot.tone-bad { background: #e05555; }

.word-eval-legend .hint {
    margin-left: auto;
    color: rgba(180, 170, 200, 0.65);
}

.word-recording-history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
}

.word-recording-history-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 8px;
    text-align: center;
    font-weight: 600;
    color: rgba(220, 190, 255, 0.95);
    background: rgba(40, 12, 60, 0.98);
    border-bottom: 1px solid rgba(199, 125, 255, 0.35);
    white-space: nowrap;
}

.word-recording-history-table th:first-child,
.word-recording-history-table td.col-mark {
    text-align: left;
    width: 48px;
}

.word-recording-history-table th:nth-child(2),
.word-recording-history-table th:nth-child(3),
.word-recording-history-table th:nth-child(4),
.word-recording-history-table th:nth-child(5) {
    width: 56px;
}

.word-recording-history-table th:nth-child(6) {
    width: 56px;
}

.word-recording-history-table th:nth-child(7) {
    width: 96px;
}

.word-recording-history-table td {
    padding: 8px;
    text-align: center;
    border-bottom: none;
    vertical-align: middle;
}

.word-recording-history-table td.col-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e8d0ff;
    white-space: nowrap;
}

.word-recording-history-table td.col-score.unscored {
    font-weight: 500;
    color: rgba(180, 180, 190, 0.65);
}

.word-recording-history-table td.col-time {
    color: rgba(220, 210, 235, 0.75);
    white-space: nowrap;
}

.word-recording-detail-row td.col-detail {
    text-align: left;
    white-space: normal;
    padding: 6px 10px 14px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.18);
    background: rgba(0, 0, 0, 0.12);
}

.word-eval-detail-label {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 6px;
    font-size: 0.72rem;
    color: rgba(200, 180, 230, 0.7);
    vertical-align: middle;
}

.word-eval-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    vertical-align: middle;
}

.word-eval-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: 0.02em;
    cursor: help;
    border: 1px solid transparent;
    user-select: none;
}

.word-eval-chip.tone-good {
    color: #d8ffe8;
    background: rgba(46, 160, 90, 0.45);
    border-color: rgba(80, 200, 120, 0.55);
}

.word-eval-chip.tone-mid {
    color: #fff3d0;
    background: rgba(190, 140, 30, 0.42);
    border-color: rgba(220, 180, 60, 0.55);
}

.word-eval-chip.tone-bad {
    color: #ffd6d6;
    background: rgba(180, 50, 50, 0.5);
    border-color: rgba(230, 90, 90, 0.55);
}

.word-eval-chip.tone-none {
    color: rgba(180, 180, 190, 0.7);
    background: rgba(120, 120, 130, 0.25);
    font-weight: 500;
    cursor: default;
}

.word-recording-history-row,
.word-recording-detail-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.word-recording-history-row:hover,
.word-recording-history-row:hover + .word-recording-detail-row,
.word-recording-detail-row:hover {
    background: rgba(199, 125, 255, 0.14);
}

.word-recording-history-row:hover + .word-recording-detail-row td.col-detail,
.word-recording-detail-row:hover td.col-detail {
    background: rgba(199, 125, 255, 0.1);
}

.word-recording-history-row.selected {
    background: rgba(199, 125, 255, 0.28);
}

.word-recording-history-row.selected + .word-recording-detail-row,
.word-recording-detail-row.selected {
    background: rgba(199, 125, 255, 0.16);
}

.word-recording-history-row.selected + .word-recording-detail-row td.col-detail,
.word-recording-detail-row.selected td.col-detail {
    background: rgba(199, 125, 255, 0.12);
}

.word-recording-history-row.selected td.col-mark {
    color: #fff;
    font-weight: 600;
}

@media (max-width: 640px) {
    .word-recording-history {
        width: min(520px, 92vw);
        max-height: min(340px, 65vh);
    }

    .word-eval-legend .hint {
        margin-left: 0;
        width: 100%;
    }
}

.word-card.has-floating-play .word-content {
    flex: 1;
}

.word-card:hover {
    backdrop-filter: blur(18px);
    background: rgba(34, 6, 50, 0.62);
    border-color: rgba(199, 125, 255, 0.55);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}

.word-card:hover .action-btn {
    opacity: 0.8;
}


.word-card.active {
    backdrop-filter: blur(22px);
    background: rgba(28, 4, 44, 0.78);
    border-color: rgba(199, 125, 255, 0.75);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.word-card.active .action-btn {
    opacity: 0.8;
}

/* 图片展示区域 */
.word-images {
    margin-top: 5px;
    display: none; /* 默认隐藏 */
    overflow: visible;
}

.word-images.show {
    display: block;
}

.word-images-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-items: stretch;
    align-items: start;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: visible;
}

.word-images-container.single-image {
    grid-template-columns: minmax(0, 1fr);
    max-width: 500px;
}

.word-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 180px;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    background: rgba(20, 8, 32, 0.35);
    transition: box-shadow 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.word-image:hover {
    box-shadow: 0 4px 14px rgba(199, 125, 255, 0.35);
}

.word-image-video {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 80px;
    cursor: pointer;
}

.word-image-video-el {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    pointer-events: none;
    background: rgba(8, 4, 16, 0.55);
}

.word-image-video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.word-image-video-play .fa-play {
    margin-left: 3px;
}

.word-image-video.is-playing .word-image-video-play {
    display: none;
}

.word-image-video.is-broken {
    display: none;
}

.word-image.loading {
    background: rgba(199, 125, 255, 0.1);
    display: block;
    min-height: 80px;
    color: #c77dff;
    font-size: 12px;
}

.word-image.error {
    background: rgba(255, 0, 0, 0.1);
    display: block;
    min-height: 80px;
    color: #ff6b6b;
    font-size: 12px;
}

/* imgs 存 {{emoji}} 时的内联展示：移动端 50px，PC 100px */
.word-image-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    min-height: 50px;
    max-height: 56px;
    font-size: 50px;
    line-height: 1;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: default;
    user-select: none;
    box-shadow: none;
}
.word-image-emoji:hover {
    box-shadow: none;
}
@media (min-width: 769px) {
    .word-image-emoji {
        min-height: 100px;
        max-height: 110px;
        font-size: 100px;
    }
}

.word-header {
    display: flex;
    align-items: flex-start;
    text-align: left;
    gap: 15px;
    margin-bottom: 15px;
}

.action-btn {
    background: rgba(199, 125, 255, 0.3);
    border: 1px solid rgba(199, 125, 255, 0.4);
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.4;
}

.action-btn:hover {
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    color: white;
    box-shadow: 0 3px 10px rgba(199, 125, 255, 0.4);
    opacity: 1;
    border: none;
}

.word-content {
    flex: 1;
    text-align: left;
}

.word-field-wrap {
    position: relative;
}

.word-field-reveal-btn {
    display: none !important;
}

.word-reveal-all-btn {
    display: none !important;
}

body.word-feed-mode .word-reveal-all-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(199, 125, 255, 0.22);
    color: #e0aaff;
    cursor: pointer;
    font-size: 1.15rem;
    margin: 6px 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

body.word-feed-mode .word-reveal-all-btn:hover,
body.word-feed-mode .word-reveal-all-btn:focus-visible {
    opacity: 1;
    background: rgba(199, 125, 255, 0.4);
    color: #fff;
    outline: none;
}

body.word-feed-mode .word-reveal-all-btn[hidden] {
    display: none !important;
}

.word-english {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e0aaff;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.word-phonetic {
    font-size: 1.2rem;
    color: #b8a9ff;
    font-style: italic;
    margin-bottom: 3px;
    line-height: 1.2;
    font-weight: 500;
}

.word-chinese {
    font-size: 1.0rem;
    color: #d0b3ff;
    line-height: 1.2;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.word-chinese-text {
    flex: 1 1 auto;
    min-width: 0;
}

body:not(.word-feed-mode) .word-native-play-btn {
    display: none !important;
}

.word-native-play-btn {
    flex: 0 0 auto;
    margin-top: 0;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.42);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.word-native-play-btn:hover,
.word-native-play-btn:focus-visible {
    background: rgba(192, 132, 252, 0.72);
    color: #fff;
    outline: none;
}

.word-detail {
    font-size: 0.88rem;
    color: #c9b8ff;
    line-height: 1.55;
    margin-top: 8px;
    opacity: 0.95;
    font-style: normal;
    word-break: break-word;
}

.word-detail h1,
.word-detail h2,
.word-detail h3 {
    margin: 0.65em 0 0.35em;
    font-size: 0.95rem;
    font-weight: 650;
    color: #e0d4ff;
    line-height: 1.35;
}

.word-detail h1:first-child,
.word-detail h2:first-child,
.word-detail h3:first-child,
.word-detail p:first-child,
.word-detail ol:first-child,
.word-detail ul:first-child {
    margin-top: 0;
}

.word-detail p {
    margin: 0.35em 0;
}

.word-detail ol,
.word-detail ul {
    margin: 0.35em 0 0.35em 1.25em;
    padding: 0;
}

.word-detail li {
    margin: 0.2em 0;
}

.word-detail li > p {
    margin: 0.15em 0;
}

.word-detail b,
.word-detail strong {
    color: #f0e8ff;
    font-weight: 650;
}

.word-detail i,
.word-detail em {
    color: #d4c4ff;
}

.word-detail hr {
    border: none;
    border-top: 1px solid rgba(199, 125, 255, 0.25);
    margin: 0.6em 0;
}

.word-associations {
    margin-top: 8px;
    padding-left: 1.25em;
    border-left: 2px solid rgba(199, 125, 255, 0.2);
}

.word-association-group {
    margin-top: 6px;
}

.word-association-group:first-child {
    margin-top: 0;
}

.word-association-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(184, 169, 255, 0.65);
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.word-association-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.word-association-item {
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(208, 179, 255, 0.75);
}

.word-association-eng {
    cursor: pointer;
    color: rgba(200, 180, 255, 0.85);
    text-decoration: underline;
    text-decoration-color: rgba(255, 214, 102, 0.35);
    text-underline-offset: 2px;
}

.word-association-eng:hover {
    color: #ffe066;
    text-decoration-color: rgba(255, 214, 102, 0.85);
}

.word-association-eng.loading {
    opacity: 0.55;
    pointer-events: none;
}

.word-association-zh {
    margin-left: 0.45em;
    color: rgba(176, 160, 220, 0.75);
    font-size: 0.74rem;
}

.word-actions {
    position: relative;
    margin-top: 6px;
}

.word-actions-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.word-numeric-id-wrap {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.word-numeric-id-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    opacity: 0.42;
    background: rgba(80, 90, 110, 0.25);
}

.word-numeric-id-btn i {
    font-size: 11px;
    color: #8b93a7;
}

.word-numeric-id-btn:hover:not(:disabled) {
    opacity: 0.75;
    background: rgba(199, 125, 255, 0.35);
}

.word-numeric-id-btn.revealed {
    opacity: 1;
    background: rgba(199, 125, 255, 0.4);
    box-shadow: 0 0 0 1px rgba(199, 125, 255, 0.45);
}

.word-numeric-id-btn.revealed i {
    color: #e0aaff;
}

.word-numeric-id {
    flex-shrink: 0;
    min-width: 2.5em;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(208, 179, 255, 0.75);
    letter-spacing: 0.02em;
    user-select: text;
}

.word-related-query-info .word-numeric-id {
    font-size: 0.8rem;
}

.word-actions-toggle {
    display: none;
    border: 1px solid rgba(199, 125, 255, 0.5);
    border-radius: 18px;
    background: rgba(58, 12, 83, 0.9);
    color: #e0aaff;
    padding: 6px 10px;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.action-label {
    display: none;
}

.word-related-search-btn {
    background: rgba(199, 125, 255, 0.3);
}

.word-related-search-btn:hover {
    background: rgba(199, 125, 255, 0.6);
}

.word-score-box {
    font-size: 0.8rem;
    border: 0;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 2px 2px 2px 2px;
    backdrop-filter: blur(2px);
}

.word-related-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.word-related-modal-content {
    width: min(980px, 96vw);
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(58, 12, 83, 0.96);
    border: 1px solid rgba(199, 125, 255, 0.35);
    border-radius: 16px;
}

.word-related-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.2);
    background: rgba(58, 12, 83, 0.98);
    border-radius: 16px 16px 0 0;
}

.word-related-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 16px;
}

/* 前进/后退导航 */
.word-related-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.word-related-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(199, 125, 255, 0.35);
    background: rgba(199, 125, 255, 0.18);
    color: #e0aaff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-related-nav-btn:hover:not(:disabled) {
    background: rgba(199, 125, 255, 0.5);
    color: #fff;
}

.word-related-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.word-related-modal-title {
    flex: 1;
    text-align: center;
    color: #e0aaff;
    font-size: 1.1rem;
    font-weight: 700;
}

.word-related-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(199, 125, 255, 0.35);
    color: #fff;
}

.word-related-section-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.word-related-section-title {
    margin: 0;
    color: #d0b3ff;
    font-size: 0.95rem;
}

.word-related-ai-sync-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(199, 125, 255, 0.45);
    border-radius: 6px;
    background: rgba(199, 125, 255, 0.15);
    color: #c77dff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-related-ai-sync-btn:hover:not(:disabled) {
    background: rgba(199, 125, 255, 0.35);
    color: #fff;
}

.word-related-ai-sync-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.word-related-ai-sync-btn.loading i {
    animation: word-related-sync-spin 0.8s linear infinite;
}

@keyframes word-related-sync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.word-related-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.word-related-row .related-play-btn {
    flex: 0 0 auto;
    margin-top: 2px;
}

.word-related-row .word-header {
    flex: 1;
    margin-bottom: 0;
    align-items: flex-start;
    text-align: left;
}

.word-related-row .word-content {
    width: 100%;
}

.word-related-row .word-english,
.word-related-row .word-phonetic,
.word-related-row .word-chinese {
    text-align: left;
}

/* 弹窗内操作按钮默认更可见（列表中默认更暗，仅 hover 显示，弹窗中提高可发现性） */
.word-related-modal .word-card .action-btn,
.word-related-modal .word-related-query-card .action-btn {
    opacity: 0.75;
}

.word-related-modal .word-card:hover .action-btn,
.word-related-modal .word-related-query-card:hover .action-btn {
    opacity: 1;
}

/* 弹窗内每条结果分隔，便于区分操作区 */
.word-related-modal .word-card {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.12);
}

.word-related-empty {
    color: #b8a9ff;
    opacity: 0.85;
    padding: 8px 2px;
}

/* 可逐词点击的英文单词：悬浮黄色下划线 */
.word-eng-token.clickable {
    cursor: pointer;
    transition: color 0.15s ease;
}

.word-eng-token.clickable:hover {
    color: #ffd60a;
    text-decoration: underline;
    text-decoration-color: #ffd60a;
    text-underline-offset: 3px;
}

.word-eng-token.loading {
    opacity: 0.6;
    cursor: progress;
}

/* 相关搜索弹窗：查询词卡片（词条 + 操作按钮） */
.word-related-query-card {
    margin: 4px 0 14px;
    padding: 8px 12px;
    background: rgba(199, 125, 255, 0.08);
    border: 1px solid rgba(199, 125, 255, 0.22);
    border-radius: 10px;
}

.word-related-query-card .word-related-query-info {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    flex: 1;
}

.word-related-query-card .word-related-row {
    margin-bottom: 8px;
}

.word-related-query-card .word-associations {
    margin: 0 0 8px;
}

.word-related-query-card .word-actions {
    margin-top: 0;
}

.word-related-query-card .word-actions-content {
    flex-wrap: wrap;
    gap: 10px;
}

/* 相关搜索弹窗：查询词音标 + 发音 */
.word-related-query-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 14px;
    padding: 8px 12px;
    background: rgba(199, 125, 255, 0.12);
    border: 1px solid rgba(199, 125, 255, 0.25);
    border-radius: 10px;
}

.word-related-query-eng {
    color: #e8d5ff;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.word-related-query-eng .word-eng-token.clickable {
    text-decoration: underline;
    text-decoration-color: rgba(255, 214, 102, 0.45);
    text-underline-offset: 2px;
}

.word-related-query-phonetic {
    color: #b8a9ff;
    font-style: italic;
    font-size: 1.1rem;
    font-weight: 500;
}

.word-related-query-play {
    flex: 0 0 auto;
}

.word-related-query-zh-row {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.word-related-query-zh {
    color: #d0b3ff;
    font-size: 1rem;
    line-height: 1.3;
}

.word-score-box i {
    margin-right: 4px;
    opacity: 0.5;
}

.word-score-box span {
    font-weight: 600;
    color: #d0b3ff;
    opacity: 0.7;
}

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(199, 125, 255, 0.3);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(199, 125, 255, 0.6);
}

.collect-btn {
    opacity: 0.45;
}

.collect-btn.collected {
    opacity: 1;
}

.collect-btn i {
    color: #c77dff;
    font-size: 18px;
}

.collect-btn.collected i {
    color: #ffd700;
}

.freya-btn {
    opacity: 0.38;
    background: rgba(80, 90, 110, 0.25);
}

.freya-btn i {
    color: #8b93a7;
    font-size: 18px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.freya-btn.in-freya {
    opacity: 1;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.45), rgba(124, 108, 240, 0.5));
    box-shadow: 0 0 0 2px rgba(255, 107, 157, 0.75), 0 4px 12px rgba(255, 107, 157, 0.35);
}

.freya-btn.in-freya i {
    color: #ffe8f0;
    transform: scale(1.08);
    filter: drop-shadow(0 0 4px rgba(255, 180, 210, 0.9));
}

.freya-btn:hover:not(:disabled) {
    background: rgba(199, 125, 255, 0.45);
}

.freya-btn.in-freya:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 130, 175, 0.55), rgba(140, 120, 255, 0.55));
}

.pte-btn {
    opacity: 0.38;
    background: rgba(80, 90, 110, 0.25);
}

.dict-text-btn {
    width: auto;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 999px;
}

.dict-flag-label {
    color: #8b93a7;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.pte-btn .dict-flag-label {
    font-size: 9px;
    letter-spacing: 0.01em;
}

.pte-btn.in-pte {
    opacity: 1;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.45), rgba(14, 165, 233, 0.5));
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.75), 0 4px 12px rgba(14, 165, 233, 0.35);
}

.pte-btn.in-pte .dict-flag-label {
    color: #e0f7ff;
    transform: scale(1.06);
    filter: drop-shadow(0 0 3px rgba(125, 211, 252, 0.9));
}

.pte-btn:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.35);
}

.pte-btn.in-pte:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.55), rgba(14, 165, 233, 0.55));
}

.it-btn {
    opacity: 0.38;
    background: rgba(80, 90, 110, 0.25);
}

.it-btn .dict-flag-label {
    font-size: 11px;
    letter-spacing: 0.04em;
}

.it-btn.in-it {
    opacity: 1;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.45), rgba(234, 88, 12, 0.5));
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.75), 0 4px 12px rgba(234, 88, 12, 0.35);
}

.it-btn.in-it .dict-flag-label {
    color: #fff7ed;
    transform: scale(1.06);
    filter: drop-shadow(0 0 3px rgba(253, 186, 116, 0.9));
}

.it-btn:hover:not(:disabled) {
    background: rgba(251, 146, 60, 0.35);
}

.it-btn.in-it:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.55), rgba(234, 88, 12, 0.55));
}

.complete-btn {
    background: rgba(199, 125, 255, 0.3);
}

.complete-btn:hover {
    background: rgba(199, 125, 255, 0.3);
}

.delete-btn {
    background: rgba(199, 125, 255, 0.3);
}

.delete-btn:hover {
    background: rgba(199, 125, 255, 0.3);
}

.remove-btn {
    background: rgba(199, 125, 255, 0.3);
}

.remove-btn:hover {
    background: rgba(199, 125, 255, 0.6);
}

.add-btn {
    background: rgba(199, 125, 255, 0.3);
}

.add-btn:hover {
    background: rgba(199, 125, 255, 0.6);
}

/* 配置弹窗 */
.config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 2, 18, 0.72);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.config-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(62, 18, 92, 0.97) 0%, rgba(36, 10, 58, 0.98) 100%);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 0;
    max-width: 760px;
    width: min(92vw, 760px);
    max-height: min(88vh, 860px);
    overflow: hidden;
    border: 1px solid rgba(216, 180, 254, 0.22);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 18px 22px 12px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.18);
    flex-shrink: 0;
}

.config-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.config-save-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(74, 222, 128, 0.14);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    font-size: 0.78rem;
    font-weight: 600;
    color: #86efac;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(-4px);
}

.config-save-status i {
    color: #4ade80;
}

.config-save-status.show-save-status {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.config-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f3e8ff;
    letter-spacing: 0.02em;
}

.close-btn {
    background: rgba(199, 125, 255, 0.18);
    border: 1px solid rgba(216, 180, 254, 0.2);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #f3e8ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(199, 125, 255, 0.32);
}

.config-scheme-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding: 12px 22px 14px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.14);
    background: rgba(124, 58, 237, 0.08);
}

.config-scheme-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 7.5em;
}

.config-scheme-label {
    color: #f5e8ff;
    font-weight: 700;
    font-size: 0.92rem;
}

.config-scheme-hint {
    color: rgba(221, 198, 255, 0.7);
    font-size: 0.75rem;
}

.config-scheme-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 280px;
    min-width: 0;
}

.config-scheme-select {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
}

.config-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid rgba(216, 180, 254, 0.28);
    background: rgba(168, 85, 247, 0.32);
    color: #f8f0ff;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
}

.config-btn:hover {
    background: rgba(168, 85, 247, 0.48);
}

.config-btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    padding: 0 10px;
}

.config-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.config-btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(252, 165, 165, 0.4);
}

.config-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.config-btn-primary {
    background: linear-gradient(180deg, #c084fc, #a855f7);
    border-color: transparent;
    color: #fff;
}

.config-body {
    overflow-y: auto;
    padding: 16px 22px 22px;
    flex: 1 1 auto;
}

.config-section {
    margin-bottom: 18px;
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(199, 125, 255, 0.12);
}

.config-section-title {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #d8b4fe;
}

.config-block {
    margin-bottom: 12px;
}

.config-label {
    color: #d4b8ff;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 8px;
    display: block;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.config-category-row {
    margin-bottom: 8px;
    align-items: center;
}

.config-checkbox-inline {
    margin-right: 12px;
}

.config-combined-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
    margin-top: 6px;
}

.config-combined-label {
    margin-left: 6px;
    color: #d0b3ff;
    font-size: 0.86rem;
}

.config-combined-select {
    width: 64px;
    margin-left: 4px;
}

.config-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 12px;
    align-items: center;
}

.config-field {
    display: grid;
    grid-template-columns: 6.8em minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 12px;
}

.config-field > .config-label {
    margin: 0;
}

.config-field-control {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.config-value {
    min-width: 4.2em;
    text-align: right;
    color: #e9d5ff;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.config-slider {
    flex: 1;
    min-width: 80px;
    accent-color: #c084fc;
}

.config-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d0b3ff;
}

.config-chip-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.config-chip-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.config-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(157, 78, 221, 0.12);
    border: 1px solid rgba(199, 125, 255, 0.18);
    color: #edd9ff;
    cursor: pointer;
    font-size: 0.86rem;
    user-select: none;
}

.config-chip input {
    accent-color: #c084fc;
}

.config-chip:has(input:checked) {
    background: rgba(168, 85, 247, 0.28);
    border-color: rgba(233, 213, 255, 0.42);
    color: #fff;
}

.config-select {
    background: rgba(88, 28, 135, 0.72);
    color: white;
    border: 1px solid rgba(216, 180, 254, 0.22);
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.88rem;
}

.config-select:focus {
    outline: 2px solid rgba(192, 132, 252, 0.55);
    outline-offset: 1px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

#category_container .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#category_container .config-category-row {
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(157, 78, 221, 0.08);
    border: 1px solid rgba(199, 125, 255, 0.14);
}

#category_container .config-category-row:has(input:checked) {
    background: rgba(168, 85, 247, 0.18);
    border-color: rgba(233, 213, 255, 0.32);
}

#dict_container .checkbox-group:not(.dict-special-group) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

#dict_container .checkbox-group:not(.dict-special-group) .config-checkbox,
.dict-special-group > .config-checkbox {
    margin: 0;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(157, 78, 221, 0.12);
    border: 1px solid rgba(199, 125, 255, 0.18);
    color: #edd9ff;
}

#dict_container .checkbox-group:not(.dict-special-group) .config-checkbox:has(input:checked),
.dict-special-group > .config-checkbox:has(input:checked) {
    background: rgba(168, 85, 247, 0.28);
    border-color: rgba(233, 213, 255, 0.42);
    color: #fff;
}

#dict_container .checkbox-group:not(.dict-special-group) .config-checkbox:has(input:disabled) {
    opacity: 0.45;
}

.config-scheme-dialog {
    position: absolute;
    inset: 0;
    background: rgba(8, 2, 18, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3;
}

.config-scheme-dialog[hidden] {
    display: none !important;
}

.config-scheme-dialog-card {
    width: min(100%, 360px);
    background: #3b1460;
    border: 1px solid rgba(216, 180, 254, 0.28);
    border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.config-scheme-dialog-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f3e8ff;
    margin-bottom: 6px;
}

.config-scheme-dialog-text {
    margin: 0 0 12px;
    color: rgba(233, 213, 255, 0.75);
    font-size: 0.86rem;
    line-height: 1.45;
}

.config-scheme-name-input {
    width: 100%;
    height: 40px;
    border-radius: 9px;
    border: 1px solid rgba(216, 180, 254, 0.3);
    background: rgba(15, 4, 28, 0.45);
    color: #fff;
    padding: 0 12px;
    font-size: 0.92rem;
    margin-bottom: 14px;
}

.config-scheme-name-input:focus {
    outline: 2px solid rgba(192, 132, 252, 0.55);
}

.config-scheme-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.config-scheme-dialog.is-delete .config-btn-primary {
    background: linear-gradient(180deg, #f87171, #ef4444);
}

/* “我的收藏 / 最近学习”特殊单选组 */
.dict-special-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.18);
}

.dict-special-group .config-checkbox input[type="radio"] {
    accent-color: #c77dff;
}

.dict-recent-days {
    padding: 4px 10px;
    font-size: 0.85rem;
}

.dict-recent-days:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dict-level-filter-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.dict-level-filter-row .config-label {
    margin: 0;
    min-width: 4.5em;
}

.dict-range-sep {
    color: #9aa3a0;
    font-size: 0.85rem;
}

.dict-level-filter-row .config-select {
    min-width: 72px;
}

/* 特殊模式激活时，普通字典置灰提示 */
.config-checkbox input:disabled + span {
    opacity: 0.4;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #d0b3ff;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .top-navbar {
        flex-direction: column;
        padding: 8px 20px;
        gap: 10px;
    }

    .navbar-logo {
        position: static;
        margin-bottom: 5px;
    }

    .navbar-controls {
        gap: 15px;
    }

    /* .main-content 和 .main-content.with-stats 的 margin-top 由 JavaScript 动态设置 */
}

@media (max-width: 1024px) {
    .navbar-nav {
        display: none !important;
    }
    
    .top-navbar > .navbar-nav {
        display: none !important;
    }

    .navbar-controls {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 8px;
    }

    /* 平板/窄屏：翻页独占一行，避免被工具栏挤到屏幕外 */
    .pagination-controls {
        flex-basis: 100%;
        justify-content: center;
        margin-left: 0 !important;
    }

    .menu-toggle {
        display: flex !important;
    }
    
    .top-navbar > .menu-toggle {
        display: flex !important;
    }


    .stats-data-section {
        /* 统计数据显示区域 */
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .stat-item {
        padding: 5px 3px;
    }

    .stat-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .stat-value,
    .stat-progress,
    .stat-completed,
    .stat-total-times {
        font-size: 0.8rem;
    }

    .main-content {
        /* margin-top 由 JavaScript 动态设置 */
        padding: 15px;
    }

    /* .main-content.with-stats 的 margin-top 由 JavaScript 动态设置 */

    .word-header {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        margin-bottom: 0px;
    }

    .word-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .config-content {
        padding: 0;
        width: 100%;
        max-height: 92vh;
        border-radius: 16px;
    }

    .config-field,
    .config-field-grid {
        grid-template-columns: 1fr;
    }

    .config-chip-grid,
    .config-chip-grid-4,
    #dict_container .checkbox-group:not(.dict-special-group) {
        grid-template-columns: 1fr 1fr;
    }

    .config-scheme-controls {
        flex: 1 1 100%;
    }

    .config-scheme-select {
        flex: 1 1 auto;
    }

    .config-row {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .config-chip-grid,
    .config-chip-grid-4,
    #dict_container .checkbox-group:not(.dict-special-group) {
        grid-template-columns: 1fr;
    }

    .top-navbar {
        padding: 6px 15px;
        gap: 8px;
    }

    .navbar-logo {
        font-size: 1.1rem;
    }

    .navbar-logo i {
        font-size: 1.2rem;
    }

    .navbar-controls {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 小屏幕时隐藏搜索输入框，显示搜索按钮 */
    .search-input {
        display: none;
    }

    .search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-container.expanded .search-input {
        display: block;
        width: 110px;
    }

    .search-container.expanded .search-toggle {
        display: none;
    }

    .user-display {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .control-btn {
        padding: 4px 8px;
        font-size: 0.9rem;
    }

    .icon-btn {
        width: 28px;
        height: 28px;
    }

    /* .main-content 和 .main-content.with-stats 的 margin-top 由 JavaScript 动态设置 */
    .word-card {
        padding-bottom: 3px;
        padding-left: 5px;
        padding-right: 5px;
    }
    .word-list {
        gap: 5px;
    }
    .word-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .stat-item {
        padding: 3px 2px;
    }

    .stat-label {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .stat-value,
    .stat-progress,
    .stat-completed,
    .stat-total-times {
        font-size: 0.8rem;
    }

    .main-content {
        margin-top: 80px;
    }

    .main-content.with-stats {
        margin-top: 180px;
    }

    .word-english {
        font-size: 1.1rem;
    }
    .word-phonetic {
        font-size: 0.9rem;
    }

    .word-chinese {
        font-size: 0.9rem;
    }

    /* 小屏幕时限制单词图片尺寸（完整展示，不裁剪） */
    .word-image {
        max-height: 60px;
    }

    .word-image-video {
        min-height: 48px;
    }

    .word-image-video-play {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

}

@media (max-width: 768px) {
    .word-card.has-floating-play .word-header {
        flex-direction: row !important;
        align-items: flex-start;
        text-align: left;
    }

    .word-actions-content {
        display: none;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 8px;
        border-radius: 10px;
        border: 1px solid rgba(199, 125, 255, 0.25);
        background: rgba(35, 8, 53, 0.65);
    }

    .word-actions.expanded .word-actions-content {
        display: flex;
    }

    .word-actions-toggle {
        display: inline-flex;
        position: absolute;
        right: 8px;
        bottom: 8px;
        z-index: 1;
        opacity: 0.7;
        border: 0;
        border-radius: 8px;
        padding: 2px 6px;
        backdrop-filter: blur(2px);
    }

    .word-actions.expanded .action-btn {
        width: auto;
        min-height: 30px;
        border-radius: 16px;
        padding: 0 10px;
        opacity: 1;
        gap: 6px;
    }

    .word-actions.expanded .action-label {
        display: inline;
        font-size: 12px;
    }

    .word-related-row .word-header {
        flex-direction: row;
        text-align: left;
    }
}

/* 登录弹窗样式 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.login-modal.show {
    display: flex;
}

.login-content {
    background: rgba(58, 12, 83, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(199, 125, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: loginAppear 0.3s ease-out;
}

@keyframes loginAppear {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #e0aaff;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #d0b3ff;
    opacity: 0.8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-label {
    font-size: 14px;
    font-weight: 600;
    color: #d0b3ff;
}

.login-input {
    background: rgba(157, 78, 221, 0.2);
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    color: #f0e6ff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.login-input:focus {
    outline: none;
    border-color: rgba(199, 125, 255, 0.6);
    background: rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.2);
}

.login-input::placeholder {
    color: rgba(240, 230, 255, 0.5);
}

.login-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.login-btn {
    flex: 1;
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(199, 125, 255, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(199, 125, 255, 0.4);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-btn.secondary {
    background: rgba(157, 78, 221, 0.3);
    border: 1px solid rgba(199, 125, 255, 0.4);
}

.login-btn.secondary:hover {
    background: rgba(157, 78, 221, 0.5);
}

.login-error {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.login-error.show {
    display: block;
}

.login-loading {
    display: none;
    text-align: center;
    color: #d0b3ff;
    font-size: 14px;
}

.login-loading.show {
    display: block;
}

.login-loading i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 图片模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.image-modal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -30px;
    right: 0;
    background: rgba(199, 125, 255, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 添加图片模态框样式 */
.add-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.add-image-modal-content {
    background: rgba(58, 12, 83, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(199, 125, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.add-image-title {
    color: #e0aaff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
}

.add-image-tab-container {
    margin-bottom: 20px;
}

.add-image-tab-buttons {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(199, 125, 255, 0.3);
}

.add-image-tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #d0b3ff;
    border: 1px solid rgba(199, 125, 255, 0.3);
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-image-tab-btn.active {
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    color: white;
}

.add-image-tab-btn:first-child {
    margin-right: 5px;
}

.add-image-content-area {
    min-height: 200px;
}

.add-image-url-area {
    display: block;
}

.add-image-file-area {
    display: none;
}

.add-image-instruction {
    color: #d0b3ff;
    margin-bottom: 15px;
    font-size: 14px;
}

.add-image-instruction kbd {
    display: inline-block;
    padding: 2px 6px;
    margin: 0 2px;
    background: rgba(199, 125, 255, 0.3);
    border: 1px solid rgba(199, 125, 255, 0.5);
    border-radius: 4px;
    color: #e0aaff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.add-image-textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 10px;
    background: rgba(199, 125, 255, 0.1);
    color: #fff;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 20px;
}

.add-image-file-input {
    width: 100%;
    padding: 15px;
    border: 2px dashed rgba(199, 125, 255, 0.3);
    border-radius: 10px;
    background: rgba(199, 125, 255, 0.1);
    color: #fff;
    font-size: 14px;
    margin-bottom: 15px;
    cursor: pointer;
}

.add-image-preview-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.add-image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(199, 125, 255, 0.1);
    border: 1px solid rgba(199, 125, 255, 0.3);
}

.add-image-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.add-image-preview-filename {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-image-button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.add-image-submit-btn {
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-image-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #d0b3ff;
    border: 1px solid rgba(199, 125, 255, 0.3);
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* 动态样式类 */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex-visible {
    display: flex !important;
}

.inline-flex-visible {
    display: inline-flex !important;
}

.animated-glow {
    transition: all 0.2s ease;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.config-panel-visible {
    display: flex !important;
}

.config-panel-hidden {
    display: none !important;
}

.stats-panel-visible {
    display: block !important;
}

.stats-panel-hidden {
    display: none !important;
}

.images-container-visible {
    display: block !important;
}

.images-container-hidden {
    display: none !important;
}

.word-images-visible {
    display: block !important;
}

.word-images-hidden {
    display: none !important;
}

.search-exit-visible {
    display: inline-flex !important;
}

.search-exit-hidden {
    display: none !important;
}

/* 搜索结果分类筛选 */
.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 6px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 8;
    background: linear-gradient(180deg, rgba(18, 12, 28, 0.96) 0%, rgba(18, 12, 28, 0.88) 100%);
    border-bottom: 1px solid rgba(199, 125, 255, 0.18);
}

.search-filter-hidden {
    display: none !important;
}

.search-filter-btn {
    appearance: none;
    border: 1px solid rgba(199, 125, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    color: #d0b3ff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.search-filter-btn:hover {
    border-color: rgba(199, 125, 255, 0.55);
    background: rgba(199, 125, 255, 0.14);
    color: #e0aaff;
}

.search-filter-btn.active {
    border-color: rgba(199, 125, 255, 0.7);
    background: rgba(199, 125, 255, 0.28);
    color: #f0e6ff;
    box-shadow: 0 0 0 2px rgba(199, 125, 255, 0.12);
}

.search-filter-count {
    min-width: 1.2em;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    color: rgba(240, 230, 255, 0.85);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.search-filter-btn.active .search-filter-count {
    background: rgba(199, 125, 255, 0.35);
    color: #fff;
}

/* 个人中心菜单样式 */
.personal-center-menu {
    position: fixed;
    top: 60px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 200px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.personal-center-content {
    padding: 16px;
}

.personal-center-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
    color: #333;
    font-weight: 500;
}

.personal-center-user-info i {
    font-size: 18px;
    color: #007bff;
}

.personal-center-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.personal-center-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f4ff;
    color: #007bff;
    border: 1px solid #c8d9f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.personal-center-menu-link:hover {
    background: #e2ebff;
    border-color: #9bb8f0;
    color: #0056b3;
}

.personal-center-menu-link i {
    font-size: 14px;
}

.personal-center-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.personal-center-logout-btn:hover {
    background: #c82333;
}

.personal-center-logout-btn i {
    font-size: 14px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(58, 12, 83, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
}

/* 单词图片右键菜单样式 */
.word-image-context-menu {
    display: none !important;
    visibility: hidden;
    position: fixed !important;
    background: #ffffff !important;
    border: 1px solid #d9d9d9 !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    z-index: 10002 !important;
    min-width: 160px;
    padding: 4px 0;
    overflow: hidden;
}

.word-image-context-menu[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
}

.word-image-context-menu .menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.15s ease;
}

.word-image-context-menu .menu-item:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.word-image-context-menu .menu-item:first-child {
    border-radius: 4px 4px 0 0;
}

.word-image-context-menu .menu-item:last-child {
    border-radius: 0 0 4px 4px;
}

/* 编辑单词模态框样式 */
.edit-word-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.edit-word-modal.active {
    opacity: 1;
    visibility: visible;
}

.edit-word-modal-content {
    background: rgba(58, 12, 83, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(199, 125, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.edit-word-modal.active .edit-word-modal-content {
    transform: scale(1);
}

.edit-word-title {
    color: #e0aaff;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(199, 125, 255, 0.3);
    padding-bottom: 15px;
}

.edit-word-form-group {
    margin-bottom: 20px;
}

.edit-word-label {
    display: block;
    color: #d0b3ff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.edit-word-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 10px;
    background: rgba(199, 125, 255, 0.1);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.edit-word-input:focus {
    outline: none;
    border-color: #c77dff;
    background: rgba(199, 125, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.2);
}

.edit-word-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(199, 125, 255, 0.3);
    border-radius: 10px;
    background: rgba(199, 125, 255, 0.1);
    color: #fff;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.edit-word-textarea:focus {
    outline: none;
    border-color: #c77dff;
    background: rgba(199, 125, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.2);
}

.add-word-modal-content {
    max-width: 680px;
}

.add-word-category-hint {
    margin-top: 8px;
    color: #e0aaff;
    font-size: 13px;
    min-height: 1.2em;
}

.add-word-dict-hint {
    margin: 0 0 8px;
    color: #c9a6ef;
    font-size: 12px;
    font-weight: 400;
}

.add-word-dict-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 640px) {
    .add-word-dict-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.edit-word-button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(199, 125, 255, 0.3);
}

.edit-word-btn {
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
}

.edit-word-btn-save {
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    color: white;
}

.edit-word-btn-save:hover {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    box-shadow: 0 4px 15px rgba(199, 125, 255, 0.4);
    transform: translateY(-2px);
}

.edit-word-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #d0b3ff;
    border: 1px solid rgba(199, 125, 255, 0.3);
}

.edit-word-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(199, 125, 255, 0.5);
    transform: translateY(-2px);
}

.edit-btn {
    background: rgba(199, 125, 255, 0.3);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #c77dff, #9d4edd);
    color: white;
    box-shadow: 0 3px 10px rgba(199, 125, 255, 0.4);
    opacity: 1;
    border: none;
}

/* 通用飘屏提示 */
.app-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(18, 10, 54, 0.92);
    border: 1px solid rgba(199, 125, 255, 0.4);
    color: #f0ebff;
    font-size: 14px;
    line-height: 1.4;
    z-index: 10050;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    max-width: min(90vw, 420px);
    text-align: center;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.app-toast--success {
    border-color: rgba(114, 245, 198, 0.55);
    color: #d4ffe8;
}

.app-toast--error {
    border-color: rgba(255, 143, 163, 0.55);
    color: #ffe0e6;
}