/* =========================================================
   Resume
   ========================================================= */

/* ---- 页面容器与导出按钮 ---- */
.main { max-width: min(96vw, 960px); padding-top: 0px; }
.resume-actions { text-align: center; margin: 24px 0 0; }
.resume-actions button {
    font: inherit;
    font-size: 0.92em;
    padding: 6px 18px;
    border: 1px solid var(--resume-btn-border);
    border-radius: 6px;
    background: var(--resume-bg);
    color: var(--resume-text);
    cursor: pointer;
}
.resume-actions button:hover { background: var(--resume-btn-hover); }

.resume-page {
    --resume-bg: #ffffff;
    --resume-text: #18181b;
    --resume-muted: #52525b;
    --resume-rule: #27272a;
    --resume-photo-border: #d4d4d8;
    --resume-btn-border: #b8c4d0;
    --resume-btn-hover: #eef3f8;
    --resume-icon-filter: none;
    --resume-logo-filter: none;

    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 5px 24px 40px;

    box-sizing: border-box;

    color: var(--resume-text);
    background: var(--resume-bg);

    font-family:
        "Microsoft YaHei",
        "PingFang SC",
        "Noto Sans CJK SC",
        "Source Han Sans SC",
        Arial,
        sans-serif;

    font-size: 13.2px;
    line-height: 1.62;
}


/* =========================================================
   Reset
   ========================================================= */

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

.resume-page div,
.resume-page span,
.resume-page li,
.resume-page strong,
.resume-page em {
    color: inherit;
}

.resume-page a {
    color: inherit;
}


/* =========================================================
   Header
   ========================================================= */

.resume-header {
    position: relative;

    width: 100%;
    min-height: 88px;

    margin: 0 0 4px;
    padding: 4px 120px 0;
}


/* =========================================================
   左上角单位 Logo
   ========================================================= */

.resume-brands {
    position: absolute;

    top: 10px;
    left: 0;

    display: flex;
    align-items: flex-start;
    justify-content: flex-start;

    margin: 0;
    padding: 0;

    z-index: 2;
}

.brand-logo {
    display: block;
    object-fit: contain;

    filter: var(--resume-logo-filter);
}

/* 鹏城实验室 Logo */
.pcl-logo {
    width: 145px;
    height: auto;
    max-height: 55px;

    object-position: left top;
}


/* =========================================================
   中间姓名 + 联系方式
   ========================================================= */

.resume-identity {
    position: absolute;

    left: 50%;
    top: 15px;

    transform: translateX(-50%);

    width: max-content;
    max-width: calc(100% - 260px);

    text-align: center;

    z-index: 1;
}

.resume-name {
    margin: 0;

    font-size: 30px;
    line-height: 1.25;
    font-weight: 700;

    letter-spacing: 3px;

    text-align: center;
    white-space: nowrap;
}

.resume-contact {
    margin-top: 10px;

    font-size: 13px;
    line-height: 1.7;

    text-align: center;
}

.contact-row {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: nowrap;

    gap: 8px;

    width: 100%;
}

.contact-row.emails {
    justify-content: center;
}

.contact-item {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 5px;

    white-space: nowrap;
}

.contact-icon {
    display: block;

    width: 15px;
    height: 15px;

    object-fit: contain;

    filter: var(--resume-icon-filter);
}

.contact-separator {
    display: inline-block;

    margin: 0 3px;

    color: var(--resume-muted);
}


/* =========================================================
   右上角证件照
   ========================================================= */

.resume-portrait-wrap {
    position: absolute;

    top: 10px;
    right: 0;

    width: 86px;
    height: 116px;

    margin: 0;

    z-index: 2;
}

.resume-portrait {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border: 1px solid var(--resume-photo-border);
    border-radius: 2px;
}


/* =========================================================
   Section
   ========================================================= */

.resume-section {
    margin: 0;
    padding: 0;
}

.section-title {
    display: flex;

    align-items: center;

    gap: 7px;

    margin: 16px 0 8px;
    padding: 0 0 4px;

    border-bottom: 1.5px solid var(--resume-rule);

    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}

.section-title.first-section {
    margin-top: 0;
}

.section-icon {
    display: block;

    width: 20px;
    height: 20px;

    object-fit: contain;

    flex: 0 0 auto;

    filter: var(--resume-icon-filter);
}

.section-title-text {
    display: inline-block;
}


/* =========================================================
   Entry
   ========================================================= */

.resume-entry {
    margin: 7px 0 11px;
}

