:root {
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-line: rgba(122, 142, 154, 0.18);
  --surface-line-strong: rgba(91, 114, 128, 0.22);
  --ink: #2f4651;
  --ink-soft: #5f7681;
  --ink-muted: #7f9098;
  --navy: #4f6976;
  --navy-strong: #405661;
  --teal: #4b776f;
  --violet: #6e73b6;
  --mist: #dde8f0;
  --peach: #f4e8e1;
  --soft-shadow: 0 14px 36px rgba(61, 82, 92, 0.08);
  --card-shadow: 0 18px 44px rgba(61, 82, 92, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-ui: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(134, 119, 240, 0.12), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(248, 156, 64, 0.11), transparent 26%),
    radial-gradient(circle at 72% 82%, rgba(154, 100, 237, 0.08), transparent 24%),
    linear-gradient(160deg, #f5f8fc 0%, #edf2f7 36%, #edf3fa 64%, #f4f7fb 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.screen-reader-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.8), transparent 22%),
    radial-gradient(circle at 60% 8%, rgba(255, 255, 255, 0.58), transparent 18%),
    radial-gradient(circle at 76% 62%, rgba(255, 255, 255, 0.62), transparent 26%);
  opacity: 0.9;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 28px));
  margin: 14px auto 28px;
}

.top-nav-shell,
.module-nav,
.knowledge-tree-panel,
.brand-hero,
.filter-panel,
.question-card,
.resource-card-shell,
.knowledge-card,
.knowledge-reader,
.knowledge-filter-panel,
.feature-placeholder-card {
  border: 1px solid var(--surface-line);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.top-nav-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 20px;
}

.top-nav-shell__left,
.top-nav-shell__brand,
.top-nav-shell__right,
.top-nav-shell__status,
.module-nav,
.question-module-stack,
.brand-hero__actions,
.hero-orbit,
.filters-row,
.filter-actions,
.results-summary,
.results-summary__main,
.results-summary__actions,
.question-meta-row,
.question-meta-row__left,
.question-tag-row,
.question-actions,
.resource-toolbar,
.resource-card-shell,
.resource-card,
.resource-card__meta,
.resource-card__actions,
.knowledge-filter-panel,
.knowledge-layout,
.feature-placeholder-card__grid,
.auth-tabs,
.top-auth-form {
  display: flex;
}

.top-nav-shell__left {
  align-items: center;
  gap: 14px;
}

.top-nav-shell__mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f6976, #6c8794);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(79, 105, 118, 0.24);
}

.top-nav-shell__brand {
  flex-direction: column;
  gap: 2px;
}

