/**
 * 个人简介页样式（仅 pageTemplates/page-profile.php 使用）
 * 作用域：.pf-page / body.b2child-profile-page
 * 修改时间：2026-10-27
 */

body.b2child-profile-page {
    background: #f7f9fa;
}

body.b2child-profile-page .site-header.mg-b {
    margin-bottom: 0;
}

body.b2child-profile-page #content.site-content {
    padding-bottom: 0;
    background: transparent;
}

@media (max-width: 767px) {
    body.b2child-profile-page #content.site-content {
        margin: 0;
        padding-bottom: 0;
    }

    /* 本站移动端有 55px 固定底栏，给页脚留出安全距离 */
    body.b2child-profile-page #colophon.footer {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

.pf-page {
    --pf-accent: var(--b2color, #dd3333);
    --pf-accent-deep: #b82424;
    --pf-soft: rgba(221, 51, 51, 0.07);
    --pf-heading: #151a26;
    --pf-text: #1f2533;
    --pf-muted: #5b6478;
    --pf-line: #e7ebf1;
    --pf-card: #ffffff;
    --pf-radius: 16px;
    --pf-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 18px 45px -30px rgba(16, 24, 40, 0.4);

    position: relative;
    box-sizing: border-box;
    padding: 24px 0 56px;
    color: var(--pf-text);
    background-color: #f7f9fa;
    background-image: linear-gradient(180deg, #f7f9fa 0%, #f3f5f8 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

@supports (color: color-mix(in srgb, red, blue)) {
    .pf-page {
        --pf-accent-deep: color-mix(in srgb, var(--pf-accent) 86%, #000);
        --pf-soft: color-mix(in srgb, var(--pf-accent) 7%, #fff);
        background-image:
            radial-gradient(820px 420px at 6% 0%, color-mix(in srgb, var(--pf-accent) 7%, transparent), transparent 70%),
            radial-gradient(680px 360px at 100% 4%, rgba(26, 31, 44, 0.035), transparent 72%),
            linear-gradient(180deg, #f7f9fa 0%, #f3f5f8 100%);
    }
}

.pf-page *,
.pf-page *::before,
.pf-page *::after {
    box-sizing: border-box;
}

.pf-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.pf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.pf-card {
    min-width: 0;
    padding: 20px;
    background: var(--pf-card);
    border: 1px solid rgba(23, 32, 51, 0.05);
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
}

.pf-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--pf-heading);
}

/* ---------- 个人名片 ---------- */

.pf-profile {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pf-profile-media {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 238px;
    padding: 14px 12px 0;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--pf-soft) 0%, #f2f5f8 100%);
}

.pf-profile-media::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 42%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    transform: translate(-50%, -50%);
}

.pf-profile-media::after {
    content: "";
    position: absolute;
    left: 16px;
    bottom: -44px;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    background: var(--pf-soft);
}

.pf-avatar {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 238px;
    object-fit: contain;
    filter: drop-shadow(0 14px 22px rgba(23, 32, 51, 0.14));
}

.pf-kicker {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.12em;
    color: var(--pf-accent-deep);
}

.pf-name {
    margin: 0;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--pf-heading);
}

.pf-role {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--pf-muted);
}

.pf-lead {
    margin: 13px 0 0;
    font-size: 14px;
    line-height: 1.85;
    color: #394154;
}

.pf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: 0 17px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pf-btn .pf-icon {
    width: 18px;
    height: 18px;
    flex: none;
}

.pf-btn--primary {
    color: #fff;
    background: var(--pf-accent);
    border: 1px solid transparent;
    box-shadow: 0 8px 20px -12px var(--pf-accent);
}

.pf-btn--primary:hover {
    color: #fff;
    background: var(--pf-accent-deep);
}

.pf-btn--ghost {
    color: var(--pf-text);
    background: #fff;
    border: 1px solid var(--pf-line);
}

.pf-btn--ghost:hover {
    color: var(--pf-accent-deep);
    background: var(--pf-soft);
    border-color: var(--pf-accent);
}

.pf-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--pf-muted);
}

.pf-status-dot {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--pf-accent);
    box-shadow: 0 0 0 4px var(--pf-soft);
}

.pf-status--soft {
    padding: 6px 9px;
    border-radius: 8px;
    background: #f5f7fa;
}

/* ---------- 详细自述 ---------- */

.pf-story-lead {
    margin: 9px 0 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.8;
    color: var(--pf-heading);
}

.pf-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 17px;
    padding: 14px 10px;
    border-radius: 12px;
    background: #f6f8fa;
}

