:root {
    --transition-duration: 0.3s;
    --color-bg: #ffffff;
    --color-text: #333333;
    --color-text-dark: #323233;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-shadow-hard: rgba(0, 0, 0, 0.2);
    --show-more-btn-background: #000409;
    --show-more-btn-text-color: #ffffff;
    --show-more-btn-hover-background: #5a5b5d;
    --show-more-btn-active-background: #000409;

    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --accent-color: #3b82f6;
    --text-muted: #64748b;
}

:root[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-text: #f8fafc;
    --color-text-dark: rgb(183, 183, 183);
    --color-shadow: rgba(0, 0, 0, 0.4);
    --show-more-btn-background: #f9f9fa;
    --show-more-btn-text-color: #040404;
    --show-more-btn-hover-background: #656566;
    --show-more-btn-active-background: #f9f9fa;

    --card-bg: #1e293b;
    --border-color: #334155;
    --accent-color: #60a5fa;
    --text-muted: #94a3b8;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 500;
    background-color: var(--color-bg);
    color: var(--color-text);
}

body.fonts-loaded {
    font-family: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

body.no-gsap .spin-btn:hover {
    transform: scale(1.05) rotate(3deg);
    transition: transform 0.2s ease;
}

.background-auto {
    background-color: var(--color-bg);
    color: #2d3748;
}

/* Background Animations */
.bg-gradient {
    width: 100%;
    height: 300px;
    background-size: 400% 400%;
    z-index: 0;
}

/* Background extension area - pushes content down */
#bg-extension {
    width: 100%;
    height: 0;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    position: relative;
    z-index: 999;
    background: #1a1a1a;
    pointer-events: none;
}

/* Bridge area - connects buttons to menu */
#bg-extension::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
}

#bg-extension.extended::before {
    pointer-events: none;
}

/* Ensure menu buttons can still receive clicks */
.read-menu-container,
.study-menu-container,
.titleButton {
    pointer-events: auto !important;
}

#bg-extension.extended {
    height: 280px;
    overflow: visible;
    pointer-events: none;
}

/* Menu Extension Content */
.menu-extension-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 40px;
    height: 100%;
    display: flex;
    gap: 50px;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    width: 100%;
    pointer-events: none;
}

#bg-extension.extended .menu-extension-content {
    opacity: 1;
    pointer-events: auto;
}

#bg-extension.extended .menu-extension-content {
    opacity: 1;
}

/* Menu Section */
.menu-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.menu-section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    width: 100%;
}

.menu-section-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.menu-section-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

/* Study Menu Section */
.study-menu-section {
    flex: 0 0 160px;
}

.menu-section-links {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Level Selection Section */
.level-menu-section {
    flex: 0 0 200px;
}

.level-menu-section .menu-section-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px 20px;
}

.level-option {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    padding: 0;
    border-radius: 0;
    transition: none;
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    line-height: 1.5;
}

.level-option:hover {
    background: transparent;
    color: #ffffff;
    transform: none;
}

.level-option.active {
    background: transparent;
    color: #ffffff;
    font-weight: 600;
}

.level-name {
    display: block;
}

/* Read Menu Section Grid */
.read-menu-section {
    flex: 1;
}

.menu-section-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.8fr 1fr 1fr;
    gap: 40px 100px;
    align-items: start;
    justify-items: start;
}

.menu-extension-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.menu-extension-column-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    text-align: left;
}

.menu-extension-links {
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: flex-start;
}

/* News and Explore columns use 2-column grid for links */
.menu-extension-column:first-child .menu-extension-links,
.menu-extension-column:nth-child(2) .menu-extension-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px 20px;
}

.menu-extension-item {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    padding: 0;
    border-radius: 0;
    transition: none;
    display: block;
}

.menu-extension-item:hover {
    background: transparent;
    color: #ffffff;
    transform: none;
}

.menu-extension-item>span:first-child {
    display: block;
}

.menu-extension-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    padding: 0;
    display: block;
}

.menu-extension-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

/* Hide original mega menus when extension is active */
#bg-extension.extended~.main-content .read-mega-menu,
#bg-extension.extended~.main-content .read-menu-items {
    display: none !important;
}

.bg-wave {
    max-height: 300px;
    height: 300px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.bg-wave-inner {
    position: absolute;
    inset: 0;
    width: 200%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    mix-blend-mode: overlay;
    will-change: transform;
}

/* Header & Nav */
#nav1 {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin: 0 auto;
    max-width: 1280px;
    z-index: 1000;
    position: relative;
}

.logo {
    width: 250px;
    display: flex;
    justify-content: center;
    transform: rotate(-4deg);
    cursor: pointer;
}

.logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.2));
}

.slogan {
    margin: 15px;
    font-size: clamp(18px, 6vw, 26px);
    color: white;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menu Styles */
.menu {
    width: 100%;
    max-width: 1000px !important;
    /* Increase width to accommodate dropdown */
    display: flex;
    justify-content: space-between !important;
    /* Push dropdown to right */
    align-items: baseline;
    gap: 20px;
    filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.2));
    position: relative;
    padding: 0 20px;
    /* Add side padding */
    box-sizing: border-box;
    margin: 0 auto;
}

/* Glassmorphism Button Styles - Liquid Wave Effect */
.menu .titleButton {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    gap: 10px;
    padding: 10px 20px;
    background: transparent;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* The Liquid Glass Layer */
.menu .titleButton::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85%;
    /* Initial water level */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: -1;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;

    /* Wave Mask */
    /* --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 Q100,0 200,30 T400,30 V60 H0 Z' fill='black'/%3E%3C/svg%3E"); */
    --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 Q100,10 200,30 T400,30 V60 H0 Z' fill='black'/%3E%3C/svg%3E");

    -webkit-mask: var(--wave) repeat-x;
    mask: var(--wave) repeat-x;
    -webkit-mask-size: 200% 100%;
    mask-size: 200% 100%;
    -webkit-mask-position: 0 bottom;
    mask-position: 0 bottom;

    animation: waveFlow 4s linear infinite;
}

/* Second subtle wave layer for depth (optional, keeping it simple for now) */

@keyframes waveFlow {
    0% {
        -webkit-mask-position: 0 bottom;
        mask-position: 0 bottom;
    }

    100% {
        -webkit-mask-position: -200% bottom;
        /* Move left by 200% width */
        mask-position: -200% bottom;
    }
}

.menu .titleButton:hover {
    transform: translateY(-5px);
}

.menu .titleButton:hover::before {
    height: 85%;
    /* Water level rises */
    background: rgba(255, 255, 255, 0.25);
    animation: waveFlow 4s linear infinite;
}

.menu a img {
    display: block;
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    /* Enhanced shadow for depth */
}

.menu-label {
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    z-index: 2;
}

/* Read Menu Dropdown - Glass Style */
.read-menu-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* 透明桥接层 - 覆盖按钮和菜单之间的间隙 */
.read-menu-container::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    pointer-events: auto;
}

/* Mega Menu Styles - 延伸自header的效果 */
.read-mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    display: grid;
    grid-template-columns: 200px 200px 150px minmax(160px, 1fr);
    gap: 0 40px;
    background: #fdfbf7;
    border-radius: 0 0 20px 20px;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 4px 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1001;
    max-width: calc(100vw - 40px);
    overflow: hidden;
}

/* CSS hover control - more reliable than JS */
.read-menu-container:hover .read-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Mega Menu Column */
.mega-menu-column {
    padding: 24px 18px;
    min-width: 200px;
}

/* Mega Menu Links Container */
.mega-menu-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 资讯和知识探索的链接分成两列 */
.mega-menu-column:nth-child(1) .mega-menu-links,
.mega-menu-column:nth-child(2) .mega-menu-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 32px;
}

/* Mega Menu Item */
.mega-menu-item {
    color: #475569;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    display: inline;
    width: fit-content;
    padding: 8px 0 8px 12px;
    line-height: 1.5;
}

.mega-menu-item:hover {
    color: #3b82f6;
    cursor: pointer;
}

/* Mega Menu Header */
.mega-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 12px 10px;
    margin-bottom: 10px;
}

.mega-menu-title {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.5px;
}

/* Mega Menu Links Container */
.mega-menu-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.mega-menu-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Mega Menu Complex Item (with image, title and description) */
.mega-menu-item-complex {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 8px 12px;
    border-radius: 8px;
    position: relative;
}

.mega-menu-complex-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    position: absolute;
    top: 8px;
    right: 10px;
}

.mega-menu-complex-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.mega-menu-complex-title {
    color: #475569;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    padding-right: 32px;
}

.mega-menu-complex-desc {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    pointer-events: none;
}

.mega-menu-complex-title:hover {
    color: #3b82f6;
}

.mega-menu-complex-desc {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    pointer-events: none;
}

/* Dark theme for complex item */
:root[data-theme="dark"] .mega-menu-complex-title {
    color: #94a3b8;
}

:root[data-theme="dark"] .mega-menu-complex-title:hover {
    color: #60a5fa;
}

:root[data-theme="dark"] .mega-menu-complex-desc {
    color: #64748b;
}

