@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 {
  --mint: #99ffcc;
  --lume: #00ff41;
  --ink: #001e3c;
  --ink-2: #04263f;
  --ink-3: #07314f;
  --text: #e4fff2;
  --muted: #9ec7ba;
  --r: 28px;
  --pad: clamp(18px, 3.4vw, 46px);
  --maxw: 1180px;
  --serif: "Noto Serif TC", "Songti TC", Georgia, "PingFang TC", serif;
  --sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background-color: var(--ink);
  background-image:
    radial-gradient(62vw 62vw at 92% -12%, rgba(0, 255, 65, .17), transparent 62%),
    radial-gradient(48vw 48vw at 2% 10%, rgba(153, 255, 204, .15), transparent 60%),
    radial-gradient(76vw 52vw at 46% 112%, rgba(0, 255, 65, .10), transparent 66%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  overflow-wrap: break-word;
}

img, svg, video, iframe { max-width: 100%; }

a { color: var(--lume); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 溢出兜底 ---------- */
.top,
.shell,
main,
.foot { max-width: 100%; min-width: 0; }

.shell { width: 100%; }

main { overflow-x: hidden; overflow-x: clip; }

main > article,
main > section,
main > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

main img,
main svg,
main video,
main iframe,
main embed,
main object,
main table,
main pre,
main blockquote,
main figure { max-width: 100%; }

main section,
main article,
main div,
main span,
main dl,
main dt,
main dd,
main figcaption,
main h5,
main h6 {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------- 顶部 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  padding: 10px clamp(14px, 3vw, 32px) 8px;
  background: linear-gradient(180deg, rgba(0, 30, 60, .96), rgba(0, 30, 60, .8));
  border-bottom: 1px solid rgba(153, 255, 204, .14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 6px 4px;
  color: var(--mint);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .1em;
  text-decoration: none;
  white-space: nowrap;
}

.brand .mark { display: inline-flex; }
.brand .mark svg { height: 26px; width: auto; }

.find {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 5px 4px 14px;
  border-radius: 999px;
  background: rgba(153, 255, 204, .1);
  transition: background .3s ease, box-shadow .3s ease;
}

.find:focus-within {
  background: rgba(153, 255, 204, .17);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, .45);
}

.find input {
  flex: 1 1 auto;
  width: min(34vw, 190px);
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

.find input::placeholder { color: var(--muted); }

.find button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--lume);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.find button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 255, 65, .38);
}

.menu {
  max-width: var(--maxw);
  margin: 0 auto;
  min-width: 0;
}

.menu ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: block;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .28s ease, color .28s ease, transform .28s ease;
}

.menu a:hover,
.menu a:focus-visible {
  background: rgba(153, 255, 204, .16);
  color: var(--mint);
  transform: translateY(-1px);
}

.has-sub { position: relative; }

.has-sub > a::after {
  content: "⌄";
  margin-left: 6px;
  color: var(--lume);
  font-size: 14px;
}

.sub {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 176px;
  padding: 8px;
  border-radius: 20px;
  background: var(--ink-2);
  box-shadow: 0 22px 44px rgba(0, 0, 0, .48);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}

.has-sub:hover .sub,
.has-sub:focus-within .sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- 骨架 ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 26px) clamp(14px, 3vw, 32px) 48px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: start;
  min-width: 0;
}

.rail {
  position: sticky;
  top: 132px;
  min-width: 0;
  max-width: 100%;
  padding-top: 8px;
}

.rail ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid rgba(153, 255, 204, .16);
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
  transition: color .28s ease, border-color .28s ease, background .28s ease;
}

.rail a:hover {
  color: var(--mint);
  border-left-color: var(--lume);
  background: linear-gradient(90deg, rgba(0, 255, 65, .16), transparent 82%);
}

main { min-width: 0; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(18px, 4vw, 46px);
  padding: var(--pad);
  border-radius: var(--r);
  background-color: var(--ink-2);
  background-image: radial-gradient(rgba(153, 255, 204, .2) 1px, transparent 1.4px);
  background-size: 22px 22px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -32%;
  width: 62%;
  padding-bottom: 62%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 65, .3), transparent 66%);
  filter: blur(30px);
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 1; min-width: 0; }

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(28px, 4.6vw, 56px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: .015em;
  color: #eafff5;
  background: linear-gradient(100deg, #eafff5 0%, #99ffcc 58%, #00ff41 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow-wrap: anywhere;
}

.hero .lead {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.cell-fig {
  position: relative;
  z-index: 1;
  margin: 0;
  justify-self: end;
  width: min(100%, 360px);
  max-width: 100%;
  animation: float 10s ease-in-out infinite;
}

.cell-fig svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 28px rgba(0, 255, 65, .32));
}

.ring-a,
.ring-b,
.nucleus {
  transform-box: fill-box;
  transform-origin: center;
}

