/* 全局基础样式 - 字体缩小，配色保留，边框强化 */
:root {
    --primary: #4285F4;
    --secondary: #673AB7;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --primary-gradient: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    --bg: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --card: #FFFFFF;
    --text: #2D3748;
    --text-light: #718096;
    --border: #E2E8F0;
    --border-deep: #CBD5E1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}
.dark {
    --bg: #1A202C;
    --bg-secondary: #2D3748;
    --card: #2D3748;
    --text: #F7FAFC;
    --text-light: #A0AEC0;
    --border: #4A5568;
    --border-deep: #6B7280;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.3);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    scroll-behavior: smooth;
    font-size: 13px; /* 全局字体缩小，基础字号13px */
}

/* 布局核心 - 1280px固定，适配3列布局 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
.main {
    min-height: calc(100vh - 180px);
    padding: 30px 0;
}

/* 头部样式 - 字体缩小，边框强化 */
.header {
    background: var(--card);
    padding: 16px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-deep);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-text {
    font-size: 20px; /* 缩小 */
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-deep);
    border-radius: 50%;
    font-size: 18px; /* 缩小 */
    cursor: pointer;
    color: var(--text);
    width: 38px; /* 缩小 */
    height: 38px; /* 缩小 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.theme-toggle:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-hover);
}

/* 搜索区样式 - 字体缩小，边框完整，模块感强 */
.search-card {
    background: var(--card);
    padding: 30px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid var(--border-deep); /* 完整边框 */
}
.search-title {
    font-size: 20px; /* 缩小 */
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    font-weight: 700;
}
.search-input {
    width: 100%;
    max-width: 650px; /* 缩小 */
    padding: 12px 16px; /* 缩小 */
    border: 1px solid var(--border-deep); /* 深边框 */
    border-radius: var(--radius-md);
    font-size: 14px; /* 缩小 */
    background: var(--bg-secondary);
    color: var(--text);
    outline: none;
    margin-bottom: 20px;
    transition: all 0.3s;
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

/* 筛选栏 - 字体缩小，居中布局 */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-label {
    font-size: 14px; /* 缩小 */
    color: var(--text);
    font-weight: 500;
}
.custom-select {
    padding: 8px 30px 8px 16px; /* 缩小 */
    border: 1px solid var(--border-deep); /* 深边框 */
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 14px; /* 缩小 */
    outline: none;
    appearance: none;
    cursor: pointer;
    min-width: 140px; /* 缩小 */
    transition: all 0.3s;
    position: relative;
}
.custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}
.select-wrapper {
    position: relative;
}
.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px; /* 缩小 */
    color: var(--text-light);
    pointer-events: none;
}

/* 使用指南 - 字体缩小，边框完整，分割线强化 */
.guide-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--border-deep); /* 完整边框 */
}
.guide-header {
    background: var(--primary-gradient);
    color: white;
    padding: 12px 20px; /* 缩小 */
    font-size: 14px; /* 缩小 */
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--border-deep);
}
.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px solid var(--border-deep); /* 分割线 */
    background: var(--border-deep);
}
.step-item {
    background: var(--bg-secondary);
    padding: 20px 15px; /* 缩小 */
    text-align: center;
    transition: all 0.3s;
    border-right: 1px solid var(--border-deep);
}
.step-item:last-child {
    border-right: none;
}
.step-item:hover {
    background: rgba(66, 133, 244, 0.03);
}
.step-number {
    display: inline-block;
    width: 32px; /* 缩小 */
    height: 32px; /* 缩小 */
    line-height: 32px; /* 缩小 */
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px; /* 缩小 */
    color: white;
    margin-bottom: 12px;
}
.step-1 { background: var(--primary); }
.step-2 { background: var(--secondary); }
.step-3 { background: var(--success); }
.step-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px; /* 缩小 */
    color: var(--text);
}
.step-desc {
    font-size: 12px; /* 缩小 */
    color: var(--text-light);
    line-height: 1.5;
}

