/* QiMeng Theme Custom Styles */

/* ========== 全局溢出控制 ========== */
/* 使用 clip 代替 hidden 以支持 sticky 定位 */
html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
    max-width: 100vw;
}

/* 确保所有容器不超出视口 */
.max-w-7xl {
    max-width: min(80rem, calc(100vw - 2rem));
}

/* ========== 顶部导航样式 ========== */

/* 导航栏整体 - 毛玻璃效果 */
#qm-header {
    background: transparent;
}

/* 固定定位样式 */
#qm-header.sticky {
    position: sticky;
    top: 0;
    z-index: 50;
}

#qm-primary-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark #qm-primary-header {
    background: rgba(31, 41, 55, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 滚动时增强毛玻璃效果 */
#qm-header.is-scrolled #qm-primary-header {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.dark #qm-header.is-scrolled #qm-primary-header {
    background: rgba(31, 41, 55, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* 副菜单滚动隐藏动画 */
#qm-secondary-header {
    max-height: 40px;
    opacity: 1;
    overflow: hidden;
    background: #f9fafb;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dark #qm-secondary-header {
    background: #1f2937;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#qm-secondary-header.is-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* 旧的 header 样式移除 */
header {
    background: transparent;
    box-shadow: none;
}

/* 主导航链接 */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
}

/* 高亮标签 - 渐变色 */
.menu-tag {
    position: absolute;
    top: -4px;
    right: -4px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* 热门 - 红橙渐变 */
.tag-hot {
    background: linear-gradient(135deg, #ff6b6b, #f97316);
    color: white;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.4);
}

/* 新 - 绿色渐变 */
.tag-new {
    background: linear-gradient(135deg, #10b981, #22c55e);
    color: white;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.4);
}

/* VIP - 金色渐变 */
.tag-vip {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
}

/* 推荐 - 蓝色渐变 */
.tag-rec {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}

/* 免费/福利 - 紫色渐变 */
.tag-free {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.4);
}

/* 默认 - 主题渐变 */
.tag-default {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: white;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.4);
}

/* 有标签的链接需要额外右边距 */
.nav-link.has-tag,
.nav-item-secondary.has-tag {
    padding-right: 1rem;
}

/* 副导航菜单项 */
.nav-item-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: #4b5563;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-item-secondary:hover {
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
}

/* 副导航下拉菜单 */
.nav-dropdown {
    position: relative;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

/* 下拉菜单网格样式 */
.dropdown-menu .dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 96px));
    gap: 0.5rem;
    max-width: 520px; /* 最多5个一行 */
}

.dropdown-menu .dropdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.2s;
    width: 96px;
}

.dropdown-menu .dropdown-item:hover {
    background: rgba(124, 58, 237, 0.05);
}

.dropdown-menu .dropdown-item .icon-wrap {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #f3e8ff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: transform 0.2s;
}

.dropdown-menu .dropdown-item:hover .icon-wrap {
    transform: scale(1.05);
}

.dropdown-menu .dropdown-item .icon-wrap img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu .dropdown-item .icon-wrap i {
    font-size: 1.125rem;
    color: #8b5cf6;
}

.dropdown-menu .dropdown-item .item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: color 0.2s;
}

.dropdown-menu .dropdown-item:hover .item-title {
    color: #7c3aed;
}

.dropdown-menu .dropdown-item .item-count {
    font-size: 0.625rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主导航激活状态 */
.nav-link.active {
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
}

/* 日夜切换按钮 */
.dark-hidden { display: inline; }
.dark-show { display: none; }
body.dark-mode .dark-hidden { display: none; }
body.dark-mode .dark-show { display: inline; }

/* 导航菜单样式 */
.menu li {
    list-style: none;
}

.menu li a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s;
    border-radius: 0.5rem;
}

.menu li a:hover {
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
}

/* 导航下拉菜单动画 */
.nav-item .sub-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.nav-item:hover .sub-menu {
    opacity: 1;
    transform: translateY(0);
}

.nav-item .sub-menu a:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
    color: #7c3aed;
}

.nav-item .sub-menu a {
    font-weight: 600;
}

/* 用户下拉菜单动画 */
.user-menu {
    animation: userMenuFadeIn 0.25s ease;
    width: 280px;
    max-width: calc(100vw - 1.5rem);
    padding: 0;
    border-radius: 16px;
    background: #ffffff;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.dark .user-menu {
    background: #1e293b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

@keyframes userMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 用户头像按钮 - 带红点通知 */
.qm-user-avatar-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qm-user-avatar-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    animation: avatarDotPulse 2s ease-in-out infinite;
}

.dark .qm-user-avatar-dot {
    border-color: #1e293b;
}

@keyframes avatarDotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

/* ========== 站内通知弹窗 ========== */
.qm-notify-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 1rem 1rem;
}

.qm-notify-modal.hidden {
    display: none;
}

.qm-notify-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.qm-notify-modal__panel {
    position: relative;
    width: 420px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 120px);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(124, 58, 237, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: notifyModalIn 0.25s ease;
}

@keyframes notifyModalIn {
    from { opacity: 0; transform: translate3d(0, -20px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.dark .qm-notify-modal__panel {
    background: #1e293b;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.qm-notify-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);
    color: #ffffff;
}

.qm-notify-modal__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.qm-notify-modal__title i {
    font-size: 18px;
}

.qm-notify-modal__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-notify-modal__mark-all,
.qm-notify-modal__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qm-notify-modal__mark-all:hover,
.qm-notify-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.qm-notify-modal__close:hover {
    transform: rotate(90deg);
}

.qm-notify-modal__content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    max-height: 400px;
}

.qm-notify-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #94a3b8;
}

.qm-notify-modal__loading i {
    font-size: 24px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-notify-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #94a3b8;
}

.qm-notify-modal__empty i {
    font-size: 48px;
    opacity: 0.5;
}

.qm-notify-modal__empty span {
    font-size: 14px;
}

/* 通知列表 */
.qm-notify-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qm-notify-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
    cursor: pointer;
}

