:root {
    --transition-duration: 0.3s;
}

/* showMoreBtn CSS变量已提取到 common/main-content/main-content.css */

/* 深色主题下的标签样式优化 */
@media (min-width: 769px) {
    :root[data-theme="dark"] .taggroup {
        /* background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.08); */
    }

    :root[data-theme="dark"] .taggroup button {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.12);
    }

    :root[data-theme="dark"] .taggroup button:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }

    :root[data-theme="dark"] .taggroup button.active {
        background: linear-gradient(135deg, #ffffff, #e5e7eb);
        color: #1f2937;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

    /* 深色主题下的功能标签样式 */
    :root[data-theme="dark"] .taggroup button[data-tag="latest"],
    :root[data-theme="dark"] .taggroup button[data-tag="audit"],
    :root[data-theme="dark"] .taggroup button[data-tag="history"],
    :root[data-theme="dark"] .taggroup button[data-tag="favorite"] {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.06));
        border-color: rgba(59, 130, 246, 0.25);
    }

    :root[data-theme="dark"] .taggroup button[data-tag="latest"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="audit"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="history"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="favorite"]:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.12));
        border-color: rgba(59, 130, 246, 0.4);
    }

    :root[data-theme="dark"] .taggroup button[data-tag="latest"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="audit"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="history"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="favorite"].active {
        background: linear-gradient(135deg, #3b82f6, #60a5fa);
        color: white;
    }

    /* 深色主题下的分类标签样式 */
    :root[data-theme="dark"] .taggroup button[data-tag="news"],
    :root[data-theme="dark"] .taggroup button[data-tag="stories"],
    :root[data-theme="dark"] .taggroup button[data-tag="fun"],
    :root[data-theme="dark"] .taggroup button[data-tag="knowledge"],
    :root[data-theme="dark"] .taggroup button[data-tag="life"] {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04));
        border-color: rgba(34, 197, 94, 0.15);
    }

    :root[data-theme="dark"] .taggroup button[data-tag="news"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="stories"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="fun"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="knowledge"]:hover,
    :root[data-theme="dark"] .taggroup button[data-tag="life"]:hover {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
        border-color: rgba(34, 197, 94, 0.3);
    }

    :root[data-theme="dark"] .taggroup button[data-tag="news"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="stories"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="fun"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="knowledge"].active,
    :root[data-theme="dark"] .taggroup button[data-tag="life"].active {
        background: linear-gradient(135deg, #22c55e, #4ade80);
        color: white;
    }
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    /* 使用系统字体作为降级方案，Google字体延迟加载 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 500;
    font-style: normal;
    transition: font-family 0.3s ease;
}

/* Google字体加载完成后应用 */
body.fonts-loaded {
    font-family: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* 如果GSAP加载失败，可以使用CSS动画作为降级方案 */
body.no-gsap .spin-btn:hover {
    transform: scale(1.05) rotate(4deg);
    transition: transform 0.2s ease;
}

/* 响应式图片容器 */
picture {
    display: inline-block;
}

picture img {
    max-width: 100%;
    height: auto;
}

/* 为懒加载图片添加淡入效果 */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.background-auto {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* main-content, showMoreBtn, articles-grid 样式已提取到 common/main-content/main-content.css */

#bgWave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
} */

/* articles-grid 样式已提取到 common/main-content/main-content.css */

/* 骨架屏样式 */
.skeleton-card {
    background: var(--color-card-bg, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--color-border, #e1e5e9);
    box-shadow: 0 2px 8px var(--color-shadow, rgba(0, 0, 0, 0.05));
    animation: skeleton-pulse 1.5s ease-in-out infinite alternate;
}

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

.skeleton-line {
    height: 1rem;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--color-skeleton-bg, #f0f0f0) 25%, var(--color-skeleton-highlight, #e0e0e0) 50%, var(--color-skeleton-bg, #f0f0f0) 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, var(--color-skeleton-bg, #f0f0f0) 25%, var(--color-skeleton-highlight, #e0e0e0) 50%, var(--color-skeleton-bg, #f0f0f0) 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;
    }
}

/* 暗色主题下的骨架屏 */
:root[data-theme="dark"] .skeleton-card {
    --color-skeleton-bg: #2a2a2a;
    --color-skeleton-highlight: #3a3a3a;
}

/* 深色主题下的小说图标样式 */
:root[data-theme="dark"] .novel-icon {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .drama-icon {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}


/* 文章卡片样式 */
.article-card {
    background: var(--color-surface);
    height: 440px;
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: center;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    /* 默认浅色渐变，但更柔和 */
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
}

:root[data-theme="dark"] .article-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

:root[data-theme="dark"] .article-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* 小说图标样式 */
.novel-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    /* background: rgba(255, 255, 255, 0.9); */
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 剧场图标样式 */
.drama-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 当同时存在小说和剧本图标时的布局调整 */
.article-card:has(.novel-icon) .drama-icon {
    left: auto;
    right: 12px;
}

.article-card:has(.drama-icon) .novel-icon {
    left: 12px;
}

.novel-icon img {
    /*旋转 */
    transform: rotate(-10deg);
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.drama-icon img {
    /* 轻微旋转，与小说图标不同方向 */
    transform: rotate(10deg);
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* 响应式设计 - 移动端小说和剧本图标 */
@media (max-width: 768px) {
    .novel-icon {
        width: 100px;
        height: 100px;
        top: 8px;
        left: 8px;
    }

    .novel-icon img {
        width: 80px;
        height: 80px;
    }

    .drama-icon {
        width: 100px;
        height: 100px;
        top: 8px;
        left: 8px;
    }

    .drama-icon img {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .novel-icon {
        width: 100px;
        height: 100px;
        top: 6px;
        left: 6px;
    }

    .novel-icon img {
        width: 80px;
        height: 80px;
    }

    .drama-icon {
        width: 100px;
        height: 100px;
        top: 6px;
        left: 6px;
    }

    .drama-icon img {
        width: 80px;
        height: 80px;
    }
}

/* .article-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 使用 SVG data URI 作为背景 
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'%3E%3Ccircle cx='5' cy='5' r='1'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 10px 10px; /* 调整 SVG 纹理的大小 
    opacity: 0.8; /* 调整纹理的透明度，使其若隐若现 
  } */

/* .header {
    background-color: white;
} */




.article-content {
    /* height: 350px; */
    width: 80%;
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: center;
    margin: 50px 0px 2px 0px;
    overflow-y: auto;
    /* 当内容超出时，垂直方向显示滚动条 */
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    /* 水平方向隐藏滚动条，避免横向滚动 */
    /* padding: 10px; */
    /* 可选，内边距让内容不贴边 */
    -ms-overflow-style: none;
    /* IE/Edge 隐藏滚动条 */
    scrollbar-width: none;
    /* Firefox 隐藏滚动条 */
    /* background-color: #a0aec0; */
    /* transition: transform 0.3s ease 0.2s, font-size 0.3s ease 0.2s, border-color 0.3s ease 0.2; */
    box-shadow: 0 10px 30px var(--color-shadow);
    /* 细腻的阴影 */
    transform-origin: center bottom;
    /* 从上边中心开始放大 */
    transition: transform 0.3s ease;
    border-radius: 16px 16px 0px 0px;
    background-clip: padding-box;
    cursor: pointer;
}



.article-content:hover {
    transform: scale(1.05);
    border-color: black !important;
}

.article-content> :first-child {
    padding: 10px !important;
    /* 设置父元素第一个子元素的内边距 */
}

.article-description {
    width: 100%;
    /* height: 50px; */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg);
}

.article-description h3 {
    /* flex-grow: 1; */
    /* flex-shrink: 1; */
    flex-basis: 100%;
}

/* .footer {
    background-color: var(--color-bg);
    padding: 2rem 0;
    text-align: center;
    color: var(--color-text);
} */

/* Simple tag buttons */
.taggroup {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: center;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.tag-column {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.taggroup button {
    background: transparent;
    border: 1px solid var(--color-text);
    color: var(--color-text);
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 70px;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.2;
}

.taggroup button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.taggroup button.active {
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: 600;
}

.taggroup {
    position: relative;
    display: flex;
    gap: 10px;
    /* border-bottom: 1px solid var(--color-border); */
    /* padding-bottom: 8px; */
    width: fit-content;
    justify-content: left;
    align-items: center;
}

/* 确保桌面端taggroup显示 */
@media (min-width: 769px) {
    .taggroup {
        display: flex !important;
    }
}

.taggroup button {
    background: none;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    font-size: 18px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* font-weight: 500; */
    transition: background-color var(--transition-duration);
    color: var(--color-text);
    font-family: inherit;
    /* font-weight: 700; */
}

.taggroup button:hover {
    /* color: var(--color-primary); */
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.taggroup button.active {
    /* color: var(--color-primary); */
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.taggroup .tag-divider {
    color: var(--color-text);
    opacity: 0.4;
    font-size: 20px;
    line-height: 1;
    margin: 0 8px;
    user-select: none;
    display: flex;
    align-items: center;
    align-self: center;
}



.indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s ease, width 0.3s ease;
}

.taggroup button img {
    height: 40px;
    display: block;
    filter: drop-shadow(2px 2px 2px var(--color-shadow-hard));
}

.tagselect {
    display: none;
}

.level {
    display: flex;
    justify-content: right;
    align-items: center;
    gap: 20px;
    width: 100px;
    max-width: none;
}

.level button img {
    max-width: 80px;
    height: auto;
    width: 100%;
    display: block;
}

/* 旧的全局 dropdown 样式已迁移到 common/styles/header.css (#dropdown 作用域) */

.timeline-container {
    width: 100%;
    overflow-x: hidden;
    padding: 20px 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.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%);
    transform: translateY(-50%);
}

.time-point {
    position: relative;
    z-index: 1;
    padding: 4px 28px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.4px;
    background: var(--color-bg);
    border-radius: 999px;
    /* box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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








/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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


/*呼吸标语*/
.breathing-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--color-shadow);
    z-index: 1000;
}

/* slogan 文字 */
.breathing-text {
    position: relative;
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    letter-spacing: 1px;
    z-index: 1; /* Lower than menu elements */
    opacity: 1;
    transform: scale(1);
    pointer-events: none; /* Prevent slogan from interfering with mouse events */
}

.badge {
    /* background-color: #6e6e6e; */
    /* color: rgb(36, 36, 36); */
    color: var(--color-text-muted);
    /* border: 1px solid rgb(36, 36, 36); */
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 16px;
    width: fit-content;
    margin: 15px 0px;
}

.read-more {
    cursor: pointer;
    flex-grow: 1;
    color: var(--color-text-muted);
    font-weight: 500;
    text-align: right;
}

.audit {
    cursor: pointer;
    color: var(--color-primary);
}

/* .article-summary {
    background-color: #f9f9f9;
    border-left: 4px solid #4A90E2;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
    border-radius: 6px;
} */

/* .article-summary p {
    margin: 0;
    font-style: italic;
} */


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

.empty-illustration {
    margin-bottom: 20px;
    opacity: 0.8;
}

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

.dy-article-title {
    font-size: 18px !important;
}







@media (max-width: 768px) {
    /* 显示移动端顶部难度等级切换按钮 */
    #topBarLevelToggle {
        display: flex !important;
    }

    /* 移动端Header专属美化：优雅呼吸渐变 */
    .bg-gradient {
        background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #243b55) !important;
        background-size: 400% 400% !important;
        animation: mobileBgFlow 12s ease-in-out infinite !important;
        /* 增加极轻微的内部光晕 */
        box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.3) !important;
    }

    @keyframes mobileBgFlow {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    /* 移动端下拉菜单保持垂直布局 */
    .dropdown-options {
        min-width: 160px;
        flex-direction: row;
        padding: 8px 0;
    }

    #tagsDropdown .dropdown-options {
        min-width: 300px;
    }

    .dropdown-group {
        border-right: none !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
        border-bottom: 1px solid rgba(128, 128, 128, 0.2);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .dropdown-group:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .dropdown-group-title {
        font-size: 0.75rem;
        padding: 4px 20px 6px 20px;
        border-bottom: 1px solid rgba(128, 128, 128, 0.15);
        margin-bottom: 4px;
    }



    .dropdown-option {
        margin: 0;
        padding: 5px 20px;
    }

    .dropdown-option:hover {
        background: transparent;
    }

}

/* 中等屏幕优化 - 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .dropdown-options {
        min-width: 240px;
    }

    .dropdown-group-title {
        font-size: 0.7rem;
        padding: 3px 10px 6px 10px;
    }

    .dropdown-option {
        padding: 5px 10px;
        margin: 0 2px;
        font-size: 0.9rem;
    }

    .taggroup button {
        min-width: 70px;
        padding: 8px 16px;
    }
}

/* PC端隐藏移动端顶部难度等级切换按钮 */
@media (min-width: 769px) {
    #topBarLevelToggle {
        display: none !important;
    }
}

/* taggroup 和旧 dropdown 的 PC端样式已迁移到 common/styles/header.css */

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* articles-grid 移动端样式已提取到 common/main-content/main-content.css */

    .article-content {
        width: 90%;
        overflow-y: hidden;
        overflow-x: hidden;
        touch-action: pan-x pan-y pinch-zoom;
        -webkit-overflow-scrolling: touch;
    }

    .article-card {
        height: 280px;
        border-radius: 0;
        border: none !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* 移动端隐藏PC端的tags和level下拉框 */
    #tagsDropdown {
        display: block;
    }

    #dropdown {
        display: none; /* 隐藏难度选择下拉框，功能已迁移到顶部工具栏 */
    }

    /* 统一使用PC端的列式布局 */
    #tagsDropdown.open .dropdown-options {
        display: flex;
        flex-direction: row;
    }

    #dropdown.open .dropdown-options {
        display: flex;
        flex-direction: column;
    }

    .dropdown-toggle {
        gap: 10px;
        /* width: 250px; */
    }

    /* 移动端日期标签优化 */
    .timeline-container {
        padding: 15px 0;
    }

    .timeline {
        height: 45px;
    }

    .time-point {
        padding: 4px 24px;
        font-size: 18px;
        letter-spacing: 0.3px;
    }

    .menu {
        gap: 10px;
    }

    .article-description {
        padding: 0 10px;
    }

    /* main-content 移动端样式已提取到 common/main-content/main-content.css */
}

