@charset "utf-8";
/* ============================================================
   个人主页（/user/view?id=N）
   ------------------------------------------------------------
   风格：清爽学术风 —— 变量全部取自 theme.css，
        白底 + 1px 细线 + 单一品牌青，无渐变、无投影，hover 只改颜色
   作用域：全部规则限定在 .pf-page 内，避免撞上 site.css 的老模板选择器
          （踩过的坑：.solution-index table / .rating-index tr td:nth-child(n)
            这类按 body 类名写死的老规则，会命中新结构）
   结构：身份卡 → 段位进度 → 六项数字 → 提交构成 → 最近提交 / 难度分布
        → 已解答 / 未解答题号 → 比赛评分曲线
   ============================================================ */

.pf-page {
    padding: 22px 0 10px;
    color: var(--ink);
}

/* ---------------------------------------------------------------- 身份卡 */
.pf-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.pf-hero-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

/* 头像：存的是 @web/uploads/profile_photo/xxx.jpg，控制器已解析成 URL */
.pf-avatar {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    overflow: hidden;
}

.pf-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 没有头像图时用昵称首字占位 */
.pf-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-soft);
    user-select: none;
}

.pf-id {
    min-width: 0;
}

.pf-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.pf-name {
    margin: 0;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.2px;
    word-break: break-word;
}

/* 段位徽章：文字与边框同色（currentColor），底色留白，
   颜色由视图里的 $gradeColors[$idx] 内联给出 */
.pf-grade {
    flex: 0 0 auto;
    display: inline-block;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.3px;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid currentColor;
    border-radius: 3px;
    white-space: nowrap;
}

.pf-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-3);
}

.pf-meta .sep {
    color: #C9D0CD;
    user-select: none;
}

