:root {
  --bg: #f8f7f2;
  --surface: #ffffff;
  --ink: #2f3430;
  --muted: #6e756f;
  --sage: #7e9278;
  --sage-soft: #e5ebe2;
  --line: #e1ded4;
  --cream: #f2e9d6;
  --bluegray: #dde6e8;
  --clay: #ebd9cc;
  --shadow: 0 14px 36px rgba(47, 52, 48, .08);
  --page: 1120px;
  --reading: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.78;
}

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

.prototype-header,
.prototype-footer,
.prototype-main {
  width: min(var(--page), calc(100% - 40px));
  margin: 0 auto;
}

.prototype-header {
  padding: 28px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.site-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.prototype-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
}

.prototype-nav a {
  position: relative;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.prototype-nav a:hover,
.prototype-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.prototype-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--sage);
}

.prototype-main { padding: 36px 0 60px; }

.content-shell {
  width: min(var(--reading), 100%);
  margin: 0 auto;
}

.wide-shell {
  width: min(var(--page), 100%);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 700;
}

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

.kicker {
  margin: 0 0 10px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 700;
}

.content-title {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.16;
  font-weight: 500;
}

.content-summary {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.meta-row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--ink);
  font-size: 13px;
}

.tag.reading { background: var(--cream); }
.tag.life { background: var(--bluegray); }
.tag.hobby { background: var(--clay); }

.prototype-cover,
.photo-block,
.project-visual,
.travel-photo,
.collection-photo {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.prototype-cover {
  margin: 34px 0;
  aspect-ratio: 16 / 8;
  background:
    linear-gradient(90deg, rgba(126, 146, 120, .12) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(rgba(126, 146, 120, .12) 1px, transparent 1px) 0 0 / 44px 44px,
    #fffdf8;
  position: relative;
}

.prototype-cover::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 24%;
  height: 12px;
  border-radius: 999px;
  background: rgba(126, 146, 120, .38);
  box-shadow: 0 -34px 0 rgba(235, 217, 204, .7), 0 -68px 0 rgba(221, 230, 232, .7);
}

.reading-body {
  color: var(--ink);
  font-size: 18px;
}

.reading-body h2 {
  margin: 42px 0 12px;
  font-size: 28px;
  line-height: 1.32;
}

.reading-body p { margin: 18px 0; }

.quote-block,
.note-block,
.tip-block {
  margin: 28px 0;
  padding: 20px 22px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.quote-block {
  border-left: 4px solid var(--sage);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.6;
}

.note-block strong,
.tip-block strong { color: var(--sage); }

.code-block {
  margin: 26px 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: 8px;
  background: #2f3430;
  color: #f8f7f2;
  font-size: 14px;
  line-height: 1.65;
}

.content-table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 15px;
}

.content-table th,
.content-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.content-table th { background: var(--sage-soft); }

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  gap: 34px;
  align-items: center;
}

.project-visual {
  min-height: 340px;
  background:
    linear-gradient(135deg, rgba(126, 146, 120, .16), transparent 55%),
    linear-gradient(90deg, #fff 12%, transparent 12% 18%, #fff 18% 30%, transparent 30%),
    #f2e9d6;
  position: relative;
}

.project-visual::after {
  content: "";
  position: absolute;
  inset: 42px;
  border: 1px solid rgba(47, 52, 48, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
}

.project-sections {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-note {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-note h2,
.project-note h3 { margin: 0 0 10px; }

.image-grid,
.travel-grid,
.collection-grid {
  display: grid;
  gap: 16px;
}

.image-grid {
  margin-top: 26px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.travel-grid {
  margin: 34px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.travel-photo,
.photo-block,
.collection-photo {
  min-height: 220px;
  background: var(--bluegray);
}

.travel-photo:nth-child(2n),
.photo-block:nth-child(2n),
.collection-photo:nth-child(2n) { background: var(--cream); }

.travel-photo:nth-child(3n),
.photo-block:nth-child(3n),
.collection-photo:nth-child(3n) { background: var(--clay); }

.map-placeholder {
  margin: 28px 0;
  padding: 22px;
  border: 1px dashed #c7c7bd;
  border-radius: 8px;
  background: rgba(255, 255, 255, .6);
  color: var(--muted);
}

.photo-diary {
  display: grid;
  gap: 34px;
}

.photo-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: end;
}

.photo-block { min-height: 460px; }

.photo-caption h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.collection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  margin-top: 34px;
}

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

.collection-info {
  position: sticky;
  top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  font-size: 15px;
}

.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; }

.article-navigation,
.related-section {
  width: min(var(--reading), 100%);
  margin: 46px auto 0;
}

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

.article-navigation a {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
  color: var(--ink);
}

.article-navigation span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.related-section {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.related-section h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
}

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

.related-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(47, 52, 48, .05);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: #d4d9cf;
  box-shadow: var(--shadow);
}

.related-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--sage-soft);
}

.related-cover::before,
.related-cover::after {
  content: "";
  position: absolute;
}

.related-cover::before {
  left: 12%;
  right: 12%;
  top: 20%;
  height: 52%;
  border: 1px solid rgba(47, 52, 48, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .54);
}

.related-cover::after {
  left: 20%;
  right: 20%;
  bottom: 22%;
  height: 8px;
  border-radius: 999px;
  background: rgba(126, 146, 120, .48);
  box-shadow: 0 18px 0 rgba(47, 52, 48, .08), 0 -18px 0 rgba(255, 255, 255, .66);
}

.related-cover.project { background: var(--cream); }
.related-cover.travel { background: var(--bluegray); }
.related-cover.collection { background: var(--clay); }
.related-cover.photo { background: #e3e6e7; }

.related-body {
  padding: 18px;
}

.related-body h3 {
  margin: 14px 0 0;
  font-size: 20px;
  line-height: 1.45;
}

.related-body time {
  display: block;
  margin-top: 14px;
  color: #8b918c;
  font-size: 13px;
}

.prototype-footer {
  padding: 24px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
}

@media (max-width: 900px) {
  .prototype-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-hero,
  .collection-layout,
  .photo-entry {
    grid-template-columns: 1fr;
  }

  .project-sections,
  .image-grid,
  .travel-grid,
  .collection-grid,
  .article-navigation,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .collection-info { position: static; }
}

@media (max-width: 560px) {
  .prototype-header,
  .prototype-footer,
  .prototype-main {
    width: min(100% - 28px, var(--page));
  }

  .prototype-nav a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .content-title { font-size: 36px; }
  .content-summary { font-size: 17px; }
  .reading-body { font-size: 17px; }
  .photo-block { min-height: 320px; }
}
