:root {
    --primary-color: #5ac8fa;
    --accent-color: #8b5cf6;
    --sidebar-width: 240px;
    --header-height: 60px;
    --body-gradient: radial-gradient(at 20% 20%, rgba(90, 200, 250, 0.55) 0%, rgba(255, 255, 255, 0) 55%),
        radial-gradient(at 80% 10%, rgba(139, 92, 246, 0.45) 0%, rgba(255, 255, 255, 0) 60%),
        radial-gradient(at 10% 90%, rgba(255, 123, 181, 0.35) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, #eef5ff 0%, #f8fbff 45%, #e6f3ff 100%);
    --card-bg: rgba(255, 255, 255, 0.55);
    --glass-hover: rgba(255, 255, 255, 0.75);
    --hover-bg: rgba(255, 255, 255, 0.28);
    --border-color: rgba(255, 255, 255, 0.35);
    --text-color: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.65);
    --body-bg: #eef5ff;
    --sidebar-bg: rgba(255, 255, 255, 0.48);
    --topbar-bg: rgba(255, 255, 255, 0.48);
    --footer-bg: rgba(255, 255, 255, 0.48);
    --active-menu-bg: rgba(90, 200, 250, 0.2);
    --search-bg: rgba(255, 255, 255, 0.32);
    --avatar-bg: rgba(255, 255, 255, 0.32);
    --gitlab-color: #fc6d26;
    --glass-border-strong: rgba(255, 255, 255, 0.55);
    --glass-shadow: 0 25px 55px rgba(15, 23, 42, 0.16);
    --blur-strength: 18px;
    --highlight-glow: 0 0 25px rgba(90, 200, 250, 0.45);
}

