:root {
  --ink: #202523;
  --muted: #5d6763;
  --line: #d9d3c2;
  --paper: #f8f7f2;
  --soft: #eef3ef;
  --deep: #0f3d32;
  --deeper: #082b23;
  --green: #2f6b57;
  --green-soft: #dfece5;
  --gold: #a1864d;
  --white: #ffffff;
  --shadow: 0 14px 36px rgba(15, 61, 50, 0.1);
  --display-font: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 247, 242, 0.92) 280px),
    var(--paper);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 12vw;
  background: var(--deep);
  color: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--paper);
  padding: 3px;
  box-shadow: 0 8px 18px rgba(3, 22, 17, 0.18);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--display-font);
  letter-spacing: 0.04em;
}

.brand small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
}

.admin-link {
  color: #b8e2c6;
  font-weight: 700;
}

.nav .admin-nav {
  display: none;
  color: #b8e2c6;
}

body[data-role="admin"] .nav .admin-nav {
  display: inline-flex;
}

.view {
  display: none;
  padding: 44px 12vw 76px;
}

.view.active {
  display: block;
}

.route-pending .view {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.78fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 148px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--display-font);
  font-weight: 700;
}

.hero h1,
.page-head h1 {
  margin-bottom: 16px;
  max-width: 760px;
  font-size: clamp(30px, 3.7vw, 48px);
  line-height: 1.18;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
}

.search-panel,
.hero-card,
.login-card,
.login-note,
.side-card,
.locked-panel,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-panel {
  max-width: 650px;
  margin-top: 28px;
  padding: 16px;
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--deep);
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

button,
.primary-action {
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 17px;
}

.ghost-button {
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--green);
}

#searchHint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-card {
  position: relative;
  max-width: 390px;
  justify-self: end;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hero-card:hover,
.hero-card:focus-visible {
  border-color: var(--green);
  box-shadow: 0 18px 42px rgba(15, 61, 50, 0.16);
  transform: translateY(-2px);
}

.hero-card:focus-visible {
  outline: 3px solid var(--green-soft);
  outline-offset: 3px;
}

.hero-card .word-header {
  margin-bottom: 8px;
}

.hero-card-link,
.sample-card,
.category-row-link,
.card-open {
  color: inherit;
  text-decoration: none;
}

.hero-card-link {
  display: block;
}

.sample-card {
  display: block;
}

.hero-sense-visual {
  display: grid;
  place-items: center;
  margin: 6px 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.hero-sense-visual svg {
  width: min(190px, 100%);
  height: auto;
}

.hero-sense-visual img {
  display: block;
  width: min(260px, 100%);
  max-height: 170px;
  object-fit: contain;
}

.hero-sense-visual svg * {
  fill: none;
  stroke: var(--deep);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-sense-visual svg circle {
  fill: var(--white);
}

.hero-sense-visual svg marker path {
  fill: var(--deep);
  stroke: none;
}

.hero-sense-visual .visual-dot {
  fill: var(--deep);
  stroke: none;
}

.hero-sense-visual .visual-label {
  fill: var(--deep);
  stroke: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
}

.word-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.entry > .word-header {
  padding: 0 32px;
}

.word-header h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  line-height: 0.95;
}

.word-header h1 span,
.phonetic {
  color: var(--muted);
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
}

.word-header h1 .word-main {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 900;
  line-height: 0.95;
}

.word-header h1 .title-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  transform: translateY(2px);
}

.word-header h1 .title-phonetic {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
}

.word-header h1 .head-meaning {
  display: inline-block;
  max-width: 100%;
  margin-left: 0;
  color: var(--deep);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
  vertical-align: baseline;
}

.word-header .ghost-button {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 32px;
}

.favorite-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  align-self: flex-start;
  margin-top: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--deep);
  box-shadow: 0 8px 18px rgba(15, 61, 50, 0.08);
}

.favorite-button:hover {
  border-color: var(--green);
  background: var(--soft);
}

.favorite-button svg {
  width: 23px;
  height: 23px;
}

.favorite-button path {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.favorite-button.is-active {
  border-color: var(--green);
  background: var(--soft);
  color: var(--green);
}

.favorite-button.is-active path {
  fill: currentColor;
}

.word {
  display: block;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 850;
  line-height: 1;
}

.hero-card .phonetic {
  font-size: 15px;
}

.tag,
.tag-row span,
.mini-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--deep);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
}

.pron-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}

.pos-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.pos-row span {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 800;
}

.pron-row a,
.word-link {
  color: var(--green);
  font-weight: 800;
}

.phonetic-pending {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--green);
  padding: 7px 10px;
  font-size: 14px;
}

.sound-btn::before {
  content: "▶";
  font-size: 11px;
}

.sound-btn.playing::before {
  content: "✓";
}

.sense-line {
  color: var(--deep);
  font-size: 15px;
  line-height: 1.65;
}