.qm-notify-item:hover {
    background: rgba(124, 58, 237, 0.04);
}

.qm-notify-item:last-child {
    border-bottom: none;
}

.dark .qm-notify-item {
    border-bottom-color: #334155;
}

.dark .qm-notify-item:hover {
    background: rgba(124, 58, 237, 0.1);
}

.qm-notify-item--unread {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.04));
}

.qm-notify-item--unread:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.08));
}

.qm-notify-item__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.12));
}

.qm-notify-item__icon i {
    font-size: 16px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-notify-item__icon--checkin {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(34, 197, 94, 0.12));
}

.qm-notify-item__icon--checkin i {
    background: linear-gradient(135deg, #10b981, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
}

.qm-notify-item__icon--system {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.12));
}

.qm-notify-item__icon--system i {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
}

.qm-notify-item__icon--reward {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.12));
}

.qm-notify-item__icon--reward i {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
}

.qm-notify-item__body {
    flex: 1;
    min-width: 0;
}

.qm-notify-item__title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 4px;
}

.dark .qm-notify-item__title {
    color: #f1f5f9;
}

.qm-notify-item--unread .qm-notify-item__title {
    font-weight: 700;
}

.qm-notify-item__desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .qm-notify-item__desc {
    color: #94a3b8;
}

.qm-notify-item__time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

.qm-notify-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    flex-shrink: 0;
    margin-top: 6px;
}

.qm-notify-modal__footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.dark .qm-notify-modal__footer {
    border-top-color: #334155;
}

.qm-notify-modal__view-all {
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.qm-notify-modal__view-all:hover {
    opacity: 0.8;
}

.qm-user-menu {
    width: 280px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.dark .qm-user-menu {
    background: #1e293b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.qm-user-menu a {
    text-decoration: none;
}

/* 顶部渐变头部 */
.qm-user-menu__header {
    position: relative;
    padding: 20px 16px 16px;
}

.qm-user-menu__header-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);
    opacity: 0.1;
}

.dark .qm-user-menu__header-bg {
    opacity: 0.2;
}

.qm-user-menu__profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.qm-user-menu__avatar {
    position: relative;
    flex-shrink: 0;
}

.qm-user-menu__avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.dark .qm-user-menu__avatar-img {
    border-color: #334155;
}

.qm-user-menu__avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.qm-user-menu__avatar-badge i {
    font-size: 8px;
    color: #ffffff;
}

.dark .qm-user-menu__avatar-badge {
    border-color: #1e293b;
}

.qm-user-menu__info {
    flex: 1;
    min-width: 0;
}

.qm-user-menu__name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.dark .qm-user-menu__name {
    color: #f1f5f9;
}

.qm-user-menu__level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
}

.qm-user-menu__level i,
.qm-user-menu__level span {
    color: inherit;
}

.qm-user-menu__notify {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    color: #64748b;
    position: relative;
    transition: all 0.2s ease;
}

.qm-user-menu__notify:hover {
    background: #ffffff;
    color: #7c3aed;
    transform: scale(1.05);
}

.dark .qm-user-menu__notify {
    background: rgba(51, 65, 85, 0.8);
    color: #94a3b8;
}

.dark .qm-user-menu__notify:hover {
    background: #334155;
    color: #a78bfa;
}

.qm-user-menu__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
}

/* 数据统计区 */
.qm-user-menu__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.dark .qm-user-menu__stats {
    border-bottom-color: #334155;
}

.qm-user-menu__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.qm-user-menu__stat:hover {
    background: rgba(124, 58, 237, 0.06);
}

.dark .qm-user-menu__stat:hover {
    background: rgba(124, 58, 237, 0.15);
}

.qm-user-menu__stat-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dark .qm-user-menu__stat-value {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
}

.qm-user-menu__stat-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* 快捷操作区 */
.qm-user-menu__quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 16px;
}

.qm-user-menu__quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.qm-user-menu__quick-btn--vip {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.qm-user-menu__quick-btn--vip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.45);
}

.qm-user-menu__quick-btn--checkin {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.qm-user-menu__quick-btn--checkin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
}

/* 功能菜单 - 图标网格 */
.qm-user-menu__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 16px 16px;
}

.qm-user-menu__grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.qm-user-menu__grid-item:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
}

.qm-user-menu__grid-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.12));
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    transition: all 0.2s ease;
}

.qm-user-menu__grid-icon i {
    font-size: 16px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-user-menu__grid-item:hover .qm-user-menu__grid-icon {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}

.qm-user-menu__grid-item:hover .qm-user-menu__grid-icon i {
    background: #ffffff;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-user-menu__grid-text {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
}

.qm-user-menu__grid-item:hover .qm-user-menu__grid-text {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 退出登录特殊样式 */
.qm-user-menu__grid-item--logout .qm-user-menu__grid-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.12));
}

.qm-user-menu__grid-item--logout .qm-user-menu__grid-icon i {
    background: linear-gradient(135deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
}

.qm-user-menu__grid-item--logout:hover .qm-user-menu__grid-icon {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.qm-user-menu__grid-item--logout:hover .qm-user-menu__grid-text {
    background: linear-gradient(135deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
}

/* 暗色模式 */
.dark .qm-user-menu__grid-item:hover {
    background: rgba(124, 58, 237, 0.15);
}

.dark .qm-user-menu__grid-icon {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.2));
}

.dark .qm-user-menu__grid-text {
    color: #94a3b8;
}

.dark .qm-user-menu__grid-item--logout .qm-user-menu__grid-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
}

