:root {
  --color0: #DEDEDE;
  --color-black: #111111;
  --color-white: #FBFBFB;
  --color1: #1E5EFF;
  --color-secondary-text: #898989;
  --color6-secondary-blue: #80D0FF;
  --color7-selecting-blue: #5485FF;
}

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

body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, PingFangSC-Regular, "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: var(--color-black);
  background-color: var(--color0);
  font-weight: 300;
}

img {
  vertical-align: bottom;
}

ul {
  list-style: none;
}

a {
  color: var(--color-black);
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* ===============================
   Bottom fade overlay (iOS-style)
================================= */
.detailContent::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent 0%, var(--color0) 100%);
  pointer-events: none;
  z-index: 100;
}

/* ===============================
   Page wrapper
================================= */
.detailContent {
  width: 100%;
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  position: relative;
}

/* ===============================
   Language toggle  (fixed top-right)
================================= */
.langToggle {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 60px;
  height: 20px;
  border: 1px solid var(--color1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 0;
  z-index: 300;
  background: var(--color0);
  cursor: pointer;
}

.langOpt {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 400;
  color: var(--color1);
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.langOpt.active {
  background: var(--color1);
  color: var(--color-white);
}

/* ===============================
   Scrollable rows
================================= */
.detailRows {
  padding-left: 20px;
  padding-bottom: 100px;
}

.detailRow {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  margin-bottom: 50px;
}

/* ===============================
   Image block
================================= */
.detailImg {
  width: 750px;
  aspect-ratio: 3 / 2;
  flex-shrink: 0;
  overflow: hidden;
  margin-right: 20px;
  background: #c8c8c8;
}

.detailImg img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ===============================
   Row 1 — project meta (right column, bottom-aligned)
================================= */
.detailMeta {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Part 1: title + subtitle */
.metaTitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-black);
  line-height: 1.2;
  margin-bottom: 4px;
}

.metaSub p {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-secondary-text);
  line-height: 1.3;
  margin: 0;
}

/* Part 2: role / scope / focus blocks — vertical */
.metaBlocks {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metaBlockHead {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.metaBlockHead img {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.metaBlockHead span {
  font-size: 10px;
  font-weight: 700;
  color: var(--color1);
}

.metaBlock p {
  font-size: 10px;
  font-weight: 400;
  color: var(--color-black);
  line-height: 1.4;
  margin: 0;
}

/* Part 3: description */
.metaDesc {
  margin-top: 30px;
}

.metaDesc p {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-black);
  line-height: 1.6;
  margin: 0;
}

.metaDesc p + p {
  margin-top: 8px;
}

/* ===============================
   Rows 2-8 — section caption (right column, bottom-aligned)
================================= */
.detailCaption {
  max-width: 500px;
}

.captionMain {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-black);
  line-height: 1.4;
  margin: 0;
}

.captionSub {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-black);
  line-height: 1.4;
  margin: 0;
}

/* ===============================
   Progress nav — vertical, fixed right
================================= */
.detailProgress {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 200;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid #ffffff;
  padding: 16px 10px;
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.progressItem {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 3;
  min-height: 0;
  width: 100%;
  cursor: pointer;
}

.progressDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.15);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.progressItem.active .progressDot {
  background: var(--color1);
}

.progressItem.reached .progressDot {
  background: var(--color1-faded);
}

.progressText {
  margin-top: 6px;
  flex-shrink: 0;
  text-align: center;
  width: 100%;
}

.progressLabelEn,
.progressLabelZh {
  display: block;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(17, 17, 17, 0.3);
  transition: color 0.2s ease;
}

.progressItem.active .progressLabelEn,
.progressItem.active .progressLabelZh {
  color: var(--color-black);
}

.progressItem.reached .progressLabelEn,
.progressItem.reached .progressLabelZh {
  color: rgba(17, 17, 17, 0.5);
}

/* vertical dashed line between items */
.progressLine {
  flex: 1;
  width: 1px;
  min-height: 6px;
  margin-top: 4px;
  border-left: 1px dashed var(--color1-light);
  transition: border-color 0.2s ease;
}

.progressLine.reached {
  border-color: var(--color1-mid);
}

/* ===============================
   Progress bar toggle button
   (only shown at 768px–1280px)
================================= */
.progressToggle {
  display: none;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #ffffff;
  padding: 0;
  cursor: url('../assets/cursor/cursor-pointer.svg') 6 2, pointer;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.progressToggle .progressToggleIcon {
  font-size: 14px;
  color: var(--color1);
  line-height: 1;
}

/* ===============================
   Responsive — 768px ~ 1280px
   (single-column layout, vertical progress bar)
================================= */
@media (max-width: 1280px) {
  .progressToggle {
    display: flex;
  }

  .detailProgress {
    overflow: visible;
    padding-top: 26px; /* room for toggle button protruding above */
  }

  .detailProgress.is-collapsed {
    height: 0;
    padding: 0;
    background: transparent;
    border-color: transparent;
  }

  .detailProgress.is-collapsed .progressItem,
  .detailProgress.is-collapsed .progressLine {
    display: none;
  }

  .detailRows {
    padding: 0 20px 100px;
  }

  .detailRow {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 20px;
  }

  .detailImg {
    width: 100%;
    aspect-ratio: 3 / 2;
    flex-shrink: 1;
    margin-right: 0;
    order: 1;
  }

  .detailMeta {
    order: 0;
    max-width: none;
    justify-content: flex-start;
    margin-bottom: 6px;
  }

  .detailCaption {
    order: 0;
    max-width: none;
    margin-bottom: 6px;
  }

  .metaBlocks {
    order: 3;
    margin-top: 16px;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
  }

  .metaHeader { order: 1; }
  .metaDesc   { order: 2; margin-top: 12px; }

  .metaBlockHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ===============================
   Responsive — 768px and below
   (horizontal progress bar)
================================= */
@media (max-width: 768px) {
  .detailProgress {
    width: auto;
    height: auto;
    right: auto;
    top: auto;
    transform: translateX(-50%);
    left: 50%;
    bottom: 60px;
    flex-direction: row;
    align-items: flex-start;
    padding: 6px 8px;
    max-width: calc(100% - 24px);
  }

  .progressItem {
    flex: 1;
    min-width: 0;
    max-width: none;
    width: auto;
    position: relative;
    align-items: center;
  }

  .progressItem.active {
    z-index: 2;
  }

  /* first item: text left-aligned under dot */
  .progressItem.is-first .progressText {
    align-items: flex-start;
  }

  /* last item: text right-aligned under dot */
  .progressItem.is-last .progressText {
    align-items: flex-end;
  }

  /* center labels via flex column on progressText */
  .progressText {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /* non-active: shrink to content but cap at parent width so truncation works */
  .progressLabelEn,
  .progressLabelZh {
    width: auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* active: remove cap so full label shows */
  .progressItem.active .progressLabelEn,
  .progressItem.active .progressLabelZh {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
  }

  .progressItem::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -10px;
    right: -10px;
    bottom: -6px;
  }

  .progressLine {
    flex: 1;
    min-width: 10px;
    width: auto;
    height: 0;
    border-left: none;
    border-top: 1px dashed var(--color1-light);
    margin-top: 4px;
    align-self: flex-start;
    flex: 0 0 10px;
    min-width: 0;
  }

  .progressLine.reached {
    border-top-color: var(--color1-mid);
    border-left: none;
  }

  .progressToggle {
    display: none;
  }

  .detailProgress {
    overflow: hidden;
    padding-top: 8px;
  }

  .langToggle {
    right: 12px;
  }
}
