[data-theme="dark"] {
    /* 暗色主题 */
    --bg-color: #1a1a1a;
    --text-color: #ecf0f1;
    --card-bg: #2d2d2d;
    --primary-color: #2980b9;
    --secondary-color: #27ae60;
    --border-color: #404040;
    --hover-bg: rgba(41, 128, 185, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.3s, color 0.3s;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
}

/* 控制栏 */
.control-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* 主题切换 */
.theme-switch button {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}
/* 模式切换 */
.mode-switch {
    text-align: right;
    margin-bottom: 20px;
}

.mode-switch button {
    padding: 8px 16px;
    background: #409EFF;
    color: white;
    border: none;
    border-radius: 20px; /* 圆角按钮 */
    cursor: pointer;
    position: relative;
    min-width: 80px; /* 减小最小宽度 */
    transition: background 0.3s; /* 添加过渡效果 */
}

.mode-switch button:hover {
    background: #3a8ee6; /* 鼠标悬停时的背景颜色 */
}

.mode-switch .loading {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* 搜索框 */
.search-box {
    margin: 30px 0;
}

.search-header {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

#engineSelect {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
}

.search-input {
    flex: 1;
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

#searchKeyword {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-color);
}

#searchKeyword:focus {
    outline: none;
}

.search-input button {
    padding: 0 20px;
    background: var(--secondary-color);
    border: none;
    color: white;
    cursor: pointer;
}

/* 分类区块 */
.category {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.category h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--border-color);
    font-size: 1.5em;
}

/* 链接网格 */
.links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(25% - 18px), 1fr));
    gap: 18px;
}

/* 链接项 */
.link-item {
    padding: 16px;
    border-radius: 8px;
    background: #f5f7fa;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.link-item:hover {
    background: #409EFF;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

.link-item a {
    color: #303133;
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 80%;
}

.link-item:hover a {
    color: white;
}

/* 图标样式 */
.fas {
    margin-right: 12px;
    width: 24px;
    text-align: center;
    font-size: 1.2em;
}

/* 加载动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 移动端适配 */
@media (max-width: 1200px) {
    body {
        padding: 12px;
    }

    .search-box input {
        width: 100%;
        margin-bottom: 12px;
    }

    .search-box button {
        width: 20%;
        margin-left: 0;
    }

    .links {
        grid-template-columns: 1fr;
    }

    .mode-switch button {
        width: 102%;
    }

    .category .link-item {
        width: 33%; /* 手机上每行显示两个链接 */
        box-sizing: border-box;
        padding: 5px;
    }
}

/* 1080x2400 屏幕适配 */
@media (max-width: 1080px) and (min-height: 2400px) {
    .links {
        grid-template-columns: repeat(2, 1fr); /* 每行显示 2 个链接项 */
    }
}

/* 默认样式，适用于电脑屏幕 */
.category .links {
    display: flex;
    flex-wrap: wrap;
}

.category .link-item {
    width: 20%; /* 电脑上每行显示一个链接 */
    box-sizing: border-box;
    padding: 5px;
}

/* 新增：修改备案信息样式 */
.icp-info {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-color); /* 使用主题变量控制文字颜色 */
}

.icp-info a {
    color: var(--text-color); /* 让链接颜色也跟随主题变量 */
    text-decoration: none; /* 去除下划线 */
}

.icp-info a:hover {
    text-decoration: underline; /* 鼠标悬停时显示下划线 */
}