.qm-checkin-modal.hidden { display: none; }

.qm-checkin-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.qm-checkin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 签到弹窗wrapper - 包裹panel和破界图 */
.qm-checkin-modal__wrapper {
    position: relative;
    animation: checkinModalIn 0.3s ease;
}

.qm-checkin-modal__panel {
    position: relative;
    width: 380px;
    max-width: calc(100vw - 1.5rem);
    background: #ffffff;
    overflow: hidden;
    border-radius: 24px;
    clip-path: path('M24,0 L266,0 Q278,0 284,10 L311,50 Q317,60 330,60 L356,60 Q380,60 380,84 L380,476 Q380,500 356,500 L24,500 Q0,500 0,476 L0,24 Q0,0 24,0 Z');
    /* 多层阴影增加立体感 */
    box-shadow: 
        0 4px 6px rgba(124, 58, 237, 0.1),
        0 10px 20px rgba(124, 58, 237, 0.15),
        0 30px 60px rgba(124, 58, 237, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

@keyframes checkinModalIn {
    from { opacity: 0; transform: translate3d(0, 20px, 0) scale(0.95); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.dark .qm-checkin-modal__panel {
    background: #1e293b;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.qm-checkin-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.qm-checkin-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* 签到弹窗破界图 */
.qm-checkin-modal__breakout {
    position: absolute;
    top: -25px;
    right: -15px;
    width: 130px;
    height: 130px;
    z-index: 15;
    pointer-events: none;
    animation: checkinBreakoutFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 25px rgba(124, 58, 237, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.qm-checkin-modal__breakout img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes checkinBreakoutFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(2deg); }
    50% { transform: translateY(-10px) rotate(-1deg); }
    75% { transform: translateY(-4px) rotate(1deg); }
}

/* hover时破界图效果 */
.qm-checkin-modal__wrapper:hover .qm-checkin-modal__breakout {
    transform: translateY(-12px) rotate(-5deg) scale(1.08);
    filter: drop-shadow(0 15px 35px rgba(124, 58, 237, 0.4));
}

.dark .qm-checkin-modal__close {
    background: rgba(0, 0, 0, 0.2);
}

.qm-checkin-modal__header {
    padding: 28px 20px 24px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* 几何装饰 - 大圆 */
.qm-checkin-modal__header:before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: checkinCircle1 8s linear infinite;
}

/* 几何装饰 - 小圆 */
.qm-checkin-modal__header:after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 80px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: checkinCircle2 6s ease-in-out infinite;
}

@keyframes checkinCircle1 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes checkinCircle2 {
    0%, 100% { transform: scale(1); opacity: 0.08; }
    50% { transform: scale(1.2); opacity: 0.15; }
}

.qm-checkin-modal__header-text {
    position: relative;
    z-index: 3;
}

/* 光泽层 */
.qm-checkin-modal__header-text:before {
    content: '';
    position: absolute;
    top: -28px;
    left: -20px;
    right: -20px;
    height: 60px;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: -1;
}

/* 三角形装饰 */
.qm-checkin-modal__header-text:after {
    content: '';
    position: absolute;
    top: -10px;
    right: 120px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid rgba(255, 255, 255, 0.2);
    animation: checkinTriangle 3s ease-in-out infinite;
}

@keyframes checkinTriangle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(10deg); }
}

.qm-checkin-modal__title {
    font-weight: 800;
    font-size: 24px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.qm-checkin-modal__subtitle {
    margin-top: 8px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0.9;
}

.qm-checkin-modal__subtitle span {
    font-weight: 800;
    font-size: 20px;
}

.qm-checkin-modal__content {
    padding: 20px;
    background: #ffffff;
}

.dark .qm-checkin-modal__content {
    background: #1e293b;
}

.qm-checkin-modal__hint {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.dark .qm-checkin-modal__hint {
    color: #94a3b8;
}

.qm-checkin-modal__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.qm-checkin-day {
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    padding: 12px;
    min-height: 70px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.dark .qm-checkin-day {
    border-color: #334155;
    background: #0f172a;
}

.qm-checkin-day__title {
    font-weight: 700;
    font-size: 12px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    z-index: 1;
}

.qm-checkin-day__reward {
    margin-top: 8px;
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.dark .qm-checkin-day__reward {
    color: #e2e8f0;
}

/* 图标作为背景装饰 */
.qm-checkin-day__icon {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
    font-size: 18px;
    opacity: 0.6;
    z-index: 0;
}

.qm-checkin-day__icon i {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 已签到状态 */
.qm-checkin-day--done {
    border-color: rgba(124, 58, 237, 0.2);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
}

.qm-checkin-day--done .qm-checkin-day__icon {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.15));
    opacity: 0.8;
}

/* 当前可签到状态 */
.qm-checkin-day--active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.12));
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.qm-checkin-day--active .qm-checkin-day__title {
    font-weight: 800;
}

.qm-checkin-day--active .qm-checkin-day__icon {
    opacity: 0.8;
}

/* 第7天特殊样式 - 横跨两列 */
.qm-checkin-day--wide {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: auto;
    padding: 14px 16px;
}

.qm-checkin-day--wide .qm-checkin-day__reward {
    margin-top: 0;
    font-size: 15px;
    font-weight: 800;
}

.qm-checkin-day--wide .qm-checkin-day__icon {
    right: -12px;
    bottom: -12px;
    width: 56px;
    height: 56px;
    font-size: 22px;
}

.qm-checkin-modal__btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
    transition: all 0.2s ease;
}

.qm-checkin-modal__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(124, 58, 237, 0.45);
}

.qm-checkin-modal__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.qm-checkin-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.dark .qm-checkin-modal__footer {
    border-top-color: #334155;
}

.qm-checkin-modal__streak {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
}

.qm-checkin-modal__streak span {
    font-weight: 800;
    margin: 0 2px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dark .qm-checkin-modal__streak {
    color: #94a3b8;
}

.qm-checkin-modal__remind {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    cursor: pointer;
    position: relative;
}

.qm-checkin-modal__remind-text {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
}

.dark .qm-checkin-modal__remind-text {
    color: #94a3b8;
}

.qm-checkin-modal__remind-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.qm-checkin-modal__switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #e2e8f0;
    position: relative;
    transition: background 0.2s ease;
}

.dark .qm-checkin-modal__switch {
    background: #334155;
}

.qm-checkin-modal__switch:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.qm-checkin-modal__remind-input:checked + .qm-checkin-modal__switch {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}

.qm-checkin-modal__remind-input:checked + .qm-checkin-modal__switch:after {
    transform: translateX(20px);
}

.qm-checkin-modal__message {
    margin-top: 12px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.qm-checkin-modal__message--success { 
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-checkin-modal__message--error { 
    color: #ef4444; 
}

.dark .qm-checkin-modal__message {
    color: #e2e8f0;
}

/* 文章内容样式 */
.prose img {
    border-radius: 0.5rem;
    margin: 1.5rem auto;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose pre {
    background: #1f2937;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.prose code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

/* 行数限制 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    background: #fff;
    border-radius: 0.5rem;
    color: #4b5563;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #2563eb;
    color: #fff;
}

/* 分类列表样式 */
.widget ul li {
    list-style: none;
}

.widget ul li a {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
    transition: color 0.2s;
}

.widget ul li a:hover {
    color: #2563eb;
}

/* 标签样式 */
.tag-cloud-link,
.post-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #4b5563;
    transition: all 0.2s;
}

.tag-cloud-link:hover,
.post-tags a:hover {
    background: #2563eb;
    color: #fff;
}

/* 评论样式 */
.comment-list {
    list-style: none;
    padding: 0;
    display: block;
    width: 100%;
}

.comment {
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    display: block;
    width: 100%;
}

.comment-author {
    font-weight: 600;
    color: #1f2937;
}

.comment-meta {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* 点赞按钮动画 */
.like-btn.liked {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}



/* 移动端菜单 */
#mobile-menu .menu {
    padding: 0.5rem 0;
}

#mobile-menu .menu li a {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}


/* 移动端子菜单 */
.mobile-submenu-toggle i.rotate-180 {
    transform: rotate(180deg);
}

.mobile-submenu-toggle i {
    transition: transform 0.2s ease;
}


/* 隐藏滚动条 */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.qm-slider {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: 0 18px 60px rgba(17, 24, 39, 0.12);
}

/* 全屏模式 - 贴近浏览器边缘，紧贴导航栏 */
.qm-slider--fullscreen {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: -4px;
    padding-top: 0;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

/* 处理 WordPress admin bar 情况 */
.admin-bar .qm-slider--fullscreen {
    margin-top: -4px;
}

.dark .qm-slider {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(236, 72, 153, 0.10));
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.dark .qm-slider--fullscreen {
    background: transparent;
    border: none;
    box-shadow: none;
}

.qm-slider__slides {
    position: relative;
    height: var(--qm-slider-height, 560px);
}

/* 移动端使用移动端高度 */
@media (max-width: 1023px) {
    .qm-slider__slides {
        height: var(--qm-slider-height-mobile, 300px);
    }
}

.qm-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.015);
    transition: opacity 0.35s ease, transform 0.5s ease;
}

.qm-slide.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.qm-slide__link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.qm-slide__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 视频封面图 - 视频未加载时显示 */
.qm-slide__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* 视频加载后隐藏封面图 */
.qm-slide video.is-loaded + .qm-slide__poster {
    opacity: 0;
    pointer-events: none;
}

.qm-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(17, 24, 39, 0.35);
    color: rgba(255, 255, 255, 0.96);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 2;
}

.qm-slider__nav:hover {
    background: rgba(17, 24, 39, 0.5);
    transform: translateY(-50%) scale(1.03);
}

.qm-slider__nav--prev { left: 1rem; }
.qm-slider__nav--next { right: 1rem; }

.qm-slider__dots {
    position: absolute;
    left: 50%;
    bottom: 0.9rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.qm-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.16);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.qm-slider__dot.is-active {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.15);
}


.qm-tile {
    position: relative;
    display: block;
    border-radius: 1.25rem;
    overflow: hidden;
    min-height: 220px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.10);
    box-shadow: 0 18px 60px rgba(17, 24, 39, 0.10);
    text-decoration: none;
}

