:root {
  --bg-page: #03090d;
  --bg-sidebar: #061116;
  --bg-header: #07151a;
  --bg-panel: #091c22;
  --bg-panel-alt: #0c242b;
  --bg-inset: #051318;

  --border-subtle: rgba(118, 183, 179, 0.1);
  --border-normal: rgba(78, 188, 178, 0.22);
  --border-emphasis: rgba(68, 223, 207, 0.48);

  --accent: #42d8c7;
  --accent-bright: #63eadb;
  --accent-muted: #2a948a;
  --accent-bg: rgba(66, 216, 199, 0.08);

  --text-primary: #e7f2f1;
  --text-secondary: #a5b9b8;
  --text-muted: #698382;

  --purple: #a98aeb;
  --gold: #d6ae61;
  --danger: #ce7180;

  --radius-s: 8px;
  --radius-m: 10px;
  --radius-l: 12px;

  --sidebar-width: 312px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  color: var(--text-secondary);
  line-height: 1.6;
  background: radial-gradient(
      circle at 74% 10%,
      rgba(33, 115, 109, 0.12),
      transparent 36%
    ),
    radial-gradient(circle at 18% 82%, rgba(30, 83, 92, 0.08), transparent 34%),
    linear-gradient(180deg, #03090d 0%, #061017 44%, #040b10 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: radial-gradient(
      circle at 50% 50%,
      rgba(108, 178, 167, 0.8) 1px,
      transparent 1px
    ),
    linear-gradient(rgba(91, 149, 145, 0.36) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 149, 145, 0.36) 1px, transparent 1px);
  background-size: 140px 140px, 56px 56px, 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 86%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.02;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-l);
  background: linear-gradient(
    160deg,
    rgba(12, 36, 43, 0.96),
    rgba(7, 22, 27, 0.98)
  );
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    rgba(7, 18, 24, 0.98),
    rgba(5, 13, 18, 0.98)
  );
  box-shadow: inset -16px 0 22px rgba(0, 0, 0, 0.32),
    8px 0 18px rgba(0, 0, 0, 0.24);
}

.sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sidebar-title-row h2 {
  margin: 0;
  font-size: 15px;
  color: var(--accent-bright);
  letter-spacing: 0.12em;
}

.ornament {
  color: var(--accent);
  font-size: 12px;
}

.title-line {
  width: 52px;
  height: 1px;
  margin-left: auto;
  background: linear-gradient(90deg, rgba(102, 164, 161, 0.54), transparent);
}

.sidebar-progress {
  padding: 4px 0 2px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
}

.progress-meta strong {
  color: var(--text-primary);
  font-size: 16px;
  letter-spacing: 0.04em;
}

.progress-split {
  color: var(--text-muted);
  margin: 0 2px;
}

.segmented-progress {
  margin-top: 6px;
  display: flex;
  gap: 3px;
  min-height: 7px;
}

.segmented-progress span {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 7px;
  border-radius: 2px;
  background: rgba(61, 87, 94, 0.72);
}

.segmented-progress span.is-filled {
  background: linear-gradient(180deg, #66d9ca, #2d8f86);
  box-shadow: 0 0 4px rgba(64, 170, 161, 0.26);
}

.sidebar-actions {
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: rgba(6, 20, 26, 0.58);
}

.hud-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.hud-button:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.hud-button.is-active {
  color: var(--accent-bright);
  background: var(--accent-bg);
  border-color: var(--border-normal);
}

.search-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(107, 154, 150, 0.22);
  border-radius: 9px;
  background: rgba(5, 16, 21, 0.75);
  padding: 0 10px;
}

.search-icon {
  color: var(--text-muted);
  font-size: 13px;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
}

.search-clear {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(107, 154, 150, 0.35);
  border-radius: 999px;
  background: rgba(18, 41, 49, 0.68);
  color: #9ec8c5;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.search-clear:hover {
  color: #d4efec;
  border-color: rgba(133, 196, 190, 0.52);
}

