:root {
  --orange: #ff4817;
  --ink: #101216;
  --muted: #5f646d;
  --line: #dedfdf;
  --paper: #f1f3f4;
  --dark: #11161d;
  --dark2: #18202b;
  --page-width: min(1280px, calc(100vw - 44px));
  --page-height: min(720px, calc(56.25vw - 24.75px));
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 62px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

body.is-category-route .topbar {
  display: none;
}

body.is-category-route .book {
  padding-top: 22px;
}

body.is-home-route .book {
  min-height: 100vh;
  padding-top: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 128px;
  font-size: 24px;
  font-weight: 900;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 26px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 21px;
  height: 21px;
  background: var(--orange);
  transform: skew(-18deg) rotate(45deg);
}

.brand-mark::before {
  left: 0;
  top: 0;
  opacity: 0.92;
}

.brand-mark::after {
  left: 13px;
  top: 8px;
  opacity: 0.72;
}

.quick-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.quick-nav a,
.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #30343b;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-nav a:hover,
.quick-nav a.is-active {
  border-color: var(--orange);
  color: var(--orange);
}

.admin-link {
  border-color: var(--ink);
}

.admin-link:hover {
  background: var(--ink);
  color: #fff;
}

.book {
  display: grid;
  gap: 22px;
  padding: 26px 0 54px;
}

.page {
  position: relative;
  width: var(--page-width);
  height: var(--page-height);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(16, 18, 22, 0.18);
  scroll-margin-top: 78px;
}

.page-inner {
  position: absolute;
  inset: 0;
  padding: 54px 64px;
}

.page-label {
  position: absolute;
  left: 64px;
  top: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  color: #6a6f77;
  white-space: nowrap;
}

.page-label strong {
  color: #6a6f77;
  font-size: 18px;
  line-height: 1;
}

.product-page .page-label {
  top: 18px;
  gap: 8px;
  font-size: 11px;
}

.product-page .page-label strong {
  font-size: 17px;
}

.page-number {
  display: none;
  position: absolute;
  left: 64px;
  bottom: 36px;
  color: #92969c;
  font-size: 15px;
}

.page-footer {
  position: absolute;
  right: 64px;
  top: 18px;
  bottom: auto;
  color: #6a6f77;
  font-size: 13px;
}

.orange-line {
  width: 156px;
  height: 8px;
  background: var(--orange);
}

.cover-page {
  background: #11151b;
  color: #fff;
}

.cover-page .page-inner {
  display: grid;
  place-items: center;
  text-align: center;
}

.cover-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 70px;
  font-size: clamp(58px, 8vw, 96px);
  font-weight: 900;
}

.cover-mark {
  position: relative;
  width: 86px;
  height: 62px;
}

.cover-mark::before,
.cover-mark::after {
  content: "";
  position: absolute;
  width: 50px;
  height: 50px;
  background: var(--orange);
  transform: skew(-18deg) rotate(45deg);
}

.cover-mark::before {
  left: 0;
  top: 0;
}

.cover-mark::after {
  left: 30px;
  top: 16px;
  opacity: 0.75;
}

.cover-by {
  color: #77808d;
  font-size: 26px;
  letter-spacing: 8px;
}

.cover-tagline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 86px;
  color: #39424f;
  font-size: 18px;
  letter-spacing: 4px;
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  background: #2b333e;
}

.corner::before {
  width: 18px;
  height: 2px;
  top: 8px;
}

.corner::after {
  width: 2px;
  height: 18px;
  left: 8px;
}

.corner.tl { left: 34px; top: 34px; }
.corner.tr { right: 34px; top: 34px; }
.corner.bl { left: 34px; bottom: 34px; }
.corner.br { right: 34px; bottom: 34px; }

.toc-content {
  padding: 72px 42px 30px;
}

.toc-title {
  margin-bottom: 20px;
}

.toc-title .small {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.toc-title h1 {
  margin: 0;
  font-size: clamp(21px, 2.4vw, 31px);
  line-height: 1.08;
  font-weight: 500;
}

.toc-title .orange-line {
  width: 122px;
  height: 6px;
  margin-top: 16px;
}

.toc-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 52px;
}

