:root {
    --bg: #eceef0;
    --sheet: #f7f8f9;
    --text: #101317;
    --secondary: #555d68;
    --muted: #8a919b;
    --hair: #d5d9de;
    --rule: #9aa1ab;
    --hover: rgba(16, 19, 23, 0.05);
    --accent: #1c3fd0;
    --accent-soft: rgba(28, 63, 208, 0.09);
    --accent-ring: rgba(28, 63, 208, 0.16);
    --cat-firmware: #1c3fd0;
    --cat-software: #0f7a55;
    --cat-document: #8a919b;
    --toast-bg: rgba(16, 19, 23, 0.92);
    --toast-text: #ffffff;
    --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #131518;
        --sheet: #1b1e22;
        --text: #e6e8eb;
        --secondary: #a3aab4;
        --muted: #6f7680;
        --hair: #2a2e34;
        --rule: #4a5058;
        --hover: rgba(255, 255, 255, 0.05);
        --accent: #8aa2ff;
        --accent-soft: rgba(138, 162, 255, 0.12);
        --accent-ring: rgba(138, 162, 255, 0.25);
        --cat-firmware: #8aa2ff;
        --cat-software: #4fd1a0;
        --cat-document: #6f7680;
        --toast-bg: rgba(230, 232, 235, 0.94);
        --toast-text: #131518;
    }
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: -apple-system, "SF Pro Text", "Inter", "PingFang SC", "Noto Sans", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
}
.hidden {
    display: none !important;
}
.shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    max-width: 1240px;
    margin: 0 auto;
}
.side {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 32px 24px 20px 28px;
    border-right: 1px solid var(--hair);
}
.brand {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.brand span {
    color: var(--accent);
}
.meta {
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
}
.tools {
    margin-top: 24px;
}
.search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px;
    background: var(--sheet);
    border: 1px solid var(--hair);
    border-radius: 8px;
    color: var(--muted);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    color: var(--text);
}
.search input::placeholder {
    color: var(--muted);
}
.search input::-webkit-search-cancel-button {
    display: none;
}
.search-icon {
    flex: none;
}
.clear-btn {
    flex: none;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 5px;
    margin-right: -5px;
    border-radius: 6px;
    display: flex;
}
.filters {
    margin-top: 12px;
    display: grid;
    gap: 1px;
}
.filters button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-size: 13px;
    color: var(--secondary);
    cursor: pointer;
    text-align: left;
}
.filters button[aria-pressed="true"],
.index a.active {
    color: var(--text);
    font-weight: 600;
    border-radius: 2px 6px 6px 2px;
    box-shadow: inset 2px 0 0 var(--accent);
}
.filters button.is-empty {
    opacity: 0.45;
}
mark {
    background: none;
    color: inherit;
    text-decoration: underline 2px var(--accent);
    text-underline-offset: 3px;
}
.count {
    font-family: var(--mono);
    font-size: 11px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}
.index {
    flex: 1;
    overflow-y: auto;
    margin: 22px -8px 0;
    padding: 0 8px;
    scrollbar-width: thin;
}
.index a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--secondary);
    text-decoration: none;
}
.index a .count {
    color: var(--muted);
    font-weight: 400;
}
@media (hover: hover) and (pointer: fine) {
    .clear-btn:hover,
    .filters button:not([aria-pressed="true"]):hover,
    .index a:hover {
        background: var(--hover);
        color: var(--text);
    }
}
main {
    /* 首个分组标题与侧栏搜索框顶部对齐，让品牌名独占左上角 */
    padding: 93px 40px 40px;
    min-width: 0;
}
.sec {
    /* 跳转后分组标题与左上角品牌名对齐 */
    scroll-margin-top: 22px;
}
.sec:first-child .sechead {
    margin-top: 0;
}
/* 吸顶位置与左上角品牌名对齐，::before 遮住上方空隙，避免滚动内容从缝里露出 */
.sechead {
    position: sticky;
    top: 22px;
    z-index: 10;
    background: var(--bg);
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 28px;
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--rule);
}
.sechead::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 22px;
    background: var(--bg);
}
.sechead h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.015em;
}
.sechead .count {
    color: var(--muted);
}
.prod {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hair);
}
.prod h3 {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.35;
}
.files {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px 88px 72px 32px;
    gap: 12px;
    align-items: center;
    min-height: 32px;
    margin: 0 -6px;
    padding: 0 2px 0 6px;
    border-radius: 6px;
}
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}
.file-link svg {
    flex: none;
    color: var(--muted);
}
.file-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ver,
.date,
.size {
    font-family: var(--mono);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ver {
    color: var(--secondary);
}
.date,
.size {
    color: var(--muted);
}
.size {
    text-align: right;
}
.date.is-updated {
    position: relative;
    color: var(--accent);
}
.date.is-updated::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: var(--accent);
}
/* 复制按钮只在悬停或键盘聚焦时出现，避免每行都挂一个图标 */
@media (hover: hover) and (pointer: fine) {
    .row .iconbtn {
        opacity: 0;
    }
    .row:hover .iconbtn,
    .row:focus-within .iconbtn,
    .row-selected .iconbtn {
        opacity: 1;
    }
    .row:hover {
        background: var(--sheet);
    }
    .file-link:hover span {
        text-decoration: underline;
        text-underline-offset: 3px;
    }
    .file-link:hover svg {
        color: var(--accent);
    }
}
.row-selected {
    background: var(--sheet);
    box-shadow: inset 0 0 0 1.5px var(--accent);
}
.iconbtn {
    border: 0;
    background: transparent;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    font: inherit;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}
