/* ============================================================
   MCRES 选料 - 帧率投稿列表页
   ============================================================ */

.fps-list-page {
    max-width: 1300px;
    margin: 0 auto;
}

/* ============================================================
   页头
   ============================================================ */
.page-header {
    padding: 16px 0 28px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-left h1 i {
    color: var(--accent);
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.header-right {
    display: flex;
    gap: 10px;
}

/* ============================================================
   筛选栏
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-type {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.filter-tab {
    padding: 7px 16px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.filter-tab:hover {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--text-primary);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.filter-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.filter-label {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.filter-label i {
    font-size: 12px;
}

.filter-select {
    padding: 7px 30px 7px 12px;
    background: rgba(11, 15, 20, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='3'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: rgba(168, 85, 247, 0.4);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.filter-select option {
    background: #11161c;
    color: var(--text-primary);
}

.filter-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.search-input-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    padding: 9px 36px 9px 38px;
    background: rgba(11, 15, 20, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.filter-search-input::placeholder {
    color: var(--text-muted);
}

.filter-search-input:hover {
    border-color: var(--border-strong);
}

.filter-search-input:focus {
    border-color: var(--accent);
    background: rgba(11, 15, 20, 0.85);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: var(--transition);
    text-decoration: none;
}

.search-clear:hover {
    background: var(--danger);
    color: #fff;
}

/* ============================================================
   列表统计
   ============================================================ */
.list-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.list-count {
    font-size: 13px;
    color: var(--text-muted);
}

.list-count strong {
    color: var(--accent-bright);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 0 2px;
}

.list-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.8;
}

.list-tip i {
    color: var(--accent);
    opacity: 0.7;
    font-size: 11px;
}

/* ============================================================
   行列表
   ============================================================ */
.fps-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
}

.fps-row {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.fps-row:hover {
    border-color: rgba(168, 85, 247, 0.35);
}

.fps-row.expanded {
    border-color: rgba(168, 85, 247, 0.5);
}

/* -------- 主行 -------- */
.fps-row-head {
    display: grid;
    grid-template-columns:
        auto                 /* 类型 */
        minmax(0, 1.3fr)     /* 资源名 */
        minmax(0, 1fr)       /* GPU */
        auto                 /* fps */
        minmax(0, 140px)     /* 作者 */
        auto;                /* toggle */
    gap: 18px;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    position: relative;
}

.fps-row-head:hover {
    background: rgba(168, 85, 247, 0.04);
}

.fps-row-head:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.row-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-bright);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
}

.row-resource {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    transition: color 0.15s ease;
}

.fps-row-head:hover .row-resource {
    color: var(--accent-bright);
}

.row-gpu {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.row-gpu i {
    color: var(--accent);
    opacity: 0.7;
    font-size: 11px;
    margin-right: 4px;
}

.row-fps {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 17px;
    font-weight: 700;
    color: #55d88b;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 62px;
    justify-content: flex-end;
}

.row-fps span {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 400;
}

.row-author {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    justify-content: flex-end;
}

.row-author .author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.row-author .author-avatar-text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.row-author .author-name {
    font-size: 12.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.03);
}

.fps-row-head:hover .row-toggle {
    color: var(--accent-bright);
    background: rgba(168, 85, 247, 0.12);
}

.fps-row.expanded .row-toggle {
    transform: rotate(180deg);
    color: var(--accent-bright);
    background: rgba(168, 85, 247, 0.15);
}

/* -------- 展开内容 -------- */
.fps-row-body {
    padding: 4px 20px 18px;
    border-top: 1px solid var(--border-light);
    animation: expandIn 0.25s ease;
}

@keyframes expandIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.expand-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 28px;
    padding-top: 16px;
}

.expand-col {
    min-width: 0;
}

.expand-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--border-light);
}

.expand-title i {
    color: var(--accent);
    font-size: 12px;
}

/* -------- 左列：配置 -------- */
.config-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 13px;
}

.cfg-key {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 12.5px;
}

.cfg-val {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* -------- 右列：计算过程 -------- */
.calc-step {
    margin-bottom: 14px;
}

.step-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.calc-rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 7px;
    border: 1px solid var(--border-light);
}

.calc-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.calc-line.calc-sum {
    padding: 8px 12px;
    background: rgba(168, 85, 247, 0.06);
    border-radius: 7px;
    border: 1px solid rgba(168, 85, 247, 0.15);
    font-weight: 600;
    color: var(--text-primary);
}

.calc-line.calc-sum.highlight {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
}

.calc-line.calc-sum.highlight .calc-val {
    color: var(--accent-bright);
    font-size: 15px;
}

.calc-line.calc-total {
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
    margin-top: 3px;
    color: var(--text-primary);
    font-weight: 600;
}

.calc-val {
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.calc-val.muted {
    color: var(--text-muted);
    font-weight: 400;
}

.calc-formula {
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: 7px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    word-break: break-all;
}

.calc-result {
    display: block;
    margin-top: 6px;
    color: var(--accent-bright);
    font-size: 15px;
    font-weight: 700;
}

.calc-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* -------- 空状态 -------- */
.expand-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

.expand-empty i {
    color: var(--warning);
    font-size: 16px;
}

/* -------- 展开底部 -------- */
.expand-foot {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.link-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-bright);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.link-detail:hover {
    color: var(--accent);
    gap: 9px;
}

.link-detail i {
    font-size: 11px;
}

/* ============================================================
   分页
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0 20px;
    flex-wrap: wrap;
}

.page-btn,
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    font-variant-numeric: tabular-nums;
}

.page-btn:hover,
.page-num:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent-bright);
}

.page-num.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--text-muted);
    font-size: 14px;
    user-select: none;
}

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    color: var(--accent);
    opacity: 0.25;
    margin-bottom: 20px;
    display: block;
}

.empty-state h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
    .fps-row-head {
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto
            auto;
        grid-template-rows: auto auto;
        gap: 6px 14px;
        padding: 12px 16px;
    }

    .row-type {
        grid-row: 1;
        grid-column: 1;
        align-self: center;
    }

    .row-resource {
        grid-row: 1;
        grid-column: 2 / -2;
        font-size: 14px;
    }

    .row-gpu {
        grid-row: 2;
        grid-column: 1 / -1;
        font-size: 12.5px;
        padding-left: 2px;
    }

    .row-fps {
        grid-row: 1;
        grid-column: 3;
        font-size: 16px;
    }

    .row-author {
        display: none;
    }

    .row-toggle {
        grid-row: 1;
        grid-column: 4;
    }

    .expand-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        justify-content: flex-end;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-type {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .filter-type::-webkit-scrollbar {
        display: none;
    }

    .filter-sort,
    .filter-search {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .page-header h1 {
        font-size: 22px;
    }

    .filter-bar {
        padding: 14px 16px;
    }

    .fps-row-head {
        padding: 12px 14px;
        gap: 6px 10px;
    }

    .row-type {
        padding: 3px 9px;
        font-size: 11px;
        min-width: 50px;
    }

    .row-resource {
        font-size: 13.5px;
    }

    .row-gpu {
        font-size: 12px;
    }

    .row-fps {
        font-size: 15px;
        min-width: 52px;
    }

    .fps-row-body {
        padding: 4px 14px 16px;
    }

    .expand-title {
        font-size: 13px;
    }

    .config-list li {
        font-size: 12.5px;
        padding: 5px 8px;
    }

    .calc-line {
        font-size: 12px;
    }

    .calc-formula {
        font-size: 11.5px;
        padding: 10px 12px;
    }

    .pagination {
        gap: 4px;
    }

    .page-btn,
    .page-num {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 13px;
    }
}