.toc-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 66px;
  padding: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.toc-item:last-child {
  border-bottom: 1px solid var(--line);
}

.toc-item-empty {
  pointer-events: none;
}

.toc-start {
  color: var(--orange);
  padding-left: 10px;
  font-size: 14px;
  font-weight: 700;
}

.toc-name {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 66px;
}

.toc-name strong {
  font-size: 16px;
  line-height: 1.05;
  font-weight: 500;
}

.toc-name span,
.toc-count {
  color: #60656d;
  font-size: 13px;
  font-weight: 400;
}

.toc-count {
  display: none;
  text-align: right;
}

.scenario-page {
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 72, 23, 0.08), transparent 28%),
    linear-gradient(135deg, #f0f2f4 0%, #e6e9ed 48%, #f8f9fa 100%);
  color: var(--ink);
}

.scenario-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16,18,22,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,18,22,0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
}

.scenario-page .page-label,
.scenario-page .page-label strong,
.scenario-page .page-footer,
.scenario-page .page-number {
  color: #6a6f77;
}

.scenario-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  height: 100%;
  padding: 92px 72px 80px;
}

.scenario-kicker {
  margin: 0 0 28px;
  color: var(--orange);
  font-size: 25px;
  font-weight: 800;
}

.scenario-content h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(56px, 7vw, 86px);
  line-height: 1.1;
  font-weight: 500;
}

.scenario-content .orange-line {
  margin: 42px 0;
}

.scenario-content p {
  max-width: 980px;
  margin: 0;
  color: #5b6068;
  font-size: 26px;
  line-height: 1.62;
  font-weight: 600;
}

.scenario-index {
  position: absolute;
  right: 70px;
  bottom: 92px;
  color: rgba(16, 18, 22, 0.06);
  font-size: 132px;
  font-weight: 900;
  line-height: 1;
}

.product-content {
  display: grid;
  grid-template-columns: 30% 1fr;
  gap: 46px;
  height: 100%;
  padding: 18px 64px 42px;
}

.product-media {
  display: grid;
  align-content: center;
  justify-items: center;
  padding-top: 34px;
}

.main-image-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  height: 388px;
}

.main-product-image {
  max-width: 100%;
  max-height: 378px;
  object-fit: contain;
}

.image-placeholder {
  display: grid;
  place-items: center;
  width: 280px;
  height: 280px;
  border: 1px dashed #c8c8c8;
  color: #9ba0a7;
  font-size: 36px;
  font-weight: 900;
}

.thumbs {
  display: flex;
  gap: 18px;
  justify-content: center;
  min-height: 58px;
  margin-top: 18px;
}

.thumb {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 72, 23, 0.55);
  background: #fff;
  cursor: pointer;
}

.thumb.is-active {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px rgba(255, 72, 23, 0.18);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-copy {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
  min-height: 0;
  padding-top: 56px;
}

.product-category {
  display: none;
  color: #626870;
  font-size: 12px;
  margin-bottom: 4px;
}

.product-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1;
  text-align: left;
}

.position {
  margin: 0 0 18px;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 700;
}

.product-copy .orange-line {
  width: 126px;
  height: 6px;
  margin-bottom: 0;
}

.product-detail-block {
  align-self: stretch;
  position: relative;
  display: grid;
  align-content: center;
  gap: 20px;
  width: 100%;
  min-height: 0;
  margin-top: 15px;
  padding: 24px 0 22px;
  perspective: 1200px;
  --switch-x: 28px;
  --switch-tilt: 0.65deg;
}

.product-detail-block.has-detail-pages {
  padding-bottom: 54px;
  cursor: pointer;
}

.product-detail-block[data-switch-direction="prev"] {
  --switch-x: -28px;
  --switch-tilt: -0.65deg;
}

.detail-page {
  display: none;
  align-self: center;
  gap: 20px;
  transform-origin: 50% 42%;
  will-change: opacity, transform, filter;
}

.detail-page.is-active {
  display: grid;
  animation: macWindowSwitch 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.detail-pager {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6a6f77;
  font-size: 12px;
  font-weight: 700;
}

.detail-pager::before {
  content: "";
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 72, 23, 0.55));
}

