/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 暗色主题 */
body.theme-dark {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* 防止页面加载时的闪屏 - 使用更平滑的方式 */
html {
    scroll-behavior: smooth;
    /* 移动端固定滚动条，防止滚动时抖动 */
    -webkit-overflow-scrolling: touch;
}

/* 移动端优化滚动体验 */
body {
    /* 防止移动端滚动时的弹性效果导致页面抖动 */
    overscroll-behavior-y: contain;
    /* 固定滚动位置 */
    position: relative;
}

/* 优化渲染性能 */
.page-layout {
    will-change: auto;
    contain: layout style paint;
}

/* 主布局 - 侧边栏 + 内容区 */
.page-layout {
    display: flex;
    height: calc(100vh - 80px - 50px); /* 减去header和footer高度 */
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    overflow: hidden;
}

/* 侧边栏样式 */
.user-sidebar {
    width: 80px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    cursor: default;
    will-change: width;
    backface-visibility: hidden;
    transform: translateZ(0);
    flex-shrink: 0;
    /* 确保侧边栏在最上层，可以正常点击 */
    z-index: 10;
    /* 确保侧边栏内的所有元素都可以交互 */
    pointer-events: auto;
}

/* 右侧边栏样式 - 固定展开状态 */
.user-sidebar-right {
    width: 260px !important;
}

/* 隐藏右侧边栏的切换按钮 */
.user-sidebar-right .sidebar-toggle-btn {
    display: none;
}

/* 右侧边栏用户信息样式 */
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 0 5px 0;
}

.sidebar-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s;
}

.sidebar-user-avatar:hover {
    transform: scale(1.05);
}

.sidebar-user-name-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    padding: 0 10px;
    margin: 0;
}

.sidebar-auth-time {
    text-align: center;
    padding: 8px 10px;
    margin-top: 8px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.theme-dark .sidebar-auth-time {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
}

/* 返回按钮样式 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.back-btn:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.back-btn i {
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* 右侧边栏用户功能按钮 */
.sidebar-user-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 123, 255, 0.05);
    border: 1px solid rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.sidebar-user-action-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.sidebar-user-action-btn.active {
    background: rgba(0, 123, 255, 0.15);
    border-color: var(--primary-color);
}

.sidebar-user-action-btn i {
    font-size: 1rem;
    color: var(--primary-color);
}

.sidebar-user-action-btn.active i {
    color: var(--primary-color);
}

/* 右侧边栏欢迎卡片样式 */
.sidebar-welcome-card {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

.welcome-card-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.welcome-stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.1);
    transition: all 0.3s;
}

.welcome-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.welcome-sign-action {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* 右侧边栏签到日历样式 */
.sidebar-calendar-card {
    flex: 1;
    padding: 15px;
    overflow: hidden !important; /* 移除滚动条 */
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    position: relative;
}

/* 日历标题 - 不缩放 */
.sidebar-calendar-title {
    flex-shrink: 0 !important;
    z-index: 1;
}

/* 日历内容容器 - 用于整体缩放 */
.sidebar-calendar-content,
#signCalendarSidebar {
    width: 100% !important;
    max-width: 100% !important;
    transform-origin: top center !important;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    will-change: transform;
    /* 确保内容不被裁剪 */
    overflow: visible !important;
    position: relative;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* 右侧边栏已激活卡密信息样式 */
.sidebar-cards-section {
    padding: 18px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-cards-container {
    position: relative;
    overflow: hidden;
}

.sidebar-cards-list {
    position: relative;
    width: 100%;
    min-height: 200px;
    overflow: visible;
    padding-bottom: 16px; /* 为堆叠卡片预留空间 */
}

.sidebar-card-item {
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity, z-index;
}

.sidebar-card-item.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-card-item.stacked {
    opacity: 0.7;
    pointer-events: none;
    cursor: pointer;
}

.sidebar-card-item.stacked:hover {
    opacity: 0.9;
}

/* 从右侧进入的动画 */
.sidebar-card-item.slide-in-right {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 2;
    position: relative;
}

/* 向左滑出的动画 */
.sidebar-card-item.slide-out-left {
    opacity: 0;
    transform: translateX(-100%) scale(0.95);
    pointer-events: none;
    z-index: 1;
    position: absolute;
}

.sidebar-card-item.hidden {
    display: none;
}

.sidebar-card-item {
    /* 信用卡比例：85.60mm : 53.98mm ≈ 1.586 : 1 */
    /* 使用padding-bottom技巧实现宽高比（兼容旧浏览器） */
    padding-bottom: 63.1%; /* 1 / 1.586 ≈ 0.631 */
    min-height: 200px; /* 最小高度备用 */
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

.sidebar-card-item.credit-card-style {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

/* 现代浏览器使用aspect-ratio */
@supports (aspect-ratio: 1.586 / 1) {
    .sidebar-card-item {
        aspect-ratio: 1.586 / 1;
        padding-bottom: 0;
        min-height: 0;
    }
}

/* 卡片指示器 */
.sidebar-cards-indicator {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #999;
    padding: 8px 14px;
    background: rgba(0,0,0,0.04);
    border-radius: 10px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    font-weight: 500;
    border: 1px solid rgba(0,0,0,0.05);
}

.theme-dark .sidebar-cards-indicator {
    background: rgba(255,255,255,0.05);
    color: #ccc;
}

/* 右侧边栏公告样式 */
.sidebar-notice-section {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-notice-box {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
}

.theme-dark .sidebar-notice-box {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
}

.sidebar-card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, rgba(0, 123, 255, 0.3) 100%);
    z-index: 1;
}

.sidebar-card-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.sidebar-card-item.stacked:hover {
    transform: translateY(-1px) scale(1.02);
    opacity: 0.85;
}

.theme-dark .sidebar-card-item {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(0, 123, 255, 0.08) 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.theme-dark .sidebar-card-item:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

/* 卡片过期状态的背景 */
.sidebar-card-item[style*="border-left: 4px solid var(--danger-color)"] {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(220, 53, 69, 0.05) 100%);
}

.sidebar-card-item[style*="border-left: 4px solid var(--danger-color)"]::before {
    background: linear-gradient(90deg, var(--danger-color) 0%, rgba(220, 53, 69, 0.3) 100%);
}

.theme-dark .sidebar-card-item[style*="border-left: 4px solid var(--danger-color)"] {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(220, 53, 69, 0.08) 100%);
}

/* 卡片有效状态的背景 */
.sidebar-card-item[style*="border-left: 4px solid var(--success-color)"] {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.sidebar-card-item[style*="border-left: 4px solid var(--success-color)"]::before {
    background: linear-gradient(90deg, var(--success-color) 0%, rgba(40, 167, 69, 0.3) 100%);
}

.theme-dark .sidebar-card-item[style*="border-left: 4px solid var(--success-color)"] {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(40, 167, 69, 0.08) 100%);
}

/* 侧边栏展开状态（通过JS控制） */
.user-sidebar.expanded {
    width: 200px;
}

.user-sidebar-right.expanded {
    width: 260px;
}

/* 移除过渡效果 */

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 60px;
    box-sizing: border-box;
}

/* 右侧边栏header优化 - 减少空白区域 */
.user-sidebar-right .sidebar-header {
    padding: 15px 15px 10px 15px;
    gap: 8px;
    height: auto;
    min-height: auto;
}

/* 侧边栏展开/折叠按钮 */
.sidebar-toggle-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    flex-shrink: 0;
    padding: 0;
    /* 确保可以正常点击 */
    pointer-events: auto;
    z-index: 2;
    position: relative;
}

