:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-elev: #fffaf3;
  --ink: #1c1612;
  --ink-soft: #5c5148;
  --line: #e3d7c8;
  --accent: #b33a28;
  --accent-ink: #8a2e1c;
  --seal: #b33a28;
  --seal-ink: #fffaf3;
  --code-bg: #efe4d6;
  --mark: #f3d2c6;
  --font: "PingFang TC", "PingFang HK", "Hiragino Sans CNS", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --measure: 38rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141210;
  --bg-elev: #1e1a17;
  --ink: #f6f1e8;
  --ink-soft: #d0c4b6;
  --line: #3c342c;
  --accent: #e07060;
  --accent-ink: #ffb2a6;
  --seal: #b33a28;
  --seal-ink: #fffaf3;
  --code-bg: #2a241f;
  --mark: #5a2e28;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141210;
    --bg-elev: #1e1a17;
    --ink: #f6f1e8;
    --ink-soft: #d0c4b6;
    --line: #3c342c;
    --accent: #e07060;
    --accent-ink: #ffb2a6;
    --seal: #b33a28;
    --seal-ink: #fffaf3;
    --code-bg: #2a241f;
    --mark: #5a2e28;
  }
}

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

html {
  font-size: 100%;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.75;
  line-break: strict;
  border-top: 6px solid var(--accent);
  accent-color: var(--seal);
}

main {
  flex: 1;
}

button,
input,
textarea {
  font: inherit;
}