.search-input::placeholder {
  color: #657d7c;
}

.search-wrap:focus-within {
  border-color: var(--border-emphasis);
  box-shadow: 0 0 0 2px rgba(66, 216, 199, 0.12);
}

.search-input:focus {
  outline: none;
}

.skill-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 12px;
}

.skill-item {
  margin: 0 0 2px;
}

.skill-row {
  position: relative;
  display: grid;
  grid-template-columns: 2rem 2.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 5px 12px;
  border-bottom: 1px solid rgba(105, 176, 171, 0.09);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.skill-row:hover {
  background: rgba(66, 216, 199, 0.06);
}

.skill-item.is-expanded .skill-row,
.skill-item.is-target .skill-row {
  background: rgba(66, 216, 199, 0.11);
}

.skill-item.is-expanded .skill-row::before,
.skill-item.is-target .skill-row::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.skill-no {
  font-family: Consolas, Monaco, monospace;
  color: #8ea3a2;
  font-size: 12px;
  font-weight: 700;
}

.skill-icon {
  width: 31px;
  height: 31px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(89, 118, 122, 0.48);
}

.skill-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.patch-badge {
  padding: 1px 5px;
  border: 1px solid rgba(104, 137, 138, 0.34);
  border-radius: 4px;
  font-size: 10px;
  color: #91a8a7;
  font-family: Consolas, Monaco, monospace;
}

.learn-toggle {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(106, 138, 140, 0.4);
  border-radius: 5px;
  background: rgba(7, 18, 23, 0.9);
  color: #6d8584;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.learn-toggle.is-learned {
  color: var(--accent-bright);
  border-color: rgba(101, 186, 176, 0.62);
  background: rgba(66, 216, 199, 0.1);
}

.chevron {
  color: #5f7574;
  font-size: 9px;
  transition: transform 0.2s ease, color 0.18s ease;
}

.skill-row:hover .chevron,
.skill-item.is-expanded .chevron {
  color: #a4c0bd;
}

.skill-item.is-expanded .chevron {
  transform: rotate(180deg);
}

.skill-source {
  display: none;
  margin: 0 12px 8px;
  padding: 9px 10px 10px;
  border: 1px solid rgba(96, 133, 132, 0.24);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(6, 15, 20, 0.9);
}

.skill-item.is-expanded .skill-source {
  display: block;
}

.skill-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(212, 174, 97, 0.4);
  color: var(--gold);
  font-size: 11px;
}

.status-chip.is-learned {
  border-color: rgba(109, 191, 183, 0.6);
  color: #8de0d4;
}

.source-row {
  display: grid;
  grid-template-columns: 16px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-secondary);
}

.source-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.source-dot {
  color: var(--accent-muted);
  font-size: 9px;
}

.source-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(101, 134, 133, 0.35);
  color: #7d9594;
  font-size: 10px;
}

.main-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.brand-nav-shell {
  margin: 10px 14px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px 12px 0 0;
  background: linear-gradient(
    180deg,
    rgba(9, 21, 27, 0.92),
    rgba(7, 16, 22, 0.9)
  );
  position: relative;
  z-index: 3;
}

.site-header {
  min-height: 92px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid rgba(78, 188, 178, 0.14);
  background: linear-gradient(
    135deg,
    rgba(8, 27, 33, 0.98),
    rgba(4, 15, 20, 0.98)
  );
}

.sidebar-toggle {
  display: none;
}

.site-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-brand__mask {
  width: 54px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  transform: scale(2.2);
  filter: drop-shadow(0 0 5px rgba(66, 216, 199, 0.16));
}

.site-brand__text,
.site-title-wrap {
  min-width: 0;
}

.site-title {
  margin: 0;
  font-family: 'Noto Serif TC', 'PMingLiU', 'Yu Mincho', serif;
  font-size: clamp(24px, 2.2vw, 31px);
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: var(--text-primary);
}

