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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    color: #333;
}

/* ===== 顶部搜索区域 ===== */
.search-hero {
    background: linear-gradient(135deg, #1a73e7 0%, #4285f6 50%, #6ea0ff 100%);
    padding: 60px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.search-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 36px;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

/* ===== 品牌单选 ===== */
.brand-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 26px;
}

.brand-opt {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 15px;
    color: #fff;
    background: rgba(255,255,255,0.16);
    border: 1.5px solid rgba(255,255,255,0.45);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.brand-opt:hover {
    background: rgba(255,255,255,0.3);
}

.brand-opt input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    transition: all 0.2s ease;
}

.brand-opt.active {
    background: #fff;
    color: #1a73e7;
    border-color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}

.brand-opt.active .brand-dot {
    border-color: #1a73e7;
    background: #1a73e7;
    box-shadow: inset 0 0 0 3px #fff;
}

.search-box {
    display: flex;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.search-input {
    flex: 1;
    padding: 18px 30px;
    font-size: 17px;
    border: none;
    outline: none;
    color: #333;
    background: transparent;
}

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

.search-btn {
    padding: 18px 40px;
    background: linear-gradient(135deg, #1a73e7, #4285f6);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px 50px 50px 0;
}

.search-btn:hover {
    background: linear-gradient(135deg, #1557b0, #1a73e7);
}

/* ===== 结果区域 ===== */
.results-area {
    max-width: 1400px;
    margin: -40px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    min-height: 500px;
}

.results-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.results-header {
    background: #f8f9fa;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.results-title {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.results-title span {
    color: #1a73e7;
    font-weight: 700;
}

.placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: #999;
}

.placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.placeholder-hint {
    font-size: 14px;
    color: #bbb;
}

/* ===== 加载状态 ===== */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #1a73e7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #999;
    font-size: 15px;
}

/* ===== 搜索结果列表（每行 3 个） ===== */
.results-list {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: stretch;
}

/* 结果区外层（计数头 + 网格 + 分页）：统一给一次内边距，避免与内层叠加 */
#resultsList {
    padding: 20px;
}

#resultsGrid {
    padding: 16px 0 0;
}