/* Open State - for JS fallback */
.read-menu-container.open .read-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Dark Theme Mega Menu Overrides */
:root[data-theme="dark"] .read-mega-menu {
    background: #1a1a1a;
    border-top-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Dark theme for mega menu header - no border */

:root[data-theme="dark"] .mega-menu-title {
    color: #f1f5f9;
}

:root[data-theme="dark"] .mega-menu-item {
    color: #94a3b8;
}

:root[data-theme="dark"] .mega-menu-item:hover {
    color: #60a5fa;
}

/* Responsive adjustments for mega menu */
@media (max-width: 1100px) {
    .read-mega-menu {
        min-width: 460px;
        grid-template-columns: repeat(2, 1fr);
    }

    .mega-menu-column:nth-child(2) {
        border-right: none;
    }

    .mega-menu-column:nth-child(1),
    .mega-menu-column:nth-child(2) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    :root[data-theme="dark"] .mega-menu-column:nth-child(1),
    :root[data-theme="dark"] .mega-menu-column:nth-child(2) {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
}

/* Legacy read-menu-items - 学习菜单,与header延伸效果一致 */
.read-menu-items {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fdfbf7;
    border-radius: 0 0 20px 20px;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1001;
}

/* CSS hover control */
.read-menu-container:hover .read-menu-items {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Open State - for JS fallback */
.read-menu-container.open .read-menu-items {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.read-item {
    display: block;
    padding: 12px 16px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    background: transparent;
    border-radius: 12px;
    margin-bottom: 4px;
    width: 100%;
    white-space: nowrap;
}

.read-item:last-child {
    margin-bottom: 0;
}

.read-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    transform: translateX(4px);
}

:root[data-theme="dark"] .read-menu-items {
    background: #1a1a1a;
    border-top-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .read-item {
    color: #94a3b8;
}

:root[data-theme="dark"] .read-item:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* Icon IDs & Buttons */
#flashcard,
#read,
#game,
#login {
    object-fit: contain;
    filter: drop-shadow(2px 2px 1px var(--color-shadow));
}

.titleButton {
    z-index: 1002;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    #nav1 {
        padding: 20px 16px;
    }

    .menu {
        gap: 10px;
        flex-wrap: wrap;
    }

    .menu-label {
        font-size: 14px;
    }

    .menu a img {
        height: 36px;
    }

    .slogan {
        font-size: 20px;
    }
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Dropdown Styling in Menu */
#dropdown {
    position: relative;
    z-index: 1001;
}

#dropdown .dropdown-toggle {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

#dropdown .dropdown-toggle .arrow {
    border-color: white;
    margin-left: 8px;
    margin-top: -2px;
}

#dropdown .dropdown-options {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    right: 0;
    left: auto;
    padding: 6px;
    margin-top: 10px;
    overflow: hidden;
    display: none;
    position: absolute;
    z-index: 1002;
    flex-direction: column;
}

#dropdown.open .dropdown-options {
    display: flex;
    animation: fadeIn 0.2s ease;
}

/* 移动端修复：确保下拉选项保持居中 */
@media (max-width: 768px) {
    #dropdown.open .dropdown-options {
        animation: fadeInMobile 0.2s ease;
    }
}

@keyframes fadeInMobile {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#dropdown .dropdown-group-title {
    color: #64748b;
    font-size: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 4px;
    font-weight: 600;
}

#dropdown .dropdown-option {
    color: #1e293b;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 10px;
    margin-bottom: 2px;
    cursor: pointer;
    text-align: left;
}

#dropdown .dropdown-option:last-child {
    margin-bottom: 0;
}

#dropdown .dropdown-option:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
    transform: translateX(4px);
}

/* Dark Theme Dropdown Overrides */
:root[data-theme="dark"] #dropdown .dropdown-options {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] #dropdown .dropdown-option {
    color: #f8fafc;
}

:root[data-theme="dark"] #dropdown .dropdown-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

:root[data-theme="dark"] #dropdown .dropdown-group-title {
    color: #94a3b8;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Header Right Top - Language Toggle & User Icon */
.header {
    position: relative;
}

.header-right-top {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1003;
}

.lang-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    align-self: flex-end;
}

.lang-toggle-btn:hover {
    color: rgba(255, 255, 255, 1);
}

.lang-toggle-btn .lang-code {
    display: block;
}

.lang-toggle-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1004;
}

.lang-toggle-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

.user-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    position: relative;
}

.user-icon-btn:hover {
    opacity: 1;
}

.user-icon-btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.user-icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1004;
}

.user-icon-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .menu {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
        align-items: center;
        /* 确保dropdown居中 */
    }

    .menu-left {
        justify-content: center;
        width: 100%;
    }

    #dropdown {
        margin-top: 10px;
        align-self: center;
        /* 确保dropdown本身居中 */
    }

    #dropdown .dropdown-options {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media (max-width: 900px) {
    .menu-left {
        display: none;
    }

    .menu {
        display: none !important;
    }

    .mobile-nav-container {
        display: flex !important;
    }

    .header-right-top {
        display: none;
    }

}

/* Main Content and Articles Grid Layout (Ported from pages/stories/styles.css) */
.main-content {
    padding: 2rem 0;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 2rem auto;
    width: 100%;
    max-width: 400px;
}

.pagination-sub-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--card-bg);
    color: var(--color-text);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px var(--color-shadow);
}

.pagination-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--color-shadow);
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination-btn:hover img {
    filter: brightness(0) invert(1);
}

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

.pagination-btn img {
    width: 20px;
    height: 20px;
    transition: all 0.2s ease;
}

.pagination-btn:disabled,
.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.05);
}

.page-indicator {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: monospace;
}

/* Dark theme adjustments */
:root[data-theme="dark"] .pagination-btn {
    background-color: var(--card-bg);
    color: var(--color-text);
}

:root[data-theme="dark"] .pagination-btn:hover {
    color: white;
}

:root[data-theme="dark"] .pagination-btn img {
    filter: invert(1);
}

.articles-grid {
    column-count: 1;
    column-gap: 2rem;
    padding: 1rem;
    display: block;
}

@media (min-width: 769px) {
    .articles-grid {
        column-count: 2;
    }
}

@media (min-width: 1280px) {
    .articles-grid {
        column-count: 3;
    }
}

/* Article Card Styles */
.article-card {
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: center;
    position: relative;
    break-inside: avoid;
    margin-bottom: 16px;
    width: 100%;
    background: transparent;
    padding-bottom: 16px;
    cursor: default;
}

@media (min-width: 769px) {
    .article-card {
        cursor: default;
    }
}

/* Separator line between articles - not touching edges */
.article-card:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0px;
    right: 24px;
    height: 1px;
    background-color: var(--border-color);
    opacity: 1;
}

.article-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-shadow: none;
    transform-origin: center bottom;
    border-radius: 0;
    background: transparent;
}

.article-content.collapsed {
    max-height: 200px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.collapse-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    margin-top: 0;
    z-index: 2;
    position: relative;
}

.article-content.collapsed+.collapse-btn {
    margin-top: -40px;
}

.collapse-btn img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    opacity: 0.6;
    filter: invert(0);
    /* Default for light theme */
}

:root[data-theme="dark"] .collapse-btn img {
    filter: invert(1);
}

.collapse-btn:hover img {
    opacity: 1;
    transform: scale(1.2);
}

/* When content is NOT collapsed (Expanded), arrow points UP */
.article-content:not(.collapsed)+.collapse-btn img {
    transform: rotate(180deg);
}

/* When content IS collapsed, arrow points DOWN (default icon orientation) */
.article-content.collapsed+.collapse-btn img {
    transform: rotate(0deg);
}


/* Skeleton Loader Styles */
.skeleton-card {
    background: var(--color-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--color-shadow);
    box-shadow: 0 2px 8px var(--color-shadow);
    animation: skeleton-pulse 1.5s ease-in-out infinite alternate;
    break-inside: avoid;
    margin-bottom: 2rem;
}

.skeleton-content {
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 1rem;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    margin-bottom: 0.8rem;
}

.skeleton-title {
    height: 1.4rem;
    width: 85%;
}

