/* me.muqi.ai — 藏青 / 朱红 / 奶油，丝网海报气质。无外部字体与资源。 */
:root {
  --navy: #1f3a6e;
  --night: #14264a;
  --red: #d8392b;
  --cream: #f4ead8;
  --amber: #f2a516;

  --bg: #f4ead8;
  --fg: #1f3a6e;
  --muted: #55648a;
  --rule: #d8c9ab;
  --accent: #d8392b; /* 色块、粗线 */
  --accent-ink: #b92c20; /* 小字号文字用，保证对比度 */
  --panel: #ebdfc8;
  --code-bg: #ebdfc8;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC',
    'Microsoft YaHei', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Songti SC',
    'Noto Serif SC', 'Source Han Serif SC', STSong, SimSun, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14264a;
    --fg: #f4ead8;
    --muted: #b3bcd0;
    --rule: #2f4577;
    --accent: #e2483a;
    --accent-ink: #f37a6c;
    --panel: #1b3260;
    --code-bg: #1b3260;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #14264a;
  --fg: #f4ead8;
  --muted: #b3bcd0;
  --rule: #2f4577;
  --accent: #e2483a;
  --accent-ink: #f37a6c;
  --panel: #1b3260;
  --code-bg: #1b3260;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 6.5rem;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.8;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  height: auto;
}
/* 图片加载失败（或尚未生成）时隐藏破图标记，由容器底色占位 */
img.img-missing {
  visibility: hidden;
}

/* 语言切换：无 JS 时 <html lang="zh-CN">，只显示中文 */
html[lang|='en'] [data-i18n='zh'],
html:not([lang|='en']) [data-i18n='en'] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.24em;
}
a:hover {
  color: var(--accent-ink);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--bg);
  padding: 0.25rem 0.6rem;
  z-index: 30;
}

.wrap {
  max-width: 65rem; /* 1040px */
  margin: 0 auto;
  padding: 0 1.5rem;
}
.wrap.narrow {
  max-width: 45rem;
}