[data-theme="dark"] {
    --primary-color: #5ac8fa;
    --accent-color: #7c9aff;
    --card-bg: rgba(15, 23, 42, 0.58);
    --glass-hover: rgba(30, 41, 59, 0.78);
    --hover-bg: rgba(80, 116, 166, 0.2);
    --border-color: rgba(148, 163, 184, 0.28);
    --text-color: #e2e8f0;
    --text-secondary: rgba(226, 232, 240, 0.65);
    --body-bg: #0f172a;
    --body-gradient: radial-gradient(at 20% 15%, rgba(90, 200, 250, 0.3) 0%, rgba(15, 23, 42, 0) 60%),
        radial-gradient(at 85% 10%, rgba(124, 154, 255, 0.28) 0%, rgba(15, 23, 42, 0) 60%),
        radial-gradient(at 10% 85%, rgba(251, 191, 36, 0.2) 0%, rgba(15, 23, 42, 0) 55%),
        linear-gradient(135deg, #040b1a 0%, #071124 40%, #0b1224 100%);
    --sidebar-bg: rgba(15, 23, 42, 0.58);
    --topbar-bg: rgba(15, 23, 42, 0.58);
    --footer-bg: rgba(15, 23, 42, 0.58);
    --active-menu-bg: rgba(90, 200, 250, 0.16);
    --search-bg: rgba(30, 41, 59, 0.55);
    --avatar-bg: rgba(30, 41, 59, 0.55);
    --gitlab-color: #fc6d26;
    --glass-border-strong: rgba(124, 154, 255, 0.4);
    --glass-shadow: 0 25px 65px rgba(4, 6, 24, 0.55);
    --blur-strength: 20px;
    --highlight-glow: 0 0 25px rgba(124, 154, 255, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    background: var(--body-gradient);
    background-color: var(--body-bg);
    background-attachment: fixed;
    transition: background 0.8s ease, background-color 0.6s ease, color 0.3s;
    position: relative;
    overflow-x: hidden;
    scroll-padding-top: 140px;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -40%;
    z-index: -2;
    pointer-events: none;
    background: radial-gradient(circle at 30% 20%, rgba(90, 200, 250, 0.35) 0%, transparent 55%),
        radial-gradient(circle at 70% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(255, 123, 181, 0.25) 0%, transparent 55%);
    filter: blur(90px);
    opacity: 0.9;
    transform: translate3d(0, 0, 0);
    transition: opacity 0.6s ease;
}

body::after {
    inset: -30%;
    background: radial-gradient(circle at 65% 75%, rgba(255, 214, 165, 0.28) 0%, transparent 55%),
        radial-gradient(circle at 15% 60%, rgba(90, 200, 250, 0.28) 0%, transparent 55%);
    animation: float 16s ease-in-out infinite;
}

[data-theme="dark"] body::before {
    background: radial-gradient(circle at 25% 25%, rgba(90, 200, 250, 0.3) 0%, transparent 55%),
        radial-gradient(circle at 75% 20%, rgba(124, 154, 255, 0.28) 0%, transparent 60%),
        radial-gradient(circle at 20% 70%, rgba(251, 191, 36, 0.22) 0%, transparent 60%);
    opacity: 0.7;
    filter: blur(110px);
}

[data-theme="dark"] body::after {
    background: radial-gradient(circle at 65% 75%, rgba(56, 189, 248, 0.25) 0%, transparent 55%),
        radial-gradient(circle at 15% 60%, rgba(168, 85, 247, 0.25) 0%, transparent 55%);
    opacity: 0.65;
}

/* 应用容器 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border-strong);
    padding: 28px 0 32px;
    position: fixed;
    top: 24px;
    left: 24px;
    bottom: 24px;
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    transition: background 0.6s ease, border-color 0.3s, box-shadow 0.3s;
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.logo-container {
    padding: 10px 24px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s, padding 0.3s;
    flex-shrink: 0;
}

.logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--search-bg);
    border: 1px solid var(--glass-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 18px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.logo:hover {
    transform: rotate(90deg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 15px 25px rgba(15, 23, 42, 0.15);
}

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

.logo i {
    font-size: 24px;
    color: var(--text-color);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
    transition: color 0.3s;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 0;
    transition: color 0.3s;
}

.sidebar-menu {
    padding: 22px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

#sidebar-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    color: var(--text-color);
    border-radius: 16px;
    border: 1px solid transparent;
}

.menu-item:hover {
    background-color: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.menu-item.active {
    background-color: var(--active-menu-bg);
    color: var(--primary-color);
    box-shadow: 0 12px 22px rgba(90, 200, 250, 0.2);
    border-color: rgba(90, 200, 250, 0.4);
}

.menu-item i {
    font-size: 18px;
    margin-right: 10px;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: calc(var(--sidebar-width) + 48px);
    margin-right: 24px;
    margin-top: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: calc(100vh - 48px);
    transition: margin 0.3s ease;
}

.top-bar {
    height: var(--header-height);
    background: var(--topbar-bg);
    border: 1px solid var(--glass-border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 24px;
    z-index: 5;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    transition: background 0.6s ease, border-color 0.3s, box-shadow 0.3s;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--search-bg);
    border-radius: 20px;
    padding: 8px 18px;
    width: 320px;
    transition: background-color 0.3s, box-shadow 0.3s;
    height: 40px;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.search-container i {
    color: var(--text-secondary);
    margin-right: 10px;
    transition: color 0.3s;
    font-size: 18px;
}

#search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-color);
    transition: color 0.3s;
    font-size: 15px;
    height: 100%;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

.search-container:focus-within {
    box-shadow: var(--highlight-glow);
    border-color: rgba(90, 200, 250, 0.35);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#visit-count {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s;
}

/* GitLab链接样式 */
.gitlab-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--search-bg);
    border: 1px solid transparent;
    text-decoration: none;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
    transition: background-color 0.3s, transform 0.2s ease, box-shadow 0.3s;
}

.gitlab-link:hover {
    background-color: var(--glass-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--highlight-glow);
}

.gitlab-link i {
    font-size: 22px;
    color: #fc6d26;
}

/* 确保在深色模式下也显示正确的颜色 */
[data-theme="dark"] .gitlab-link i {
    color: #fc6d26;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background-color: var(--search-bg);
    border: 1px solid transparent;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
    transition: background-color 0.3s, color 0.3s, transform 0.2s ease, box-shadow 0.3s;
}

.theme-toggle:hover {
    background-color: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--highlight-glow);
}

.theme-toggle i {
    font-size: 18px;
}

.light-icon {
    display: none;
}

.dark-icon {
    display: block;
}

[data-theme="dark"] .light-icon {
    display: block;
}

[data-theme="dark"] .dark-icon {
    display: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--avatar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.user-avatar i {
    font-size: 20px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

/* 内容区域样式 */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--topbar-bg);
    border: 1px solid var(--glass-border-strong);
    border-radius: 28px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    transition: background 0.6s ease, border-color 0.3s;
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
    min-height: 0;
    /* 关键：允许flex子项小于内容高度 */
}