.detail-pager::after {
  content: "";
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 72, 23, 0.55), transparent);
}

.detail-pager button {
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid #c6ccd4;
  background: #fff;
  color: #6a6f77;
  cursor: pointer;
}

.detail-pager button.is-active {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 72, 23, 0.28);
}

@keyframes macWindowSwitch {
  0% {
    opacity: 0;
    transform: translate3d(var(--switch-x), 14px, 0) scale(0.965) rotateX(1.4deg) rotateZ(var(--switch-tilt));
    filter: blur(7px);
  }
  58% {
    opacity: 1;
    transform: translate3d(calc(var(--switch-x) * -0.08), -2px, 0) scale(1.006) rotateX(0deg) rotateZ(0deg);
    filter: blur(0.8px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateX(0deg) rotateZ(0deg);
    filter: blur(0);
  }
}

.section {
  margin-bottom: 0;
}

.section.is-empty {
  display: none;
}

.section h2 {
  display: inline-block;
  min-width: 124px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--orange);
  font-size: 20px;
  line-height: 1.1;
}

.info-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.info-list li::before {
  content: attr(data-num);
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
  padding-top: 2px;
}

.product-page.image-right .product-content {
  grid-template-columns: 1fr 30%;
}

.product-page.image-right .product-media {
  order: 2;
}

.product-page.image-right .product-copy {
  order: 1;
  padding-top: 56px;
}

.back-cover {
  background: #11151b;
  color: #fff;
}

.back-cover .page-inner {
  display: grid;
  place-items: center;
  text-align: center;
}

.contact-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 72px;
  font-size: 54px;
  font-weight: 900;
}

.contact-title {
  margin: 0 0 40px;
  font-size: 34px;
}

.contact-sub {
  color: #9ba6b3;
  font-size: 18px;
  margin-bottom: 46px;
}

.contact-row {
  display: flex;
  gap: 34px;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
}

.contact-dot {
  width: 10px;
  height: 10px;
  margin: 58px auto 0;
  background: var(--orange);
}

