:root {
    color-scheme: light;
    --sans-serif-font-family: -apple-system, "Noto Sans", "Helvetica Neue",
        Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC",
        "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC",
        "Source Han Sans CN", "Microsoft YaHei", "Wenquanyi Micro Hei",
        "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp",
        sans-serif;
    --primary-color: #536b82;
    --primary-hover: #3f556a;
    --primary-rgb: 83, 107, 130;
    --text-color: #414850;
    --heading-color: #343b42;
    --secondary-text-color: #59616a;
    --text-light: #7f8892;
    --text-lighter: #a4abb2;
    --border-color: #cbd1d6;
    --border-light: #e7eaed;
    --background-light: #f3f4f5;
    --background-white: #fff;
    --shadow-color: rgba(30, 40, 50, 0.06);
    --menu-shadow-color: rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --primary-color: #91b5d6;
    --primary-hover: #b5cee5;
    --primary-rgb: 145, 181, 214;
    --text-color: #d7dde3;
    --heading-color: #edf1f5;
    --secondary-text-color: #bdc6cf;
    --text-light: #a3adb7;
    --text-lighter: #7f8b96;
    --border-color: #4a5661;
    --border-light: #313b44;
    --background-light: #11161b;
    --background-white: #1b2229;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --menu-shadow-color: rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

body {
    background: var(--background-light);
    color: var(--text-color);
    font-family: var(--sans-serif-font-family);
    font-size: 14px;
    line-height: 1.62;
    font-variant-numeric: tabular-nums;
    margin: 40px 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

em { color: var(--text-light); }
p { line-height: inherit; }
ul { margin-bottom: 0; }

/* Avoid isolated words or a handful of CJK characters on the final line. */
#intro > li,
.highlights > li,
.item-authors,
.item-meta,
.block-content,
.organization-note,
.blockHeader .title {
    text-wrap: balance;
}

.block-content {
    font-size: 13px;
}

[lang="en"] #intro {
    font-size: 13.5px;
}

[lang="ja"] #intro > li:nth-child(3) {
    font-size: 13.2px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}
a:hover { color: var(--primary-hover); }

#resume {
    margin: 0 auto;
    max-width: 900px;
    padding: 64px 72px 72px;
    background: var(--background-white);
    border: 0;
    border-radius: 4px;
    box-shadow: 0 8px 32px var(--shadow-color);
    position: relative;
}

/* 通用标题样式 */
.largeFont {
    font-size: 16px;
    margin: 0 0 12px;
    text-align: center;
}

.largeFont .name {
    margin: 0;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: 0.08em;
}

.smallFont {
    font-size: 12px;
    line-height: 1.6;
    margin: 0 0 24px;
    text-align: center;
    color: var(--text-light);
}

/* 通用section样式 */
.sectionBlock {
    display: flex;
    width: 100%;
    margin-bottom: 24px;
}

.sectionName {
    width: 17%;
    padding: 1px 20px 0 0;
    color: var(--heading-color);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.03em;
    vertical-align: top;
    display: inline-block;
    flex-shrink: 0;
}

.sectionName span {
    text-wrap: balance;
}

.sectionContent {
    width: 83%;
    vertical-align: top;
    display: inline-block;
    flex-grow: 1;
    min-width: 0;
}

.sectionContent ul {
    padding-left: 18px;
    margin-top: 6px;
}

.sectionLine {
    border-bottom: 1px solid var(--border-light);
    margin: 24px 0;
}

/* 通用block样式 */
.block {
    margin-bottom: 18px;
    page-break-inside: avoid;
}

.blockHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blockHeader .title {
    font-weight: bold;
}

.blockHeader .date {
    line-height: 1;
    color: var(--text-light);
}

/* 获奖荣誉：次要奖项默认折叠，仅保留一个低调的省略号入口 */
.awards-more {
    margin-top: 2px;
}

.awards-more-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 24px;
    margin-left: -6px;
    padding: 0 6px 5px;
    border-radius: 5px;
    color: var(--text-lighter);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    list-style: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.awards-more-trigger::-webkit-details-marker {
    display: none;
}

.awards-more-trigger:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.06);
}

.awards-more-trigger:focus-visible {
    outline: 2px solid rgba(var(--primary-rgb), 0.45);
    outline-offset: 2px;
}

.awards-more-content {
    margin-top: 1px;
}

.block-content {
    margin-top: 4px;
}

#sideProjects .block-content {
    margin-top: 0;
}

.highlights {
    color: var(--text-light);
}

/* 工作经历与教育背景：默认仅展示摘要，逐条展开详情 */
.experience-group {
    margin-bottom: 19px;
}

.experience-organization {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 650;
}

.organization-note {
    margin-left: 0.6em;
    color: var(--text-light);
    font-size: 13px;
    font-weight: normal;
    white-space: nowrap;
}

