:root {
  --page: #e7e7e7;
  --card: #f5f5f5;
  --ink: #15191e;
  --muted: #425066;
  --quiet: #78808a;
  --line: #d1d2d3;
  --accent: #24543d;
  --max: 1200px;
}

[data-theme="dark"] {
  --page: #141517;
  --card: #1c1d21;
  --ink: #f0f1f3;
  --muted: #9ba1a9;
  --quiet: #6d737d;
  --line: #2e3036;
  --accent: #5bb389;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #141517;
    --card: #1c1d21;
    --ink: #f0f1f3;
    --muted: #9ba1a9;
    --quiet: #6d737d;
    --line: #2e3036;
    --accent: #5bb389;
  }
}

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

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

/* ================= Header ================= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-mark {
  color: var(--accent);
  font-size: 21px;
  line-height: 0;
  margin-left: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s;
  position: relative;
}

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

.nav-link.active {
  color: var(--ink);
  font-weight: 600;
}

.theme-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.theme-btn svg {
  width: 15px;
  height: 15px;
}

main {
  width: 100%;
  flex: 1;
}

/* ================= Homepage ================= */
.home {
  padding-top: 16px;
  padding-bottom: 24px;
}

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

.entry-card {
  position: relative;
  min-height: 89px;
  padding: 16px 23px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.entry-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-title {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.card-description {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.card-status {
  margin-top: 10px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--quiet);
  font-size: 10px;
  line-height: 1.4;
}

/* ================= Footer ================= */
.site-footer {
  width: min(var(--max), calc(100% - 32px));
  min-height: 80px;
  margin: 40px auto 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-icon-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 36px;
}

.footer-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: color 0.15s, transform 0.15s;
}

.footer-icon:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-icon svg {
  width: 28px;
  height: 28px;
}

/* ================= Listings (Projects, Artworks, Posts) ================= */
.page-heading {
  padding: 15px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h1, .article-header h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.25;
  color: var(--ink);
}

.heading-period {
  color: var(--accent);
}

.page-heading-row > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.list-intro {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.project-grid, .artwork-grid {
  padding-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 110px;
  padding: 16px 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-card-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-index {
  color: var(--quiet);
  font-size: 10px;
}

.project-card h2, .project-card h3 {
  margin: 4px 0 2px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink);
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.post-list {
  margin: 0 auto 25px;
  border-top: 1px solid var(--line);
}

.post-row {
  min-height: 57px;
  padding: 12px 6px;
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.15s;
}

.post-row:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .post-row:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.post-row time {
  color: var(--quiet);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.post-row > span {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.15s;
}

.post-row:hover > span {
  color: var(--accent);
}

/* ================= Artworks ================= */
.artwork-card {
  display: block;
}

.artwork-image {
  position: relative;
  aspect-ratio: 1.35;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.artwork-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artwork-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--quiet);
  font-size: 12px;
  text-align: center;
}

.placeholder-mark {
  color: var(--accent);
  font-size: 22px;
}

.artwork-placeholder code {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 4px;
  border-radius: 4px;
}

.artwork-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

.artwork-meta time, .artwork-medium {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 400;
}

.artwork-medium {
  display: block;
  margin-top: 2px;
}

/* ================= Single Article & Pages ================= */
.article {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.article-header {
  margin: 0 0 24px;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--quiet);
  font-size: 13px;
  transition: color 0.15s;
}

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

.article-date {
  display: inline-block;
  margin-top: 8px;
  color: var(--quiet);
  font-size: 12px;
}

.status {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--quiet);
  font-size: 10px;
}

.article-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.article-artwork {
  margin: 0 0 24px;
}

.article-artwork img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: contain;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.article-artwork figcaption {
  margin-top: 6px;
  color: var(--quiet);
  font-size: 12px;
}

.content-body {
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.85;
}

.content-body h2 {
  margin: 1.8em 0 0.5em;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3em;
}

.content-body h3 {
  margin: 1.4em 0 0.4em;
  font-size: 17px;
  font-weight: 650;
}

.content-body p, .content-body ul, .content-body ol {
  margin: 0 0 1.15em;
}

.content-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.content-body li {
  margin: 0.35em 0;
}

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

.content-body blockquote {
  margin: 20px 0;
  padding: 6px 0 6px 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 6px 6px 0;
}

[data-theme="dark"] .content-body blockquote {
  background: rgba(255, 255, 255, 0.02);
}

.content-body pre {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}

.content-body code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--card);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.content-body pre code {
  background: none;
  padding: 0;
}

/* ================= About Page ================= */
.about-page {
  max-width: 660px;
}

.about-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}

.about-monogram {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.about-meta div {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.about-meta div span {
  color: var(--quiet);
  font-size: 11px;
}

.contact-card {
  margin-top: 28px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  transition: border-color 0.15s, transform 0.15s;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.contact-card strong {
  font-size: 13px;
  color: var(--accent);
}

/* ================= Responsive ================= */
@media (max-width: 640px) {
  .wrap, .site-header, .site-footer, .page-heading, .project-grid, .artwork-grid, .post-list, .list-intro {
    width: calc(100% - 28px);
  }

  .site-header {
    min-height: 56px;
    align-items: center;
    padding: 8px 0 10px;
  }

  .brand {
    font-size: 15px;
  }

  .site-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 13px;
  }

  .home {
    padding-top: 14px;
  }

  .card-grid, .project-grid, .artwork-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .entry-card {
    min-height: 85px;
    padding: 14px 17px 12px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-description {
    font-size: 13px;
  }

  .site-footer {
    min-height: 72px;
    margin-top: 28px;
  }

  .footer-icon-dock {
    gap: 28px;
  }

  .footer-icon, .footer-icon svg {
    width: 24px;
    height: 24px;
  }

  .page-heading {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .page-heading-row {
    display: block;
  }

  .page-heading-row > p {
    margin-top: 5px;
    font-size: 12px;
  }

  .page-heading h1, .article-header h1 {
    font-size: 24px;
  }

  .project-card {
    min-height: 100px;
    padding: 14px 17px 12px;
  }

  .project-card h2, .project-card h3 {
    font-size: 16px;
  }

  .project-card p {
    font-size: 13px;
  }

  .post-row {
    grid-template-columns: 85px 1fr;
    gap: 10px;
    min-height: 52px;
  }

  .post-row time {
    font-size: 11px;
  }

  .post-row > span {
    font-size: 14px;
  }

  .article {
    padding-top: 18px;
    padding-bottom: 36px;
  }

  .back-link {
    margin-bottom: 12px;
  }

  .content-body {
    font-size: 14.5px;
  }

  .artwork-grid {
    padding-bottom: 20px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
