:root {
  --brand: #0a5fd8;
  --brand-dark: #06479f;
  --brand-soft: #eaf3ff;
  --ink: #172033;
  --muted: #687386;
  --line: #dfe5ec;
  --surface: #ffffff;
  --page: #f5f7fa;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(20, 42, 74, 0.08);
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(10, 95, 216, 0.08), transparent 34rem),
    var(--page);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

[data-theme="oem"] {
  --brand: #185b74;
  --brand-dark: #104153;
  --brand-soft: #e9f3f6;
}

[data-theme="oem"] .yq-only,
html:not([data-theme="oem"]) .oem-only {
  display: none !important;
}

.page-width {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 229, 236, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.brand-neutral {
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.header-inner nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #3b4658;
  font-size: 14px;
}

.header-inner nav a:hover,
.back-link:hover {
  color: var(--brand);
}

.catalog-page {
  padding-block: 72px 80px;
}

.hero {
  max-width: 720px;
  margin-bottom: 42px;
}

.eyebrow,
.manual-model {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.product-info h1 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 58px);
}

.hero > p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.catalog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.search-box {
  width: min(100%, 560px);
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 42, 74, 0.04);
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 95, 216, 0.12);
}

.search-box span {
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.manual-count {
  color: var(--muted);
  white-space: nowrap;
}

.status-panel {
  width: 100%;
  padding: 32px;
  border: 1px dashed #c9d3df;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

.status-panel.is-error {
  border-color: #f3b8b1;
  background: #fff5f4;
  color: var(--danger);
}

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

.manual-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(223, 229, 236, 0.95);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.manual-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(20, 42, 74, 0.13);
}

.manual-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-bottom: 1px solid var(--line);
  object-fit: cover;
  background: var(--brand-soft);
}

.manual-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}

.manual-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
}

.manual-version {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  margin-top: auto;
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.empty-state {
  grid-column: 1 / -1;
}

.site-footer {
  padding-block: 26px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.viewer-body {
  height: 100vh;
  overflow: hidden;
}

.viewer-header .header-inner {
  min-height: 58px;
}

.back-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.viewer-page {
  height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  padding-block: 18px;
}

#viewer-content {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.product-info h1 {
  font-size: clamp(23px, 3vw, 32px);
}

.product-info > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.viewer-actions,
.language-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.language-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding-inline: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.qr-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

#qrcode {
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  padding: 6px;
  background: #fff;
}

#qrcode img,
#qrcode canvas {
  width: 100%;
  height: 100%;
}

.qr-panel p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.pdf-shell {
  min-height: 360px;
  flex: 1;
  overflow: hidden;
  border: 1px solid #cbd4df;
  border-radius: 14px;
  background: #d9dde3;
  box-shadow: var(--shadow);
}

#pdf-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #d9dde3;
}

@media (max-width: 900px) {
  .manual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-inner nav {
    gap: 14px;
  }
}

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

  .site-header .header-inner {
    min-height: 56px;
    padding-block: 10px;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .header-inner nav {
    display: flex;
    flex: 0 0 100%;
    justify-content: center;
    gap: 28px;
    padding-top: 8px;
    border-top: 1px solid rgba(223, 229, 236, 0.85);
    font-size: 13px;
  }

  .catalog-page {
    padding-block: 42px 56px;
  }

  .hero {
    margin-bottom: 30px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .catalog-tools,
  .product-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-count {
    font-size: 13px;
  }

  .manual-grid {
    grid-template-columns: 1fr;
  }

  .manual-card-content {
    padding: 20px;
  }

  .viewer-body {
    display: flex;
    flex-direction: column;
  }

  .viewer-page {
    height: auto;
    min-height: 0;
    flex: 1;
    padding-block: 12px;
  }

  .product-bar {
    gap: 12px;
    margin-bottom: 12px;
  }

  .viewer-actions {
    justify-content: space-between;
  }

  .qr-panel {
    align-items: flex-start;
  }

  #qrcode {
    width: 112px;
    height: 112px;
    flex-basis: 112px;
  }

  .pdf-shell {
    min-height: 0;
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