.hero-definition {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 10px 0 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.hero-definition strong {
  color: var(--deep);
}

.hero-card-action {
  display: inline-block;
  margin-top: 14px;
  border-bottom: 2px solid var(--green-soft);
  color: var(--deep);
  font-size: 13px;
  font-weight: 900;
}

.hero-card-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(47, 107, 87, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(15, 61, 50, 0.14);
  transform: translateY(-50%);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hero-card-prev {
  left: -18px;
}

.hero-card-next {
  right: -18px;
}

.hero-card-nav span {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.hero-card-prev span {
  margin-right: 2px;
  border-right: 8px solid var(--deep);
}

.hero-card-next span {
  margin-left: 2px;
  border-left: 8px solid var(--deep);
}

.hero-card-nav:hover,
.hero-card-nav:focus-visible {
  border-color: var(--green);
  box-shadow: 0 14px 32px rgba(15, 61, 50, 0.2);
  transform: translateY(-50%) scale(1.04);
}

.mini-list,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.band {
  padding: 62px 0 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.section-title h2,
.membership-strip h2 {
  max-width: 720px;
  font-size: 27px;
  line-height: 1.2;
}

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

.sample-card,
.category-card,
.stats div {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 20px;
}

.sample-card,
.stats div {
  min-height: 168px;
}

.category-toolbar {
  display: flex;
  width: min(1040px, 100%);
  margin: -4px auto 10px;
  justify-content: flex-end;
}

.all-words-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 7px 12px;
  color: var(--deep);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.all-words-button:hover,
.all-words-button.active {
  background: var(--green-soft);
  border-color: var(--green);
}

.sample-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sample-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.sample-card h3,
.category-card h2 {
  margin-bottom: 8px;
  font-size: 23px;
}

.sample-card p,
.category-card p,
.locked-panel p,
.login-note p {
  color: var(--muted);
}

.membership-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 42px;
  padding: 30px;
  border-radius: 4px;
  background: var(--deeper);
  color: var(--white);
}

.membership-strip .eyebrow {
  color: #d9c08a;
}

.membership-strip h2 {
  margin-bottom: 0;
}

.primary-action {
  background: var(--white);
  color: var(--deep);
  white-space: nowrap;
}

.page-head {
  margin: 0 auto 28px;
  max-width: 1000px;
}

.dictionary-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 280px;
  gap: 30px;
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
}

.entry,
.entry-side {
  min-width: 0;
}

.entry {
  border-radius: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 32px 0;
}

.entry-section {
  padding: 24px 32px;
  border-top: 1px solid var(--line);
}

.entry-section strong {
  color: var(--deep);
  font-weight: 900;
}

.entry-section.highlight {
  margin: 0 32px 10px;
  border: 0;
  border-left: 5px solid var(--green);
  border-radius: 0;
  background: var(--soft);
  padding: 18px 22px;
}

.sense-highlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 22px;
  align-items: center;
}

.sense-copy p {
  margin-bottom: 0;
}

.sense-visual {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 10px;
}

.sense-visual-art {
  aspect-ratio: 11 / 7.5;
  display: grid;
  place-items: center;
}

.sense-visual svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #151515;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sense-visual-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sense-visual marker path {
  fill: var(--ink);
  stroke: none;
}

.sense-visual .visual-bg {
  fill: #ffffff;
  stroke: none;
}

.sense-visual .visual-accent {
  fill: #151515;
  stroke: none;
}

.sense-visual .visual-ink {
  stroke: #151515;
}

.sense-visual .visual-muted {
  stroke: #151515;
  stroke-width: 3.2;
}

.sense-visual .visual-dot {
  fill: #151515;
  stroke: none;
}

.sense-visual .visual-label {
  fill: #151515;
  stroke: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
}

.sense-visual .visual-zone,
.sense-visual .visual-ghost {
  stroke: #151515;
  stroke-dasharray: 6 5;
}

.sense-visual .visual-zone {
  fill: none;
}

.sense-visual p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.definition-block > div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
}

.definition-block h3 {
  margin-bottom: 8px;
  color: var(--deep);
  font-family: inherit;
  font-size: 16px;
}

.definition-block ol {
  margin: 0;
  padding-left: 20px;
}

.definition-block li {
  margin: 6px 0;
}

.etymology-card {
  display: grid;
  gap: 14px;
}

.etymology-parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.morpheme-chip {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 13px 14px;
}

.morpheme-chip small,
.formation-logic span,
.etymology-story span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.morpheme-chip strong {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.05;
}

