/* SmartUSBHub Website — Shared Styles */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@200;300;400&display=swap');

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

:root {
  --bg:         #ffffff;
  --bg-subtle:  #f7f7f7;
  --bg-section: #f2f2f2;
  --border:     #e0e0e0;
  --border-mid: #cccccc;
  --text:       #111111;
  --text-muted: #555555;
  --text-dim:   #999999;
  --led:        #cc0000;
  --font:       'Jost', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --mono:       'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

html {
  font-size: 22px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}

a:hover { opacity: 0.55; }

hr.rule {
  border: none;
  border-top: 0.5px solid var(--border);
}

img {
  display: block;
  max-width: 100%;
}

/* ─── Bilingual ─────────────────────────────────────────── */
.en { display: none; }
body.lang-en .zh  { display: none; }
body.lang-en .en  { display: inline; }

.en-b { display: none; }
body.lang-en .zh-b  { display: none; }
body.lang-en .en-b  { display: block; }

/* ─── Navigation ────────────────────────────────────────── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  height: 54px;
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
}

.nav-brand {
  font-size: 18px;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.nav-center {
  display: flex;
  gap: 36px;
}

.nav-center a {
  font-size: 15px;
  text-decoration: none;
  color: var(--text-muted);
}

.nav-center a:hover { color: var(--text); opacity: 1; }
.nav-center a.active { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.nav-right button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
  padding: 4px 6px;
  letter-spacing: 0.04em;
}

.nav-right button.active {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}

.nav-right .sep {
  color: var(--text-dim);
  font-size: 11px;
}

/* ─── Section base ──────────────────────────────────────── */
.section {
  padding: 72px 40px 80px;
  position: relative;
}

.section-tag {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 44px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 48px;
}

.section-header .section-tag { margin-bottom: 0; }

.section-header a {
  font-size: 13px;
  color: var(--text-muted);
}

.corner-label {
  position: absolute;
  bottom: 20px;
  left: 40px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 72px 40px 72px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.hero-eyebrow {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 720px;
  margin-bottom: 28px;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 44px;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 36px;
  align-items: baseline;
}

.hero-actions a {
  font-size: 16px;
}

.hero-actions a.dim {
  color: var(--text-dim);
}

.hero-product-hint {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Image placeholder ─────────────────────────────────── */
.img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border: 0.5px dashed #1e1e1e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.img-placeholder span {
  font-size: 10px;
  color: #2a2a2a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.img-placeholder .img-hint {
  font-size: 10px;
  color: #1e1e1e;
}

/* ─── Product grid ──────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product-cell {
  padding: 56px 40px 88px;
  border-right: 0.5px solid var(--border);
  position: relative;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.product-cell:last-child { border-right: none; }

.product-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  min-height: 260px;
}

.product-sku {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.product-name {
  font-size: 26px;
  font-weight: 200;
  line-height: 1.2;
  margin-bottom: 14px;
}

.product-desc {
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
}

.product-specs {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 0.5px solid var(--border);
  margin-bottom: 28px;
}

.spec-item {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spec-item span {
  display: block;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 300;
  margin-top: 4px;
}

/* ─── Spec table ─────────────────────────────────────────── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.spec-table tr { border-bottom: 0.5px solid var(--border); }

.spec-table td {
  padding: 13px 0;
  vertical-align: top;
  line-height: 1.5;
}

.spec-table td:first-child {
  color: var(--text-muted);
  width: 46%;
}

/* ─── Code block ─────────────────────────────────────────── */
/* Wrapper: replaces .code-block at runtime via JS + highlight.js */
.code-wrap {
  position: relative;
  border: 0.5px solid #e0e0e0;
}

.code-wrap pre {
  margin: 0;
  overflow-x: auto;
}

.code-wrap pre code.hljs {
  background: #f6f8fa;
  padding: 24px 32px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.85;
  display: block;
}

/* Fallback for pages without JS upgrade */
.code-block {
  background: #f6f8fa;
  border: 0.5px solid #e0e0e0;
  padding: 24px 32px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  white-space: pre;
  overflow-x: auto;
  tab-size: 4;
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.85);
  border: 0.5px solid #d0d0d0;
  border-radius: 3px;
  padding: 4px 10px;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.code-wrap:hover .code-copy-btn { opacity: 1; }
.code-block:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:focus-visible { opacity: 1; outline: 2px solid var(--text); outline-offset: 2px; }
.code-copy-btn:hover { color: var(--text); border-color: #aaa; }
.code-copy-btn.copied { color: #4a9b6f; border-color: #4a9b6f; }

/* ─── Two-column layout ─────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

/* ─── Capability grid ───────────────────────────────────── */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0.5px solid var(--border);
  border-left: 0.5px solid var(--border);
}

.cap-cell {
  padding: 30px 24px 36px;
  border-right: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}

.cap-icon {
  margin-bottom: 20px;
  opacity: 0.5;
  line-height: 0;
}

.cap-title {
  font-size: 16px;
  font-weight: 300;
  margin-bottom: 9px;
}

.cap-body {
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Inline list ───────────────────────────────────────── */
.inline-list {
  list-style: none;
  border-top: 0.5px solid var(--border);
}

.inline-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
  line-height: 1.45;
}

.inline-list li::before {
  content: '';
  width: 18px;
  height: 0.5px;
  background: var(--text-dim);
  flex-shrink: 0;
}

.inline-list .meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
}

/* ─── Platform row ──────────────────────────────────────── */
.platform-row {
  display: flex;
  gap: 32px;
  padding-top: 28px;
  border-top: 0.5px solid var(--border);
  margin-top: 28px;
}

.platform-badge {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Stat block ────────────────────────────────────────── */
.stat-row {
  display: flex;
  gap: 64px;
}

.stat-item {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-item span {
  display: block;
  font-size: 48px;
  color: var(--text);
  font-weight: 200;
  letter-spacing: -0.02em;
  text-transform: none;
  margin-top: 6px;
  line-height: 1;
}

/* ─── LED ───────────────────────────────────────────────── */
.led {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 6px var(--led);
  vertical-align: middle;
}

.led.off {
  background: #1a1a1a;
  box-shadow: none;
}

/* ─── Doc cards ─────────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 0.5px solid var(--border);
  border-left: 0.5px solid var(--border);
}

.doc-card {
  padding: 32px 28px 40px;
  border-right: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: block;
}

.doc-card:hover {
  background: var(--bg-subtle);
  opacity: 1;
}

.doc-card-icon {
  margin-bottom: 20px;
  opacity: 0.45;
  line-height: 0;
}

.doc-card-title {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 10px;
}

.doc-card-body {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Footer ────────────────────────────────────────────── */
footer.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 52px 40px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  font-size: 13px;
  margin-bottom: 14px;
}

.footer-tagline {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-weight: 300;
}

.footer-col a {
  display: block;
  font-size: 17px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 12px;
}

.footer-col a:hover { color: var(--text); opacity: 1; }

.footer-bottom {
  border-top: 0.5px solid #111;
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ─── Comparison table ──────────────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.compare-table th,
.compare-table td {
  padding: 15px 20px;
  text-align: left;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}

.compare-table th {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--border-mid);
}

.compare-table th:first-child { color: var(--text-dim); }

.compare-table td:first-child {
  color: var(--text-muted);
  font-size: 17px;
}

.check {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a1a1a;
  vertical-align: middle;
}

.check.yes { background: #2a2a2a; box-shadow: 0 0 0 1px #444 inset; }

/* ─── Ordering code block ───────────────────────────────── */
.order-block {
  border: 0.5px solid var(--border);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.order-code {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.06em;
}

.order-desc {
  color: var(--text-muted);
  max-width: 360px;
}

/* ─── Quick start steps ─────────────────────────────────── */
.steps {
  counter-reset: step;
}

.step {
  display: flex;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 0.5px solid var(--border);
  counter-increment: step;
}

.step-num {
  font-size: 11px;
  color: var(--text-dim);
  width: 40px;
  flex-shrink: 0;
  padding-top: 2px;
}

.step-num::before {
  content: "0" counter(step);
  letter-spacing: 0.06em;
}

.step-content h3 {
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 12px;
}

.step-content p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.legacy-notice {
  margin-top: 28px;
  max-width: 760px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  background: var(--bg-subtle);
  font-size: 15px;
  color: var(--text-muted);
}

.legacy-notice a { color: var(--text); }
.example-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.example-grid > * { min-width: 0; }
.table-scroll { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }

@media (hover: none), (pointer: coarse) {
  .code-copy-btn { opacity: 1; }
}

@media (max-width: 820px) {
  html { font-size: 19px; }
  body { overflow-x: hidden; }
  .nav {
    height: auto;
    min-height: 54px;
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 8px 18px;
  }
  .nav-center {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 24px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .section { padding: 52px 20px 58px; }
  .two-col { grid-template-columns: 1fr; gap: 36px !important; }
  .two-col > * { min-width: 0; }
  .example-grid { grid-template-columns: minmax(0, 1fr); }
  .platform-row { gap: 12px 18px; }
  .table-scroll .compare-table { min-width: 640px; }
  footer.site-footer {
    padding: 44px 20px 32px;
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom { padding: 18px 20px; }
}

@media (max-width: 520px) {
  html { font-size: 18px; }
  .nav-center { gap: 18px; }
  .section { padding: 44px 18px 50px; }
  .section-tag { margin-bottom: 30px; }
  .code-wrap pre code.hljs,
  .code-block { padding: 20px 18px; font-size: 12.5px; }
  .code-copy-btn { top: 6px; right: 6px; }
  .example-grid > div { padding: 24px 18px !important; }
  footer.site-footer { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
}
