:root {
    /* 基础颜色 */
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    
    /* 尺寸变量 */
    --header-height: 70px;
    --sidebar-width: 180px;
    --blur-amount: 10px;
    
    /* 字体大小 */
    --font-size-xs: clamp(0.75rem, 0.7vw, 0.875rem);  /* 12-14px */
    --font-size-sm: clamp(0.875rem, 0.9vw, 1rem);     /* 14-16px */
    --font-size-base: clamp(1rem, 1vw, 1.125rem);     /* 16-18px */
    --font-size-lg: clamp(1.125rem, 1.2vw, 1.25rem);  /* 18-20px */
    --font-size-xl: clamp(1.25rem, 1.5vw, 1.5rem);    /* 20-24px */
    --font-size-2xl: clamp(1.5rem, 2vw, 2rem);        /* 24-32px */
    
    /* 间距 */
    --space-xs: 0.5rem;    /* 8px */
    --space-sm: 0.75rem;   /* 12px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    
    /* 深色主题（默认） */
    --bg-gradient: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
    --text-color: rgba(255, 255, 255, 0.95);
    --desc-color: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(0, 0, 0, 0.4);
    --header-bg: rgba(0, 0, 0, 0.4);
    --search-bg: rgba(0, 0, 0, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 浅色主题 */
[data-theme="light"] {
    --bg-gradient: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9));
    --text-color: rgba(0, 0, 0, 0.9);
    --desc-color: rgba(0, 0, 0, 0.7);
    --card-bg: rgba(255, 255, 255, 0.85);
    --header-bg: rgba(255, 255, 255, 0.85);
    --search-bg: rgba(0, 0, 0, 0.1);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-shadow: none;
}

/* 响应式布局断点 */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 160px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
        --sidebar-width: 280px;  /* 增加侧边栏宽度，更容易点击 */
        --space-md: 0.8rem;
        --space-lg: 1.2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 50px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Arial', sans-serif;
    background: var(--bg-gradient), url('./background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    font-size: var(--font-size-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);  /* 默认隐藏 */
    transition: transform 0.3s ease;
}

/* 显示侧边栏 */
body:not(.sidebar-hidden) .sidebar {
    transform: translateX(0);  /* 显示 */
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
    font-size: var(--font-size-lg);  /* 增大字体 */
    color: var(--white-text);
    font-weight: 600;
    text-shadow: var(--text-shadow);
}

.sidebar-header h2 i {
    font-size: 0.9em;
    opacity: 0.8;
    color: var(--primary-color);
}

/* 让第二个图标镜像翻转 */
.sidebar-header h2 i:last-child {
    transform: scaleX(-1);
}

/* 修改header布局 */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 修改侧边栏切换按钮样式 */
.sidebar-toggle {
    position: static;
    min-width: 40px;          /* 使用最小宽度 */
    min-height: 40px;         /* 使用最小高度 */
    width: 40px;              /* 固定宽度 */
    height: 40px;             /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;           /* 防止按钮被压缩 */
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle i {
    font-size: 1.2rem;        /* 固定图标大小 */
    width: 1.2rem;            /* 固定图标宽度 */
    height: 1.2rem;           /* 固定图标高度 */
    display: flex;            /* 使用flex确保图标居中 */
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

/* 移除旧的位置相关样式 */
body:not(.sidebar-hidden) .sidebar-toggle {
    left: auto; /* 移除左侧定位 */
}

/* 修改header基础样式 */
header {
    height: var(--header-height);
    padding: 0 var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    transition: left 0.3s ease;
    z-index: 1001;  /* 增加z-index确保在最上层 */
}

/* 修改主内容区域，为固定header留出空间 */
.sites-grid {
    margin-top: 1.5rem;  /* 默认边距 */
    padding: clamp(1rem, 2vw, 2rem);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.2rem;  /* 减小网格间距 */
    position: relative;
    z-index: 1;  /* 确保低于header */
    scroll-behavior: smooth;
    align-items: start;  /* 让卡片从顶部对齐 */
}

/* 当不在主页时，增加网格的顶部边距 */
body:not([data-category="all"]) .sites-grid {
    margin-top: calc(var(--header-height) + 1.5rem);
}

/* 当在主页时，时钟容器显示，网格使用默认边距 */
body[data-category="all"] .clock-container {
    display: block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    body:not([data-category="all"]) .sites-grid {
        margin-top: calc(var(--header-height) + 1rem);  /* 移动端稍微减小边距 */
    }

    .main-content header {
        left: 0 !important;
        right: 0;
        width: 100%;
    }

    .header-controls {
        flex: 0 1 auto;  /* 允许搜索框区域收缩 */
    }

    .search-box {
        min-width: 100px;
        max-width: 200px;
    }

    .sites-grid {
        margin-top: var(--header-height);  /* 确保内容不被header遮挡 */
        padding: 1rem;
    }

    .sites-grid {
        gap: 1rem;  /* 移动端更小的间距 */
    }
}

/* 修改分类按钮容器样式 */
.filter-buttons {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.8rem;
    overflow-y: auto;
    flex: 1;
    height: calc(100% - var(--header-height));  /* 减去头部高度 */
    -webkit-overflow-scrolling: touch;  /* 添加弹性滚动 */
}

/* 自定义滚动条样式 */
.filter-buttons::-webkit-scrollbar {
    width: 6px;
}

.filter-buttons::-webkit-scrollbar-track {
    background: transparent;
}

.filter-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* 修改分类按钮样式 */
.filter-btn {
    display: block;
    padding: 0.6rem 1rem;
    border: none;  /* 移除边框 */
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--white-text);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    font-weight: 500;
    text-shadow: var(--text-shadow);
    font-size: var(--font-size-sm);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 40px;      /* 添加最小高度 */
    flex-shrink: 0;        /* 防止按钮被压缩 */
}

/* 按钮悬停效果 */
.filter-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 激活状态的按钮样式 */
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

/* 添加炫光效果 */
.filter-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: 0.5s;
}