.iconbtn:active {
    transform: scale(0.94);
}
@media (hover: hover) and (pointer: fine) {
    .iconbtn:hover {
        color: var(--accent);
        background: var(--accent-soft);
    }
}
.iconbtn.is-copied {
    color: var(--cat-software);
}
.iconbtn:focus-visible,
.clear-btn:focus-visible,
.filters button:focus-visible,
.index a:focus-visible,
.file-link:focus-visible,
.back-to-top:focus-visible {
    outline: none;
    border-radius: 6px;
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.empty {
    padding: 120px 0;
    text-align: center;
    color: var(--muted);
}
.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 4px;
}
.footer {
    margin-top: 40px;
    font-size: 11.5px;
    color: var(--muted);
}
.footer a {
    color: inherit;
    text-decoration: none;
}
.footer a:hover {
    color: var(--text);
    text-decoration: underline;
}
.back-to-top {
    display: none;
}
.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 14px);
    opacity: 0;
    pointer-events: none;
    z-index: 70;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--toast-text);
    background: var(--toast-bg);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.copy-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.copy-toast.error {
    background: #b91c1c;
    color: #ffffff;
}
@media (max-width: 860px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }
    /* 侧栏拆开平铺：品牌 → 吸顶的搜索与筛选 → 横向分组索引 → 列表 */
    .side {
        display: contents;
    }
    .brand-block {
        padding: 20px 16px 0;
    }
    .tools {
        position: sticky;
        top: 0;
        z-index: 40;
        margin: 0;
        padding: 12px 16px 10px;
        background: var(--bg);
        border-bottom: 1px solid var(--hair);
    }
    .filters {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        margin-right: -16px;
        padding-right: 24px;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }
    .filters button {
        flex: none;
    }
    .filters button[aria-pressed="true"] {
        border-radius: 6px;
        box-shadow: none;
        background: var(--hover);
    }
    .index {
        display: flex;
        gap: 4px;
        margin: 0;
        padding: 10px 6px 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .index a {
        flex: none;
        white-space: nowrap;
    }
    main {
        padding: 6px 16px 32px;
    }
    .sec {
        scroll-margin-top: 110px;
    }
    .sechead {
        position: static;
    }
    .sechead::before {
        content: none;
    }
    .prod {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }
    .prod h3 {
        margin: 0;
    }
    .row {
        grid-template-columns: minmax(0, 1fr) auto auto 32px;
        min-height: 44px;
    }
    .date {
        display: none;
    }
    .iconbtn {
        width: 36px;
        height: 36px;
    }
    .back-to-top {
        position: fixed;
        bottom: 18px;
        right: 16px;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        border: 1px solid var(--hair);
        background: var(--sheet);
        color: var(--secondary);
        display: grid;
        place-items: center;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
        transition: opacity 0.2s ease;
        z-index: 50;
    }
    .back-to-top.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .copy-toast {
        bottom: 20px;
    }
}
@media (prefers-contrast: more) {
    .search,
    .prod {
        border-color: var(--secondary);
    }
    .date,
    .size,
    .meta {
        color: var(--secondary);
    }
}
@media (prefers-reduced-motion: reduce) {
    .search,
    .iconbtn,
    .back-to-top {
        transition: none;
    }
    .iconbtn:active {
        transform: none;
    }
    .copy-toast {
        transition: opacity 0.15s ease;
    }
    .copy-toast,
    .copy-toast.visible {
        transform: translate(-50%, 0);
    }
}
.ic {
    width: 14px;
    height: 14px;
}
