:root {
  --font-sans: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-2: #f1f5f9;
  --color-text: #0f172a;
  --color-text-2: #334155;
  --color-text-3: #64748b;
  --color-primary: #2563eb;
  --color-primary-2: #1d4ed8;
  --color-accent: #06b6d4;
  --color-border: #e2e8f0;
  --color-shadow: rgba(15, 23, 42, 0.08);
  --header-height: 64px;
  --content-inset: 16px;
  --max-content: 760px;
  --max-wide: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 900;
  transition: box-shadow 0.2s;
}
.site-header.is-scrolled { box-shadow: 0 4px 20px var(--color-shadow); }
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
}
.brand-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 8px;
  font-size: 0.85rem;
}
.primary-nav { display: flex; }
.nav-list {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 8px 14px;
  color: var(--color-text-2);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.nav-list a:hover,
.nav-list a.active {
  color: var(--color-primary);
  background: var(--color-surface);
}
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
}
.menu-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 0 auto;
  transition: transform 0.2s, opacity 0.2s;
}
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Main spacing */
main { padding-top: var(--header-height); }

/* Hero */
.hero {
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--color-border);
}
.hero-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 80px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-copy h1 {
  font-size: 2.6rem;
  line-height: 1.2;
  margin: 0 0 20px;
  color: var(--color-text);
}
.hero-lead {
  font-size: 1.15rem;
  color: var(--color-text-2);
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual { display: flex; justify-content: center; }
.hero-illustration { width: 100%; max-width: 420px; height: auto; }

/* Sections */
.section { padding: 64px 24px; }
.section-categories { background: var(--color-bg); }
.section-articles { background: var(--color-surface); }
.section-solutions { background: var(--color-bg); }
.section-cta { background: var(--color-surface); }
.container {
  max-width: var(--max-wide);
  margin: 0 auto;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}
.section-title {
  font-size: 1.75rem;
  margin: 0;
  color: var(--color-text);
}
.section-more {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.95rem;
}
.section-more:hover { text-decoration: underline; }

.category-grid,
.solution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.category-card,
.solution-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.category-card:hover,
.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--color-shadow);
  border-color: var(--color-primary);
}
.category-card h3,
.solution-card h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}
.category-card p,
.solution-card p {
  margin: 0 0 18px;
  color: var(--color-text-2);
  font-size: 0.95rem;
}
.card-link,
.solution-card a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.solution-card a:hover { text-decoration: underline; }

.article-list { display: grid; gap: 20px; }
.article-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.2s;
}
.article-card:hover { box-shadow: 0 8px 24px var(--color-shadow); }
.article-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--color-text-3);
}
.article-category {
  color: var(--color-primary);
  font-weight: 600;
}
.article-card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.article-card h3 a { color: var(--color-text); text-decoration: none; }
.article-card h3 a:hover { color: var(--color-primary); }
.article-card p { margin: 0; color: var(--color-text-2); font-size: 0.95rem; }

.cta-box {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  border-radius: 20px;
  padding: 48px;
  text-align: center;
}
.cta-box h2 { margin: 0 0 12px; font-size: 1.6rem; }
.cta-box p { margin: 0 0 24px; opacity: 0.92; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-2); }
.btn-secondary { background: #fff; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-secondary:hover { background: var(--color-surface); }

/* Breadcrumb */
.breadcrumb-wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 20px var(--content-inset) 0;
}
.breadcrumb { font-size: 0.85rem; color: var(--color-text-3); }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li:not(:last-child)::after {
  content: "›";
  color: var(--color-text-3);
  margin-left: 6px;
}
.breadcrumb a { color: var(--color-text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); text-decoration: underline; }