.sidebar-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.sidebar-toggle-icon i {
    font-size: 1.2rem;
    color: var(--primary-color);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease, transform 0.15s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 展开状态下，按钮和图标大小与导航图标一致 */
.user-sidebar.expanded .sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 123, 255, 0.15);
}

.user-sidebar.expanded .sidebar-toggle-icon i {
    font-size: 1rem;
}

.sidebar-logo {
    display: none;
    width: 100%;
    text-align: center;
}

/* 展开状态下也隐藏logo文字 */
.user-sidebar.expanded .sidebar-logo {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    /* 确保导航区域可以正常交互 */
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* 展开状态下调整间距 */
.user-sidebar.expanded .sidebar-nav {
    gap: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    vertical-align: middle;
    /* 确保可以正常点击 */
    pointer-events: auto;
    z-index: 1;
}

/* 展开状态下，导航项恢复为正常链接样式 */
.user-sidebar.expanded .sidebar-item {
    cursor: pointer;
}

/* 文字隐藏（桌面端） */
.sidebar-text {
    display: none;
}

.user-sidebar.expanded .sidebar-item {
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 12px;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
    box-sizing: border-box;
}

.user-sidebar.expanded .sidebar-text {
    display: block;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* 图标样式 - 圆形背景 */
.sidebar-icon {
    font-size: 1.2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sidebar-icon i {
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.user-sidebar.expanded .sidebar-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-sidebar.expanded .sidebar-icon i {
    font-size: 1rem;
    width: 100%;
    height: 100%;
}

/* 不同导航项的颜色 */
.sidebar-item-home .sidebar-icon {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.sidebar-item-profile .sidebar-icon {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.sidebar-item-shop .sidebar-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.sidebar-item-logs .sidebar-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.sidebar-item-lottery .sidebar-icon {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
}

.sidebar-item-tickets .sidebar-icon {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
}

.sidebar-item-community .sidebar-icon {
    background: linear-gradient(135deg, #ff9a56, #ff6a88);
    color: white;
}

/* 签到日历月份切换按钮 */
.calendar-month-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 123, 255, 0.05);
    border: 1px solid rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    flex-shrink: 0;
}

.calendar-month-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.calendar-month-btn i {
    font-size: 1rem;
    color: var(--primary-color);
}

.sidebar-item-settings .sidebar-icon {
    background: linear-gradient(135deg, #30cfd0, #330867);
    color: white;
}

.sidebar-item-admin .sidebar-icon {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #333;
}

.sidebar-item-logout .sidebar-icon {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

.sidebar-item-qrcode .sidebar-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* 快捷登录按钮区域（PC端隐藏，仅移动端显示） */
.sidebar-qrcode-login {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-qrcode-login .sidebar-item {
    width: 48px;
    height: 48px;
    margin: 0;
}

.user-sidebar.expanded .sidebar-qrcode-login {
    padding: 12px 16px;
}

.user-sidebar.expanded .sidebar-qrcode-login .sidebar-item {
    width: 100%;
    justify-content: center;
}

/* 退出登录按钮区域 */
.sidebar-logout {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-logout .sidebar-item {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-sidebar.expanded .sidebar-logout {
    padding: 12px 16px;
}

.user-sidebar.expanded .sidebar-logout .sidebar-item {
    width: 100%;
    justify-content: center;
}

/* Font Awesome图标颜色继承 */
.sidebar-icon i,
.qrcode-icon i,
.admin-icon i,
.menu-icon i {
    color: inherit;
}

/* 悬停效果 */
.sidebar-item:hover {
    transform: translateY(-2px);
}

.sidebar-item:hover .sidebar-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 移除悬停效果 */

/* 激活状态 */
.sidebar-item.active {
    background: rgba(0, 123, 255, 0.08);
}

.sidebar-item.active .sidebar-icon {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.sidebar-item.active::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    display: block;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
}

.user-sidebar.expanded .sidebar-item.active {
    background: rgba(0, 123, 255, 0.1);
    border-radius: 12px;
}

.user-sidebar.expanded .sidebar-item.active::after {
    left: 0;
    height: 60%;
}

.user-sidebar.expanded .sidebar-item.active .sidebar-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* Tooltip提示 */
.sidebar-item {
    position: relative;
}

/* 移除tooltip提示效果 */
.user-sidebar.expanded .sidebar-item::before {
    display: none;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
    width: 32px;
    align-self: center;
}

.user-sidebar.expanded .sidebar-divider {
    width: 100%;
    margin: 10px 0;
}

.sidebar-footer {
    padding: 12px 10px;
    flex-shrink: 0;
    display: none;
    justify-content: center;
    align-items: center;
}

.sidebar-footer-copyright {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.user-sidebar.expanded .sidebar-footer {
    display: flex;
    padding: 12px 16px;
}

.user-sidebar.expanded .sidebar-footer-copyright {
    font-size: 0.8rem;
    padding: 10px 14px;
}

.theme-dark .sidebar-footer-copyright {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
}

.sidebar-stats {
    display: flex;
    gap: 15px;
    justify-content: space-around;
}

.sidebar-stat {
    text-align: center;
}

.sidebar-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.theme-dark .sidebar-stat-label {
    color: #aaa;
}

.sidebar-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* 主内容区 */
.main-content-wrapper {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* 移动端优化滚动体验 */
    -webkit-overflow-scrolling: touch;
    /* 防止滚动时的弹性效果 */
    overscroll-behavior-y: contain;
    /* 固定滚动位置，防止抖动 */
    will-change: scroll-position;
    /* 确保不会覆盖侧边栏 */
    position: relative;
    z-index: 1;
    backface-visibility: hidden;
    transform: translateZ(0);
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* 为固定的breadcrumb留出空间 */
    padding-top: 0;
}

/* 确保breadcrumb后面的内容有适当的间距 */
.main-content-wrapper > .breadcrumb + * {
    margin-top: 20px;
}

/* 响应式：移动端优化 */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 15px 15px !important;
        height: 60px;
        line-height: 1;
        font-size: 1rem;
        margin-left: -15px;
        margin-right: -15px;
        gap: 6px;
        position: sticky !important;
        top: 0 !important;
        z-index: 99 !important;
        width: calc(100% + 30px);
    }
    
    .breadcrumb-item {
        gap: 6px;
    }
    
    .breadcrumb-separator {
        font-size: 0.9rem;
    }
}

/* 隐藏Webkit浏览器的滚动条 */
.main-content-wrapper::-webkit-scrollbar {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 - 简化版 */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.logo-badge {
    position: absolute;
    top: -6px;
    left: 100%;
    margin-left: 8px;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    border: 2px solid var(--card-bg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    white-space: nowrap;
    line-height: 1.3;
    text-align: center;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡密角标 - 蓝色 */
.logo-badge.badge-card {
    background: var(--primary-color);
}

/* 未激活角标 - 灰色 */
.logo-badge.badge-inactive {
    background: #6c757d;
    color: #fff;
}

/* 正式会员角标 - 蓝色 */
.logo-badge.badge-member {
    background: var(--primary-color);
    color: #fff;
}

/* 已过期角标 - 红色 */
.logo-badge.badge-expired {
    background: #dc3545;
    color: #fff;
}

/* 管理员角标 - 紫色 */
.logo-badge.badge-admin {
    background: #6f42c1;
    color: #fff;
}

.theme-dark .logo-badge {
    border-color: var(--bg-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 管理后台按钮 */
.admin-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-weight: 500;
    flex-direction: row-reverse;
}

.admin-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-icon i {
    font-size: 1rem;
}

.admin-text {
    display: block;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 6px;
}

.cache-clear-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cache-clear-btn:hover {
    background: rgba(0, 123, 255, 0.1);
}

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

.cache-clear-btn.loading {
    animation: spin 1s linear infinite;
    pointer-events: none;
}

.cache-clear-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.cache-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cache-icon i {
    font-size: 1.2rem;
}

/* 扫码登录按钮 */
.qrcode-login-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-login-btn:hover {
    background: rgba(0, 123, 255, 0.1);
}

.qrcode-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-icon i {
    font-size: 1.2rem;
}

/* 通知按钮样式 */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: rgba(0, 123, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 通知下拉菜单 */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    max-height: 500px;
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.active {
    display: flex;
}

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.notification-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 200px;
    max-height: 400px;
}

.notification-loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notification-loading i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item:hover {
    background: rgba(0, 123, 255, 0.05);
}

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

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.notification-item-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    flex: 1;
}

.notification-item-type {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.notification-item-type.notice {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

.notification-item-type.ticket {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.notification-item-type.read-badge {
    background: rgba(108, 117, 125, 0.1) !important;
    color: #6c757d !important;
    font-size: 0.7rem;
    padding: 2px 6px;
}

.notification-item.read {
    opacity: 0.8;
}

.notification-item.read:hover {
    opacity: 1;
}

.notification-item-content {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.notification-item-time {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

.notification-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

.notification-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.notification-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: -10px;
    }
    
    .notification-item {
        padding: 12px 15px;
    }
}

/* 默认隐藏扫码登录按钮 */
.qrcode-login-btn.mobile-only {
    display: none;
}

/* 移动端显示扫码登录按钮 */
@media (max-width: 768px) {
    .qrcode-login-btn.mobile-only {
        display: flex !important;
    }
    
    /* 移动端显示快捷登录按钮 */
    .sidebar-qrcode-login.mobile-only {
        display: flex !important;
    }
}

/* 用户信息下拉菜单 */
.user-menu-wrapper {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-color);
}

.user-menu-trigger:hover {
    background: rgba(0, 123, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    font-size: 0.7rem;
    color: #999;
    transition: transform 0.3s;
}

.user-menu-wrapper.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.theme-dark .user-menu-dropdown {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.user-menu-wrapper.active .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 1px solid var(--border-color);
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background: rgba(0, 123, 255, 0.1);
    padding-left: 20px;
}

.user-menu-item.active {
    background: rgba(0, 123, 255, 0.15);
    color: var(--primary-color);
    font-weight: 500;
}

.user-menu-item-danger {
    color: var(--danger-color);
}

.user-menu-item-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.menu-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon i {
    font-size: 1rem;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* 移动端头部优化 */
@media (max-width: 768px) {
    .header {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .header-content {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
        line-height: 1.2;
    }
    
    .logo-badge {
        font-size: 0.55rem;
        padding: 2px 6px;
        margin-left: 6px;
        max-width: 80px;
        top: -4px;
    }
    
    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }
    
    .theme-toggle,
    .qrcode-login-btn {
        font-size: 1.1rem;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .notification-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    .admin-btn {
        font-size: 0.85rem;
        padding: 8px 10px;
        gap: 4px;
    }
    
    .admin-text {
        display: none; /* 移动端隐藏文字，只显示图标 */
    }
    
    .admin-icon {
        font-size: 1.1rem;
    }
    
    .notification-badge {
        min-width: 18px;
        height: 18px;
        font-size: 0.7rem;
        padding: 2px 5px;
    }
}

/* 移动端用户菜单样式 */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-menu-trigger {
        padding: 6px;
    }
    
    .user-menu-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }
}

/* 主要内容 */
.main-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* 统一卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

/* 紧凑型卡片（用于已激活卡密信息） */
.card-compact {
    padding: 15px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 移动端卡片优化 */
@media (max-width: 768px) {
    .card {
        padding: 18px;
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .card-header {
        padding-bottom: 12px;
        margin-bottom: 15px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-body {
        font-size: 0.9rem;
    }
}

.theme-dark .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-dark .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* Emby卡片头部更紧凑 */
.emby-info-card .card-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, rgba(102, 126, 234, 0.1) 50%, transparent 100%);
    border-image-slice: 1;
    position: relative;
}

.emby-info-card .card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, transparent);
}

.emby-info-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.emby-info-card .card-title i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.card-body {
    padding: 0;
}

/* 公告框 */
.notice-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.theme-dark .notice-box {
    background: #3d2f00;
    border-color: #ffc107;
}

/* 签到卡片 */
.sign-card {
    text-align: center;
    padding: 20px;
    margin-bottom: 15px;
}

.user-info h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.stat-item {
    padding: 12px;
    background: rgba(0,123,255,0.1);
    border-radius: 8px;
}

.stat-item .label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.theme-dark .stat-item .label {
    color: #aaa;
}

.stat-item .value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.level {
    color: var(--warning-color) !important;
}

.coins {
    color: var(--success-color) !important;
}

.stat-item.expired {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
}

.stat-item .expires {
    font-size: 1.2rem;
}

.stat-item .expires small {
    font-size: 0.75rem;
    display: block;
    margin-top: 3px;
    opacity: 0.8;
}

/* ========================================
   Emby服务器信息卡片样式
   ======================================== */

.emby-info-card {
    margin-top: 20px;
    padding: 20px !important;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(102, 126, 234, 0.02) 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(102, 126, 234, 0.05);
    position: relative;
    overflow: hidden;
    /* 确保卡片本身不会阻止交互 */
    pointer-events: auto;
    /* 确保不会覆盖侧边栏 */
    z-index: 1;
}

.emby-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

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

/* 海报墙卡片样式 */
.poster-wall-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.poster-wall-container {
    min-height: 200px;
    padding: 15px;
    overflow: hidden;
}

.poster-wall-container-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.poster-wall-section {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* 确保横屏图片容器只显示3张 */
.poster-wall-grid-horizontal {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    width: 100%;
    position: relative;
}

/* 确保父容器隐藏超出部分 */
.poster-wall-section:has(.poster-wall-grid-horizontal) {
    overflow: hidden;
    width: 100%;
}

.poster-wall-loading,
.poster-wall-empty,
.poster-wall-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
    text-align: center;
}

.poster-wall-loading i,
.poster-wall-empty i,
.poster-wall-error i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.poster-wall-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 10px 0;
    overflow: hidden;
    position: relative;
}

/* 横屏图片容器 */
.poster-wall-grid-horizontal {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    width: 100%;
    position: relative;
}

/* 竖屏图片容器 */
.poster-wall-grid-vertical {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    width: 100%;
    position: relative;
}

.poster-wall-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 1;
    transform: translateX(0);
}

.poster-wall-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.poster-wall-item.poster-link a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.poster-wall-item img {
    width: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* 横屏图片（默认） */
.poster-wall-item.poster-horizontal img {
    height: 160px;
    aspect-ratio: 16 / 9;
}

/* 竖屏图片 */
.poster-wall-item.poster-vertical img {
    height: 240px;
    aspect-ratio: 9 / 16;
}

.poster-wall-item:hover img {
    transform: scale(1.05);
}

.poster-title {
    padding: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式：移动端优化 */
@media (max-width: 768px) {
    .poster-wall-grid-horizontal {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .poster-wall-grid-vertical {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .poster-wall-item.poster-horizontal img {
        height: 100px;
    }
    
    .poster-wall-item.poster-vertical img {
        height: 150px;
    }
    
    .poster-title {
        font-size: 0.75rem;
        padding: 6px;
    }
}

.theme-dark .emby-info-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(102, 126, 234, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(102, 126, 234, 0.1);
}

.emby-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    flex-wrap: wrap;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.emby-authorization-remaining {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-radius: 12px;
    margin-left: 8px;
    border: 1px solid rgba(0, 123, 255, 0.15);
    transition: all 0.3s;
}

.emby-authorization-remaining:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.12) 0%, rgba(102, 126, 234, 0.08) 100%);
    border-color: rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.emby-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.emby-login-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.emby-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.emby-login-btn i {
    font-size: 0.9rem;
}

.emby-authorization-remaining .authorization-value {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #999;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(153, 153, 153, 0.7);
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: ripple 2s infinite;
}

.status-dot.online {
    background: #28a745;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
}

.status-dot.offline {
    background: #dc3545;
    animation: none;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

.status-dot.loading {
    background: #ffc107;
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
}

.status-text {
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
}

/* 在线时长样式 */
.emby-uptime {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-dark .emby-uptime {
    color: #999;
    border-left-color: rgba(255, 255, 255, 0.1);
}

.emby-uptime i {
    opacity: 0.7;
    font-size: 0.75rem;
}

.emby-uptime .uptime-value {
    color: #666;
    font-weight: 500;
}

.theme-dark .emby-uptime .uptime-value {
    color: #999;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.emby-info-content {
    min-height: 60px; /* 减小最小高度 */
}

.emby-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px; /* 减小内边距 */
    color: var(--text-color);
    opacity: 0.7;
    /* 确保加载状态不会阻止其他元素的交互 */
    pointer-events: none;
    position: relative;
    z-index: 0;
}

.emby-loading i {
    font-size: 1rem; /* 减小图标 */
}

/* 确保Emby卡片内容区域可以正常交互 */
.emby-info-card .card-body {
    /* 确保卡片内容区域可以正常交互 */
    pointer-events: auto;
}

.emby-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* 使用0作为最小值，确保平均分配 */
    gap: 12px;
    margin-top: 10px;
    padding: 2px 0;
    grid-auto-rows: 1fr; /* 确保所有行高度一致 */
    align-items: stretch; /* 拉伸所有卡片到相同高度 */
}

.emby-info-item {
    padding: 12px 14px 28px 14px; /* 增加底部padding为右下角标签留出空间 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(102, 126, 234, 0.03) 100%);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-left: 3px solid var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%; /* 填满网格单元格 */
    min-height: 75px;
    box-sizing: border-box;
}

.emby-info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: transform 0.6s ease-out;
    transform: translateX(0);
    z-index: 0;
    pointer-events: none;
}

.emby-info-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(102, 126, 234, 0.08) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.emby-info-item:hover::before {
    transform: translateX(200%);
}

.theme-dark .emby-info-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

.theme-dark .emby-info-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(102, 126, 234, 0.1) 100%);
}

.emby-info-item-label {
    font-size: 0.7rem;
    color: rgba(102, 126, 234, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 8px;
    right: 10px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.emby-info-item:hover .emby-info-item-label {
    opacity: 1;
}

.theme-dark .emby-info-item-label {
    color: rgba(255, 255, 255, 0.6);
}

.emby-info-item-value {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
    position: relative;
    z-index: 1;
}

.emby-connection-quality {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0;
    margin-top: 0;
    border: 1px solid;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    align-self: flex-end;
}

.emby-connection-quality.excellent {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.3);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.emby-connection-quality.good {
    background: rgba(0, 123, 255, 0.15);
    color: #007bff;
    border-color: rgba(0, 123, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.emby-connection-quality.fair {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.3);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.emby-connection-quality.poor {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.emby-connection-quality.offline {
    background: rgba(108, 117, 125, 0.15);
    color: #6c757d;
    border-color: rgba(108, 117, 125, 0.3);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.emby-signal-strength {
    display: inline-flex;
    gap: 2px;
    align-items: flex-end;
}

.emby-signal-bar {
    width: 4px;
    background: #ddd;
    border-radius: 2px;
    transition: all 0.3s;
}

.emby-signal-bar.active {
    background: #28a745;
}

.emby-signal-bar:nth-child(1) {
    height: 6px;
}

.emby-signal-bar:nth-child(2) {
    height: 9px;
}

.emby-signal-bar:nth-child(3) {
    height: 12px;
}

.emby-signal-bar:nth-child(4) {
    height: 15px;
}

.emby-member-status {
    padding: 8px 12px; /* 减小内边距 */
    border-radius: 6px; /* 减小圆角 */
    margin-top: 10px; /* 减小上边距 */
    font-size: 0.85rem; /* 减小字体 */
}

.emby-member-status p {
    margin: 4px 0 0 0; /* 减小段落间距 */
    font-size: 0.8rem; /* 减小段落字体 */
}

.emby-member-status.active {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.emby-member-status.expired {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.emby-member-status.no-member {
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.3);
    color: #6c757d;
}

/* Emby统计信息样式 - 已合并到主网格，保留样式用于统计项 */

.emby-stat-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(102, 126, 234, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-left: 3px solid;
    border-left-color: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 不同统计项的特殊颜色 */
.emby-stat-movies {
    border-left-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(102, 126, 234, 0.02) 100%);
}

.emby-stat-users {
    border-left-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(40, 167, 69, 0.02) 100%);
}

.emby-stat-online {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 193, 7, 0.02) 100%);
}

.emby-stat-recent {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.08) 0%, rgba(23, 162, 184, 0.02) 100%);
}

.emby-stat-item::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.emby-stat-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(102, 126, 234, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.emby-stat-item:hover::after {
    opacity: 1;
}

.theme-dark .emby-stat-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(102, 126, 234, 0.08) 100%);
}

.theme-dark .emby-stat-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(102, 126, 234, 0.15) 100%);
}

.emby-stat-item .emby-info-item-label {
    font-size: 0.7rem;
    font-weight: 500;
    position: absolute;
    bottom: 8px;
    right: 10px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.emby-stat-item .emby-info-item-label i {
    font-size: 0.75rem;
}

.emby-stat-item:hover .emby-info-item-label {
    opacity: 1;
}

.emby-stat-item .emby-info-item-value {
    font-weight: 700;
    line-height: 1.3;
    font-size: 1.25rem !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.emby-stat-item .emby-info-item-value small {
    font-weight: 400;
    opacity: 0.8;
    font-size: 0.7rem !important;
    display: block;
    margin-top: 3px;
}

.emby-error-message {
    padding: 15px 18px;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    color: #dc3545;
    text-align: center;
    font-size: 0.85rem;
    border-left: 4px solid #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

.emby-not-configured {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, transparent 100%);
    border-radius: 10px;
}

.emby-not-configured i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.emby-not-configured p {
    font-size: 0.9rem;
    margin: 6px 0;
    color: var(--text-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 优化网格布局，使卡片平均分摊面积 */
@media (min-width: 1400px) {
    .emby-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* 大屏幕自动适应，平均分配 */
        gap: 12px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .emby-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* 自动适应，平均分配 */
        gap: 12px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .emby-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* 自动适应，平均分配 */
        gap: 12px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .emby-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* 平板自动适应，平均分配 */
        gap: 10px;
    }
}

@media (max-width: 767px) {
    .emby-info-grid {
        grid-template-columns: repeat(2, 1fr); /* 小屏幕2列，平均分配 */
        gap: 10px;
    }
    
    .emby-status-indicator {
        font-size: 0.8rem;
    }
    
    .emby-login-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .emby-info-card {
        padding: 15px !important;
    }
}

@media (max-width: 480px) {
    .emby-info-grid {
        grid-template-columns: 1fr; /* 超小屏幕1列 */
        gap: 10px;
    }
}

.sign-action {
    margin-top: 20px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.sign-time {
    margin-top: 10px;
    color: #666;
}

.theme-dark .sign-time {
    color: #aaa;
}

.rank-badge {
    margin-top: 10px;
    font-size: 1.2rem;
    color: var(--warning-color);
    font-weight: bold;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: rgba(0,123,255,0.1);
    font-weight: 600;
}

table tr:hover {
    background: rgba(0,123,255,0.05);
}

.positive {
    color: var(--success-color);
}

.negative {
    color: var(--danger-color);
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    position: relative;
    padding-bottom: 50px;
}

.login-footer-fixed {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.login-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 注册卡片样式 */
.register-card-wrapper {
    margin-top: 20px;
}

.register-card {
    display: block;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    cursor: pointer;
    border: 2px dashed #999;
}

.register-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-dark .register-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.register-card-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}

.register-card-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.register-card h3 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.register-card p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: visible;
}

.theme-dark .register-card p {
    color: #aaa;
}

.theme-dark .register-card {
    border-color: #666;
}

/* 登录页面Logo */
.login-logo {
    text-align: center;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 页脚样式 */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    margin-top: 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-info {
    color: #666;
    font-size: 0.9rem;
}

.theme-dark .footer-info {
    color: #aaa;
}

.footer-separator {
    margin: 0 10px;
    color: #999;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.footer-link:hover {
    text-decoration: underline;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.modal-content {
    background: var(--card-bg);
    margin: 20px auto;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-close {
    color: #999;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .disclaimer-section {
    margin-bottom: 25px;
}

.modal-body .disclaimer-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.modal-body .disclaimer-section p {
    line-height: 1.8;
    color: var(--text-color);
}

.modal-body .disclaimer-section ul {
    margin-left: 20px;
    line-height: 1.8;
}

.modal-body .disclaimer-section li {
    margin-bottom: 8px;
}

.modal-body .disclaimer-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.theme-dark .modal-body .disclaimer-footer {
    color: #aaa;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 95vh;
    }
    
    .footer-info {
        font-size: 0.8rem;
    }
    
    .footer-separator {
        margin: 0 5px;
    }
}

/* 提示框 */
.alert {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.theme-dark .alert-error {
    background: #3d1a1d;
    color: #f5c6cb;
    border-color: #721c24;
}

.theme-dark .alert-success {
    background: #1a3d1f;
    color: #c3e6cb;
    border-color: #155724;
}

/* 卡密激活 */
.card-activate {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.card-activate h2 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.card-activate .form-input {
    font-size: 18px;
    padding: 15px;
    text-align: center;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 0 !important;
    margin-left: -15px;
    margin-right: -15px;
    font-size: 1.2rem;
    color: #666;
    padding: 15px !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    line-height: 1 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 99 !important;
    background: var(--bg-color) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: calc(100% + 30px);
    box-sizing: border-box !important;
}

/* 暗色主题下的breadcrumb */
.theme-dark .breadcrumb {
    background: var(--bg-color);
    border-bottom-color: var(--border-color);
    color: #aaa;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-separator {
    color: #999;
    font-size: 1rem;
}

/* 通用区块样式（前台和后台统一） */
.section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.theme-dark .section {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-dark .section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* 签到排行榜样式 */
.rank-section {
    max-width: 50%;
}

.rank-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.rank-list-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

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

.rank-item:hover {
    background: rgba(0, 123, 255, 0.05);
    transform: translateX(4px);
    border-color: rgba(0, 123, 255, 0.2);
}

.theme-dark .rank-item:hover {
    background: rgba(0, 123, 255, 0.1);
}

.rank-item-current {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.12) 0%, rgba(0, 123, 255, 0.06) 100%);
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.rank-number {
    flex-shrink: 0;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-medal {
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.rank-avatar {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.rank-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    transition: all 0.3s;
}

.rank-item-current .rank-avatar img {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.rank-avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rank-user-info {
    flex: 1;
    min-width: 0;
}

.rank-user-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.rank-user-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.rank-consecutive-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.rank-consecutive-badge i {
    font-size: 0.7rem;
}

.rank-sign-time {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-sign-time i {
    font-size: 0.8rem;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .rank-section {
        max-width: 100% !important;
    }
    
    .rank-item {
        padding: 12px;
        gap: 12px;
    }
    
    .rank-avatar {
        width: 48px;
        height: 48px;
    }
    
    .rank-number {
        width: 45px;
    }
    
    .rank-medal {
        font-size: 1.5rem;
    }
    
    .rank-badge {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

.section h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section h2 i {
    color: var(--primary-color);
}

/* 个人中心 */
.profile-info p {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

/* 免责声明 */
.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer-section {
    margin-bottom: 30px;
}

.disclaimer-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.disclaimer-section ul {
    margin-left: 20px;
    margin-top: 10px;
}

.disclaimer-section li {
    margin-bottom: 8px;
}

.disclaimer-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .page-layout {
        flex-direction: column;
        padding-bottom: calc(70px + env(safe-area-inset-bottom)); /* 为底部导航栏和安全区域留出空间 */
    }
    
    .user-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        max-height: none;
        border-radius: 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        border-top: 1px solid var(--border-color);
        background: var(--card-bg);
        height: auto;
        /* 适配iOS安全区域 */
        padding-bottom: env(safe-area-inset-bottom);
        /* 毛玻璃效果（可选） */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .sidebar-header {
        display: none;
    }
    
    .sidebar-toggle-btn {
        display: none;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px 8px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        width: 100%;
        align-items: stretch;
        /* 隐藏滚动条但保持滚动功能 */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar-item {
        flex: 1;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 8px;
        margin-bottom: 0;
        border-radius: 12px;
        text-align: center;
        min-height: 64px;
        width: auto;
        height: auto;
        transition: all 0.2s ease;
        position: relative;
        /* 优化触摸反馈 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* 移动端激活状态优化 */
    .sidebar-item.active {
        background: rgba(0, 123, 255, 0.1);
        color: var(--primary-color);
    }
    
    .sidebar-item.active .sidebar-icon {
        transform: scale(1.1);
    }
    
    .sidebar-item.active::after {
        display: none; /* 移动端不显示左侧指示条 */
    }
    
    /* 移动端触摸反馈 */
    .sidebar-item:active {
        transform: scale(0.95);
        background: rgba(0, 123, 255, 0.15);
    }
    
    .sidebar-item .sidebar-icon {
        font-size: 1.4rem;
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
        transition: transform 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: transparent;
    }
    
    /* 移动端激活状态的图标背景 */
    .sidebar-item.active .sidebar-icon {
        background: rgba(0, 123, 255, 0.15);
    }
    
    .sidebar-item .sidebar-text {
        display: block;
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 500;
        line-height: 1.2;
    }
    
    .sidebar-item::before {
        display: none !important;
    }
    
    .sidebar-divider {
        display: none;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    /* 隐藏次要菜单项，但保留快捷登录按钮 */
    .sidebar-item:not(.main-nav-item):not(.sidebar-item-qrcode),
    .sidebar-item.sidebar-item-danger,
    .sidebar-divider {
        display: none;
    }
    
    /* 移动端显示快捷登录按钮 */
    .sidebar-qrcode-login.mobile-only {
        display: flex !important;
        padding: 0;
        border-top: none;
        margin-top: 0;
    }
    
    .sidebar-qrcode-login.mobile-only .sidebar-item {
        flex: 1;
        min-height: 64px;
    }
    
    /* 移动端显示退出登录按钮 */
    .sidebar-logout {
        display: flex !important;
        padding: 0;
        border-top: none;
        margin-top: 0;
    }
    
    .sidebar-logout .sidebar-item {
        flex: 1;
        min-height: 64px;
    }
    
    /* 只显示主要导航项 */
    .sidebar-item.main-nav-item {
        display: flex;
    }
    
    /* 优化快捷登录和退出按钮在移动端的显示 */
    .sidebar-qrcode-login,
    .sidebar-logout {
        flex: 1;
        min-width: 0;
    }
}

/* 小屏幕设备进一步优化 */
@media (max-width: 480px) {
    .sidebar-nav {
        padding: 8px 4px;
        gap: 2px;
    }
    
    .sidebar-item {
        padding: 8px 4px;
        min-height: 60px;
        border-radius: 10px;
    }
    
    .sidebar-item .sidebar-icon {
        font-size: 1.2rem;
        width: 36px;
        height: 36px;
        margin-bottom: 4px;
    }
    
    .sidebar-item .sidebar-text {
        font-size: 0.7rem;
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 360px) {
    .sidebar-nav {
        padding: 6px 2px;
        gap: 1px;
    }
    
    .sidebar-item {
        padding: 6px 2px;
        min-height: 56px;
    }
    
    .sidebar-item .sidebar-icon {
        font-size: 1.1rem;
        width: 32px;
        height: 32px;
        margin-bottom: 3px;
    }
    
    .sidebar-item .sidebar-text {
        font-size: 0.65rem;
    }
}

/* 移动端底部导航栏固定样式（已合并到上面的@media中，避免重复） */

@media (max-width: 768px) {
    /* 移动端固定滚动条，防止抖动 */
    html, body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    .header-content {
        padding: 12px 15px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    /* 移动端用户菜单优化 */
    .user-name {
        display: none;
    }
    
    .user-menu-trigger {
        padding: 6px;
        gap: 0;
    }
    
    .user-menu-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }
    
    .page-layout {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: calc(70px + env(safe-area-inset-bottom)); /* 为底部导航栏和安全区域留出空间 */
        height: auto;
        width: 100%;
        max-width: 100%;
        padding: 10px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom)); /* 为底部导航栏和安全区域留出空间 */
        gap: 15px;
        margin: 0;
    }
    
    .main-content-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        will-change: scroll-position;
        /* 隐藏滚动条但保持滚动功能 */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    /* 隐藏Webkit浏览器的滚动条 */
    .main-content-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .main-content,
    .section,
    .card {
        padding: 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    table th,
    table td {
        padding: 8px;
    }
    
    .sidebar-item .sidebar-text {
        font-size: 0.65rem;
    }
    
    .sidebar-item {
        padding: 6px 3px;
        min-height: 55px;
    }
    
    .sidebar-item .sidebar-icon {
        font-size: 1.3rem;
    }
    
    /* 移动端：已激活卡密信息改为单列显示 */
    .section > div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   右侧边栏中间内容自适应缩放
   ======================================== */

/* 右侧边栏中间内容区域容器 - 启用自适应缩放 */
.user-sidebar-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 右侧边栏中间内容区域 - 可滚动区域 */
.user-sidebar-right .sidebar-calendar-card {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 响应式缩放 - 超小屏幕（宽度 < 1400px） */
@media (max-width: 1400px) and (min-width: 1200px) {
    .user-sidebar-right {
        width: 240px !important;
    }
    
    /* 缩放日历内容 */
    .sidebar-calendar-card {
        transform: scale(0.95);
        transform-origin: top center;
        padding: 10px 0;
    }
    
    /* 缩放公告内容 */
    .sidebar-notice-section {
        transform: scale(0.95);
        transform-origin: top center;
        padding: 12px;
    }
    
    /* 缩放卡密卡片内容 */
    .sidebar-cards-section {
        transform: scale(0.95);
        transform-origin: top center;
        padding: 12px;
    }
    
    /* 调整字体大小 */
    .sidebar-calendar-card h3,
    .sidebar-cards-section h3 {
        font-size: 1.1rem !important;
    }
    
    .sidebar-calendar-card table {
        font-size: 0.8rem !important;
    }
    
    #signCalendarSidebar table {
        font-size: 0.75rem !important;
    }
    
    #signCalendarSidebar th,
    #signCalendarSidebar td {
        padding: 5px 2px !important;
        font-size: 0.75rem !important;
    }
}

/* 响应式缩放 - 中等屏幕（宽度 < 1200px） */
@media (max-width: 1199px) and (min-width: 1025px) {
    .user-sidebar-right {
        width: 220px !important;
    }
    
    /* 缩放日历内容 */
    .sidebar-calendar-card {
        transform: scale(0.9);
        transform-origin: top center;
        padding: 8px 0;
    }
    
    /* 缩放公告内容 */
    .sidebar-notice-section {
        transform: scale(0.9);
        transform-origin: top center;
        padding: 10px;
    }
    
    /* 缩放卡密卡片内容 */
    .sidebar-cards-section {
        transform: scale(0.9);
        transform-origin: top center;
        padding: 10px;
    }
    
    /* 调整字体大小 */
    .sidebar-calendar-card h3,
    .sidebar-cards-section h3 {
        font-size: 1rem !important;
    }
    
    .sidebar-calendar-card table {
        font-size: 0.75rem !important;
    }
    
    #signCalendarSidebar table {
        font-size: 0.7rem !important;
    }
    
    #signCalendarSidebar th,
    #signCalendarSidebar td {
        padding: 4px 1px !important;
        font-size: 0.7rem !important;
        height: 30px !important;
    }
    
    /* 调整用户信息区域 */
    .sidebar-user-avatar {
        width: 50px !important;
        height: 50px !important;
    }
    
    .sidebar-user-name-text {
        font-size: 0.85rem !important;
    }
    
    .sidebar-auth-time {
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
    }
}

/* 响应式缩放 - 小屏幕（宽度 < 1024px 但 > 768px） */
/* 注意：在1024px以下，page-layout会变为column布局，右侧边栏可能会隐藏 */
@media (max-width: 1024px) and (min-width: 769px) {
    .user-sidebar-right {
        width: 200px !important;
    }
    
    /* 缩放日历内容 */
    .sidebar-calendar-card {
        transform: scale(0.85);
        transform-origin: top center;
        padding: 6px 0;
    }
    
    /* 缩放公告内容 */
    .sidebar-notice-section {
        transform: scale(0.85);
        transform-origin: top center;
        padding: 8px;
    }
    
    /* 缩放卡密卡片内容 */
    .sidebar-cards-section {
        transform: scale(0.85);
        transform-origin: top center;
        padding: 8px;
    }
    
    /* 调整字体大小 */
    .sidebar-calendar-card h3,
    .sidebar-cards-section h3 {
        font-size: 0.95rem !important;
    }
    
    .sidebar-calendar-card table {
        font-size: 0.7rem !important;
    }
    
    #signCalendarSidebar table {
        font-size: 0.65rem !important;
    }
    
    #signCalendarSidebar th,
    #signCalendarSidebar td {
        padding: 3px 1px !important;
        font-size: 0.65rem !important;
        height: 28px !important;
    }
    
    /* 调整用户信息区域 */
    .sidebar-user-avatar {
        width: 45px !important;
        height: 45px !important;
    }
    
    .sidebar-user-name-text {
        font-size: 0.8rem !important;
    }
    
    .sidebar-auth-time {
        font-size: 0.65rem !important;
        padding: 5px 6px !important;
    }
    
    .sidebar-user-action-btn {
        width: 32px !important;
        height: 32px !important;
    }
    
    .sidebar-user-action-btn i {
        font-size: 0.9rem !important;
    }
}

/* 超小屏幕（宽度 < 768px）时隐藏右侧边栏或使用特殊布局 */
@media (max-width: 768px) {
    /* 移动端隐藏右侧边栏（可选，根据需求调整） */
    .user-sidebar-right {
        display: none !important;
    }
    
    /* 如果需要显示，可以使用以下样式 */
    /*
    .user-sidebar-right {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 280px !important;
        height: calc(100vh - 80px - 50px);
        z-index: 999;
        transition: right 0.3s ease;
    }
    
    .user-sidebar-right.mobile-open {
        right: 0;
    }
    
    .sidebar-calendar-card,
    .sidebar-notice-section,
    .sidebar-cards-section {
        transform: scale(1);
    }
    */
}

/* 确保缩放后内容仍然可以滚动 */
.user-sidebar-right .sidebar-calendar-card,
.user-sidebar-right .sidebar-notice-section,
.user-sidebar-right .sidebar-cards-section {
    will-change: transform;
    backface-visibility: hidden;
}

/* 保持缩放后元素的交互性 */
.user-sidebar-right .sidebar-calendar-card *,
.user-sidebar-right .sidebar-notice-section *,
.user-sidebar-right .sidebar-cards-section * {
    pointer-events: auto;
}

/* 优化缩放性能 */
.user-sidebar-right {
    contain: layout style;
}

/* 针对高DPI屏幕的优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sidebar-calendar-card,
    .sidebar-notice-section,
    .sidebar-cards-section {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 确保卡片在不同缩放比例下保持比例 */
@media (max-width: 1199px) {
    .sidebar-card-item {
        min-height: 120px;
    }
}

@media (max-width: 1024px) {
    .sidebar-card-item {
        min-height: 110px;
    }
}

/* 调整日历按钮大小以适应缩放 */
@media (max-width: 1199px) {
    .calendar-month-btn {
        padding: 4px 8px !important;
        font-size: 0.9rem !important;
    }
    
    #signBtnCalendar {
        padding: 3px 10px !important;
        font-size: 0.8rem !important;
        height: 26px !important;
    }
}

/* 调整公告内容字体以适应缩放 */
@media (max-width: 1199px) {
    .sidebar-notice-box {
        font-size: 0.8rem !important;
        padding: 10px !important;
    }
    
    .sidebar-notice-box h4 {
        font-size: 0.9rem !important;
    }
    
    .sidebar-notice-box p {
        font-size: 0.75rem !important;
    }
}

/* ========================================
   右侧边栏签到日历跨浏览器兼容性优化
   ======================================== */

/* 日历整体缩放 - 不使用滚动条 */
.sidebar-calendar-card {
    /* 移除滚动条 */
    overflow: hidden !important;
    /* 居中显示缩放后的日历 */
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    /* 确保内容不被裁剪 */
    position: relative;
    /* 允许日历内容超出但不显示滚动条 */
    min-height: 0;
}

/* 日历表格容器优化 - 支持整体缩放 */
#signCalendarSidebar {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box;
    /* 确保在所有浏览器中都能正确显示 */
    display: block;
    position: relative;
    /* 缩放原点设置 */
    transform-origin: top center !important;
    /* 优化缩放性能 */
    will-change: transform;
    backface-visibility: hidden;
    /* 确保内容完整显示 */
    min-height: 0;
}

/* 日历表格样式优化 - 跨浏览器兼容 */
#signCalendarSidebar table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    /* 防止表格溢出 */
    box-sizing: border-box;
}

/* 表格单元格宽度平均分配 */
#signCalendarSidebar th,
#signCalendarSidebar td {
    width: calc(100% / 7) !important;
    box-sizing: border-box;
    /* 防止内容溢出 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* 确保单元格内容正确对齐 */
    vertical-align: top;
}

/* 日历单元格内容容器优化 */
#signCalendarSidebar td > div {
    width: 100%;
    min-height: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    /* 防止内容溢出 */
    overflow: hidden;
}

/* Chrome/Safari/Edge 优化 */
@supports (-webkit-appearance: none) {
    .sidebar-calendar-card {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    #signCalendarSidebar table {
        -webkit-font-smoothing: antialiased;
    }
}

/* Firefox 兼容性优化 */
@-moz-document url-prefix() {
    .sidebar-calendar-card {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }
    
    #signCalendarSidebar td {
        min-height: 35px !important;
    }
    
    #signCalendarSidebar table {
        border-collapse: separate;
        border-spacing: 0;
    }
}

/* IE 11 兼容性（如果还需要支持） */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .sidebar-calendar-card {
        overflow-y: scroll;
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }
    
    #signCalendarSidebar table {
        table-layout: auto;
    }
}

/* 确保日历内容不会被容器裁剪 */
.user-sidebar-right .sidebar-calendar-card {
    overflow-y: auto !important;
    overflow-x: visible !important;
    max-height: none !important;
}

/* 日历标题优化 */
.sidebar-calendar-card > h3 {
    flex-shrink: 0;
    margin-bottom: 10px !important;
    padding: 0 15px;
    box-sizing: border-box;
}

/* 日历月份切换按钮容器优化 */
#signCalendarSidebar > div:first-of-type {
    flex-shrink: 0;
    padding: 0 5px;
    box-sizing: border-box;
}

/* 日历表格容器优化 */
#signCalendarSidebar table {
    flex-shrink: 0;
}

/* 日历底部操作栏优化 */
#signCalendarSidebar > div:last-of-type {
    flex-shrink: 0;
    margin-top: 10px;
    padding: 0 5px;
    box-sizing: border-box;
}

/* 响应式优化 - 确保在小屏幕上也能完整显示 */
/* 移动端Emby信息卡片优化 */
@media (max-width: 768px) {
    .emby-info-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .emby-info-item {
        padding: 12px 12px 24px 12px;
        min-height: 70px;
    }
    
    .emby-info-item-label {
        font-size: 0.65rem;
        bottom: 6px;
        right: 8px;
    }
    
    .emby-info-item-value {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .emby-stat-item .emby-info-item-value {
        font-size: 1.1rem !important;
    }
    
    .emby-connection-quality {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
    
    .emby-info-item-value span {
        font-size: 0.9rem !important;
        font-weight: 600;
    }
    
    .emby-signal-strength {
        gap: 3px;
    }
    
    .emby-signal-bar {
        width: 3px;
    }
    
    .emby-status-indicator {
        font-size: 0.85rem;
    }
    
    .emby-status-indicator .status-text {
        font-size: 0.8rem;
    }
    
    .emby-login-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .emby-authorization-remaining {
        font-size: 0.75rem;
        flex-wrap: wrap;
        gap: 4px;
    }
}

@media (max-width: 1400px) {
    #signCalendarSidebar {
        padding: 0 5px;
    }
    
    #signCalendarSidebar th,
    #signCalendarSidebar td {
        padding: 3px 1px !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 1200px) {
    #signCalendarSidebar th,
    #signCalendarSidebar td {
        padding: 2px 1px !important;
        font-size: 0.7rem !important;
    }
    
    #signCalendarSidebar td > div {
        min-height: 30px;
    }
}

/* 确保日历在不同浏览器中的滚动条样式一致 */
.sidebar-calendar-card::-webkit-scrollbar {
    width: 6px;
}

.sidebar-calendar-card::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.sidebar-calendar-card::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.sidebar-calendar-card::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 暗色主题滚动条优化 */
.theme-dark .sidebar-calendar-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.theme-dark .sidebar-calendar-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