.site-subtitle {
  margin: 6px 0 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.header-progress {
  --icon-saturation: 0;
  width: clamp(190px, 20vw, 230px);
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid rgba(78, 188, 178, 0.22);
  background: linear-gradient(
    135deg,
    rgba(13, 39, 45, 0.88),
    rgba(6, 22, 28, 0.9)
  );
}

.header-progress__icon {
  width: 46px;
  height: 46px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center;
  transform: scale(2);
  transform-origin: center;
  filter: saturate(var(--icon-saturation))
    grayscale(calc(1 - var(--icon-saturation)))
    drop-shadow(0 0 8px rgba(66, 216, 199, 0.22));
}

.header-progress__content {
  min-width: 0;
  flex: 1;
}

.header-progress-label {
  margin: 0;
  font-size: 11px;
  color: #89a4a3;
  letter-spacing: 0.07em;
}

.header-progress-count {
  margin-top: 2px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.header-progress-count strong {
  color: var(--accent-bright);
  font-size: 24px;
  line-height: 1;
}

.header-progress-count span,
.header-progress-count em {
  color: #96abab;
  font-style: normal;
  font-size: 14px;
}

.header-progress-track {
  margin-top: 7px;
  height: 4px;
  border-radius: 999px;
  background: rgba(62, 88, 92, 0.58);
  overflow: hidden;
}

.header-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fcdbf, #7be4d7);
  box-shadow: 0 0 5px rgba(85, 190, 180, 0.2);
  transition: width 0.25s ease;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  min-height: 54px;
  background: rgba(6, 15, 20, 0.76);
  border-top: 1px solid rgba(107, 148, 145, 0.14);
  border-bottom: 1px solid rgba(67, 197, 186, 0.16);
}

.main-tab {
  position: relative;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  color: #9caead;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.main-tab::after {
  content: '';
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.main-tab:hover {
  color: #bdd5d3;
}

.main-tab.is-active {
  color: var(--accent-bright);
  background: rgba(66, 216, 199, 0.07);
}

.main-tab.is-active::after {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(54, 218, 201, 0.35);
}

.content-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 0 28px;
}

.page-shell,
.main-content-inner {
  width: min(1120px, calc(100% - 56px));
  margin-inline: auto;
}

.tab-panel[hidden] {
  display: none;
}

.page-intro {
  margin-bottom: 28px;
  text-align: center;
}

.page-eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.page-title {
  margin: 4px 0 5px;
  color: #67dfd0;
  font-family: 'Noto Serif TC', 'PMingLiU', 'Yu Mincho', serif;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: 0.04em;
}

.page-meta {
  margin: 0;
  color: #95aaab;
  font-size: 13px;
}

.section-title {
  margin: 0 0 8px;
  color: var(--accent-bright);
  font-family: 'Noto Serif TC', 'PMingLiU', 'Yu Mincho', serif;
  font-size: clamp(25px, 2.5vw, 32px);
  letter-spacing: 0.05em;
  text-align: center;
}

.section-date {
  text-align: center;
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-size: 13px;
}

.card-list {
  display: grid;
  gap: 14px;
  width: min(960px, 100%);
  margin: 0 auto;
}

.challenge-card,
.masquerade-card,
.detail-card {
  position: relative;
  border: 1px solid rgba(75, 189, 178, 0.22);
  border-radius: 11px;
  background: linear-gradient(
    145deg,
    rgba(12, 35, 41, 0.96),
    rgba(6, 20, 26, 0.98)
  );
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 14px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.challenge-card::after,
.masquerade-card::after,
.detail-card::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(114, 156, 153, 0.35);
  border-bottom: 1px solid rgba(114, 156, 153, 0.35);
}

.challenge-card:hover,
.masquerade-card:hover,
.detail-card:hover {
  border-color: rgba(74, 217, 201, 0.42);
  transform: translateY(-1px);
}

.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(108, 156, 152, 0.14);
}

.card-head-main {
  display: flex;
  align-items: start;
  gap: 9px;
  min-width: 0;
}

