/* ==========================================================================
   杜可个人作品集 — 瑞士工程档案排版系统
   原则：零圆角卡片堆砌、零阴影修饰、锐利网格线、纯实色高对比度
   ========================================================================== */

:root {
  --paper: #FFFFFF;
  --paper-subtle: #F5F6F8;
  --paper-stage: #EBEEF2;
  --ink: #111214;
  --ink-secondary: #3F434A;
  --ink-muted: #555A63;

  --blueprint: #184A8C;
  --blueprint-dark: #113668;
  --line: #D4D7DD;
  --line-heavy: #111214;

  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --container-w: 1220px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: var(--ink);
  color: #FFFFFF;
}

:focus-visible {
  outline: 2px solid var(--blueprint);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

.container {
  width: min(100% - 40px, var(--container-w));
  margin-inline: auto;
}

/* ==========================================================================
   顶部极简导航条
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.topbar-id {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.id-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.id-meta {
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.topbar-nav a:hover,
.topbar-nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.tool-link {
  padding: 8px 10px;
  background: transparent;
  border: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

.tool-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background-color: var(--ink);
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background-color 0.15s;
}

.tool-btn:hover {
  background-color: var(--blueprint);
  border-color: var(--blueprint);
}

.tool-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background-color: var(--paper);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: background-color 0.15s, color 0.15s;
}

.tool-btn-outline:hover {
  background-color: var(--paper-subtle);
}

.menu-toggle {
  display: none;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ==========================================================================
   开篇标题与双联对照视口
   ========================================================================== */
.intro-band {
  padding: 40px 0 56px;
  border-bottom: 1px solid var(--line);
}

.intro-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 36px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--line-heavy);
}

.intro-primary {
  min-width: 0;
}

.intro-name {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.intro-role {
  display: inline-block;
  margin-left: 10px;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 500;
  color: var(--blueprint);
}

.intro-bio {
  margin: 0;
  max-width: 64ch;
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

.intro-specs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  align-content: start;
  min-width: 0;
}

.intro-specs div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-width: 0;
}

.intro-specs dt {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.intro-specs dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
}

.intro-specs a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro-specs a:hover {
  color: var(--blueprint);
}

/* 双联图版控制与展示 */
.diptych-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
}

.diptych-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diptych-tab {
  padding: 9px 16px;
  background-color: var(--paper-subtle);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.diptych-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.diptych-tab.is-active {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.diptych-hint {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.diptych-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
}

.plate-frame {
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background-color: var(--paper);
  min-width: 0;
}

.plate-trigger {
  width: 100%;
  height: 440px;
  padding: 12px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #16181B;
  cursor: zoom-in;
}

.plate-cad .plate-trigger {
  background-color: var(--paper-stage);
}

.plate-trigger img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.plate-caption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-secondary);
  background-color: var(--paper);
}

.plate-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--blueprint);
  flex-shrink: 0;
}

/* ==========================================================================
   通用章节标题栏
   ========================================================================== */
.band-head {
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line-heavy);
}

.band-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.band-head p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.band-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

/* ==========================================================================
   项目实录（横排工程条目，无大黑卡片套壳）
   ========================================================================== */
.projects-band {
  padding: 64px 0;
  background-color: var(--paper-subtle);
  border-bottom: 1px solid var(--line);
}

.case-row {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 36px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.case-row:first-of-type {
  padding-top: 8px;
}

.case-row:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.case-meta {
  min-width: 0;
}

.case-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blueprint);
  margin-bottom: 8px;
}

.case-title {
  margin: 0 0 12px;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.35;
}