/* Sticker Menu for FM Button */
.sticker-menu-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.sticker-menu-items {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    z-index: -1;
    pointer-events: none;
}

.sticker-menu-container:hover .sticker-menu-items {
    pointer-events: auto;
}

.sticker-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 2px solid white;
    opacity: 0;

    --tx: 0px;
    --ty: 0px;
    --r: 0deg;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticker-item img {
    width: 20px;
    height: 20px;
    filter: invert(0.2);
    transition: transform 0.2s;
}

/* Dark theme support */
:root[data-theme="dark"] .sticker-item {
    background: #2a2a2a;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
:root[data-theme="dark"] .sticker-item img {
    filter: invert(0.8);
}

/* Watermark 样式已移至 common/header/header.css */

.sticker-menu-container:hover .sticker-item:nth-child(1) {
    --tx: -70px; --ty: -35px; --r: -15deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.05s;
}

/* === Sidebar Toggle Button Styles === */
/* Removed mobile-sidebar-btn specific styles to use shared component */

@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

.sticker-menu-container:hover .sticker-item:nth-child(2) {
    --tx: 0px; --ty: -75px; --r: 0deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.1s;
}

.sticker-menu-container:hover .sticker-item:nth-child(3) {
    --tx: 70px; --ty: -35px; --r: 15deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.15s;
}

.sticker-item:hover {
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1.2);
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    z-index: 10;
}

