:root {
  --bg: #0a0a0a;
  --panel: #111;
  --panel-soft: #151515;
  --border: #2a2a2a;
  --border-soft: #1f1f1f;
  --text: #e5e5e5;
  --muted: #8d8d8d;
  --dim: #555;
  --accent: #c97e3a;
  --accent-soft: rgba(201, 126, 58, .13);
  --mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: radial-gradient(circle at 50% -10%, rgba(201, 126, 58, .08), transparent 34%), var(--bg);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(201, 126, 58, .32);
}

.site-shell {
  width: min(1400px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 36px;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  padding-bottom: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.brand-mark-image {
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.brand-mark-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.brand-copy em {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.site-nav,
.header-actions,
.quick-links,
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a,
.icon-link,
.language-toggle,
.quick-links a,
.small-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.site-nav a:hover,
.quick-links a:hover,
.small-action:hover,
.icon-link:hover {
  color: var(--text);
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.icon-link {
  width: 34px;
  border-color: var(--border);
  border-radius: 6px;
  color: var(--muted);
}

.language-toggle {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}

.language-toggle span {
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--dim);
  line-height: 1;
}

html[data-lang="zh"] [data-lang-option="zh"],
html[data-lang="en"] [data-lang-option="en"] {
  background: var(--accent-soft);
  color: var(--accent);
}

[data-lang-panel] {
  display: none;
}

html[data-lang="zh"] [data-lang-panel="zh"],
html[data-lang="en"] [data-lang-panel="en"] {
  display: inline;
}

.site-main {
  min-height: 70vh;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.reveal {
  animation: reveal .45s ease both;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 22px;
  align-items: start;
  padding: 24px 0 16px;
}

.eyebrow,
.section-heading p,
.page-title p {
  margin: 0 0 10px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.profile-core h1,
.page-title h1,
.article-header h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(26px, 4vw, 56px);
  line-height: 1.04;
}

.profile-core h1 small {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.status-line span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.profile-lede,
.section-card p,
.muted,
.article-body,
.post-excerpt {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.profile-lede {
  max-width: 760px;
  margin: 14px 0 0;
}

.quick-links {
  margin-top: 20px;
}

.quick-links a,
.small-action {
  padding: 8px 12px;
  border-color: var(--border);
  border-radius: 6px;
  color: var(--text);
}

.quick-links a:first-child,
.small-action {
  background: var(--accent-soft);
  border-color: rgba(201, 126, 58, .45);
  color: var(--accent);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 17, .78);
}

.profile-stats div:not(.mini-grid) {
  min-width: 0;
}

.profile-stats strong {
  display: block;
  color: var(--text);
  font-family: var(--mono);
  font-size: 22px;
}

.profile-stats span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.mini-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.heat {
  aspect-ratio: 1;
  border-radius: 2px;
  background: #1a1a1a;
}

.heat-1 { background: #3b2815; }
.heat-2 { background: #65411f; }
.heat-3 { background: #985f2d; }
.heat-4 { background: var(--accent); }

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.section-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 17, .78);
}

.section-card.wide {
  grid-column: 1 / -1;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h2,
.photo-notes strong,
.metric-card strong {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 21px;
  line-height: 1.35;
}

.metric-card span,
.note-list span,
.link-row span,
.photo-notes span,
.chip-cloud span,
.tag-line a {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
}

.split-section > div {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 17, .78);
}

.note-list {
  display: grid;
  gap: 2px;
}

.note-list a {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
}

.note-list strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
}

.note-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

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

.photo-strip img,
.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.link-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.link-row a {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 17, .62);
}

.link-row strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.page-title {
  padding-top: 24px;
}

.page-title.with-actions {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.resume-hero-card,
.photo-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 17, .78);
}

.resume-hero-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 34px;
}

.accent {
  color: var(--accent) !important;
  font-family: var(--mono);
}

.resume-contact-list {
  display: grid;
  align-content: start;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.resume-contact-list a:hover {
  color: var(--accent);
}

.three-up {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.three-up div,
.mini-list div {
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, .02);
}

.three-up strong,
.mini-list strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.timeline-card {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.timeline-item time,
.mini-list span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

.timeline-item h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 17px;
}

.timeline-item ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.mini-list {
  display: grid;
  gap: 12px;
}

.mini-list p {
  margin-bottom: 0;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-cloud span {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
}

.photo-feature figure,
.photo-grid figure {
  position: relative;
  margin: 0;
  min-width: 0;
}

.photo-feature img {
  display: block;
  width: 100%;
  height: 520px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.photo-feature figcaption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(12px);
}

.photo-feature figcaption span,
.photo-feature figcaption em,
.photo-grid figcaption {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.photo-feature figcaption strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.photo-notes {
  display: grid;
  gap: 12px;
  align-content: start;
}

.photo-notes div {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, .02);
}

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

.photo-grid figcaption {
  margin-top: 8px;
}

.photo-grid a,
.photo-feature a {
  display: block;
}

.photo-entry-cover {
  margin: 0 0 28px;
}

.photo-entry-cover img {
  width: 100%;
  max-height: 680px;
  object-fit: cover;
  border-radius: 8px;
}

.archive-page,
.article-page {
  max-width: 980px;
  margin: 0 auto;
}

.post-list {
  display: grid;
  gap: 10px;
}

.post-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 17, .62);
}

.post-row time {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

.post-row h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
}

.post-row h2 a:hover {
  color: var(--accent);
}

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.article-header {
  padding: 34px 0 24px;
  border-bottom: 1px solid var(--border);
}

.article-body {
  padding-top: 24px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.35;
}

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(201, 126, 58, .35);
}

.article-body p,
.article-body li {
  color: var(--muted);
  line-height: 1.9;
}

.article-body code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #191919;
  color: #e6b078;
  font-family: var(--mono);
}

.article-body pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #080808;
}

.article-body img {
  display: block;
  max-width: 100%;
  margin: 18px auto;
  border-radius: 8px;
}

.pager {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.pager a,
.pager span {
  margin-right: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-dot {
  margin: 0 8px;
  color: #333;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .profile-panel,
  .resume-hero-card,
  .photo-feature,
  .split-section {
    grid-template-columns: 1fr;
  }

  .profile-stats {
    max-width: 420px;
  }

  .photo-feature img {
    height: 420px;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding-inline: 16px;
  }

  .site-header {
    gap: 16px;
  }

  .site-nav {
    gap: 10px;
  }

  .profile-panel {
    padding-top: 8px;
  }

  .profile-stats,
  .section-grid,
  .three-up,
  .link-row,
  .photo-grid {
    grid-template-columns: 1fr;
  }

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

  .timeline-item,
  .post-row {
    grid-template-columns: 1fr;
  }

  .page-title.with-actions {
    display: grid;
  }

  .photo-feature img {
    height: 360px;
  }

  .brand-copy em {
    display: none;
  }
}