.entry-head {
    display: flex;

    align-items: baseline;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 2px;
}

.entry-title {
    min-width: 0;

    font-size: 14px;
    font-weight: 700;
}

.entry-detail {
    font-weight: 400;
}

.entry-date {
    flex: 0 0 auto;

    font-size: 13px;

    white-space: nowrap;
}


/* =========================================================
   Lists
   ========================================================= */

.resume-list {
    margin: 4px 0 7px 21px;
    padding: 0;
}

.resume-list li {
    margin: 2px 0;
    padding-left: 2px;
}

.publication-list li,
.patent-list li {
    margin-bottom: 6px;
}


/* =========================================================
   Subheading
   ========================================================= */

.subheading {
    margin: 8px 0 4px;

    font-size: 14px;
    font-weight: 700;
}

.patent-heading {
    margin-top: 10px;
}


/* =========================================================
   Summary
   ========================================================= */

.resume-summary {
    margin: 4px 0 0;

    text-align: justify;
}


/* =========================================================
   Dark mode
   ========================================================= */

@media (prefers-color-scheme: dark) {

    .resume-page {
        --resume-bg: #17181a;
        --resume-text: #eceff3;
        --resume-muted: #c9cdd3;
        --resume-rule: #767b83;
        --resume-photo-border: #555b63;
        --resume-btn-border: #555b63;
        --resume-btn-hover: #26282c;

        --resume-logo-filter:
            brightness(1.15)
            saturate(0.95);

        --resume-icon-filter:
            invert(1)
            brightness(1.08);
    }
}


/*
 * 手动切换到 light(PaperMod 把 data-theme 挂在 <html> 上,
 * 所以选择器直接用 [data-theme=...],与主题自身 CSS 一致)。
 */

[data-theme="light"] .resume-page {

    --resume-bg: #ffffff;
    --resume-text: #18181b;
    --resume-muted: #52525b;
    --resume-rule: #27272a;
    --resume-photo-border: #d4d4d8;
    --resume-btn-hover: #eef3f8;

    --resume-icon-filter: none;
    --resume-logo-filter: none;
}


/*
 * 手动切换到 dark。
 */

[data-theme="dark"] .resume-page {

    --resume-bg: #17181a;
    --resume-text: #eceff3;
    --resume-muted: #c9cdd3;
    --resume-rule: #767b83;
    --resume-photo-border: #555b63;
    --resume-btn-border: #555b63;
    --resume-btn-hover: #26282c;

    --resume-logo-filter:
        brightness(1.15)
        saturate(0.95);

    --resume-icon-filter:
        invert(1)
        brightness(1.08);
}


/* =========================================================
   移动端
   ========================================================= */

@media (max-width: 700px) {

    .resume-page {
        padding-left: 14px;
        padding-right: 14px;
    }

    .resume-header {
        min-height: 160px;

        padding-left: 0;
        padding-right: 0;
    }

    .pcl-logo {
        width: 110px;
        max-height: 45px;
    }

    .resume-portrait-wrap {
        width: 70px;
        height: 94px;
    }

    .resume-identity {
        top: 105px;

        width: 100%;
        max-width: 100%;
    }

    .resume-name {
        font-size: 26px;
    }

    .contact-row {
        flex-wrap: wrap;

        gap: 5px 8px;
    }

    .entry-head {
        display: block;
    }

    .entry-date {
        margin-top: 2px;
    }
}


/* =========================================================
   Print
   ========================================================= */

@media print {

    .resume-page {
        max-width: none;

        padding: 0;

        font-size: 12px;
        line-height: 1.55;

        background: #ffffff;
        color: #111111;
    }

    .resume-header {
        min-height: 90px;
    }

    .section-title {
        margin-top: 10px;
    }

    .resume-entry {
        margin-bottom: 7px;
    }

    /* 隐藏站点导航/页脚/页面标题区/导出按钮/回到顶部悬浮钮,只输出简历正文 */
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .header, .footer, .post-header, .breadcrumbs, .resume-actions, .top-link, #top-link {
        display: none !important;
    }
    .main {
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .post-single { padding: 0 !important; margin: 0 !important; }
    .resume-page {
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 分页控制:头部/条目/列表项不跨页切断;
       小节标题与其后第一条内容绑定,标题不落在页尾 */
    .resume-header, .resume-entry, .resume-list li {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .resume-section > .section-title {
        break-inside: avoid;
        page-break-after: avoid;
    }
    .resume-section > .section-title + * {
        break-before: avoid;
        page-break-before: avoid;
    }
}