:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --surface-soft: #f2f2f3;
  --line: #ececec;
  --line-strong: #dedee0;
  --text: #17191c;
  --muted: #777b86;
  --faint: #979799;
  --highlight: #fbe1d1;
  --row-active: #f2f2f3;
  --row-hover: #fafafb;
  --table-head-bg: #ffffff;
  --shadow: none;
  --shadow-soft: none;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html,
body {
  min-width: 1080px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

button,
input {
  font-family: var(--font-sans);
}

[hidden] {
  display: none !important;
}

.app-shell {
  --vocab-detail-pane-width: 475px;
  grid-template-columns: 220px minmax(510px, 1fr) var(--vocab-detail-pane-width);
  grid-template-rows: 84px minmax(0, 1fr);
  width: min(1344px, 100vw);
  max-width: 1344px;
  height: 100vh;
  min-height: 720px;
  margin-inline: auto;
  padding: 0 24px 24px;
  background: var(--bg);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  width: 100%;
  height: 84px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.brand {
  width: auto;
  min-height: 0;
  gap: 10px;
  padding: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  filter: grayscale(1);
}

.brand h1 {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.3px;
}

.sidebar {
  overflow: hidden;
}

.sidebar-modules {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  width: 100%;
  min-height: 0;
  padding: 20px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

.module-nav-item {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.module-tab {
  box-sizing: border-box;
  position: relative;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  height: auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 9999px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}

.module-tab:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.module-tab.active {
  border-color: transparent;
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 450;
}

.module-nav-item.active > .module-tab.active,
.module-nav-item.active > .module-tab.active:hover {
  background: transparent;
}

.module-tab.active::after {
  display: none;
}

.module-tab.disabled {
  color: var(--faint);
  opacity: 0.62;
}

.module-icon {
  box-sizing: border-box;
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 500;
}

.module-icon-svg {
  grid-area: 1 / 1;
  display: block;
  width: 18px;
  height: 18px;
}

.module-icon-filled {
  display: none;
}

.module-tab.active .module-icon {
  border-color: var(--text);
  color: var(--surface);
  background: var(--text);
}

.module-tab.active .module-icon-outline {
  display: none;
}

.module-tab.active .module-icon-filled {
  display: block;
}

.module-tab > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-section.module-secondary-nav {
  box-sizing: border-box;
  width: calc(100% - 26px);
  margin: 0 0 8px 26px;
  padding: 2px 0 2px 12px;
  border: 0;
  background: transparent;
}

.module-secondary-nav .choice-list {
  gap: 4px;
}

.module-secondary-nav .choice {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9999px;
  color: var(--faint);
  font-size: 13px;
}

.module-secondary-nav .choice-label,
.module-secondary-nav .choice-count {
  white-space: nowrap;
}

.module-secondary-nav .choice-count {
  justify-self: end;
}

.module-secondary-nav .choice:hover {
  color: var(--text);
  background: var(--bg);
}

.module-secondary-nav .choice.active {
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 450;
}

.module-secondary-nav .choice::before {
  display: none;
}

.module-secondary-nav .choice-count {
  font-size: 11px;
}

.sidebar,
.table-pane,
.detail-pane {
  min-height: 0;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 24px 0 0 24px;
  background: var(--bg);
}

.filter-section {
  padding: 26px 20px 22px;
  border-color: var(--line);
}

.filter-section:last-child {
  border-bottom: 0;
}

.filter-section h2 {
  padding: 0 10px 12px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.choice-list {
  gap: 4px;
}

.choice {
  position: relative;
  min-height: 40px;
  padding: 0 10px 0 30px;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 400;
}

.choice::before {
  position: absolute;
  left: 11px;
  width: 8px;
  height: 8px;
  border: 1px solid #979799;
  border-radius: 50%;
  background: transparent;
  content: "";
}

.choice:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.choice.active {
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: none;
}

.choice.active::before {
  border-color: var(--text);
  background: var(--text);
  box-shadow: inset 0 0 0 2px var(--surface-soft);
}

.choice-count {
  color: var(--faint);
  font-size: 12px;
}

.workspace {
  grid-column: 2 / 4;
  grid-row: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(510px, 1fr) var(--vocab-detail-pane-width, 380px);
  grid-template-rows: 92px minmax(0, 1fr);
}

.speaking-mode .workspace {
  display: contents;
}

.speaking-mode .vocab-panel-head {
  display: none;
}

.table-pane {
  grid-column: 1;
  grid-row: 2;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0;
}

body:not(.speaking-mode) .table-pane {
  grid-template-rows: 58px minmax(0, 1fr);
}

.speaking-mode .table-pane {
  grid-template-rows: minmax(0, 1fr);
}

.table-head-wrap {
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.table-head-wrap::-webkit-scrollbar {
  width: 8px;
}

.table-head-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.table-head-wrap table,
.table-wrap table {
  width: 100%;
}

.table-head-wrap thead th {
  position: static;
}

.rank-track {
  width: 58px;
}

.term-track {
  width: 32%;
}

.brief-track {
  width: auto;
}

.doc-track {
  width: 92px;
}

.freq-track {
  width: 100px;
}

.detail-pane {
  grid-column: 2;
  grid-row: 2;
  border: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
  border-radius: 0 0 24px 0;
}

body:not(.speaking-mode) .detail-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.vocab-panel-head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 24px 0 0;
  background: var(--surface);
}

.vocab-panel-copy {
  display: flex;
  min-width: 190px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 7px;
}

.vocab-panel-head h2,
.vocab-panel-head p {
  margin: 0;
}

.vocab-panel-head h2 {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
}

.vocab-panel-head p {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 400;
}

.vocab-panel-head .frequency-choice-list {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.vocab-panel-head .frequency-choice-list[hidden] {
  display: none;
}

.vocab-panel-head .frequency-choice-list .choice {
  min-height: 34px;
  width: auto;
  gap: 4px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 11px;
  white-space: nowrap;
}

.vocab-panel-head .frequency-choice-list .choice::before {
  display: none;
}

.vocab-panel-head .frequency-choice-list .choice-count {
  margin-left: 0;
  font-size: 10px;
}

.table-wrap {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-color: #dedee0 transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 9999px;
  background: #dedee0;
  background-clip: padding-box;
}

table {
  font-size: 14px;
}

thead th {
  height: 58px;
  padding: 0 16px;
  border-color: var(--line);
  color: var(--faint);
  background: rgba(255, 255, 255, 0.98);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.table-sort-button:hover,
.table-sort-button.active {
  color: var(--text);
}

.table-sort-direction {
  position: relative;
  display: inline-block;
  flex: 0 0 10px;
  width: 10px;
  height: 14px;
  color: var(--text);
  transform-origin: center;
}

.table-sort-direction[hidden] {
  display: none;
}

.table-sort-direction::before,
.table-sort-direction::after {
  position: absolute;
  background: currentColor;
  content: "";
}

.table-sort-direction::before {
  top: 2px;
  left: 4px;
  width: 1px;
  height: 10px;
}

.table-sort-direction::after {
  top: 2px;
  left: 4px;
  width: 5px;
  height: 1px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.table-sort-direction[data-direction="desc"] {
  transform: none;
}

.table-sort-direction[data-direction="desc"]::after {
  top: 11px;
  transform: rotate(-45deg);
}

.doc-col .table-sort-button,
.freq-col .table-sort-button {
  justify-content: flex-end;
  width: 100%;
}

td {
  height: 68px;
  padding: 0 16px;
  border-bottom: 0;
  color: var(--muted);
  background-color: var(--surface);
  background-image: linear-gradient(var(--line), var(--line));
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 100% 1px;
}

tbody tr {
  --current-row-bg: var(--surface);
}

tbody tr:not(.skeleton-row):hover {
  --current-row-bg: var(--row-hover);
}

tbody tr.active {
  --current-row-bg: var(--surface-soft);
}

tbody tr:not(.skeleton-row):hover td,
tbody tr.locked-row:hover td,
tbody tr.active td {
  background-color: var(--current-row-bg);
  background-image: none;
}

tbody tr:has(+ tr:not(.skeleton-row):hover) td,
tbody tr.before-active td {
  background-image: none;
}

tbody tr:not(.skeleton-row):hover td:first-child,
tbody tr.active td:first-child {
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}

tbody tr:not(.skeleton-row):hover td:last-child,
tbody tr.active td:last-child {
  border-radius: 0;
  background-color: transparent;
}

tbody td:first-child,
tbody td:last-child {
  position: relative;
}

tbody td:first-child {
  background-position: right bottom;
  background-size: calc(100% - 16px) 1px;
}

tbody td:last-child {
  background-position: left bottom;
  background-size: calc(100% - 8px) 1px;
}

tbody tr:not(.skeleton-row):hover td:first-child::before,
tbody tr.active td:first-child::before,
tbody tr:not(.skeleton-row):hover td:last-child::before,
tbody tr.active td:last-child::before {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  background: var(--current-row-bg);
  content: "";
}

tbody tr:not(.skeleton-row):hover td:first-child::before,
tbody tr.active td:first-child::before {
  right: 0;
  left: 8px;
  border-radius: 14px 0 0 14px;
}

tbody tr:not(.skeleton-row):hover td:last-child::before,
tbody tr.active td:last-child::before {
  right: 0;
  left: 0;
  border-radius: 0 14px 14px 0;
}

tbody td:first-child > *,
tbody td:last-child > * {
  position: relative;
  z-index: 1;
}

.rank-col,
tbody td:first-child {
  width: 58px;
  padding-right: 0;
  padding-left: 24px;
  text-indent: 0;
  text-overflow: clip;
}

.doc-col {
  width: 92px;
}

.freq-col {
  width: 100px;
}

.term-cell {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.freq,
.doc-count,
tbody td:first-child {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.loading-row td,
.error-row td,
.empty-row td {
  color: var(--muted);
}

.detail-content {
  scrollbar-color: #dedee0 transparent;
  scrollbar-width: thin;
}

.skeleton-line {
  background: #dedee0;
}

.skeleton-line::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
}

.skeleton-row td,
.skeleton-row:hover td,
.speaking-skeleton-list,
.speaking-skeleton-detail,
.speaking-skeleton-card,
.speaking-skeleton-card:hover {
  background: var(--surface);
}

.skeleton-row.skeleton-active td,
.speaking-skeleton-card.active {
  background: var(--surface-soft);
}

.skeleton-row.skeleton-active td:first-child {
  box-shadow: none;
}

.detail-head {
  padding: 30px 28px 14px;
  background: rgba(255, 255, 255, 0.98);
}

.detail-title {
  gap: 10px;
}

.detail-title h2 {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.phonetic-line {
  gap: 14px;
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 13px;
}

.audio-actions {
  gap: 8px;
  margin-top: 2px;
}

.audio-button {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 400;
}

.audio-button:hover,
.audio-button.playing {
  border-color: var(--text);
  color: var(--surface);
  background: var(--text);
}

.definition-block {
  padding: 8px 28px 24px;
  border-color: var(--line);
}

.definition-list {
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.definition-item {
  gap: 10px;
}

.pos-tag {
  color: var(--faint);
  font-weight: 400;
}

.examples-block {
  padding: 22px 0 34px;
}

.examples-title {
  padding: 0 28px 14px;
}

.examples-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 480;
}

.examples-title span {
  color: var(--faint);
  font-size: 12px;
}

.example {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 22px 28px;
  border-top: 0;
}

.example::before,
.example:last-child::after {
  position: absolute;
  right: 8px;
  left: 16px;
  height: 1px;
  background: var(--line);
  content: "";
}

.example::before {
  top: 0;
}

.example:last-child {
  border-bottom: 0;
}

.example:last-child::after {
  bottom: 0;
}

.example-number {
  color: var(--faint);
  font-size: 11px;
}

.example-text {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.62;
}

.example-source {
  margin-top: 9px;
  color: var(--faint);
  font-size: 11px;
}

mark {
  padding: 0 2px;
  color: inherit;
  background: transparent;
  box-shadow: inset 0 -5px var(--highlight);
}

.empty-state {
  padding: 44px 28px;
}

.empty-state h2 {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
}

.empty-state p {
  max-width: 290px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.locked-content {
  position: relative;
  display: inline-block;
  min-width: 1.8em;
  max-width: 100%;
  color: transparent;
  filter: none;
  opacity: 1;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.locked-content::after {
  position: absolute;
  top: 50%;
  left: -2px;
  right: -2px;
  height: 0.82em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 24, 31, 0.05), rgba(20, 24, 31, 0.18), rgba(20, 24, 31, 0.06));
  content: "";
  filter: blur(5px);
  transform: translateY(-50%);
}

tbody tr.locked-row td {
  text-overflow: clip;
}

tbody tr.locked-row .brief-cell .locked-content {
  display: block;
  width: 100%;
  min-width: 0;
}

.wechat-contact {
  position: sticky;
  bottom: 0;
  z-index: 2;
  justify-content: center;
  width: auto;
  min-height: 52px;
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  background: var(--bg);
  flex: 0 0 auto;
}

.sidebar > .filter-section:last-of-type {
  border-bottom: 0;
}

.corner-link {
  padding: 0 10px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.corner-link:first-child {
  padding-left: 10px;
}

.corner-link:hover {
  color: var(--text);
}

.corner-link + .corner-link {
  border-color: var(--line-strong);
}

.access-bar {
  bottom: 16px;
  width: min(680px, calc(100vw - 420px));
  min-height: 64px;
  padding: 10px 10px 10px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.access-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 480;
}

.access-copy span {
  color: var(--muted);
  font-size: 12px;
}

.access-primary,
.access-secondary,
.modal-primary {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--text);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
}

.access-primary,
.modal-primary {
  color: var(--surface);
  background: var(--text);
}

.access-secondary {
  color: var(--text);
  background: transparent;
}

.modal-backdrop {
  background: rgba(23, 25, 28, 0.18);
}

.access-modal {
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.module-tab:focus-visible,
.choice:focus-visible,
.table-sort-button:focus-visible,
.speaking-unit-tabs button:focus-visible,
.speaking-topic-tags button:focus-visible,
.speaking-detail-tabs button:focus-visible,
.speaking-question-card:focus-visible,
.access-primary:focus-visible,
.access-secondary:focus-visible,
.modal-primary:focus-visible,
.admin-primary:focus-visible,
.admin-ghost:focus-visible,
.admin-row-action:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

/* Speaking surfaces keep the original information architecture while sharing
   the same quiet monochrome treatment as the vocabulary workspace. */
.speaking-mode .app-shell {
  --speaking-right-pane-width: 475px;
  grid-template-columns: 220px minmax(510px, 1fr) var(--speaking-right-pane-width);
  width: min(1344px, 100vw);
  max-width: 1344px;
}

.speaking-mode .table-pane.speaking-single-pane {
  grid-column: 2 / -1;
  border-right: 1px solid var(--line);
  border-radius: 0 24px 24px 0;
}

.speaking-mode .table-pane.speaking-p2-pane {
  grid-column: 2;
}

.speaking-mode .detail-pane.speaking-p3-pane {
  grid-column: 3;
}

.speaking-board-head-spanning {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.speaking-scene-row {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.speaking-scene-tabs {
  justify-content: flex-start;
  flex: 1 1 auto;
  min-height: 36px;
}

.speaking-panel-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(510px, 1fr) var(--speaking-right-pane-width);
  overflow: hidden;
}

.speaking-panel-grid > .speaking-board,
.speaking-panel-grid > .speaking-detail-board,
.speaking-panel-grid .speaking-topic-stack {
  min-width: 0;
}

.speaking-board,
.speaking-detail-board,
.speaking-question-card,
.speaking-answer-card,
.speaking-cue-card,
.speaking-qa,
.speaking-template-slot {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
}

.speaking-board,
.speaking-detail-board {
  border-radius: 24px;
}

.speaking-panel-grid > .speaking-board:first-child {
  border-radius: 0;
}

.speaking-panel-grid > .speaking-detail-board {
  border-radius: 0 24px 24px 0;
}

.speaking-panel-grid .speaking-topic-stack,
.speaking-panel-grid .speaking-detail-body {
  scrollbar-color: #dedee0 transparent;
  scrollbar-width: thin;
}

.speaking-unit-tabs,
.speaking-topic-section,
.speaking-stage,
.speaking-detail-tabs,
.speaking-detail-body {
  border-color: var(--line);
  background: var(--surface);
}

.speaking-board-head,
.speaking-detail-head,
.speaking-detail-tabs,
.speaking-topic-section,
.speaking-reference-answer,
.speaking-qa,
.speaking-cue-card {
  border-color: var(--line);
}

.speaking-board-head h2,
.speaking-board-title span,
.speaking-detail-head .detail-title h2,
.speaking-section-heading h3,
.speaking-stage-title h3 {
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 400;
}

.speaking-unit-tabs button,
.speaking-topic-tags button,
.speaking-detail-tabs button {
  border-color: transparent;
  border-radius: 9999px;
  color: var(--muted);
  background: transparent;
  font-weight: 400;
  box-shadow: none;
}

.speaking-detail-tabs button {
  font-weight: 600;
}

.speaking-unit-tabs button:hover,
.speaking-topic-tags button:hover,
.speaking-detail-tabs button:hover,
.speaking-unit-tabs button.active,
.speaking-topic-tags button.active,
.speaking-detail-tabs button.active {
  border-color: transparent;
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: none;
}

.speaking-question-card:hover,
.speaking-question-card.active {
  border-color: transparent;
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: none;
}

.speaking-question-card strong,
.speaking-answer-card strong,
.speaking-answer strong,
.speaking-template-slot strong {
  color: var(--text);
  font-weight: 480;
}

.speaking-question-card > span,
.speaking-unit-tabs small,
.speaking-topic-tags small,
.question-zh,
.speaking-section-heading p,
.speaking-stage-title span,
.speaking-translation,
.speaking-answer.zh p,
.speaking-answer-card p,
.speaking-answer-card.zh p,
.speaking-qa p,
.speaking-answer p,
.speaking-template-slot p {
  color: var(--muted);
}

.speaking-question-card > span {
  color: var(--text);
  background: var(--surface-soft);
}

.speaking-cue-card pre,
.speaking-template-slot {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: none;
}

.speaking-reference-answer h4 {
  color: var(--text);
  font-weight: 480;
}

.speaking-reference-answer {
  border-color: var(--line);
}

.speaking-detail-tabs button::after,
.speaking-detail-tabs button.active::after {
  display: none;
  background: transparent;
}

/* Admin */
.admin-page {
  min-width: 0;
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.admin-page.is-admin-authenticated {
  height: 100vh;
  overflow: hidden;
}

.admin-shell {
  width: min(1200px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 48px 0;
}

.admin-panel {
  display: grid;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: none;
}

.admin-kicker {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 400;
}

.admin-head h1 {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.admin-login,
.admin-add-form {
  gap: 16px;
}

.admin-login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  padding: 24px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.admin-login label,
.admin-add-form label {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.admin-login input,
.admin-add-form input,
.admin-add-form select,
.admin-toolbar input {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
}

.admin-login input:focus,
.admin-add-form input:focus,
.admin-add-form select:focus,
.admin-toolbar input:focus {
  border-color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(23, 25, 28, 0.06);
}

.admin-primary,
.admin-ghost,
.admin-row-action {
  border-radius: 9999px;
  font-weight: 400;
  box-shadow: none;
}

.admin-primary {
  color: var(--surface);
  background: var(--text);
}

.admin-primary:hover {
  background: #17191c;
}

.admin-ghost,
.admin-row-action {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--surface);
}

.admin-ghost:hover,
.admin-row-action:hover {
  border-color: var(--text);
}

.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 24px;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  border-color: var(--line);
  color: var(--text);
  font-size: 13px;
}

.admin-table th {
  color: var(--faint);
  background: var(--bg);
  font-weight: 400;
}

.admin-table tbody tr:hover td {
  background: var(--bg);
}

.admin-table tbody tr {
  cursor: default;
}

.admin-table tbody td:first-child > .admin-cell-value {
  position: relative;
  z-index: 1;
}

.admin-table tbody tr.is-editing td {
  background: var(--bg);
}

.admin-inline-field {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

.admin-inline-field:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(23, 25, 28, 0.06);
}

.admin-row-action.primary {
  border-color: var(--text);
  color: var(--surface);
  background: var(--text);
}

.admin-row-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-table th:last-child {
  width: 210px;
}

.admin-row-action.danger {
  border-color: #ececec;
  color: #17191c;
  background: #fafafb;
}

.admin-note {
  color: var(--muted);
}

/* User admin expansion */
.admin-shell {
  width: min(1480px, calc(100vw - 48px));
}

.admin-head,
.admin-section-head,
.admin-chart-head,
.admin-pagination,
.admin-dialog-head,
.admin-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-section-kicker {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 12px;
}

.admin-section-head h2,
.admin-chart-head h3,
.admin-dialog-head h2 {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  line-height: 1.25;
}

.admin-section-head h2,
.admin-dialog-head h2 {
  font-size: 24px;
}

.admin-chart-head h3 {
  font-size: 18px;
}

.admin-dashboard,
.admin-users,
.admin-audit {
  display: grid;
  gap: 20px;
}

.admin-panel.is-authenticated {
  display: block;
  height: calc(100vh - 96px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.admin-panel.is-authenticated .admin-head,
.admin-panel.is-authenticated > .admin-login {
  display: none;
}

.admin-workspace {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
}

.admin-workspace[hidden],
.admin-view[hidden] {
  display: none;
}

.admin-sidebar {
  display: flex;
  height: 100%;
  min-height: 0;
  padding: 28px 18px 20px;
  align-self: stretch;
  flex-direction: column;
  color: #ffffff;
  background: #17191c;
}

.admin-sidebar-brand {
  display: grid;
  padding: 4px 10px 26px;
  gap: 7px;
}

.admin-sidebar-brand span,
.admin-sidebar-footer span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.admin-sidebar-brand strong {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.admin-side-nav {
  display: grid;
  gap: 7px;
}

.admin-nav-item {
  display: grid;
  width: 100%;
  min-height: 52px;
  padding: 0 13px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.admin-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-nav-item.is-active {
  color: #17191c;
  background: #ffffff;
}

.admin-nav-index {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  opacity: 0.58;
}

.admin-sidebar-footer {
  display: grid;
  margin-top: auto;
  padding: 18px 10px 0;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-sidebar-footer button {
  width: max-content;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.admin-sidebar-footer button:hover {
  color: #ffffff;
}

.admin-main {
  display: grid;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--surface);
}

.admin-page-head {
  display: flex;
  min-height: 108px;
  padding: 26px 32px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-page-head h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.admin-page-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-page-head .admin-ghost {
  min-width: 90px;
}

.admin-page-body {
  min-width: 0;
  min-height: 0;
  padding: 28px 32px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-view {
  display: grid;
  gap: 20px;
}

.admin-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.admin-main > .admin-note {
  min-height: 40px;
  margin: 0;
  padding: 0 32px 20px;
  font-size: 12px;
}

.admin-nav-item:focus-visible,
.admin-sidebar-footer button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

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

.admin-metric-card,
.admin-chart-card,
.admin-add-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.admin-metric-card {
  display: grid;
  min-height: 142px;
  padding: 20px;
  align-content: start;
  gap: 8px;
}

.admin-metric-card span,
.admin-metric-card small,
.admin-chart-caption,
.admin-result-count {
  color: var(--muted);
  font-size: 12px;
}

.admin-metric-card strong {
  margin-top: 4px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.1;
}

.admin-metric-card small {
  align-self: end;
}

.admin-chart-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(500px, 1.22fr);
  gap: 12px;
}

.admin-chart-card {
  display: grid;
  min-height: 330px;
  padding: 22px;
  align-content: start;
  gap: 22px;
}

.admin-distribution-chart {
  display: grid;
  align-content: center;
  gap: 16px;
}

.admin-distribution-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 76px;
  gap: 8px 12px;
}

.admin-distribution-label {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.admin-distribution-label span,
.admin-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-distribution-label i,
.admin-trend-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chart-color);
}

.admin-distribution-track {
  height: 9px;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--surface-soft);
}

.admin-distribution-track span {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: var(--chart-color);
}

.admin-distribution-row small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.admin-trend-chart {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.admin-trend-legend {
  display: flex;
  min-height: 20px;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.admin-trend-bars {
  display: grid;
  height: 210px;
  padding-top: 12px;
  grid-template-columns: repeat(30, minmax(8px, 1fr));
  align-items: end;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to top, transparent 49%, var(--line) 50%, transparent 51%);
}

.admin-trend-day {
  display: grid;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) 24px;
  align-items: end;
  gap: 5px;
}

.admin-trend-day > strong {
  display: flex;
  width: 100%;
  min-height: 2px;
  overflow: hidden;
  flex-direction: column-reverse;
  border-radius: 5px 5px 0 0;
  background: var(--line);
}

.admin-trend-day > strong span {
  display: block;
  width: 100%;
  background: var(--chart-color);
}

.admin-trend-day small {
  width: 48px;
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
  transform: rotate(-35deg) translate(-5px, 3px);
  transform-origin: left center;
}

.admin-chart-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}

.admin-add-panel {
  padding: 0 22px 22px;
}

.admin-add-panel > h2 {
  margin: 0;
  padding: 20px 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}

.admin-add-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.admin-add-note-field {
  grid-column: span 3;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) repeat(4, minmax(112px, 0.7fr)) auto;
  align-items: end;
  gap: 12px;
}

.admin-filters > .admin-ghost {
  min-width: 92px;
  white-space: nowrap;
}

.admin-filters label,
.admin-edit-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-filters input,
.admin-filters select,
.admin-edit-form input,
.admin-edit-form select,
.admin-edit-form textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
}

.admin-edit-form textarea {
  height: auto;
  min-height: 96px;
  padding-block: 12px;
  resize: vertical;
}

.admin-filters input:focus,
.admin-filters select:focus,
.admin-edit-form input:focus,
.admin-edit-form select:focus,
.admin-edit-form textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(23, 25, 28, 0.06);
}

.admin-table-wrap {
  position: relative;
  overflow: auto;
  border-radius: 20px;
}

.admin-table {
  min-width: 1180px;
}

.admin-table th,
.admin-table td {
  height: 68px;
  padding: 14px 16px;
  vertical-align: middle;
}

.admin-table th {
  height: 52px;
  white-space: nowrap;
}

.admin-table th:last-child {
  width: 88px;
}

.admin-table tbody tr.is-archived td {
  color: var(--muted);
  background: var(--surface-soft);
}

.admin-cell-value,
.admin-cell-secondary {
  display: block;
  white-space: nowrap;
}

.admin-cell-secondary {
  max-width: 180px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.admin-source-label {
  white-space: nowrap;
}

.admin-status {
  display: inline-flex;
  min-height: 28px;
  padding: 0 10px;
  align-items: center;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-status.active {
  color: #19613d;
  background: #eaf7ef;
}

.admin-status.inactive,
.admin-status.archived {
  color: #60646c;
  background: #f0f1f2;
}

.admin-status.expiring {
  color: #8a5500;
  background: #fff4d8;
}

.admin-status.expired {
  color: #9a3030;
  background: #fdecec;
}

.admin-sort {
  padding: 0;
  border: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  font: inherit;
}

.admin-sort::after {
  content: "";
  display: inline-block;
  width: 12px;
  margin-left: 4px;
}

.admin-sort.is-active[data-direction="asc"]::after {
  content: "↑";
}

.admin-sort.is-active[data-direction="desc"]::after {
  content: "↓";
}

.admin-row-menu {
  position: relative;
}

.admin-row-menu summary {
  display: inline-flex;
  height: 34px;
  padding: 0 12px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
}

.admin-row-menu summary::-webkit-details-marker {
  display: none;
}

.admin-row-menu-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 136px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(23, 25, 28, 0.12);
}

.admin-row-menu-popover button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.admin-row-menu-popover button:hover {
  background: var(--surface-soft);
}

.admin-row-menu-popover button.danger {
  color: #9a3030;
}

.admin-pagination {
  color: var(--muted);
  font-size: 12px;
}

.admin-pagination > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-pagination .admin-ghost {
  height: 36px;
  padding-inline: 13px;
  font-size: 12px;
}

.admin-ghost:disabled,
.admin-primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-audit-table {
  min-width: 920px;
}

.admin-audit-table th:last-child {
  width: auto;
}

.admin-audit-action {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 9999px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 12px;
}

.admin-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 25, 28, 0.2);
}

.admin-dialog::backdrop {
  background: rgba(23, 25, 28, 0.28);
  backdrop-filter: blur(4px);
}

.admin-edit-form {
  display: grid;
  padding: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-dialog-head,
.admin-dialog-actions,
.admin-edit-note-field {
  grid-column: 1 / -1;
}

.admin-dialog-close {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  font-size: 24px;
  line-height: 1;
}

.admin-dialog-actions {
  margin-top: 8px;
  justify-content: flex-end;
}

.admin-dialog-actions .admin-primary,
.admin-dialog-actions .admin-ghost {
  min-width: 110px;
}

.admin-sort:focus-visible,
.admin-row-menu summary:focus-visible,
.admin-row-menu-popover button:focus-visible,
.admin-dialog-close:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-chart-grid {
    grid-template-columns: 1fr;
  }

  .admin-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-search-field {
    grid-column: span 2;
  }
}

@media (max-width: 1344px) {
  .app-shell {
    --vocab-detail-pane-width: 425px;
    grid-template-columns: 190px minmax(425px, 1fr) var(--vocab-detail-pane-width);
    width: 100%;
    padding-inline: 18px;
  }

  .speaking-mode .app-shell {
    --speaking-right-pane-width: 425px;
    grid-template-columns: 190px minmax(425px, 1fr) var(--speaking-right-pane-width);
    width: 100%;
  }

  .topbar {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .module-tab {
    padding-inline: 9px;
    font-size: 13px;
  }

  .detail-title h2 {
    font-size: 34px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    min-width: 0;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell,
  .speaking-mode .app-shell {
    display: flex;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100vh;
    padding: 0 12px 24px;
    flex-direction: column;
    gap: 12px;
  }

  .topbar {
    position: static;
    display: flex;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .brand {
    min-height: 64px;
    flex: 0 0 64px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .module-tabs {
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .module-tab {
    flex: 0 0 auto;
    height: 42px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .module-icon {
    display: none;
  }

  .sidebar {
    display: block;
    width: 100%;
    min-height: 0;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 24px;
  }

  .sidebar-modules {
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    overflow: visible;
    flex-wrap: wrap;
  }

  .module-nav-item {
    display: contents;
  }

  .sidebar-modules .module-tab {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    min-height: 40px;
    padding: 6px 8px;
    background: var(--surface-soft);
  }

  .filter-section.module-secondary-nav {
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
    padding: 4px 0 0;
    overflow-x: auto;
  }

  .module-secondary-nav .choice-list {
    display: flex;
    gap: 6px;
    width: max-content;
  }

  .module-secondary-nav .choice {
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    padding: 0 10px;
  }

  .filter-section {
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .filter-section:nth-child(2) {
    border-right: 0;
  }

  .speaking-filter-section {
    border-top: 1px solid var(--line);
  }

  .workspace,
  .speaking-mode .workspace {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .table-pane,
  .detail-pane,
  .speaking-mode .table-pane,
  .speaking-mode .detail-pane {
    width: 100%;
    min-width: 0;
    height: min(62vh, 560px);
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 24px;
  }

  .table-head-wrap,
  .table-wrap {
    overflow-x: hidden;
  }

  .table-head-wrap table,
  .table-wrap table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .rank-track,
  .doc-track,
  .rank-col,
  tbody td:first-child,
  .doc-col {
    display: none;
  }

  .term-track {
    width: 38%;
  }

  .brief-track {
    width: 44%;
  }

  .freq-track {
    width: 18%;
  }

  .term-cell,
  thead th:nth-child(2),
  .freq-col {
    width: auto;
  }

  .table-head-wrap th,
  .table-wrap td {
    padding-inline: 10px;
  }

  .term-cell {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .detail-pane,
  .speaking-mode .detail-pane {
    height: auto;
    min-height: 520px;
  }

  .speaking-panel-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(420px, 1fr) minmax(420px, 1fr);
    overflow-y: auto;
  }

  .speaking-panel-grid > .speaking-board,
  .speaking-panel-grid > .speaking-detail-board {
    min-height: 420px;
  }

  .access-bar {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    min-height: 0;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    transform: none;
  }

  .access-actions {
    justify-content: flex-end;
  }

  .wechat-contact {
    position: static;
    display: flex;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 14px 24px;
    grid-column: 1 / -1;
  }

  .admin-shell {
    width: min(100vw - 24px, 560px);
    padding: 20px 0;
  }

  .admin-panel {
    padding: 20px;
  }

  .admin-head h1 {
    font-size: 36px;
  }
}

.turnstile-slot {
  min-height: 65px;
}

.turnstile-unavailable {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f0caca;
  border-radius: 12px;
  color: #9d3636;
  background: #fff7f7;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .admin-shell {
    width: calc(100vw - 20px);
    max-width: none;
    padding: 10px 0;
  }

  .admin-panel {
    gap: 24px;
    padding: 18px;
  }

  .admin-head {
    align-items: flex-start;
    flex-direction: row;
  }

  .admin-head h1 {
    font-size: 34px;
  }

  .admin-section-head,
  .admin-chart-head {
    align-items: flex-start;
  }

  .admin-login,
  .admin-add-form,
  .admin-filters,
  .admin-edit-form {
    grid-template-columns: 1fr;
  }

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

  .admin-metric-card {
    min-height: 124px;
    padding: 16px;
  }

  .admin-chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-chart-card {
    min-height: 300px;
    padding: 18px;
  }

  .admin-trend-chart {
    overflow-x: auto;
  }

  .admin-trend-legend,
  .admin-trend-bars {
    min-width: 620px;
  }

  .admin-add-note-field,
  .admin-search-field,
  .admin-dialog-head,
  .admin-dialog-actions,
  .admin-edit-note-field {
    grid-column: auto;
  }

  .admin-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .admin-edit-form {
    padding: 20px;
  }

  .admin-dialog-head,
  .admin-dialog-actions,
  .admin-edit-note-field {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
