/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    padding: 30px 20px;
}

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

/* ===== 网站头部 ===== */
.site-header {
    text-align: center;
    padding: 40px 0 30px;
}

.site-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 1px;
}

.site-header h1 span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-header .subtitle {
    color: #888;
    font-size: 14px;
    margin-top: 6px;
}

/* ===== 分类标题 ===== */
.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    padding-bottom: 12px;
    border-bottom: 3px solid #667eea;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title .badge {
    background: #667eea;
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    padding: 0 12px;
    line-height: 24px;
    font-weight: 400;
}

/* ===== 卡片网格 ===== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

/* ===== 卡片样式 ===== */
.link-card {
    background: #fff;
    border-radius: 10px;
    padding: 8px 14px 8px;   /* 内边距大幅减小 */
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;      /* 改为横向排列，更矮 */
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #667eea;
    min-height: 48px;         /* 从70px减到48px */
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.link-card .card-icon {
    font-size: 18px;          /* 从20px减到18px */
    flex-shrink: 0;
    line-height: 1;
}

.link-card .card-info {
    flex: 1;
    min-width: 0;            /* 防止溢出 */
}

.link-card .card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0;
}

.link-card .card-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card .card-url {
    display: none;
}

/* ===== 空状态 ===== */
.empty-tip {
    text-align: center;
    color: #bbb;
    padding: 40px 0;
    grid-column: 1 / -1;
}

/* ===== 后台管理入口 ===== */
.admin-entry {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #e8e8e8;
}

.admin-entry a {
    color: #bbb;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-entry a:hover {
    color: #667eea;
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .link-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .link-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .link-grid {
        grid-template-columns: 1fr;
    }
    .site-header h1 {
        font-size: 24px;
    }
}

/* ===== 搜索框 ===== */
.search-box {
    max-width: 520px;
    margin: 16px auto 0;
}

.search-box form {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 4px 4px 4px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box form:focus-within {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 10px 0;
    background: transparent;
    color: #333;
    min-width: 0;
}

.search-input::placeholder {
    color: #bbb;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    white-space: nowrap;
}

.search-btn:hover {
    transform: scale(1.02);
    opacity: 0.92;
}

.search-btn:active {
    transform: scale(0.96);
}

.search-clear {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    padding: 0 12px;
    white-space: nowrap;
    transition: color 0.2s;
}

.search-clear:hover {
    color: #e74c3c;
}

.search-info {
    margin-top: 10px;
    font-size: 14px;
    color: #888;
}

.search-info strong {
    color: #333;
}

/* 搜索结果中的分类标签 */
.card-category {
    font-size: 10px;
    background: #f0f2f5;
    color: #888;
    padding: 1px 10px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 400;
    vertical-align: middle;
}

/* 搜索无结果时 */
.empty-tip .search-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== 响应式 ===== */
@media (max-width: 500px) {
    .search-box {
        max-width: 100%;
        margin: 12px auto 0;
    }
    .search-box form {
        padding: 3px 3px 3px 14px;
        border-radius: 30px;
    }
    .search-input {
        font-size: 14px;
        padding: 8px 0;
    }
    .search-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    .search-clear {
        font-size: 12px;
        padding: 0 8px;
    }
    .search-info {
        font-size: 13px;
    }
}