.qm-tile--lg {
    min-height: 460px;
}

/* 三合一布局网格 */
.qm-three-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* 移动端：大图在上，两小图并排在下 */
.qm-tile--main {
    height: 140px;
    min-height: auto;
}

.qm-three-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.qm-tile--sub {
    height: 90px;
    min-height: auto;
}

/* 桌面端：左大右上下 */
@media (min-width: 1024px) {
    .qm-three-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        flex-direction: row;
    }
    
    .qm-tile--main {
        min-height: 460px;
    }
    
    .qm-three-side {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .qm-tile--sub {
        flex: 1;
        min-height: 0;
    }
}

.qm-tile__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dark .qm-tile {
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}


.qm-hero {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    height: 420px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: 0 18px 60px rgba(17, 24, 39, 0.12);
}

/* 移动端大图高度调小 */
@media (max-width: 767px) {
    .qm-hero {
        height: 180px;
    }
}

.qm-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qm-hero__link {
    display: block;
    width: 100%;
    height: 100%;
}

.qm-cards {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
}

/* 平板端（768 ~ 1023）: 让卡片更接近移动端体验，避免内容挤压导致“混乱/重叠” */
@media (min-width: 768px) and (max-width: 1023px) {
    .qm-cards {
        gap: 0.75rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    /* 平板端对 folder 卡片内部进行适度缩放，避免右侧破界图/文字区互相挤压 */
    .qm-folder-card__content {
        left: 1rem;
        right: 72px;
    }
    
    .qm-folder-card__title {
        font-size: 0.95rem;
        line-height: 1.2;
        margin-bottom: 0.2rem;
    }
    
    .qm-folder-card__subtitle {
        font-size: 0.72rem;
        line-height: 1.3;
    }
    
    .qm-folder-card__breakout {
        width: 72px;
        height: 72px;
        top: -12px;
        right: -6px;
    }
}

/* 桌面端（>= 1024）根据 data-cols 设置列数 */
@media (min-width: 1024px) {
    .qm-cards {
        gap: 0.6rem;
        /* 让 1024+ 根据可用宽度自动提升到 4+ 列 */
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }
}

/* 大屏进一步增加最小列宽，避免卡片过窄导致内容挤压 */
@media (min-width: 1280px) {
    .qm-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (min-width: 1536px) {
    .qm-cards {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* >=1024 永远自适应：不再使用后台 data-cols 覆盖列数 */

/* 图片卡片 */
.qm-card-img {
    display: block;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qm-card-img img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.qm-card-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ========== 异形卡片（斜切缺口样式） ========== */
.qm-cards--folder {
    gap: 1rem;
}

@media (min-width: 768px) {
    .qm-cards--folder {
        gap: 1.25rem;
    }
}

/* 异形卡片主体 - 参考图“糖果渐变 + 立体贴纸”风格 */
.qm-folder-card {
    --qm-card-bg-1: #a78bfa;
    --qm-card-bg-2: #60a5fa;
    --qm-card-bg-3: #34d399;

    position: relative;
    display: block;
    text-decoration: none;
    transition: transform 0.25s ease, filter 0.25s ease;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    border-radius: 1.25rem;

    background: linear-gradient(135deg, var(--qm-card-bg-1), var(--qm-card-bg-2));
    box-shadow:
        0 14px 30px rgba(15, 23, 42, 0.18),
        0 6px 12px rgba(15, 23, 42, 0.10);
}

/* 多彩渐变（循环） */
.qm-folder-card:nth-child(4n+1) {
    --qm-card-bg-1: #a7f3d0;
    --qm-card-bg-2: #34d399;
    --qm-card-bg-3: #22c55e;
}

.qm-folder-card:nth-child(4n+2) {
    --qm-card-bg-1: #93c5fd;
    --qm-card-bg-2: #60a5fa;
    --qm-card-bg-3: #3b82f6;
}

.qm-folder-card:nth-child(4n+3) {
    --qm-card-bg-1: #fbcfe8;
    --qm-card-bg-2: #f472b6;
    --qm-card-bg-3: #ec4899;
}

.qm-folder-card:nth-child(4n+4) {
    --qm-card-bg-1: #ddd6fe;
    --qm-card-bg-2: #a78bfa;
    --qm-card-bg-3: #7c3aed;
}

/* 棋盘格纹理 + 高光 */
.qm-folder-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 55%),
        linear-gradient(45deg, rgba(255,255,255,0.22) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.22) 75%, rgba(255,255,255,0.22)),
        linear-gradient(45deg, rgba(255,255,255,0.22) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.22) 75%, rgba(255,255,255,0.22));
    background-size: auto, 22px 22px, 22px 22px;
    background-position: 0 0, 0 0, 11px 11px;
    opacity: 0.42;
    pointer-events: none;
    z-index: 1;
}

/* 贴纸描边 + 底部彩条 */
.qm-folder-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.55) inset,
        0 0 0 1px rgba(15, 23, 42, 0.08) inset;
    background: linear-gradient(90deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0));
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.qm-folder-card:hover {
    transform: translateY(-6px) scale(1.01);
    filter: drop-shadow(0 18px 40px rgba(15, 23, 42, 0.22));
}