.stage-heading {
  min-width: 0;
}

.stage-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
}

.stage-subtitle {
  margin: 2px 0 0;
  color: #7f9494;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-meta {
  color: #8ca1a1;
  font-size: 12px;
  letter-spacing: 0.07em;
  white-space: nowrap;
  text-align: right;
  padding-top: 2px;
}

.level-chip {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid currentColor;
  background: rgba(6, 18, 23, 0.58);
  flex-shrink: 0;
}

.weekly-macro-chip {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease;
}

.weekly-macro-chip:hover {
  transform: translateY(-1px);
  background: rgba(14, 34, 40, 0.74);
}

.weekly-macro-chip[data-copy-state='done'] {
  color: #79e0b3;
  border-color: rgba(121, 224, 179, 0.68);
  background: rgba(17, 55, 41, 0.78);
}

.weekly-macro-chip[data-copy-state='error'] {
  color: #f1a9a9;
  border-color: rgba(241, 169, 169, 0.68);
  background: rgba(58, 24, 24, 0.78);
}

.level-chip.level-beginner {
  color: #68d8ca;
}

.level-chip.level-intermediate {
  color: #a98aeb;
}

.level-chip.level-advanced,
.level-chip.level-extreme {
  color: #d6ae61;
}

.weekly-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.weekly-tag {
  position: relative;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(214, 174, 97, 0.42);
  color: var(--gold);
  font-size: 11px;
}

.weekly-tag[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 4;
  min-width: 140px;
  max-width: 280px;
  padding: 6px 8px;
  border: 1px solid rgba(109, 144, 143, 0.42);
  border-radius: 8px;
  background: rgba(8, 18, 24, 0.95);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}

.skill-group-label {
  display: block;
  margin-bottom: 6px;
  color: #9cb0b0;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.skill-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 8px;
}

.skill-icon-item {
  width: 46px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.skill-icon-item:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.skill-icon-item img,
.skill-icon-item .empty-slot {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.skill-icon-item img {
  border: 1px solid rgba(79, 104, 109, 0.7);
}

.skill-icon-item:hover img {
  box-shadow: 0 8px 10px -8px rgba(66, 216, 199, 0.8);
}

.skill-icon-item .empty-slot {
  border: 1px solid rgba(78, 101, 104, 0.6);
  background: rgba(11, 23, 28, 0.76);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  opacity: 0.55;
}

.skill-icon-no {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-family: Consolas, Monaco, monospace;
  font-size: 10px;
  color: #9bb2b1;
}

.strategy-note {
  margin-top: 11px;
  border: 1px solid rgba(94, 126, 129, 0.28);
  border-radius: 9px;
  background: linear-gradient(
    180deg,
    rgba(8, 20, 25, 0.74),
    rgba(5, 14, 19, 0.9)
  );
  padding: 12px 14px;
}

.strategy-title {
  margin: 0 0 8px;
  color: #9ec8c5;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.strategy-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.72;
  font-size: 14px;
}

.strategy-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.strategy-steps li {
  color: var(--text-secondary);
  line-height: 1.72;
  font-size: 14px;
}

.strategy-steps li::before {
  content: attr(data-step);
  display: inline-block;
  width: 1.8em;
  margin-right: 6px;
  color: #85b6b1;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.spellbook-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.spellbook-overview,
.filter-panel,
.detail-panel {
  padding: 14px;
}

.overview-head,
.filter-row,
.detail-head,
.detail-card-head,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.overview-head h2,
.detail-head h3,
.detail-title {
  margin: 0;
  color: var(--text-primary);
}

.overview-total strong {
  color: var(--accent-bright);
  font-size: 32px;
}

.progress-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.overall-ring {
  --progress: 0;
  width: 132px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--accent) calc(var(--progress) * 1%),
    rgba(24, 56, 60, 0.74) 0
  );
  position: relative;
}

.overall-ring::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: var(--bg-inset);
}