.organization-note a {
    color: inherit;
    text-decoration: none;
}

.organization-note a:hover {
    color: var(--primary-color);
}

.experience-entries {
    min-width: 0;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

.collapsible-block {
    margin-bottom: 2px;
    border-radius: 5px;
}

.collapsible-block:last-child {
    margin-bottom: 0;
}

.collapsible-summary {
    position: relative;
    display: block;
    padding: 3px 6px;
    margin: -3px -6px 0;
    border-radius: 5px;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.06);
}

.collapsible-summary:focus-visible {
    outline: 2px solid rgba(var(--primary-rgb), 0.45);
    outline-offset: 2px;
}

.collapsible-summary .date {
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--text-light);
}

.collapsible-heading {
    display: block;
}

.experience-entries .blockHeader .title {
    font-weight: normal;
}

.summary-meta {
    margin-left: 0.5em;
    color: var(--text-light);
    font-weight: normal;
}

.collapsible-content {
    padding-top: 2px;
}

.collapsible-content .highlights {
    margin-bottom: 0;
}

.annotation {
    color: var(--text-lighter);
    font-weight: normal;
}

/* 通用header样式 */
.header {
    display: flex;
    align-items: center;
}

.header .content {
    flex-grow: 1;
}

/* 通用item样式 */
.item {
    margin-bottom: 16px;
}

.item-title {
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 2px;
    text-wrap: balance;
}

.item-authors {
    font-style: italic;
    margin-bottom: 2px;
    color: var(--secondary-text-color);
}

.item-meta {
    color: var(--text-light);
}

.blockHeader .title .item-meta {
    font-weight: normal;
}

#academicServices .blockHeader .title,
#academicServices .item-meta {
    text-wrap: wrap;
}

#academicServices .item-meta {
    font-size: 0.9em;
}

#academicServices .service-affiliation {
    display: inline-block;
    font-weight: normal;
    text-wrap: balance;
}

#academicServices .service-affiliation strong {
    font-weight: bold;
}

/* 特殊样式：专利section使用普通字重标题 */
#patents .item-title {
    font-weight: normal;
    margin: 0;
}

#patents .item-authors {
    font-style: italic;
}

#patents .item-authors a {
    font-style: normal;
}

.divider {
    font-weight: bold;
    margin: 0 5px;
}

#intro {
    margin-top: 0;
    margin-bottom: 0;
}

#intro a {
    color: var(--text-lighter);
}

/* 求和样式 */
.sum {
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
}

/* 响应式设计 */
@media only screen and (max-width: 40em) {
    body {
        margin: 0;
        font-size: 14px;
        line-height: 1.62;
        padding-top: 0;
    }

    #resume {
        margin: 0 auto;
        max-width: 600px;
        padding: 76px 22px 56px;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .largeFont {
        margin-bottom: 10px;
    }

    .largeFont .name {
        font-size: 29px;
    }

    .smallFont {
        margin-bottom: 30px;
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    #intro {
        font-size: 13.5px;
    }

    .organization-note {
        white-space: normal;
    }

    .sectionName {
        width: auto;
        padding: 0 0 8px;
        margin: 30px 0 14px;
        background: none;
        border-bottom: 1px solid var(--border-light);
        font-size: 16px;
        letter-spacing: 0.04em;
        display: block;
    }

    .sectionContent {
        width: auto;
        display: block;
    }

    .sectionBlock {
        display: block;
        width: auto;
        margin-bottom: 0;
    }

    .collapsible-summary .blockHeader {
        align-items: flex-start;
        gap: 8px;
    }

    .collapsible-summary .date {
        flex-shrink: 0;
        padding-top: 3px;
        font-size: 12px;
    }

    .item {
        margin-bottom: 18px;
    }

    .sectionLine {
        margin: 22px 0;
    }
}

/* Left-side vertical anchor nav */
.page-anchor-shell {
    position: fixed;
    top: 50%;
    left: max(8px, calc(50% - 482px));
    transform: translateX(-100%) translateY(-50%);
    z-index: 1000;
}

.page-anchor-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.page-anchor-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.page-anchor {
    position: relative;
}

/* Vertical track line */
.page-anchor::before {
    content: '';
    position: absolute;
    top: 0;
    right: 8px;
    width: 2px;
    height: 100%;
    background: var(--border-light);
    border-radius: 1px;
}

.anchor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.anchor-item {
    position: relative;
}

.anchor-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 5px 24px 5px 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    transition: all 0.25s ease;
    position: relative;
}

/* Dot on track */
.anchor-link::after {
    content: '';
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid var(--background-light);
    transition: all 0.25s ease;
    z-index: 1;
}

.anchor-link:hover {
    color: var(--primary-color);
}

.anchor-link:hover::after {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.2);
}