.pf-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pf-stat strong {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--pf-heading);
    font-variant-numeric: tabular-nums;
}

.pf-stat-suffix {
    margin-left: 1px;
    color: var(--pf-accent);
    font-size: 18px;
}

.pf-stat > span:last-child {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--pf-muted);
}

.pf-story-text {
    max-width: 72ch;
    margin-top: 17px;
    color: #3b4354;
}

.pf-story-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.9;
}

.pf-story-text p + p {
    margin-top: 10px;
}

.pf-principles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.pf-principles li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 8px 9px;
    border-radius: 9px;
    background: #f6f8fa;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--pf-muted);
}

.pf-principles li::before {
    content: "";
    width: 5px;
    height: 5px;
    flex: none;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--pf-accent);
}

.pf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 17px 0 0;
    padding: 0;
    list-style: none;
}

.pf-tags li {
    padding: 5px 10px;
    border: 1px solid var(--pf-line);
    border-radius: 999px;
    background: #fff;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--pf-muted);
}

/* ---------- 工作经历 ---------- */

.pf-timeline {
    display: grid;
    gap: 18px;
    margin: 16px 0 0;
    padding: 0 0 0 2px;
    list-style: none;
}

.pf-timeline li {
    position: relative;
    padding-left: 17px;
    border-left: 1px solid var(--pf-line);
}

.pf-timeline li::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pf-accent);
    box-shadow: 0 0 0 4px var(--pf-soft);
}

.pf-time {
    margin: 0;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--pf-muted);
}

.pf-timeline h3 {
    margin: 3px 0 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--pf-heading);
}

.pf-org {
    margin: 1px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--pf-muted);
}

.pf-desc {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--pf-muted);
}

/* ---------- 擅长领域 ---------- */

.pf-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.pf-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 11px;
    border-radius: 10px;
    background: #f6f8fa;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: #333b4c;
}

.pf-tile .pf-icon {
    width: 19px;
    height: 19px;
    flex: none;
    color: var(--pf-accent);
}

/* ---------- 精选项目 ---------- */

.pf-project-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
}

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

.pf-project-media {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 11px;
    background: #eef1f5;
}

.pf-project-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pf-project:hover .pf-project-media img {
    transform: scale(1.03);
}

.pf-project-body {
    padding-top: 11px;
}

.pf-chip {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--pf-soft);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--pf-accent-deep);
}

.pf-project h3 {
    margin: 7px 0 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--pf-heading);
}

.pf-project h3 a {
    color: inherit;
    text-decoration: none;
}

.pf-project h3 a:hover {
    color: var(--pf-accent-deep);
}

.pf-project p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--pf-muted);
}

/* ---------- 合作方向 ---------- */

.pf-service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 16px;
}

.pf-service {
    min-width: 0;
    padding: 13px;
    border-radius: 11px;
    background: #f6f8fa;
}

.pf-service-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #fff;
    color: var(--pf-accent);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.pf-service-icon .pf-icon {
    width: 20px;
    height: 20px;
}

.pf-service h3 {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pf-heading);
}

.pf-service p {
    margin: 4px 0 0;
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--pf-muted);
}

/* ---------- 联系方式 ---------- */

.pf-contact-lead {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--pf-muted);
}

.pf-contact-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.pf-contact-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    border-top: 1px solid var(--pf-line);
}

.pf-contact-list li:last-child {
    border-bottom: 1px solid var(--pf-line);
}

.pf-contact-label {
    flex: 0 0 50px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--pf-muted);
}

.pf-contact-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pf-text);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.pf-contact-value:hover {
    color: var(--pf-accent-deep);
}

.pf-contact-link {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 3px;
    min-width: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pf-text);
    text-decoration: none;
}

.pf-contact-link:hover {
    color: var(--pf-accent-deep);
}

.pf-contact-link .pf-icon {
    width: 15px;
    height: 15px;
    flex: none;
}

.pf-copy {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 0 9px;
    border: 1px solid var(--pf-line);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 11px;
    line-height: 1;
    color: var(--pf-muted);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pf-copy .pf-icon {
    width: 13px;
    height: 13px;
}

.pf-copy:hover {
    color: var(--pf-accent-deep);
    background: var(--pf-soft);
    border-color: var(--pf-accent);
}

/* ---------- 最新文章 ---------- */

.pf-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pf-more {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--pf-accent-deep);
    text-decoration: none;
    white-space: nowrap;
}

.pf-more .pf-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.2s;
}

.pf-more:hover .pf-icon {
    transform: translateX(2px);
}

