@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;500;600;700&display=swap');

:root {
  --teal: #5cc6b0;
  --teal-deep: #2f8b7b;
  --sand: #d4c4a8;
  --ink: #172623;
  --clay: #c67b5c;
  --olive: #6b7b3c;
  --paper: #f3ece0;
  --card: rgba(255, 252, 246, 0.66);
  --line: rgba(23, 38, 35, 0.14);
  --radius: 18px;
  --shadow: 0 20px 44px -34px rgba(23, 38, 35, 0.85);
  --serif: "Noto Serif TC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background:
    radial-gradient(1200px 640px at 90% -10%, rgba(92, 198, 176, 0.22), transparent 62%),
    radial-gradient(940px 560px at 4% 2%, rgba(212, 196, 168, 0.58), transparent 64%),
    linear-gradient(180deg, #f8f2e7 0%, #f2eadc 44%, #ebe1d1 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='.32'/%3E%3C/svg%3E");
}

a {
  color: var(--teal-deep);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 3px;
}

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

/* 页头 */
.masthead {
  display: flex;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem clamp(1rem, 4vw, 2rem) 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(23, 38, 35, 0.22);
}

.mark-dot {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 52% 44% 58% 46%;
  background: radial-gradient(circle at 32% 28%, var(--teal), var(--teal-deep));
  box-shadow: inset 0 0 0 1px rgba(23, 38, 35, 0.18);
}

/* 粘性小节条 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 1px solid rgba(212, 196, 168, 0.72);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 242, 231, 0.88);
  backdrop-filter: blur(10px);
}

.navbar ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.18rem;
  margin: 0 auto;
  padding: 0.34rem clamp(0.6rem, 4vw, 2rem);
  max-width: 1120px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
}

.navbar li {
  flex: 0 0 auto;
}

.navbar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.72rem;
  border-radius: 999px;
  color: #2c3d37;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.25s ease-out, color 0.25s ease-out;
}

.navbar a::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--clay);
  opacity: 0.72;
}

.navbar a:hover,
.navbar a:focus-visible {
  background: rgba(92, 198, 176, 0.2);
}

.navbar a[aria-current="true"] {
  background: rgba(92, 198, 176, 0.28);
  color: var(--ink);
  font-weight: 500;
}

/* 版心 */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: 2.6rem;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.8rem) clamp(1rem, 4vw, 2rem) 3.4rem;
}

article {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 首屏 */
.hero {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 3vw, 2rem);
  min-height: 68vh;
  padding: 1.6rem 0 0.6rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.95rem;
  max-width: 34rem;
  text-align: right;
}

.eyebrow {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.34em;
  color: var(--clay);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5.4vw, 3.2rem);
  line-height: 1.26;
  letter-spacing: 0.015em;
}

.hero-sub {
  margin: 0;
  max-width: 30rem;
  color: #42544d;
  font-size: 1rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 0.3rem;
  padding: 0 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #f7f1e6;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.3s ease-out, border-color 0.3s ease-out, transform 0.3s ease-out;
}

.hero-cta:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  transform: translateY(-2px);
}

.hero-art-wrap {
  flex: 0 0 auto;
}

.hero-art {
  width: clamp(110px, 15vw, 168px);
  height: auto;
  border-radius: 26px 13px 26px 13px;
  border: 1px solid rgba(23, 38, 35, 0.16);
  box-shadow: var(--shadow);
}

/* 正文区块 */
article > section:not(.hero) {
  scroll-margin-top: 5.6rem;
  padding: clamp(1.15rem, 2.6vw, 1.9rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

article > section:not(.hero) h2 {
  margin: 0 0 0.85rem;
  padding-left: 0.85rem;
  border-left: 4px solid var(--sand);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 1.62rem);
  line-height: 1.42;
  letter-spacing: 0.01em;
}

article > section:not(.hero) h3 {
  margin: 1.35rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.5;
  color: #22332d;
}

article p {
  margin: 0 0 0.95rem;
}

article p:last-child {
  margin-bottom: 0;
}

article ul,
article ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

article li {
  margin-bottom: 0.4rem;
}

article li::marker {
  color: var(--clay);
}

article blockquote {
  margin: 1.1rem 0;
  padding: 0.8rem 1.1rem;
  border-left: 3px solid var(--teal);
  border-radius: 0 14px 14px 0;
  background: rgba(212, 196, 168, 0.3);
  color: #2c3d37;
}

article strong {
  color: #14211d;
}

article code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(212, 196, 168, 0.5);
  font-size: 0.92em;
}

article img {
  margin: 1rem 0;
  border-radius: 14px;
  border: 1px solid var(--line);
}

/* 侧栏 */
.rail {
  position: sticky;
  top: 5rem;
  padding: 1.15rem 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 22px 12px 22px 12px;
  background: linear-gradient(160deg, rgba(212, 196, 168, 0.5), rgba(255, 253, 247, 0.68));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.rail h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.rail .subtitle {
  margin: 0.18rem 0 0.85rem;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #5b6b64;
}

.rail-list {
  counter-reset: railc;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list li a {
  display: block;
  min-height: 40px;
  padding: 0.46rem 0.55rem;
  border-radius: 12px;
  color: #2e3f39;
  font-size: 0.95rem;
  line-height: 1.5;
  text-decoration: none;
  transition: background 0.25s ease-out, color 0.25s ease-out;
}

.rail-list li a::before {
  counter-increment: railc;
  content: counter(railc) " · ";
  color: var(--clay);
  font-variant-numeric: tabular-nums;
}

.rail-list li a:hover {
  background: rgba(92, 198, 176, 0.2);
  color: var(--ink);
}

/* 页脚 */
footer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.4rem 2rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.4rem) clamp(1rem, 4vw, 2rem) 1.6rem;
  border-top: 1px solid rgba(212, 196, 168, 0.9);
  background: linear-gradient(180deg, rgba(212, 196, 168, 0.34), rgba(255, 253, 247, 0.1));
}

footer p {
  margin: 0;
}

.foot-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.05em;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  align-content: start;
  justify-content: flex-end;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #33443d;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease-out, color 0.25s ease-out;
}

.foot-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

footer small {
  grid-column: 1 / -1;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: #5b6b64;
  font-size: 16px;
  text-align: center;
}

/* 滚动显现 */
.js article > section:not(.hero) {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.js article > section.is-in {
  opacity: 1;
  transform: none;
}

/* 窄屏 */
@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .rail {
    position: static;
    order: 2;
  }

  .rail-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .rail-list li a {
    padding: 0.5rem 0.7rem;
    background: rgba(255, 253, 247, 0.6);
  }

  footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-links {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  .hero {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
    padding: 1.1rem 0 0.4rem;
    gap: 1rem;
  }

  .hero-art {
    width: 96px;
    border-radius: 18px 10px 18px 10px;
  }

  .hero-copy {
    align-items: flex-end;
  }

  article > section:not(.hero) {
    padding: 1.1rem 1rem;
    border-radius: 16px;
  }

  footer small {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .js article > section:not(.hero) {
    opacity: 1;
    transform: none;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