.case-summary {
  margin: 0 0 16px;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.case-list {
  margin: 0 0 20px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.case-tech {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.case-tech span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.case-tech p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.55;
}

/* 项目右侧图版查看器 */
.case-viewer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.viewer-stage {
  height: 410px;
  background-color: #16181B;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.viewer-stage.is-cad-bg {
  background-color: var(--paper-stage);
}

.viewer-zoom {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.viewer-zoom img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.viewer-caption {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.viewer-caption strong {
  color: var(--ink);
}

.viewer-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.viewer-strip-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.strip-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  color: var(--ink-muted);
  text-align: left;
  min-width: 0;
  transition: border-color 0.15s, color 0.15s;
}

.strip-item img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.strip-item span {
  font-size: 0.76rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-item:hover {
  color: var(--ink);
  border-bottom-color: var(--ink-secondary);
}

.strip-item.is-active {
  color: var(--ink);
  border-bottom-color: var(--blueprint);
}

.strip-item.is-active img {
  border-color: var(--blueprint);
}

/* ==========================================================================
   全量图集档案（无卡片外框，仅干净画板 + 图注）
   ========================================================================== */
.archive-band {
  padding: 64px 0;
  background-color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  padding: 9px 16px;
  background-color: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 500;
}

.filter-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-tab.is-active {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
  align-items: start;
}

.archive-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.archive-item.is-hidden {
  display: none;
}

.archive-thumb {
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background-color: #16181B;
  cursor: zoom-in;
  overflow: hidden;
}

.archive-thumb.is-cad {
  background-color: var(--paper-stage);
  aspect-ratio: 16 / 10;
}

.archive-thumb.is-proto {
  aspect-ratio: 3 / 4;
}

.archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.archive-thumb:hover img {
  transform: scale(1.02);
}

.archive-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.archive-kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--blueprint);
}

.archive-meta h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}

.archive-meta p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   履历与工程技能规格表
   ========================================================================== */
.resume-band {
  padding: 64px 0;
  background-color: var(--paper-subtle);
  border-bottom: 1px solid var(--line);
}

.resume-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.resume-block {
  min-width: 0;
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.block-head h3 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
}

.block-head span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--blueprint);
  font-weight: 600;
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.93rem;
  color: var(--ink-secondary);
}

.edu-sub + .edu-sub {
  margin-top: 18px;
}

.edu-sub h4 {
  margin: 0 0 6px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
}

.edu-sub p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-secondary);
}

/* 专业技能水平规格表 */
.skills-table-wrap {
  padding-top: 36px;
}

.sub-heading {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 700;
}

.skills-table {
  margin: 0;
  border-top: 1px solid var(--line-heavy);
}

.skill-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.skill-row dt {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink);
}

.skill-row dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   联系与个人档案底栏
   ========================================================================== */
.contact-band {
  padding: 56px 0;
  background-color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
}

.contact-person {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.person-photo {
  width: 96px;
  height: auto;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.contact-person h2 {
  margin: 0 0 6px;
  font-size: 1.32rem;
  font-weight: 700;
}

.person-meta {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.person-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.channel-k {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-muted);
  width: 42px;
  flex-shrink: 0;
}

.channel-v {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  margin-right: auto;
  word-break: break-all;
}

.channel-v:hover {
  color: var(--blueprint);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy-link {
  padding: 8px 14px;
  background-color: var(--paper-subtle);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  flex-shrink: 0;
}

.copy-link:hover {
  border-color: var(--ink);
}

.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

/* 页脚 */
.footer-bar {
  padding: 20px 0 32px;
  background-color: var(--paper);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   灯箱（高对比纯实色框架）
   ========================================================================== */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: #111214;
  opacity: 0.9;
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 1040px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  overflow: hidden;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.lightbox-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.lightbox-kind {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--blueprint);
  flex-shrink: 0;
}

.lightbox-heading h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lightbox-count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.lightbox-close {
  padding: 8px 12px;
  background-color: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
}

.lightbox-close:hover {
  border-color: var(--ink);
}

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 300px;
  max-height: 70vh;
  background-color: #16181B;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 56px;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 64vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-step {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 48px;
  background-color: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox-step:hover {
  background-color: var(--ink);
  color: #FFFFFF;
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background-color: var(--paper-subtle);
}

.lightbox-foot p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 9px 16px;
  background-color: var(--ink);
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 500;
}

/* ==========================================================================
   响应式适配
   ========================================================================== */
@media (max-width: 980px) {
  .intro-header,
  .diptych-grid,
  .case-row,
  .resume-columns,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .skill-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 28px, var(--container-w));
  }

  .id-meta,
  .tool-link {
    display: none;
  }

  .topbar-nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px;
    background-color: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .topbar-nav.is-open {
    display: flex;
  }

  .menu-toggle {
    display: inline-block;
  }

  .intro-role {
    display: block;
    margin: 6px 0 0;
  }

  .intro-specs {
    grid-template-columns: minmax(0, 1fr);
  }

  .plate-trigger,
  .viewer-stage {
    height: 320px;
  }

  .viewer-strip,
  .viewer-strip-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .archive-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-person {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  .topbar,
  .diptych-controls,
  .viewer-strip,
  .archive-filters,
  .copy-link,
  .channel-actions,
  .lightbox,
  .toast {
    display: none !important;
  }

  .case-row,
  .skill-row {
    break-inside: avoid;
  }
}
