@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 {
  color-scheme: dark;
  --bg: #000000;
  --panel: #121212;
  --line: #232323;
  --line-2: #363636;
  --ink: #ececec;
  --dim: #a2a2a2;
  --mint: #7ff0c4;
  --gold: #e6c987;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Noto Serif TC", Georgia, "Songti TC", serif;
  line-height: 1.32;
  font-weight: 600;
  margin: 0 0 .55em;
  letter-spacing: .01em;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
p { margin: 0 0 1.1em; }

.num {
  font-size: 16px;
  letter-spacing: .08em;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

/* ---------- 顶栏：两行 ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  background: rgba(0, 0, 0, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px clamp(16px, 4vw, 56px) 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  text-decoration: none;
}

.mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--mint);
  font-size: 16px;
  text-shadow: 0 0 10px rgba(127, 240, 196, .55);
}

img.mark { object-fit: contain; border: 0; }

.brandtext {
  font-family: "Noto Serif TC", Georgia, serif;
  font-size: 19px;
  letter-spacing: .06em;
}

.contact {
  margin: 0;
  max-width: 60%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--dim);
  font-size: 16px;
  letter-spacing: .04em;
}

.mainnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 clamp(10px, 3vw, 48px) 10px;
  scrollbar-width: none;
}

.mainnav::-webkit-scrollbar { height: 0; }

.mainnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--dim);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, border-color .2s, text-shadow .2s;
}

.mainnav a:hover,
.mainnav a:focus-visible {
  color: #fff;
  border-color: var(--line-2);
  text-shadow: 0 0 10px rgba(127, 240, 196, .5);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 100vh;
  overflow: hidden;
  padding-top: 150px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 88% 16%, rgba(127, 240, 196, .12), transparent 62%),
    radial-gradient(70% 60% at 10% 92%, rgba(230, 201, 135, .09), transparent 60%),
    #000;
}

.hero-media {
  position: absolute;
  inset: -12% 0 0;
  z-index: 0;
  will-change: transform;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.52) saturate(1.05);
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(110% 80% at 92% 18%, rgba(127, 240, 196, .14), transparent 58%),
    linear-gradient(270deg, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .58) 46%, rgba(0, 0, 0, .92) 100%);
}

@keyframes drift {
  from { transform: scale(1.04) translateY(0); }
  to { transform: scale(1.12) translateY(-2%); }
}

@keyframes heroFade {
  0%, 100% { opacity: 0; }
  6%, 30% { opacity: 1; }
  36% { opacity: 0; }
}

.hero-media img:first-child { animation: drift 26s ease-in-out infinite alternate; }
.hero-media img:nth-child(n+2) { opacity: 0; animation: heroFade 27s linear infinite; }
.hero-media img:nth-child(2) { animation-delay: 6s; }
.hero-media img:nth-child(3) { animation-delay: 15s; }

.hero-copy {
  position: relative;
  z-index: 3;
  width: min(100%, 1120px);
  margin-left: auto;
  padding: 0 clamp(20px, 5vw, 72px) clamp(52px, 12vh, 116px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  text-align: right;
}

.badge {
  margin: 0;
  padding: 6px 15px;
  border: 1px solid rgba(127, 240, 196, .45);
  border-radius: 999px;
  background: rgba(127, 240, 196, .07);
  color: var(--mint);
  font-size: 16px;
  letter-spacing: .1em;
  text-shadow: 0 0 10px rgba(127, 240, 196, .55);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.05rem, 5.8vw, 4.3rem);
  letter-spacing: .015em;
  text-shadow: 0 0 26px rgba(0, 0, 0, .9);
}

.lead {
  margin: 0;
  max-width: 46ch;
  color: #cfcfcf;
  font-size: clamp(1rem, 1.6vw, 1.19rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 10px;
  border: 1px solid var(--mint);
  background: var(--mint);
  color: #04120d;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(127, 240, 196, .22);
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(127, 240, 196, .42); }

.btn.ghost {
  background: rgba(0, 0, 0, .35);
  border-color: var(--line-2);
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost:hover { border-color: var(--mint); color: var(--mint); }

.hero-scroll {
  position: absolute;
  left: clamp(20px, 5vw, 72px);
  bottom: 20px;
  z-index: 3;
  color: var(--dim);
  font-size: 16px;
  letter-spacing: .2em;
}

/* ---------- 正文 ---------- */
main { background: var(--bg); }

article { scroll-margin-top: 152px; }

section {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 40px);
}

section > :not(aside) { grid-column: 2; }

aside.toc {
  grid-column: 1;
  grid-row: 1 / span 7;
  align-self: start;
  position: sticky;
  top: 156px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.toc h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: .08em; }

.subtitle {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 16px;
  letter-spacing: .1em;
  font-weight: 400;
}

.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 6px;
  border-radius: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, .06);
  color: var(--dim);
  font-size: 16px;
  text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible { color: var(--mint); text-shadow: 0 0 10px rgba(127, 240, 196, .5); }

