:root {
  color-scheme: light;
  --paper: #f5f7f4;
  --white: #fff;
  --ink: #122521;
  --muted: #526660;
  --green: #155b47;
  --forest: #0d3029;
  --mint: #d7f78a;
  --line: #d9e1dc;
  --radius: 16px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.65;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #247d63; outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
.shell { width: min(1180px, calc(100% - 72px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; left: 16px; top: 12px; z-index: 2; padding: 9px 14px; background: white; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; white-space: nowrap; letter-spacing: .05em; font-size: 1.15rem; }
.mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; width: 28px; height: 28px; place-content: center; border-radius: 8px; background: var(--forest); }
.mark i { width: 5px; height: 5px; border-radius: 100%; background: #ddf8a5; }
.mark i:last-child { background: #83c394; }
.nav nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); color: #334c44; font-size: .95rem; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--green); text-decoration: underline; text-underline-offset: 5px; }
.github { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: system-ui, sans-serif; }

.hero { margin-top: 30px; min-height: 474px; display: grid; grid-template-columns: 1.02fr 1fr; background: var(--forest); border-radius: 22px; overflow: hidden; color: #fff; }
.hero-copy { padding: clamp(32px, 5vw, 68px); display: flex; flex-direction: column; align-items: start; justify-content: center; }
.hero-context { color: #bad7ca; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.hero-context span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.hero h1 { font-weight: 800; font-size: clamp(3.4rem, 7vw, 6.1rem); letter-spacing: -.045em; line-height: 1.07; margin: 17px 0 12px; }
.hero-focus { font-size: clamp(1.35rem, 2.5vw, 2.2rem); font-weight: 700; line-height: 1.36; color: #f1f8ee; }
.hero-description { margin-top: 16px; max-width: 34ch; color: #c6dbd4; }
.actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; min-height: 44px; border: 1px solid transparent; border-radius: 8px; font-size: .94rem; font-weight: 700; }
.button:hover { filter: brightness(.93); }
.button.primary { background: var(--mint); color: #1e3321; }
.button.inverse { color: #fff; border-color: #71978a; }
.button.light { color: var(--forest); background: #e9f2eb; border-color: #ccded4; }
.hero-visual { display: grid; position: relative; min-width: 0; min-height: 290px; isolation: isolate; background: #27443c; }
.hero-visual img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 47% center; z-index: -2; }
.hero-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #071810e6, #07181000 40%); z-index: -1; }
.hero-visual figcaption { margin-top: auto; padding: 20px 24px; display: flex; justify-content: space-between; align-items: end; gap: 12px; color: #f5fff8; font-size: .875rem; }
.hero-visual figcaption span:first-child { white-space: nowrap; }
.hero-visual figcaption span + span { color: #dcebe1; text-align: right; }

.section { margin-top: 60px; scroll-margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.section h2, .detail-copy h2, .resume h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.27; letter-spacing: -.035em; }
.section-head p, .about p { margin-top: 7px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 12px; width: min(100%, 289px); border: 1px solid #c5d5cd; background: var(--white); border-radius: 9px; min-height: 44px; }
.search:focus-within { outline: 2px solid #247d63; outline-offset: 2px; }
.search input { background: transparent; border: 0; outline: none; padding: 0; width: 100%; min-width: 0; color: var(--ink); font-size: .925rem; }
.search input:focus-visible { outline: none; }
.magnifier { width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; position: relative; flex: 0 0 auto; }
.magnifier::after { content: ''; width: 5px; height: 1.5px; background: var(--muted); position: absolute; left: 9px; top: 10px; transform: rotate(45deg); }
kbd { font-size: .75rem; font-family: system-ui, sans-serif; background: #edf1ed; color: #496055; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 16px 0 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button, .empty button { border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 6px 12px; font-size: .9rem; color: #28493f; min-height: 38px; }
.filters button:hover { background: #e7f1e8; }
.filters button[aria-pressed="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }
#project-count { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.project-card { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); overflow: clip; transition: border-color .16s, box-shadow .16s; }
.project-card:hover { border-color: #7eaa97; box-shadow: 0 10px 22px #17372a12; }
.card-link { display: flex; flex-direction: column; height: 100%; }
.card-link:focus-visible { outline-offset: -5px; }
.card-cover { aspect-ratio: 1.85; background: #e4e9e4; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.media-pattern-recognition img { object-position: center top; }
.media-odometry-diagnostics img { object-fit: contain; }
.card-content { display: flex; flex-direction: column; flex: 1; padding: 18px 18px 16px; }
.meta { color: var(--green); font-size: .875rem; font-weight: 750; }
.card-content h3 { margin: 5px 0 6px; font-size: 1.19rem; line-height: 1.45; }
.summary { margin-bottom: 14px; color: var(--muted); }
.tags { padding: 0; margin: auto 0 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: #edf2ef; border: 1px solid #e2ebe6; color: #284a3f; font-size: .82rem; border-radius: 6px; padding: 2px 7px; }
.empty { padding: 24px; background: #fff; border: 1px dashed #a5bcb0; border-radius: var(--radius); }
.empty button { margin-top: 10px; }

.note-list { margin-top: 8px; }
.note-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.note-row h3 { font-size: 1.05rem; }
.note-row:hover h3 { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.note-row p { color: var(--muted); }
.note-row span { text-align: right; color: var(--green); font-size: .875rem; white-space: nowrap; }
.about { border: 1px solid var(--line); background: #edf3ee; display: flex; align-items: center; gap: 22px; padding: 23px; border-radius: var(--radius); }
.about img { object-fit: cover; border-radius: 8px; }
.about h2 { font-size: 1.5rem; }
.text-link { display: inline-block; color: var(--green); text-decoration: underline; text-underline-offset: 4px; font-weight: 700; margin-top: 9px; }

.detail, .resume { max-width: 930px; margin-top: 34px; }
.breadcrumbs { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .94rem; margin-bottom: 18px; }
.breadcrumbs a { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.detail-title { background: #e9f1e9; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(19px, 4vw, 42px); }
.detail-title h1, .resume h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.18; letter-spacing: -.04em; margin: 5px 0 10px; }
.detail-intro { color: var(--muted); font-size: 1.09rem; }
.detail-title .tags { margin-top: 16px; }
.detail-title .button { margin-top: 18px; background: #fff; }
.detail-media { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.detail-media img { width: 100%; height: auto; max-height: 540px; object-fit: contain; }
.detail-media figcaption { font-size: .9rem; color: var(--muted); padding: 8px 14px; }
.detail-copy { max-width: 740px; }
.detail-copy section { margin-top: 27px; }
.detail-copy h2 { font-size: 1.42rem; margin-bottom: 8px; }
.detail-copy ul, .resume ul { padding-left: 1.3em; margin-block: 7px; }
.detail-copy li + li, .resume li + li { margin-top: 4px; }

.resume { padding: clamp(20px, 5vw, 54px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.resume-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.resume-head a, .resume-projects a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.resume-head img { border-radius: 5px; object-fit: cover; }
.resume section { margin-top: 21px; }
.resume h2 { font-size: 1.19rem; border-bottom: 2px solid var(--ink); padding-bottom: 3px; margin-bottom: 7px; }
.resume-projects { display: grid; gap: 9px; }
.resume h3 { font-size: 1rem; }
.print-action { margin-top: 15px; }
.site-footer { margin-top: 58px; background: var(--white); border-top: 1px solid var(--line); }
.footer-inner { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.footer-inner a:hover { text-decoration: underline; }

@media (max-width: 940px) {
  .shell { width: calc(100% - 46px); }
  .hero-copy { padding: 32px; }
  .hero { min-height: 410px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 660px) {
  .shell { width: calc(100% - 28px); }
  .nav { min-height: 60px; gap: 10px; }
  .brand { gap: 6px; font-size: 1rem; }
  .nav nav { gap: 12px; font-size: .875rem; }
  .github { padding: 4px 6px; }
  .hero { margin-top: 14px; grid-template-columns: 1fr; }
  .hero-copy { padding: 27px 20px 28px; }
  .hero h1 { font-size: 3.55rem; }
  .hero-break { display: none; }
  .hero-visual { min-height: 235px; }
  .hero-visual figcaption { padding: 13px; }
  .section { margin-top: 38px; }
  .section-head { align-items: stretch; flex-direction: column; gap: 11px; }
  .search { width: 100%; }
  .filter-row { align-items: start; }
  #project-count { padding-top: 7px; }
  .project-grid { grid-template-columns: 1fr; }
  .note-row { align-items: start; flex-direction: column; gap: 5px; }
  .about { padding: 14px; gap: 13px; align-items: start; }
  .about img { width: 64px; height: auto; }
  .detail, .resume { margin-top: 18px; }
  .resume-head img { width: 60px; height: auto; }
}
@media (max-width: 370px) { .nav .github { display: none; } .nav nav a { white-space: nowrap; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  @page { margin: 12mm 15mm; size: A4; }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.35; }
  .site-header, .site-footer, .print-action, .skip { display: none !important; }
  .resume { width: 100%; max-width: none; border: 0; padding: 0; margin: 0; }
  .resume h1 { font-size: 25pt; }
  .resume h2 { font-size: 12pt; }
  .resume h3 { font-size: 10pt; }
  .resume section { margin-top: 10px; break-inside: avoid; }
  .resume-projects { gap: 5px; }
  .resume a { color: inherit; }
}

