:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #dbe3ea;
  --accent: #ea580c;
  --accent-dark: #9a3412;
  --green: #166534;
  --green-soft: #dcfce7;
  --blue-soft: #e0f2fe;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(148, 163, 184, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.18) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
  color: var(--text);
  font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  align-items: center;
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 14px clamp(18px, 4vw, 56px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  align-items: center;
  background: var(--text);
  color: #fff;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

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

.site-nav a,
.site-footer a {
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent-dark);
}

main {
  display: grid;
  gap: 56px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1fr);
  min-height: calc(100vh - 67px);
  padding: clamp(30px, 6vw, 80px) clamp(18px, 4vw, 56px) 24px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 1;
  margin-bottom: 20px;
  max-width: 860px;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-text {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-action,
.secondary-action {
  border: 1px solid var(--text);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  padding: 10px 12px;
  text-decoration: none;
}

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

.primary-action:hover {
  background: var(--accent-dark);
}

.secondary-action:hover {
  background: var(--text);
  color: #fff;
}

.hero-media {
  margin: 0;
}

.hero-media img {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--text);
  box-shadow: var(--shadow);
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.progress-panel {
  background: var(--surface);
  border: 1px solid var(--text);
  box-shadow: var(--shadow);
  margin-top: 30px;
  max-width: 520px;
  padding: 22px;
}

.progress-number {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.progress-total,
#progress-label {
  color: var(--muted);
  font-weight: 700;
}

#progress-label {
  margin: 12px 0 0;
}

.progress-track {
  background: #e2e8f0;
  height: 12px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-track span {
  background: linear-gradient(90deg, var(--accent), var(--green));
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.latest-section,
.posts-section,
.about-section {
  padding: 0 clamp(18px, 4vw, 56px);
}

.section-heading {
  margin-bottom: 18px;
  max-width: 680px;
}

.featured-post {
  background: var(--surface);
  border: 1px solid var(--text);
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 36px);
}

.post-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-weight: 800;
  gap: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.status-pill {
  background: var(--green-soft);
  color: var(--green);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 4px 8px;
}

.status-pill.draft {
  background: var(--blue-soft);
  color: #075985;
}

.featured-post h3 {
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 0;
}

.post-body {
  color: var(--muted);
  display: grid;
  gap: 10px;
  max-width: 780px;
}

.post-body p {
  margin: 0;
}

.post-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-links a {
  border: 1px solid var(--text);
  font-weight: 800;
  padding: 8px 10px;
  text-decoration: none;
}

.post-links a:hover {
  background: var(--text);
  color: #fff;
}

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

.media-list img,
.media-list video {
  border: 1px solid var(--line);
  display: block;
  max-height: 620px;
  object-fit: cover;
  width: 100%;
}

.media-caption {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

.post-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  min-height: 168px;
  padding: 16px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.post-card strong {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.post-card:hover,
.post-card:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(234, 88, 12, 0.2);
  outline-offset: 2px;
}

.post-card.is-empty {
  background: #f1f5f9;
  color: #64748b;
  cursor: default;
}

.post-card.is-empty:hover,
.post-card.is-empty:focus {
  border-color: var(--line);
  outline: none;
}

.post-card strong {
  display: block;
  font-size: 1rem;
}

.post-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

.about-section {
  padding-bottom: 42px;
}

.about-copy {
  border-top: 1px solid var(--line);
  max-width: 760px;
  padding-top: 28px;
}

.about-copy p:last-child {
  color: var(--muted);
  font-size: 1.08rem;
}

.post-page {
  display: block;
  padding: clamp(30px, 6vw, 80px) clamp(18px, 4vw, 56px) 56px;
}

.post-detail {
  background: var(--surface);
  border: 1px solid var(--text);
  display: grid;
  gap: 20px;
  margin: 0 auto;
  max-width: 980px;
  padding: clamp(22px, 4vw, 44px);
}

.post-detail h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  margin-bottom: 0;
}

.post-summary {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  font-weight: 700;
  margin: 0;
  max-width: 760px;
}

.post-hero-image {
  margin: 0;
}

.post-hero-image img {
  border: 1px solid var(--line);
  display: block;
  max-height: 680px;
  object-fit: cover;
  width: 100%;
}

.post-hero-image figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 8px;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 56px);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 34px;
  }

  .hero-media {
    order: -1;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }
}
