:root {
  --ink: #17212b;
  --muted: #607080;
  --line: #dbe2e8;
  --surface: #ffffff;
  --surface-soft: #f4f7f8;
  --sidebar: #10212a;
  --sidebar-muted: #91a6b2;
  --shopee: #e94f2c;
  --tiktok: #123b4a;
  --lazada: #254fbf;
  --accent: #157f72;
  --warning: #a64b15;
  --shadow: 0 10px 28px rgba(23, 33, 43, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--sidebar);
  background-size: 28px 28px;
  z-index: 20;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.25;
}

.brand p {
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-mark span {
  display: block;
  background: #fff;
}

.brand-mark span:nth-child(1) {
  height: 45%;
}

.brand-mark span:nth-child(2) {
  height: 100%;
}

.brand-mark span:nth-child(3) {
  height: 70%;
}

.primary-nav {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--sidebar-muted);
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-left-color: var(--accent);
}

.nav-index {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  opacity: 0.7;
}

.progress-panel {
  margin-top: auto;
  padding: 16px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.progress-heading strong {
  color: #fff;
}

.progress-track {
  height: 5px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.text-button {
  padding: 5px 0;
  color: var(--sidebar-muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  cursor: pointer;
}

.text-button:hover {
  color: #fff;
}

.main {
  min-height: 100vh;
  margin-left: 270px;
}

.mobile-bar {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 34px;
  background: rgba(244, 247, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.search-wrap {
  position: relative;
  width: min(620px, 100%);
}

.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 54px 0 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 127, 114, 0.1);
}

.search-wrap kbd {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.quiet-button,
.icon-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.quiet-button:hover,
.icon-button:hover {
  color: var(--ink);
  border-color: #aebbc5;
}

.content {
  width: min(1220px, calc(100% - 68px));
  margin: 0 auto;
  padding: 38px 0 70px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.18;
  letter-spacing: 0;
}

.page-head .lead {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.page-meta {
  min-width: 180px;
  display: grid;
  gap: 8px;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 12px;
}

.platform-value {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.platform-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  background: var(--line);
  border: 1px solid var(--line);
}

.platform-tile {
  position: relative;
  min-height: 230px;
  padding: 24px;
  background: var(--surface);
  border: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.platform-tile::after {
  content: "";
  position: absolute;
  inset: auto -35px -55px auto;
  width: 140px;
  height: 140px;
  border: 20px solid color-mix(in srgb, var(--tile-color) 14%, transparent);
  transform: rotate(16deg);
}

.platform-tile:hover {
  background: #fbfcfc;
}

.platform-monogram {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: var(--tile-color);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
}

.platform-tile h3 {
  margin: 18px 0 4px;
  font-size: 22px;
  line-height: 1.3;
}

.platform-tile .tile-note {
  color: var(--muted);
  font-size: 13px;
}

.platform-tile p {
  max-width: 92%;
  margin: 14px 0 0;
  color: var(--muted);
}

.platform-tile .tile-count {
  position: absolute;
  right: 20px;
  bottom: 18px;
  color: var(--tile-color);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  z-index: 1;
}

.section-block {
  margin-top: 40px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading h3 {
  margin: 0;
  font-size: 22px;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scrollbar-width: thin;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.module-list {
  display: grid;
  gap: 10px;
}

.module {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--platform-color, var(--accent));
  border-radius: var(--radius);
  box-shadow: 0 1px 1px rgba(23, 33, 43, 0.02);
}

.module[open] {
  box-shadow: var(--shadow);
}

.module summary {
  list-style: none;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 16px 18px;
  cursor: pointer;
}

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

.module-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.module-title-wrap {
  min-width: 0;
}

.module-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.module-summary {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tag {
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
}

.module-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 28px;
  padding: 0 22px 24px 66px;
}

.module-body h4 {
  margin: 20px 0 8px;
  font-size: 14px;
}

.module-body h4:first-child {
  margin-top: 0;
}

.knowledge-list,
.action-list,
.risk-list {
  margin: 0;
  padding-left: 1.2em;
}

.knowledge-list li,
.action-list li,
.risk-list li {
  margin: 6px 0;
}

.action-list {
  list-style: decimal;
}

.risk-box {
  padding: 16px;
  background: #fff8f2;
  border-left: 3px solid var(--warning);
}

.reference-line {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.reference-line strong {
  color: var(--ink);
}

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px 18px 66px;
}

.done-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.done-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.platform-band {
  margin: 28px 0 0;
  padding: 24px;
  color: #fff;
  background: var(--platform-color);
}

.platform-band p {
  max-width: 860px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.empty-state {
  padding: 50px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.comparison-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

.comparison-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.comparison-table th {
  color: var(--ink);
  background: #edf2f4;
  font-size: 12px;
  z-index: 2;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 150px;
  color: var(--ink);
  font-weight: 700;
}

.comparison-table tr:last-child td {
  border-bottom: 0;
}

@media (max-height: 760px) and (min-width: 761px) {
  .topbar {
    min-height: 58px;
    padding-block: 7px;
  }

  .content {
    padding-top: 24px;
  }

  .comparison-head {
    padding-bottom: 16px;
  }

  .comparison-head h2 {
    font-size: clamp(26px, 2.8vw, 34px);
  }

  .comparison-head .lead {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
  }

  .comparison-section {
    margin-top: 18px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 10px 14px;
    line-height: 1.55;
  }
}

@media (min-width: 1240px) {
  .comparison-table-wrap {
    overflow: visible;
  }

  .comparison-table th {
    position: sticky;
    top: 72px;
  }
}

@media (min-width: 1240px) and (max-height: 760px) {
  .comparison-table th {
    top: 58px;
  }
}

.playbook-list {
  display: grid;
  gap: 1px;
  margin-top: 24px;
  background: var(--line);
  border: 1px solid var(--line);
}

.playbook {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(210px, 0.55fr);
  gap: 22px;
  padding: 22px;
  background: var(--surface);
}

.playbook-phase {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.playbook h3 {
  margin: 0;
  font-size: 18px;
}

.playbook p {
  margin: 6px 0 0;
  color: var(--muted);
}

.playbook ul {
  margin: 0;
  padding-left: 1.2em;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  background: var(--line);
  border: 1px solid var(--line);
}

.source-item {
  min-height: 150px;
  padding: 20px;
  background: var(--surface);
}

.source-item .source-type {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.source-item h3 {
  margin: 8px 0 5px;
  font-size: 16px;
}

.source-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.source-item a {
  display: inline-block;
  margin-top: 12px;
  color: var(--lazada);
  text-decoration: none;
}

.source-item a:hover {
  text-decoration: underline;
}

.search-hit {
  padding: 0 2px;
  color: inherit;
  background: #fff0a8;
}

@media (max-width: 1040px) {
  .platform-overview {
    grid-template-columns: 1fr;
  }

  .platform-tile {
    min-height: 190px;
  }

  .module-body {
    grid-template-columns: 1fr;
    padding-left: 22px;
  }

  .module-footer {
    padding-left: 22px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 8px 14px;
    color: #fff;
    background: var(--sidebar);
  }

  .mobile-bar button {
    min-height: 32px;
    padding: 0 9px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 4px;
  }

  .topbar {
    top: 54px;
    display: grid;
    padding: 10px 14px;
  }

  .topbar-actions {
    display: none;
  }

  .content {
    width: calc(100% - 28px);
    padding-top: 24px;
  }

  .page-head {
    grid-template-columns: 1fr;
  }

  .page-meta {
    padding-left: 14px;
  }

  .module summary {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 14px;
  }

  .module-tags {
    grid-column: 2;
    justify-content: flex-start;
  }

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

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

}

@media print {
  .sidebar,
  .mobile-bar,
  .topbar,
  .filter-bar,
  .module-footer,
  .text-button {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .main {
    margin: 0;
  }

  .content {
    width: 100%;
    padding: 0;
  }

  .module {
    break-inside: avoid;
    box-shadow: none;
  }

  .module-body {
    display: block;
  }
}