.ring-inner {
  position: relative;
  z-index: 3;
  text-align: center;
  pointer-events: none;
}

.ring-inner .label,
.ring-inner .count {
  font-size: 11px;
  color: var(--text-muted);
}

.ring-inner strong {
  color: var(--text-primary);
  font-size: 23px;
  letter-spacing: 0.03em;
}

.ring-hover-layer {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 2;
}

.ring-hover-zone {
  position: relative;
  cursor: pointer;
  transition: background 0.16s ease;
}

.ring-hover-zone--left:hover {
  background: linear-gradient(
    90deg,
    rgba(92, 215, 206, 0.56) 0%,
    rgba(92, 215, 206, 0.2) 55%,
    transparent 100%
  );
}

.ring-hover-zone--right:hover {
  background: linear-gradient(
    270deg,
    rgba(214, 174, 97, 0.56) 0%,
    rgba(214, 174, 97, 0.2) 55%,
    transparent 100%
  );
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 26px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: rgba(106, 145, 142, 0.34);
}

.timeline-stage {
  text-align: center;
  color: var(--accent);
}

.timeline-stage.stage-515 {
  color: #7ac9e6;
}

.timeline-stage.stage-545 {
  color: var(--purple);
}

.timeline-stage.stage-645 {
  color: var(--gold);
}

.timeline-node {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: rgba(8, 28, 34, 0.76);
  position: relative;
  overflow: hidden;
}

.timeline-node-hover-layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 1;
}

.timeline-node-text {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.timeline-count {
  display: block;
  margin-top: 7px;
  color: var(--text-primary);
  font-size: 18px;
}

.timeline-percent {
  color: var(--text-secondary);
  font-size: 12px;
}

.timeline-bar {
  width: 86%;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(35, 65, 70, 0.72);
}

.timeline-bar span {
  display: block;
  height: 100%;
  background: currentColor;
}

.filter-title {
  min-width: 62px;
  color: var(--text-secondary);
  font-size: 12px;
}

.filter-btn {
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(99, 139, 138, 0.32);
  border-radius: 7px;
  background: rgba(5, 17, 22, 0.74);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--accent-bright);
  border-color: var(--border-emphasis);
  background: rgba(66, 216, 199, 0.08);
}

.detail-list,
.detail-sources {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.detail-card-layout {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-card-content {
  min-width: 0;
}

.detail-skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(96, 132, 135, 0.56);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.detail-skill-icon--empty {
  display: block;
  background: rgba(9, 22, 27, 0.86);
  border-style: dashed;
}

.masquerade-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 28px auto 30px;
  text-align: left;
}

.masquerade-heading__icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(66, 216, 199, 0.16));
}

.masquerade-heading__content {
  min-width: 0;
}

.masquerade-heading .page-eyebrow,
.masquerade-heading .page-title,
.masquerade-heading .page-meta {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.masquerade-card__watermark {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 58px;
  height: 44px;
  object-fit: contain;
  opacity: 0.055;
  pointer-events: none;
  user-select: none;
  filter: none;
}

.slot-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 0 8px;
}

.contact-panel {
  width: min(780px, 100%);
  margin: 56px auto;
  padding: 32px 32px 26px;
  display: grid;
  grid-template-columns: clamp(180px, 27%, 210px) minmax(0, 1fr);
  align-items: end;
  gap: 28px;
  border: 1px solid rgba(82, 225, 219, 0.22);
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    rgba(8, 35, 40, 0.97),
    rgba(5, 25, 30, 0.97)
  );
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.contact-character-area {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  animation: contact-char-enter 0.45s ease both;
}

.contact-character-area::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(77, 230, 224, 0.05);
  filter: blur(35px);
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
}

.contact-emblem {
  width: min(205px, 100%);
  height: clamp(280px, 32vw, 340px);
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: none;
}

.contact-content {
  min-width: 0;
  text-align: left;
  animation: contact-content-enter 0.45s ease both 0.04s;
}

.contact-content .page-eyebrow {
  margin: 0 0 6px;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #89a6a5;
}