.morpheme-chip em {
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.morpheme-chip b {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.formation-logic,
.etymology-story {
  border-left: 4px solid var(--green-soft);
  background: rgba(238, 243, 239, 0.66);
  padding: 13px 16px;
}

.formation-logic p,
.etymology-story p {
  margin: 4px 0 0;
}

.formation-logic p {
  color: var(--deep);
  font-weight: 700;
}

.etymology-source-block {
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--green-soft);
  background: rgba(238, 243, 239, 0.66);
  padding: 13px 16px;
}

.etymology-source-block > span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.etymology-source-path,
.study-etymology-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.etymology-source-path b,
.study-etymology-path b {
  color: var(--deep);
  font-size: 14px;
}

.etymology-source-path i,
.study-etymology-path i {
  color: var(--muted);
  font-style: normal;
}

.etymology-card-simple .etymology-story {
  border-left-color: var(--line);
}

.etymology-reference {
  margin: -2px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(209, 199, 177, 0.62);
  color: rgba(93, 105, 101, 0.78);
  font-size: 12px;
  line-height: 1.5;
}

.meaning-grid div,
.phrase-list div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 15px;
}

.meaning-grid span {
  display: block;
  color: var(--muted);
}

.scene-list {
  display: grid;
  gap: 13px;
}

.scene {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  border-left: 3px solid var(--green);
  padding: 7px 0 7px 14px;
}

.scene > span {
  color: var(--gold);
  font-weight: 900;
}

.scene h3,
.scene p,
.phrase-list p {
  margin-bottom: 4px;
}

.example-en {
  color: var(--ink);
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.7;
}

.example-zh {
  display: block;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.example-highlight {
  background: linear-gradient(transparent 55%, rgba(177, 229, 156, 0.8) 55%);
  color: inherit;
  font-weight: 850;
  padding: 0 2px;
}

.phrase-list strong {
  display: block;
  margin-bottom: 7px;
  color: var(--deep);
  font-size: 18px;
}

.phrase-meaning {
  color: var(--deep);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.65;
}

.phrase-list .phrase-example {
  margin: 0 0 5px;
}

.phrase-list small {
  margin-top: 2px;
}

.phrase-list {
  display: grid;
  gap: 12px;
}

.entry-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 86px;
}

.side-card {
  padding: 18px;
}

