/* (Previous styles remain the same) */

/* 通用样式和背景 */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif; /* 正文使用 Roboto */
    background-color: #0a192f; /* 深蓝背景 */
    color: #e2e8f0; /* 浅色文字 */
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh; /* 确保背景覆盖整个视口 */
    /* 添加一个背景图会增强毛玻璃效果，这里只是示例，您可自行替换 */
    /* background-image: url('your-background-image.jpg'); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* 背景固定，滚动时毛玻璃效果更明显 */
}

h1, h2 {
    font-family: 'Orbitron', sans-serif; /* 标题使用 Orbitron */
    color: #0ff; /* 霓虹蓝 */
    text-shadow: 0 0 5px #0ff, 0 0 10px #0ff; /* 发光效果 */
}
.language-switcher {
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex; /* 水平排列按钮 */
    gap: 10px; /* 按钮间距 */
    flex-wrap: wrap; /* 小屏幕换行 */
}

.language-switcher button {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.language-switcher button:hover {
     background-color: rgba(255, 255, 255, 0.15);
     border-color: rgba(255, 255, 255, 0.2);
}

.language-switcher button.active {
    background-color: #0ff; /* 选中状态 */
    color: #0a192f;
    border-color: #0ff;
    font-weight: bold;
}
.container {
    display: flex;
    gap: 20px; /* 侧边栏和主内容之间的间距 */
    max-width: 1200px;
    margin: 0 auto; /* 居中 */
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    flex-shrink: 0; /* 不会被挤压 */
    padding: 20px;
    /* Glassmorphism 效果 */
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    align-self: flex-start; /* 顶部对齐 */
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.5em;
}

#category-filter {
    display: flex;
    flex-direction: column; /* 按钮垂直排列 */
}

.category-button {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
}

.category-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-button.active {
    background-color: #0ff; /* 选中状态使用霓虹蓝 */
    color: #0a192f; /* 深色文字 */
    border-color: #0ff;
    font-weight: bold;
}

/* 主内容区域样式 */
.main-content {
    flex-grow: 1; /* 占据剩余空间 */
}

/* 新增: 搜索框容器样式 - 应用毛玻璃效果 */
.search-container {
    margin-bottom: 20px; /* 搜索框和标题之间的间距 */
    padding: 15px 20px; /* 容器内部填充 */
    /* Glassmorphism 效果 */
    background-color: rgba(255, 255, 255, 0.08); /* 半透明白色背景 */
    backdrop-filter: blur(10px); /* **核心毛玻璃效果** */
    -webkit-backdrop-filter: blur(10px); /* 兼容 Safari */
    border: 1px solid rgba(255, 255, 255, 0.1); /* 半透明边框 */
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2); /* 阴影 */
    display: flex; /* 使用 flex 布局使输入框填充容器 */
    align-items: center;
}


/* 新增: 搜索输入框样式 */
#search-input {
    flex-grow: 1; /* 占据容器剩余空间 */
    padding: 10px 0; /* 调整内边距，因为容器已经有 padding */
    border: none; /* 移除输入框本身的边框 */
    background-color: transparent; /* 背景透明，看到容器的毛玻璃效果 */
    color: #e2e8f0; /* 文字颜色 */
    font-size: 1em;
    font-family: 'Roboto', sans-serif;
    outline: none; /* 移除默认轮廓 */
    /* 可选：在输入框底部加一个细线 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-bottom-color 0.3s ease;
}

#search-input::placeholder {
    color: rgba(226, 232, 240, 0.6); /* 占位符文字颜色 */
}

#search-input:focus {
    border-bottom-color: #0ff; /* 聚焦时底部线变亮 */
}


#loading-message {
    text-align: center;
    font-size: 1.2em;
    color: #0ff;
    animation: pulse 1.5s infinite alternate; /* 加载动画 */
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.5; }
}


/* 卡片网格布局 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 响应式列 */
    gap: 20px; /* 卡片之间的间距 */
    margin-top: 20px;
}

/* 单个卡片样式 - 应用毛玻璃效果 */
.data-card {
    /* Glassmorphism 效果 */
     /* 使用和 search-container 相似的背景和模糊度 */
    background-color: rgba(255, 255, 255, 0.08); /* 半透明白色背景 */
    backdrop-filter: blur(10px); /* **核心毛玻璃效果** */
    -webkit-backdrop-filter: blur(10px); /* 兼容 Safari */
    border: 1px solid rgba(255, 255, 255, 0.1); /* 半透明边框 */
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2); /* 阴影 */

    padding: 20px;
    display: flex;
    flex-direction: column; /* 内容垂直排列 */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 悬停动画 */
    position: relative; /* 用于内容渐变遮罩 */

    /* 初始动画 - 简单淡入 */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}

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

