:root {
  --bg: #ffffff;
  --bg-deep: #fafafa;
  --surface: #fafafa;
  --surface-strong: #ffffff;
  --surface-muted: #f4f4f5;
  --line: #e4e4e7;
  --line-strong: #d9dbe0;
  --text: #18181b;
  --text-muted: #52525b;
  --text-soft: #686e79;
  --brand: #3559d8;
  --brand-dark: #2a46b4;
  --brand-soft: #f0f3ff;
  --green: #287947;
  --amber: #925318;
  --purple: #7440bb;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

.glass {
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 60px;
  margin: 0 auto;
  padding: 10px 16px 11px;
  border-radius: 0;
  border-width: 0 0 1px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-right: 30px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--brand);
  border-radius: 8px;
  color: white;
  background: var(--brand);
  box-shadow: none;
  font-size: 18px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.nav-link {
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button,
.avatar-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface);
  transition: transform 180ms var(--ease), color 180ms var(--ease), background 180ms var(--ease);
}

.icon-button:hover,
.avatar-button:hover {
  color: var(--brand);
  background: var(--surface-strong);
  transform: translateY(-2px);
}

.theme-moon {
  display: none;
}

.avatar-button {
  color: white;
  background: var(--text);
  border-color: transparent;
  font-size: 12px;
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

body[data-page] main > section {
  display: none;
}

body[data-page="home"] .hero-section,
body[data-page="catalog"] .catalog-section,
body[data-page="practice"] .practice-section,
body[data-page="courses"] .resource-section,
body[data-page="anti-ai"] .anti-ai-section,
body[data-page="updates"] .updates-section,
body[data-page="skill"] .footer-band {
  display: grid;
}

body[data-page="catalog"] .catalog-section,
body[data-page="updates"] .updates-section {
  display: block;
}

body[data-page]:not([data-page="home"]) main {
  min-height: calc(100vh - 120px);
  padding-top: 52px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 48px;
  min-height: 570px;
  padding: 70px 28px 60px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(33, 104, 221, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(33, 104, 221, 0.1);
}

.hero-copy h1 {
  max-width: 680px;
  margin: 0;
  color: #182a43;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 1.06;
}

.hero-copy h1 span,
.practice-copy h2 span {
  color: var(--brand);
}

.hero-description {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 45px;
  padding: 0 17px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 650;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, #2f82ef, #1556c6);
  box-shadow: 0 8px 17px rgba(33, 104, 221, 0.25), inset 0 1px rgba(255, 255, 255, 0.35);
}

.button-primary span {
  font-size: 17px;
}

.button-secondary {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}

.button-secondary span {
  color: var(--text-soft);
  font-size: 11px;
}

.hero-orbit {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  border-radius: 38% 62% 58% 42% / 46% 38% 62% 54%;
  background:
    radial-gradient(circle at 52% 47%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.19) 35%, transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(220, 232, 247, 0.26));
  transform: rotate(-7deg);
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(55, 113, 209, 0.21);
  border-radius: 50%;
}

.hero-preview {
  position: absolute;
  z-index: 2;
  top: 8%;
  right: 4%;
  width: 128px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 13px 24px rgba(65, 100, 150, 0.14);
  transform: rotate(9deg);
}

.hero-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  border-radius: 10px;
  object-fit: cover;
}

.orbit-ring-outer {
  inset: 13%;
  transform: rotate(35deg) scaleY(0.55);
}

.orbit-ring-inner {
  inset: 23%;
  transform: rotate(-35deg) scaleY(0.7);
  border-color: rgba(141, 111, 232, 0.25);
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 152px;
  height: 152px;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #ffffff, rgba(232, 240, 252, 0.76));
  box-shadow: 0 18px 30px rgba(70, 108, 161, 0.17), inset 0 -8px 20px rgba(136, 168, 218, 0.13);
  transform: translate(-50%, -50%) rotate(7deg);
}