@media (max-width: 900px) {
  :root {
    --page-width: min(100vw - 20px, 560px);
    --page-height: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
    font-size: 22px;
  }

  .quick-nav {
    gap: 6px;
    padding-bottom: 2px;
  }

  .quick-nav a,
  .admin-link {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .top-actions {
    position: absolute;
    right: 10px;
    top: 10px;
  }

  .book {
    gap: 16px;
    padding: 12px 0 28px;
  }

  body.is-category-route .book {
    padding-top: 10px;
  }

  .page {
    width: var(--page-width);
    height: auto;
    min-height: calc(100svh - 24px);
    aspect-ratio: auto;
    overflow: visible;
    box-shadow: 0 10px 28px rgba(16, 18, 22, 0.14);
  }

  .page-inner {
    position: relative;
    inset: auto;
    min-height: calc(100svh - 24px);
    padding: 54px 24px 42px;
  }

  .page-label {
    left: 24px;
    top: 18px;
    max-width: calc(100% - 48px);
    overflow: hidden;
    font-size: 11px;
  }

  .page-label strong,
  .product-page .page-label strong {
    font-size: 16px;
  }

  .page-footer {
    right: 24px;
    top: auto;
    bottom: 18px;
    max-width: calc(100% - 48px);
    font-size: 11px;
    text-align: right;
  }

  .orange-line {
    width: 96px;
    height: 5px;
  }

  .cover-page,
  .back-cover {
    min-height: calc(100svh - 24px);
    overflow: hidden;
  }

  .cover-logo {
    gap: 12px;
    margin-bottom: 38px;
    font-size: 42px;
  }

  .cover-mark {
    width: 48px;
    height: 36px;
  }

  .cover-mark::before,
  .cover-mark::after {
    width: 30px;
    height: 30px;
  }

  .cover-mark::after {
    left: 18px;
    top: 10px;
  }

  .cover-by {
    font-size: 15px;
    letter-spacing: 4px;
  }

  .cover-tagline {
    bottom: 52px;
    padding: 0 26px;
    font-size: 11px;
    line-height: 1.7;
    letter-spacing: 2px;
  }

  .corner.tl { left: 20px; top: 20px; }
  .corner.tr { right: 20px; top: 20px; }
  .corner.bl { left: 20px; bottom: 20px; }
  .corner.br { right: 20px; bottom: 20px; }

  .toc-content {
    padding: 70px 18px 34px;
  }

  .toc-title {
    margin-bottom: 22px;
  }

  .toc-title h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .toc-title .orange-line {
    width: 92px;
    height: 5px;
    margin-top: 14px;
  }

  .toc-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    min-height: 58px;
  }

  .toc-name {
    min-height: 58px;
    gap: 6px;
  }

  .toc-name strong {
    font-size: 15px;
    line-height: 1.2;
  }

  .toc-name span,
  .toc-count {
    font-size: 12px;
  }

  .toc-start {
    padding-left: 0;
    font-size: 13px;
  }

  .toc-item-empty {
    display: none;
  }

  .scenario-content {
    min-height: calc(100svh - 24px);
    padding: 90px 26px 76px;
  }

  .scenario-kicker {
    margin-bottom: 16px;
    font-size: 18px;
  }

  .scenario-content h1 {
    font-size: 42px;
    line-height: 1.15;
  }

  .scenario-content .orange-line {
    margin: 24px 0;
  }

  .scenario-content p {
    font-size: 17px;
    line-height: 1.7;
  }

  .scenario-index {
    right: 24px;
    bottom: 54px;
    font-size: 72px;
  }

  .product-content,
  .product-page.image-right .product-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: calc(100svh - 24px);
    padding: 58px 24px 54px;
  }

  .product-media,
  .product-page.image-right .product-media {
    order: 1;
    padding-top: 0;
  }

  .product-copy,
  .product-page.image-right .product-copy {
    order: 2;
    display: block;
    padding-top: 0;
  }

  .product-copy h1 {
    margin-bottom: 10px;
    font-size: 34px;
    line-height: 1.05;
    word-break: break-word;
  }

  .position {
    margin-bottom: 14px;
    font-size: 18px;
    line-height: 1.35;
  }

  .main-image-wrap {
    height: auto;
    min-height: 210px;
    max-height: 320px;
  }

  .main-product-image {
    max-height: 300px;
  }

  .thumbs {
    gap: 10px;
    min-height: 42px;
    margin-top: 12px;
    flex-wrap: wrap;
  }

  .thumb {
    width: 38px;
    height: 38px;
  }

  .product-detail-block {
    display: block;
    margin-top: 15px;
    padding: 18px 0 20px;
  }

  .product-detail-block.has-detail-pages {
    padding-bottom: 48px;
  }

  .product-detail-block {
    --switch-x: 14px;
    --switch-tilt: 0.35deg;
  }

  .product-detail-block[data-switch-direction="prev"] {
    --switch-x: -14px;
    --switch-tilt: -0.35deg;
  }

  .detail-page.is-active {
    display: block;
    animation-duration: 360ms;
  }

  .detail-page,
  .detail-page.is-active {
    gap: 18px;
  }

  .section + .section {
    margin-top: 20px;
  }

  .section h2 {
    min-width: 104px;
    margin-bottom: 9px;
    font-size: 18px;
  }

  .info-list {
    gap: 9px;
  }

  .info-list li {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    font-size: 13px;
    line-height: 1.6;
  }

  .info-list li::before {
    font-size: 12px;
  }

  .detail-pager {
    bottom: 8px;
  }

  .contact-logo {
    gap: 10px;
    margin-bottom: 42px;
    font-size: 38px;
  }

  .contact-title {
    margin-bottom: 28px;
    font-size: 28px;
  }

  .contact-sub {
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.7;
  }

  .contact-row {
    flex-direction: column;
    gap: 12px;
    font-size: 17px;
  }

  .contact-row span:nth-child(even) {
    display: none;
  }

  .contact-dot {
    margin-top: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-page.is-active {
    animation: none;
  }
}
