/**
 * FingerTips 官網共用樣式（SSOT）。
 * 涵蓋所有頁面共用的 reset、導覽列、footer、按鈕與 cookie 橫幅；
 * 色彩一律引用 tokens.css 的變數（styles/tokens.css，由 tokens.json 編譯）。
 * 首頁產品展示樣式位於 landing.css；內容頁版型沿用下方共用樣式。
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-family-base);
  line-height: 1.5;
  color: var(--color-ink-primary);
  background: var(--color-surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--color-brand-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.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;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  transform: translateY(-120%);
  padding: var(--space-2) var(--space-4);
  background: var(--color-brand-blue);
  color: var(--color-surface-page);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: var(--font-weight-medium);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translateY(0);
}

/* ===== Navigation ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-overlay-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.nav-container {
  max-width: 1328px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-ink-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  color: var(--color-ink-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: var(--font-weight-regular);
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--color-ink-primary);
}
.nav-links a.active {
  color: var(--color-ink-primary);
  font-weight: var(--font-weight-medium);
}
.nav-cta {
  background: var(--color-brand-blue);
  color: var(--color-surface-page) !important;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-medium) !important;
  transition: background 0.2s;
}
.nav-cta:hover {
  background: var(--color-brand-blue-hover);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--color-ink-primary);
  position: absolute;
  left: 13px;
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) {
  top: 15px;
}
.nav-toggle span:nth-child(2) {
  top: 21px;
}
.nav-toggle span:nth-child(3) {
  top: 27px;
}
.nav-toggle.open span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

/* ===== Buttons / links ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-brand-blue);
  color: var(--color-surface-page);
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--color-brand-blue-hover);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface-dark-elevated);
  color: var(--color-ink-on-dark);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover {
  background: var(--color-surface-dark);
}
.btn-secondary .appstore-glyph {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.btn-secondary .appstore-label small {
  display: block;
  font-size: 0.625rem;
  font-weight: var(--font-weight-regular);
  line-height: 1.1;
  opacity: 0.72;
}
.btn-secondary .appstore-label strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
}
.btn-secondary.on-dark {
  background: var(--color-surface-page);
  color: var(--color-ink-primary);
}
.btn-secondary.on-dark:hover {
  background: var(--color-surface-subtle);
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-brand-link);
  text-decoration: none;
  font-size: 1rem;
  font-weight: var(--font-weight-regular);
  transition: opacity 0.2s;
}
.link-arrow .chev {
  font-size: 1.15em;
  line-height: 0;
  transition: transform 0.2s;
}
.link-arrow:hover {
  text-decoration: underline;
}
.link-arrow:hover .chev {
  transform: translateX(2px);
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-12) var(--space-6) var(--space-8);
  background: var(--color-surface-page);
}
.footer-content {
  max-width: 1280px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-10);
}
.footer-brand h3 {
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-ink-primary);
  margin-bottom: 6px;
}
.footer-brand p {
  color: var(--color-ink-tertiary);
  font-size: 0.875rem;
}
.footer-col h4 {
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--color-ink-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  padding: 3px 0;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--color-ink-primary);
}
.footer-col p {
  color: var(--color-ink-secondary);
  font-size: 0.8125rem;
  padding: 3px 0;
}
.footer-bottom {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-5);
  text-align: center;
}
.footer-bottom p {
  font-size: 0.75rem;
  color: var(--color-ink-tertiary);
}

/* ===== Cookie 橫幅 ===== */
.cookie-consent {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--color-surface-dark-elevated);
  color: var(--color-ink-on-dark);
  padding: 14px var(--space-6);
  font-size: 0.8125rem;
}
.cookie-consent.visible {
  display: block;
}
.cookie-consent-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.cookie-consent-inner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}
.cookie-consent-inner p a {
  color: var(--color-brand-link-on-dark);
  text-decoration: underline;
  margin-left: 4px;
}
.cookie-consent-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.cookie-consent-actions button {
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 7px 18px;
  font-family: inherit;
}
.cookie-accept {
  background: var(--color-brand-blue);
  color: var(--color-surface-page);
  border: none;
  font-weight: var(--font-weight-medium);
}

/* ===== 共用響應式（nav / footer）===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: var(--color-overlay-nav);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column;
    padding: var(--space-3) var(--space-6);
    gap: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    align-items: stretch;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 12px 0;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--color-border-subtle);
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  .nav-cta {
    text-align: center;
    margin-top: var(--space-2);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* 共享內容頁版型 */
html {
  scroll-padding-top: 88px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--color-brand-link);
  margin-bottom: 18px;
  display: block;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.plain-link {
  display: inline-block;
  color: var(--color-brand-link);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 0;
}
.plain-link:hover {
  text-decoration: underline;
}
.learning-paths {
  max-width: 1000px;
  margin: auto;
  padding: 20px 24px 50px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.learning-path {
  padding: 28px;
  background: var(--color-surface-subtle);
  border-radius: 16px;
}
.learning-path h2 {
  font-size: 21px;
  margin-bottom: 16px;
}
.learning-path p,
.learning-path li {
  font-size: 14px;
  line-height: 1.85;
}
.learning-path ol {
  padding-left: 20px;
  margin-top: 20px;
}
.learning-path li {
  margin-bottom: 12px;
}
.learning-path a {
  color: var(--color-brand-link);
  text-underline-offset: 3px;
}
.learning-path .eyebrow {
  margin-bottom: 15px;
}
.catalog {
  max-width: 1080px;
  margin: auto;
  padding: 0 24px 80px;
}
.catalog-section {
  margin-top: 36px;
}
.catalog-section > h2 {
  font-size: 24px;
  margin-bottom: 24px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.catalog-item {
  display: block;
  text-decoration: none;
  padding: 22px 0;
  border-top: 1px solid var(--color-border-default);
}
.catalog-item h3 {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.catalog-item p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--color-ink-secondary);
}
.catalog-item small {
  display: block;
  font-size: 11px;
  color: var(--color-ink-tertiary);
  margin-top: 18px;
}
@media (max-width: 900px) {
  .learning-paths {
    grid-template-columns: 1fr;
  }
  .catalog-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .hero-actions {
    gap: 20px;
    margin-top: 22px;
  }
  .hero-actions .btn-primary {
    font-size: 14px;
    padding: 12px 20px;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html:not(.js) nav { position: static; }
  html:not(.js) .nav-container { height: auto; padding-top: 16px; flex-direction: column; align-items: stretch; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-links { display: flex; position: static; flex-direction: row; flex-wrap: wrap; padding: 8px 0; gap: 8px 18px; background: transparent; border: 0; }
  html:not(.js) .nav-links a { font-size: 13px; border: 0; }
  html:not(.js) .nav-cta { padding: 10px 16px; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-toggle span { transition: none; }
}