.top-nav-shell__eyebrow,
.brand-hero__eyebrow,
.brand-section-head__eyebrow,
.feature-placeholder-card__eyebrow {
  margin: 0;
  color: #617887;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.top-nav-shell__title,
.brand-hero__title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 3vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.top-nav-shell__title {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.top-nav-shell__caption,
.brand-hero__subtitle,
.brand-section-head__desc,
.tree-count,
.tree-selected,
.resource-card__desc,
.knowledge-card__meta,
.knowledge-toolbar-intro__desc,
.feature-placeholder-card__desc,
.feature-placeholder-card__grid span,
.knowledge-reader p,
.knowledge-reader li,
.knowledge-reader blockquote,
.knowledge-results-head {
  color: var(--ink-muted);
}

.top-nav-shell__caption {
  margin: 0;
  font-size: 13px;
}

.top-nav-shell__right {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.top-nav-shell__status {
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(91, 114, 128, 0.14);
}

.top-nav-shell__status span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.top-nav-shell__status strong {
  color: var(--ink);
  font-size: 14px;
}

.top-auth-form {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-auth-form input,
.auth-tab,
.nav-action,
.module-pill,
.soft-btn,
.chip-btn,
.page-btn,
.resource-action,
.tree-toggle,
.knowledge-item,
.question-toggle {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(91, 114, 128, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.top-auth-form input {
  padding: 0 14px;
  min-width: 150px;
}

.top-auth-form input:focus,
select:focus,
textarea:focus,
.tree-search input:focus,
.knowledge-filter-panel input:focus {
  outline: none;
  border-color: rgba(79, 105, 118, 0.28);
  box-shadow: 0 0 0 4px rgba(79, 105, 118, 0.08);
}

.auth-tabs {
  gap: 6px;
}

.auth-tab,
.nav-action,
.module-pill,
.soft-btn,
.chip-btn,
.page-btn,
.resource-action,
.question-toggle {
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.auth-tab.is-active,
.module-pill.is-active,
.nav-action--primary,
.soft-btn--dark,
.resource-action--primary,
.page-btn.is-current {
  background: linear-gradient(135deg, #405661, #5f7a88);
  color: #fff;
  border-color: rgba(64, 86, 97, 0.28);
  box-shadow: 0 14px 34px rgba(64, 86, 97, 0.24);
}

.nav-action,
.auth-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-message {
  grid-column: 1 / -1;
  color: #a14c4c;
  font-size: 13px;
}

.auth-message[data-tone="success"] {
  color: #3d7869;
}

.module-nav {
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 8px;
}

.module-pill {
  min-width: 150px;
}

main {
  margin-top: 22px;
}

.question-module-stack {
  flex-direction: column;
  gap: 18px;
}

.module-stage {
  display: none;
}

.module-stage--active {
  display: block;
  animation: fade-in 280ms ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-workspace {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.knowledge-tree-panel {
  padding: 12px;
  position: sticky;
  top: 96px;
}

.k-header {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 17px;
  background: linear-gradient(180deg, #526c79, #48616d);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.tree-count,
.tree-selected {
  margin: 12px 0 0;
  font-size: 13px;
}

.tree-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.tree-search span,
.filters-row label span,
.year-range span,
.knowledge-filter-panel span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.tree-search input,
.knowledge-filter-panel input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(91, 114, 128, 0.14);
  background: rgba(247, 250, 252, 0.9);
  color: var(--ink);
}

.tree-search input,
.knowledge-filter-panel input,
select {
  min-height: 36px;
  padding: 0 12px;
}

textarea {
  min-height: 140px;
  padding: 12px;
  resize: vertical;
}

.chapter-tree {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.tree-node {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-toggle {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  color: #4f6976;
}

.tree-leaf {
  width: 22px;
  min-width: 22px;
}

.tree-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4c6470;
  font-size: 14px;
  font-weight: 650;
}

.tree-checkbox input {
  margin: 0;
  accent-color: #5f7a88;
}

.tree-children {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 16px;
  padding-left: 14px;
  border-left: 1px solid rgba(79, 105, 118, 0.11);
}

.question-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.brand-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 34px 34px 30px;
  overflow: hidden;
  position: relative;
}

.brand-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.82), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.58), transparent 20%),
    radial-gradient(circle at 60% 84%, rgba(255, 255, 255, 0.4), transparent 26%);
  pointer-events: none;
}

.brand-hero > * {
  position: relative;
  z-index: 1;
}

.brand-hero__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-hero__eyebrow,
.brand-section-head__eyebrow,
.feature-placeholder-card__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(220, 232, 240, 0.86);
  border: 1px solid rgba(122, 142, 154, 0.16);
}

.brand-hero__subtitle {
  max-width: 780px;
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}

.brand-hero__actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.hero-chip,
.hero-orbit span,
.question-meta-chip,
.brand-tag,
.resource-meta-pill,
.resource-category-pill,
.knowledge-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(122, 142, 154, 0.16);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
}

.hero-chip--dark,
.hero-orbit span:nth-child(1),
.hero-orbit span:nth-child(6) {
  color: #47606d;
  background: rgba(79, 105, 118, 0.14);
}

.hero-chip--soft,
.hero-orbit span:nth-child(2),
.hero-orbit span:nth-child(3) {
  color: #5b6898;
  background: rgba(120, 132, 175, 0.11);
}

.hero-chip--silver,
.hero-orbit span:nth-child(4),
.hero-orbit span:nth-child(5) {
  color: #456f67;
  background: rgba(73, 129, 119, 0.11);
}

.hero-orbit {
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}

.filter-panel,
.knowledge-filter-panel,
.feature-placeholder-card {
  padding: 24px;
}

.brand-section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-section-head__title,
.feature-placeholder-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.brand-section-head__title {
  font-size: 1.05rem;
}

.brand-section-head__desc {
  margin: 0;
  font-size: 14px;
}

.filters-row {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(190px, 0.9fr);
  gap: 12px;
  align-items: flex-end;
}

.filters-row label,
.knowledge-filter-panel label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.year-range {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.year-range__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.year-range__inputs input {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 114, 128, 0.14);
  background: rgba(247, 250, 252, 0.9);
}

.filter-actions {
  margin-top: 18px;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.soft-btn,
.chip-btn,
.page-btn,
.resource-action,
.question-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-summary {
  color: var(--ink-muted);
  font-size: 13px;
}

.results-summary {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(122, 142, 154, 0.16);
}

.results-summary__main,
.results-summary__actions {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.results-summary__label,
.results-summary__suffix {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.results-summary__count {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f6976, #6c8794);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.basket-inline-meta {
  color: var(--ink-muted);
  font-size: 13px;
}

.basket-open-btn {
  gap: 10px;
}

.basket-fab {
  appearance: none;
  -webkit-appearance: none;
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 23;
  min-height: 58px;
  padding: 0 20px 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #4f6976, #6f8390);
  color: #fff;
  box-shadow: 0 18px 40px rgba(61, 82, 92, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
  outline: none;
}

.basket-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(61, 82, 92, 0.28);
}

.basket-fab__label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.basket-fab--pop {
  animation: basket-pop 420ms ease;
}

.basket-count-badge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.basket-fab .basket-count-badge {
  background: rgba(255, 255, 255, 0.18);
}

@keyframes basket-fly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  70% {
    transform: translate(var(--fly-dx), var(--fly-dy)) scale(0.42);
    opacity: 0.78;
  }
  100% {
    transform: translate(var(--fly-dx), var(--fly-dy)) scale(0.16);
    opacity: 0;
  }
}

@keyframes basket-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.13); }
  72% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.basket-fly-item {
  position: fixed;
  z-index: 9999;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(135deg, #4f6976, #7b909c);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(61, 82, 92, 0.24);
  animation: basket-fly 880ms cubic-bezier(0.2, 0.86, 0.28, 1) forwards;
}

.question-list,
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.question-card,
.resource-card-shell {
  padding: 14px 14px 10px;
}

.question-card {
  border-radius: 18px;
  border: 1px solid rgba(122, 142, 154, 0.18);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.question-card:hover,
.resource-card-shell:hover,
.knowledge-item:hover,
.resource-action:hover,
.soft-btn:hover,
.chip-btn:hover,
.page-btn:hover,
.module-pill:hover,
.nav-action:hover,
.auth-tab:hover,
.tree-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(61, 82, 92, 0.1);
}

.question-card.is-selected {
  border-color: rgba(79, 105, 118, 0.26);
  box-shadow: 0 16px 40px rgba(61, 82, 92, 0.1);
}

.question-meta-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-meta-row__left {
  gap: 8px;
  flex-wrap: wrap;
}

.question-index-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 105, 118, 0.18), rgba(118, 145, 156, 0.18));
  color: #35505d;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(79, 105, 118, 0.12);
}

.question-index-badge--compact {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.question-meta-chip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.question-meta-chip--compact {
  min-height: 28px;
  padding: 0 11px;
  font-size: 11px;
}

.question-meta-chip--source {
  background: rgba(79, 105, 118, 0.14);
  color: #47606d;
}

.question-meta-chip--year {
  background: rgba(84, 136, 160, 0.12);
  color: #43728a;
}

.question-meta-chip--number {
  background: rgba(120, 132, 175, 0.12);
  color: #5a6596;
}

.question-meta-chip--type {
  background: rgba(73, 129, 119, 0.12);
  color: #3f6f66;
}

.question-meta-chip--id {
  background: rgba(132, 146, 154, 0.12);
  color: #667982;
}

.question-meta-row__right {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.question-divider {
  height: 1px;
  margin: 10px 0 12px;
  background: rgba(122, 142, 154, 0.16);
}

.question-content,
.question-solution,
.knowledge-body {
  color: #324955;
  line-height: 2.8;
  font-size: 15px;
}

.question-content img,
.question-solution img,
.knowledge-body img {
  display: block;
  max-width: min(100%, 420px);
  height: auto;
  margin: 18px auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.question-tag-row {
  margin-top: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-tag--violet {
  background: rgba(79, 105, 118, 0.12);
  color: #46606d;
}

.brand-tag--lavender {
  background: rgba(73, 129, 119, 0.11);
  color: #426f67;
}

.brand-tag--mist {
  background: rgba(120, 132, 175, 0.1);
  color: #5a6594;
}

.question-actions {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(122, 142, 154, 0.16);
  flex-wrap: wrap;
}

.question-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.question-toggle {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 14px;
  gap: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  border: 1px solid rgba(91, 114, 128, 0.14);
  border-radius: 999px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.question-toggle.is-active {
  background: linear-gradient(135deg, rgba(79, 105, 118, 0.14), rgba(108, 122, 182, 0.16));
  border-color: rgba(79, 105, 118, 0.24);
  color: #39525e;
}

.question-toggle.is-basketed {
  background: linear-gradient(135deg, #4f6976, #6f8390);
  color: #fff;
  border-color: rgba(64, 86, 97, 0.28);
  box-shadow: 0 12px 28px rgba(64, 86, 97, 0.18);
}

.question-toggle__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(110, 115, 182, 0.24);
  box-shadow: inset 0 0 0 1px rgba(110, 115, 182, 0.16);
}

.question-toggle.is-active .question-toggle__dot {
  background: #5f7a88;
}

.question-toggle.is-basketed .question-toggle__dot {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.basket-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(50, 68, 80, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.basket-backdrop.is-visible {
  animation: fade-in 180ms ease;
}

.basket-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 25;
  width: min(800px, calc(100vw - 28px));
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--surface-line);
  background: rgba(245, 249, 252, 0.92);
  border-radius: 28px;
  box-shadow: 0 24px 56px rgba(45, 60, 70, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(18px);
  opacity: 0;
  pointer-events: none;
}

.basket-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  transition: transform 200ms ease, opacity 200ms ease;
}

.basket-drawer__header,
.basket-item,
.basket-item__meta,
.basket-item__actions,
.basket-export-card__actions {
  display: flex;
}

.basket-drawer__header {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.basket-drawer__eyebrow {
  color: #617887;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.basket-drawer__title {
  margin: 6px 0 4px;
  font-size: 1.8rem;
  line-height: 1;
}

.basket-drawer__meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.basket-close-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(91, 114, 128, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.basket-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
}

.basket-item {
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(122, 142, 154, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.basket-item__body {
  flex: 1;
  min-width: 0;
}

.basket-item__meta {
  gap: 8px;
  flex-wrap: wrap;
}

.basket-item__title {
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
}

.basket-item__title .content-block + .content-block {
  margin-top: 10px;
}

.basket-item__title img {
  max-width: min(100%, 260px);
  border-radius: 10px;
}

.basket-item__tags {
  margin-top: 10px;
}

.basket-item__tags .question-tag-row {
  margin-top: 0;
}

.basket-item__tags .brand-tag {
  min-height: 28px;
  padding: 0 11px;
  font-size: 11px;
}

.basket-item__actions {
  flex-direction: column;
  gap: 8px;
  min-width: 76px;
}

.basket-item__btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(91, 114, 128, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.basket-item__btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.basket-item__btn--danger {
  color: #9a5555;
}

.basket-empty-state {
  padding: 26px 18px;
  border-radius: 20px;
  color: var(--ink-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(122, 142, 154, 0.2);
}

.basket-export-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(122, 142, 154, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.basket-export-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.basket-export-card label + label {
  margin-top: 12px;
}

.basket-export-card span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.basket-switch {
  flex-direction: row !important;
  align-items: center;
}

.basket-switch input {
  margin: 0;
  accent-color: #5f7a88;
}

.basket-export-card__actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.basket-export-card__actions .soft-btn {
  flex: 1 1 160px;
}

.question-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.question-extra {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(122, 142, 154, 0.16);
}

.question-extra h4,
.resource-detail-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.pagination-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.knowledge-toolbar-intro {
  margin-bottom: 14px;
}

.knowledge-toolbar-intro__title,
.feature-placeholder-card__grid strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.knowledge-toolbar-intro__desc {
  margin-top: 6px;
  font-size: 14px;
}

.knowledge-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.knowledge-results-head {
  margin-bottom: 14px;
  font-size: 14px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.knowledge-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
}

.knowledge-item.is-selected {
  border-color: rgba(79, 105, 118, 0.26);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(61, 82, 92, 0.08);
}

.knowledge-card__title,
.resource-card__title {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

.knowledge-item .knowledge-card__title {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.knowledge-card__meta {
  font-size: 12px;
  font-weight: 700;
}

.knowledge-reader {
  padding: 20px 22px;
  min-height: 620px;
}

.knowledge-card__kicker {
  color: #7d8f98;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.knowledge-card__summary {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
}

.knowledge-reader h1,
.knowledge-reader h2,
.knowledge-reader h3 {
  color: var(--ink);
  margin: 1.1rem 0 0.7rem;
}

.knowledge-reader pre,
.question-card pre {
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: rgba(236, 241, 246, 0.9);
}

.resource-toolbar {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.resource-toolbar > span {
  color: var(--ink-muted);
  font-size: 14px;
}

.resource-card-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  padding: 12px 14px;
}

.resource-card {
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.resource-card__badge {
  width: 82px;
  min-width: 82px;
  height: 108px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f9f2ee, #f0e6dd);
  color: #8d6147;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  border: 1px solid rgba(198, 168, 152, 0.2);
}

.resource-card__badge--word {
  background: linear-gradient(180deg, #ebf2f8, #dde7f0);
  color: #577492;
}

.resource-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.resource-card__eyebrow-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.resource-card__eyebrow {
  color: #7d8f98;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.resource-card__title {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.resource-card__meta {
  gap: 8px;
  flex-wrap: wrap;
}

.resource-meta-pill,
.resource-category-pill {
  color: var(--ink-soft);
}

.resource-category-pill--paper {
  background: rgba(244, 232, 225, 0.92);
  color: #9a6c50;
}

.resource-category-pill--notes {
  background: rgba(228, 238, 244, 0.92);
  color: #567188;
}

.resource-category-pill--bundle {
  background: rgba(234, 239, 248, 0.92);
  color: #6171a4;
}

.resource-card__desc {
  font-size: 14px;
}

.resource-card__actions {
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.resource-action {
  width: 100%;
}

.resource-action--danger {
  color: #c27a63;
}

.resource-action:disabled,
.soft-btn:disabled,
.nav-action:disabled,
.page-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.resource-detail-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(122, 142, 154, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.admin-composer {
  margin-bottom: 14px;
}

.editor-card {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(122, 142, 154, 0.16);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
}

.editor-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.editor-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editor-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-grid label.full-span {
  grid-column: 1 / -1;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.content-block + .content-block {
  margin-top: 24px;
}

.content-block img {
  display: block;
  max-width: min(100%, 380px);
  margin: 0 auto;
}

.latex-table-wrap {
  overflow: auto;
  padding: 2px;
}

.latex-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.74);
}

.latex-math-cell {
  padding: 10px;
  border: 1px solid rgba(122, 142, 154, 0.18);
  color: var(--ink-soft);
}

.options-block {
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
}

.options-block ol {
  display: grid;
  grid-template-columns: repeat(var(--option-cols, 1), minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.options-block li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.options-block strong {
  min-width: 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(120, 132, 175, 0.14);
  color: #5a6596;
  font-weight: 800;
  line-height: 1;
}

.options-block li > span {
  display: block;
  min-height: 24px;
  line-height: 1.55;
}

.feature-placeholder-card__title {
  font-size: 2.1rem;
}

.feature-placeholder-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.feature-placeholder-card__grid div {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(122, 142, 154, 0.16);
  background: rgba(255, 255, 255, 0.68);
}

.app-toast {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 14px 13px 16px;
  border-radius: 999px;
  border: 1px solid rgba(91, 114, 128, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 58px rgba(43, 59, 69, 0.16);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.app-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.app-toast--success {
  border-color: rgba(73, 129, 119, 0.24);
  background: rgba(242, 250, 247, 0.96);
  color: #315f55;
}

.app-toast--error {
  border-color: rgba(171, 80, 74, 0.22);
  background: rgba(255, 246, 244, 0.96);
  color: #8a413d;
}

.app-toast__action {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #315f55;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .top-nav-shell {
    grid-template-columns: 1fr;
  }

  .top-nav-shell__right {
    align-items: flex-start;
  }

  .question-workspace,
  .knowledge-layout,
  .resource-card-shell,
  .brand-hero {
    grid-template-columns: 1fr;
  }

  .knowledge-tree-panel {
    position: static;
  }

  .knowledge-filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .resource-card__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .resource-action {
    width: auto;
    flex: 1 1 180px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(calc(100% - 12px), 1280px);
    margin-top: 6px;
  }

  .top-nav-shell,
  .module-nav,
  .knowledge-tree-panel,
  .brand-hero,
  .filter-panel,
  .knowledge-filter-panel,
  .knowledge-reader,
  .feature-placeholder-card {
    border-radius: 22px;
  }

  .module-nav,
  .filter-actions,
  .results-summary,
  .results-summary__actions,
  .top-auth-form,
  .feature-placeholder-card__grid {
    flex-direction: column;
    align-items: stretch;
  }

  .top-auth-form input,
  .module-pill,
  .soft-btn,
  .nav-action,
  .auth-tab {
    width: 100%;
  }

  .knowledge-filter-panel,
  .filters-row,
  .editor-grid,
  .feature-placeholder-card__grid {
    grid-template-columns: 1fr;
  }

  .question-meta-row,
  .question-actions,
  .resource-card,
  .resource-card__eyebrow-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .basket-drawer {
    top: 10px;
    right: 6px;
    bottom: 10px;
    width: calc(100vw - 12px);
    padding: 14px;
  }

  .basket-fab {
    right: 14px;
    bottom: 14px;
    min-height: 54px;
    padding: 0 18px;
  }

  .basket-item {
    flex-direction: column;
  }

  .basket-item__actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .resource-card__badge {
    width: 72px;
    min-width: 72px;
    height: 92px;
  }
}
