:root {
  color-scheme: light;
  --ink: #1d2a2f;
  --muted: #66747a;
  --line: #d9e0df;
  --panel: #ffffff;
  --panel-soft: #f5f8f7;
  --accent: #107c72;
  --accent-strong: #0a5f58;
  --amber: #c88222;
  --shadow: 0 14px 34px rgba(22, 43, 48, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #edf1ef;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #edf1ef;
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.brand-header {
  max-width: 1440px;
  margin: 0 auto 14px;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.brand-header a {
  display: block;
}

.brand-header img {
  width: min(560px, 100%);
  height: auto;
  display: block;
}

.page-tabs {
  max-width: 1440px;
  width: fit-content;
  margin: 0 auto 18px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(22, 43, 48, 0.08);
}

.tab-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.tab-link:hover,
.tab-link:focus-visible {
  border-color: #b7d4d0;
  outline: none;
}

.tab-link.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 124, 114, 0.22);
}

.material-page {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.page-heading {
  display: grid;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--amber);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.25;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.page-intro {
  max-width: 720px;
  margin: 2px 0 0;
  color: #43545a;
  font-size: 15px;
  line-height: 1.7;
}

.material-section {
  display: grid;
  gap: 14px;
}

.material-section-heading {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.material-card {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.material-card h3 {
  min-height: 48px;
  margin: 0;
  display: flex;
  align-items: end;
  font-size: 20px;
  line-height: 1.2;
}

.material-card picture {
  width: 100%;
  display: block;
}

.material-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.material-photo.contain {
  object-fit: contain;
  background: #ffffff;
}

.material-card > p {
  margin: 0;
  color: #38484d;
  font-size: 14px;
  line-height: 1.7;
}

.material-card dl {
  margin: auto 0 0;
  display: grid;
  gap: 8px;
}

.material-card dl div {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.material-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.material-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.material-note {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: #f4f8f7;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1060px) {
  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 12px;
  }

  .brand-header {
    margin-bottom: 10px;
    padding: 10px;
  }

  .brand-header img {
    width: min(420px, 100%);
  }

  .page-tabs {
    width: 100%;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-link {
    padding: 0 10px;
  }

  .material-page {
    gap: 24px;
    padding: 18px 14px;
  }

  h1 {
    font-size: 27px;
  }

  h2 {
    font-size: 22px;
  }

  .material-grid {
    grid-template-columns: 1fr;
  }

  .material-card h3 {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