.core-icon {
  margin-bottom: -5px;
  color: var(--brand);
  font-size: 22px;
}

.orbit-core strong {
  color: var(--text);
  font-size: 43px;
  font-weight: 750;
  letter-spacing: -0.07em;
  line-height: 1;
}

.orbit-core small {
  color: var(--text-soft);
  font-size: 11px;
}

.orbit-label {
  position: absolute;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(65, 100, 150, 0.12);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 700;
  transform: rotate(7deg);
}

.orbit-label::before {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}

.orbit-label-one { top: 15%; left: 8%; }
.orbit-label-two { top: 12%; right: 10%; }
.orbit-label-three { right: 4%; bottom: 21%; }
.orbit-label-four { bottom: 12%; left: 16%; }
.orbit-label-two::before { background: var(--purple); }
.orbit-label-three::before { background: var(--amber); }
.orbit-label-four::before { background: var(--green); }

.catalog-section {
  padding: 38px 0 86px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 0 5px;
}

.section-heading h2,
.practice-copy h2,
.footer-band h2 {
  margin: 0;
  color: var(--text);
  font-size: 32px;
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.section-heading .section-kicker {
  margin-bottom: 10px;
}

.result-count {
  color: var(--text-muted);
  font-size: 12px;
}

.filter-panel {
  position: sticky;
  z-index: 5;
  top: 101px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 12px;
  border-radius: 19px;
}

.search-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 270px;
  gap: 9px;
  min-width: 220px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.search-symbol {
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.search-wrap input::placeholder {
  color: var(--text-soft);
}

kbd {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.66);
  font-size: 11px;
}

.category-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  min-height: 35px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  transition: color 180ms var(--ease), background 180ms var(--ease), border 180ms var(--ease);
}

.category-chip span {
  margin-left: 3px;
  color: var(--text-soft);
  font-size: 10px;
}

.category-chip:hover,
.category-chip.active {
  border-color: rgba(33, 104, 221, 0.16);
  color: var(--brand);
  background: var(--brand-soft);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.catalog-sidebar {
  position: sticky;
  top: 184px;
  display: grid;
  gap: 4px;
}

.sidebar-label {
  margin: 0 0 8px 10px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  text-align: left;
  font-size: 12px;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}

.sidebar-item span {
  width: 16px;
  color: var(--text-soft);
  text-align: center;
}

.sidebar-item em {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 10px;
  font-style: normal;
}

.sidebar-item:hover,
.sidebar-item.active {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.56);
}

.sidebar-item.active span,
.sidebar-item.active em {
  color: var(--brand);
}

.sidebar-note {
  display: flex;
  align-items: start;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.4);
}

.note-icon {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  font-size: 11px;
}

.sidebar-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.sidebar-note strong {
  color: var(--text);
  font-weight: 650;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.term-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  cursor: pointer;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 16px rgba(75, 101, 135, 0.06);
}

.term-card::after {
  position: absolute;
  z-index: 0;
  right: -30px;
  bottom: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--card-tint, rgba(53, 119, 227, 0.1));
  content: "";
  opacity: 0.82;
}

.term-card:hover {
  border-color: rgba(33, 104, 221, 0.31);
  box-shadow: var(--shadow-small);
}

.term-card.is-opening {
  border-color: rgba(33, 104, 221, 0.31);
  transform: none;
}

.term-card:focus-visible {
  outline: 3px solid rgba(33, 104, 221, 0.25);
  outline-offset: 3px;
}

.term-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.term-index {
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.bookmark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.42);
  font-size: 15px;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}

.bookmark:hover,
.bookmark.saved {
  color: var(--brand);
  background: var(--brand-soft);
}

.term-card h3 {
  position: relative;
  z-index: 1;
  margin: 15px 0 5px;
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.term-card h3 span {
  margin-left: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.term-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.term-prompt span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
}

.term-card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
}

