:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --surface-soft: #f2f2f3;
  --line: #ececec;
  --line-strong: #dedee0;
  --text: #17191c;
  --muted: #777b86;
  --faint: #979799;
  --highlight: #fbe1d1;
  --row-active: #f2f2f3;
  --shadow: none;
  --shadow-soft: none;
  --table-head-bg: rgba(255, 255, 255, 0.98);
  --page-gutter: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(680px, 1.15fr) minmax(500px, 0.85fr);
  grid-template-rows: 104px minmax(0, 1fr);
  column-gap: 0;
  row-gap: 0;
  justify-content: stretch;
  height: 100vh;
  min-height: 720px;
  padding: 0 var(--page-gutter);
}

.topbar {
  position: static;
  z-index: 20;
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  min-width: 0;
  height: 104px;
  padding: 0 24px;
  width: auto;
  margin-inline: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.module-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  min-width: 0;
  border-bottom: 0;
  background: transparent;
}

.module-tab {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #777b86;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 760;
}

.module-tab:hover {
  background: #fafafb;
}

.module-tab.active {
  border-color: #dedee0;
  color: var(--text);
  background: #fafafb;
}

.module-tab.disabled {
  color: #979799;
  cursor: default;
}

.module-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--text);
  background: #f2f2f3;
  font-size: 12px;
  font-weight: 820;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--table-head-bg);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  width: 220px;
  padding: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
}

.brand h1,
.pane-header h2,
.detail-title h2,
.detail-title p,
.filter-section h2,
.empty-state h2,
.empty-state p {
  margin: 0;
}

.brand h1 {
  color: #17191c;
  font-family:
    "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.filter-section {
  padding: 22px 16px 18px;
  border-bottom: 1px solid var(--line);
}

