/* TAG — Lightweight Modern Tech Brand Stylesheet */

:root {
  --bg: #f7f9fc;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef3f8;
  --bg-header: rgba(247, 249, 252, 0.86);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #dce4ee;
  --border-strong: #c3d0e0;
  --accent: #0f62fe;
  --accent-hover: #0043ce;
  --accent-soft: #edf4ff;
  --teal: #0d7a72;
  --teal-soft: #e6f6f4;
  --notice-bg: #f1f5f9;
  --notice-border: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --max-width: 1120px;
  --article-width: 760px;
  --header-height: 68px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-elevated: #111a2e;
  --bg-subtle: #16223a;
  --bg-header: rgba(11, 17, 32, 0.86);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1e2d47;
  --border-strong: #2d4266;
  --accent: #4d8eff;
  --accent-hover: #74a7ff;
  --accent-soft: rgba(77, 142, 255, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.12);
  --notice-bg: #142038;
  --notice-border: #26395c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.theme-ready body,
html.theme-ready .site-header,
html.theme-ready .card,
html.theme-ready .notice-box,
html.theme-ready .btn,
html.theme-ready .faq-item,
html.theme-ready .site-footer,
html.theme-ready .table-wrap {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
  color: #ffffff;
  text-decoration: none;
}

/* Layout containers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 72px;
}

.section-alt {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  max-width: 680px;
  margin-bottom: 40px;
}

.section-kicker {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.section-title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}

.section-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--bg-subtle);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.theme-toggle {
  width: auto;
  height: 36px;
  padding-inline: 12px;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(17, 26, 46, 0.42);
  border-color: rgba(148, 163, 184, 0.24);
}

.theme-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--text);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root:not([data-theme="dark"]) .theme-toggle .icon-sun {
  display: none;
}

.menu-toggle {
  display: none;
}

/* Hero */
.hero {
  padding-block: 80px 72px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(
      900px 420px at 85% -10%,
      var(--accent-soft),
      transparent 70%
    ),
    radial-gradient(
      700px 360px at 10% 110%,
      var(--teal-soft),
      transparent 70%
    ),
    var(--bg);
}

.hero-inner {
  max-width: 780px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-subtitle {
  margin: 0 0 32px;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.plan-name {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.plan-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.price-figure {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Grids & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

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

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-media {
  margin: -28px -28px 22px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  background: var(--bg-subtle);
}

.card-media img {
  width: 100%;
  height: auto;
}

.card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--text);
}

.card p {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

.card-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.card-list li {
  margin-bottom: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Notice box */
.notice-box {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.notice-box strong {
  color: var(--text);
}

/* Pricing table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.pricing-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.pricing-table th,
.pricing-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.pricing-table thead th {
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table td {
  color: var(--text-secondary);
}

.pricing-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Reviews placeholder */
.empty-state {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 40px 28px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--text);
}

.empty-state p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(225deg);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.faq-answer p {
  margin: 0;
}

/* CTA Band */
.cta-band {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-md);
}

.cta-band h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.cta-band p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 560px;
}

/* Footer */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding-block: 44px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.footer-heading-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-heading-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Standalone & Article Pages */
.page-hero {
  padding-block: 56px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  line-height: 1.28;
}

.page-hero p {
  margin: 0;
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 44px;
  align-items: start;
}

.article-body {
  max-width: var(--article-width);
}

.article-body h2 {
  margin: 40px 0 14px;
  font-size: 1.45rem;
  line-height: 1.35;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.article-body h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.article-body h3 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.article-body p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.article-body ul,
.article-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 8px;
}

.toc-box {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.toc-title {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.875rem;
}

.toc-list a {
  color: var(--text-secondary);
  display: block;
  line-height: 1.45;
}

.toc-list a:hover {
  color: var(--accent);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.related-card {
  display: block;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.related-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.related-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.related-card span {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.editorial-note {
  margin-top: 32px;
  padding: 18px 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-card-link {
  margin-top: auto;
  padding-top: 12px;
  font-weight: 600;
  font-size: 0.92rem;
}

.prose-section {
  max-width: 820px;
}

.prose-section h2 {
  margin: 32px 0 12px;
  font-size: 1.35rem;
}

.prose-section h2:first-child {
  margin-top: 0;
}

.prose-section p,
.prose-section li {
  color: var(--text-secondary);
}

.sitemap-group {
  margin-bottom: 28px;
}

.sitemap-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.sitemap-list li {
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc-box {
    position: static;
    order: -1;
  }

  .nav-link {
    padding: 8px 8px;
    font-size: 0.875rem;
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    box-shadow: var(--shadow-md);
    display: none;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-link {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }

  .section {
    padding-block: 52px;
  }

  .hero {
    padding-block: 56px 48px;
  }

  .grid-3,
  .grid-2,
  .related-grid,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .cta-band {
    padding: 24px;
  }

  .theme-toggle .theme-label {
    display: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