/* 顶栏 + 页内导航 */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 3px solid var(--fg);
}
.bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  min-height: 3.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--navy);
  overflow: hidden;
  flex: none;
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nav {
  display: flex;
  gap: 0.25rem 1.4rem;
  margin-left: auto;
  font-size: 0.925rem;
  white-space: nowrap;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.nav a:hover {
  color: inherit;
  border-bottom-color: var(--accent);
}
.controls {
  display: none;
  gap: 0.25rem;
  margin-left: auto;
}
.nav + .controls {
  margin-left: 0;
}
.js .controls {
  display: flex;
}
.controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.controls button:hover {
  color: var(--accent-ink);
}
.controls svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* Hero：通栏头图，始终深色 */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(24rem, 46vw, 34rem);
  background: var(--night);
  color: var(--cream);
  overflow: hidden;
  border-bottom: 6px solid var(--red);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% center;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(20, 38, 74, 0.94) 0%,
    rgba(20, 38, 74, 0.78) 34%,
    rgba(20, 38, 74, 0) 68%
  );
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.hero-text {
  max-width: 31rem;
}
.avatar {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  border: 4px solid var(--cream);
  background: var(--navy);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--red);
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
}
html:not([lang|='en']) .hero h1 {
  letter-spacing: 0.1em;
}
.alt-name {
  margin: 0.6rem 0 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
  opacity: 0.82;
}
.tagline {
  margin: 1.5rem 0 0;
  font-size: 1.25rem;
  line-height: 1.6;
}
.location {
  display: inline-block;
  margin: 1.25rem 0 0;
  padding: 0.1rem 0.7rem;
  background: var(--red);
  color: var(--cream);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* 分区 */
.sec {
  padding: 4.5rem 0 4rem;
}
.sec + .sec {
  border-top: 3px solid var(--fg);
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 2.25rem;
}
.sec-no {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.sec-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 4.2vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.sec p {
  margin: 0 0 1em;
}
.sec p:last-child {
  margin-bottom: 0;
}
.measure {
  max-width: 36em;
}
.lede {
  font-size: 1.15rem;
  line-height: 1.75;
}
h3 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.35;
}
.kicker {
  margin: 0 0 0.75rem !important;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* 图文交错 */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: 3.5rem;
  align-items: start;
}
.split.flip {
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
}
.split + .split {
  margin-top: 4rem;
}
.fig {
  margin: 0 10px 10px 0;
  aspect-ratio: 4 / 3;
  background: var(--navy);
  box-shadow: 10px 10px 0 var(--accent);
  overflow: hidden;
}
.fig.amber {
  box-shadow: 10px 10px 0 var(--amber);
}
.fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 经历 */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.timeline li:first-child {
  border-top: 0;
  padding-top: 0;
}
.timeline li:last-child {
  padding-bottom: 0;
}
.when {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}

/* 分享与报道 */
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 3.5rem;
}
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rows li {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.rows li:first-child {
  border-top: 3px solid var(--fg);
}
.rows .yr {
  font-family: var(--serif);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.row-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.5;
}
.row-meta {
  margin: 0.3rem 0 0 !important;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

/* 项目 */
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 3.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.projects li {
  padding: 1.4rem 0 1.6rem;
  border-top: 3px solid var(--fg);
}
.proj-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
}
.proj-lang {
  margin-left: 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.projects p {
  margin: 0.5rem 0 0 !important;
  font-size: 0.975rem;
  line-height: 1.75;
}

/* 工具与工作流 */
.defs {
  margin: 0;
}
.defs > div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0 1.25rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}
.defs > div:first-child {
  border-top: 3px solid var(--fg);
}
.defs dt {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.65;
}
.defs dd {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.75;
}
.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}
.rules li {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  counter-increment: rule;
}
.rules li:first-child {
  border-top: 3px solid var(--fg);
}
.rules li::before {
  content: counter(rule, decimal-leading-zero);
  font-family: var(--serif);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.colophon {
  max-width: 44rem;
  margin: 2.5rem 0 0 !important;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--accent);
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--muted);
}
.colophon strong {
  color: var(--fg);
}

