/* ========== Pagination Styles ========== */
.pagination-container {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
margin-top: 2rem;
padding: 1.5rem;
background: var(--gradient-card);
border-radius: var(--radius-xl);
border: 1px solid var(--border-light);
}
.pagination-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.625rem 1rem;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
color: var(--text-primary);
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
}
.pagination-btn:hover:not(:disabled) {
background: var(--gradient-primary);
color: white;
border-color: transparent;
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.pagination-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.pagination-info {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.625rem 1.25rem;
background: var(--bg-primary);
border-radius: var(--radius-md);
border: 1px solid var(--border-light);
font-weight: 600;
}
.current-page {
color: var(--primary-color);
font-size: 1.1rem;
}
.page-separator {
color: var(--text-tertiary);
}
.total-pages {
color: var(--text-secondary);
}
.page-numbers {
display: flex;
gap: 0.5rem;
align-items: center;
}
.page-number {
min-width: 2.5rem;
height: 2.5rem;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.75rem;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
color: var(--text-primary);
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
}
.page-number:hover {
background: var(--gradient-primary);
color: white;
border-color: transparent;
transform: scale(1.1);
}
.page-number.active {
background: var(--gradient-primary);
color: white;
border-color: transparent;
box-shadow: 0 4px 15px rgba(32, 128, 128, 0.3);
}
.page-ellipsis {
color: var(--text-tertiary);
padding: 0 0.5rem;
}
/* ========== Settings Panel ========== */
.settings-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
z-index: 999;
opacity: 0;
transition: opacity 0.3s ease;
}
.settings-overlay.active {
display: block;
opacity: 1;
}
.settings-panel {
position: fixed;
top: 0;
right: -400px;
width: 400px;
height: 100vh;
background: var(--bg-primary);
box-shadow: var(--shadow-xl);
z-index: 1000;
transition: right 0.3s ease;
overflow-y: auto;
}
.settings-panel.active {
right: 0;
}
.settings-content {
padding: 1.5rem;
}
.settings-section {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.setting-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 1.25rem;
background: var(--gradient-card);
border: 1px solid var(--border-light);
border-radius: var(--radius-lg);
transition: all 0.3s ease;
}
.setting-item:hover {
border-color: var(--primary-color);
box-shadow: var(--shadow-md);
}
.setting-info h4 {
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 0.25rem;
}
.setting-info p {
font-size: 0.875rem;
color: var(--text-secondary);
margin: 0;
}
.settings-select {
padding: 0.625rem 1rem;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
color: var(--text-primary);
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
}
.settings-select:hover {
border-color: var(--primary-color);
}
/* Toggle Switch */
.toggle-switch {
position: relative;
display: inline-block;
width: 52px;
height: 28px;
flex-shrink: 0;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--bg-secondary);
border: 2px solid var(--border-color);
transition: all 0.3s ease;
border-radius: 34px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 2px;
bottom: 2px;
background-color: white;
transition: all 0.3s ease;
border-radius: 50%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
background: var(--gradient-primary);
border-color: transparent;
}
.toggle-switch input:checked + .toggle-slider:before {
transform: translateX(24px);
}
.toggle-switch input:focus + .toggle-slider {
box-shadow: 0 0 0 3px rgba(32, 128, 128, 0.2);
}
/* ========== Header Hide on Scroll ========== */
.header.header-hidden {
transform: translateY(-100%);
transition: transform 0.3s ease;
}
.header.header-visible {
transform: translateY(0);
transition: transform 0.3s ease;
}
/* Mobile Responsive for Pagination and Settings */
@media (max-width: 768px) {
.pagination-container {
flex-wrap: wrap;
padding: 1rem;
}
.pagination-btn span {
display: none;
}
.page-numbers {
order: -1;
width: 100%;
justify-content: center;
margin-bottom: 0.75rem;
}
.settings-panel {
width: 100%;
right: -100%;
}
.settings-content {
padding: 1rem;
}
}
/* ========== Radical Search Results Styling ========== */
.radical-search-results {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
}
.radical-search-results .result-item {
display: flex;
align-items: flex-start;
gap: 1rem;
padding: 1rem;
}
.radical-search-results .char-display {
font-size: 2.5rem !important;
min-width: 3.5rem;
text-align: center;
line-height: 1;
flex-shrink: 0;
}
.radical-search-results .char-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
min-width: 0;
}
.radical-search-results .char-readings {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
align-items: center;
}
.radical-search-results .reading-badge {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-weight: 600;
}
.radical-search-results .reading-badge.py {
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: white;
}
.radical-search-results .reading-badge.hv {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
}
.radical-search-results .char-meaning {
font-size: 0.875rem;
color: var(--text-secondary);
line-height: 1.5;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
/* Meaning badges for {hanviet} and [chinese] in preview */
.meaning-badge {
display: inline;
padding: 0.1rem 0.35rem;
border-radius: 3px;
font-size: 0.8em;
font-weight: 500;
margin: 0 0.1rem;
}
.meaning-badge.hv {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
}
.meaning-badge.zh {
background: linear-gradient(135deg, #208080, #1a6666);
color: white;
}
.radical-search-results .char-strokes {
font-size: 0.75rem;
color: var(--text-tertiary);
font-weight: 500;
}
.radical-search-results .hsk-badge {
font-size: 0.7rem;
padding: 0.2rem 0.4rem;
border-radius: 3px;
font-weight: 700;
background: var(--gradient-accent);
color: white;
}
/* HSK Level colors */
.hsk-badge.hsk-1, .hsk-badge.hsk-2 {
background: linear-gradient(135deg, #10b981, #059669);
}
.hsk-badge.hsk-3, .hsk-badge.hsk-4 {
background: linear-gradient(135deg, #f59e0b, #d97706);
}
.hsk-badge.hsk-5, .hsk-badge.hsk-6 {
background: linear-gradient(135deg, #ef4444, #dc2626);
}
.hsk-badge.hsk-7, .hsk-badge.hsk-8, .hsk-badge.hsk-9 {
background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
@media (max-width: 768px) {
.radical-search-results {
grid-template-columns: 1fr;
}
.radical-search-results .char-display {
font-size: 2rem !important;
min-width: 3rem;
}
}
/* ============== Service Worker Update Banner ============== */
.sw-update-banner {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100000;
transform: translateY(-100%);
transition: transform 0.3s ease-out;
}
.sw-update-banner.show {
transform: translateY(0);
}
.sw-update-content {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
padding: 12px 20px;
background: linear-gradient(135deg, #208080, #8b5cf6);
color: white;
font-size: 14px;
box-shadow: 0 4px 20px rgba(32, 128, 128, 0.4);
}
.sw-update-icon {
font-size: 20px;
animation: spin 2s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.sw-update-text {
font-weight: 500;
}
.sw-update-btn {
padding: 8px 16px;
background: white;
color: #208080;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.sw-update-btn:hover {
background: #f0f4ff;
transform: scale(1.05);
}
.sw-update-close {
padding: 4px 8px;
background: transparent;
color: white;
border: none;
font-size: 20px;
cursor: pointer;
opacity: 0.7;
transition: opacity 0.2s;
}
.sw-update-close:hover {
opacity: 1;
}
/* Dark mode */
[data-theme="dark"] .sw-update-content {
background: linear-gradient(135deg, #1a6666, #7c3aed);
}
/* Mobile responsive */
@media (max-width: 600px) {
.sw-update-content {
flex-wrap: wrap;
text-align: center;
padding: 10px 15px;
gap: 8px;
}
.sw-update-text {
width: 100%;
font-size: 13px;
}
.sw-update-btn {
padding: 6px 12px;
font-size: 13px;
}
}
/* ============================================
CVDICT / Free CV Format Styles
============================================ */
.cvdict-format {
line-height: 1.6;
}
.cvdict-format .meaning-list {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0.25rem;
}
.cvdict-format .meaning-item {
color: #333;
}
.cvdict-format .meaning-sep {
color: #999;
margin: 0 0.15rem;
}
.cvdict-format .meaning-ref {
color: #666;
font-style: italic;
margin-left: 0.5rem;
}
.cvdict-format .ref-link {
color: var(--primary-color, #4a90a4);
cursor: pointer;
text-decoration: underline;
}
.cvdict-format .ref-link:hover {
color: var(--primary-hover, #357082);
}
.cvdict-format .idiom-tag {
font-size: 0.85em;
color: #8b5cf6;
background: rgba(139, 92, 246, 0.1);
padding: 0 0.25rem;
border-radius: 3px;
}
.cvdict-format .region-tag {
font-size: 0.85em;
color: #059669;
}
.cvdict-format .meaning-single {
display: block;
}
/* Word class badges */
.word-class-badge {
display: inline-block;
font-size: 0.75em;
padding: 0.1rem 0.3rem;
margin-left: 0.5rem;
background: linear-gradient(135deg, #f97316, #fb923c);
color: white;
border-radius: 3px;
font-weight: 500;
}
/* Meaning examples */
.meaning-examples {
margin-top: 0.5rem;
padding-left: 1rem;
border-left: 2px solid #e5e7eb;
}
.example-pair {
margin: 0.25rem 0;
}
.example-pair .ex-zh {
color: #1f2937;
font-weight: 500;
}
.example-pair .ex-vi {
color: #6b7280;
font-style: italic;
margin-left: 0.5rem;
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
.cvdict-format .meaning-item {
color: #e5e7eb;
}
.cvdict-format .meaning-sep {
color: #6b7280;
}
.cvdict-format .meaning-ref {
color: #9ca3af;
}
.example-pair .ex-zh {
color: #f3f4f6;
}
.example-pair .ex-vi {
color: #9ca3af;
}
}
/* ============ English meanings with examples (en-meaning) - Chinese-English Tab ============ */
.meaning-item.en-meaning {
padding: 0.5rem 0;
margin: 0;
background: transparent;
border: none;
border-radius: 0;
font-size: 0.95rem;
line-height: 1.6;
border-bottom: 1px solid rgba(0,0,0,0.05);
}
.meaning-item.en-meaning:last-child {
border-bottom: none;
}
/* Main meaning line */
.meaning-item.en-meaning .en-main-meaning {
font-weight: 500;
color: #1e293b;
}
/* Example sentence as sub-line */
.meaning-item.en-meaning .en-example {
margin-top: 0.25rem;
padding-left: 1rem;
font-size: 0.875rem;
color: #64748b;
font-style: italic;
border-left: 2px solid #e2e8f0;
}
/* Pinyin markers in examples */
.meaning-item.en-meaning .pinyin-example {
color: #94a3b8;
font-size: 0.85rem;
}
[data-theme="dark"] .meaning-item.en-meaning {
background: transparent;
border-bottom-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .meaning-item.en-meaning .en-main-meaning {
color: #e2e8f0;
}
[data-theme="dark"] .meaning-item.en-meaning .en-example {
color: #94a3b8;
border-left-color: #475569;
}
/* ============== Dialect Section Styles ============== */
.dialect-section {
margin-top: 1.5rem;
}
.dialect-section h4 {
font-size: 1.1rem;
color: var(--text-primary);
margin-bottom: 1rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.dialect-group {
margin-bottom: 1.25rem;
padding: 1rem;
background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(59, 130, 246, 0.05) 100%);
border-radius: var(--radius-lg);
border: 1px solid rgba(59, 130, 246, 0.15);
}
.dialect-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.75rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--border-color);
}
.dialect-name {
font-weight: 600;
color: var(--text-primary);
font-size: 0.95rem;
}
.dialect-content {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.dialect-reading-item {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: 0.5rem;
padding: 0.75rem 1rem;
background: var(--bg-primary);
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
}
.dialect-romanization {
font-size: 1.1rem;
font-weight: 600;
color: var(--primary-color);
min-width: 60px;
}
.dialect-variant {
font-size: 0.75rem;
padding: 0.15rem 0.4rem;
background: rgba(234, 179, 8, 0.15);
color: #d97706;
border-radius: var(--radius-sm);
font-weight: 500;
}
.dialect-type {
font-size: 0.7rem;
padding: 0.1rem 0.35rem;
background: rgba(107, 114, 128, 0.15);
color: var(--text-muted);
border-radius: var(--radius-sm);
}
.dialect-definition {
flex: 1;
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.5;
padding-left: 0.5rem;
border-left: 2px solid rgba(59, 130, 246, 0.3);
}
.dialect-source {
font-size: 0.7rem;
color: var(--text-muted);
padding: 0.15rem 0.4rem;
background: rgba(139, 92, 246, 0.1);
border-radius: var(--radius-sm);
}
.dialect-readings-summary {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 0.75rem;
}
.dialect-reading-tag {
padding: 0.25rem 0.6rem;
background: rgba(59, 130, 246, 0.1);
color: #3b82f6;
border-radius: var(--radius-md);
font-size: 0.9rem;
font-weight: 500;
}
/* Dialect by source expandable section */
.dialect-by-source {
margin-top: 0.75rem;
border-top: 1px dashed var(--border-color);
padding-top: 0.5rem;
}
.dialect-by-source .source-toggle {
cursor: pointer;
font-size: 0.85rem;
color: var(--text-muted);
padding: 0.35rem 0;
user-select: none;
}
.dialect-by-source .source-toggle:hover {
color: var(--text-primary);
}
.dialect-by-source .source-list {
display: none;
margin-top: 0.5rem;
}
.dialect-by-source.expanded .source-list {
display: block;
}
.dialect-by-source .source-item {
padding: 0.5rem;
margin-bottom: 0.5rem;
background: var(--bg-secondary);
border-radius: var(--radius-sm);
border-left: 3px solid var(--border-color);
}
.dialect-by-source .source-name {
font-size: 0.8rem;
font-weight: 600;
color: var(--text-muted);
margin-bottom: 0.35rem;
}
.dialect-by-source .source-readings {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.dialect-by-source .reading-entry {
display: inline-flex;
align-items: center;
gap: 0.3rem;
font-size: 0.85rem;
}
.dialect-by-source .reading-entry .jyutping {
font-weight: 500;
color: var(--text-primary);
}
.dialect-by-source .reading-entry .definition {
color: var(--text-muted);
font-size: 0.8rem;
}
.dialect-definitions {
margin-top: 0.5rem;
}
/* Minnan specific colors */
#minnanSection {
background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(16, 185, 129, 0.05) 100%);
border-color: rgba(16, 185, 129, 0.15);
}
#minnanSection .dialect-reading-tag {
background: rgba(16, 185, 129, 0.1);
color: #10b981;
}
#minnanSection .dialect-definition {
border-left-color: rgba(16, 185, 129, 0.3);
}
#minnanSection .dialect-by-source .source-item {
border-left-color: rgba(16, 185, 129, 0.4);
}
/* Cantonese specific colors */
#cantoneseSection {
background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(239, 68, 68, 0.05) 100%);
border-color: rgba(239, 68, 68, 0.15);
}
#cantoneseSection .dialect-reading-tag {
background: rgba(239, 68, 68, 0.1);
color: #ef4444;
}
#cantoneseSection .dialect-definition {
border-left-color: rgba(239, 68, 68, 0.3);
}
#cantoneseSection .dialect-by-source .source-item {
border-left-color: rgba(239, 68, 68, 0.4);
}
/* Dark theme adjustments */
[data-theme="dark"] .dialect-group {
background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(59, 130, 246, 0.08) 100%);
}
[data-theme="dark"] #minnanSection {
background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(16, 185, 129, 0.08) 100%);
}
[data-theme="dark"] #cantoneseSection {
background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(239, 68, 68, 0.08) 100%);
}
/* ============ BKTD Buddhist Category Tags ============ */
.bktd-category {
margin-bottom: 0.5rem;
}
.bktd-category .category-tag {
display: inline-block;
background: linear-gradient(135deg, #f0fdf4, #dcfce7);
color: #166534;
padding: 0.2rem 0.6rem;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 500;
border: 1px solid rgba(22, 101, 52, 0.2);
}
[data-theme="dark"] .bktd-category .category-tag {
background: linear-gradient(135deg, rgba(22, 101, 52, 0.2), rgba(34, 197, 94, 0.15));
color: #86efac;
border-color: rgba(134, 239, 172, 0.2);
}
/* ============ HV Layer System (古/準/現) ============ */
/* Force high specificity with !important for initial render */
div.hv-layer-section,
div#hvLayerSection {
margin: 1rem 0 !important;
padding: 1rem !important;
background: linear-gradient(135deg, #f8f9fa 0%, rgba(139, 92, 246, 0.12) 100%) !important;
border: 2px solid rgba(139, 92, 246, 0.3) !important;
border-radius: 12px !important;
}
div.hv-layer-section .section-title,
div#hvLayerSection .section-title,
div#hvLayerSection > h4 {
margin: 0 0 0.5rem 0 !important;
font-size: 1.1rem !important;
font-weight: 600 !important;
color: #8b5cf6 !important;
}
p.hv-layer-description,
div#hvLayerSection > p {
font-size: 0.85rem !important;
color: #64748b !important;
margin-bottom: 1rem !important;
line-height: 1.5 !important;
}
.hv-layers-grid {
display: grid !important;
grid-template-columns: repeat(3, 1fr) !important;
gap: 0.75rem !important;
}
.hv-layer-item {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
padding: 0.75rem !important;
background: var(--bg-primary);
border-radius: 6px;
border: 1px solid var(--border-color);
transition: all 0.2s ease;
}
.hv-layer-item.differs {
border-color: rgba(234, 179, 8, 0.4);
background: rgba(234, 179, 8, 0.05);
}
.hv-layer-label {
font-size: 0.7rem;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.hv-layer-label .layer-era {
font-size: 0.65rem;
opacity: 0.7;
}
.hv-layer-reading {
font-size: 1.2rem;
font-weight: 600;
color: var(--text-primary);
margin: 0.25rem 0;
}
.hv-layer-source {
font-size: 0.65rem;
color: var(--text-muted);
opacity: 0.8;
}
.hv-layer-item.hv-co {
border-left: 3px solid #8b5cf6;
}
.hv-layer-item.hv-chuan {
border-left: 3px solid #3b82f6;
}
.hv-layer-item.viet-hien-dai {
border-left: 3px solid #10b981;
}
.hv-layer-notes {
margin-top: 0.75rem;
padding: 0.5rem;
background: rgba(139, 92, 246, 0.1);
border-radius: 4px;
font-size: 0.8rem;
color: var(--text-secondary);
text-align: center;
}
/* Dark theme */
[data-theme="dark"] #hvLayerSection {
background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(139, 92, 246, 0.08) 100%);
}
[data-theme="dark"] .hv-layer-item {
background: rgba(30, 41, 59, 0.6);
}
[data-theme="dark"] .hv-layer-item.differs {
background: rgba(234, 179, 8, 0.1);
}
/* ============================================================