.ring-a { animation: spin 38s linear infinite; }
.ring-b { animation: breathe 7.5s ease-in-out infinite; }
.nucleus { animation: breathe 5.5s ease-in-out infinite reverse; }

/* ---------- 正文 ---------- */
main > article[id] {
  margin: clamp(22px, 4vw, 44px) 0;
  padding: var(--pad);
  border-radius: var(--r);
  background: var(--ink-2);
  scroll-margin-top: 148px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

main > article[id]:last-child { margin-bottom: 0; }

main h2,
main h3,
main h4 { overflow-wrap: anywhere; }

main h2 {
  margin: .1em 0 .5em;
  font-family: var(--serif);
  font-size: clamp(23px, 3.4vw, 33px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--mint);
}

main h3 {
  margin: 1.4em 0 .5em;
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 600;
  line-height: 1.5;
  color: #d8fff0;
}

main h4 {
  margin: 1.2em 0 .4em;
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--mint);
}

main hr {
  height: 1px;
  margin: 0 0 24px;
  border: 0;
  background: linear-gradient(90deg, var(--lume), rgba(153, 255, 204, .22) 46%, transparent);
}

main h2 + hr { margin-top: -.1em; }

main p { margin: 0 0 1.1em; max-width: 66ch; overflow-wrap: anywhere; }
main p:last-child { margin-bottom: 0; }

main ul,
main ol { margin: 0 0 1.2em; padding-left: 1.3em; }
main li { margin-bottom: .5em; overflow-wrap: anywhere; }
main li::marker { color: var(--lume); }

main a {
  color: var(--lume);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}

main a:hover { color: var(--mint); }

main blockquote {
  margin: 0 0 1.3em;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(153, 255, 204, .1);
  color: #dcfff2;
  overflow-wrap: anywhere;
}

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

main strong { color: var(--mint); }

main figure { margin: 0 0 1.3em; max-width: 100%; }

main img {
  display: block;
  height: auto;
  max-width: 100%;
  border-radius: 20px;
}

main video,
main iframe,
main embed,
main object {
  display: block;
  max-width: 100%;
  border: 0;
}

main pre {
  margin: 0 0 1.3em;
  max-width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--ink-3);
  overflow-x: auto;
  font-size: 16px;
  line-height: 1.7;
}

main pre code {
  display: block;
  min-width: 0;
  font-size: 16px;
  white-space: pre;
  overflow-wrap: normal;
}

main code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

main table {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.3em;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
}

main th,
main td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

main thead th {
  background: rgba(0, 255, 65, .14);
  color: var(--mint);
}

main tbody tr:nth-child(even) { background: var(--ink-3); }

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 32px) 44px;
  border-top: 1px solid rgba(153, 255, 204, .14);
  color: var(--muted);
  font-size: 16px;
}

.foot article {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.foot .f-brand {
  color: var(--mint);
  font-family: var(--serif);
  letter-spacing: .1em;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(153, 255, 204, .1);
  color: var(--text);
  text-decoration: none;
  transition: background .28s ease, color .28s ease;
}

.foot a:hover {
  background: var(--lume);
  color: var(--ink);
}

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.flash { animation: glow 1.6s ease-out 1; }

@keyframes breathe {
  0%, 100% { transform: scale(.95); opacity: .6; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(-9px); }
  50% { transform: translateY(9px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes glow {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 65, .65); }
  100% { box-shadow: 0 0 0 24px rgba(0, 255, 65, 0); }
}

/* ---------- 断点 ---------- */
@media (max-width: 880px) {
  .top { position: static; }
  .brand { font-size: 18px; letter-spacing: .06em; }
  .menu ul {
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .menu ul::-webkit-scrollbar { display: none; }
  .has-sub { display: flex; align-items: center; }
  .sub {
    position: static;
    display: contents;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .has-sub > a::after { content: ""; }
  .shell { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
  .rail { display: none; }
  .hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 20px 32px;
  }
  .hero h1 { font-size: clamp(27px, 8.4vw, 38px); }
  .cell-fig { justify-self: start; width: min(62%, 190px); }
  main > article[id] { scroll-margin-top: 20px; padding: 24px 18px; }
}

@media (max-width: 560px) {
  .brand-row { flex-wrap: wrap; row-gap: 8px; }
  .find {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
  }
  .find input { width: 100%; flex: 1 1 auto; }
  .find button { min-height: 44px; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .shell { padding-left: 12px; padding-right: 12px; }
  .find { padding-left: 12px; }
  .find button { padding: 8px 14px; }
  .hero { padding: 24px 16px 28px; }
  main > article[id] { padding: 22px 15px; }
  main th,
  main td { padding: 9px 8px; font-size: 16px; }
  main blockquote { padding: 16px 16px; }
  main pre { padding: 14px 14px; }
  main ul,
  main ol { padding-left: 1.1em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

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