.contact-content .section-title {
  margin: 0;
  text-align: left;
}

.contact-description {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.contact-note {
  margin: 10px 0 0;
  color: #7f9a99;
  font-size: 12px;
  line-height: 1.5;
}

.contact-links {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.contact-link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  min-height: 66px;
  border: 1px solid rgba(115, 174, 177, 0.28);
  border-radius: 9px;
  background: rgba(3, 20, 24, 0.42);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 12px;
  transition: transform 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-link[href] {
  cursor: pointer;
}

.contact-icon {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) saturate(100%) invert(83%) sepia(8%) saturate(448%)
    hue-rotate(124deg) brightness(89%) contrast(89%);
  transition: filter 0.18s ease;
}

.contact-text {
  min-width: 0;
}

.contact-action-icon {
  width: 14px;
  height: 14px;
  opacity: 0.78;
  filter: brightness(0) saturate(100%) invert(83%) sepia(8%) saturate(448%)
    hue-rotate(124deg) brightness(89%) contrast(89%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(73, 231, 224, 0.62);
  background: rgba(73, 231, 224, 0.055);
  box-shadow: 0 8px 24px rgba(0, 229, 220, 0.07);
}

.contact-link:hover .contact-icon,
.contact-link:focus-visible .contact-icon {
  filter: brightness(0) saturate(100%) invert(84%) sepia(33%) saturate(294%)
    hue-rotate(116deg) brightness(94%) contrast(90%);
}

.contact-link:hover .contact-action-icon,
.contact-link:focus-visible .contact-action-icon {
  opacity: 1;
  transform: translate(1px, -1px);
}

.contact-link:focus-visible,
.contact-copy-btn:focus-visible {
  outline: 2px solid rgba(73, 231, 224, 0.65);
  outline-offset: 2px;
}

.contact-link--static {
  cursor: default;
}

.contact-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-value {
  display: block;
  font-weight: 700;
  color: #d8ecea;
  font-size: 15px;
  line-height: 1.25;
}

.contact-copy-btn {
  min-width: 56px;
  height: 30px;
  border: 1px solid rgba(122, 181, 183, 0.4);
  border-radius: 999px;
  background: rgba(9, 32, 37, 0.7);
  color: #c6e3e1;
  font-size: 12px;
  line-height: 1;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.contact-copy-btn:hover {
  border-color: rgba(73, 231, 224, 0.7);
  color: #e7f8f7;
  background: rgba(73, 231, 224, 0.12);
}

.contact-copy-btn[data-copy-state='done'] {
  border-color: rgba(111, 222, 158, 0.7);
  color: #c9f7dc;
  background: rgba(111, 222, 158, 0.14);
}

.contact-copy-btn[data-copy-state='error'] {
  border-color: rgba(230, 167, 104, 0.7);
  color: #f2d7bf;
  background: rgba(230, 167, 104, 0.14);
}

.references-page {
  max-width: 1200px;
  margin: auto;
  padding: 40px 24px;
  position: relative;
}

.references-page::before,
.references-page::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.08;
  filter: blur(12px);
}

.references-page::before {
  top: -130px;
  right: -120px;
  background: radial-gradient(circle, rgba(78, 231, 225, 0.18) 0%, rgba(78, 231, 225, 0) 72%);
}

.references-page::after {
  left: -130px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(78, 231, 225, 0.12) 0%, rgba(78, 231, 225, 0) 72%);
}

.references-hero {
  text-align: center;
  margin-bottom: 18px;
  padding: 30px 0 6px;
}

.references-hero__eyebrow {
  margin: 0;
  letter-spacing: 4px;
  font-size: 12px;
  opacity: 0.65;
  color: var(--text-secondary);
}

.references-hero__eyebrow::before {
  content: '📖 ';
  opacity: 0.9;
}

.references-hero__title {
  margin: 10px 0 12px;
  color: var(--accent-bright);
  font-family: 'Noto Serif TC', 'PMingLiU', 'Yu Mincho', serif;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: 0.04em;
}

.references-hero__description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.references-hero__divider {
  width: min(920px, 100%);
  height: 1px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent 0%, rgba(70, 210, 205, 0.22) 50%, transparent 100%);
}

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