.sidebar-menu::-webkit-scrollbar {
    width: 0;
    display: none;
}

.section {
    margin: 0;
}

#all-categories {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    transition: color 0.3s;
}

.more-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: color 0.3s, transform 0.3s;
}

.more-link i {
    font-size: 12px;
    margin-left: 5px;
}

.more-link:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.site-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px 18px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s, background-color 0.3s, border-color 0.3s;
    position: relative;
    height: 100%;
    overflow: hidden;
    backdrop-filter: blur(calc(var(--blur-strength) * 0.7));
    -webkit-backdrop-filter: blur(calc(var(--blur-strength) * 0.7));
    z-index: 0;
}

.site-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 55%);
    opacity: 0.65;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: -1;
}

.site-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 35px rgba(90, 200, 250, 0.25);
    border-color: var(--glass-border-strong);
    background-color: var(--glass-hover);
}

.site-card:hover::before {
    opacity: 0.85;
}

.site-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.15) 70%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 18px rgba(15, 23, 42, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-icon i {
    font-size: 26px;
    color: var(--text-color);
    transition: color 0.3s;
}

.site-favicon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.site-card:hover .site-icon {
    transform: translateY(-2px) scale(1.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 14px 22px rgba(90, 200, 250, 0.35);
}

[data-theme="dark"] .site-card {
    border-color: rgba(124, 154, 255, 0.22);
    box-shadow: 0 20px 32px rgba(4, 6, 24, 0.55);
}

[data-theme="dark"] .site-card::before {
    background: linear-gradient(135deg, rgba(124, 154, 255, 0.25) 0%, rgba(15, 23, 42, 0) 55%);
    opacity: 0.55;
}

[data-theme="dark"] .site-card:hover {
    background-color: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .site-card:hover .site-icon {
    box-shadow: inset 0 1px 0 rgba(124, 154, 255, 0.35), 0 14px 22px rgba(90, 200, 250, 0.25);
}

.card-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
    transition: color 0.3s;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-direction: column;
    transition: color 0.3s;
}

.tag {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 8px;
    font-size: 12px;
    color: white;
    border-radius: 0 10px 0 10px;
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.85), rgba(139, 92, 246, 0.85));
    backdrop-filter: blur(6px);
}

.site-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.site-link:focus-visible .site-card {
    outline: 2px solid rgba(90, 200, 250, 0.8);
    outline-offset: 3px;
}

/* 分类区域样式 */
.category-section {
    margin: 0;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    color: var(--text-color);
    transition: color 0.3s;
    gap: 10px;
    padding: 12px 20px;
    background: var(--search-bg);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(calc(var(--blur-strength) * 0.6));
    -webkit-backdrop-filter: blur(calc(var(--blur-strength) * 0.6));
}

.category-title i {
    margin-right: 0;
    color: var(--text-color);
    transition: color 0.3s;
}

[data-theme="dark"] .logo {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(124, 154, 255, 0.45);
    box-shadow: inset 0 1px 0 rgba(124, 154, 255, 0.2), 0 10px 18px rgba(4, 6, 24, 0.45);
}

[data-theme="dark"] .logo img {
    filter: brightness(0.75);
}