/* SVG 边框（作为底板） */
.qm-folder-card__border {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100px;
    opacity: 0.92;
}

/* 文字内容 - 绝对定位在卡片内 */
.qm-folder-card__content {
    position: absolute;
    top: 50%;
    left: 1.1rem;
    right: 120px;
    transform: translateY(-50%);
    z-index: 5;
    min-width: 0;
}

/* 标题（白字黑描边） */
.qm-folder-card__title {
    display: block;
    font-size: clamp(1.05rem, 1.6vw, 1.45rem);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.05;
    margin-bottom: 0.12rem;
    letter-spacing: 0.01em;

    position: relative;
    z-index: 20;

    /* 黑描边（多重阴影模拟） */
    text-shadow:
        -2px -2px 0 rgba(0,0,0,0.85),
        2px -2px 0 rgba(0,0,0,0.85),
        -2px 2px 0 rgba(0,0,0,0.85),
        2px 2px 0 rgba(0,0,0,0.85),
        0 6px 18px rgba(0,0,0,0.25);

    padding: 0.12em 0.18em;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: visible;
}

/* 副标题 */
.qm-folder-card__subtitle {
    font-size: clamp(0.7rem, 1.05vw, 0.9rem);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);

    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: visible;
}

/* 右侧破界图 - 位置往上 */
.qm-folder-card__breakout {
    position: absolute;
    top: -18px;
    right: -8px;
    width: 115px;
    height: 115px;
    z-index: 10;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.20));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    pointer-events: none;
}

.qm-folder-card__breakout img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 隐藏不需要的元素 */
.qm-folder-card__tab,
.qm-folder-card__icon,
.qm-folder-card__body {
    display: none;
}

