/* Duo Cai Hui guide atlas — single-column directory layout.
   Intentionally unlike Jin Zun: no purple theme, no 2-col sidebar, no white card grid. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;800&family=Noto+Serif+TC:wght@600;700&display=swap");

.atlas-page {
  --atlas-ink: #f4ebe3;
  --atlas-mute: #b9a89c;
  --atlas-dim: #7d6d66;
  --atlas-line: rgba(232, 211, 162, 0.16);
  --atlas-wine: #861a2d;
  --atlas-wine-deep: #3b0d15;
  --atlas-gold: #d8b873;
  --atlas-panel: rgba(25, 16, 17, 0.72);
  color: var(--atlas-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.atlas-shell {
  width: min(calc(100% - 48px), 920px);
  margin: 0 auto;
  padding-bottom: 56px;
}

.atlas-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 18px 0 8px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--atlas-line);
}

.atlas-tabs a {
  position: relative;
  padding: 6px 0;
  color: var(--atlas-mute);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.atlas-tabs a:hover {
  color: var(--atlas-gold);
}

.atlas-tabs a.is-active {
  color: var(--atlas-ink);
  font-weight: 700;
}

.atlas-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -15px;
  height: 2px;
  background: linear-gradient(90deg, var(--atlas-wine), var(--atlas-gold));
}

.atlas-masthead {
  position: relative;
  margin: 28px 0 36px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--atlas-line);
  overflow: hidden;
}

.atlas-masthead::before {
  content: "";
  position: absolute;
  inset: -20% 40% auto -12%;
  height: 160%;
  background:
    linear-gradient(118deg, rgba(134, 26, 45, 0.38), transparent 58%),
    radial-gradient(circle at 20% 40%, rgba(216, 184, 115, 0.12), transparent 46%);
  transform: skewX(-12deg);
  pointer-events: none;
}

.atlas-kicker {
  position: relative;
  margin: 0 0 10px;
  color: var(--atlas-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.atlas-masthead h1 {
  position: relative;
  margin: 0;
  max-width: 16ch;
  font-family: "Noto Serif TC", "Noto Serif", serif;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff8ec 0%, #e4c98f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.atlas-lede {
  position: relative;
  max-width: 42rem;
  margin: 14px 0 0;
  color: var(--atlas-mute);
  font-size: 15px;
  line-height: 1.7;
}

.atlas-chapter {
  margin: 0 0 42px;
  padding-top: 6px;
}

.atlas-chapter-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.atlas-index {
  font-family: "Noto Serif TC", serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: rgba(216, 184, 115, 0.55);
}

.atlas-chapter h2 {
  margin: 4px 0 6px;
  font-family: "Noto Serif TC", serif;
  font-size: 24px;
  font-weight: 700;
}

.atlas-chapter-head p,
.atlas-copy {
  margin: 0;
  color: var(--atlas-mute);
  font-size: 14px;
  line-height: 1.75;
}

.atlas-copy + .atlas-copy {
  margin-top: 10px;
}

.atlas-alert {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(134, 26, 45, 0.45);
  border-top: 3px solid var(--atlas-wine);
  background: linear-gradient(180deg, rgba(134, 26, 45, 0.18), rgba(25, 16, 17, 0.35));
  color: #f0ddd6;
  font-size: 13px;
  line-height: 1.7;
}

.atlas-alert strong {
  display: block;
  margin-bottom: 4px;
  color: var(--atlas-gold);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.atlas-dir {
  display: flex;
  flex-direction: column;
  margin: 8px 0 0;
  border-top: 1px solid var(--atlas-line);
}

.atlas-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--atlas-line);
  color: inherit;
  text-decoration: none;
  transition: background 0.18s ease, padding-left 0.18s ease;
}

.atlas-row:hover,
.atlas-row:focus-visible {
  background: linear-gradient(90deg, rgba(134, 26, 45, 0.16), transparent 70%);
  outline: none;
  padding-left: 10px;
}

.atlas-row img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
}

.atlas-row b {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.atlas-row em {
  display: block;
  margin-top: 3px;
  color: var(--atlas-dim);
  font-style: normal;
  font-size: 12px;
}

.atlas-row span {
  color: var(--atlas-gold);
  font-size: 12px;
  white-space: nowrap;
}

.atlas-steps {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--atlas-line);
}

.atlas-steps li {
  position: relative;
  margin: 0;
  padding: 0 0 18px 22px;
  color: var(--atlas-mute);
  font-size: 14px;
  line-height: 1.7;
}

.atlas-steps li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--atlas-wine);
  box-shadow: 0 0 0 3px rgba(134, 26, 45, 0.25);
}

.atlas-subhead {
  margin: 28px 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.atlas-video {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.atlas-video article {
  overflow: hidden;
  border: 1px solid var(--atlas-line);
  background: var(--atlas-panel);
}

.atlas-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #10080a;
}

.atlas-video h4 {
  margin: 12px 14px 4px;
  font-size: 14px;
}

.atlas-video a {
  display: inline-block;
  margin: 0 14px 14px;
  color: var(--atlas-gold);
  font-size: 12px;
  text-decoration: none;
}

.atlas-related {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.atlas-related a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--atlas-line);
  color: var(--atlas-mute);
  background: rgba(134, 26, 45, 0.12);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.atlas-related a:hover {
  border-color: rgba(216, 184, 115, 0.45);
  color: var(--atlas-gold);
}

.atlas-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--atlas-line);
  color: var(--atlas-dim);
  font-size: 12px;
}

.atlas-foot a {
  color: var(--atlas-gold);
  text-decoration: none;
}

@media (max-width: 720px) {
  .atlas-shell {
    width: calc(100% - 28px);
  }

  .atlas-chapter-head {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .atlas-index {
    font-size: 30px;
  }

  .atlas-chapter h2 {
    font-size: 20px;
  }

  .atlas-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .atlas-row img {
    width: 44px;
    height: 44px;
  }

  .atlas-row span {
    grid-column: 2;
  }
}

/* Stable layout guard: long third-party names or URLs must never expand the page. */
body.atlas-page { overflow-x: hidden; background: #10080a; }
.atlas-page .atlas-shell, .atlas-page .atlas-row, .atlas-page .atlas-row > *, .atlas-page .atlas-row div { min-width: 0; }
.atlas-page .atlas-masthead { margin-top: 24px; padding: 30px 32px; border: 1px solid var(--atlas-line); border-radius: 18px; background: linear-gradient(135deg, rgba(134, 26, 45, 0.2), rgba(25, 16, 17, 0.78) 58%); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16); }
.atlas-page .atlas-row b, .atlas-page .atlas-row em, .atlas-page .atlas-row span { overflow: hidden; text-overflow: ellipsis; }
.atlas-page .atlas-row b, .atlas-page .atlas-row em { white-space: nowrap; }
.atlas-page .atlas-chapter { scroll-margin-top: 116px; }
@media (max-width: 720px) { .atlas-page .atlas-masthead { margin-top: 18px; padding: 24px 20px; border-radius: 14px; } .atlas-page .atlas-row span { white-space: normal; overflow-wrap: anywhere; } }