[data-theme="dark"] .site-icon {
    background: radial-gradient(circle at 30% 30%, rgba(148, 163, 184, 0.4) 0%, rgba(15, 23, 42, 0.6) 70%);
    border: 1px solid rgba(124, 154, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(124, 154, 255, 0.2), 0 12px 20px rgba(4, 6, 24, 0.6);
}

/* 页脚样式 */
.footer {
    padding: 18px 24px;
    background: var(--footer-bg);
    border: 1px solid var(--glass-border-strong);
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    transition: background 0.6s ease, border-color 0.3s, color 0.3s;
    margin-top: auto;
}

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

@keyframes float {
    0% {
        transform: translate3d(-12px, -10px, 0) scale(1);
    }

    50% {
        transform: translate3d(10px, 6px, 0) scale(1.03);
    }

    100% {
        transform: translate3d(-6px, 8px, 0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
        left: 20px;
        top: 20px;
        bottom: 20px;
        border-radius: 24px;
    }

    .logo-container {
        padding: 0 20px 20px;
    }

    .main-content {
        margin-left: calc(200px + 44px);
        margin-right: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
        min-height: calc(100vh - 40px);
    }

    .search-container {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
        padding: 24px 0 24px;
    }

    .logo {
        margin-bottom: 10px;
    }

    .logo-text,
    .logo-subtitle,
    .menu-item span {
        display: none;
    }

    .sidebar-menu {
        padding: 24px 0 0;
        gap: 12px;
        align-items: center;
    }

    .menu-item {
        justify-content: center;
        padding: 12px 0;
        margin: 0 auto;
        width: 44px;
        gap: 0;
    }

    .menu-item i {
        margin-right: 0;
    }

    .main-content {
        margin-left: calc(72px + 36px);
    }

    .search-container {
        width: 200px;
    }

    .content-area {
        padding: 20px;
    }

    .site-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 576px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin: 16px;
        gap: 16px;
        min-height: calc(100vh - 32px);
    }

    .top-bar {
        top: 16px;
        padding: 0 18px;
        border-radius: 18px;
    }

    .search-container {
        width: 160px;
    }

    #visit-count {
        display: none;
    }

    .content-area {
        padding: 18px;
        border-radius: 20px;
    }

    .site-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .footer {
        padding: 16px;
        border-radius: 18px;
    }
}

[data-theme="dark"] .site-icon i {
    color: var(--text-color);
}

[data-theme="dark"] .category-title i {
    color: var(--text-color);
}

[data-theme="dark"] .content-area::-webkit-scrollbar-thumb {
    background: rgba(124, 154, 255, 0.35);
    border-color: rgba(124, 154, 255, 0.25);
}


/* 3D抽屉菜单样式 */
.drawer-container {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.drawer-container.open {
    pointer-events: auto;
    opacity: 1;
}

.drawer-panel {
    position: absolute;
    top: 24px;
    left: 24px;
    bottom: 24px;
    width: 320px;
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border-strong);
    border-radius: 28px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    transform: translateX(-120%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px;
}

.drawer-container.open .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.drawer-close:hover {
    background: var(--hover-bg);
    color: var(--text-color);
    opacity: 1;
    transform: rotate(90deg);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    /* 防止滚动条遮挡内容 */
}

.drawer-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.drawer-menu-item:hover {
    background-color: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.drawer-menu-item i {
    font-size: 20px;
    margin-right: 12px;
    color: var(--primary-color);
}

.drawer-menu-item span {
    font-size: 15px;
    font-weight: 500;
}

/* 抽屉菜单样式增强 - 覆盖之前的简单样式 */
.drawer-section {
    margin-bottom: 20px;
}

.drawer-section h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.drawer-config-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.3s ease;
    color: var(--text-color);
    margin-bottom: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.4);
    /* 增加不透明度以提高对比度 */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.drawer-config-item:hover {
    background-color: rgba(255, 255, 255, 0.6);
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.drawer-config-item.active {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.25), rgba(139, 92, 246, 0.25));
    /* 加深激活状态背景 */
    color: #0f172a;
    /* 确保文字颜色足够深 */
    border-color: rgba(90, 200, 250, 0.4);
    box-shadow: 0 4px 12px rgba(90, 200, 250, 0.2);
    font-weight: 500;
}

.drawer-config-item i {
    font-size: 20px;
    margin-right: 12px;
}

.drawer-config-item .check-icon {
    margin-left: auto;
    margin-right: 0;
    font-size: 18px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--accent-color);
}

.drawer-config-item.active .check-icon {
    opacity: 1;
    transform: scale(1);
}

.drawer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 20px 0;
    opacity: 0.6;
}

/* 3D效果增强 */
.main-content.drawer-transition {
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
    transform: none;
    /* 确保默认状态下没有变换 */
}

.drawer-container.open~.app-container .main-content {
    transform: translateX(60px);
    filter: blur(2px);
    pointer-events: none;
}

[data-theme="dark"] .drawer-config-item {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: none;
    color: var(--text-color);
}

[data-theme="dark"] .drawer-config-item.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.15), rgba(139, 92, 246, 0.15));
}

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

/* Floating Action Button */
/* Floating Action Button */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(150, 200, 250, 0.85), rgba(139, 92, 246, 0.85));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(150, 200, 250, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-fab:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 12px 40px rgba(90, 200, 250, 0.6);
}