/* 资源列表与卡片 - 核心：3列固定，简介两行，移除大小，边框完整 */
.resource-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px; /* 缩小 */
    border: 1px solid var(--border-deep); /* 完整边框 */
}
.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border); /* 分割线 */
}
.resource-header h3 {
    font-size: 16px; /* 缩小 */
    font-weight: 700;
    color: var(--text);
}
.result-count {
    color: var(--text-light);
    font-size: 12px; /* 缩小 */
    padding: 6px 12px; /* 缩小 */
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
/* 核心：每行3个，固定宽度，自适应间距 */
.resource-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 强制3列 */
    gap: 18px; /* 适配3列间距 */
    margin-bottom: 30px;
}
.resource-item {
    background: var(--bg-secondary);
    padding: 16px; /* 缩小 */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-deep); /* 完整边框 */
    transition: all 0.3s;
    height: 100%; /* 等高布局 */
    display: flex;
    flex-direction: column;
}
.resource-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.resource-labels {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.label {
    display: inline-block;
    padding: 3px 8px; /* 缩小 */
    border-radius: 16px;
    font-size: 11px; /* 缩小 */
    font-weight: 600;
}
.label-video { background: rgba(239,68,68,0.1); color: var(--danger); }
.label-software { background: rgba(59,130,246,0.1); color: var(--info); }
.label-study { background: rgba(16,185,129,0.1); color: var(--success); }
.label-ebook { background: rgba(139,92,246,0.1); color: var(--secondary); }
.label-other { background: rgba(245,158,11,0.1); color: var(--warning); }
.label-updating { background: rgba(245,158,11,0.1); color: var(--warning); }
.label-finished { background: rgba(16,185,129,0.1); color: var(--success); }
.hot-badge {
    background: linear-gradient(90deg, var(--warning) 0%, var(--danger) 100%);
    color: white;
    padding: 3px 8px; /* 缩小 */
    border-radius: 16px;
    font-size: 11px; /* 缩小 */
    font-weight: 600;
}
/* 核心：简介强制两行，超出省略 */
.resource-desc {
    font-size: 12px; /* 缩小 */
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 0 16px 0; /* 移除大小后调整间距 */
    padding: 8px 12px; /* 缩小 */
    background: rgba(66, 133, 244, 0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    /* 强制两行省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1; /* 占满剩余高度 */
}
.resource-item h4 {
    font-size: 14px; /* 缩小 */
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 按钮样式 - 字体缩小，渐变主按钮，新标签页打开 */
.btn {
    padding: 10px 0; /* 缩小，左右无padding（占满卡片） */
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 13px; /* 缩小 */
    width: 100%;
}
.btn-primary {
    background: var(--primary-gradient);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}
.back-btn {
    background: var(--primary-gradient);
    color: white;
    margin: 16px 0; /* 缩小 */
    display: inline-flex;
    align-items: center;
    gap: 6px; /* 缩小 */
    padding: 8px 16px; /* 缩小 */
    font-size: 13px; /* 缩小 */
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid var(--border-deep);
}
.back-btn:hover {
    box-shadow: var(--shadow-hover);
}

/* 分页 - 字体缩小，页码间隔，边框完整 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px; /* 缩小 */
    padding: 10px 0;
}
.page-btn {
    padding: 8px 14px; /* 缩小 */
    background: var(--bg-secondary);
    border: 1px solid var(--border-deep); /* 深边框 */
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px; /* 缩小 */
}
.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(66, 133, 244, 0.05);
}
.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
}
.page-number {
    width: 36px; /* 缩小 */
    height: 36px; /* 缩小 */
    line-height: 36px; /* 缩小 */
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-deep); /* 深边框 */
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px; /* 缩小 */
    margin: 0 3px; /* 缩小间隔 */
}
.page-number.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(66, 133, 244, 0.2);
}
.page-number:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* 空状态 - 字体缩小，边框适配 */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px; /* 缩小 */
    color: var(--text-light);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    margin: 20px 0;
}
.empty-icon {
    font-size: 48px; /* 缩小 */
    margin-bottom: 16px;
    color: var(--text-light);
}
.empty p {
    font-size: 14px; /* 缩小 */
}

/* 详情页样式 - 字体缩小，边框完整，层次分明，移除大小标签 */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* 缩小 */
    margin-top: 16px; /* 缩小 */
}
.file-item {
    padding: 16px; /* 缩小 */
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-deep); /* 完整边框 */
    transition: all 0.3s;
}
.file-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.file-links {
    display: flex;
    gap: 10px; /* 缩小 */
    margin-top: 10px; /* 缩小 */
    flex-wrap: wrap;
}
.file-link {
    padding: 8px 16px; /* 缩小 */
    border-radius: var(--radius-sm);
    font-size: 12px; /* 缩小 */
    font-weight: 600;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
    border: 1px solid var(--border-deep);
}
.file-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}
.baidu-link { background: var(--primary); }
.quark-link { background: var(--secondary); }

/* 页脚 - 字体缩小，边框强化 */
.footer {
    background: var(--card);
    padding: 20px 0; /* 缩小 */
    margin-top: auto;
    width: 100%;
    border-top: 2px solid var(--border-deep); /* 粗边框 */
    text-align: center;
    font-size: 12px; /* 缩小 */
    color: var(--text-light);
}
.footer-note {
    font-size: 11px; /* 缩小 */
    margin-top: 8px;
}

/* 搜索高亮样式（新增核心样式） */
.search-highlight {
    background: #FBBF24;
    color: #1F2937;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}
.dark .search-highlight {
    background: #F59E0B;
    color: #111827;
}

/* 响应式适配 - 移动端单列，保留样式 */
@media (max-width: 992px) {
    .resource-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .main { min-height: calc(100vh - 170px); padding: 20px 0; }
    .steps-container { grid-template-columns: 1fr; }
    .resource-list { grid-template-columns: 1fr; gap: 12px; }
    .search-card { padding: 20px 15px; }
    .search-title { font-size: 18px; }
    .search-input { font-size: 13px; max-width: 100%; }
    .resource-card { padding: 15px; }
    .filter-bar { gap: 8px; justify-content: center; }
    .custom-select { min-width: 120px; padding: 6px 24px 6px 12px; }
    .page-number { width: 32px; height: 32px; margin: 0 2px; }
    .page-btn { padding: 6px 12px; }
    .step-item { border-right: none; border-bottom: 1px solid var(--border-deep); }
    .step-item:last-child { border-bottom: none; }
}