/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: linear-gradient(135deg, #ffe0b2 0%, #e0e0ff 100%);
    color: #333;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

input#search {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* 顶部分类标签栏 —— 全平台使用 */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    /* 适中间距 */
    padding: 12px 0;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f5f0;
    max-width: 100%;
    /* 确保不超出容器 */
}

.category-tabs::-webkit-scrollbar {
    height: 6px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.category-tabs button {
    background: #f8f5f0;
    /* 米白色 */
    border: none;
    padding: 8px 16px;
    /* 适中内边距 */
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
    min-width: 90px;
    /* 最小宽度足够显示 3 个字 */
    flex-shrink: 1;
    /* 关键：允许缩小 */
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-overflow: ellipsis;
    /* 显示省略号 */
}

.category-tabs button:hover {
    background: #f0e8d8;
    transform: translateY(-1px);
}

.category-tabs button.active {
    background: #f59e0b;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 书签区域 */
.category-section {
    margin-bottom: 20px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    padding-left: 24px; /* ✅ 修改：从 10px 增加到 24px，拉开距离 */
    position: relative;
}

.category-title::before {
    content: "▷";
    position: absolute;
    left: 0;
    top: 0;
    color: #6a5acd;
    font-weight: bold;
    /* margin-right 不生效（因为 absolute），所以靠 padding-left 控制间距 */
}

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

/* 手机端：卡片全宽 */
@media (max-width: 767px) {
    .bookmark-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* 书签卡片 */
.bookmark-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    border-left: 4px solid #6a5acd;
    text-decoration: none;
    display: block;
    color: inherit;
}

.bookmark-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border-left-color: #8b6f4e;
}

.bookmark-info h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1a1a1a;
}

.bookmark-info p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
}

a {
    text-decoration: none !important;
    color: inherit;
}