/* ---------- 最新文章（复用 B2 文章内页「猜你喜欢」模块） ---------- */

.pf-posts .related-posts {
    margin-top: 10px;
}

.pf-posts .hidden-line {
    overflow: hidden;
}

.pf-posts .related-posts-item {
    padding: 12px 14px;
}

.pf-posts .related-posts-item:first-child {
    padding-left: 0;
}

.pf-posts .related-posts-item:last-child {
    border-right: 0;
}

.pf-posts .related-post-thumb {
    overflow: hidden;
    border-radius: 8px;
}

.pf-posts .related-post-thumb .link-block {
    position: absolute;
    inset: 0;
}

.pf-posts .related-posts-in h2 {
    font-size: 14px;
}

@media (max-width: 767px) {
    .pf-posts .related-posts-item {
        padding: 10px;
    }

    .pf-posts .related-posts-item:nth-child(odd) {
        padding-left: 0;
    }
}

/* ---------- 交互与提示 ---------- */

.pf-page a:focus-visible,
.pf-page button:focus-visible {
    outline: 2px solid var(--pf-accent);
    outline-offset: 2px;
}

.pf-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 10000;
    max-width: calc(100vw - 32px);
    padding: 10px 16px;
    border-radius: 10px;
    background: #1f2430;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.22);
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.pf-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ---------- 响应式 ---------- */

@media (max-width: 767px) {
    .pf-page {
        padding: 14px 0 28px;
    }

    .pf-card {
        padding: 18px;
        border-radius: 14px;
    }

    .pf-title {
        font-size: 18px;
    }

    .pf-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pf-btn {
        width: 100%;
    }

    .pf-story-lead {
        font-size: 14.5px;
    }

    .pf-contact-list li {
        min-height: 48px;
    }

    .pf-copy {
        min-height: 38px;
    }

    .pf-toast {
        bottom: calc(68px + env(safe-area-inset-bottom));
    }
}

@media (min-width: 600px) {
    .pf-grid {
        gap: 16px;
    }

    .pf-profile {
        flex-direction: row;
        align-items: stretch;
        gap: 24px;
    }

    .pf-profile-media {
        flex: 0 0 38%;
        min-height: 300px;
        padding: 16px 14px 0;
    }

    .pf-avatar {
        max-height: 268px;
    }

    .pf-profile-body {
        display: flex;
        flex: 1;
        flex-direction: column;
        justify-content: center;
    }

    .pf-actions {
        flex-direction: row;
        align-items: center;
    }

    .pf-btn {
        width: auto;
    }

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

@media (min-width: 768px) {
    .pf-wrap {
        max-width: calc(100% - 80px);
        padding: 0;
    }

    .pf-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "profile profile"
            "story story"
            "exp skill"
            "projects projects"
            "services contact"
            "posts posts";
        gap: 18px;
    }

    .pf-card {
        padding: 22px;
    }

    .pf-profile {
        grid-area: profile;
    }

    .pf-story {
        grid-area: story;
    }

    .pf-exp {
        grid-area: exp;
    }

    .pf-skill {
        grid-area: skill;
    }

    .pf-projects {
        grid-area: projects;
    }

    .pf-services {
        grid-area: services;
    }

    .pf-contact {
        grid-area: contact;
    }

    .pf-posts {
        grid-area: posts;
    }

    .pf-story-lead {
        font-size: 16px;
    }

    .pf-stat strong {
        font-size: 26px;
    }

    .pf-stat > span:last-child {
        font-size: 12px;
    }

    .pf-title {
        font-size: 20px;
    }

    .pf-service-grid {
        gap: 10px;
    }

    .pf-service {
        padding: 14px;
    }

    .pf-service h3 {
        font-size: 13.5px;
    }

    .pf-service p {
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    .pf-wrap {
        max-width: min(1200px, calc(100% - 120px));
    }
}

@media (min-width: 1280px) {
    .pf-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas:
            "profile story story"
            "exp skill contact"
            "projects projects services"
            "posts posts posts";
        gap: 22px;
    }

    .pf-card {
        padding: 24px;
    }

    .pf-profile {
        flex-direction: column;
        gap: 22px;
    }

    .pf-profile-media {
        flex: none;
        height: 260px;
        min-height: 260px;
        padding: 14px 16px 0;
    }

    .pf-avatar {
        max-height: 246px;
    }

    .pf-profile-body {
        display: block;
    }

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

    .pf-story {
        display: flex;
        flex-direction: column;
    }

    .pf-story .pf-tags {
        margin-top: auto;
        padding-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pf-page *,
    .pf-page *::before,
    .pf-page *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
