/* 个人办公室 — 相对路径静态样式；无外链 CDN；暖色 + 墨绿，避免紫霓虹 */

:root {
  --bg: #f8f1e6;
  --bg-alt: #f3e8d8;
  --surface: #fffaf3;
  --text: #1c1b19;
  --muted: #5c5954;
  --border: #e0d6c8;
  --accent: #2f5d50;
  --accent-soft: #e4efe9;
  --placeholder: #8a4b2a;
  --placeholder-bg: #f6ebe3;
  --wall: #faf4ea;
  --floor: #5c4030;
  --desk: #fbf9f4;
  --desk-dark: #e0d8cc;
  --peach: #f3e4d0;
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.06), 0 8px 24px rgba(28, 27, 25, 0.08);
  --radius: 12px;
  --max: 960px;
  --header-h: 56px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: #23463c;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.placeholder {
  display: inline;
  color: var(--placeholder);
  background: var(--placeholder-bg);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-size: 0.95em;
}

/* —— Top bar —— */
.topbar {
  min-height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  width: min(100% - 1.5rem, 1100px);
  margin-inline: auto;
  padding: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
}

.topbar-split {
  justify-content: space-between;
  align-items: center;
}

.brand {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hint-desktop {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.back-link {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--muted);
}

.back-link:hover {
  color: var(--accent);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #23463c;
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-alt);
}


/* —— Style reference strip —— */
.ref-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ref-figure {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
}

.ref-figure img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ref-figure figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
}

.ref-figure figcaption strong {
  font-size: 0.95rem;
}

.ref-figure figcaption span {
  color: var(--muted);
  font-size: 0.85rem;
}

.ref-note {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.ref-note code {
  font-size: 0.8em;
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* —— Office scene stage —— */
.office-main {
  flex: 1;
  width: min(100% - 1.25rem, 1100px);
  margin: 1rem auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scene-stage {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--peach);
  min-height: min(62vh, 520px);
  aspect-ratio: 16 / 10;
}

.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: transparent;
}

.scene-canvas[data-status="loading"],
.scene-canvas[data-status="ready"] {
  pointer-events: auto;
  z-index: 10;
  background: #ead9c4;
}

.scene-canvas[data-status="error"] {
  pointer-events: none;
  z-index: 1;
  background: transparent;
}

.scene-canvas[data-status="ready"] canvas,
.scene-canvas[data-status="loading"] canvas,
.scene3d-canvas {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10 !important;
  border-radius: inherit;
}

.scene-canvas-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  margin: 0;
  z-index: 20;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 250, 243, 0.94);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  pointer-events: none;
  max-width: min(92%, 28rem);
  box-shadow: 0 1px 4px rgba(28, 27, 25, 0.08);
}

.scene-canvas-badge.is-ok {
  color: #1d4a3c;
  background: rgba(228, 239, 233, 0.96);
  border-color: #2f5d50;
}

.scene-canvas-badge.is-error {
  color: #7a1c1c;
  background: rgba(255, 232, 232, 0.96);
  border-color: #c0392b;
  border-radius: 10px;
  font-weight: 700;
}

/* 等距 SVG 占位：仅在 3D 未就绪时显示 */
.room {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.room.is-hidden-for-3d,
#hotspots.is-hidden-for-3d {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.room-iso {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--peach);
}

.iso-scene {
  width: 100%;
  height: 100%;
  display: block;
}

/* —— Hotspots (interactive overlay) —— */
.hotspots {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.hotspot {
  position: absolute;
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 72px;
  min-height: 72px;
}

.hotspot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.hotspot-hit {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 64px;
  border-radius: 10px;
  border: 2px dashed transparent;
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hotspot:hover .hotspot-hit,
.hotspot:focus-visible .hotspot-hit {
  border-color: rgba(47, 93, 80, 0.55);
  background: rgba(228, 239, 233, 0.35);
}

.hotspot-label {
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(28, 27, 25, 0.08);
  pointer-events: none;
}

.hotspot.is-decor {
  cursor: default;
  pointer-events: none;
}

.decor-label {
  opacity: 0.65;
  font-size: 0.7rem;
}

/* 热区对准精简 SVG：居中桌上显示器与简历文件夹（够大、易点） */
.hotspot-computer {
  left: 50.5%;
  top: 54%;
  width: 16%;
  max-width: 130px;
  min-width: 96px;
  height: 20%;
  transform: translate(-50%, -50%);
}

.hotspot-files {
  left: 58.5%;
  top: 66%;
  width: 14%;
  max-width: 110px;
  min-width: 88px;
  height: 15%;
  transform: translate(-50%, -50%);
}

.mobile-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* —— Modal —— */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 25, 0.45);
}

.modal-panel {
  position: relative;
  width: min(100%, 520px);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  min-width: 44px;
  min-height: 44px;
}

.modal-body {
  padding: 1.1rem 1.25rem;
}

.resume-name {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 650;
}

.resume-tagline {
  margin: 0 0 1rem;
  color: var(--muted);
}

.resume-meta {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-alt);
  border-radius: 8px;
}

.resume-meta div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
}

.resume-meta dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.resume-meta dd {
  margin: 0;
}

.resume-block {
  margin-bottom: 1rem;
}

.resume-block h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.resume-block ul {
  margin: 0;
  padding-left: 1.2rem;
}

.resume-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* —— Portfolio —— */
.portfolio-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.portfolio-hero {
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.portfolio-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.work-card-visual {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.work-card-visual.muted {
  background: var(--bg-alt);
  color: var(--muted);
}

.work-card-icon {
  font-size: 1.75rem;
}

.work-card-body {
  padding: 1.1rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.work-card-body h2 {
  margin: 0;
  font-size: 1.2rem;
}

.work-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.work-meta {
  margin-bottom: 0.5rem !important;
}

.work-card-body .btn {
  margin-top: auto;
  align-self: flex-start;
}

.portfolio-note {
  padding: 1.25rem 1.35rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.portfolio-note h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.portfolio-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
}

/* —— Responsive —— */
@media (max-width: 720px) {
  .scene-stage {
    aspect-ratio: 4 / 5;
    min-height: 420px;
  }

  .hint-desktop {
    display: none;
  }

  .ref-figure img {
    width: 56px;
    height: 56px;
  }

  .hotspot-computer {
    width: 24%;
    min-width: 100px;
    height: 18%;
    left: 51%;
    top: 54%;
  }

  .hotspot-files {
    left: 60%;
    top: 68%;
    width: 20%;
    min-width: 92px;
    height: 15%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .hotspot-hit {
    transition: none;
  }
}
