
:root {
  color-scheme: light;
  --ink: #111522;
  --muted: #4f5c70;
  --blue: #0059f5;
  --line: #dee5f1;
  --paper: #fff;
  --shadow: 0 3px 12px #1738660a;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f8faff; color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; display: inline-block; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.wrap { width: min(1240px, calc(100% - 74px)); margin-inline: auto; }
section { scroll-margin-top: 20px; }
:focus-visible { outline: 3px solid #2477ff; outline-offset: 4px; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 5; padding: 10px 16px; transform: translateY(-180%); background: white; border-radius: 10px; }
.skip:focus { transform: none; }

.masthead { border-bottom: 1px solid #e5eaf1; background: #f1f4f9; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.18rem; font-weight: 820; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; color: var(--blue); stroke-width: 2.3; }
nav { display: flex; align-items: stretch; gap: clamp(14px, 3vw, 40px); align-self: stretch; }
nav a { display: grid; place-items: center; position: relative; color: #172034; font-size: .93rem; font-weight: 720; white-space: nowrap; }
nav a:hover, nav a[aria-current] { color: var(--blue); }
nav a[aria-current]::after { content: ""; position: absolute; inset: auto -4px 7px; height: 2px; background: var(--blue); border-radius: 10px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 8px 17px; border: 1px solid var(--blue); border-radius: 999px; background: var(--blue); color: white; font-weight: 730; font-size: .92rem; white-space: nowrap; }
.pill:hover { background: #0048cb; border-color: #0048cb; }
.pill svg { width: 19px; height: 19px; }
.pill.secondary { background: #ffffffe8; color: #111827; border-color: #5391ff; }
.pill.secondary:hover { background: #e7f0ff; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: #f0f2f6; }
.hero-photo { position: absolute; z-index: -2; inset: 0 0 0 34%; background: #e3e9e1 url(assets/workspace.webp) center 58% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#f0f2f6 10%,#f0f2f6 33%,#f0f2f6e8 43%,#f0f2f62b 64%,transparent 83%); }
.hero-inner { padding-block: 33px 36px; }
h1 { margin: 0; font-size: clamp(2.22rem, 4.4vw, 3.65rem); letter-spacing: -.045em; line-height: 1.12; font-weight: 850; }
.hero-lead { margin: 7px 0 12px; font-size: clamp(1.03rem, 2.05vw, 1.55rem); font-weight: 720; }
.hero-desc { max-width: 39ch; margin: 0; color: #303b4c; line-height: 1.7; font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.hero-actions .pill { padding-inline: 23px; }
.hero-actions .pill:first-child { box-shadow: 0 4px 12px #0059f528; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; padding: 18px 0; }
.metrics > div { display: flex; justify-content: center; align-items: center; gap: 13px; min-width: 0; }
.metrics > div + div { border-left: 1px solid #d2dced; }
.metrics svg { width: 31px; height: 31px; color: #0066ff; }
.metrics p { display: grid; gap: 4px; margin: 0; }
.metrics b { font-size: 1.64rem; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.metrics small { font-size: .84rem; }
.metrics span { font-size: .86rem; color: #364257; }

.portfolio-section { border-top: 1px solid var(--line); padding-block: 19px 17px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 23px; margin-bottom: 14px; }
.section-head h2, .panel h2 { margin: 0; font-size: clamp(1.33rem, 2.1vw, 1.82rem); font-weight: 840; letter-spacing: -.03em; }
.section-head h2::before { content: ""; width: 6px; height: .94em; margin-right: 10px; display: inline-block; background: #065ffa; border-radius: 5px; vertical-align: -.08em; }
.section-head h2 span { font-size: .79em; }
.section-head p { margin: 0; font-size: .9rem; color: var(--muted); }
.work-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.card, .panel { border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); min-width: 0; }
.card { --accent: #0059ee; --tint: #edf4ff; position: relative; display: flex; flex-direction: column; overflow: hidden; transition: border-color .16s, box-shadow .16s, transform .16s; }
.card:hover, .card:focus-within { border-color: #a6c5f9; box-shadow: 0 7px 22px #1753a316; }
.mobile-card:hover { transform: translateY(-2px); }
.card-header { display: flex; align-items: center; gap: 9px; min-height: 59px; padding: 12px 12px 7px; }
.project-icon { width: 37px; height: 37px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: var(--accent); color: white; font-weight: 800; }
.project-icon img { width: 100%; height: 100%; object-fit: cover; }
.project-title { font-size: 1rem; line-height: 1.24; font-weight: 825; margin: 0; overflow-wrap: anywhere; }
.project-subtitle { margin: 3px 0 0; font-size: .78rem; line-height: 1.34; color: #404b5e; }
.phone-preview { --preview-width: 158px; height: clamp(151px, 17vw, 216px); display: flex; justify-content: center; align-items: flex-start; overflow: hidden; margin: 2px 10px 0; padding-top: 6px; background: radial-gradient(ellipse at 50% 100%,var(--tint),transparent 72%); }
.phone-frame { flex: none; width: min(var(--preview-width), 90%); padding: 4px; border: 1px solid #494d59; border-radius: 19px; background: #20252e; box-shadow: 0 2px 9px #1218223f; }
.phone-frame img { width: 100%; height: auto; border-radius: 14px; }
.card-tags { position: relative; z-index: 1; pointer-events: none; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: auto 0 0; padding: 8px 9px 9px; background: #fff; }
.card-tags li { border-radius: 8px; padding: 4px 7px; background: #edf4ff; color: #173750; font-size: .72rem; font-weight: 680; line-height: 1.15; }
.card-target { position: absolute; z-index: 1; inset: 0; width: 100%; border: 0; border-radius: inherit; background: transparent; }
.card-target:focus-visible { outline-offset: -4px; }

.personal-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 15px; align-items: stretch; }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.app-grid .phone-preview { --preview-width: 140px; height: clamp(128px, 14vw, 174px); }
.store-links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: auto 0 0; padding: 6px 5px 8px; pointer-events: none; }
.store-links a { display: inline-flex; align-items: center; gap: 3px; padding: 4px 5px; color: white; background: #181d27; border-radius: 5px; font-size: .68rem; font-weight: 700; white-space: nowrap; pointer-events: auto; }
.store-links a:hover { background: #244577; }
.store-links a svg { font-size: .89rem; }
.web-panel { padding: 12px 12px 10px; align-self: stretch; }
.web-panel > h3 { margin: 0 1px 8px; font-size: 1.12rem; letter-spacing: -.025em; }
.web-list { display: grid; gap: 4px; }
.web-row { --accent: #0059f5; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) auto; align-items: center; gap: 6px; min-height: 33px; border: 1px solid #edf0f5; border-radius: 8px; background: #f8faff; }
.web-row:hover { border-color: #c2d7f7; }
.web-row button { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 5px; border: 0; background: none; color: inherit; text-align: left; font-size: .79rem; font-weight: 800; letter-spacing: -.025em; }
.web-row .project-icon { width: 23px; height: 23px; border-radius: 6px; font-size: .8rem; }
.web-row .row-summary { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #445165; font-size: .76rem; }
.external-link { display: inline-flex; align-items: center; gap: 3px; padding: 5px 7px; color: #0048c3; font-size: .76rem; font-weight: 710; white-space: nowrap; }
.external-link:hover { text-decoration: underline; }

.skills-row { display: grid; grid-template-columns: 1.24fr 1fr; gap: 15px; margin: 4px 0 17px; }
.open-panel, .tech-panel { padding: 13px; }
.panel h2 { font-size: 1.23rem; }
.panel h2 svg, .with-icon svg { color: #0066ff; width: 25px; height: 25px; margin-right: 4px; }
.open-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.open-card { min-height: 125px; padding: 9px 10px 7px; }
.open-card .card-header { padding: 0; min-height: 34px; }
.open-card .project-icon { width: 31px; height: 31px; }
.open-card p { position: relative; margin: 7px 0; color: #3d4b5d; font-size: .8rem; line-height: 1.55; }
.open-links { position: relative; z-index: 2; align-self: end; margin-top: auto; pointer-events: none; }
.open-links a { pointer-events: auto; }
.tech-list { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; list-style: none; margin: 10px 0 0; padding: 0; }
.tech-list li { display: flex; align-items: center; gap: 4px; padding: 5px 3px; border: 1px solid #ecf0f7; border-radius: 8px; background: #f8faff; white-space: nowrap; font-size: .72rem; font-weight: 690; }
.tech-list b { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--tech) 11%, white); color: var(--tech); font-size: .65rem; }
.tech-list svg { width: .95rem; height: .95rem; }

.with-icon h2::before { display: none; }
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; margin: 3px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 3px 11px 6px 17px; border-left: 2px solid #bad4ff; }
.timeline li::before { content: ""; position: absolute; width: 10px; height: 10px; left: -6px; top: 8px; border: 2px solid var(--blue); border-radius: 50%; background: white; }
.timeline h3 { margin: 0; font-size: .98rem; }
.timeline p { margin: 6px 0 0; color: #354357; font-size: .9rem; line-height: 1.52; }
.timeline .role { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: baseline; font-size: .83rem; }
.timeline time { color: #485a71; white-space: nowrap; }
.about { padding: 15px 18px; }
.about p { max-width: 54rem; margin: 8px 0 0; color: #43536a; font-size: .92rem; line-height: 1.72; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding-block: 17px 20px; color: #5b6880; font-size: .82rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 5px 16px; }
.footer a:hover { color: var(--blue); }

dialog { width: min(870px, calc(100% - 28px)); max-height: calc(100% - 30px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 19px; background: white; color: var(--ink); box-shadow: 0 20px 100px #071c4b51; }
dialog::backdrop { background: #1426469c; backdrop-filter: blur(4px); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-layout { position: relative; display: grid; grid-template-columns: 1fr 1.05fr; }
.dialog-copy { padding: 27px; }
.dialog-copy h2 { margin: 10px 0 6px; font-size: 1.6rem; }
.dialog-copy p, .dialog-copy li { color: #39485e; line-height: 1.65; }
.dialog-copy h3 { font-size: 1rem; margin: 15px 0 0; }
.dialog-copy ul { padding-left: 1.2rem; margin-top: 7px; }
.source-label { color: #475a75; font-size: .9rem; }
.dialog-links { display: flex; flex-wrap: wrap; gap: 6px; }
.dialog-close { position: absolute; z-index: 1; top: 10px; right: 10px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #dbe6fb; border-radius: 50%; background: white; color: #12428b; font-size: 1.2rem; }
.icon-button:hover { background: #e4efff; }
.dialog-gallery { display: grid; align-content: center; justify-items: center; gap: 8px; min-height: 350px; padding: 36px 16px 17px; background: #edf3ff; }
.dialog-gallery img { width: 100%; max-height: min(57vh, 520px); object-fit: contain; }
.dialog-gallery.is-portrait img { width: auto; border-radius: 8px; }
.gallery-controls { display: flex; align-items: center; gap: 13px; font-size: .85rem; color: #3d587d; }
.gallery-caption { margin: 0; color: #435877; font-size: .79rem; text-align: center; }

@media (max-width: 1060px) {
  .wrap { width: calc(100% - 48px); }
  .personal-grid { grid-template-columns: 1.28fr 1fr; }
  .card-header { padding-inline: 9px; gap: 6px; }
  .project-icon { width: 32px; height: 32px; }
  .project-title { font-size: .94rem; }
  .web-row .row-summary { font-size: .7rem; }
}
@media (max-width: 890px) {
  .topbar { gap: 12px; }
  nav { gap: 15px; }
  .brand { font-size: 1rem; gap: 7px; }
  .brand svg { width: 25px; height: 25px; }
  .work-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .personal-grid, .skills-row { grid-template-columns: 1fr; }
  .app-grid .phone-preview { height: 167px; }
  .web-row .row-summary { font-size: .8rem; }
  .tech-list { grid-template-columns: repeat(5, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 30px); }
  .topbar { flex-wrap: wrap; row-gap: 2px; padding-top: 9px; }
  .resume { margin-left: auto; min-height: 34px; padding-inline: 11px; font-size: .81rem; }
  nav { order: 3; width: 100%; gap: 0; justify-content: space-between; min-height: 38px; }
  nav a { font-size: .81rem; }
  nav a[aria-current]::after { bottom: 1px; }
  .hero-inner { padding-block: 25px; }
  .hero-photo { inset-inline-start: 24%; opacity: .55; }
  .hero::after { background: linear-gradient(90deg,#f0f2f6 7%,#f0f2f6e8 41%,#f0f2f68a 75%,#f0f2f62e); }
  .hero-lead { margin-bottom: 10px; }
  .hero-desc { max-width: 33ch; font-size: .9rem; }
  .hero-actions { margin-top: 14px; gap: 9px; }
  .hero-actions .pill { padding-inline: 13px; font-size: .83rem; }
  .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px 4px; padding: 13px 0; }
  .metrics > div { gap: 6px; justify-content: start; }
  .metrics > div + div { border-left: 0; }
  .metrics svg { width: 20px; height: 20px; }
  .metrics b { font-size: 1.21rem; }
  .metrics small { font-size: .7rem; }
  .metrics span { font-size: .67rem; }
  .portfolio-section { padding-block: 16px 13px; }
  .section-head { gap: 5px 12px; margin-bottom: 11px; }
  .section-head p { font-size: .81rem; }
  .work-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .app-grid { gap: 6px; }
  .app-grid .card-header { display: grid; align-content: start; padding: 8px 6px 4px; min-height: 82px; }
  .app-grid .project-title { font-size: .82rem; }
  .app-grid .project-subtitle { font-size: .7rem; }
  .app-grid .phone-preview { height: 119px; margin-inline: 5px; }
  .phone-preview { height: 161px; margin-inline: 6px; }
  .phone-frame { padding: 3px; border-radius: 13px; }
  .phone-frame img { border-radius: 10px; }
  .store-links a { font-size: .63rem; }
  .store-links a svg { font-size: .8rem; }
  .web-row { grid-template-columns: minmax(0,1.16fr) minmax(0,.9fr) auto; }
  .web-row button, .web-row .row-summary, .external-link { font-size: .7rem; }
  .tech-list { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .timeline { grid-template-columns: 1fr; gap: 9px; margin-left: 4px; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-copy { padding: 18px; }
  .dialog-gallery { min-height: 200px; padding: 13px; }
}
@media (max-width: 360px) {
  .web-row { grid-template-columns: minmax(0,1fr) auto; }
  .web-row .row-summary { display: none; }
  .tech-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .open-card .external-link { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition: none!important; }
}