/* Hover 效果 */
.qm-folder-card:hover .qm-folder-card__breakout {
    transform: translateY(-6px) scale(1.10) rotate(-6deg);
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.24));
}

/* ========== 暗色模式 ========== */
.dark .qm-folder-card {
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 10px 20px rgba(0, 0, 0, 0.35);
}

.dark .qm-folder-card::before {
    opacity: 0.34;
}

.dark .qm-folder-card::after {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.10) inset,
        0 0 0 1px rgba(0, 0, 0, 0.22) inset;
}

/* ========== 异形卡片移动端适配 ========== */
@media (max-width: 767px) {
    /* 移动端卡片容器 - 2列显示 */
    .qm-cards--folder {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* 移动端根据 data-cols-mobile 隐藏多余卡片 */
    /* 移动端显示2个 */
    .qm-cards--folder[data-cols-mobile="2"] .qm-folder-card:nth-child(n+3) {
        display: none;
    }
    /* 移动端显示3个 */
    .qm-cards--folder[data-cols-mobile="3"] .qm-folder-card:nth-child(n+4) {
        display: none;
    }
    /* 移动端显示4个 */
    .qm-cards--folder[data-cols-mobile="4"] .qm-folder-card:nth-child(n+5) {
        display: none;
    }
    /* 移动端显示5个 */
    .qm-cards--folder[data-cols-mobile="5"] .qm-folder-card:nth-child(n+6) {
        display: none;
    }
    /* 移动端显示6个 - 不隐藏 */
    
    /* 移动端卡片主体 */
    .qm-folder-card {
        min-height: 75px;
    }
    
    /* 移动端 SVG 边框高度 */
    .qm-folder-card__border {
        min-height: 75px;
    }
    
    /* 移动端文字内容 */
    .qm-folder-card__content {
        left: 0.75rem;
        right: 55px;
    }
    
    /* 移动端标题 */
    .qm-folder-card__title {
        font-size: 0.85rem;
        margin-bottom: 0.1rem;
        line-height: 1.2;
    }
    
    /* 移动端副标题 - 确保显示 */
    .qm-folder-card__subtitle {
        display: block !important;
        font-size: 0.65rem;
        line-height: 1.3;
        opacity: 0.9;
    }
    
    /* 移动端破界图 - 缩小尺寸 */
    .qm-folder-card__breakout {
        top: -8px;
        right: -4px;
        width: 55px;
        height: 55px;
    }
    
    /* 移动端 hover 效果减弱 */
    .qm-folder-card:hover {
        transform: translateY(-3px);
    }
    
    .qm-folder-card:hover .qm-folder-card__breakout {
        transform: scale(1.08) rotate(-3deg);
    }
}

/* 小屏手机适配 (< 400px) */
@media (max-width: 400px) {
    .qm-cards--folder {
        gap: 0.5rem;
    }
    
    .qm-folder-card {
        min-height: 60px;
    }
    
    .qm-folder-card__border {
        min-height: 60px;
    }
    
    .qm-folder-card__content {
        left: 0.5rem;
        right: 45px;
    }
    
    .qm-folder-card__title {
        font-size: 0.75rem;
    }
    
    .qm-folder-card__subtitle {
        font-size: 0.6rem;
        display: none; /* 小屏隐藏副标题 */
    }
    
    .qm-folder-card__breakout {
        top: -6px;
        right: -3px;
        width: 45px;
        height: 45px;
    }
}

/* ========== 签到破界卡片 ========== */
.qm-checkin-card {
    position: relative;
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    cursor: pointer;
}

.qm-checkin-card:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.18));
}

.qm-checkin-card__border {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100px;
}

/* 使用伪元素实现渐变 */
.qm-checkin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 3;
    clip-path: polygon(0 0, 70% 0, 82.5% 29%, 100% 29%, 100% 100%, 0 100%);
    border-radius: 12px 0 0 0;
}

.qm-checkin-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.2));
    z-index: 4;
    border-radius: 0 0 12px 12px;
}

.qm-checkin-card__content {
    position: absolute;
    top: 50%;
    left: 1.5rem;
    right: 120px;
    transform: translateY(-50%);
    z-index: 5;
}

.qm-checkin-card__title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 0.4rem;
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(0, 0, 0, 0.2);
}

.qm-checkin-card__subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.qm-checkin-card__breakout {
    position: absolute;
    top: -18px;
    right: -8px;
    width: 115px;
    height: 115px;
    z-index: 10;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.15));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    pointer-events: none;
}

.qm-checkin-card__breakout img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qm-checkin-card:hover .qm-checkin-card__breakout {
    transform: scale(1.12) rotate(-5deg);
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.2));
}

.qm-checkin-card:hover::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 100%);
}

/* 暗色模式 */
.dark .qm-checkin-card {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.dark .qm-checkin-card:hover {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.5));
}

.dark .qm-checkin-card::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.dark .qm-checkin-card::after {
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
}

/* 保留旧的 qm-card 样式用于其他地方 */
.qm-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(124, 58, 237, 0.10);
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.qm-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(380px 200px at 15% 30%, rgba(124, 58, 237, 0.18), transparent 58%),
        radial-gradient(360px 200px at 80% 20%, rgba(236, 72, 153, 0.14), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.qm-card:hover {
    transform: translateY(-2px);
    border-color: rgba(236, 72, 153, 0.22);
    box-shadow: 0 22px 60px rgba(17, 24, 39, 0.12);
}

.qm-card:hover::before {
    opacity: 1;
}

.qm-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(59, 130, 246, 0.14));
    color: #7c3aed;
    flex: 0 0 44px;
    position: relative;
    z-index: 1;
}