/* Read Menu Container - Sticker Style like FM but with text */
.read-menu-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Extremely high to definitely cover slogan and other elements */
}

.read-menu-items {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    z-index: 9998; /* Very high to cover all other menu items */
    pointer-events: auto; /* Allow hover over the menu area */
    opacity: 0;
    transition: opacity 0.1s 0.3s ease; /* 0.3s delay before hiding */
}

/* Create an invisible hover area that doesn't affect positioning */
.read-menu-items::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -80%);
    width: 200px;
    height: 150px;
    z-index: -1;
    background: transparent;
}

/* Ensure read items are on top of everything */
.read-item {
    z-index: 9999;
}

/* Show menu when hovering over container */
.read-menu-container:hover .read-menu-items {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s; /* Immediate show */
}

/* Make the menu items themselves able to maintain hover state */
.read-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 36px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 2px solid white;
    opacity: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    padding: 0 8px;
    pointer-events: auto; /* Allow interaction with menu items */

    --tx: 0px;
    --ty: 0px;
    --r: 0deg;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Create a pseudo-element that acts as a bridge between the button and menu items */
.read-menu-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: transparent;
    z-index: 9997;
    pointer-events: none;
}

/* Dark theme support for read menu */
:root[data-theme="dark"] .read-item {
    background: #2a2a2a;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    color: rgba(255, 255, 255, 0.9);
}