.detail-trigger {
  position: relative;
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-soft);
  background: transparent;
  font-size: 16px;
  transition: color 180ms var(--ease), background 180ms var(--ease), border 180ms var(--ease);
}

.detail-trigger:hover {
  border-color: var(--line);
  color: var(--brand);
  background: var(--brand-soft);
}

.term-tag {
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10px;
}

.term-arrow {
  color: var(--text-soft);
  font-size: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.3);
  text-align: center;
}

.practice-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 80px;
  padding: 110px 28px 130px;
}

.practice-copy h2 {
  font-size: 42px;
}

.practice-copy > p:not(.section-kicker) {
  max-width: 370px;
  margin: 22px 0 26px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.text-link {
  display: inline-flex;
  gap: 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.text-link span {
  transition: transform 180ms var(--ease);
}

.text-link:hover span {
  transform: translateX(5px);
}

.practice-card {
  min-height: 270px;
  padding: 26px;
  border-radius: 24px;
}

.practice-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.mini-label {
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.progress-label {
  color: var(--text-soft);
  font-size: 11px;
}

.practice-card h3 {
  max-width: 440px;
  margin: 0 0 22px;
  font-size: 21px;
  font-weight: 690;
  letter-spacing: -0.035em;
}

.answer-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.36);
  font-size: 12px;
  text-align: left;
  transition: border 180ms var(--ease), color 180ms var(--ease), background 180ms var(--ease);
}

.answer-option span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--text-muted);
  background: rgba(96, 113, 136, 0.1);
  font-size: 11px;
  font-weight: 700;
}

.answer-option:hover,
.answer-option.selected {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.answer-option.correct {
  border-color: var(--green);
  color: var(--green);
  background: rgba(26, 156, 120, 0.1);
}

.answer-feedback {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--green);
  font-size: 12px;
}

.resource-section,
.anti-ai-section,
.updates-section {
  padding: 78px 28px 0;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.resource-card {
  display: flex;
  min-height: 205px;
  flex-direction: column;
  padding: 22px;
  border-radius: 19px;
}

.resource-number {
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.resource-card h3 {
  margin: 26px 0 7px;
  font-size: 19px;
  letter-spacing: -0.035em;
}

.resource-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.resource-card .text-link {
  margin-top: auto;
}

.anti-ai-panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  padding: 30px;
  border-radius: 24px;
}

.anti-ai-panel h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.06em;
  line-height: 1.15;
}

.anti-ai-panel h2 span {
  color: var(--brand);
}

.prompt-rules {
  display: grid;
  gap: 12px;
}

.prompt-rule {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 53px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.28);
}

.prompt-rule span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 750;
}

.prompt-rule p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.updates-section {
  padding-bottom: 88px;
}

.update-list {
  overflow: hidden;
  border-radius: 19px;
}

.update-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  padding: 0 21px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
}

.update-row:last-child {
  border-bottom: 0;
}

.update-date {
  color: var(--brand);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.update-row strong {
  color: var(--text);
  font-weight: 650;
}

.footer-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 54px 28px 72px;
  border-top: 1px solid var(--line);
}

.footer-band h2 {
  font-size: 29px;
}

.footer-meta {
  max-width: 310px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.footer-meta p {
  margin: 0 0 8px;
}

.source-note a {
  color: var(--brand);
}

.footer-mark {
  display: block;
  margin-top: 28px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
  font-size: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-open {
  overflow: hidden;
}

.term-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.term-modal.open {
  visibility: visible;
  pointer-events: auto;
}

.term-modal.closing {
  visibility: visible;
  pointer-events: none;
}

.term-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 39, 60, 0.25);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

.term-modal.open .term-modal-backdrop {
  opacity: 1;
}

.term-detail {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 48px));
  height: min(760px, calc(100% - 48px));
  padding: 27px 28px 32px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 27px;
  background: #f8fbff;
  box-shadow: 0 28px 70px rgba(47, 70, 103, 0.18);
  opacity: 0;
  transform: translate(0, 0) scale(1, 1);
  transform-origin: center;
  backface-visibility: hidden;
  contain: layout paint;
  will-change: transform;
}