.qm-card__icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.qm-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.qm-card__title {
    font-weight: 900;
    color: #111827;
    line-height: 1.2;
}

.qm-card__desc {
    font-size: 12px;
    color: rgba(75, 85, 99, 0.92);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qm-card__arrow {
    margin-left: auto;
    color: rgba(124, 58, 237, 0.78);
    position: relative;
    z-index: 1;
}

.dark .qm-hero,
.dark .qm-card {
    background: rgba(17, 24, 39, 0.65);
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.dark .qm-card__title {
    color: rgba(243, 244, 246, 0.98);
}

.dark .qm-card__desc {
    color: rgba(156, 163, 175, 0.92);
}

/* 移动端响应式调整 - 移除旧的媒体查询 */


/* ========== 现代暗色模式 ========== */
/* 使用 Slate 色系替代 Gray，更现代清爽 */

/* 页面背景 */
.dark body,
body.dark {
    background-color: #0f172a;
}

/* 导航栏 */
.dark header {
    background: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark header .bg-white {
    background: #0f172a !important;
}

.dark header .bg-gray-50\/80,
.dark header .bg-gray-800\/80 {
    background: rgba(15, 23, 42, 0.9) !important;
}

/* 卡片和容器 */
.dark .bg-white {
    background: #1e293b !important;
}

.dark .bg-gray-800 {
    background: #1e293b !important;
}

.dark .bg-gray-900 {
    background: #0f172a !important;
}

/* 边框 */
.dark .border-gray-700,
.dark .border-gray-600 {
    border-color: #334155 !important;
}

/* 文字颜色 */
.dark .text-gray-100 {
    color: #f1f5f9 !important;
}

.dark .text-gray-200 {
    color: #e2e8f0 !important;
}

.dark .text-gray-300 {
    color: #cbd5e1 !important;
}

.dark .text-gray-400 {
    color: #94a3b8 !important;
}

/* 输入框和表单 */
.dark input,
.dark select,
.dark textarea {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #64748b;
}

/* 悬停效果 */
.dark .hover\:bg-gray-700:hover {
    background: #334155 !important;
}

.dark .hover\:bg-gray-100:hover {
    background: #334155 !important;
}

/* 下拉菜单 */
.dark .dropdown-menu .bg-white {
    background: #1e293b !important;
    border-color: #334155;
}

.dark .dropdown-item:hover {
    background: rgba(124, 58, 237, 0.15) !important;
}

.dark .dropdown-item .item-title {
    color: #e2e8f0;
}

.dark .dropdown-item .icon-wrap {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.15));
}

/* 导航链接 */
.dark .nav-link {
    color: #cbd5e1;
}

.dark .nav-link:hover,
.dark .nav-link.active {
    color: #a78bfa;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.1));
}

.dark .nav-item-secondary {
    color: #94a3b8;
}

.dark .nav-item-secondary:hover {
    color: #a78bfa;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.08));
}

/* 搜索框 */
.dark .bg-gray-100 {
    background: #1e293b !important;
}

/* 移动端菜单 */
.dark #mobile-menu {
    background: #0f172a;
    border-color: #334155;
}

.dark #mobile-menu .bg-gray-50 {
    background: #1e293b !important;
}

/* 小工具/侧边栏 */
.dark .widget {
    background: #1e293b;
    border-color: #334155;
}

/* 文章卡片 */
.dark .post-card,
.dark article {
    background: #1e293b;
    border-color: #334155;
}

/* 渐变色在暗色模式下更鲜艳 */
.dark .bg-gradient-to-r.from-purple-500,
.dark .bg-gradient-to-r.from-blue-500 {
    filter: brightness(1.1) saturate(1.1);
}

/* 阴影调整 */
.dark .shadow,
.dark .shadow-sm,
.dark .shadow-lg,
.dark .shadow-xl {
    --tw-shadow-color: rgba(0, 0, 0, 0.4);
}


/* ========== 搜索弹窗 ========== */
.qm-search-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 100px 1rem 1rem;
}

.qm-search-modal.hidden {
    display: none;
}

.qm-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.qm-search-modal__panel {
    position: relative;
    width: 560px;
    max-width: calc(100vw - 2rem);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(124, 58, 237, 0.25);
    overflow: hidden;
    animation: searchModalIn 0.2s ease;
}

@keyframes searchModalIn {
    from { opacity: 0; transform: translate3d(0, -20px, 0) scale(0.96); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.dark .qm-search-modal__panel {
    background: #1e293b;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.qm-search-modal__header {
    padding: 0;
}

.qm-search-modal__form {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.qm-search-modal__icon {
    font-size: 18px;
    color: #9ca3af;
    flex-shrink: 0;
}

.qm-search-modal__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    background: transparent;
}

.qm-search-modal__input::placeholder {
    color: #9ca3af;
}

.dark .qm-search-modal__input {
    color: #f1f5f9;
}

.qm-search-modal__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.qm-search-modal__close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.dark .qm-search-modal__close {
    background: #334155;
    color: #94a3b8;
}

.dark .qm-search-modal__close:hover {
    background: #475569;
    color: #f1f5f9;
}

.qm-search-modal__hint {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

.dark .qm-search-modal__hint {
    border-top-color: #334155;
    color: #64748b;
}

/* 搜索类型选择标签 */
.qm-search-modal__tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
}

.dark .qm-search-modal__tabs {
    border-top-color: #334155;
}

.qm-search-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qm-search-tab:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
    color: #7c3aed;
}

.qm-search-tab.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.qm-search-tab i {
    font-size: 14px;
}

.dark .qm-search-tab {
    border-color: #334155;
    background: #0f172a;
    color: #94a3b8;
}

.dark .qm-search-tab:hover {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

.dark .qm-search-tab.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #ffffff;
}


/* ========== 用户中心头像框（SVG 图片） ========== */
.qm-avatar-frame {
    /* 头像框资源为 120x120，默认按 120 渲染（其他位置可通过 CSS 变量覆盖） */
    --qm-avatar-size: 120px;
    /* 内圈尺寸：根据边框图片实际内圈大小调整，确保头像填满边框内部 */
    --qm-avatar-inner: 85px;

    position: relative;
    width: var(--qm-avatar-size);
    height: var(--qm-avatar-size);
    display: inline-block;
}

.qm-avatar-frame__svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;

    /* 默认使用 1.webp，具体等级在模板中通过 inline style 覆盖 */
    background-image: url('../images/avatar-frames/1.webp');
    background-repeat: no-repeat;
    background-position: center;
    /* 使用 cover 确保边框图片完全填满容器 */
    background-size: cover;

    filter: drop-shadow(0 10px 26px rgba(17, 24, 39, 0.18));
}