/* 可选: 悬停时的微交互 */
.data-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.data-card h3 {
    font-family: 'Orbitron', sans-serif;
    color: #0ff;
    margin-top: 0;
    margin-bottom: 10px; /* 标题和内容之间的间距 */
    font-size: 1.3em;
    text-shadow: 0 0 3px #0ff; /* 给卡片标题也加个小发光 */
}

/* 内容区域样式 */
.card-content {
    margin-bottom: 15px; /* 内容和按钮容器之间的间距 */
    overflow: hidden; /* 隐藏超出部分 */
    max-height: 80px; /* 初始只显示部分内容 */
    position: relative; /* 用于渐变遮罩 */
    transition: max-height 0.5s ease; /* 展开/收起动画 */
    text-align: justify; /* 内容两端对齐 */
}

/* 内容展开时的样式 */
.card-content.expanded {
    max-height: none; /* 显示全部内容 */
    margin-bottom: 10px; /* 展开后和按钮容器的间距稍微小一点 */
}

/* 内容底部渐变遮罩，模拟科技感 */
/* 注意：毛玻璃背景下，渐变遮罩需要使用 body 的背景颜色 */
.card-content:not(.expanded)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px; /* 遮罩高度 */
    /* 使用 body 的背景色作为渐变终点 */
    background: linear-gradient(to bottom, rgba(10, 25, 47, 0), rgba(10, 25, 47, 0.8), rgba(10, 25, 47, 1)); /* 从透明到背景色的渐变 */
    pointer-events: none; /* 允许点击穿透 */
}

/* 按钮容器样式 */
.card-actions {
    display: flex; /* 使用 Flexbox 排列按钮 */
    justify-content: flex-start; /* 按钮靠左对齐 */
    gap: 10px; /* 按钮之间的间距 */
    margin-top: auto; /* 将按钮推到底部 */
    flex-wrap: wrap; /* 小屏幕下允许换行 */
}


/* "显示全部" 按钮样式 */
.toggle-content {
    background: none;
    border: none;
    color: #0ff; /* 霓虹蓝 */
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
    text-decoration: underline;
    transition: color 0.3s ease;
    font-family: 'Roboto', sans-serif; /* 确保字体一致 */
}

.toggle-content:hover {
    color: #fff; /* 悬停变亮 */
}

/* 当内容不长时隐藏按钮 */
.toggle-content.hidden {
    display: none;
}

/* 新增: "复制内容" 按钮样式 */
.copy-button {
    background-color: rgba(0, 255, 255, 0.1); /* 淡青色背景 */
    color: #0ff; /* 霓虹蓝文字 */
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    font-family: 'Roboto', sans-serif; /* 确保字体一致 */
    display: inline-flex; /* 使用 flex 方便对齐内部图标/文本 */
    align-items: center;
    /* gap: 5px; 如果有图标和文本 */
}

.copy-button:hover {
    background-color: rgba(0, 255, 255, 0.2);
    border-color: #0ff;
    color: #fff;
}

.copy-button:active {
     background-color: rgba(0, 255, 255, 0.3);
     border-color: #fff;
}

/* 可选: 复制成功/失败时的样式反馈 */
.copy-button.success {
    background-color: rgba(0, 255, 0, 0.2); /* 绿色背景 */
    border-color: #0f0;
    color: #0f0;
}

.copy-button.error {
    background-color: rgba(255, 0, 0, 0.2); /* 红色背景 */
    border-color: #f00;
    color: #f00;
}

.copy-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.hidden {
    display: none !important; /* 使用 !important 确保覆盖其他 display 样式 */
}

/* 新增: Giscus 评论容器样式 */
#comments-container {
    margin-top: 20px;
    padding: 20px;
    /* 可选: 给评论区域也加上毛玻璃效果 */
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* 新增: 评论按钮样式 (与分类按钮类似) */
/* 它已经有了 .category-button 类，只需要覆盖或添加特定样式 */
#comments-button {
     /* 与其他 category-button 共享样式 */
     /* 可以选择添加一些区分度，例如不同的背景色或边框 */
     /* background-color: rgba(128, 0, 128, 0.1); Purple tone */
     /* border-color: rgba(128, 0, 128, 0.3); */
}

/* 评论按钮激活状态 */
#comments-button.active {
    background-color: #0ff; /* 使用霓虹蓝 */
    color: #0a192f;
    border-color: #0ff;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* 小屏幕下侧边栏在顶部 */
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px;
        border-radius: 0; /* 可选：顶部侧边栏取消圆角 */
    }

    #category-filter {
        flex-direction: row; /* 小屏幕下分类按钮水平排列 */
        flex-wrap: wrap; /* 换行 */
        gap: 10px; /* 按钮之间的小间距 */
    }

    .category-button {
        margin-bottom: 0; /* 取消垂直间距 */
    }

    .main-content {
        padding-top: 0; /* 取消顶部填充 */
    }

    .card-grid {
         /* grid 会自动调整，这里可以不改 */
    }

     .card-actions {
        justify-content: center; /* 小屏幕下按钮居中 */
     }
}
