@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 {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #fffdf7;
  --sand: #ffe9b0;
  --line: 3px;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PingFang TC", Georgia, serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.78;
  overflow-x: hidden;
}

a { color: inherit; }

a:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--red);
  outline-offset: 3px;
}

/* ---------- 顶栏：品牌行 / 菜单行 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: var(--line) solid var(--ink);
}

.brand-row {
  background: var(--sand);
  border-bottom: var(--line) solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 16px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand .mark {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: cover;
  background: var(--blue);
  border: var(--line) solid var(--ink);
  border-radius: 10px;
}

.menu-row { background: var(--blue); }

details.menu { display: block; }

details.menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 20px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.08em;
  background: var(--red);
  border-right: var(--line) solid var(--ink);
  cursor: pointer;
  list-style: none;
}

details.menu > summary::-webkit-details-marker { display: none; }

.bars {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--ink);
  box-shadow: 0 7px 0 var(--ink), 0 -7px 0 var(--ink);
}

details.menu[open] { position: relative; z-index: 95; }

details.menu[open] > summary {
  position: relative;
  z-index: 2;
  background: var(--red);
  box-shadow: 4px 4px 0 var(--ink);
}

details.menu[open] > menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 76px 18px 40px;
  list-style: none;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

details.menu[open] > menu > li { border-bottom: 2px solid #2f2f2f; }

details.menu[open] > menu > li > a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 10px 6px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-decoration: none;
}

details.menu[open] > menu > li > a:hover,
details.menu[open] > menu > li > a:focus-visible { color: var(--blue); }

/* ---------- 首屏拼贴 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 30px 16px 86px;
  background: var(--blue);
  border-bottom: 4px solid var(--ink);
}

.collage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ph {
  position: absolute;
  margin: 0;
  width: 34vw;
  max-width: 232px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow: 9px 9px 0 var(--ink);
}

.ph img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ph-a { top: 6%; left: -3%; transform: rotate(-5deg); }
.ph-b { bottom: 13%; right: -3%; transform: rotate(4deg); }

.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  text-align: center;
}

.hero h1 {
  margin: 0 auto;
  padding: 16px 18px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(30px, 8vw, 66px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  background: #ffffff;
  border: 4px solid var(--ink);
  border-radius: 12px;
  box-shadow: 9px 9px 0 var(--ink);
}

.hero-desc {
  margin: 24px auto 0;
  max-width: 52ch;
  padding: 10px 14px;
  font-size: 17px;
  line-height: 1.7;
  background: #ffffff;
  border: var(--line) solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--red);
}

.band {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 4px;
  height: 26px;
  background: var(--red);
  border-top: var(--line) solid var(--ink);
  transform: rotate(-2deg);
  z-index: 3;
}

/* ---------- 主体 ---------- */
main { display: block; }

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 38px 16px 60px;
}

.body-shell { min-width: 0; }

.prose {
  max-width: 70ch;
  font-size: 17px;
}

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

.prose p { margin: 0 0 18px; }

.prose h2 {
  margin: 46px 0 0;
  padding: 2px 0 2px 14px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 29px);
  line-height: 1.32;
  letter-spacing: -0.01em;
  border-left: 10px solid var(--red);
}

.prose h3 {
  margin: 30px 0 0;
  padding-left: 12px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
  border-left: 6px solid var(--blue);
}

hr {
  width: 76px;
  height: 4px;
  margin: 16px 0;
  border: 0;
  background: var(--ink);
}

.prose h2 + hr,
.prose h3 + hr { margin: 12px 0 20px; }

.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: var(--line) solid var(--red);
  background: rgba(59, 177, 255, 0.2);
}

.prose ul,
.prose ol { margin: 0 0 18px; padding-left: 24px; }

.prose li { margin: 6px 0; }

.prose li::marker { color: var(--red); font-weight: 700; }

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0 20px;
  border: var(--line) solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--ink);
}

.prose figure { margin: 10px 0 20px; }

.prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: #3a3a3a;
}

.prose blockquote {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--sand);
  border: var(--line) solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
}

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

.prose strong { font-weight: 700; background: rgba(255, 82, 82, 0.28); }

.prose code {
  padding: 1px 5px;
  font-size: 15px;
  background: #efefef;
  border: 2px solid var(--ink);
  border-radius: 6px;
}

.prose article { scroll-margin-top: 120px; }

.prose article + article {
  margin-top: 40px;
  padding-top: 6px;
  border-top: var(--line) solid var(--ink);
}

.prose table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 2px solid var(--ink);
  text-align: left;
}

.prose th { background: var(--blue); font-family: var(--sans); }

/* ---------- 侧栏 ---------- */
.side {
  align-self: start;
  padding: 14px 16px 18px;
  background: #ffffff;
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--ink);
}

.side h2 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.side hr { width: 100%; height: var(--line); margin: 10px 0 6px; }

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

.side-list li + li { border-top: 2px solid #dcdcdc; }

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: none;
}

.side-list a:hover { background: var(--blue); }

/* ---------- 页脚 ---------- */
.site-foot {
  margin-top: 22px;
  background: var(--ink);
  color: var(--paper);
  border-top: 4px solid var(--ink);
}

.cta {
  padding: 46px 18px;
  text-align: center;
  background: var(--red);
  color: var(--ink);
  border-bottom: 4px solid var(--ink);
}

.cta-brand {
  margin: 0 0 22px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(28px, 7vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 26px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
  background: var(--blue);
  border: var(--line) solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--ink);
}

.cta-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.foot-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 18px;
}

.foot-cols dl {
  margin: 0;
  padding-left: 14px;
  border-left: 4px solid var(--blue);
}

.foot-cols dt {
  margin-bottom: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.foot-cols dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #f0f0f0;
}

.foot-cols a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 2px solid var(--red);
}

.foot-cols a:hover { color: var(--blue); }

.foot-base {
  padding: 16px 18px 26px;
  text-align: center;
  border-top: 3px solid #2b2b2b;
}

.foot-base p {
  margin: 0;
  font-size: 16px;
  color: #c9c9c9;
}

/* ---------- 动效 ---------- */
.js .reveal { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

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

  .ph-a { animation: swayA 11s ease-in-out infinite alternate; }
  .ph-b { animation: swayB 13s ease-in-out infinite alternate; }
}

@keyframes swayA {
  from { transform: rotate(-5deg) translateY(-6px); }
  to { transform: rotate(-2deg) translateY(8px); }
}

@keyframes swayB {
  from { transform: rotate(4deg) translateY(8px); }
  to { transform: rotate(1deg) translateY(-8px); }
}

/* ---------- 断点 ---------- */
@media (min-width: 720px) {
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 920px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 38px;
    padding-top: 46px;
  }

  .side { position: sticky; top: 124px; }

  .ph-a { top: 12%; left: 7%; }
  .ph-b { bottom: 14%; right: 7%; }

  .hero h1 { box-shadow: 12px 12px 0 var(--ink); }
}

@media (max-width: 420px) {
  .hero { padding-bottom: 72px; }
  .hero h1 { padding: 12px 14px; box-shadow: 7px 7px 0 var(--ink); }
  .hero-desc { box-shadow: 4px 4px 0 var(--red); }
  .ph { width: 38vw; }
  .prose h2 { border-left-width: 8px; }
}

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