.references-section-header {
  margin-bottom: 14px;
}

.references-section__heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.references-section__rail {
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  flex: 0 0 auto;
}

.references-section__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  letter-spacing: 0.03em;
}

.references-section__count {
  margin: 3px 0 0;
  font-size: 12px;
  opacity: 0.6;
  color: var(--text-secondary);
}

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

.reference-card {
  min-height: 268px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  background: rgba(8, 24, 28, 0.94);
  border: 1px solid rgba(84, 220, 215, 0.18);
  border-radius: 14px;
  padding: 28px;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease-out, border-color 0.25s ease-out,
    box-shadow 0.25s ease-out;
  animation: reference-card-enter 350ms ease both;
}

.reference-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(78, 231, 225, 0.05), transparent 30%);
  opacity: 0.55;
  pointer-events: none;
}

.reference-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(78, 231, 225, 0.3) 50%, transparent 100%);
  opacity: 0.3;
  pointer-events: none;
}

.reference-card:hover,
.reference-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(80, 230, 220, 0.66);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.reference-card:hover::before,
.reference-card:focus-visible::before {
  opacity: 1;
}

.reference-card__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(66, 216, 199, 0.62);
  background: transparent;
  border-radius: 999px;
  color: var(--accent-bright);
  font-size: 11px;
  letter-spacing: 1.2px;
  line-height: 1;
}

.reference-card__icon {
  width: 40px;
  height: 40px;
  color: var(--accent-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease-out, filter 0.25s ease-out;
}

.reference-card__icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(83%) sepia(12%) saturate(676%) hue-rotate(127deg) brightness(96%) contrast(95%);
}

.reference-card__title {
  margin: 8px 0 8px;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1.2;
}

.reference-card__subtitle {
  margin: 0;
  color: #a8c4c2;
  font-size: 14px;
}