/* Fan out positions on hover - back to original positions */
.read-menu-container:hover .read-item:nth-child(1) {
    --tx: -90px; --ty: -35px; --r: -12deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.05s;
}

.read-menu-container:hover .read-item:nth-child(2) {
    --tx: -45px; --ty: -75px; --r: -8deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.1s;
}

.read-menu-container:hover .read-item:nth-child(3) {
    --tx: 45px; --ty: -75px; --r: 8deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.15s;
}

.read-menu-container:hover .read-item:nth-child(4) {
    --tx: 90px; --ty: -35px; --r: 12deg;
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1);
    transition-delay: 0.2s;
}

.read-item:hover {
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) rotate(var(--r)) scale(1.2);
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    z-index: 10;
    background: #3b82f6;
    color: white;
}

:root[data-theme="dark"] .read-item:hover {
    background: #60a5fa;
}

/* New menu items styling */
#flashcard {
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 1px var(--color-shadow));
    /* transform: rotate(-3deg); */
}

#read {
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 1px var(--color-shadow));
    transform: rotate(-2deg);
}

#game {
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 1px var(--color-shadow));
    transform: rotate(8deg);
}

/* Fix hover effect for game button when GSAP is not available */
body.no-gsap #game:hover {
    transform: scale(1.05) rotate(10deg);
    transition: transform 0.2s ease;
}

#login {
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.2));
    transform: rotate(-2deg);
}

/* Hide sidebar on PC for read page */
@media screen and (min-width: 901px) {
    .sidebar-container,
    .sidebar-overlay,
    .sidebar-pc-toggle {
        display: none !important;
    }

    body.sidebar-pc-collapsed,
    body.sidebar-pc-expanded {
        margin-left: 0 !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #flashcard, #read, #game {
        height: 60px;
    }

    #login {
        height: 70px;
    }
}
