/* SainTech — homepage (direction 1a: 經典頻道首頁).
   The mockup is a fixed 1060px canvas; here the same composition runs
   fluid up to --maxw-content with the design system's 56px gutter as
   the desktop ceiling. */

:root {
  --gutter: clamp(20px, 5vw, 56px);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body { font-family: var(--font-body); color: var(--text-body); }

.st-shell {
  max-width: var(--maxw-content);
  margin: 0 auto;
}

.st-section {
  padding: 12px var(--gutter) 64px;
  scroll-margin-top: 80px;
}

.st-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.st-section__head h2 { font-size: 26px; color: var(--text-strong); }
.st-section__lede {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0 0 24px;
}
.st-section__head + .st-section__lede { margin-top: -18px; }

.st-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.st-link:hover { color: var(--text-strong); }

.st-morelink {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-sm);
}

/* ============================================================
   Top bar
   ============================================================ */
.st-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px var(--gutter);
  border-bottom: var(--border-width) solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-page) 82%, transparent);
  backdrop-filter: blur(8px);
}

.st-brand { display: flex; align-items: center; gap: 11px; }
.st-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: var(--border-width-bold) solid var(--border-strong);
}
.st-brand__mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-brand__name {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 19px;
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
}

.st-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: 14.5px;
}
.st-nav a[aria-current="page"] { color: var(--text-strong); }

.st-topbar__actions { display: flex; align-items: center; gap: 14px; }

.st-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xs);
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.st-toggle:hover { color: var(--text-strong); border-color: var(--text-muted); }

/* ============================================================
   Hero
   ============================================================ */
.st-hero { padding: 80px var(--gutter) 64px; max-width: 880px; }
.st-hero h1 {
  font-size: clamp(38px, 5.6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  margin: 20px 0 0;
}
.st-hero__lede {
  margin: 24px 0 0;
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
  max-width: 560px;
}
.st-hero__cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.st-hero__tags { display: flex; gap: 8px; margin-top: 36px; flex-wrap: wrap; }

/* ============================================================
   Grids
   ============================================================ */
.st-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.st-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ============================================================
   Article card (科技專欄)
   ============================================================ */
.st-artcard {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: var(--border-width-bold) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.st-artcard:hover { transform: translateY(-3px); border-color: var(--brand); }

.st-artcard__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.st-artcard__read {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.st-artcard h3 {
  font-size: var(--text-h4);
  line-height: 1.25;
  color: var(--text-strong);
  margin: 0 0 10px;
}
.st-artcard p {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--text-body);
  margin: 0 0 20px;
}
.st-artcard__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.st-artcard__play {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-sm);
  color: var(--brand);
}
.st-artcard__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   Test database table
   ============================================================ */
.st-datatable {
  border: var(--border-width-bold) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.st-datarow {
  display: grid;
  grid-template-columns: 1.4fr 1.8fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px var(--space-5);
  border-bottom: var(--border-width) solid var(--border-subtle);
  transition: background var(--dur-fast) var(--ease-out);
}
.st-datarow:last-child { border-bottom: none; }
.st-datarow:not(.st-datarow--head):hover { background: var(--bg-raised); }

.st-datarow--head {
  padding: 14px var(--space-5);
  border-bottom-width: var(--border-width-bold);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.st-datarow__name {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: 15px;
  color: var(--text-strong);
}
.st-datarow__id {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 3px;
}
.st-datarow__scope { font-size: 13px; color: var(--text-body); }

.st-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.st-dl:hover { background: var(--brand); color: var(--text-on-brand); }

/* ============================================================
   Platform stats
   ============================================================ */
.st-statcard {
  background: var(--bg-surface);
  border: var(--border-width-bold) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.st-statcard__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: var(--space-5);
}
.st-statcard__dot { width: 10px; height: 10px; border-radius: 3px; }
.st-statcard__dot--yt { background: var(--red-500); }
.st-statcard__dot--bili { background: #FB7299; }
.st-statcard__name {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-base);
  color: var(--text-strong);
}
.st-statcard__figures { display: flex; gap: 44px; flex-wrap: wrap; }
.st-stat__value {
  font-size: 40px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
}
.st-stat__label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   Footer
   ============================================================ */
.st-footer {
  background: var(--bg-surface);
  border-top: var(--border-width) solid var(--border-subtle);
  padding: 44px var(--gutter) 36px;
}
.st-footer__top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.st-footer__about { max-width: 280px; }
.st-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.st-footer__mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
}
.st-footer__mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-footer__wordmark {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 17px;
  color: var(--text-strong);
}
.st-footer__about p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
.st-footer__cols { display: flex; gap: 56px; flex-wrap: wrap; }
.st-footer__coltitle {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.st-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--text-sm);
}
.st-footer__mail {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--brand);
}
.st-footer__mail:hover { color: var(--brand); text-decoration: underline; }
.st-footer__legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: var(--border-width) solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .st-grid-3 { grid-template-columns: 1fr 1fr; }
  .st-nav { gap: 20px; font-size: 14px; }
}

@media (max-width: 760px) {
  .st-topbar { flex-wrap: wrap; }
  .st-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 2px;
  }
  .st-hero { padding-top: 56px; }
  .st-grid-2, .st-grid-3 { grid-template-columns: 1fr; }
  .st-datarow {
    grid-template-columns: 1fr;
    gap: 10px;
    justify-items: start;
  }
  .st-datarow--head { display: none; }
  .st-statcard__figures { gap: 28px; }
  .st-stat__value { font-size: 32px; }
  .st-footer__cols { gap: 32px; }
}