.results-count {
    grid-column: 1 / -1;
    padding: 0 4px 12px;
    font-size: 14px;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.results-count b {
    color: #1a73e7;
}

/* ===== 结果内筛选 ===== */
.filter-box {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input {
    width: 250px;
    padding: 8px 32px 8px 14px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    outline: none;
    transition: all 0.2s ease;
}

.filter-input:focus {
    border-color: #1a73e7;
    box-shadow: 0 0 0 3px rgba(26,115,231,0.12);
}

.filter-clear {
    position: absolute;
    right: 7px;
    width: 18px;
    height: 18px;
    line-height: 17px;
    text-align: center;
    border: none;
    background: #e0e0e0;
    color: #666;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    display: none;
    font-family: inherit;
}

.filter-clear:hover {
    background: #cfcfcf;
    color: #333;
}

.filter-empty {
    grid-column: 1 / -1;
    padding: 36px 4px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.result-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 18px 20px;
    transition: all 0.3s ease;
    min-width: 0;
    /* 固定高度 + 超出滚动 */
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c9c9c9 #f3f3f3;
}

.result-item::-webkit-scrollbar {
    width: 8px;
}

.result-item::-webkit-scrollbar-track {
    background: #f3f3f3;
    border-radius: 8px;
}

.result-item::-webkit-scrollbar-thumb {
    background: #c9c9c9;
    border-radius: 8px;
}

.result-item::-webkit-scrollbar-thumb:hover {
    background: #a9a9a9;
}

/* ===== 品类标识 ===== */
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}

.cat-chip.cat-主板    { background: #e6f0ff; color: #1a66d8; }
.cat-chip.cat-显卡    { background: #fdeaea; color: #d83a3a; }
.cat-chip.cat-笔记本  { background: #e9f8ee; color: #1a9d52; }
.cat-chip.cat-显示器  { background: #f5ecff; color: #8a3ad8; }
.cat-chip.cat-台式机  { background: #eef0f2; color: #5a6472; }
.cat-chip.cat-一体机  { background: #fff3e0; color: #c97a00; }
.cat-chip.cat-服务器  { background: #e8f4f7; color: #0d7c8a; }
.cat-chip.cat-工作站  { background: #fdeaf3; color: #c43a86; }
.cat-chip.cat-迷你主机 { background: #eef7e8; color: #5a8a14; }
.cat-chip.cat-电源    { background: #fff3e0; color: #c97a00; }
.cat-chip.cat-外设    { background: #e0f2f1; color: #00796b; }
.cat-chip.cat-机箱    { background: #eceff1; color: #546e7a; }
.cat-chip.cat-散热器  { background: #e1f5fe; color: #0277bd; }
.cat-chip.cat-其他    { background: #eef0f2; color: #5a6472; }
.cat-chip.cat-网络设备 { background: #e3f2fd; color: #0277bd; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 26px 0 8px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    color: #444;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: #1a73e7;
    color: #1a73e7;
}

.page-btn.active {
    background: #1a73e7;
    border-color: #1a73e7;
    color: #fff;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-ellipsis {
    min-width: 24px;
    text-align: center;
    color: #aaa;
}

.page-info {
    margin-left: 12px;
    font-size: 13px;
    color: #999;
}

.result-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #1a73e7;
}

.result-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.result-title {
    font-size: 17px;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}

.result-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.result-badge.driver {
    background: #e8f0fe;
    color: #1a73e7;
}

.result-badge.article {
    background: #fef3e2;
    color: #e8710a;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #888;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== 下载地址列表 ===== */
.dl-section {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.dl-loading {
    font-size: 13px;
    color: #888;
    padding: 8px 0;
}

.dl-group {
    margin-bottom: 14px;
}

.dl-group:last-child {
    margin-bottom: 0;
}

/* ===== 区块标签（官方驱动下载 / 基础驱动 / 国产MAC） ===== */
.dl-block {
    margin-bottom: 18px;
}

.dl-block:last-child {
    margin-bottom: 0;
}

.dl-section-label {
    border-left: 4px solid #444;
    padding-left: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin: 0 0 12px;
    line-height: 1.4;
}

.dl-block.official .dl-section-label {
    border-left-color: #0f9d58;
}

.dl-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    line-height: 1.5;
}

.dl-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dl-tag {
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.dl-tag.official { background: #e6f4ea; color: #137333; }
.dl-tag.primary  { background: #e8f0fe; color: #1a73e7; }
.dl-tag.backup   { background: #f1f3f4; color: #5f6368; }
.dl-tag.pan      { background: #fce8e6; color: #c5221f; }
.dl-tag.download { background: #f1f3f4; color: #5f6368; }

.dl-btns {
    display: flex;
    gap: 6px;
}

.dl-btn-sm {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s ease;
}

.dl-btn-sm.go {
    background: linear-gradient(135deg, #1a73e7, #4285f6);
    color: #fff;
    text-decoration: none;
    display: inline-block;
}

.dl-btn-sm.go:hover { background: linear-gradient(135deg, #1557b0, #1a73e7); }

.dl-btn-sm.copy {
    background: #f1f3f4;
    color: #333;
}

.dl-btn-sm.copy:hover { background: #e0e0e0; }

.dl-empty {
    font-size: 13px;
    color: #999;
    padding: 8px 0;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 16px;
    color: #666;
}

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

@media (max-width: 768px) {
    .search-hero {
        padding: 40px 16px 60px;
    }

    .hero-title {
        font-size: 26px;
    }

    .search-box {
        flex-direction: column;
        border-radius: 20px;
    }

    .search-input {
        padding: 16px 20px;
        text-align: center;
    }

    .search-btn {
        padding: 16px;
        border-radius: 0 0 20px 20px;
        justify-content: center;
    }

    .results-area {
        margin-top: -30px;
    }

    .results-list {
        grid-template-columns: 1fr;
    }

    .result-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== 品牌机型卡片 ===== */
.meta-link {
    color: #1a73e7;
    text-decoration: none;
    font-size: 13px;
}

.meta-link:hover {
    text-decoration: underline;
}

.brand-chip {
    display: inline-block;
    padding: 1px 9px;
    font-size: 12px;
    color: #1a73e7;
    background: #e8f0fe;
    border-radius: 10px;
}

.os-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.os-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.os-select {
    flex: 1;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}

.os-select:hover {
    border-color: #1a73e7;
}

.dl-summary {
    font-size: 12px;
    color: #888;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e6e6e6;
    margin-bottom: 10px;
}

.dl-section-label .cnt {
    font-weight: 400;
    font-size: 12px;
    color: #999;
    margin-left: 6px;
}

.dl-block.bios .dl-section-label {
    color: #b06000;
}

.dl-file {
    flex: 1;
    min-width: 0;
}

.dl-file-title {
    font-size: 13px;
    color: #333;
    line-height: 1.45;
    word-break: break-all;
}

.dl-file-meta {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

/* ===== 测试版标注 ===== */
.beta-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 17px;
    color: #854f0b;
    background: #faeeda;
    border: 1px solid #ef9f27;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: 1px;
}

.dl-link-row.is-beta {
    background: #fffbf3;
    border-left: 2px solid #ef9f27;
}

.dl-group.collapsed {
    max-height: 128px;
    overflow: hidden;
}

/* ===== 品类筛选条（计数头中间的红框区域） ===== */
.cat-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1 1 300px;
    justify-content: center;
}

.cat-filter-chip {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid #e0e4ea;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.cat-filter-chip:hover {
    border-color: #1a73e7;
    color: #1a73e7;
}

.cat-filter-chip.active {
    background: #1a73e7;
    border-color: #1a73e7;
    color: #fff;
    font-weight: 600;
}

.cat-filter-chip b {
    font-weight: 600;
    margin-left: 2px;
}

/* ===== 区块标签：展开/收起切换 ===== */
.dl-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dl-section-label .lbl-toggle {
    margin-left: auto;
    padding: 3px 12px;
    background: #fff;
    border: 1px solid #c9dcf5;
    border-radius: 6px;
    color: #1a73e7;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dl-section-label .lbl-toggle:hover {
    background: #e8f0fe;
    border-color: #1a73e7;
}