.skeleton-text {
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-footer {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.skeleton-badge {
    height: 1.2rem;
    width: 4rem;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes skeleton-pulse {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/* Dark Theme Skeleton */
:root[data-theme="dark"] .skeleton-card {
    background: #1e293b;
    border-color: #334155;
}

:root[data-theme="dark"] .skeleton-line,
:root[data-theme="dark"] .skeleton-badge {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
}

/* Novel & Drama Icons - Hidden */
.novel-icon,
.drama-icon {
    display: none;
}

/* Mobile Simplification */
@media (max-width: 768px) {
    .articles-grid {
        column-count: 1;
        padding: 0.5rem 1rem;
    }

    .article-card {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .article-content {
        margin-top: 0;
        padding: 0 1rem;
    }

    .article-content.collapsed+.collapse-btn {
        margin-top: 0;
    }

    /* Mobile layout for split card */
    .new-article-content.has-image {
        flex-direction: column;
        /* 图片在上,内容在下 */
        gap: 12px;
    }

    /* 移动端隐藏图片 */
    .new-article-content.has-image .new-article-image {
        display: none !important;
    }

    .new-article-content.has-image .new-article-text {
        width: 100%;
        order: 0;
        /* 内容在下方 */
    }

    /* 移动端调小summary字体 */
    .new-article-summary {
        font-size: 0.85rem;
        /* 从0.95rem调小到0.85rem */
    }
}

/* Timeline & Empty State */
.timeline-container {
    width: 100%;
    overflow-x: hidden;
    padding: 20px 0;
}

.timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 48px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.4) 12%, rgba(148, 163, 184, 0.55) 50%, rgba(148, 163, 184, 0.4) 88%, transparent 100%);
}

.time-point {
    position: relative;
    z-index: 1;
    padding: 4px 28px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg);
    border-radius: 999px;
    box-shadow: 0 2px 10px var(--color-shadow);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    animation: fadeIn 0.3s ease;
}

.empty-illustration img {
    width: 200px;
    opacity: 0.8;
}

.empty-text {
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
}


/* =========================================
   DASHBOARD NEW BOARDS STYLES
   ========================================= */

.dashboard-section {
    width: 100%;
    margin-bottom: 2rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* =========================================
   HISTORY & CHECKIN WRAPPER
   ========================================= */
.history-checkin-wrapper {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.history-section {
    flex: 0 0 60%;
    max-width: 60%;
}

.checkin-section {
    flex: 0 0 40%;
    max-width: 40%;
    padding-top: 0;
}

/* Medium screens: 50/50 split */
@media (max-width: 1323px) and (min-width: 769px) {
    .history-section {
        flex: 0 0 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }

    .checkin-section {
        flex: 0 0 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }
}

/* 打卡区域 header 和左边对齐 */
.checkin-header-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.3rem;
}

/* 打卡区域右侧容器 */
.checkin-header-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 分享按钮基础样式 */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.share-btn:hover {
    background: rgba(33, 150, 243, 0.15);
    transform: scale(1.05);
}

.share-btn:active {
    transform: scale(0.95);
}

.share-btn .material-symbols-outlined {
    font-size: 20px;
    color: currentColor;
}

/* 暗色模式适配 */
:root[data-theme="dark"] .share-btn {
    background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .share-btn:hover {
    background: rgba(33, 150, 243, 0.25);
}

/* 分享按钮 Tooltip */
.share-btn-wrapper {
    position: relative;
    display: inline-block;
    padding: 5px;
}

.share-btn-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.share-btn-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.share-btn-wrapper:hover .share-btn-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 分享面板 Modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.share-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.share-modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    /* 不限制宽度，让卡片决定内容尺寸 */
    max-width: 90vw;
    width: fit-content;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片宽高比 768/1376 ≈ 0.558 */

.share-card-wrapper {
    position: relative;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    /* wrapper 完全适配 canvas 尺寸 */
    width: fit-content;
    max-width: calc(90vw - 60px);
    max-height: calc(90vh - 140px);
    margin-left: auto;
    margin-right: auto;
    /* 优化触摸滑动体验 */
    touch-action: none;
}

.share-card-canvas {
    display: block;
    aspect-ratio: 768 / 1376;
    /* 默认：宽度是限制因素 */
    width: min(90vw - 60px, (90vh - 140px) * 768 / 1376);
    height: auto;
    border-radius: 16px;
    /* 优化触摸体验 */
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

/* 屏幕较宽（宽高比 >= 0.558），高度是限制因素 */
@media (min-aspect-ratio: 768/1376) {
    .share-card-canvas {
        width: auto;
        height: min(90vh - 140px, (90vw - 60px) * 1376 / 768);
    }
}

/* 背景切换点 */
.share-bg-dots {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.share-bg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

::root[data-theme="dark"] .share-bg-dot {
    background: rgba(0, 0, 0, 0.5);
}

.share-bg-dot:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.2);
}

.share-bg-dot.active {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.share-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.share-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-modal-btn .material-symbols-outlined {
    font-size: 18px;
}

.share-modal-btn.primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.share-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.share-modal-btn.primary:active {
    transform: translateY(0);
}

.share-modal-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] .share-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.share-modal-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] .share-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .share-modal {
        padding: 16px;
    }

    .share-modal-content {
        padding: 16px;
        max-width: calc(100vw - 32px);
    }

    /* 小屏幕下的宽高比逻辑 */
    .share-card-wrapper {
        margin-bottom: 12px;
        max-width: calc(100vw - 64px);
        max-height: calc(100vh - 160px);
    }

    .share-card-canvas {
        width: min(100vw - 64px, (100vh - 160px) * 768 / 1376);
        height: auto;
    }

    /* 小屏幕横屏：高度是限制因素 */
    @media (min-aspect-ratio: 768/1376) {
        .share-card-canvas {
            width: auto;
            height: min(100vh - 160px, (100vw - 64px) * 1376 / 768);
        }
    }

    .share-modal-actions {
        flex-direction: row;
        gap: 8px;
    }

    .share-modal-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .share-modal-btn .material-symbols-outlined {
        font-size: 16px;
    }
}

/* 打卡 tabs - 复用 history-tabs 风格 */
.checkin-tabs {
    display: flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px;
    border-radius: 16px;
}

:root[data-theme="dark"] .checkin-tabs {
    background: rgba(255, 255, 255, 0.1);
}

.checkin-tab {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 1.03rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkin-tab.active {
    background: var(--card-bg);
    color: var(--color-text);
    box-shadow: 0 2px 4px var(--color-shadow);
}

.checkin-tab:hover:not(.active) {
    color: var(--color-text);
}

.checkin-content {
    /* padding: 0 0.5rem; */
    margin-top: 26px;
}

/* 打卡内容面板 */
.checkin-panel {
    display: none;
}

.checkin-panel.active {
    display: block;
}

/* 打卡卡片 - 参考 achievement-card 风格 */
.checkin-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkin-item-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.checkin-item-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.checkin-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
    flex-shrink: 0;
}

.checkin-item-icon .material-symbols-outlined {
    font-size: 20px;
    color: #4CAF50;
}

:root[data-theme="dark"] .checkin-item-icon {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.15) 0%, rgba(102, 187, 106, 0.08) 100%);
}

:root[data-theme="dark"] .checkin-item-icon .material-symbols-outlined {
    color: #66BB6A;
}

.checkin-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.checkin-item-label {
    font-size: 0.75rem;
    color: #8e8e8e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:root[data-theme="dark"] .checkin-item-label {
    color: #8e8e8e;
}

.checkin-item-value {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.checkin-value-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.checkin-value-unit {
    font-size: 0.7rem;
    font-weight: 400;
    color: #888888;
}

:root[data-theme="dark"] .checkin-value-number {
    color: #ffffff;
}

:root[data-theme="dark"] .checkin-value-unit {
    color: #999999;
}

/* 单列布局（学习面板中只有一项时） */
.checkin-card-grid.checkin-card-single {
    grid-template-columns: 1fr;
}

/* 累计面板特殊布局 */
.checkin-total-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkin-total-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Level Card - 完全照搬 article 页面样式 */
.level-card {
    background: #ffffff;
    border: 1px solid #4CAF50;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.level-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.level-header {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.level-badge {
    height: auto;
    width: auto;
    max-height: 80px;
    flex-shrink: 0;
    align-self: center;
}

.level-progress-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.level-next-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.next-label {
    font-size: 0.75rem;
    color: #8e8e8e;
}

.next-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4CAF50;
}

.total-words-label {
    font-size: 0.75rem;
    color: #8e8e8e;
    white-space: nowrap;
}

.total-words-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4CAF50;
    white-space: nowrap;
    margin-left: auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #CDDC39 0%, #8BC34A 50%, #4CAF50 100%);
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* Dark mode for level-card */
:root[data-theme="dark"] .level-card {
    background: #1a1a1a;
    border-color: #71ef74;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .level-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .progress-bar {
    background: #2a2a2a;
}

:root[data-theme="dark"] .next-value {
    color: #66BB6A;
}

:root[data-theme="dark"] .next-label {
    color: #8e8e8e;
}