/* ========== 等级徽章统一尺寸系统 ========== */
/* 基础徽章样式 - 默认中等尺寸（继续放大） */
.qm-level-badge {
    display: inline-block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex: 0 0 auto;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.qm-level-badge:hover {
    transform: scale(1.05);
}

/* 徽章尺寸变体 - 统一管理，便于维护（继续放大） */
.qm-level-badge-sm {
    width: 56px;
    height: 56px;
}

.qm-level-badge-md {
    width: 80px;
    height: 80px;
}

.qm-level-badge-lg {
    width: 100px;
    height: 100px;
}

.qm-level-badge-xl {
    width: 120px;
    height: 120px;
}

/* 内联徽章 - 用于文字旁边（继续放大） */
.qm-level-badge-inline {
    width: 72px;
    height: 72px;
    margin-left: 10px;
    vertical-align: middle;
}

/* 头像上的徽章 - 小尺寸（继续放大） */
.qm-level-badge-avatar {
    width: 40px;
    height: 40px;
    position: absolute;
    bottom: -2px;
    right: -2px;
    border-radius: 50%;
    background: white;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 卡片中的徽章 - 中等尺寸（继续放大） */
.qm-level-badge-card {
    width: 80px;
    height: 80px;
}

/* 列表中的徽章 - 小尺寸（继续放大） */
.qm-level-badge-list {
    width: 64px;
    height: 64px;
}

.qm-avatar-frame__inner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--qm-avatar-inner);
    height: var(--qm-avatar-inner);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;

    background: #ffffff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16);
}

.qm-avatar-frame__inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dark .qm-avatar-frame__inner {
    background: #1e293b;
}

/* 头像框位置微调（如果需要） */
.qm-avatar-frame--frame1 .qm-avatar-frame__svg {
    /* 如果边框图片需要微调位置，可以在这里调整 */
    /* transform: translate(-6%, 2%); */
}

.qm-avatar-frame--sm {
    --qm-avatar-size: 96px;
    /* 内圈约为外框的 71% */
    --qm-avatar-inner: 68px;
}

.qm-avatar-frame--sm.qm-avatar-frame--frame1 .qm-avatar-frame__svg {
    transform: translate(-6%, 2%);
}

.qm-avatar-frame-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
    z-index: 0;
}

.qm-avatar-frame-wrapper img {
    position: relative;
    z-index: 1;
    display: block;
    border-radius: 9999px;
}

.qm-avatar-frame-wrapper .qm-avatar-frame-img {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.qm-avatar-with-frame {
    border: none !important;
    box-shadow: none !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9999px;
}

/* ========== 主菜单溢出折叠 ========== */
#qm-primary-nav {
    flex: 1;
    min-width: 0;
    overflow: visible;
    align-items: center;
}

/* 确保 lg 断点以上才显示 flex */
@media (min-width: 1024px) {
    #qm-primary-nav {
        display: flex;
    }
}

.nav-link--main {
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link--more {
    padding: 0.5rem 0.625rem !important;
}

.nav-link--more i {
    font-size: 1rem;
}

/* 更多菜单下拉样式 */
#qm-more-menu {
    flex-shrink: 0;
    margin-left: 0.25rem;
}

#qm-more-menu .dropdown-menu {
    min-width: 180px;
}

#qm-more-menu-list a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

#qm-more-menu-list a:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
    color: #7c3aed;
}

#qm-more-menu-list a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: #9ca3af;
}

#qm-more-menu-list a:hover i {
    color: #7c3aed;
}

.dark #qm-more-menu-list a {
    color: #e2e8f0;
}

.dark #qm-more-menu-list a:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

.dark #qm-more-menu-list a i {
    color: #64748b;
}

.dark #qm-more-menu-list a:hover i {
    color: #a78bfa;
}

/* 更多菜单 hover 显示 */
#qm-more-menu:hover .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

/* ========== 副菜单溢出折叠 ========== */
#qm-secondary-nav {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.nav-item--secondary {
    flex-shrink: 0;
}

#qm-secondary-more-menu {
    flex-shrink: 0;
    margin-left: 0.25rem;
}

#qm-secondary-more-menu .dropdown-menu {
    min-width: 180px;
}

#qm-secondary-more-list a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

#qm-secondary-more-list a:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1));
    color: #7c3aed;
}

#qm-secondary-more-list a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: #9ca3af;
}

#qm-secondary-more-list a:hover i {
    color: #7c3aed;
}

.dark #qm-secondary-more-list a {
    color: #e2e8f0;
}

.dark #qm-secondary-more-list a:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

.dark #qm-secondary-more-list a i {
    color: #64748b;
}

.dark #qm-secondary-more-list a:hover i {
    color: #a78bfa;
}

/* 副菜单更多菜单 hover 显示 */
#qm-secondary-more-menu:hover .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