.filter-section h2 {
  padding: 0 8px 10px;
  color: #777b86;
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.choice-list {
  display: grid;
  gap: 4px;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 36px;
  width: 100%;
  padding: 0 12px;
  border-radius: 10px;
  color: #17191c;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.choice-label {
  min-width: 0;
}

.choice-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.choice:hover {
  background: #f2f2f3;
}

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

.choice.disabled {
  color: var(--faint);
  cursor: default;
}

.choice.disabled:hover {
  background: transparent;
}

.workspace {
  display: contents;
}

.table-pane,
.detail-pane {
  grid-row: 2;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-pane {
  grid-column: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.pane-header h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 820;
}

.table-wrap {
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 15px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--table-head-bg);
  color: #777b86;
  text-align: left;
  font-size: 12px;
  font-weight: 760;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover td {
  background: #fafafb;
}

tbody tr.active td {
  background: var(--row-active);
}

tbody tr.active td:first-child {
  box-shadow: inset 4px 0 0 var(--text);
}

tbody tr.locked-row {
  cursor: pointer;
}

tbody tr.locked-row td {
  position: relative;
}

tbody tr.locked-row:hover td {
  background: #fafafb;
}

.locked-content {
  position: relative;
  display: inline-block;
  min-width: 1.8em;
  color: transparent;
  filter: none;
  opacity: 1;
  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%);
}

td {
  height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-col {
  width: 82px;
}

tbody td:first-child {
  width: 82px;
  color: var(--faint);
  font-weight: 400;
}

.doc-col {
  width: 86px;
  text-align: right;
}

.freq-col {
  width: 92px;
  text-align: right;
}

.term-cell {
  color: var(--text);
  font-weight: 780;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.brief-cell {
  min-width: 0;
}

.term-cell span {
  display: inline;
}

.term-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.35;
}

.freq {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  font-weight: 400;
}

.doc-count {
  color: var(--faint);
  font-weight: 400;
}

.detail-pane {
  grid-column: 3;
  min-height: 0;
  border-right: 0;
}

.detail-content {
  height: 100%;
  overflow: auto;
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 22px 24px 8px;
  border-bottom: 0;
  background: #ffffff;
}

.detail-title {
  display: grid;
  gap: 8px;
}

.detail-title h2 {
  color: #17191c;
  font-family:
    "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 36px;
  line-height: 1.08;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.phonetic-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2px 0 0;
  color: var(--faint);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

.audio-button {
  appearance: none;
  border: 1px solid #dedee0;
  border-radius: 999px;
  background: #fafafb;
  color: #17191c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  padding: 7px 11px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.audio-button:hover,
.audio-button.playing {
  border-color: #dedee0;
  background: #f2f2f3;
  color: #17191c;
}

.detail-title p {
  color: #17191c;
  font-size: 16px;
  line-height: 1.5;
}

.definition-block {
  padding: 4px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.definition-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 780;
}

.definition-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #17191c;
  font-size: 14px;
  line-height: 1.6;
}

.definition-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.definition-item.plain {
  display: block;
}

.pos-tag {
  color: var(--faint);
  font-weight: 500;
  white-space: nowrap;
}

.examples-block {
  padding: 20px 0 28px;
}

.examples-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px 12px;
}

.examples-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
}

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

.example-list {
  display: grid;
}

.example {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.example:last-child {
  border-bottom: 1px solid var(--line);
}

.example-number {
  padding-top: 4px;
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.example-text {
  margin: 0;
  max-width: 68ch;
  color: #17191c;
  font-family:
    "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 15px;
  line-height: 1.66;
}

.example-source {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.4;
}

mark {
  padding: 0 2px;
  border-radius: 5px;
  background: var(--highlight);
  color: inherit;
}

.skeleton-line {
  position: relative;
  display: block;
  overflow: hidden;
  height: 12px;
  max-width: 100%;
  border-radius: 999px;
  background: #dedee0;
}

.skeleton-line::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  animation: skeleton-shimmer 1.45s ease-in-out infinite;
}

.skeleton-row {
  cursor: default;
}

.skeleton-row td {
  background: #ffffff;
}

.skeleton-row:hover td {
  background: #ffffff;
}

.skeleton-row.skeleton-active td {
  background: var(--row-active);
}

.skeleton-row.skeleton-active td:first-child {
  box-shadow: inset 4px 0 0 var(--text);
}

.skeleton-rank {
  width: 24px;
}

.skeleton-term {
  width: 128px;
}

.skeleton-term-wide {
  width: 176px;
}

.skeleton-cn {
  width: 96px;
}

.skeleton-cn-wide {
  width: 136px;
}

.skeleton-number {
  width: 34px;
  margin-left: auto;
}

.detail-skeleton-head {
  padding-bottom: 10px;
}

.skeleton-title {
  width: min(190px, 56%);
  height: 28px;
  border-radius: 8px;
}

.skeleton-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skeleton-phonetic {
  width: 150px;
  height: 10px;
}

.skeleton-audio {
  width: 58px;
  height: 26px;
}

.skeleton-definition-list {
  gap: 12px;
}

.skeleton-definition {
  width: min(440px, 78%);
}

.skeleton-definition-short {
  width: min(320px, 56%);
}

.skeleton-section-title {
  width: 110px;
  height: 16px;
}

.skeleton-count {
  width: 38px;
}

.skeleton-example {
  cursor: default;
}

.skeleton-example-number {
  width: 14px;
  margin-left: auto;
}

.skeleton-example-text,
.skeleton-example-text-long,
.skeleton-example-text-short,
.skeleton-source {
  margin-top: 5px;
}

.skeleton-example-text {
  width: min(520px, 88%);
  height: 14px;
}

.skeleton-example-text-long {
  width: min(600px, 96%);
  height: 14px;
}

.skeleton-example-text-short {
  width: min(420px, 72%);
  height: 14px;
}

.skeleton-source {
  width: 150px;
  height: 10px;
  margin-top: 12px;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line::after {
    animation: none;
  }
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 100%;
  padding: 48px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  color: var(--text);
  font-size: 24px;
}

.empty-state p {
  max-width: 360px;
  margin-top: 10px;
  line-height: 1.7;
}

.loading-row td,
.error-row td {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.wechat-contact {
  position: fixed;
  left: 0;
  bottom: 14px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 236px;
  color: #777b86;
  font-size: 12px;
  line-height: 1.4;
}

.corner-link {
  padding: 0 10px;
  color: #777b86;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  text-align: left;
}

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

.corner-link + .corner-link {
  border-left: 1px solid #dedee0;
}

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