body {
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    max-width: 980px;
    margin: 28px auto;
    padding: 0 18px;
    background: #f7fafc;
    color: #0f172a;
}

button {
    padding: 12px 20px;
    margin: 0 8px 12px 0;
    border: none;
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
    background: linear-gradient(135deg, #0066cc, #0052a3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

/* 主要按鈕樣式 */
button.primary {
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(10, 132, 255, 0.4);
}

button.primary:hover {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    box-shadow: 0 5px 20px rgba(10, 132, 255, 0.5);
}

/* 禁用按鈕樣式 */
button:disabled {
    background: #94a3b8 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

button:disabled:hover {
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

button:disabled::before {
    display: none;
}

button.secondary {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

button.secondary:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

button.danger {
    background: linear-gradient(135deg, #ff3b30, #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

button.danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

/* 按鈕容器樣式 */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.button-group button {
    margin: 0;
    flex: 0 0 auto;
}

/* 主控制區域樣式 */
.controls {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .button-group {
        gap: 8px;
    }

    .button-group button {
        padding: 10px 16px;
        font-size: 13px;
    }

    .controls {
        padding: 16px;
    }

    .slider {
        width: 180px;
        margin: 0 10px;
    }
}

.card {
    padding: 14px;
    border: 1px solid #e6eef6;
    margin-bottom: 12px;
    border-radius: 10px;
    position: relative;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.04);
    display: grid;
    /* index | word(revealed) | mark | meta */
    grid-template-columns: 44px 1fr 44px 160px;
    grid-template-rows: auto auto auto;
    gap: 8px 12px;
    align-items: center;
}

.card .index {
    grid-column: 1 / 2;
    text-align: right;
    color: #475569;
    font-weight: 700;
}

.word {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    font-weight: 700;
    font-size: 1.05rem;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.reveal-row {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    gap: 8px
}

.mark {
    grid-column: 3 / 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.masked {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    letter-spacing: 6px;
    color: #0f172a;
    /* show underline for unrevealed letters; we rely on the underscore character '_' so just ensure baseline alignment */
    font-variant-ligatures: none;
    white-space: pre;
}

.masked span.revealed {
    letter-spacing: normal;
    font-weight: 700;
    color: inherit;
}

/* per-character styling */
.masked .char {
    display: inline-block;
    min-width: 0.72em;
    text-align: center;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 1.05rem;
}

.masked .char.revealed {
    background: linear-gradient(90deg, rgba(10, 132, 255, 0.12), rgba(10, 132, 255, 0.06));
    color: #0a84ff;
    font-weight: 800;
    box-shadow: 0 1px 0 rgba(10, 132, 255, 0.08) inset;
    border-bottom: 3px solid rgba(10, 132, 255, 0.18);
}

.masked .char.hidden {
    background: rgba(2, 6, 23, 0.03);
    color: #64748b;
    border-bottom: 2px solid rgba(99, 102, 241, 0.35);
}

.masked .sp {
    display: inline-block;
    width: 6px;
}

.meta {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    justify-self: end;
    color: #64748b;
    font-size: 0.9rem
}

.hint {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    color: #059669;
    /* green */
    margin-top: 6px;
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.3;
}

.card input {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6eef6;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 1.05rem;
    line-height: 1.4;
}

.answer {
    /* show correct answer beside the revealed word on the same row */
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: start;
    align-self: center;
    font-weight: 700;
    color: inherit;
    margin-left: 8px;
    display: inline-block;
}

.result {
    padding: 10px;
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    margin-bottom: 12px;
    border-radius: 8px;
    /* make the result text larger and more prominent */
    font-size: 2rem;
    font-weight: 700;
}

.ok {
    color: #059669;
}

.nok {
    color: #dc2626;
}

.answer.correct {
    color: #0a84ff
}

.answer.wrong {
    color: #ff3b30
}

.mark.ok svg {
    stroke: #0a84ff
}

.mark.wrong svg {
    stroke: #ff3b30
}

.mark.ok svg path {
    stroke: #0a84ff !important
}

.mark.wrong svg path {
    stroke: #ff3b30 !important
}

ol {
    padding-left: 0;
    list-style: none
}

ol>li {
    margin-bottom: 12px
}

/* responsive: collapse right column on small screens */
@media (max-width: 700px) {
    .card {
        grid-template-columns: 40px 1fr 40px;
        grid-template-rows: auto auto auto;
    }

    .meta {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
        justify-self: start;
    }

    .answer {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        justify-self: start;
    }

    .mark {
        grid-column: 3 / 4
    }
}

/* small utility spacing - legacy */
.controls-old {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px
}

/* slider */
.slider {
    width: 220px;
    vertical-align: middle;
    margin: 0 15px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 24px;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -9px;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
    border: 3px solid #fff;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #0066cc, #0052a3);
    box-shadow: 0 6px 16px rgba(10, 132, 255, 0.5);
}

.slider::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(90deg, #e2e8f0, #cbd5e1);
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    box-shadow: 0 6px 16px rgba(10, 132, 255, 0.5);
}

.slider::-moz-range-track {
    height: 6px;
    background: linear-gradient(90deg, #e2e8f0, #cbd5e1);
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.muted {
    color: #64748b;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 8px;
    display: block;
}

.muted strong {
    color: #0f172a;
    font-weight: 700;
}

/* disabled input visual */
input[disabled] {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* global scrollbar styling (WebKit browsers) */
::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cfe8ff, #9fd0ff);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #9fd0ff transparent;
}

/* slightly enhance slider thumb focus */
.slider:focus {
    outline: none
}

.slider::-webkit-slider-thumb {
    box-shadow: 0 2px 6px rgba(10, 132, 255, 0.25)
}

.slider::-moz-range-thumb {
    box-shadow: 0 2px 6px rgba(10, 132, 255, 0.25)
}

/* History Modal Styles */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.history-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-width: 600px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e6eef6;
    padding-bottom: 16px;
}

.history-header h3 {
    margin: 0;
    color: #0f172a;
}

.history-header div {
    display: flex;
    gap: 8px;
}

.no-history {
    text-align: center;
    color: #64748b;
    padding: 40px;
    font-style: italic;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    border: 1px solid #e6eef6;
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.history-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.test-date {
    color: #64748b;
    font-size: 0.9rem;
}

.test-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0a84ff;
}

.history-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.question-results {
    display: grid;
    gap: 8px;
}

.question-result {
    display: grid;
    grid-template-columns: 40px 1fr 120px 150px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px;
    background: #ffffff;
    border-radius: 6px;
    font-size: 0.9rem;
}

.q-num {
    font-weight: 700;
    color: #64748b;
}

.q-word {
    font-weight: 600;
    color: #0f172a;
}

.q-user-answer {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.q-user-answer.correct {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.q-user-answer.wrong {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.q-correct-answer {
    color: #475569;
    font-style: italic;
}

.q-hint {
    color: #059669;
    font-size: 0.85rem;
}

@media (max-width: 800px) {
    .history-content {
        min-width: auto;
        margin: 20px;
    }

    .question-result {
        grid-template-columns: 1fr;
        gap: 4px;
        text-align: left;
    }
}

/* Chart Modal Styles */
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.chart-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-width: 800px;
    min-height: 500px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e6eef6;
    padding-bottom: 16px;
}

.chart-header h3 {
    margin: 0;
    color: #0f172a;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

#statsChart {
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 900px) {
    .chart-content {
        min-width: auto;
        margin: 20px;
        min-height: 400px;
    }

    .chart-container {
        height: 300px;
    }
}

/* Login Modal Styles */
.login-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: 1001;
}

.login-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    min-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-content h2 {
    margin: 0 0 24px 0;
    color: #0f172a;
    font-size: 1.8rem;
}

.login-content h3 {
    margin: 0 0 20px 0;
    color: #475569;
    font-size: 1.3rem;
}

.login-content form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.login-content input {
    padding: 12px 16px;
    border: 2px solid #e6eef6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-content input:focus {
    outline: none;
    border-color: #0a84ff;
}

.login-content button {
    padding: 12px 20px;
    background: #0a84ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-content button:hover {
    background: #0066cc;
}

.form-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.form-buttons button {
    flex: 1;
    max-width: 120px;
}

.clear-btn {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.clear-btn:hover {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.login-content p {
    margin: 0;
    color: #64748b;
}

.login-content a {
    color: #0a84ff;
    text-decoration: none;
    font-weight: 600;
}

.login-content a:hover {
    text-decoration: underline;
}

/* User Info Styles */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e6eef6;
}

.user-info span {
    font-weight: 600;
    color: #0f172a;
}

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

.admin-link {
    color: #0a84ff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border: 1px solid #0a84ff;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.admin-link:hover {
    background: #0a84ff;
    color: white;
}

@media (max-width: 500px) {
    .login-content {
        min-width: auto;
        margin: 20px;
        padding: 24px;
    }
}

/* Vocabulary Table Modal Styles */
.vocab-table-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.vocab-table-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    width: 66.67vw !important;
    max-width: none !important;
    min-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.vocab-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e6eef6;
    padding-bottom: 16px;
}

.vocab-table-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 600;
}

.vocab-stats {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stats-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.total-words {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

/* 難度級別頁籤樣式 */
.level-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.tab-button {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-button:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-button.active {
    color: #0a84ff;
    border-bottom-color: #0a84ff;
    background: #f0f9ff;
}

.tab-count {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.tab-button.active .tab-count {
    color: #60a5fa;
}

/* 不同級別的顏色標示 */
.tab-button[data-level="1"] {
    border-left: 4px solid #16a34a;
}

.tab-button[data-level="1"]:hover {
    background: #f0fdf4;
    color: #15803d;
}

.tab-button[data-level="1"].active {
    background: #dcfce7;
    color: #15803d;
    border-bottom-color: #16a34a;
}

.tab-button[data-level="2"] {
    border-left: 4px solid #2563eb;
}

.tab-button[data-level="2"]:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.tab-button[data-level="2"].active {
    background: #dbeafe;
    color: #1d4ed8;
    border-bottom-color: #2563eb;
}

.tab-button[data-level="3"] {
    border-left: 4px solid #d97706;
}

.tab-button[data-level="3"]:hover {
    background: #fffbeb;
    color: #c2410c;
}

.tab-button[data-level="3"].active {
    background: #fef3c7;
    color: #c2410c;
    border-bottom-color: #d97706;
}

.tab-button[data-level="4"] {
    border-left: 4px solid #ea580c;
}

.tab-button[data-level="4"]:hover {
    background: #fff7ed;
    color: #c2410c;
}

.tab-button[data-level="4"].active {
    background: #fed7aa;
    color: #c2410c;
    border-bottom-color: #ea580c;
}

.tab-button[data-level="5"] {
    border-left: 4px solid #dc2626;
}

.tab-button[data-level="5"]:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.tab-button[data-level="5"].active {
    background: #fecaca;
    color: #b91c1c;
    border-bottom-color: #dc2626;
}

.tab-button[data-level="6"] {
    border-left: 4px solid #78716c;
}

.tab-button[data-level="6"]:hover {
    background: #fafaf9;
    color: #57534e;
}

.tab-button[data-level="6"].active {
    background: #e7e5e4;
    color: #57534e;
    border-bottom-color: #78716c;
}

/* 活動狀態下的數量標籤顏色 */
.tab-button[data-level="1"].active .tab-count {
    color: #16a34a;
}

.tab-button[data-level="2"].active .tab-count {
    color: #2563eb;
}

.tab-button[data-level="3"].active .tab-count {
    color: #d97706;
}

.tab-button[data-level="4"].active .tab-count {
    color: #ea580c;
}

.tab-button[data-level="5"].active .tab-count {
    color: #dc2626;
}

.tab-button[data-level="6"].active .tab-count {
    color: #78716c;
}

/* 固定在頂部的頁籤樣式 */
.level-tabs-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.level-tabs-container {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    justify-content: center;
}

/* 調整模態視窗內容的上邊距，為固定頁籤留出空間 */
.vocab-table-modal .vocab-table-content {
    margin-top: 80px;
}

.level-distribution {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.level-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.level-badge.level-1 {
    background: #16a34a;
}

.level-badge.level-2 {
    background: #2563eb;
}

.level-badge.level-3 {
    background: #d97706;
}

.level-badge.level-4 {
    background: #ea580c;
}

.level-badge.level-5 {
    background: #dc2626;
}

.level-badge.level-6 {
    background: #78716c;
}

.vocab-table-container {
    overflow-x: auto;
}

.vocab-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
}

.vocab-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.vocab-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

/* 隔行變色效果 */
.vocab-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.vocab-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.vocab-table tr:hover {
    background: #e0f2fe !important;
    transition: background-color 0.2s ease;
}

.vocab-table .sequence {
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    width: 60px;
}

.vocab-table .word {
    font-weight: 600;
    color: #111827;
    min-width: 150px;
}

.vocab-table .pos {
    color: #6b7280;
    font-style: italic;
    width: 80px;
}

.vocab-table .zh {
    color: #374151;
}

/* 高亮顯示行的樣式 - 優先於隔行變色 */
.vocab-table tr.highlight-row {
    background: #fbbf24 !important;
    transition: background-color 0.3s ease;
}

.vocab-table tr.highlight-row td {
    background: transparent;
}

/* hover效果優先於所有其他背景色 */
.vocab-table tr:hover:not(.highlight-row) {
    background: #e0f2fe !important;
}

/* 頁籤的響應式設計 */
@media (max-width: 600px) {
    .level-tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* 固定頁籤在行動裝置上的調整 */
    .level-tabs-container {
        padding: 8px 16px;
        justify-content: flex-start;
    }

    .level-tabs-fixed .tab-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .vocab-table-modal .vocab-table-content {
        margin-top: 70px;
    }
}

@media (max-width: 400px) {
    .level-tabs-container {
        padding: 6px 12px;
    }

    .level-tabs-fixed .tab-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .tab-count {
        font-size: 10px;
    }

    .vocab-table-modal .vocab-table-content {
        margin-top: 65px;
    }
}

/* 讓級別標籤可點擊的視覺提示 */
.level-badge:hover {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 16px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 16px;
}

@media (min-width: 801px) {
    .vocab-table-content {
        width: 66.67vw !important;
        max-width: none !important;
        min-width: 400px !important;
    }
}

@media (max-width: 800px) {
    .vocab-table-content {
        min-width: auto;
        margin: 20px;
        padding: 16px;
        width: calc(100vw - 40px);
    }

    .vocab-table {
        font-size: 12px;
    }

    .vocab-table th,
    .vocab-table td {
        padding: 8px 12px;
    }
}