.synonym-card {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.synonym-card:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.synonym-card .word-link {
  display: inline-block;
  margin-bottom: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.synonym-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.synonym-example {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 3px solid rgba(47, 107, 87, 0.18);
}

.synonym-example .example-en {
  color: var(--deep);
  font-size: 15px;
  line-height: 1.55;
}

.synonym-example .example-zh {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.synonym-keyword {
  background: linear-gradient(transparent 62%, rgba(177, 229, 156, 0.68) 62%);
  color: inherit;
  padding: 0 1px;
}

.locked {
  background: var(--deep);
  color: var(--white);
}

.locked p {
  color: rgba(255, 255, 255, 0.76);
}

.member-only {
  display: none;
}

body[data-role="member"] .guest-only,
body[data-role="admin"] .guest-only {
  display: none;
}

body[data-role="member"] .member-only,
body[data-role="admin"] .member-only {
  display: block;
}

.member-only {
  background: var(--soft);
}

.member-only h3 {
  color: var(--deep);
}

.member-only p {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  border-radius: 4px;
  background: var(--deep);
  color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  padding: 12px 14px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(8, 43, 35, 0.28);
}

.login-modal.show {
  display: grid;
}

.login-modal-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(3, 22, 17, 0.22);
  padding: 28px;
}

.login-modal-card h2 {
  margin-bottom: 10px;
  color: var(--deep);
  font-size: 30px;
}

.login-modal-card p:not(.section-kicker) {
  color: var(--muted);
}

.category-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.category-card {
  cursor: pointer;
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.category-card h2 {
  margin: 0;
}

.category-card.active {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(47, 107, 87, 0.16), var(--shadow);
}

.category-card.active h2 {
  color: var(--deep);
}

.category-list {
  display: none;
  max-width: 1040px;
  margin: 22px auto 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  overflow: hidden;
}

body[data-role="member"] .category-list,
body[data-role="admin"] .category-list {
  display: block;
}

body[data-role="member"] .category-locked,
body[data-role="admin"] .category-locked {
  display: none;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.category-row-link {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr) auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.category-row:hover {
  background: rgba(233, 244, 237, 0.42);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-row strong {
  min-width: 0;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.category-row p {
  margin: 0;
  color: var(--muted);
}

.category-meaning strong {
  margin-right: 5px;
  color: var(--deep);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 900;
}

.category-row span {
  color: var(--deep);
  font-size: 13px;
  font-weight: 800;
}

.category-favorite {
  width: 36px;
  height: 36px;
  margin: 0;
  box-shadow: none;
}

.category-favorite svg {
  width: 19px;
  height: 19px;
}

.locked-panel {
  max-width: 760px;
  margin: 28px auto 0;
  padding: 26px;
  text-align: center;
}

.method-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto;
}

.method-main,
.method-side,
.word-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.method-main {
  padding: 30px;
}

.method-main section + section {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.method-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.method-primer {
  gap: 20px;
}

.guide-copy p:last-child {
  margin-bottom: 0;
}

.method-story {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.method-story p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.method-story strong {
  color: var(--deep);
  font-family: inherit;
  font-size: inherit;
}

.method-story mark {
  background: linear-gradient(transparent 56%, rgba(177, 229, 156, 0.72) 56%);
  color: var(--muted);
  padding: 0 2px;
}

.guide-card {
  display: grid;
  grid-template-columns: minmax(230px, 0.95fr) minmax(280px, 1.05fr);
  grid-template-areas:
    "word visual"
    "copy visual"
    "tags visual";
  column-gap: 30px;
  row-gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  padding: 24px 28px;
}

.guide-word {
  grid-area: word;
  align-self: end;
}

.guide-word span {
  display: block;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 850;
  line-height: 1;
}

.guide-word small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 16px;
}

.guide-card > p {
  grid-area: copy;
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}

.guide-card .mini-list {
  grid-area: tags;
  align-self: start;
  margin-top: 0;
  max-width: 390px;
}

.guide-visual {
  grid-area: visual;
  display: grid;
  place-items: center;
  min-height: 178px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.guide-visual svg {
  width: min(220px, 100%);
  height: auto;
}

.guide-visual svg * {
  fill: none;
  stroke: var(--deep);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-visual svg circle {
  fill: var(--white);
}

.guide-visual svg marker path {
  fill: var(--deep);
  stroke: none;
}

.method-visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.method-visual div,
.module-grid div,
.method-proof div,
.research-grid div {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  padding: 16px;
}

.method-visual span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.method-visual strong {
  display: block;
  color: var(--deep);
  font-size: 18px;
  margin-bottom: 8px;
}

.section-intro {
  max-width: 760px;
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  counter-reset: research;
}

.research-grid span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--deep);
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
}

.research-grid > div {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.research-grid > div::after {
  position: absolute;
  right: 16px;
  top: 14px;
  color: rgba(15, 61, 50, 0.07);
  content: "Sense";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 900;
  pointer-events: none;
}

.research-grid small {
  display: block;
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.research-grid strong {
  display: inline;
  background: linear-gradient(transparent 58%, rgba(177, 229, 156, 0.72) 58%);
  color: var(--deep);
  font-size: 19px;
  line-height: 1.55;
  padding: 0 2px;
}

.research-grid p {
  margin: 10px 0 0;
  line-height: 1.76;
}

.method-main h2,
.method-side h2 {
  font-size: 26px;
}

.method-main p,
.method-side p {
  color: var(--muted);
}

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

.method-steps div {
  border-left: 4px solid var(--green);
  background: var(--soft);
  padding: 16px;
}

.method-steps span {
  display: block;
  color: var(--gold);
  font-weight: 900;
}

.method-steps strong {
  display: block;
  margin: 4px 0;
  color: var(--deep);
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

.method-flow div {
  position: relative;
  min-height: 136px;
  border: 1px solid rgba(209, 199, 177, 0.9);
  border-radius: 4px;
  background: linear-gradient(180deg, #fbfbf7 0%, #eef6f0 100%);
  padding: 18px 18px 16px;
}

.method-flow div:not(:last-child)::after {
  position: absolute;
  right: -22px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--green);
  border-right: 2px solid var(--green);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.method-flow span {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(31, 107, 85, 0.1);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.method-flow strong {
  display: block;
  color: var(--deep);
  font-size: 18px;
}

.method-flow p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.method-side {
  align-self: start;
  padding: 24px;
  position: sticky;
  top: 86px;
}

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

.module-grid strong {
  display: block;
  color: var(--deep);
  margin-bottom: 6px;
}

.method-proof {
  display: grid;
  gap: 12px;
}

.method-proof div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}

.method-proof span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--deep);
  color: var(--white);
  font-weight: 900;
}

.method-badge {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.method-badge strong,
.method-badge span {
  display: block;
}

.method-badge span {
  color: var(--deep);
  font-weight: 800;
}

.card-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
}

.word-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
}

.flash-card {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1200px;
}

.flash-card:focus-visible {
  outline: 3px solid rgba(22, 130, 82, 0.26);
  outline-offset: 4px;
}

.flash-card-inner {
  position: relative;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.42s ease;
}

.flash-card.is-flipped .flash-card-inner {
  transform: rotateY(180deg);
}

.flash-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 24px;
  backface-visibility: hidden;
  box-shadow: 0 18px 42px rgba(4, 36, 27, 0.06);
}

.flash-back {
  align-items: center;
  justify-content: center;
  background: var(--soft);
  transform: rotateY(180deg);
}

.flash-back span {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
}

.card-top span {
  display: block;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
}

.card-top small,
.word-card p {
  color: var(--muted);
}

.word-card p {
  margin-bottom: 7px;
}

.word-card p strong {
  color: var(--deep);
}

.card-example {
  border-left: 3px solid var(--green);
  padding-left: 10px;
  font-style: italic;
}

.card-translation {
  margin-top: -4px;
  padding-left: 13px;
  color: var(--ink);
  font-size: 14px;
}

.card-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.card-open {
  align-self: flex-start;
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--deep);
  margin-top: 14px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 900;
}

.card-bottom span {
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--deep);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
}

.locked-card {
  background: var(--deep);
  color: var(--white);
}

.locked-card p {
  color: rgba(255, 255, 255, 0.72);
}

.locked-card .primary-action {
  align-self: start;
}

.contact-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
}

.contact-card,
.contact-note {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 22px;
}

.qr-placeholder {
  display: grid;
  width: 100%;
  place-items: center;
  aspect-ratio: 1;
  max-width: 260px;
  margin-right: auto;
  margin-bottom: 18px;
  border: 1px dashed rgba(8, 65, 49, 0.26);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(21, 126, 78, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(21, 126, 78, 0.06) 1px, transparent 1px),
    var(--soft);
  background-size: 18px 18px;
}

.qr-placeholder span {
  border-radius: 999px;
  background: var(--white);
  color: var(--deep);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
}

.qr-placeholder.qr-image {
  overflow: hidden;
  box-sizing: border-box;
  aspect-ratio: auto;
  border-style: solid;
  background: var(--white);
}

.qr-placeholder.qr-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-width: 0;
  object-fit: contain;
}

.contact-card h2,
.contact-note h2 {
  margin-bottom: 10px;
}

.contact-card p,
.contact-note li {
  color: var(--muted);
}

.contact-note p {
  color: var(--muted);
  margin-bottom: 14px;
}

.contact-note ul {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.login-wrap {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(280px, 1fr);
  gap: 24px;
  align-items: stretch;
  max-width: 960px;
  margin: 0 auto;
}

.login-card,
.login-note {
  padding: 28px;
}

.login-helper {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.login-helper h3 {
  margin-bottom: 8px;
}

.login-helper .ghost-button {
  display: inline-flex;
  margin-top: 8px;
}

.login-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 800;
}

.login-card .remember-login {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 18px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.login-card .remember-login input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.login-card button {
  width: 100%;
  margin: 8px 0 16px;
}

.feedback-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.feedback-box h3 {
  font-family: inherit;
  font-size: 18px;
}

.feedback-box .ghost-button {
  margin-top: 6px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  min-height: 620px;
}

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  border-radius: 4px;
  background: var(--deep);
  color: var(--white);
  padding: 20px;
}

.admin-sidebar strong {
  margin-bottom: 14px;
}

.admin-sidebar span {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.09);
  padding: 10px;
}

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

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stats div {
  min-height: 100px;
}

.stats span {
  color: var(--muted);
}

.stats strong {
  display: block;
  font-size: 34px;
}

.admin-panel {
  overflow: hidden;
}

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

body:not([data-role="admin"]) #admin .stats,
body:not([data-role="admin"]) #admin .admin-panel,
body:not([data-role="admin"]) #admin .admin-grid {
  display: none;
}

body[data-role="admin"] #admin .admin-auth-note {
  display: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.admin-card {
  align-self: start;
}

.admin-form-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-form-body label {
  display: grid;
  gap: 8px;
  color: var(--deep);
  font-weight: 800;
}

.admin-result {
  min-height: 88px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink);
  font-family: Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  padding: 12px;
}