.term-modal.open .term-detail {
  opacity: 1;
}

.detail-top,
.detail-meta,
.prompt-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-label {
  color: var(--brand);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.detail-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.48);
  font-size: 21px;
  line-height: 1;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}

.detail-close:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.detail-meta {
  margin-top: 48px;
}

.detail-index {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.term-detail h2 {
  margin: 17px 0 2px;
  color: var(--text);
  font-size: 43px;
  font-weight: 750;
  letter-spacing: -0.065em;
  line-height: 1;
}

.detail-english {
  margin: 0;
  color: var(--brand);
  font-size: 14px;
  font-weight: 650;
}

.detail-definition {
  margin: 25px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
}

.detail-body {
  min-width: 0;
}

.detail-sections {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.detail-section {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.detail-section > span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.detail-section p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.prompt-block {
  margin-top: 20px;
  padding: 17px;
  border: 1px solid rgba(33, 104, 221, 0.17);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.12)),
    var(--brand-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.prompt-heading > span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
}

.prompt-heading button {
  padding: 5px 8px;
  border: 1px solid rgba(33, 104, 221, 0.18);
  border-radius: 7px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.44);
  font-size: 11px;
}

.prompt-block p {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.75;
}

.detail-reference {
  display: inline-flex;
  gap: 8px;
  margin-top: 23px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}

.detail-reference span {
  font-size: 16px;
}

[data-theme="dark"] {
  --bg: #101827;
  --bg-deep: #0c1321;
  --surface: rgba(28, 43, 63, 0.78);
  --surface-strong: rgba(30, 46, 67, 0.94);
  --surface-muted: rgba(33, 49, 70, 0.54);
  --line: rgba(195, 213, 237, 0.14);
  --line-strong: rgba(195, 213, 237, 0.25);
  --text: #ecf3ff;
  --text-muted: #a7b5c9;
  --text-soft: #75869e;
  --brand: #65a4ff;
  --brand-dark: #4189ec;
  --brand-soft: rgba(101, 164, 255, 0.13);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  --shadow-small: 0 8px 22px rgba(0, 0, 0, 0.23);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 16% 3%, rgba(52, 99, 178, 0.22), transparent 28rem),
    radial-gradient(circle at 83% 13%, rgba(89, 63, 151, 0.2), transparent 27rem),
    linear-gradient(135deg, var(--bg) 0%, #172439 52%, var(--bg-deep) 100%);
}

[data-theme="dark"] .hero-copy h1 {
  color: #f2f7ff;
}

[data-theme="dark"] .theme-sun {
  display: none;
}

[data-theme="dark"] .theme-moon {
  display: inline;
}

[data-theme="dark"] .term-detail {
  background: #152336;
}

@media (max-width: 1000px) {
  .main-nav {
    gap: 0;
  }

  .nav-link {
    padding-inline: 7px;
    font-size: 12px;
  }

  .brand {
    margin-right: 18px;
  }

  .hero-section {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    padding-inline: 10px;
  }

  .terms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    top: 8px;
    width: calc(100% - 20px);
    margin-top: 8px;
    border-radius: 18px;
  }

  .brand {
    margin-right: 0;
  }

  .brand-copy small,
  .main-nav {
    display: none;
  }

  main {
    width: calc(100% - 20px);
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 35px;
    min-height: unset;
    padding: 72px 8px 70px;
  }

  .hero-copy h1 {
    font-size: clamp(43px, 15vw, 68px);
  }

  .hero-description {
    max-width: 440px;
    font-size: 14px;
  }

  .hero-orbit {
    width: min(100%, 350px);
    margin: 0 auto;
  }

  .filter-panel {
    position: static;
    display: block;
    padding: 10px;
  }

  .category-row {
    margin-top: 9px;
  }

  .catalog-layout {
    display: block;
  }

  .catalog-sidebar {
    position: static;
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .catalog-sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-label,
  .sidebar-note {
    display: none;
  }

  .sidebar-item {
    flex: 0 0 auto;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .sidebar-item em {
    display: none;
  }

  .terms-grid {
    grid-template-columns: 1fr;
  }

  .term-card {
    min-height: 165px;
  }

  .practice-section {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 70px 8px 85px;
  }

  .resource-section,
  .anti-ai-section,
  .updates-section {
    padding: 60px 8px 0;
  }

  .resource-grid,
  .anti-ai-panel {
    grid-template-columns: 1fr;
  }

  .anti-ai-panel {
    gap: 30px;
    padding: 22px;
  }

  .update-row {
    grid-template-columns: 1fr;
    gap: 3px;
    min-height: 93px;
    padding: 14px 17px;
  }

  .practice-copy h2 {
    font-size: 37px;
  }

  .answer-list {
    grid-template-columns: 1fr;
  }

  .footer-band {
    display: grid;
    padding: 42px 8px 60px;
  }

  .term-detail {
    width: 100%;
    height: min(88vh, 720px);
    align-self: end;
    border-radius: 24px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 9px;
  }
}

/* Reference layout overrides */
body[data-page="home"] .catalog-section {
  display: block;
}

body[data-page="home"] main {
  padding-top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 60px;
  margin: 0;
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: none;
}

.glass {
  border-color: var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
}

.hero-section {
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 300px;
  padding: 52px 16px 42px;
}

.hero-copy h1 {
  color: var(--text);
  font-size: 42px;
  letter-spacing: 0;
}

.hero-orbit {
  display: none;
}

.hero-reference {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow-small);
}

.hero-reference-top,
.hero-reference-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-reference-top {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
}

.hero-reference-top strong {
  color: var(--brand);
  font-size: 18px;
}

.hero-reference-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 16px;
  padding: 15px 0;
}