/* Guide pages deliberately opt out of the platform-directory canvas. */
body.atlas-page,
body.atlas-page[data-platform-page] {
  color: #263746 !important;
  background: #eef3f7 !important;
}

body.atlas-page .platform-page,
body.atlas-page[data-platform-page] .platform-page {
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

body.atlas-page .platform-header.brandbar {
  min-height: 104px !important;
  padding: 0 max(32px, calc((100vw - 1120px) / 2)) !important;
  border: 0 !important;
  background: linear-gradient(110deg, #152b3c, #213e53) !important;
  box-shadow: none !important;
}

body.atlas-page .brandbar.fade { box-shadow: none !important; }
body.atlas-page .home-brand-image { width: 190px !important; height: 70px !important; }
body.atlas-page .platform-header .site-nav {
  position: static !important;
  display: flex !important;
  gap: 8px !important;
  margin-left: auto !important;
  transform: none !important;
}
body.atlas-page .platform-header .site-nav a {
  padding: 9px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: rgba(255,255,255,.84) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
body.atlas-page .platform-header .site-nav a:hover,
body.atlas-page .platform-header .site-nav a.is-active {
  border-color: rgba(218,187,113,.42) !important;
  color: #fff3d4 !important;
  background: rgba(255,255,255,.10) !important;
}

body.atlas-page .atlas-shell {
  width: min(calc(100% - 48px), 1040px) !important;
  margin: 38px auto 0 !important;
  padding: 0 46px 58px !important;
  border: 1px solid #dce6ed;
  border-radius: 20px 20px 0 0;
  background: #fff;
  box-shadow: 0 16px 40px rgba(31, 62, 82, .09);
}
body.atlas-page .atlas-tabs { margin: 0 -46px 30px !important; padding: 16px 46px !important; border-bottom-color: #e4ebf0 !important; background: #f8fafc; }
body.atlas-page .atlas-tabs a { color: #718394 !important; font-size: 14px !important; }
body.atlas-page .atlas-tabs a:hover, body.atlas-page .atlas-tabs a.is-active { color: #1f658e !important; }
body.atlas-page .atlas-tabs a.is-active::after { bottom: -17px !important; background: #2c88b8 !important; }
body.atlas-page .atlas-masthead { margin: 0 0 40px !important; border-color: #dbe7ef !important; background: linear-gradient(135deg, #e7f4fa, #f9fbfd 63%) !important; box-shadow: none !important; }
body.atlas-page .atlas-kicker { color: #397a9f !important; }
body.atlas-page .atlas-masthead h1, body.atlas-page .atlas-chapter h2 { color: #213d50 !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
body.atlas-page .atlas-lede, body.atlas-page .atlas-chapter-head p, body.atlas-page .atlas-copy { color: #617484 !important; }
body.atlas-page .atlas-index { color: #90bbd1 !important; }
body.atlas-page .atlas-alert { border-color: #c7dfeb !important; border-top-color: #4594bd !important; background: #f2f9fc !important; color: #456274 !important; }
body.atlas-page .atlas-alert strong, body.atlas-page .atlas-row span, body.atlas-page .atlas-video a, body.atlas-page .atlas-foot a { color: #287aa6 !important; }
body.atlas-page .atlas-dir, body.atlas-page .atlas-row, body.atlas-page .atlas-foot { border-color: #e2ebf0 !important; }
body.atlas-page .atlas-row { padding: 14px 12px !important; border-radius: 10px; }
body.atlas-page .atlas-row:hover, body.atlas-page .atlas-row:focus-visible { background: #f1f8fb !important; padding-left: 18px !important; }
body.atlas-page .atlas-row img { border-radius: 10px; box-shadow: 0 4px 10px rgba(34, 70, 92, .10); }
body.atlas-page .atlas-row em, body.atlas-page .atlas-steps li, body.atlas-page .atlas-foot { color: #718394 !important; }
body.atlas-page .atlas-steps { border-left-color: #bcd7e5 !important; }
body.atlas-page .atlas-steps li::before { background: #3b91bc !important; box-shadow: 0 0 0 3px #dceff7 !important; }
body.atlas-page .atlas-related a, body.atlas-page .atlas-video article { border-color: #d9e7ee !important; color: #527084 !important; background: #f7fafc !important; }

/* Keep the three guide mastheads compact on both desktop and mobile. */
body.atlas-page .atlas-masthead {
  padding: 24px 28px !important;
  margin-bottom: 30px !important;
}
body.atlas-page .atlas-masthead h1 {
  font-size: clamp(30px, 3.8vw, 42px) !important;
}
body.atlas-page .atlas-lede { margin-top: 10px !important; font-size: 14px !important; }

@media (max-width: 720px) {
  body.atlas-page .platform-header.brandbar { min-height: 76px !important; padding: 0 16px !important; }
  body.atlas-page .home-brand-image { width: 142px !important; height: 54px !important; }
  body.atlas-page .platform-header .mobile-nav-toggle { position: absolute !important; right: 16px !important; display: grid !important; margin: 0 !important; }
  body.atlas-page .platform-header .site-nav { display: none !important; }
  body.atlas-page .platform-header .site-nav.is-open { position: absolute !important; top: 76px; left: 0; right: 0; z-index: 8; display: grid !important; margin: 0 !important; padding: 10px 16px 16px !important; border-radius: 0 0 14px 14px !important; background: #1e3a4e !important; }
  body.atlas-page .atlas-shell { width: calc(100% - 24px) !important; margin-top: 20px !important; padding: 0 18px 40px !important; border-radius: 14px 14px 0 0; }
  body.atlas-page .atlas-tabs { margin: 0 -18px 22px !important; padding: 13px 18px !important; }
  body.atlas-page .atlas-masthead { padding: 20px 18px !important; margin-bottom: 24px !important; }
  body.atlas-page .atlas-masthead h1 { font-size: 30px !important; }
}
