:root {
  color-scheme: light;
  --content-max-width: 720px;
  --color-bg: #fbfaf8;
  --color-text: #1f1c1a;
  --color-muted: #6b645d;
  --color-accent: #a6512c;
  --color-border: #e6e1da;
  font-size: 17px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.75;
  word-break: break-word;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.site-brand {
  font-weight: 700;
  color: var(--color-text);
  font-size: 1.1rem;
}

/* Hero */
.hero {
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 26, 0.42);
  z-index: 1;
}
.hero-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 300px;
  max-height: 60vh;
  object-fit: cover;
}
.hero-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  color: #fff;
}
.hero-text h1 {
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  margin: 0 0 12px;
  line-height: 1.3;
  white-space: pre-wrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-text p {
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  font-size: clamp(0.92rem, 2.5vw, 1.05rem);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 24px 0 40px;
}
@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text);
  background: #fff;
}
.card:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}
.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-border);
}
.card-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-border), #fff);
}
.card-body {
  padding: 18px;
}
.card-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.card-excerpt {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 0.95rem;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--color-muted);
}
/* Post */
.post-title {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  line-height: 1.35;
  margin: 28px 0 8px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.post-dates {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.post-content {
  font-size: 1.05rem;
}
.post-content img,
.post-content video,
.post-content iframe,
.post-content table,
.post-content pre {
  max-width: 100%;
}
.post-content pre {
  overflow-x: auto;
}
.post-content table {
  display: block;
  overflow-x: auto;
}
/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 20px 40px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}
.site-footer p {
  margin: 4px 0;
}