.hero-reference-list span {
  color: var(--text-muted);
  font-size: 12px;
}

.hero-reference-list b {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.hero-reference > a {
  display: flex;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.button-primary {
  background: var(--brand);
  box-shadow: none;
}

.button-secondary {
  background: var(--surface);
}

.catalog-section {
  padding: 20px 16px 90px;
}

.filter-panel,
.sidebar-note {
  border-radius: 8px;
}

.search-wrap {
  border-radius: 8px;
  background: var(--bg);
}

.category-chip,
.sidebar-item {
  border-radius: 7px;
}

.sidebar-item:hover,
.sidebar-item.active {
  background: var(--brand-soft);
}

.terms-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.term-card {
  min-height: 142px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.035);
}

.term-card::after {
  content: none;
}

.term-card:hover,
.term-card.is-opening {
  border-color: var(--brand);
}

.term-card h3 {
  letter-spacing: 0;
}

.bookmark {
  border-radius: 6px;
  background: var(--surface);
}

.term-detail {
  border-radius: 12px;
  background: var(--bg);
}

.skill-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 20px 22px;
  border-radius: 8px;
}

.skill-download h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
}

[data-theme="dark"] {
  --bg: #1b1d21;
  --bg-deep: #1b1d21;
  --surface: #22252a;
  --surface-strong: #1b1d21;
  --surface-muted: #2c3036;
  --line: #3e444e;
  --line-strong: #525a66;
  --text: #d9dce2;
  --text-muted: #b3b9c4;
  --text-soft: #949da9;
  --brand: #7b93ea;
  --brand-dark: #7b93ea;
  --brand-soft: #273444;
}

[data-theme="dark"] body {
  background: var(--bg);
}