.filter-btn:hover::after {
    left: 100%;
}

/* 主内容区域 */
.main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* 当侧边栏可见时的主内容区域 */
body:not(.sidebar-hidden) .main-content {
    margin-left: var(--sidebar-width);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;  /* 确保搜索框靠右 */
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--search-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    color: var(--text-color);
    width: clamp(150px, 20vw, 200px);
    font-size: var(--font-size-base);
}

.search-box input::placeholder {
    color: var(--desc-color);
}

.search-box i {
    color: var(--desc-color);
}

.site-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--blur-amount));
    transform-style: preserve-3d;
    perspective: 1000px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.2rem;  /* 减小卡片整体内边距 */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: auto;  /* 改为auto，让高度自适应内容 */
    min-height: fit-content;  /* 确保最小高度适应内容 */
    opacity: 0;  /* 初始设置为透明 */
    animation: cardAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;  /* 减少动画时间 */
}

/* 卡片悬停效果 */
.site-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-8px) scale(1.02) rotateX(2deg);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1) inset;
}

/* 添加炫光效果 */
.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-25deg);
    transition: 0.75s;
    z-index: 1;
}

.site-card:hover::before {
    left: 150%;
}

/* 网站图标样式优化 */
.site-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: -1.2rem -1.2rem 0.8rem -1.2rem;  /* 减小底部边距 */
    padding: 1.2rem;  /* 减小内边距 */
    background: linear-gradient(
        rgba(255, 255, 255, 0.05),
        transparent
    );
    border-radius: 20px 20px 0 0;
}