:root[data-theme="dark"] .progress-fill {
    background: linear-gradient(90deg, #DCE775 0%, #9CCC65 50%, #66BB6A 100%);
}

/* 空状态 */
.checkin-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 0;
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
    .history-checkin-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .history-section,
    .checkin-section {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .checkin-tabs {
        padding: 3px;
        border-radius: 14px;
        gap: 5px;
    }

    .checkin-tab {
        padding: 4px 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    .checkin-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 移动端打卡区域label更小 */
    .checkin-item-label {
        font-size: 0.6rem;
    }

    .next-label {
        font-size: 0.6rem;
    }

    .total-words-label {
        font-size: 0.6rem;
    }

    .total-words-value {
        font-size: 0.6rem;
    }

    .share-btn {
        width: 30px;
        height: 30px;
    }
}

.section-header {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.section-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-header h3::before {
    content: '';
    display: block;
    width: 3px;
    height: 1em;
    background: var(--accent-color);
    border-radius: 2px;
}

.history-header-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tabs {
    display: flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px;
    border-radius: 16px;
}

.history-tab {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 1.03rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-tab.active {
    background: var(--card-bg);
    color: var(--color-text);
    box-shadow: 0 2px 4px var(--color-shadow);
}

:root[data-theme="dark"] .history-tabs {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   LETTERS BOARD - ADAPTIVE DESIGN
   ========================================================================== */

/* --- Common Scene Container --- */
.letters-scene {
    width: 100%;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

/* --- Desktop Styles (3D Desk Scene) --- */
@media (min-width: 769px) {
    .letters-scene {
        perspective: 1000px;
        padding: 40px 10px;
    }

    .desk-container {
        position: relative;
        width: 100%;
        max-width: 1000px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .letters-stack {
        position: relative;
        width: 100%;
        max-width: 600px;
        display: grid;
        grid-template-areas: "stack";
        z-index: 1000;
    }

    .desk-decor {
        position: absolute;
        z-index: 5;
        pointer-events: none;
    }

    .left-decor {
        left: 0;
        top: 50%;
        transform: translateY(-50%) rotate(-5deg);
    }

    .right-decor {
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Props Styling */
    .polaroid {
        background: white;
        padding: 12px 12px 30px 12px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        transform: scale(0.9);
        transition: 0.3s;
    }

    .polaroid-img-wrapper {
        width: 140px;
        height: 140px;
        background: #eee;
        overflow: hidden;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .polaroid-img-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .polaroid-caption {
        font-family: var(--font-family-primary);
        text-align: center;
        color: #444;
        font-size: 1.1rem;
    }

    .pen-container {
        position: relative;
        width: 12px;
        height: 180px;
        transform: rotate(15deg);
    }

    .pen-body {
        position: absolute;
        top: 0;
        width: 100%;
        height: 85%;
        background: linear-gradient(to right, #444, #222, #444);
        border-radius: 2px;
    }

    .pen-cap {
        position: absolute;
        top: -10px;
        left: -2px;
        width: 16px;
        height: 40px;
        background: linear-gradient(to right, #666, #333, #666);
        border-radius: 2px;
    }

    .pen-tip {
        position: absolute;
        bottom: 0;
        left: 2px;
        width: 8px;
        height: 15%;
        background: #ddd;
        clip-path: polygon(0 0, 100% 0, 50% 100%);
    }

    .sticky-note {
        background: #fef08a;
        padding: 15px;
        width: 100px;
        font-family: var(--font-family-primary);
        color: #444;
        box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        transform: rotate(3deg);
        font-size: 0.9rem;
        text-align: center;
    }

    /* Hide Mobile-only elements */
    .envelope-stack,
    .mobile-envelope-stage {
        display: none !important;
    }

    /* Show modal on desktop */
    .letter-modal {
        display: flex !important;
        justify-content: center;
        align-items: center;
    }

    /* Re-use original Letter Card styling for desktop 3D flip */
    .letter-card {
        grid-area: stack;
        background-color: #fcfcfc;
        background-image: linear-gradient(#f1f1f1 1px, transparent 1px), linear-gradient(90deg, #f1f1f1 1px, transparent 1px);
        background-size: 20px 20px;
        padding: 2.5rem;
        border-radius: 4px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
        font-family: var(--font-family-primary);
        border: 1px solid #e2e8f0;
        transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        cursor: pointer;
        backface-visibility: hidden;
        height: 500px;
        overflow: hidden;
        position: relative;
        display: flex;
        flex-direction: column;
    }

    /* 桌面端信件渐变遮罩 */
    .letter-card.content-faded::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: linear-gradient(to top, #fcfcfc 0%, transparent 100%);
        pointer-events: none;
        z-index: 1;
    }

    .letter-front {
        z-index: 2;
        transform: rotate(-1deg);
    }

    .letter-back {
        z-index: 1;
        transform: rotate(2deg) translateY(12px) scale(0.96);
        opacity: 0.9;
    }

    .letters-stack.flipped .letter-front {
        z-index: 1;
        transform: rotate(-2deg) translateY(12px) scale(0.96);
        opacity: 0.9;
    }

    .letters-stack.flipped .letter-back {
        z-index: 2;
        transform: rotate(1deg) scale(1);
        opacity: 1;
    }
}

/* --- Mobile Styles (Realistic Envelope with Pattern) --- */
@media (max-width: 768px) {
    .letters-scene {
        padding: 40px 10px;
        overflow: hidden;
    }

    .desk-container {
        width: 100%;
        max-width: 400px;
        padding: 0;
    }

    .desk-decor {
        display: none;
    }

    .letters-stack {
        display: none;
    }

    /* Hide 3D cards on mobile */

    /* The Stage */
    .mobile-envelope-stage {
        position: relative;
        width: 100%;
        height: 240px;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        margin-top: 10px;
    }

    .logo {
        width: 180px;
    }

    .mobile-envelope {
        position: relative;
        width: 100%;
        height: 100%;
    }

    /* Shared Pattern for Envelope Parts */
    .envelope-pattern-bg {
        background-color: #dbe4ef;
        /* Grayish Blue Base */
        background-image:
            radial-gradient(circle, #ffffff 3px, transparent 3.5px),
            radial-gradient(circle, #94a3b8 3px, transparent 3.5px),
            radial-gradient(circle, #60a5fa 3px, transparent 3.5px);
        background-size: 40px 40px;
        background-position:
            0 0,
            /* White dot */
            13px 20px,
            /* Gray dot staggered */
            26px 7px;
        /* Blue dot staggered */
    }

    /* Back Flap (The inside back of the envelope - DARKER) */
    .envelope-back-flap {
        position: absolute;
        bottom: 0;
        left: 5%;
        width: 90%;
        height: 160px;
        background-color: #a9bbce;
        /* Darker Grayish Blue for inside */
        background-image:
            radial-gradient(circle, rgba(255, 255, 255, 0.4) 3px, transparent 3.5px),
            radial-gradient(circle, rgba(0, 0, 0, 0.1) 3px, transparent 3.5px),
            radial-gradient(circle, rgba(96, 165, 250, 0.4) 3px, transparent 3.5px);
        background-size: 40px 40px;
        background-position: 0 0, 13px 20px, 26px 7px;

        border-radius: 4px;
        z-index: 1;
        box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.15);
        /* Stronger inner shadow */
        border: 1px solid #94a3b8;
    }

    /* Open Top Flap (The inner side of the open flap - DARKER) */
    .envelope-back-flap::before {
        content: '';
        position: absolute;
        top: -60px;
        left: -1px;
        width: calc(100% + 2px);
        height: 60px;

        background-color: #a9bbce;
        /* Matches inside */
        background-image:
            radial-gradient(circle, rgba(255, 255, 255, 0.4) 3px, transparent 3.5px),
            radial-gradient(circle, rgba(0, 0, 0, 0.1) 3px, transparent 3.5px),
            radial-gradient(circle, rgba(96, 165, 250, 0.4) 3px, transparent 3.5px);
        background-size: 40px 40px;
        background-position: 0 0, 13px 20px, 26px 7px;

        clip-path: polygon(0 100%, 50% 0, 100% 100%);
        filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, 0.1));
        z-index: 1;
    }

    /* The Letter Cards (Enhanced with Grid) */
    .mobile-letter-card {
        position: absolute;
        bottom: 20px;
        width: 75%;
        height: 180px;
        left: 50%;
        background-color: #fcfcfc;
        background-image:
            linear-gradient(#f1f1f1 1px, transparent 1px),
            linear-gradient(90deg, #f1f1f1 1px, transparent 1px);
        background-size: 20px 20px;
        background-position: -2px -2px;

        border: 1px solid #cbd5e1;
        border-radius: 4px;
        padding: 12px 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        transform-origin: bottom center;
    }

    /* SKEWED STATES */
    .letter-pos-front {
        z-index: 4;
        transform: translate(-50%, -40px) rotate(-3deg) scale(1);
        filter: brightness(1);
    }

    .letter-pos-middle {
        z-index: 3;
        transform: translate(calc(-50% + 6px), -25px) rotate(2deg) scale(0.97);
        filter: brightness(0.96);
    }

    .letter-pos-back {
        z-index: 2;
        transform: translate(calc(-50% + 14px), -5px) rotate(5deg) scale(0.93);
        filter: brightness(0.9);
    }

    .mobile-letter-pwa {
        border-color: #eab308;
    }

    .mobile-letter-pwa .mob-letter-title {
        color: #b45309;
    }

    .mobile-letter-pwa-highlight {
        animation: pwaPulse 2.2s ease-in-out infinite;
        box-shadow: 0 18px 36px rgba(250, 204, 21, 0.35);
    }

    @keyframes pwaPulse {
        0% {
            box-shadow: 0 12px 26px rgba(250, 204, 21, 0.18);
            transform: translate(-50%, -42px) scale(1);
        }

        50% {
            box-shadow: 0 24px 44px rgba(250, 204, 21, 0.45);
            transform: translate(-50%, -48px) scale(1.03);
        }

        100% {
            box-shadow: 0 12px 26px rgba(250, 204, 21, 0.18);
            transform: translate(-50%, -42px) scale(1);
        }
    }

    /* Letter Content */
    .mob-letter-header {
        margin-bottom: 8px;
        width: 100%;
    }

    .mob-letter-title {
        display: block;
        font-family: var(--font-family-primary);
        font-size: 1.3rem;
        color: #1e293b !important;
        font-weight: 700;
        line-height: 1.4;
        text-align: left;
    }

    .mob-letter-content-preview {
        font-family: var(--font-family-primary);
        font-size: 1.05rem;
        color: #475569 !important;
        text-align: left;
        line-height: 1.4;
        width: 100%;
    }

    .highlight-preview {
        background: linear-gradient(120deg, rgba(255, 235, 59, 0.4) 0%, rgba(255, 235, 59, 0.1) 100%);
        padding: 0 2px;
        border-radius: 2px;
        color: #0f172a !important;
    }

    /* The Front Pocket (The outside face - LIGHTER) */
    .envelope-front-pocket {
        position: absolute;
        bottom: 0;
        left: 5%;
        width: 90%;
        height: 110px;
        z-index: 10;
        pointer-events: none;

        background-color: #dbe4ef;
        /* Lighter base */
        background-image:
            radial-gradient(circle, #ffffff 3px, transparent 3.5px),
            radial-gradient(circle, #94a3b8 3px, transparent 3.5px),
            radial-gradient(circle, #60a5fa 3px, transparent 3.5px);
        background-size: 40px 40px;
        background-position: 0 0, 13px 20px, 26px 7px;

        clip-path: polygon(0 0, 50% 30%, 100% 0, 100% 100%, 0 100%);
        box-shadow: inset 0 0 0 1000px rgba(255, 255, 255, 0.05);
        filter: drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.15));
    }

    /* "From L-feed" Label */
    .envelope-front-pocket::after {
        content: 'From L-feed';
        position: absolute;
        bottom: 5px;
        left: 5px;
        font-family: var(--font-family-primary);
        font-size: 0.9rem;
        color: #64748b;
        opacity: 0.8;
        pointer-events: none;
    }

    /* Switch Button */
    .envelope-switch-btn {
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 20;
        pointer-events: auto;

        background: white;
        color: #475569;
        border: 1px solid #cbd5e1;
        padding: 6px 16px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        transition: all 0.2s;
    }

    .envelope-switch-btn:active {
        transform: translateX(-50%) scale(0.95);
        background: #f1f5f9;
    }

    .envelope-switch-btn img {
        width: 18px;
        height: 18px;
        opacity: 1;
        filter: brightness(0.2);
    }

    /* Modal Styles (Mobile) */
    .letter-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }

    .letter-modal.active {
        opacity: 1;
        visibility: visible;
    }

    .letter-modal-content {
        width: 100%;
        height: 85vh;
        background: #fffdfa;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        background-image:
            linear-gradient(#f1f1f1 1px, transparent 1px),
            linear-gradient(90deg, #f1f1f1 1px, transparent 1px);
        background-size: 20px 20px;
    }

    .letter-modal.active .letter-modal-content {
        transform: translateY(0);
    }

    .modal-header {
        padding: 16px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #cbd5e1;
    }

    .modal-header h2 {
        margin: 0;
        font-size: 1.1rem;
        color: #334155;
        font-family: var(--font-family-primary);
    }

    .close-btn {
        background: rgba(0, 0, 0, 0.05);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        font-size: 1.2rem;
        color: #64748b;
    }

    .modal-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding: 24px;
        overscroll-behavior: contain;
        font-family: var(--font-family-primary);
    }
}

/* Inline Switch Button (Global) */
.letter-switch-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.letter-switch-wrapper:hover {
    opacity: 1;
}

.inline-switch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #718096;
    font-family: var(--font-family-primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.inline-switch-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent-color);
}

.inline-switch-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Ensure letters-board is above menu extension */
#letters-board {
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

/* Ensure letters-stack and letter-card allow pointer events */
.letters-stack,
.letter-card {
    pointer-events: auto !important;
}

/* Letter Expand Button - similar to Switch Letter button style */
.letter-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #718096;
    font-family: var(--font-family-primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.letter-expand-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent-color);
}

.letter-expand-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.letter-expand-btn:hover img {
    opacity: 1;
}

:root[data-theme="dark"] .letter-expand-btn {
    color: #94a3b8;
}

:root[data-theme="dark"] .letter-expand-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

/* --- Shared Letter Typography (Used in Desktop cards and Mobile modal) --- */
.modal-body-content .highlight,
.letter-body .highlight {
    background: linear-gradient(120deg, rgba(255, 235, 59, 0.6) 0%, rgba(255, 235, 59, 0.2) 100%);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 700;
}

.letter-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2d3748;
    font-family: var(--font-family-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.letter-header > span {
    flex: 1;
}

.letter-body p,
.modal-body-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.letter-encouragement {
    font-style: italic;
    color: #4a5568;
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    margin-top: 1.5rem;
}

.letter-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.letter-sign {
    font-size: 1rem;
    line-height: 1.4;
}

.letter-date {
    font-size: 0.85rem;
    color: #a0aec0;
    font-family: monospace;
}

/* Dark Theme Adjustments */
:root[data-theme="dark"] .letter-card,
:root[data-theme="dark"] .envelope-card,
:root[data-theme="dark"] .letter-modal-content {
    background-color: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
}

:root[data-theme="dark"] .letter-header,
:root[data-theme="dark"] .envelope-info h3 {
    color: #f1f5f9;
}

:root[data-theme="dark"] .letter-modal {
    background: rgba(0, 0, 0, 0.7);
}

:root[data-theme="dark"] .modal-header {
    border-color: #334155;
    background-color: #1e293b;
}

:root[data-theme="dark"] .inline-switch-btn {
    color: #94a3b8;
}

:root[data-theme="dark"] .inline-switch-btn img {
    filter: invert(1);
    opacity: 0.5;
}

:root[data-theme="dark"] .close-btn {
    background: #334155;
    color: #cbd5e1;
}


/* Desktop Defaults */
@media (min-width: 769px) {

    .letter-page-1,
    .letter-page-2 {
        display: block !important;
    }

    .next-page-btn,
    .letter-indicator,
    .mobile-next-hint {
        display: none;
    }

    /* Desktop Modal Styles */
    .letter-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.3s, visibility 0.3s;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(5px);
    }

    .letter-modal.active {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .letter-modal-content {
        width: 90% !important;
        max-width: 600px !important;
        height: auto !important;
        max-height: 85vh !important;
        background: #fffdfa;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        display: flex !important;
        flex-direction: column !important;
        transform: scale(0.9) !important;
        opacity: 0 !important;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        background-image:
            linear-gradient(#f1f1f1 1px, transparent 1px),
            linear-gradient(90deg, #f1f1f1 1px, transparent 1px);
        background-size: 20px 20px;
    }

    .letter-modal.active .letter-modal-content {
        transform: scale(1) !important;
        opacity: 1 !important;
    }

    .modal-header {
        padding: 20px 24px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #cbd5e1;
        flex-shrink: 0;
    }

    .modal-header h2 {
        margin: 0;
        font-size: 1.3rem;
        color: #334155;
        font-family: var(--font-family-primary);
    }

    .close-btn {
        background: rgba(0, 0, 0, 0.05);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        font-size: 1.3rem;
        color: #64748b;
        cursor: pointer;
        transition: all 0.2s;
    }

    .close-btn:hover {
        background: rgba(0, 0, 0, 0.1);
    }

    .modal-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding: 32px 24px;
        overscroll-behavior: contain;
        font-family: var(--font-family-primary);
        max-height: calc(85vh - 80px);
    }

    /* Desktop Dark Theme Modal */
    :root[data-theme="dark"] .letter-modal-content {
        background-color: #1e293b;
        background-image:
            linear-gradient(#334155 1px, transparent 1px),
            linear-gradient(90deg, #334155 1px, transparent 1px);
        background-size: 20px 20px;
        color: #cbd5e1;
    }

    :root[data-theme="dark"] .modal-header {
        border-color: #334155;
        background-color: #1e293b;
    }

    :root[data-theme="dark"] .modal-header h2 {
        color: #f1f5f9;
    }

    :root[data-theme="dark"] .close-btn {
        background: #334155;
        color: #cbd5e1;
    }

    :root[data-theme="dark"] .close-btn:hover {
        background: #475569;
    }
}

/* --- Letters Styling (Shared) --- */

/* --- Letters Styling (Shared) --- */

.letter-card {
    grid-area: stack;
    background-color: #fcfcfc;
    background-image:
        linear-gradient(#f1f1f1 1px, transparent 1px),
        linear-gradient(90deg, #f1f1f1 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -2px -2px;

    width: 100%;
    height: 500px;
    padding: 2.5rem;
    padding-top: 2rem;
    border-radius: 4px;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.05);
    font-family: var(--font-family-primary);
    color: #4a5568;
    border: 1px solid #e2e8f0;

    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    box-sizing: border-box;
    backface-visibility: hidden;
    transform-origin: center bottom;
    overflow: hidden;
    position: relative;

    /* 使用 flex 布局让内部元素垂直排列 */
    display: flex;
    flex-direction: column;
}

/* 信件底部渐变遮罩 - 只在内容溢出时显示 */
.letter-card.content-faded::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #fcfcfc 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* State: Default (Front Card is Letter 1, Back Card is Letter 2) */

/* Default State */
.letter-front {
    z-index: 2;
    transform: rotate(-1deg) translateY(0) scale(1);
}

.letter-back {
    z-index: 1;
    transform: rotate(2deg) translateY(12px) scale(0.96);
    opacity: 0.9;
    filter: brightness(0.95);
}

/* Flipped State */
.letters-stack.flipped .letter-front {
    z-index: 1;
    transform: rotate(-2deg) translateY(12px) scale(0.96);
    opacity: 0.9;
    filter: brightness(0.95);
}

.letters-stack.flipped .letter-back {
    z-index: 2;
    transform: rotate(1deg) translateY(0) scale(1);
    opacity: 1;
    filter: brightness(1);
}

/* Hover effects (only on the top card ideally, or both) */
.letters-stack:not(.flipped) .letter-front:hover {
    transform: rotate(0deg) scale(1.01);
}

.letters-stack.flipped .letter-back:hover {
    transform: rotate(0deg) scale(1.01);
}

/* Inner Letter Styling */
.letter-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

/* Letter body */
.letter-body {
    overflow: hidden;
    position: relative;
    flex: 1; /* 占据剩余空间 */
}

/* Hide footer and switch in desktop letter cards to show more content */
.letter-card.content-faded .letter-footer,
.letter-card.content-faded .letter-switch-wrapper {
    display: none;
}

/* 当内容未溢出时，显示 footer */
.letter-card:not(.content-faded) .letter-footer {
    display: flex;
    margin-top: auto; /* Push to bottom if needed */
}

.letter-card:not(.content-faded) .letter-switch-wrapper {
    display: block;
}

/* Update letter specific styles when inside letter-body */
.letter-body .update-letter-content h3.update-title {
    font-size: 1.1rem;
    margin-top: 0;
}

.letter-body .update-letter-content p {
    margin-bottom: 0.5rem;
}

.letter-body p {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.highlight {
    background: linear-gradient(120deg, rgba(255, 235, 59, 0.6) 0%, rgba(255, 235, 59, 0.2) 100%);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 700;
    color: #1a202c;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    display: inline-block;
    transform: rotate(-1deg);
    margin: 0 2px;
}

.letter-encouragement {
    font-style: italic;
    color: #4a5568;
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    margin-top: 2rem;
}

.letter-footer {
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.letter-sign {
    font-size: 1.1rem;
}

.letter-date {
    font-size: 0.9rem;
    color: #a0aec0;
    font-family: monospace;
}

.letter-hint {
    position: absolute;
    bottom: 1rem;
    right: 50%;
    transform: translateX(50%);
    font-size: 0.8rem;
    color: #cbd5e1;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.letter-card:hover .letter-hint {
    opacity: 1;
}


/* Letter 2 Specifics (Word Lists & Button) */
.word-list-section {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.list-label {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 0.5rem !important;
    font-weight: 600;
}

.mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-tags span {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.95rem;
    border: 1px dashed #cbd5e1;
}

.new-tags span {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-color);
}

.action-area {
    margin-top: 2rem;
    text-align: center;
    border-top: 2px dashed #e2e8f0;
    padding-top: 1.5rem;
}

.action-area p {
    margin-bottom: 1rem;
    font-weight: 600;
}

.letter-btn {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-family: -apple-system, sans-serif;
    /* Reset font for button */
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.letter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

/* Update Letter Styles */
.update-letter-content {
    padding: 0;
}

.update-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.update-date {
    font-size: 0.8rem;
    color: #718096;
    font-family: monospace;
    margin-bottom: 0.4rem;
}

.update-summary {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #4a5568;
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: rgba(59, 130, 246, 0.05);
    border-left: 2px solid var(--accent-color);
    border-radius: 3px;
}

.update-video {
    margin: 0.8rem 0;
}

/* 简化的视频预览框 */
.update-video-preview {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.update-video-preview:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.video-mini-player {
    position: relative;
    width: 120px;
    height: 68px;
    background: #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bilibili-mini-logo {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    color: #00a1d6;
}

.play-mini-icon {
    width: 28px;
    height: 28px;
    color: #fff;
}

.video-preview-hint {
    font-size: 0.75rem;
    color: #4a5568;
    font-weight: 500;
}

/* Dark theme */
:root[data-theme="dark"] .update-video-preview {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .update-video-preview:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

:root[data-theme="dark"] .video-preview-hint {
    color: #94a3b8;
}

/* 在modal中显示的真实视频 */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.video-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 30%);
    pointer-events: none;
    z-index: 1;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.update-links {
    margin: 0.6rem 0;
}

.update-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.update-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.update-link svg {
    flex-shrink: 0;
}

.update-social {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #e2e8f0;
}

.update-social-title {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.update-social-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.social-link:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.social-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Dark theme for update letter */
:root[data-theme="dark"] .update-title {
    color: #f1f5f9;
}

:root[data-theme="dark"] .update-date {
    color: #94a3b8;
}

:root[data-theme="dark"] .update-summary {
    color: #cbd5e1;
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--accent-color);
}

:root[data-theme="dark"] .update-social {
    border-top-color: #334155;
}

:root[data-theme="dark"] .update-social-title {
    color: #94a3b8;
}

:root[data-theme="dark"] .social-link {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
    color: #cbd5e1;
}

:root[data-theme="dark"] .social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #475569;
}

.letter-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border-radius: 20px;
    border: 1px dashed rgba(148, 163, 184, 0.8);
    background: transparent;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.pwa-letter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.5rem;
}

/* 社区邀请信样式 */
.community-qr-container {
    margin: 1.5rem 0;
    text-align: center;
}

.community-qr-code {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.community-qr-hint {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
}

.community-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.5rem;
}

/* Dark theme for community invite */
:root[data-theme="dark"] .community-qr-code {
    border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .community-qr-hint {
    color: #94a3b8;
}

.pwa-guide {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
}

.pwa-guide ol {
    margin: 0;
    padding-left: 1.2rem;
    color: #1e293b;
    font-weight: 600;
}

.pwa-guide-image {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.4);
    cursor: pointer;
    text-align: center;
}

.pwa-guide-image img {
    width: 100%;
    display: block;
}

.pwa-guide-image span {
    display: block;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dark Theme Adjustments for Letter */
:root[data-theme="dark"] .letter-card,
:root[data-theme="dark"] .letter-modal-content,
:root[data-theme="dark"] .mobile-letter-card {
    background-color: #1e293b;
    background-image:
        linear-gradient(#334155 1px, transparent 1px),
        linear-gradient(90deg, #334155 1px, transparent 1px);
    border-color: #334155;
    color: #cbd5e1;
}

:root[data-theme="dark"] .letter-header {
    color: #f1f5f9;
}

:root[data-theme="dark"] .letter-body .highlight {
    background: linear-gradient(120deg, rgba(250, 204, 21, 0.4) 0%, rgba(250, 204, 21, 0.1) 100%);
    color: #f8fafc;
}

:root[data-theme="dark"] .letter-encouragement {
    color: #94a3b8;
}

:root[data-theme="dark"] .mini-tags span {
    background: rgba(255, 255, 255, 0.05);
    border-color: #475569;
}

:root[data-theme="dark"] .letter-secondary-btn {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.6);
}

:root[data-theme="dark"] .letter-secondary-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

:root[data-theme="dark"] .pwa-guide {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
}

:root[data-theme="dark"] .pwa-guide ol {
    color: #e2e8f0;
}

:root[data-theme="dark"] .pwa-guide-image {
    border-color: rgba(148, 163, 184, 0.3);
}

/* Dark Theme Adjustments for Desk Props */
:root[data-theme="dark"] .polaroid {
    background: #1e293b;
    color: #cbd5e1;
}

:root[data-theme="dark"] .polaroid-img-wrapper {
    background: #0f172a;
}

:root[data-theme="dark"] .polaroid-caption {
    color: #94a3b8;
}

:root[data-theme="dark"] .sticky-note {
    background: #ca8a04;
    color: #fef08a;
}

:root[data-theme="dark"] .sticky-note span {
    color: #fff;
}


/* ==========================================================================
   HISTORY BOARD (Horizontal Scroll)
   ========================================================================== */
.history-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* 防止 flex 子元素溢出 */
    overflow: hidden;
    /* 防止内容溢出 */
    max-height: 300px;
    /* 限制最大高度，防止压住打卡区域 */
}

.horizontal-scroll-container {
    font-family: 'Chiron Sung HK', cursive, serif;
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 10px 4px 8px 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    width: 100%;
    /* 左右渐变遮罩效果 */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* ==========================================================================
   HISTORY DOTS INDICATOR
   ========================================================================== */
.history-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
    /* 防止被压缩 */
}

.history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.history-dot:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

.history-dot.active {
    opacity: 1;
    transform: scale(1.3);
}

/* 文章卡片的点 - 默认颜色 */
.history-dot.article-dot {
    background: var(--text-muted);
}

.history-dot.article-dot.active {
    background: var(--text-muted);
    opacity: 1;
    transform: scale(1.3);
}

/* "查看更多"卡片的点 - 蓝色 */
.history-dot.view-more-dot {
    background: var(--accent-color);
    opacity: 1;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.history-dot.view-more-dot:hover {
    opacity: 0.9;
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.history-dot.view-more-dot.active {
    transform: scale(1.6);
    box-shadow: 0 0 20px rgba(59, 130, 246, 1);
    background: #2563eb;
    /* 更深的蓝色 */
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px var(--color-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
    opacity: 0.8;
}

.scroll-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.scroll-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 12px var(--color-shadow-hard);
    opacity: 1;
    background: var(--color-bg);
}

.scroll-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0.5);
}

:root[data-theme="dark"] .scroll-btn img {
    filter: invert(1);
}

.left-btn {
    left: -20px;
}

.right-btn {
    right: -20px;
}

@media (max-width: 768px) {
    .scroll-btn {
        display: none;
    }

    .history-scroll-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    /* 移动端增加卡片整体高度 */
    .history-card {
        height: 220px !important;
        /* 从 180px 增加到 220px */
    }

    /* 移动端字体更小 */
    .history-card .card-title {
        font-size: 0.9rem;
        min-height: 2.5rem;
        line-height: 1.25;
    }

    .history-card .card-summary {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .history-card .card-meta {
        font-size: 0.7rem;
    }

    .history-card .tag-badge {
        font-size: 0.7rem;
        padding: 1px 6px;
    }

    .history-card .time-label {
        font-size: 0.7rem;
    }
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.history-card {
    flex: 0 0 280px;
    height: 180px;
    background: var(--card-bg);
    border-radius: 14px;
    scroll-snap-align: start;
    padding: 1.25rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.history-card:hover {
    transform: translateY(-4px);
}

.history-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-text);
}

.history-card .card-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Novel 和 Drama 类型的卡片摘要显示2行 */
.history-card-novel .card-summary,
.history-card-drama .card-summary {
    -webkit-line-clamp: 2;
}

.history-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

.history-card .card-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-card .time-label {
    color: var(--accent-color);
    font-weight: 600;
}

.card-last-read {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: auto;
    margin-bottom: 8px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-card .tag-badge {
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.view-more-card {
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white !important;
    text-align: center;
    cursor: pointer;
}

.view-more-card .card-title {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0;
}

.view-more-card:hover {
    filter: brightness(1.1);
}

/* Custom View More Card Backgrounds */
.view-more-card[data-type="novel"],
.view-more-card[data-type="drama"] {
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: auto 110%;
    /* Slightly larger to look good */
    align-items: flex-start;
    /* Align text to left */
    padding-left: 24px;
    /* Add spacing */
    text-align: left;
}

.view-more-card[data-type="novel"] {
    background-image: url('/assets/Qiang_half-C0mgOiPh.png');
}

.view-more-card[data-type="drama"] {
    background-image: url('/assets/Luna_half-4ZWhDyUm.png');
}


.discovery-header {
    margin-top: 1.5rem;
    padding: 0 1rem;
}

/* Discovery Category Buttons */
.discovery-category-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.discovery-category-btn .caret-icon {
    width: 9px;
    height: 9px;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.discovery-category-btn.active .caret-icon {
    transform: rotate(90deg);
    opacity: 1;
}

/* 移动端二级菜单滚动区域 - 默认隐藏 */
.discovery-mobile-menu {
    display: none;
}

/* 移动端二级菜单分组 */
.mobile-menu-scroll {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-menu-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-menu-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 16px;
    flex-shrink: 0;
}

.mobile-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    padding-right: 6px;
    border-right: 1px solid currentColor;
    opacity: 0.7;
}

.mobile-menu-item {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: #666;
}

.mobile-menu-item:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-item.selected {
    font-weight: 700;
    color: #333;
}

/* 深色主题 */
:root[data-theme="dark"] .mobile-menu-item {
    color: #999;
}

:root[data-theme="dark"] .mobile-menu-item:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .mobile-menu-item.selected {
    color: #fff;
    font-weight: 700;
}

/* 分组颜色 - 资讯 */
.mobile-menu-group[data-category="news"] {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.mobile-menu-group[data-category="news"] .mobile-menu-item:hover,
.mobile-menu-group[data-category="news"] .mobile-menu-item.selected {
    background: rgba(59, 130, 246, 0.2);
}

/* 分组颜色 - 知识探索 */
.mobile-menu-group[data-category="explore"] {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.mobile-menu-group[data-category="explore"] .mobile-menu-item:hover,
.mobile-menu-group[data-category="explore"] .mobile-menu-item.selected {
    background: rgba(16, 185, 129, 0.2);
}

/* 分组颜色 - 图书 */
.mobile-menu-group[data-category="books"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.mobile-menu-group[data-category="books"] .mobile-menu-item:hover,
.mobile-menu-group[data-category="books"] .mobile-menu-item.selected {
    background: rgba(245, 158, 11, 0.2);
}

/* 分组颜色 - 互动 */
.mobile-menu-group[data-category="play"] {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}
.mobile-menu-group[data-category="play"] .mobile-menu-item:hover,
.mobile-menu-group[data-category="play"] .mobile-menu-item.selected {
    background: rgba(139, 92, 246, 0.2);
}

/* 深色主题下移动端菜单颜色调整 */
:root[data-theme="dark"] .mobile-menu-group[data-category="news"] {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
:root[data-theme="dark"] .mobile-menu-group[data-category="news"] .mobile-menu-item:hover,
:root[data-theme="dark"] .mobile-menu-group[data-category="news"] .mobile-menu-item.selected {
    background: rgba(59, 130, 246, 0.3);
}

:root[data-theme="dark"] .mobile-menu-group[data-category="explore"] {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
:root[data-theme="dark"] .mobile-menu-group[data-category="explore"] .mobile-menu-item:hover,
:root[data-theme="dark"] .mobile-menu-group[data-category="explore"] .mobile-menu-item.selected {
    background: rgba(16, 185, 129, 0.3);
}

:root[data-theme="dark"] .mobile-menu-group[data-category="books"] {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
:root[data-theme="dark"] .mobile-menu-group[data-category="books"] .mobile-menu-item:hover,
:root[data-theme="dark"] .mobile-menu-group[data-category="books"] .mobile-menu-item.selected {
    background: rgba(245, 158, 11, 0.3);
}

:root[data-theme="dark"] .mobile-menu-group[data-category="play"] {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}
:root[data-theme="dark"] .mobile-menu-group[data-category="play"] .mobile-menu-item:hover,
:root[data-theme="dark"] .mobile-menu-group[data-category="play"] .mobile-menu-item.selected {
    background: rgba(139, 92, 246, 0.3);
}

/* Discovery Drawer - 紧跟按钮右侧水平展开 */
.discovery-drawer {
    display: inline-flex;
    align-items: center;
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    vertical-align: middle;
    gap: 4px;
    padding: 0;
    border-radius: 14px;
}

.discovery-drawer.open {
    max-width: 500px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.03);
}

::root[data-theme="dark"] .discovery-drawer.open {
    background: rgba(255, 255, 255, 0.08);
}

/* PC端分类按钮和抽屉颜色 - 资讯 */
.discovery-category-btn[data-category="news"],
.discovery-drawer[data-category="news"] {
    --category-color: #3b82f6;
}
.discovery-category-btn[data-category="news"].active {
    color: var(--category-color);
}
.discovery-drawer[data-category="news"].open {
    background: rgba(59, 130, 246, 0.1);
}
.discovery-drawer[data-category="news"] .drawer-item:hover,
.discovery-drawer[data-category="news"] .drawer-item.selected {
    background: rgba(59, 130, 246, 0.2);
    color: var(--category-color);
}

/* PC端分类按钮和抽屉颜色 - 知识探索 */
.discovery-category-btn[data-category="explore"],
.discovery-drawer[data-category="explore"] {
    --category-color: #10b981;
}
.discovery-category-btn[data-category="explore"].active {
    color: var(--category-color);
}
.discovery-drawer[data-category="explore"].open {
    background: rgba(16, 185, 129, 0.1);
}
.discovery-drawer[data-category="explore"] .drawer-item:hover,
.discovery-drawer[data-category="explore"] .drawer-item.selected {
    background: rgba(16, 185, 129, 0.2);
    color: var(--category-color);
}

/* PC端分类按钮和抽屉颜色 - 图书 */
.discovery-category-btn[data-category="books"],
.discovery-drawer[data-category="books"] {
    --category-color: #f59e0b;
}
.discovery-category-btn[data-category="books"].active {
    color: var(--category-color);
}
.discovery-drawer[data-category="books"].open {
    background: rgba(245, 158, 11, 0.1);
}
.discovery-drawer[data-category="books"] .drawer-item:hover,
.discovery-drawer[data-category="books"] .drawer-item.selected {
    background: rgba(245, 158, 11, 0.2);
    color: var(--category-color);
}

/* PC端分类按钮和抽屉颜色 - 互动 */
.discovery-category-btn[data-category="play"],
.discovery-drawer[data-category="play"] {
    --category-color: #8b5cf6;
}
.discovery-category-btn[data-category="play"].active {
    color: var(--category-color);
}
.discovery-drawer[data-category="play"].open {
    background: rgba(139, 92, 246, 0.1);
}
.discovery-drawer[data-category="play"] .drawer-item:hover,
.discovery-drawer[data-category="play"] .drawer-item.selected {
    background: rgba(139, 92, 246, 0.2);
    color: var(--category-color);
}

/* Drawer Item */
.drawer-item {
    padding: 4px 10px;
    border: none;
    background: var(--card-bg);
    color: var(--color-text);
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px var(--color-shadow);
    white-space: nowrap;
}

.drawer-item:hover {
    background: var(--accent-color);
    color: white;
}

.drawer-item.selected {
    background: var(--accent-color);
    color: white;
}

/* =========================================
   NEW SIMPLIFIED ARTICLE CARD DESIGN
   ========================================= */

.new-article-card {
    /* background: var(--card-bg); */
    /* border-radius: 16px; */
    /* padding: 0px 24px 20px 24px; */
    /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* First card should have no top padding */
/* .articles-grid > .new-article-card:first-child {
    padding-top: 0;

    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    align-items: stretch;
    cursor: default; 
    pointer-events: none; 
} */



.new-article-card:hover {
    /* transform: translateY(-4px); */
    /* box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); */
    cursor: pointer;
}

/* Novel Card Adjustments */
.novel-card {
    padding: 10px;
    border-left: none;
    background: linear-gradient(to right, rgba(255, 251, 235, 0.5), var(--card-bg));
}

.novel-recommendation {
    font-size: 0.85rem;
    font-weight: 700;
    color: #d97706;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: inline-block;
    position: relative;
    font-family: 'Patrick Hand', 'Comic Sans MS', cursive, sans-serif;
}

/* Dark theme adjustments */
:root[data-theme="dark"] .novel-card {
    border-left: none;
    background: linear-gradient(to right, rgba(251, 191, 36, 0.1), var(--card-bg));
}

:root[data-theme="dark"] .novel-recommendation {
    color: #fbbf24;
}

.new-article-content {
    width: 100%;
    position: relative;
    /* padding-top: 24px;  */
    padding-bottom: 12px;
    /* 内容底部到分隔线的固定距离 */
    pointer-events: none;
    /* 默认禁用所有点击 */
    cursor: default;
    /* 确保不显示手型指针 */
}

.new-article-content .new-article-title {
    pointer-events: auto !important;
    /* 只有标题可以点击 */
}

/* Re-enable clicks for drama scenes */
.new-article-content .drama-scenes-list {
    pointer-events: auto;
}

.new-article-content .drama-scene-item {
    pointer-events: auto;
}

/* Split layout when there's an image */
.new-article-content.has-image {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.new-article-content.has-image .new-article-text {
    flex: 1;
    min-width: 0;
    /* Allow text to shrink properly */
}

.new-article-content.has-image .new-article-image {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    box-shadow: 0 2px 8px var(--color-shadow);
    margin-top: 32px;
    /* 向下移动,与标题对齐 */
    pointer-events: none;
    /* 禁用图片的点击 */
    cursor: default;
    /* 图片不显示手型指针 */
}

/* Desktop: Show image */
@media (min-width: 769px) {
    .new-article-content.has-image .new-article-image {
        display: flex !important;
    }
}

.new-article-content.has-image .new-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Regular layout (no image) */
.new-article-content:not(.has-image) {
    display: block;
}

/* Tag positioned at top-left - using relative position for proper spacing */
.new-article-text>.new-article-tag:first-child,
.new-article-text>.new-article-tag:nth-child(2) {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 8px;
    /* Add spacing between tag and title */
    pointer-events: none;
    /* 禁用顶部标签的点击 */
    cursor: default;
    /* 顶部标签不显示手型指针 */
}

/* When in split layout, tags should be relative to text container */
.new-article-content.has-image .new-article-text>.new-article-tag:first-child,
.new-article-content.has-image .new-article-text>.new-article-tag:nth-child(2) {
    position: relative;
    top: auto;
    left: auto;
    pointer-events: none;
    /* 分栏布局时也禁用顶部标签的点击 */
    cursor: default;
}

/* Second tag styling - now inline with first tag */
.new-article-text>.new-article-tag:nth-child(2) {
    margin-left: 8px;
    /* Add spacing between two top tags */
    pointer-events: none;
    /* 第二个标签也禁用点击 */
    cursor: default;
}

.new-article-title {
    font-family: 'Chiron Sung HK', cursive, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 6px 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
}

.new-article-title {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    -webkit-text-decoration: underline;
    -webkit-text-decoration-style: dashed;
    -webkit-text-decoration-color: transparent;
    -webkit-text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    -webkit-text-underline-offset: 5px;
    transition: text-decoration-color 0.2s ease;
}

.new-article-title:hover {
    text-decoration-color: var(--color-text);
    -webkit-text-decoration-color: var(--color-text);
}

.new-article-summary {
    font-family: 'Chiron Sung HK', cursive, serif;
    font-size: 0.85rem;
    color: var(--color-text-dark);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.new-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.75rem;
    /* Smaller font for bottom meta */
    color: var(--text-muted);
    pointer-events: none;
    /* 禁用底部元数据的点击 */
}

/* PC端：文章卡片字体放大 */
@media (min-width: 769px) {
    .new-article-title {
        font-size: 1.45rem;
    }

    .new-article-summary {
        font-size: 0.95rem;
    }

    .history-card .card-summary {
        font-size: 0.95rem;
    }

    .new-article-tag {
        font-size: 0.85rem;
    }
}

.new-article-tag {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: default;
    /* 标签不显示手型指针 */
    color: var(--text-muted);
    font-size: 0.8rem;
    /* Smaller than title (1.25rem) */
    pointer-events: none;
    /* 禁用标签的点击 */
}

/* Tags in meta area (bottom) should be smaller */
.new-article-meta .new-article-tag {
    font-size: 0.75rem;
}

.new-article-tag:hover {
    opacity: 0.8;
    transform: none;
    /* 移除上移效果 */
}

/* Tag Specific Colors - all muted */
.tag-1,
.tag-2,
.tag-8,
.tag-16,
.tag-novel {
    color: var(--text-muted);
    background-color: transparent;
}

.new-article-time {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    /* Smaller, simpler text */
    opacity: 0.7;
    /* More subtle */
}

.new-article-time::before {
    content: '⏱';
    margin-right: 4px;
    font-size: 0.9em;
}

.new-article-date {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    opacity: 0.7;
}

.new-article-date::before {
    content: '';
    /* margin-right: 4px; */
    font-size: 0.9em;
}

.meta-separator {
    font-size: 0.75rem;
    opacity: 0.5;
    margin: 0 4px;
    user-select: none;
}

.new-article-fm {
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    font-weight: 500;
    font-size: 0.75rem;
    /* Smaller, simpler text */
    opacity: 0.7;
    /* More subtle */
}

/* Dark Theme Adjustments for Meta */
:root[data-theme="dark"] .new-article-tag {
    background-color: transparent;
    color: var(--text-muted);
}

/* =========================================
   DRAMA SCENES LIST
   ========================================= */

.drama-scenes-list {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.drama-scene-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.drama-scene-item:last-child {
    border-bottom: none;
}

.drama-scene-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.drama-scene-item.latest-scene {
    background: rgba(219, 39, 119, 0.05);
    font-weight: 600;
}

.drama-scene-item.latest-scene:hover {
    background: rgba(219, 39, 119, 0.1);
}

.scene-label {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.scene-episode {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.scene-title {
    color: var(--color-text);
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dark Theme Adjustments for Drama Scenes */
:root[data-theme="dark"] .drama-scenes-list {
    border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .drama-scene-item {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .drama-scene-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .drama-scene-item.latest-scene {
    background: rgba(219, 39, 119, 0.15);
}

:root[data-theme="dark"] .drama-scene-item.latest-scene:hover {
    background: rgba(219, 39, 119, 0.25);
}

:root[data-theme="dark"] .scene-episode {
    color: #f472b6;
}

:root[data-theme="dark"] .scene-title {
    color: #e2e8f0;
}

/* =========================================
   MOBILE STICKER NAVIGATION (TRUE CONTOUR STYLE)
   ========================================= */

.mobile-nav-container {
    display: none;
    /* Hidden on desktop */
    width: 100%;
    /* 改为 flex-start 以支持滚动 */
    justify-content: flex-start;
    align-items: center;
    padding: 20px 16px;
    margin-top: 10px;
    gap: 12px;
    box-sizing: border-box;

    /* 启用水平滚动 */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    /* 隐藏滚动条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-nav-container::-webkit-scrollbar {
    display: none;
}

/* Sticker Button - The Contour Style */
.mobile-sticker-btn {
    /* 移除所有盒子背景，依靠滤镜生成轮廓 */
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px;
    /* 给滤镜的膨胀留出空间 */

    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 移除 flex: 1，使用固定宽度支持滚动 */
    flex: 0 0 auto;
    min-width: 85px;
    max-width: 100px;
    position: relative;

    /* 滚动吸附效果 */
    scroll-snap-align: start;

    /* 核心：应用 SVG 滤镜生成描边 */
    filter: url(#sticker-outline);

    transform-origin: center center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* 解决Safari部分渲染问题 */
    -webkit-filter: url(#sticker-outline);
    will-change: transform;
}

.mobile-sticker-btn:hover,
.mobile-sticker-btn:active {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 10;
}

.sticker-content {
    display: flex;
    flex-direction: row;
    /* 横向排列 */
    align-items: center;
    justify-content: center;
    gap: 4px;
    /* 图标和文字的间距 */
}

.sticker-content img {
    width: 44px;
    /* 稍微缩小图标以适应横向排列 */
    height: 44px;
    object-fit: contain;
    display: block;
}

.sticker-content span {
    font-family: 'Patrick Hand', cursive, sans-serif;
    font-size: 16px;
    color: #2d3748;
    font-weight: 800;
    margin-top: 0;
    white-space: nowrap;
}

/* Rotations for organic feel */
.rotate-left {
    transform: rotate(-4deg);
}

.rotate-right {
    transform: rotate(3deg);
}

/* 
   Dropdown Sticker 
   缩小整体尺寸和外边框感
*/
.sticker-dropdown {
    position: relative;
    /* flex: 0.8;  */
    z-index: 100;
}

.sticker-dropdown .dropdown-toggle {
    background: #fff !important;
    border: 2px solid #fff !important;
    /* 减薄白边 */
    border-radius: 12px !important;
    padding: 4px 8px !important;
    /* 显著减少内边距 */
    box-shadow:
        0 2px 0px rgba(0, 0, 0, 0.05),
        2px 4px 8px rgba(0, 0, 0, 0.1) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #2d3748 !important;
    width: auto;
    /* 宽度自适应内容 */
    min-width: 60px;
    box-sizing: border-box;
    transform: rotate(1deg);
    height: 40px;
    /* 显著降低高度 */
    transition: all 0.2s;
}

.sticker-dropdown .dropdown-toggle:active {
    transform: scale(0.95);
}

.sticker-dropdown .dropdown-toggle span {
    font-family: 'Patrick Hand', cursive, sans-serif;
    font-weight: 700;
    font-size: 14px;
    /* 缩小字体 */
}

.sticker-dropdown .dropdown-toggle span:first-child {
    font-size: 11px;
    color: #718096;
    margin-right: 1px;
}

#mobile-level-selected-value {
    color: var(--accent-color);
    font-size: 16px !important;
    /* 缩小选中的等级字体 */
}

.sticker-dropdown .arrow {
    border-top: 4px solid #2d3748 !important;
    /* 缩小箭头 */
    border-left: 3px solid transparent !important;
    border-right: 3px solid transparent !important;
    margin-left: 2px;
}

.sticker-dropdown .dropdown-options {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    background: #fff !important;
    /* 不规则边框模拟撕纸感 */
    border: 3px solid #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 5px !important;
    display: none;
}

.sticker-dropdown.open .dropdown-options {
    display: flex;
    flex-direction: column;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.sticker-dropdown .dropdown-option {
    font-family: 'Patrick Hand', cursive, sans-serif;
    font-size: 16px !important;
    color: #4a5568 !important;
    text-align: center !important;
    padding: 8px !important;
    border-bottom: 1px dashed #e2e8f0;
}

/* Dark Theme: 滤镜下的白边依然是白色的，这很好，因为贴纸通常有白边。
   但我们需要确保文字颜色在暗模式下也是深色的（因为底是白色的）？
   不对，我们的滤镜是把透明变白。如果文字是白色的，滤镜膨胀后也是白的，就看不清了。
   所以在暗模式下，文字必须设为深色，因为它们现在是在“白色贴纸底”上。
*/
:root[data-theme="dark"] .sticker-content span {
    color: #2d3748 !important;
    /* 强制深色文字，因为背景变成了白色膨胀区 */
}

/* 除非我们想做“夜光贴纸”，否则贴纸本身还是白底黑字比较真实 */
:root[data-theme="dark"] .sticker-dropdown .dropdown-toggle,
:root[data-theme="dark"] .sticker-dropdown .dropdown-options {
    background: #e2e8f0 !important;
    /* 稍微灰一点的白 */
    border-color: #e2e8f0 !important;
}

:root[data-theme="dark"] .sticker-dropdown .dropdown-toggle span,
:root[data-theme="dark"] .sticker-dropdown .dropdown-option {
    color: #2d3748 !important;
}

/* Discovery 分类按钮 - 中等屏幕隐藏PC端抽屉，显示移动端菜单 */
@media (max-width: 1080px) {
    .discovery-category-btn,
    .discovery-drawer {
        display: none !important;
    }

    .discovery-mobile-menu {
        display: block;
        margin-top: 0.5rem;
        padding: 0 1rem;
    }
}

/* Media Query Updates */
@media (max-width: 768px) {

    /* .menu { display: none !important; }
    .mobile-nav-container { display: flex; } */
    #nav1 {
        padding: 20px 10px 5px 10px;
    }

    .logo {
        transform: rotate(-3deg) scale(0.9);
    }

    .slogan {
        margin-top: 5px;
        margin-bottom: 10px;
    }

    .bg-gradient {
        height: 250px;
    }

    .bg-wave {
        height: 250px;
    }

    .new-article-card {
        /* padding: 0px 24px 18px 24px; */
    }

    /* 移动端统一 header 样式 */
    .section-header {
        padding-left: 0;
        margin-bottom: 0.3rem;
    }

    .checkin-header-tabs {
        margin-bottom: 0.3rem;
    }

    /* discovery-header 不在 dashboard-section 内，需要自己的 padding */
    .discovery-header {
        padding: 0 1rem;
        margin-top: 1rem;
    }

    .section-header h3 {
        font-size: 0.9rem;
    }

    .history-header-tabs,
    .checkin-header-tabs {
        gap: 6px;
    }

    .history-tabs {
        padding: 3px;
        border-radius: 14px;
        gap: 5px;
    }

    .history-tab {
        padding: 4px 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    .checkin-tabs {
        padding: 3px;
        border-radius: 14px;
        gap: 5px;
    }

    .checkin-tab {
        padding: 4px 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }
}

/* Hide article page share button */
#shareArticleBtn {
    display: none !important;
}