::selection {
  background: var(--mark);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  transform: translateY(-160%);
  background: var(--seal);
  color: var(--seal-ink);
  padding: 0.55rem 0.8rem;
  z-index: 5;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

@media (min-width: 800px) {
  .wrap {
    width: min(1120px, calc(100% - 3rem));
  }
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand toggle"
    "nav nav";
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.9rem 0;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.seal {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  background: var(--seal);
  color: var(--seal-ink);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
}

.brand-zh {
  display: block;
  font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.brand-en {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
}

.nav a {
  color: inherit;
  text-decoration: none;
  padding: 0.4rem 0;
}

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

.nav a[aria-current="page"] {
  color: var(--accent-ink);
  border-bottom: 2px solid var(--accent);
}

.theme-toggle {
  display: none;
  grid-area: toggle;
  justify-self: end;
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  cursor: pointer;
}

html[data-js] .theme-toggle {
  display: inline-block;
}

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

@media (min-width: 800px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav toggle";
    padding: 1.1rem 0;
  }

  .nav {
    justify-content: flex-end;
  }
}

.hero {
  padding: 2.4rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.eyebrow-en {
  margin-right: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-zh {
  letter-spacing: 0.06em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 12vw, 5.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.hero h1::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 0.42rem;
  margin-top: 0.85rem;
  background: var(--accent);
}

.tagline {
  max-width: 12em;
  margin: 1.1rem 0 0;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 650;
  line-height: 1.55;
}

.latest {
  display: grid;
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.latest article {
  padding: 1.5rem 0;
}

.latest article + article {
  border-top: 1px solid var(--line);
}

@media (min-width: 800px) {
  .hero {
    padding: 3.4rem 0 2.6rem;
  }

  .latest {
    grid-template-columns: 1.4fr 0.9fr;
    column-gap: 3rem;
  }

  .latest article + article {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-left: 3rem;
  }
}

.clip {
  display: flex;
  justify-content: center;
  margin: 0 0 0.4rem;
}

.clip video {
  display: block;
  width: 100%;
  max-width: 22.5rem;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--bg-elev);
}

.featured-artwork {
  width: min(100%, 560px);
  margin: 1.35rem auto;
  padding: 8px 8px 12px;
  background: #f3ead8;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(120, 86, 48, 0.1), 0 10px 24px rgba(28, 22, 18, 0.12);
}

.featured-artwork img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.featured-artwork figcaption {
  margin: 0.7rem 0 0;
  color: #1c1612;
  text-align: center;
  line-height: 1.45;
}

.featured-artwork-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.featured-artwork-en {
  display: block;
  margin-top: 0.12rem;
  color: #5c5148;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
}

@media (prefers-reduced-motion: no-preference) {
  .featured-artwork {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
  }

  .featured-artwork:hover {
    transform: translateY(-4px);
    box-shadow: 0 1px 0 rgba(120, 86, 48, 0.1), 0 16px 32px rgba(28, 22, 18, 0.16);
  }
}

.news-today {
  margin: 0 0 1.35rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.news-today a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.news-today a:hover {
  color: var(--ink);
}

.write-me {
  display: flex;
  justify-content: center;
  margin: 0.9rem 0 1.2rem;
}

.write-me a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--seal);
  background: var(--seal);
  color: var(--seal-ink);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.write-me a:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--bg);
}

.kicker {
  margin: 0;
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.kicker-en {
  margin-left: 0.35rem;
  color: var(--ink-soft);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.latest h2,
.listing h2 {
  margin: 0.3rem 0 0.45rem;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  line-height: 1.35;
  text-wrap: balance;
}

.latest h2 a,
.listing h2 a {
  color: var(--ink);
  text-decoration: none;
}

.latest h2 a:hover,
.listing h2 a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.excerpt {
  max-width: 40rem;
  margin: 0.55rem 0 0;
  line-height: 1.75;
}

.more {
  margin: 0.9rem 0 0;
  font-weight: 700;
}

.more a,
.prose a,
.back a,
.site-footer a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.block {
  max-width: var(--measure);
  padding-top: 2.2rem;
}

.block h2,
.page-header h1,
.post-header h1 {
  text-wrap: balance;
}

.block h2 {
  margin: 0 0 0.55rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.block p {
  margin: 0 0 0.85rem;
  line-height: 1.85;
}

.page-header {
  padding: 2rem 0 1.15rem;
}

.page-header h1,
.post-header h1 {
  margin: 0.3rem 0 0;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

.lede {
  max-width: var(--measure);
  margin: 0.8rem 0 0;
  line-height: 1.75;
}

.listing {
  list-style: none;
  margin: 0;
  padding: 0;
}

.listing li {
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}

.thumb {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--bg-elev);
}

.latest .thumb {
  aspect-ratio: 3 / 2;
  margin: 0.85rem 0 0.2rem;
}

.listing .thumb {
  aspect-ratio: 16 / 9;
  margin-bottom: 0.85rem;
}

@media (min-width: 800px) {
  .listing li:has(.thumb) {
    display: grid;
    grid-template-columns: 8.75rem minmax(0, 1fr);
    column-gap: 1.2rem;
    align-items: start;
  }

  .listing .thumb {
    aspect-ratio: 1;
    margin-bottom: 0;
  }
}

.empty {
  margin-top: 1.5rem;
}

.post {
  padding-top: 2rem;
}

.post-header {
  max-width: var(--measure);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.tags li {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.875rem;
  padding: 0.05rem 0.45rem;
}

.prose {
  max-width: var(--measure);
  margin-top: 1.6rem;
  font-size: 1.1875rem;
  line-height: 1.9;
  text-wrap: pretty;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose small {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.prose p:has(small) {
  margin-top: 2rem;
  margin-bottom: 0;
}

.prose h2 {
  margin: 1.8em 0 0.55em;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
}

.prose h3 {
  margin: 1.5em 0 0.45em;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li::marker {
  color: var(--accent);
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 0.1em 0 0.1em 1em;
  border-left: 3px solid var(--accent);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose a:hover {
  color: var(--ink);
}

.prose strong {
  font-weight: 800;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose figure {
  margin: 1.35em 0 1.45em;
}

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

@media (max-width: 799px) {
  .prose figure img,
  .post-cover img,
  .thumb {
    width: 100%;
  }
}

.post-cover {
  max-width: var(--measure);
  margin: 1.35rem 0 0;
}

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

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.prose :not(pre) > code {
  background: var(--code-bg);
  padding: 0.08em 0.35em;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--code-bg);
  line-height: 1.6;
  font-size: 0.92rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.35rem;
  text-align: left;
  vertical-align: top;
}

.prose figcaption {
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}

.back {
  margin: 2.4rem 0 0;
}

.news-group {
  max-width: 42rem;
  margin: 0;
  padding: 1.25rem 0 0.15rem;
  border-top: 1px solid var(--line);
}

.news-group h2 {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.news-group ol {
  margin: 0;
  padding-left: 1.65rem;
}

.news-group li {
  margin: 0;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}

.news-group li:last-child {
  border-bottom: 0;
}

.news-group li::marker {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.news-group a {
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}

.news-group a:hover {
  color: var(--ink);
}

.news-group small {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.45;
}

.news-archive {
  max-width: 42rem;
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.news-archive a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}

.news-archive a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.signup {
  max-width: var(--measure);
}

.signup form {
  margin: 0;
}

.signup label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.signup input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.signup input::placeholder {
  color: var(--ink-soft);
}

.signup button {
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--seal);
  background: var(--seal);
  color: var(--seal-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.signup button:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.signup-note {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

.signup-compact {
  margin-top: 0.4rem;
}

.post .signup-compact {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

main .wrap {
  padding-bottom: 3rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.4rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0.3rem 0;
}

.views {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.meta .views {
  margin-left: 0.75rem;
}

.site-footer .views {
  margin: 0.35rem 0 0;
}

.footer-name {
  color: var(--ink);
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0.55rem 0;
  padding: 0;
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--accent-ink);
}

.x-ticker {
  border-bottom: 1px solid #111;
  background: #ffe600;
  color: #111;
  max-width: 100%;
}

.x-ticker[hidden] {
  display: none !important;
}

.x-ticker-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.x-ticker-label {
  flex: none;
  margin: 0;
  color: #111;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

.x-ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.x-ticker-track {
  display: flex;
  width: max-content;
  animation: x-ticker-scroll var(--x-ticker-duration, 28s) linear infinite;
}

.x-ticker:hover .x-ticker-track,
.x-ticker:focus-within .x-ticker-track {
  animation-play-state: paused;
}

.x-ticker-list {
  display: flex;
  align-items: center;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.x-ticker-list li {
  display: flex;
  align-items: center;
  flex: none;
}

.x-ticker-list li::after {
  content: "";
  width: 0.28rem;
  height: 0.28rem;
  margin-inline: 0.9rem;
  border-radius: 50%;
  background: #111;
  flex: none;
}

.x-ticker a,
.x-ticker a:visited {
  color: #111;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.x-ticker a:hover {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

@keyframes x-ticker-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .x-ticker-track {
    animation: none;
    transform: none;
    width: 100%;
  }

  .x-ticker-list[aria-hidden="true"] {
    display: none;
  }

  .x-ticker-list:not([aria-hidden="true"]) {
    width: 100%;
    min-width: 0;
  }

  .x-ticker-list:not([aria-hidden="true"]) li:not(:first-child) {
    display: none;
  }

  .x-ticker-list:not([aria-hidden="true"]) li::after {
    content: none;
    width: 0;
    height: 0;
    margin: 0;
  }

  .x-ticker-list:not([aria-hidden="true"]) li:first-child {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .x-ticker-list:not([aria-hidden="true"]) li:first-child a {
    display: block;
    max-width: 100%;
    white-space: normal;
  }
}

@media (forced-colors: active) {
  .seal,
  .x-ticker {
    border: 1px solid ButtonText;
  }

  .x-ticker-list li::after {
    background: ButtonText;
  }

  :focus-visible {
    outline: 3px solid Highlight;
  }
}

@media print {
  body {
    border-top: 0;
    background: white;
    color: black;
  }

  .theme-toggle,
  .skip,
  .site-footer,
  .back,
  .nav,
  .x-ticker {
    display: none;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