/* List layout */
.list-layout { padding-bottom: 64px; }
.list-container {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 24px var(--content-inset) 0;
}
.cat-side { position: relative; }
.cat-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--color-text);
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
}
.cat-nav { display: block; }
.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.category-list li { border-bottom: 1px solid var(--color-border); }
.category-list li:last-child { border-bottom: none; }
.category-list a {
  display: block;
  padding: 12px 16px;
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.category-list a:hover,
.category-list a.active {
  background: var(--color-surface);
  color: var(--color-primary);
}
.cat-content h1 { margin: 0 0 12px; font-size: 1.8rem; }
.cat-desc { color: var(--color-text-2); margin: 0 0 24px; }
.content-list { display: grid; gap: 20px; }
.list-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 22px;
}
.list-item-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--color-text-3);
}
.list-item-cat { color: var(--color-primary); font-weight: 600; }
.list-item h2 { margin: 0 0 10px; font-size: 1.2rem; }
.list-item h2 a { color: var(--color-text); text-decoration: none; }
.list-item h2 a:hover { color: var(--color-primary); }
.list-item p { margin: 0 0 12px; color: var(--color-text-2); font-size: 0.95rem; }
.list-item-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-text {
  display: inline-block;
  padding: 4px 10px;
  background: var(--color-surface-2);
  color: var(--color-text-3);
  border-radius: 999px;
  font-size: 0.8rem;
}
.empty-state { color: var(--color-text-3); padding: 40px 0; }
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}
.pagination-info { color: var(--color-text-3); font-size: 0.9rem; }