@media (max-width: 760px) {
  .topbar {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 42px 8px 28px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-reference {
    width: 100%;
  }

  .terms-grid {
    grid-template-columns: 1fr;
  }

  .skill-download {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Language directory */
.language-home {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.language-hero {
  max-width: 780px;
  padding: 88px 0 64px;
}

.language-hero.compact {
  padding-bottom: 42px;
}

.language-hero h1 {
  margin: 16px 0 18px;
  color: var(--text);
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.08;
  letter-spacing: 0;
}

.language-hero h1 span {
  color: var(--brand);
}

.language-hero p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--text-muted);
  font-size: 17px;
}

.language-directory-section {
  padding-bottom: 90px;
}

.language-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.language-card,
.language-term-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow-small);
}

.language-card {
  display: grid;
  grid-template-columns: 72px minmax(220px, 0.8fr) minmax(280px, 1.6fr) 150px;
  align-items: center;
  min-height: 118px;
  padding: 20px 24px;
  gap: 24px;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.language-card:hover,
.language-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(53, 89, 216, 0.11);
  transform: translateY(-2px);
}

.language-card:focus-visible,
.language-term-card:focus-visible,
.language-detail-close:focus-visible,
.language-copy-prompt:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.language-card-meta,
.language-term-card-top,
.language-card-footer,
.language-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.language-card-meta {
  align-items: flex-start;
  align-self: stretch;
  flex-direction: column;
}

.language-card-content {
  min-width: 0;
}

.language-card-index,
.language-card-count,
.language-term-card-top,
.language-term-card-tag {
  color: var(--text-soft);
  font-size: 12px;
}

.language-card h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 30px;
  letter-spacing: 0;
}

.language-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.language-card-footer {
  height: 100%;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}

.language-page-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 90px;
}

.language-page-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 58px 0 38px;
}

.language-page-hero h1 {
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.language-page-hero p {
  max-width: 540px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 16px;
}

.language-page-hero span.language-count {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--brand);
  background: var(--surface);
  font-size: 13px;
}

.language-back {
  display: inline-flex;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}

.language-toolbar {
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.language-search {
  width: min(100%, 430px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--bg);
  outline: 0;
}

.language-search:focus {
  border-color: var(--brand);
}

.language-term-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.language-term-card {
  min-height: 214px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.language-term-card:hover,
.language-term-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(53, 89, 216, 0.11);
  transform: translateY(-2px);
}

.language-term-card h2 {
  margin: 38px 0 10px;
  color: var(--text);
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
}

.language-term-card p {
  min-height: 63px;
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.language-term-card-tag {
  display: inline-block;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.language-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.language-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.language-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.language-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 27, 0.38);
}

.language-detail {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  transform: translateY(12px) scale(0.98);
  transition: transform 180ms var(--ease);
}

.language-modal.open .language-detail {
  transform: translateY(0) scale(1);
}

.language-detail-top,
.language-detail-heading,
.language-detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.language-detail-label,
.language-detail-section-heading span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-detail-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}

.language-detail-heading {
  align-items: end;
  margin-top: 34px;
}

.language-detail-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.language-detail-english {
  margin: 8px 0 24px;
  color: var(--brand);
  font-size: 14px;
}

.language-detail-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.language-detail-section p,
.language-detail-prompt {
  margin: 9px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}

.language-detail-prompt-block {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.language-copy-prompt {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  background: var(--bg);
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 850px) {
  .language-term-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .language-home,
  .language-page-main {
    width: min(100% - 20px, 560px);
  }

  .language-hero {
    padding: 54px 0 42px;
  }

  .language-hero h1 {
    font-size: 42px;
  }

  .language-grid,
  .language-term-grid {
    grid-template-columns: 1fr;
  }

  .language-card {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 14px;
  }

  .language-card-meta {
    align-items: center;
    flex-direction: row;
  }

  .language-card-footer {
    height: auto;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .language-page-hero {
    display: block;
    padding-top: 42px;
  }

  .language-page-hero span.language-count {
    margin-top: 20px;
  }

  .language-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .language-search {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-card,
  .language-term-card,
  .language-modal,
  .language-detail {
    transition: none;
  }
}