section > article {
  padding-block: clamp(28px, 4vw, 54px);
  border-top: 1px solid var(--line);
}

section > article:first-of-type { border-top: 0; padding-top: 0; }

section > article.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}

section > article.reveal.in { opacity: 1; transform: none; }

section h2 {
  position: relative;
  padding-bottom: .45em;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
}

section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), transparent);
  box-shadow: 0 0 10px rgba(127, 240, 196, .55);
}

section h2 + p { margin-top: 0; color: var(--dim); }

section h3 { font-size: 1.16rem; color: var(--gold); margin-top: 1.6em; }

section a { color: var(--gold); text-underline-offset: 3px; }
section a:hover { color: var(--mint); }

section ul, section ol { margin: 0 0 1.2em; padding-left: 1.35em; }
section li { margin-bottom: .5em; }
section li::marker { color: var(--mint); }
section strong { color: var(--mint); }

section blockquote {
  margin: 1.4em 0;
  padding: 16px 20px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--mint);
  border-radius: 10px;
  background: var(--panel);
}

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

section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 16px;
}

section th, section td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
section th { background: var(--panel); color: var(--mint); font-weight: 500; }

section img {
  margin: 1.3em 0;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* ---------- 页脚 ---------- */
footer { border-top: 1px solid var(--line); background: var(--bg); }

footer > article {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) clamp(16px, 4vw, 40px);
}

footer > article.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
  margin-block: clamp(28px, 4vw, 56px);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(127, 240, 196, .09), transparent 62%),
    var(--panel);
}

.cta h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.5rem); letter-spacing: .04em; }
.cta .subtitle { margin: 0; }

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 20px;
  margin: 0;
}

.foot-nav dt, .foot-nav dd { margin: 0; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-nav a:hover,
.foot-nav a:focus-visible { color: var(--mint); border-bottom-color: var(--mint); }

.foot-nav dd { color: #5c5c5c; font-size: 16px; letter-spacing: .1em; }

.foot-copy { border-top: 1px solid var(--line); }

.foot-copy p {
  margin: 0;
  color: var(--dim);
  font-size: 16px;
  letter-spacing: .06em;
  text-align: center;
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .hero { min-height: 92vh; padding-top: 156px; }
  section { display: block; padding-top: 32px; }
  aside.toc { position: static; margin-bottom: 28px; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 8px; }
  section > article { padding-block: 32px; }
  section > article:first-of-type { padding-top: 0; }
}

@media (max-width: 560px) {
  .hero-copy { align-items: flex-start; text-align: left; padding-bottom: 64px; }
  .hero-actions { justify-content: flex-start; }
  .hero-scroll { display: none; }
  .contact { max-width: 100%; font-size: 16px; }
  footer > article.cta { align-items: flex-start; text-align: left; }
  .btn { width: 100%; }
  .hero-actions .btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media img { animation: none !important; }
  section > article.reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

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