.site-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    transform: rotate(-5deg) translateZ(20px);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.site-card:hover .site-icon {
    transform: rotate(0deg) scale(1.1) translateZ(30px);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

/* 网站名称样式优化 */
.site-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    background: linear-gradient(90deg, #ffffff, #e0e0e0, #ffffff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    transform: translateZ(15px);
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* 网站描述样式优化 */
.site-description {
    color: var(--desc-color);
    font-size: var(--font-size-base);
    line-height: 1.5;  /* 稍微减小行高 */
    margin-bottom: 0.8rem;  /* 减小底部边距 */
    position: relative;
    padding-left: 0.8rem;  /* 减小左侧内边距 */
    border-left: 2px solid;  /* 减小边框宽度 */
    border-image: linear-gradient(to bottom, var(--primary-color), var(--secondary-color)) 1;
    transform: translateZ(10px);
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* 限制最多显示2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 网站类型标签样式优化 */
.site-type {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-top: 0;  /* 移除顶部外边距 */
    align-self: flex-start;
    border: none;
    transition: all 0.3s ease;
    transform: translateZ(25px);
}

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

.site-card:hover .site-type {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 添加动画关键帧 */
@keyframes cardPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .site-header {
        margin: -1rem -1rem 0.6rem -1rem;
        padding: 1rem;
    }

    .site-description {
        margin-bottom: 0.8rem;
        padding-left: 0.6rem;
    }

    .site-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .site-header {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .site-card {
        margin: 0 auto;
        width: 100%;
        max-width: 400px;
        height: auto;  /* 确保移动端也是自适应高度 */
    }
}

/* 主题切换按钮样式优化 */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--search-bg);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.theme-toggle i {
    color: var(--text-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* 标题文字样式 */
h1, h2, .site-name {
    color: var(--white-text);
    text-shadow: var(--text-shadow);
    font-weight: 600;
}

h1 {
    font-size: var(--font-size-xl);
    letter-spacing: 0.5px;
}

h2 {
    font-size: var(--font-size-lg);
    letter-spacing: 0.3px;
}

/* Logo和标题样式 */
.logo-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .logo-title {
        gap: 0.8rem;       /* 调整logo和标题的间距 */
    }

    .site-logo {
        width: 32px;
        height: 32px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .site-header {
        gap: 0.6rem;
    }

    .site-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .sites-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .site-card {
        margin: 0 auto;
        width: 100%;
        max-width: 400px;
    }

    .search-box {
        width: 100%;
        max-width: 300px;
    }

    .search-box input {
        width: 100%;
    }

    .header-controls {
        flex: 1;
        justify-content: flex-end;
    }

    .logo-title h1 {
        font-size: clamp(14px, 3.5vw, 18px);  /* 更灵活的字体大小 */
        white-space: nowrap;  /* 防止标题换行 */
        overflow: hidden;     /* 隐藏溢出部分 */
        text-overflow: ellipsis;  /* 显示省略号 */
    }

    .site-logo {
        width: 28px;    /* 更小的logo */
        height: 28px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .site-description {
        -webkit-line-clamp: 3;
    }

    .header-left {
        gap: 0.8rem;
    }

    .search-box {
        min-width: 100px;  /* 更小的最小宽度 */
    }

    .logo-title {
        gap: 0.6rem;
    }

    .site-logo {
        width: 28px;    /* 更小的logo */
        height: 28px;
    }

    .sites-grid {
        gap: 0.8rem;  /* 更小屏幕更小的间距 */
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* 添加点击效果 */
.site-card:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s, box-shadow 0.1s;
}

/* 优化移动端动画效果 */
@media (max-width: 768px) {
    .site-card {
        transform-style: flat;
        perspective: none;
    }
    
    .site-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .site-icon,
    .site-name,
    .site-description,
    .site-type {
        transform: none !important;
    }
}

/* 底部样式 */
.footer {
    margin-top: auto;
    width: 100%;
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.copyright {
    margin-bottom: 0.5rem;
}

/* 修改备案样式 */
.beian a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.beian-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

.beian a:hover {
    color: var(--white-text);
}

/* 确保footer始终在底部 */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sites-grid {
    flex: 1;
    margin-bottom: 2rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .footer {
        padding: 1rem 0;
    }

    .footer-content {
        padding: 0 1rem;
        font-size: calc(var(--font-size-sm) - 1px);
    }
}

/* 修改动画关键帧 */
@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);  /* 减小位移和缩放幅度 */
        filter: blur(5px);  /* 减少模糊程度 */
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 优化移动端动画 */
@media (max-width: 768px) {
    .site-card {
        animation-duration: 0.3s;  /* 移动端动画更快 */
    }
    
    @keyframes cardAppear {
        0% {
            opacity: 0;
            transform: translateY(15px);  /* 更小的位移幅度 */
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* 修改搜索框样式 */
.search-box input {
    color: var(--text-color);  /* 使用主题文字颜色 */
}

.search-box input::placeholder {
    color: var(--desc-color);  /* 使用主题描述文字颜色 */
}

.search-box i {
    color: var(--desc-color);  /* 使用主题描述文字颜色 */
}

/* 修改网站名称渐变色 */
[data-theme="light"] .site-name {
    background: linear-gradient(90deg, #000000, #333333, #000000);  /* 深色渐变 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 修改卡片悬停效果 */
[data-theme="light"] .site-card:hover {
    background: rgba(0, 0, 0, 0.05);  /* 浅色主题下的悬停背景 */
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(0, 0, 0, 0.05) inset;
}

/* 修改炫光效果 */
[data-theme="light"] .site-card::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 0, 0, 0.1),
        transparent
    );
}

/* 修改分类按钮样式 */
[data-theme="light"] .filter-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.15));
    color: var(--text-color);
}

/* 修改侧边栏样式 */
[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.8);
}

/* 浅色主题的滚动条样式 */
[data-theme="light"] .filter-buttons {
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

[data-theme="light"] .filter-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 修改主题切换按钮在移动端的样式 */
@media (max-width: 768px) {
    .theme-toggle {
        width: 32px;        /* 减小按钮尺寸 */
        height: 32px;
        min-width: 32px;    /* 确保不会被挤压 */
        min-height: 32px;
    }

    .theme-toggle i {
        font-size: 1rem;    /* 减小图标大小 */
    }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
    .theme-toggle {
        width: 28px;        /* 更小的按钮尺寸 */
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .theme-toggle i {
        font-size: 0.9rem;  /* 更小的图标大小 */
    }
}

/* 私人分类按钮样式 */
.filter-btn.private-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;  /* 与其他按钮保持一致 */
    border-radius: 10px;   /* 与其他按钮保持一致 */
    min-height: 40px;      /* 与其他按钮保持一致 */
    position: relative;
    margin-bottom: 0.5rem;
}

/* 私人分类按钮中的文字 */
.filter-btn.private-btn span {
    flex: 1;
    text-align: center;
}

/* 私人分类按钮中的图标 */
.filter-btn.private-btn i {
    font-size: 0.9em;
    position: absolute;
    right: 1rem;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .filter-btn.private-btn {
        min-height: 50px;  /* 与其他按钮保持一致 */
        padding: 1rem;     /* 与其他按钮保持一致 */
    }
}

/* 密码弹窗样式 */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.password-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.password-modal.show .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-modal:hover {
    transform: scale(1.1);
    color: #ff6b6b;
}

.modal-body {
    padding: 2rem;
}

.password-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.password-input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--desc-color);
}

#password-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--search-bg);
    color: var(--text-color);
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
}

#password-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.confirm-password {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-password:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 浅色主题适配 */
[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.9);
}

/* Toast提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2100;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.success-toast {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9), rgba(56, 142, 60, 0.9));
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.error-toast {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.9), rgba(211, 47, 47, 0.9));
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.toast i {
    font-size: 1.2rem;
}

/* 浅色主题适配 */
[data-theme="light"] .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 修改时钟容器样式 */
.clock-container {
    display: none;  /* 默认隐藏 */
    width: 100%;
    padding: 2rem;
    margin-top: calc(var(--header-height) + 1.5rem);
}

/* 修改时钟样式 */
.clock {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.clock .time {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--text-color);  /* 使用主题颜色变量 */
    text-shadow: var(--text-shadow);  /* 使用主题文字阴影 */
    font-family: 'Arial', sans-serif;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.clock .date {
    font-size: 1.3rem;
    color: var(--desc-color);  /* 使用主题描述文字颜色 */
    margin-bottom: 2.5rem;
    text-shadow: var(--text-shadow);
}

/* 修改主页搜索框样式 */
.home-search {
    margin-top: 1rem;
    width: 100%;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.home-search .search-wrapper {
    background: var(--search-bg);  /* 使用主题搜索框背景色 */
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);  /* 使用主题边框颜色 */
    transition: all 0.3s ease;
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
}

.home-search .search-wrapper:hover {
    background: var(--card-bg);  /* 使用主题卡片背景色 */
    border-color: var(--primary-color);  /* 使用主题主色 */
}

.home-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-color);  /* 使用主题文字颜色 */
    font-size: 1.1rem;
    padding: 0.5rem 0;
}

.home-search input::placeholder {
    color: var(--desc-color);  /* 使用主题描述文字颜色 */
}

.home-search button {
    background: none;
    border: none;
    color: var(--desc-color);  /* 使用主题描述文字颜色 */
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.home-search button:hover {
    color: var(--primary-color);  /* 使用主题主色 */
    transform: scale(1.1);
}

/* 必应图标颜色保持不变，但添加主题适配的阴影 */
.home-search .fa-microsoft {
    color: #00a4ef;
    font-size: 1.2rem;
    text-shadow: var(--text-shadow);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .clock .time {
        font-size: 3.5rem;
    }

    .clock .date {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .clock .time {
        font-size: 2.8rem;
    }

    .clock .date {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* 移动端基础优化 */
@media (max-width: 768px) {
    /* 优化头部布局 */
    header {
        padding: 0 var(--space-md);
    }

    /* 优化侧边栏 */
    .sidebar {
        background: rgba(0, 0, 0, 0.8);  /* 加深背景色 */
        width: 85%;  /* 调整宽度 */
        max-width: 300px;  /* 限制最大宽度 */
    }

    /* 遮罩层 */
    body:not(.sidebar-hidden)::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        cursor: pointer;  /* 添加指针样式 */
        pointer-events: auto;  /* 确保可以接收点击事件 */
    }

    /* 优化网站卡片布局 */
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--space-md);
        padding: var(--space-md);
    }

    /* 优化卡片样式 */
    .site-card {
        padding: var(--space-md);
        min-height: 120px;  /* 确保合适的点击区域 */
    }

    /* 增大按钮和可点击区域 */
    .filter-btn {
        padding: 1rem;
        margin-bottom: 0.5rem;
        font-size: var(--font-size-base);
        min-height: 50px;  /* 更容易点击 */
    }

    /* 优化搜索框 */
    .search-box {
        max-width: 160px;  /* 限制搜索框宽度 */
    }

    .search-box input {
        font-size: var(--font-size-sm);
    }

    /* 优化时钟显示 */
    .clock-container {
        padding: var(--space-md);
    }

    /* 优化主页搜索 */
    .home-search .search-wrapper {
        padding: 0.8rem 1.2rem;
    }

    .home-search input {
        font-size: var(--font-size-base);
    }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
    /* 调整布局间距 */
    .sites-grid {
        grid-template-columns: 1fr;  /* 单列显示 */
        gap: var(--space-sm);
        padding: var(--space-sm);
    }

    /* 优化标题显示 */
    .logo-title h1 {
        font-size: var(--font-size-base);
        max-width: 150px;  /* 限制标题宽度 */
    }

    /* 优化搜索框 */
    .search-box {
        max-width: 140px;
    }

    /* 优化卡片内容 */
    .site-card {
        padding: var(--space-sm);
    }

    .site-description {
        font-size: var(--font-size-sm);
    }

    /* 优化触摸交互 */
    .site-card:active {
        transform: scale(0.98);
    }
}

/* 添加触摸反馈 */
@media (hover: none) {
    /* 移除悬停效果，改用触摸反馈 */
    .site-card:hover,
    .filter-btn:hover {
        transform: none;
    }

    /* 添加触摸反馈 */
    .site-card:active,
    .filter-btn:active {
        background: var(--card-bg);
        opacity: 0.8;
        transform: scale(0.98);
    }

    /* 优化触摸滚动 */
    .filter-buttons {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-bottom: env(safe-area-inset-bottom);  /* 适配全面屏 */
    }
}

/* 适配全面屏 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 优化移动端动画性能 */
@media (max-width: 768px) {
    * {
        transition-duration: 0.2s;  /* 更快的动画 */
    }

    .site-card {
        will-change: transform;  /* 优化变换性能 */
    }

    /* 使用transform替代opacity实现动画 */
    .toast {
        transform: translateX(100%);
    }

    .toast.show {
        transform: translateX(0);
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .sidebar {
        height: 100%;  /* 确保填满高度 */
        background: rgba(0, 0, 0, 0.8);  /* 加深背景色提高可读性 */
    }

    .filter-buttons {
        padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);  /* 适配全面屏 */
    }

    /* 当侧边栏打开时的遮罩 */
    body:not(.sidebar-hidden)::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    /* 确保侧边栏在遮罩上方 */
    body:not(.sidebar-hidden) .sidebar {
        z-index: 1000;
    }
}

/* 适配全面屏 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .filter-buttons {
            padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
        }
    }
}

/* 修改无搜索结果提示的样式 */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--desc-color);
    display: none;
    margin-top: calc(var(--header-height) + 1.5rem);  /* 添加顶部边距，避免被顶栏遮挡 */
}

/* 当在主页时，移除额外的顶部边距 */
body[data-category="all"] .no-results {
    margin-top: 0;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: var(--font-size-lg);
    line-height: 1.6;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .no-results {
        padding: 2rem 1rem;
        margin-top: calc(var(--header-height) + 1rem);  /* 移动端稍微减小边距 */
    }
    
    /* 当在主页时，移除额外的顶部边距 */
    body[data-category="all"] .no-results {
        margin-top: 0;
    }
    
    .no-results i {
        font-size: 2.5rem;
    }
    
    .no-results-text {
        font-size: var(--font-size-base);
    }
} 