.pf-meta .mono {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

/* 右侧分数块 */
.pf-score {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.1;
}

.pf-score-num {
    display: block;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.pf-score-lab {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    letter-spacing: 0.2px;
    color: var(--muted);
}

.pf-score-lab b {
    font-weight: 600;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------- 段位进度条 */
.pf-progress {
    padding: 15px 0 17px;
    border-bottom: 1px solid var(--line);
}

.pf-progress-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.pf-progress-top b {
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.pf-progress-top .right {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.pf-bar {
    position: relative;
    height: 4px;
    background: var(--line-soft);
    border-radius: 2px;
    overflow: hidden;
}

.pf-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 2px;
    background: var(--muted);
}

.pf-progress.max .pf-bar-fill {
    background: var(--brand);
}

/* -------------------------------------------------------- 六项数字 */
.pf-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-bottom: 1px solid var(--line);
}

.pf-stat {
    padding: 16px 14px 17px;
    border-right: 1px solid var(--line-soft);
}

.pf-stat:last-child {
    border-right: 0;
}

.pf-stat-num {
    display: block;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.pf-stat-num small {
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--muted);
    margin-left: 2px;
}

.pf-stat-lab {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    letter-spacing: 0.2px;
    color: var(--muted);
}

/* 通过 / 未通过两种语义色，仅用于数字本身 */
.pf-stat.is-ok .pf-stat-num {
    color: var(--ok);
}

.pf-stat.is-bad .pf-stat-num {
    color: var(--ink-2);
}

/* -------------------------------------------------------- 区块通用 */
.pf-sec {
    margin-top: 30px;
}

.pf-sec-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 9px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.pf-sec-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--ink);
}

.pf-sec-note {
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------- 提交构成堆叠条 */
.pf-mix {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--line-soft);
}

.pf-mix span {
    display: block;
    height: 100%;
}

.pf-mix .m-ac  { background: #2E6B3E; }
.pf-mix .m-wa  { background: #B5651D; }
.pf-mix .m-tle { background: #6B4FA8; }
.pf-mix .m-ce  { background: #8A9490; }
.pf-mix .m-other { background: #C9D0CD; }

.pf-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 11px;
    font-size: 11.5px;
    color: var(--ink-3);
}

.pf-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 1px;
    vertical-align: 1px;
}

.pf-legend b {
    font-weight: 600;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------- 双栏容器 */
.pf-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 30px;
    margin-top: 30px;
}

/* -------------------------------------------------- 最近提交表 */
.pf-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.pf-table th {
    padding: 0 10px 8px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-align: left;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.pf-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-table tr:last-child td {
    border-bottom: 0;
}

.pf-table tbody tr:hover td {
    background: #FAFBFA;
}

.pf-table .c-id {
    width: 58px;
    padding-left: 0;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.pf-table .c-res {
    /* 120px 是「Time Limit Exceeded」在 11.5px/600 下的实测宽度，
       再窄这行就会被裁成 Time Lim… */
    width: 120px;
    /* td 上有 overflow:hidden 做标题省略，结果列要放得下整句
       「Time Limit Exceeded」，不能再裁一次 */
    overflow: visible;
}

.pf-table .c-time {
    width: 82px;
    text-align: right;
    padding-right: 0;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.pf-table a {
    color: var(--ink);
    text-decoration: none;
}

.pf-table a:hover {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 结果标签：沿用 Solution::getResultList() 返回的文本，只改外壳 */
.pf-res {
    display: inline-block;
    padding: 1px 6px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 3px;
    white-space: nowrap;
}

.pf-res.ok {
    color: var(--ok);
    background: #EDF4EE;
}

.pf-res.bad {
    color: #8A4A12;
    background: #FAF0E6;
}

.pf-res.mid {
    color: var(--ink-3);
    background: var(--line-soft);
}

/* -------------------------------------------------- 难度分布 */
.pf-diff {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pf-diff-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--ink-3);
}

.pf-diff-bar {
    height: 4px;
    background: var(--line-soft);
    border-radius: 2px;
    overflow: hidden;
}

.pf-diff-bar span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: var(--brand);
    opacity: 0.75;
}

.pf-diff-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
}

.pf-empty {
    padding: 14px 0;
    font-size: 12.5px;
    color: var(--muted);
}

/* 一次都没提交过的新账号：三段空列表（最近提交 / 难度分布 / 已解答）
   堆在一起全是「还没有…」，不如换成一句引导 */
.pf-start {
    margin-top: 30px;
    padding: 38px 24px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.pf-start-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.pf-start-sub {
    margin: 0 0 18px;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--ink-3);
}

.pf-start-btn {
    display: inline-block;
    padding: 6px 18px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #fff;
    background: var(--brand);
    border-radius: 3px;
    text-decoration: none;
    transition: background .12s;
}

.pf-start-btn:hover,
.pf-start-btn:focus {
    color: #fff;
    background: var(--brand-dark);
    text-decoration: none;
}

/* -------------------------------------------------- 题号 chips */
.pf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 168px;
    overflow-y: auto;
    padding-right: 4px;
}

/* 已解答是荣誉墙，给多一点高度 */
.pf-chips.tall {
    max-height: 260px;
}

.pf-chip {
    display: inline-block;
    min-width: 36px;
    padding: 3px 7px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 3px;
    text-decoration: none;
    transition: color .12s, border-color .12s;
}

.pf-chip:hover {
    color: var(--brand);
    border-color: rgba(15, 92, 107, 0.42);
    text-decoration: none;
}

/* 滚动条收窄，别在浅底上太抢眼 */
.pf-chips::-webkit-scrollbar {
    width: 8px;
}

.pf-chips::-webkit-scrollbar-thumb {
    background: #D6DCD9;
    border-radius: 4px;
}

.pf-chips::-webkit-scrollbar-track {
    background: transparent;
}

/* -------------------------------------------------- 比赛评分图 */
.pf-chart {
    width: 100%;
    height: 220px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
}

#pf-tooltip {
    position: absolute;
    display: none;
    padding: 6px 9px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(22, 32, 42, 0.08);
    pointer-events: none;
    z-index: 20;
}

/* 线下赛账户 */
.pf-plain {
    padding: 18px 0;
    font-size: 13px;
    color: var(--ink-3);
}

/* ------------------------------------------------------------ 断点 */
@media (max-width: 1199px) {
    .pf-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .pf-stat:nth-child(3n) {
        border-right: 0;
    }

    .pf-stat:nth-child(-n + 3) {
        border-bottom: 1px solid var(--line-soft);
    }
}

@media (max-width: 991px) {
    .pf-cols {
        grid-template-columns: minmax(0, 1fr);
        gap: 26px;
    }
}

@media (max-width: 767px) {
    .pf-page {
        padding-top: 16px;
    }

    .pf-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .pf-hero-main {
        gap: 12px;
    }

    .pf-avatar {
        width: 52px;
        height: 52px;
    }

    .pf-avatar-initial {
        font-size: 20px;
    }

    .pf-name {
        font-size: 19px;
    }

    .pf-score {
        text-align: left;
    }

    .pf-score-num {
        font-size: 32px;
    }

    .pf-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .pf-stat {
        padding: 13px 12px 14px;
    }

    .pf-stat:nth-child(3n) {
        border-right: 1px solid var(--line-soft);
    }

    .pf-stat:nth-child(2n) {
        border-right: 0;
    }

    .pf-stat:nth-child(-n + 4) {
        border-bottom: 1px solid var(--line-soft);
    }

    .pf-table .c-time {
        display: none;
    }

    /* 窄屏没有「时间」列，把左侧两列再压一点，给结果留够宽度 */
    .pf-table .c-id {
        width: 46px;
    }

    .pf-table .c-res {
        width: 110px;
    }

    .pf-res {
        padding: 1px 5px;
        font-size: 11px;
    }

    .pf-chips {
        max-height: 132px;
    }
}