/* Article / Product layout */
.article-layout,
.product-layout,
.page-layout { padding-bottom: 80px; }
.article-container,
.product-container,
.page-container {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  padding: 24px var(--content-inset) 0;
}
.page-container { grid-template-columns: 1fr; max-width: calc(var(--max-content) + var(--content-inset) * 2); }
.article-body,
.product-body,
.page-body { min-width: 0; }
.article-header,
.product-header,
.page-header { margin-bottom: 28px; }
.article-category,
.product-category { margin: 0 0 10px; }
.article-category a,
.product-category a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}
.article-header h1,
.product-header h1,
.page-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: 0 0 14px;
}
.article-summary,
.product-description,
.page-summary {
  font-size: 1.05rem;
  color: var(--color-text-2);
  margin: 0 0 16px;
}
.article-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--color-text-3);
  flex-wrap: wrap;
}
.product-series { color: var(--color-text-3); font-size: 0.9rem; margin: 0 0 12px; }
.status-onsale { color: #16a34a; font-weight: 600; }
.status-discontinued { color: var(--color-text-3); }
.status-presale { color: #d97706; font-weight: 600; }

/* TOC */
.toc-aside { position: sticky; top: calc(var(--header-height) + 24px); align-self: start; max-height: calc(100vh - var(--header-height) - 48px); }
.toc-card {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 20px;
}
.toc-card h2 { margin: 0 0 14px; font-size: 1rem; color: var(--color-text); }
#toc ol { list-style: none; margin: 0; padding: 0; }
#toc li { margin-bottom: 8px; }
#toc a {
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
}
#toc a:hover,
#toc a.active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}

/* Article / Product content */
.article-content,
.product-content,
.page-content {
  font-size: 1.05rem;
  color: var(--color-text-2);
}
.article-content h2,
.product-content h2,
.page-content h2 {
  font-size: 1.45rem;
  color: var(--color-text);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.article-content h3,
.product-content h3,
.page-content h3 {
  font-size: 1.2rem;
  color: var(--color-text);
  margin: 28px 0 12px;
}
.article-content p,
.product-content p,
.page-content p { margin: 0 0 16px; }
.article-content ul,
.product-content ul,
.page-content ul,
.article-content ol,
.product-content ol,
.page-content ol { margin: 0 0 16px; padding-left: 24px; }
.article-content li,
.product-content li,
.page-content li { margin-bottom: 6px; }
.article-content a,
.product-content a,
.page-content a { color: var(--color-primary); text-decoration: none; }
.article-content a:hover,
.product-content a:hover,
.page-content a:hover { text-decoration: underline; }
.article-content blockquote,
.product-content blockquote,
.page-content blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 10px 10px 0;
  color: var(--color-text-2);
}
.article-content blockquote p:last-child,
.product-content blockquote p:last-child,
.page-content blockquote p:last-child { margin-bottom: 0; }

/* Tables */
table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
table.data th,
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
table.data th {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data td { color: var(--color-text-2); }
.param-table-wrap { overflow-x: auto; }

/* FAQ details */
.article-content details,
.product-content details {
  margin: 12px 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.article-content summary,
.product-content summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.article-content summary::-webkit-details-marker,
.product-content summary::-webkit-details-marker { display: none; }
.article-content summary::after,
.product-content summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-primary);
}
.article-content details[open] summary::after,
.product-content details[open] summary::after { content: "−"; }
.article-content details > div,
.product-content details > div { padding: 0 18px 16px; }
.article-content details p,
.product-content details p { margin: 0; }

/* Product figure */
.product-figure {
  margin: 0 0 28px;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  text-align: center;
}
.product-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Tags footer */
.article-footer,
.product-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.article-tags,
.product-tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* Page / Error */
.error-page { min-height: 60vh; display: flex; align-items: center; }
.error-body { text-align: center; padding: 60px 0; }
.error-body h1 { font-size: 5rem; margin: 0; color: var(--color-primary); line-height: 1; }
.error-body p { font-size: 1.15rem; color: var(--color-text-2); margin: 16px 0 28px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Archive */
.archive-year { margin-bottom: 32px; }
.archive-year h2 { font-size: 1.4rem; margin: 0 0 14px; color: var(--color-text); }
.archive-year ul { list-style: none; margin: 0; padding: 0; }
.archive-year li { padding: 10px 0; border-bottom: 1px solid var(--color-border); display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.archive-year time { color: var(--color-text-3); font-size: 0.9rem; min-width: 90px; }
.archive-year a { color: var(--color-text); text-decoration: none; font-weight: 500; }
.archive-year a:hover { color: var(--color-primary); }
.archive-cat { color: var(--color-primary); font-size: 0.85rem; }

/* Floating capsule */
.floating-capsule {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 950;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  overflow: hidden;
}
.capsule-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 56px;
  padding: 14px 8px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.capsule-btn:hover { background: rgba(255,255,255,0.15); }
.capsule-btn + .capsule-btn { border-top: 1px solid rgba(255,255,255,0.2); }

/* WeChat modal */
.wechat-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.wechat-modal[hidden] { display: none; }
.wechat-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.5); }
.wechat-modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  max-width: calc(100vw - 32px);
}
.wechat-modal-content img {
  display: block;
  width: 300px;
  height: 500px;
  object-fit: contain;
  border-radius: 10px;
}
.wechat-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-text);
  color: #fff;
  border: 2px solid #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 40px 24px;
}
.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.footer-slogan { margin: 0; color: var(--color-text-2); font-size: 0.9rem; }
.footer-nav ul { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-nav a { color: var(--color-text-2); text-decoration: none; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--color-primary); }
.footer-copy {
  grid-column: 1 / -1;
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-3);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .article-container,
  .product-container { grid-template-columns: 1fr; }
  .toc-aside { display: none; }
}

@media (max-width: 768px) {
  :root { --content-inset: 16px; }
  .header-inner { padding: 0 16px; }
  .menu-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .primary-nav.is-open { max-height: 400px; }
  .nav-list { flex-direction: column; padding: 12px 16px; gap: 4px; }
  .hero-inner { grid-template-columns: 1fr; padding: 48px 16px; }
  .hero-copy h1 { font-size: 2rem; }
  .section { padding: 48px 16px; }
  .list-container { grid-template-columns: 1fr; gap: 20px; padding-top: 16px; }
  .cat-toggle { display: flex; }
  .cat-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .cat-nav.is-open { max-height: 600px; }
  .category-list { margin-top: 8px; }
  .article-container,
  .product-container,
  .page-container { padding-top: 16px; gap: 24px; }
  .article-header h1,
  .product-header h1,
  .page-header h1 { font-size: 1.55rem; }
  .floating-capsule { right: 12px; }
  .wechat-modal-content img { width: 260px; height: 433px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav ul { gap: 12px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
  .category-grid,
  .solution-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