.reference-card__description {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.reference-card__features {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reference-card__feature {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(78, 231, 225, 0.18);
  background: rgba(78, 231, 225, 0.06);
  color: var(--accent-bright);
  font-size: 11px;
  line-height: 1;
}

.reference-card__footer {
  margin-top: auto;
  padding-top: 20px;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9ed7d1;
  font-size: 13px;
}

.reference-card__footer-text {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.25s ease-out, text-decoration-color 0.25s ease-out;
}

.reference-card__arrow {
  display: inline-block;
  transition: transform 0.25s ease-out;
}

.reference-card:hover .reference-card__arrow,
.reference-card:focus-visible .reference-card__arrow {
  transform: translateX(5px);
}

.reference-card:hover .reference-card__icon,
.reference-card:focus-visible .reference-card__icon {
  transform: scale(1.08) rotate(2deg);
}

.reference-card:hover .reference-card__footer-text,
.reference-card:focus-visible .reference-card__footer-text {
  color: #c9efec;
  text-decoration-color: currentColor;
}

.references-disclaimer {
  margin-top: 24px;
  padding: 16px 20px;
  border-color: rgba(84, 220, 215, 0.16);
  background: rgba(7, 24, 29, 0.76);
}

.references-disclaimer__title {
  margin: 0 0 8px;
  color: #9bb9b6;
  font-size: 15px;
  font-weight: 700;
}

.references-disclaimer p {
  margin: 2px 0;
  color: #7f9897;
  font-size: 12px;
  line-height: 1.6;
}

@keyframes reference-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes contact-char-enter {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes contact-content-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer-bar {
  margin: 18px auto 0;
  width: min(1120px, calc(100% - 56px));
  border-top: 1px solid rgba(97, 136, 134, 0.22);
  padding: 14px 0 8px;
  text-align: center;
  background: transparent;
}

.footer-main {
  margin: 0;
  font-size: 11px;
  color: #78908f;
}

.footer-main a {
  color: #86cbc2;
}

.footer-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: #8da4a3;
}

.empty-text {
  margin: 0;
  padding: 18px 0;
  text-align: center;
  color: var(--text-muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(3, 8, 12, 0.62);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(78, 155, 150, 0.28);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 190, 180, 0.46);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[role='button']:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 270px;
  }

  .site-title {
    font-size: clamp(22px, 2.4vw, 27px);
  }

  .challenge-card,
  .masquerade-card,
  .detail-card {
    padding: 12px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
    width: min(88vw, 320px);
    transform: translateX(-103%);
    transition: transform 0.25s ease;
  }

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

  body.sidebar-open .drawer-backdrop {
    display: block;
  }

  .sidebar-toggle {
    display: inline-flex;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-normal);
    background: rgba(10, 23, 29, 0.75);
    justify-content: center;
    align-items: center;
  }

  .brand-nav-shell {
    margin: 8px 8px 0;
  }

  .site-header {
    align-items: center;
    gap: 8px;
    min-height: 92px;
    padding: 12px 14px;
  }

  .site-brand {
    order: 1;
  }

  .header-progress {
    order: 2;
    width: min(100%, 230px);
    min-width: 0;
  }

  .main-nav {
    overflow-x: auto;
    white-space: nowrap;
  }

  .main-tab {
    flex: 0 0 auto;
    min-height: 52px;
  }

  .page-shell,
  .main-content-inner,
  .footer-bar {
    width: calc(100% - 32px);
  }

  .progress-layout {
    grid-template-columns: 1fr;
  }

  .timeline-track {
    min-width: 620px;
  }

  .slot-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .contact-panel {
    width: calc(100% - 32px);
    grid-template-columns: clamp(160px, 30%, 190px) minmax(0, 1fr);
    gap: 22px;
    padding: 28px 24px 24px;
  }

  .contact-character-area {
    min-height: 250px;
  }

  .contact-emblem {
    height: clamp(240px, 34vw, 280px);
  }

  .references-page {
    padding: 32px 18px;
  }

  .references-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .references-section-header {
    margin-bottom: 12px;
  }
}

@media (max-width: 640px) {
  .content-scroll {
    padding-top: 10px;
  }

  .site-title {
    font-size: 22px;
  }

  .card-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .card-head-main {
    align-items: center;
  }

  .stage-meta {
    text-align: left;
    padding-top: 0;
  }

  .slot-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .skill-icon-item {
    width: 40px;
  }

  .skill-icon-item img,
  .skill-icon-item .empty-slot {
    width: 40px;
    height: 40px;
  }

  .strategy-steps li {
    font-size: 14px;
  }

  .contact-panel {
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 18px;
  }

  .contact-character-area {
    min-height: 0;
    justify-content: center;
  }

  .contact-character-area::before {
    width: 150px;
    height: 150px;
    bottom: 18px;
  }

  .contact-emblem {
    width: min(240px, 74vw);
    height: clamp(190px, 52vw, 230px);
  }

  .contact-links {
    margin-top: 18px;
  }

  .contact-link {
    min-height: 64px;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 10px;
  }

  .contact-copy-btn {
    min-width: 52px;
    padding: 0 10px;
  }

  .detail-card-layout {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
  }

  .detail-skill-icon {
    width: 42px;
    height: 42px;
  }

  .references-page {
    padding: 26px 12px;
  }

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

  .reference-card {
    min-height: 224px;
    padding: 22px;
  }

  .references-hero {
    padding-top: 22px;
  }

  .references-hero__title {
    font-size: 24px;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .site-brand__mask {
    width: 42px;
    height: 34px;
  }

  .header-progress {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .masquerade-heading__icon {
    width: 42px;
    height: 42px;
  }

  .masquerade-card__watermark {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-character-area,
  .contact-content {
    animation: none !important;
    transform: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