.chat-fab::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: inherit;
    filter: blur(12px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
}

.chat-fab:hover::after {
    opacity: 0.6;
}

.chat-fab:active {
    transform: scale(0.95);
}

[data-theme="dark"] .chat-fab {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.4), rgba(139, 92, 246, 0.4));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-fab:hover {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.5), rgba(139, 92, 246, 0.5));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

[data-theme="dark"] .chat-modal {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.chat-modal.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .chat-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.chat-title i {
    font-size: 22px;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(90, 200, 250, 0.3));
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-actions button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    transform: rotate(90deg);
}

[data-theme="dark"] .header-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Auth View */
.chat-auth {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    text-align: center;
}

.auth-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary-color);
    font-size: 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(90, 200, 250, 0.15);
}

.chat-auth h3 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
}

.chat-auth p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.input-group {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-color);
    outline: none;
    transition: all 0.3s;
    font-size: 14px;
}

[data-theme="dark"] .input-group input {
    background: rgba(0, 0, 0, 0.2);
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(90, 200, 250, 0.2);
}

[data-theme="dark"] .input-group input:focus {
    background: rgba(0, 0, 0, 0.4);
}

.input-group button {
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.8), rgba(139, 92, 246, 0.8));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(90, 200, 250, 0.3);
}

.input-group button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(90, 200, 250, 0.4);
}

.auth-tip a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.auth-tip a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.auth-tip a:hover::after {
    transform: scaleX(1);
}

/* Chat Interface */
.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .message.ai .message-avatar {
    border-color: rgba(255, 255, 255, 0.1);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.message-content {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
}

.message.ai .message-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top-left-radius: 4px;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .message.ai .message-content {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(90, 200, 250, 0.3);
}

.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

[data-theme="dark"] .chat-input-area {
    border-top-color: rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    align-items: flex-end;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .chat-input-wrapper {
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(90, 200, 250, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .chat-input-wrapper:focus-within {
    background: rgba(15, 23, 42, 0.8);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    max-height: 100px;
    padding: 8px 0;
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

#chat-input::placeholder {
    color: var(--text-secondary);
}

#send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(90, 200, 250, 0.3);
}

#send-btn:disabled {
    background: var(--text-secondary);
    opacity: 0.2;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#send-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(90, 200, 250, 0.5);
}

#send-btn:not(:disabled):active {
    transform: scale(0.95);
}

.chat-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.chat-footer:hover {
    opacity: 1;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    align-items: center;
    height: 20px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Custom Toast */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border-strong);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.custom-toast i {
    color: var(--primary-color);
    font-size: 18px;
}

/* Custom Confirm Dialog */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-confirm-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-confirm-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border-strong);
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-color);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
}

.custom-confirm-overlay.show .custom-confirm-box {
    transform: scale(1);
}

.confirm-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-header i {
    color: #f59e0b;
}

.confirm-content {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.confirm-btn.cancel {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-secondary);
}

.confirm-btn.cancel:hover {
    background: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
}

.confirm-btn.confirm {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.8), rgba(139, 92, 246, 0.8));
    color: white;
}

.confirm-btn.confirm:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(90, 200, 250, 0.3);
}

/* Dark Mode Premium Glassmorphism Overrides */
[data-theme="dark"] .chat-modal {
    background: rgba(16, 23, 41, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .custom-toast {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .custom-confirm-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

[data-theme="dark"] .chat-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-input-area {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-input-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-input-wrapper:focus-within {
    background: rgba(0, 0, 0, 0.5);
    border-color: #60a5fa;
}

[data-theme="dark"] .chat-footer {
    color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .input-group button,
[data-theme="dark"] .confirm-btn.confirm {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.4), rgba(139, 92, 246, 0.4));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .input-group button:hover,
[data-theme="dark"] .confirm-btn.confirm:hover {
    background: linear-gradient(135deg, rgba(90, 200, 250, 0.5), rgba(139, 92, 246, 0.5));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* Mobile Adaptation */
@media (max-width: 768px) {
    .chat-modal {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform-origin: bottom center;
        background: var(--sidebar-bg);
    }

    [data-theme="dark"] .chat-modal {
        background: rgba(16, 23, 41, 0.95);
    }

    .chat-fab {
        bottom: 20px;
        right: 20px;
    }
}