:root {
  --sg-primary: #304a27;
  --sg-primary-dark: #173318;
  --sg-primary-light: #e7eee1;
  --sg-olive: #66794b;
  --sg-khaki: #b4a77a;
  --sg-cream: #f5f2e9;
  --sg-surface: #fff;
  --sg-surface-muted: #f7f8f4;
  --sg-border: #dfe4da;
  --sg-text: #20281e;
  --sg-text-muted: #687165;
  --sg-danger: #a33e37;
  --sg-warning: #9a6a16;
  --sg-success: #3d6b3d;
  --sg-info: #42687a;
  --sg-shadow-sm: 0 3px 12px rgba(31, 55, 25, 0.07);
  --sg-shadow-md: 0 12px 30px rgba(24, 48, 20, 0.12);
  --sg-radius-sm: 7px;
  --sg-radius-md: 12px;
  --sg-radius-lg: 18px;
  --sg-container-width: 1400px;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--sg-surface);
  color: var(--sg-text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    "Microsoft JhengHei",
    sans-serif;
  line-height: 1.7;
}
.container-xl {
  max-width: var(--sg-container-width);
}
a,
button,
input,
select,
textarea {
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(154, 106, 22, 0.38);
  outline-offset: 2px;
}
.announcement {
  padding: 7px 0;
  background: var(--sg-primary-dark);
  font-size: 12px;
}
.site-header {
  border-bottom: 1px solid var(--sg-border);
  box-shadow: none;
}
.site-header.scrolled {
  box-shadow: var(--sg-shadow-sm);
}
.navbar {
  min-height: 78px;
}
.brand-mascot {
  width: 82px;
  height: 82px;
  object-fit: contain;
}
.site-header .brand-mascot {
  opacity: 1;
}
.navbar-brand.brand > span {
  display: none;
}
.brand strong {
  font-size: 20px;
  letter-spacing: 1.5px;
}
.brand small {
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--sg-text-muted);
}
.navbar-nav {
  gap: 4px;
}
.nav-link {
  position: relative;
  border: 0 !important;
  border-radius: var(--sg-radius-sm);
  padding: 11px 10px !important;
  color: #465044;
  font-size: 13px;
}
.nav-link:hover,
.nav-link.active {
  color: var(--sg-primary-dark);
  background: var(--sg-primary-light);
}
.nav-link.active:after {
  position: absolute;
  right: 10px;
  bottom: 5px;
  left: 10px;
  height: 2px;
  background: var(--sg-primary);
  content: "";
}
.search-box {
  height: 40px;
  border-color: var(--sg-border);
  background: var(--sg-surface-muted);
}
.search-box input,
.search-box button {
  background: transparent;
}
.btn,
.primary,
.more,
.read-more {
  border-radius: var(--sg-radius-sm);
  font-weight: 700;
}
.btn-olive,
.page-item.active .page-link {
  border-color: var(--sg-primary);
  background: var(--sg-primary);
}
.btn-olive:hover {
  background: var(--sg-primary-dark);
  transform: translateY(-1px);
}
.category-pill,
.tag {
  background: var(--sg-primary) !important;
}
.section-gap {
  margin-top: 30px;
}
.stats-bar,
.latest-panel,
.content-card,
.recommend-box,
.category-card,
.list-card,
.side-box,
.search-card,
.search-side-box,
.comments-box,
.related-grid article {
  border-color: var(--sg-border);
  border-radius: var(--sg-radius-md);
  box-shadow: var(--sg-shadow-sm);
}
.category-card,
.list-card,
.search-card,
.article-card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.category-card:hover,
.list-card:hover,
.search-card:hover,
.article-card:hover {
  box-shadow: var(--sg-shadow-md);
  transform: translateY(-3px);
}
.panel-title {
  background: var(--sg-primary-dark);
}
.category-hero,
.search-hero {
  background: var(--sg-primary-dark);
  border-radius: var(--sg-radius-lg);
  box-shadow: var(--sg-shadow-md);
}
.breadcrumb {
  font-size: 12px;
}
.breadcrumb a {
  color: var(--sg-primary);
}
.article-body {
  color: #30372e;
  line-height: 2;
}
.article-body h2,
.article-body h3 {
  color: var(--sg-primary-dark);
}
.toc-section,
.notice,
.author-box {
  border-radius: var(--sg-radius-md);
}
.main-search > div,
.side-search,
.comments-box input,
.comments-box textarea {
  border-color: var(--sg-border);
  border-radius: var(--sg-radius-sm);
}
.api-state,
.empty-state,
.no-results,
.page-error {
  border: 1px dashed var(--sg-border);
  border-radius: var(--sg-radius-md);
  background: var(--sg-surface-muted);
  padding: 42px;
  text-align: center;
}
.pagination .page-link,
.search-pagination button {
  border-color: var(--sg-border);
  color: var(--sg-primary);
}
.accordion-button:not(.collapsed) {
  color: var(--sg-primary-dark);
  background: var(--sg-primary-light);
}
.site-footer {
  margin-top: 48px;
  padding-top: 48px;
  background: var(--sg-primary-dark);
}
.site-footer h3 {
  font-size: 14px;
  letter-spacing: 0.04em;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.site-footer .copyright {
  margin-top: 34px;
  padding: 18px 0;
  color: #bdc8b8;
}
.site-footer p,
.site-footer li {
  line-height: 2;
}
.footer-brand .brand-mascot {
  filter: drop-shadow(0 3px 4px #0004);
}
@media (max-width: 991px) {
  .navbar-collapse {
    margin-top: 10px;
    padding: 10px 0 16px;
    border-top: 1px solid var(--sg-border);
  }
  .nav-link.active:after {
    display: none;
  }
  .site-header {
    position: static !important;
  }
  .site-footer {
    padding-top: 36px;
  }
}
@media (max-width: 767px) {
  .announcement {
    font-size: 10px;
  }
  .navbar {
    min-height: 68px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand-mascot {
    width: 64px;
    height: 64px;
  }
  .section-gap {
    margin-top: 20px;
  }
  .category-hero,
  .search-hero {
    border-radius: var(--sg-radius-md);
  }
  .api-state,
  .empty-state,
  .no-results,
  .page-error {
    padding: 30px 18px;
  }
  .site-footer {
    text-align: left;
  }
  .site-footer .row > div {
    padding-bottom: 12px;
  }
  .site-footer h3 {
    margin-bottom: 8px;
  }
}

.sg-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}
.sg-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.category-image,
.article-card,
.list-image,
.search-card > a,
.related-grid article > a {
  overflow: hidden;
}
.category-image img,
.article-card img,
.list-image img,
.search-card img,
.related-grid img {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.category-card:hover img,
.article-card:hover img,
.list-card:hover img,
.search-card:hover img,
.related-grid article:hover img {
  transform: scale(1.035);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
  }
  .sg-reveal {
    opacity: 1;
    transform: none;
  }
  .category-card:hover,
  .list-card:hover,
  .search-card:hover,
  .article-card:hover {
    transform: none;
  }
}