.anchor-link.active {
    color: var(--primary-color);
    text-shadow: 0.3px 0 0 currentColor, -0.3px 0 0 currentColor;
}

.anchor-link.active::after {
    background: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    transform: translateY(-50%) scale(1.3);
}

/* 语言切换按钮样式 */
.language-switch {
    position: relative;
}

.vt-flyout-menu[style*="display: block"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vt-flyout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    height: 36px;
    background: transparent;
    color: var(--text-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.theme-toggle {
    width: 36px;
    padding: 8px;
}

.language-toggle {
    width: 36px;
    padding: 8px;
}

.vt-locales-btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.theme-icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.theme-icon-moon {
    fill: currentColor;
    stroke: none;
}

.theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

.vt-flyout-button:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.08);
}

.vt-flyout-button:active {
    transform: translateY(1px);
}

.vt-flyout-button.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.12);
}

.vt-flyout-menu {
    position: absolute;
    top: 0;
    left: calc(100% + 8px);
    min-width: 120px;
    background: var(--background-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--menu-shadow-color);
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.vt-flyout-menu::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: var(--background-white);
    border: 1px solid var(--border-light);
    border-top: none;
    border-right: none;
    transform: rotate(45deg);
}

.vt-menu {
    padding: 8px 0;
}

.vt-menu-items {
    padding: 0;
}

.vt-locales-menu-item {
    position: relative;
}

.vt-locales-menu-item-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s;
    cursor: pointer;
    border-radius: 0;
}

.vt-locales-menu-item-text:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.06);
}

.vt-locales-menu-item-text.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.08);
    font-weight: 600;
}

.vt-locales-menu-item-text.active::after {
    content: '✓';
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 8px;
}

/* Hide anchor nav text on narrow screens, keep dots only */
@media only screen and (max-width: 1100px) {
    .anchor-link {
        font-size: 0;
        padding: 6px 24px 6px 0;
    }
}

/* Keep utility buttons available on mobile while hiding section anchors. */
@media only screen and (max-width: 768px) {
    .page-anchor-shell {
        top: 8px;
        right: 8px;
        left: auto;
        transform: none;
    }

    .page-anchor-panel {
        gap: 0;
    }

    .page-anchor-tools {
        padding: 2px;
        border: 1px solid var(--border-light);
        border-radius: 8px;
        background: color-mix(in srgb, var(--background-white) 88%, transparent);
        box-shadow: 0 4px 18px var(--shadow-color);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .page-anchor {
        display: none;
    }

    .vt-flyout-menu {
        top: calc(100% + 8px);
        right: 0;
        left: auto;
    }

    .vt-flyout-menu::before {
        top: -6px;
        right: 18px;
        left: auto;
        border: 1px solid var(--border-light);
        border-right: none;
        border-bottom: none;
    }
}

@media print {
    :root,
    :root[data-theme="dark"] {
        color-scheme: light;
        --primary-color: #536b82;
        --primary-hover: #3f556a;
        --primary-rgb: 83, 107, 130;
        --text-color: #414850;
        --heading-color: #343b42;
        --secondary-text-color: #59616a;
        --text-light: #7f8892;
        --text-lighter: #a4abb2;
        --border-color: #cbd1d6;
        --border-light: #e7eaed;
        --background-light: #f3f4f5;
        --background-white: #fff;
        --shadow-color: rgba(30, 40, 50, 0.06);
    }

    @page {
        size: A4;
        margin: 12mm 14mm;
    }

    .page-anchor-shell { display: none; }

    body {
        background: var(--background-white);
        margin: 0;
        padding-top: 0;
        font-size: 12px;
        line-height: 1.45;
    }

    #resume {
        margin: 0;
        max-width: none;
        width: 100%;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .largeFont {
        margin-bottom: 7px;
        font-size: 14px;
    }

    .largeFont .name {
        font-size: 26px;
        line-height: 1.15;
    }

    .smallFont {
        margin-bottom: 14px;
        font-size: 10px;
        line-height: 1.4;
    }

    #intro,
    [lang="en"] #intro,
    [lang="ja"] #intro > li:nth-child(3),
    .block-content {
        font-size: 11px;
    }

    .sectionBlock {
        margin-bottom: 14px;
    }

    .sectionName {
        padding-right: 14px;
        font-size: 11px;
    }

    .block {
        margin-bottom: 10px;
    }

    .collapsible-block {
        margin-bottom: 2px;
    }

    .experience-group {
        margin-bottom: 12px;
    }

    .experience-organization {
        margin-bottom: 5px;
        font-size: 12px;
    }

    .organization-note {
        font-size: 11px;
    }

    .item {
        margin-bottom: 9px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sectionLine {
        margin: 14px 0;
    }

    .sectionContent > .blockHeader {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sum {
        padding-top: 6px;
    }

    a { color: var(--text-color) !important; }
}