.account-result {
  max-height: 280px;
  white-space: pre;
}

.member-panel {
  margin-bottom: 18px;
}

.member-table-wrap {
  overflow-x: auto;
}

.panel-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.member-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f1ed;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.member-status.active {
  background: #e4f1e9;
  color: var(--green);
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 270px;
}

.member-actions button {
  padding: 6px 9px;
  font-size: 13px;
}

.admin-edit-btn {
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--green);
  padding: 7px 10px;
}

.editor-panel {
  display: none;
  margin-top: 18px;
}

.editor-panel.active {
  display: block;
}

.editor-body h3 {
  margin: 10px 0 0;
  font-family: inherit;
  color: var(--deep);
  font-size: 18px;
}

.editor-row,
.definition-line,
.scene-line,
.phrase-line,
.synonym-line {
  display: grid;
  gap: 12px;
}

.editor-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.definition-line {
  grid-template-columns: 90px 1fr 1fr;
}

.scene-line,
.phrase-line,
.synonym-line {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.checkbox-label {
  align-content: center;
  grid-template-columns: auto 1fr;
}

.checkbox-label input {
  width: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 880px) {
  .topbar,
  .membership-strip,
  .section-title,
  .word-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 13px 18px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
    gap: 18px;
    font-size: 14px;
  }

  .nav a,
  .title-audio-row a,
  .word-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    word-break: keep-all;
  }

  .hero,
  .dictionary-layout,
  .login-wrap,
  .admin-shell,
  .method-layout {
    grid-template-columns: 1fr;
  }

  .view {
    padding: 32px 18px 60px;
  }

  .hero {
    min-height: 0;
  }

  .hero-card {
    width: 100%;
    max-width: 520px;
    justify-self: start;
  }

  .hero-card-prev {
    left: 12px;
  }

  .hero-card-next {
    right: 12px;
  }

  .hero h1,
  .page-head h1 {
    font-size: 32px;
  }

  .sample-grid,
  .category-grid,
    .stats,
  .definition-block,
  .meaning-grid,
  .method-steps,
  .method-flow,
  .method-visual,
  .method-guide,
  .guide-card,
  .research-grid,
  .module-grid,
  .card-deck,
  .contact-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .method-flow {
    gap: 14px;
  }

  .method-flow div:not(:last-child)::after {
    left: 26px;
    right: auto;
    top: auto;
    bottom: -11px;
    width: 12px;
    height: 12px;
    transform: rotate(135deg);
  }

  .editor-row,
  .definition-line,
  .scene-line,
  .phrase-line,
  .synonym-line {
    grid-template-columns: 1fr;
  }

  .category-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .category-row-link {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .category-favorite {
    justify-self: start;
  }

  .entry {
    padding: 22px 0;
  }

  .entry > .word-header,
  .entry-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .entry-section.highlight {
    margin-left: 20px;
    margin-right: 20px;
  }

  .guide-card {
    grid-template-areas:
      "word"
      "visual"
      "copy"
      "tags";
    padding: 18px;
  }

  .guide-card > p {
    max-width: none;
  }

  .sense-highlight-grid {
    grid-template-columns: 1fr;
  }

  .entry-side {
    position: static;
  }

  .method-side {
    position: static;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .word-header h1 {
    font-size: 44px;
  }

  .word-header h1 .word-main {
    font-size: 44px;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 12px;
    padding: 12px 14px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .brand strong {
    font-size: 18px;
    line-height: 1.1;
  }

  .brand small {
    font-size: 11px;
  }

  .nav {
    gap: 14px;
    font-size: 13px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .view {
    padding: 24px 14px 52px;
  }

  .hero {
    gap: 28px;
  }

  .hero h1,
  .page-head h1 {
    font-size: 30px;
  }

  .lead {
    font-size: 15px;
  }

  .hero-card {
    padding: 15px;
  }

  .hero-card-prev {
    top: 18px;
    left: 14px;
    width: 34px;
    height: 34px;
    transform: none;
  }

  .hero-card-next {
    top: 18px;
    right: 14px;
    width: 34px;
    height: 34px;
    transform: none;
  }

  .hero-card-nav:hover,
  .hero-card-nav:focus-visible {
    transform: scale(1.04);
  }

  .hero-card .word-header {
    padding-left: 44px;
    padding-right: 44px;
  }

  .hero-sense-visual img,
  .hero-sense-visual svg {
    max-height: 150px;
  }

  .entry {
    padding: 18px 0;
  }

  .entry > .word-header,
  .entry-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .entry-section {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .entry-section.highlight {
    margin-left: 14px;
    margin-right: 14px;
    padding: 15px 16px;
  }

  .word-header h1,
  .word-header h1 .word-main {
    font-size: clamp(34px, 13vw, 42px);
    line-height: 1;
    overflow-wrap: anywhere;
  }

  .word-header h1 span,
  .phonetic {
    font-size: 16px;
  }

  .title-audio-row {
    gap: 8px;
  }

  .sound-btn {
    min-height: 38px;
  }

  .sense-highlight-grid {
    gap: 16px;
  }

  .sense-visual {
    padding: 8px;
  }

  .morpheme-chip strong {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .formation-logic,
  .etymology-story {
    padding: 12px 13px;
  }

  .scene {
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding-left: 10px;
  }

  .example-en {
    font-size: 15px;
    line-height: 1.65;
  }

  .example-zh {
    font-size: 14px;
  }

  .phrase-list div,
  .definition-block > div,
  .meaning-grid div {
    padding: 13px;
  }

  .phrase-list strong {
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  .category-row {
    padding: 14px;
  }

  .category-row strong {
    font-size: clamp(20px, 8vw, 24px);
  }

  .category-row span {
    line-height: 1.5;
  }
}

.study-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.study-source {
  width: min(760px, 100%);
  margin: 24px auto 0;
}

.study-source[hidden],
.study-session[hidden],
.study-source-item[hidden] {
  display: none;
}

.study-source-head {
  margin-bottom: 26px;
}

.study-source-head h1 {
  margin-bottom: 8px;
  font-size: 36px;
  line-height: 1.25;
}

.study-source-head > p:last-child {
  max-width: 560px;
  color: var(--muted);
}

.study-source-list {
  display: grid;
  gap: 10px;
}

.study-source-item {
  display: flex;
  width: 100%;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  padding: 17px 20px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.study-source-item:hover,
.study-source-item:focus-visible {
  border-color: var(--green);
  box-shadow: 0 10px 25px rgba(15, 61, 50, 0.08);
  transform: translateY(-1px);
}

.study-source-item.primary {
  border-color: var(--green);
  background: var(--soft);
}

.study-source-item.resume {
  border-color: var(--gold);
}

.study-library-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: -2px 0 14px;
}

.study-library-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--soft);
  padding: 15px 20px;
}

.study-library-heading[hidden] {
  display: none;
}

.study-library-heading span,
.study-library-heading strong,
.study-library-heading small {
  display: block;
}

.study-library-heading strong {
  color: var(--deep);
  font-family: var(--display-font);
  font-size: 21px;
}

.study-library-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.study-library-heading b {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.study-library-heading.is-locked {
  border-color: var(--line);
  background: var(--white);
}

.study-library-heading.is-locked b {
  color: var(--muted);
}

.study-library-picker.is-locked button {
  border-style: dashed;
  color: var(--muted);
}

.study-library-picker.is-locked button:hover,
.study-library-picker.is-locked button:focus-visible {
  border-style: solid;
  border-color: var(--green);
  background: var(--soft);
  color: var(--deep);
}

.study-library-picker[hidden] {
  display: none;
}

.study-library-picker button {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--deep);
  font: inherit;
  font-family: var(--display-font);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.study-library-picker button:hover,
.study-library-picker button:focus-visible {
  border-color: var(--green);
  background: var(--soft);
}

.study-source-item span,
.study-source-item strong,
.study-source-item small {
  display: block;
}

.study-source-item strong {
  color: var(--deep);
  font-family: var(--display-font);
  font-size: 21px;
}

.study-source-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.study-source-item b {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.study-record {
  margin-top: 54px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.study-record-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.study-record-head h2 {
  margin-top: 2px;
  font-family: var(--display-font);
  font-size: 25px;
}

.study-record-head > p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.study-record-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 22px 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.study-record-metrics div {
  padding: 18px 0 17px;
}

.study-record-metrics div + div {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.study-record-metrics strong,
.study-record-metrics span {
  display: block;
}

.study-record-metrics strong {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  line-height: 1;
}

.study-record-metrics span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.study-week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  height: 146px;
  padding: 10px 6px 0;
  border-bottom: 1px solid var(--line);
}

.study-chart-day {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 9px;
  height: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.study-chart-day.today {
  color: var(--deep);
  font-weight: 800;
}

.study-chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  height: 110px;
}

.study-chart-bars i {
  display: block;
  width: min(12px, 38%);
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}

.study-chart-bars .known,
.study-chart-legend .known {
  background: var(--deep);
}

.study-chart-bars .unsure,
.study-chart-legend .unsure {
  background: #d9c78f;
}

.study-chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.study-chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.study-chart-legend i {
  display: block;
  width: 14px;
  height: 3px;
}

.study-change-source {
  border: 0;
  border-bottom: 1px solid var(--green);
  background: transparent;
  padding: 3px 0;
  color: var(--deep);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.study-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.study-head h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.25;
}

.study-priority-note {
  margin: 4px 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.study-priority-note[hidden],
.study-complete[hidden] {
  display: none;
}

.study-complete {
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 54px 42px;
  text-align: center;
}

.study-complete h2 {
  margin: 5px 0 12px;
  color: var(--deep);
  font-family: var(--display-font);
  font-size: 34px;
}

.study-complete p:not(.eyebrow) {
  max-width: 520px;
  margin: 0 auto 24px;
  color: var(--muted);
}

.study-complete button {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: var(--deep);
  padding: 0 22px;
  color: var(--white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.study-progress {
  width: min(230px, 30vw);
  color: var(--deep);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.study-progress > div {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  background: var(--green-soft);
}

.study-progress i {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.study-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 28px 32px 24px;
}

.study-word-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.study-count {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.study-word-row h2 {
  margin: 2px 0 1px;
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
}

.study-pron-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.study-pron-button {
  min-height: 34px;
  padding: 5px 9px;
  border-color: var(--line);
  color: var(--deep);
  font-size: 13px;
}

.study-favorite {
  margin-top: 0;
}

.study-definition-list {
  display: grid;
  gap: 9px;
  margin-top: 4px;
}

.study-definition-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 4px 0;
}

.study-definition-item strong {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.study-definition-item p {
  margin-bottom: 1px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.study-definition-item small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.study-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 32px;
  min-height: 245px;
  padding: 28px 0 22px;
}

.study-copy {
  min-width: 0;
  height: 182px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.study-content-label {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.study-copy h3 {
  margin-bottom: 4px;
  color: var(--deep);
  font-family: var(--display-font);
  font-size: 26px;
}

.study-copy p {
  margin-bottom: 8px;
}

.study-example {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.65;
}

.study-copy small {
  color: var(--muted);
  font-size: 15px;
}

.study-sense-copy {
  font-size: 17px;
}

.study-etymology-parts {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.study-etymology-parts div {
  display: grid;
  grid-template-columns: 62px minmax(75px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.study-etymology-parts span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.study-etymology-parts strong {
  color: var(--deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.study-etymology-parts em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

.study-etymology-story {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}

.study-etymology-path {
  margin: 7px 0 10px;
}

.study-etymology-path b {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  padding: 5px 8px;
  font-size: 12px;
}

.study-etymology-label {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.study-visual {
  display: grid;
  min-height: 145px;
  place-items: center;
  border-left: 1px solid var(--line);
  padding-left: 24px;
  opacity: 0.8;
}

.study-visual img,
.study-visual svg {
  display: block;
  width: 100%;
  max-height: 135px;
  object-fit: contain;
}

.study-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.study-tabs button,
.study-secondary button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.study-tabs button {
  border-bottom: 2px solid transparent;
  padding: 7px 11px 5px;
  white-space: nowrap;
}

.study-tabs button.active {
  border-bottom-color: var(--green);
  color: var(--deep);
}

.study-phrase-list {
  display: grid;
  gap: 0;
  margin-top: 6px;
}

.study-phrase-item {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: baseline;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.study-phrase-item:last-child {
  border-bottom: 0;
}

.study-phrase-item strong {
  color: var(--deep);
  font-size: 17px;
}

.study-phrase-item span {
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 560px) {
  .study-phrase-item {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 10px 0;
  }
}

.study-reveal {
  margin-top: 16px;
  border-left: 4px solid var(--green);
  background: var(--soft);
  padding: 13px 16px;
}

.study-reveal p:last-child {
  margin-bottom: 0;
}

.study-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
  margin-top: 22px;
}

.study-actions button {
  min-height: 48px;
  border: 1px solid var(--green);
  border-radius: 4px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.study-actions button[hidden] {
  display: none;
}

.study-actions.revealed {
  grid-template-columns: 1fr;
}

.study-actions.revealed .study-unsure {
  background: var(--deep);
  color: var(--white);
}

.study-unsure {
  background: var(--white);
  color: var(--deep);
}

.study-known {
  background: var(--deep);
  color: var(--white);
}

.study-secondary {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.study-secondary a {
  border-bottom: 1px solid var(--green);
  color: var(--deep);
  font-weight: 800;
}

@media (max-width: 900px) {
  .study-shell {
    width: min(720px, 100%);
  }

  .study-main {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 22px;
  }

  .study-visual {
    padding-left: 18px;
  }
}

@media (max-width: 620px) {
  .study-source {
    margin-top: 0;
  }

  .study-source-head h1 {
    font-size: 28px;
  }

  .study-source-item {
    min-height: 78px;
    gap: 12px;
    padding: 14px;
  }

  .study-source-item strong {
    font-size: 18px;
  }

  .study-source-item small {
    font-size: 12px;
    line-height: 1.45;
  }

  .study-record {
    margin-top: 38px;
    padding-top: 21px;
  }

  .study-record-head {
    display: block;
  }

  .study-record-head > p {
    margin-top: 8px;
    text-align: left;
  }

  .study-record-metrics {
    margin: 18px 0 24px;
  }

  .study-record-metrics div {
    padding: 14px 0 13px;
  }

  .study-record-metrics div + div {
    padding-left: 12px;
  }

  .study-record-metrics strong {
    font-size: 24px;
  }

  .study-week-chart {
    gap: 7px;
    height: 130px;
    padding-inline: 0;
  }

  .study-chart-bars {
    height: 96px;
  }

  .study-head {
    display: block;
    margin-bottom: 16px;
  }

  .study-head h1 {
    font-size: 25px;
  }

  .study-progress {
    width: 100%;
    margin-top: 14px;
    text-align: left;
  }

  .study-card {
    padding: 20px 16px 16px;
  }

  .study-library-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .study-word-row h2 {
    font-size: clamp(38px, 14vw, 48px);
    overflow-wrap: anywhere;
  }

  .study-pron-row {
    gap: 6px;
  }

  .study-pron-button {
    padding: 5px 7px;
    font-size: 12px;
  }

  .study-definition-item {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    padding: 3px 0;
  }

  .study-etymology-parts div {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 3px 7px;
  }

  .study-etymology-parts em {
    grid-column: 2;
  }

  .study-main {
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 305px;
    padding: 20px 0 16px;
  }

  .study-copy {
    height: 190px;
  }

  .study-visual {
    grid-row: 1;
    min-height: 92px;
    border-left: 0;
    padding: 0;
    opacity: 0.7;
  }

  .study-visual img,
  .study-visual svg {
    max-height: 92px;
  }

  .study-example {
    font-size: 17px;
  }

  .study-actions {
    position: sticky;
    bottom: 8px;
    grid-template-columns: 0.9fr 1.3fr;
    padding-top: 8px;
    background: var(--white);
  }
}