/* 赛事记录 */
.races {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.races li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}
.races li:first-child {
  border-top: 3px solid var(--fg);
}
.races li:last-child {
  border-bottom: 1px solid var(--rule);
}
.races .yr {
  font-family: var(--serif);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.race-name {
  margin-right: 0.6em;
  font-family: var(--serif);
  font-weight: 700;
}
.status {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: 0.1em;
}
.status.done {
  border-color: var(--red);
  background: var(--red);
  color: var(--cream);
}

/* 书单 */
.books {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.books li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  line-height: 1.6;
}
.books li:last-child {
  border-bottom: 1px solid var(--rule);
}
.books .t {
  font-family: var(--serif);
  font-weight: 600;
}
.books .a {
  font-size: 0.9rem;
  color: var(--muted);
}

/* 笔记 */
.disclaimer {
  max-width: 44rem;
  margin: 0 0 1.75rem;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--accent);
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--muted);
}
.disclaimer p {
  margin: 0;
}
.note-group + .note-group {
  margin-top: 2.75rem;
}
.note-group .kicker {
  font-family: var(--sans);
  line-height: 1.8;
}
.note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 3.5rem;
  margin: 0;
  padding: 0;
  border-top: 3px solid var(--fg);
  list-style: none;
}
.note-item {
  padding: 1.1rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.note-link {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}
.note-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
.note-summary {
  margin: 0.35rem 0 0 !important;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
}
.note-meta {
  margin: 0.4rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.badge {
  margin-left: 0.6em;
  padding: 0.05em 0.5em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* 联系 */
.contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact li {
  padding: 1rem 0 0;
  border-top: 3px solid var(--fg);
}
.contact .k {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.contact a {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}

footer {
  border-top: 3px solid var(--fg);
  padding: 1.75rem 0 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* 笔记页 */
.note-head {
  padding: 3rem 0 0;
}
.note-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.35;
}
.note-head .note-meta {
  margin: 1rem 0 1.75rem !important;
  font-size: 0.85rem;
}
.note-head .disclaimer {
  margin-bottom: 0.9rem;
}
.note-source {
  max-width: 44rem;
  margin: 0 0 1.75rem;
  padding-left: calc(1rem + 3px);
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--muted);
}
.note-preface {
  font-size: 0.925rem;
  color: var(--muted);
}
.prose {
  max-width: 40em; /* 约 40 个汉字 */
  padding: 1rem 0 3rem;
}
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.4;
  margin: 2.4em 0 0.8em;
}
.prose h2 {
  font-size: 1.4rem;
}
.prose h3 {
  font-size: 1.17rem;
}
.prose h4 {
  font-size: 1.05rem;
}
.prose > :first-child {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose .table-wrap {
  margin: 0 0 1.15em;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin: 0.3em 0;
}
.prose li > ul,
.prose li > ol {
  margin: 0.3em 0;
}
.prose li:has(> input[type='checkbox']) {
  list-style: none;
  margin-left: -1.4em;
}
.prose li > input[type='checkbox'] {
  margin: 0 0.5em 0 0;
}
.prose strong {
  font-weight: 650;
}
.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.prose blockquote {
  padding: 0.1em 0 0.1em 1em;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
.prose blockquote > :last-child {
  margin-bottom: 0;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 0.12em 0.35em;
  background: var(--code-bg);
  border-radius: 3px;
}
.prose pre {
  padding: 1rem 1.1rem;
  background: var(--code-bg);
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}
.prose pre code {
  padding: 0;
  background: none;
  font-size: 0.82rem;
  white-space: pre;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.925rem;
  line-height: 1.6;
}
.prose th,
.prose td {
  padding: 0.55em 0.9em 0.55em 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  min-width: 6em;
}
.prose th {
  font-weight: 600;
  border-bottom-color: var(--muted);
  white-space: nowrap;
}

/* 404 */
.lost {
  padding: 6rem 0 5rem;
}
.lost h1 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: 4rem;
  line-height: 1.1;
  color: var(--accent-ink);
}

@media (max-width: 56rem) {
  .split,
  .split.flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }
  .split .fig {
    max-width: 30rem;
  }
  .cols,
  .projects,
  .note-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 45rem) {
  html {
    scroll-padding-top: 7rem;
  }
  .nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 0 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--rule);
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    margin-bottom: 0;
  }
  .nav + .controls {
    margin-left: auto;
  }
  /* 头图在上，文字在下，头像压在头图下沿 */
  .hero {
    display: block;
    min-height: 0;
  }
  .hero-img {
    position: static;
    display: block;
    aspect-ratio: 16 / 9;
    height: auto;
    object-position: center;
  }
  .hero::after {
    display: none;
  }
  .hero-inner {
    padding-top: 0;
    padding-bottom: 2.5rem;
  }
  .avatar {
    width: 6rem;
    height: 6rem;
    margin-top: -3rem;
    margin-bottom: 1.25rem;
  }
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }
  .contact li {
    padding-bottom: 1.25rem;
  }
}
@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }
  .wrap {
    padding: 0 1.25rem;
  }
  .sec {
    padding: 3rem 0 2.75rem;
  }
  .sec-head {
    margin-bottom: 1.5rem;
  }
  .tagline {
    font-size: 1.1rem;
  }
  .lede {
    font-size: 1.05rem;
  }
  .timeline li,
  .races li,
  .defs > div {
    grid-template-columns: minmax(0, 1fr);
  }
  .fig {
    box-shadow: 6px 6px 0 var(--accent);
    margin: 0 6px 6px 0;
  }
  .fig.amber {
    box-shadow: 6px 6px 0 var(--amber);
  }
}
@media print {
  .controls,
  .skip,
  .nav {
    display: none !important;
  }
  .site-head {
    position: static;
  }
}
