:root {
  --bg: #f6f1e8;
  --bg-accent: #f0e7d8;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fffaf2;
  --ink: #201a15;
  --muted: #6f655c;
  --line: rgba(98, 75, 48, 0.16);
  --brand: #0e6d61;
  --brand-soft: rgba(14, 109, 97, 0.12);
  --accent: #b55b2d;
  --accent-soft: rgba(181, 91, 45, 0.12);
  --shadow: 0 20px 45px rgba(64, 42, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
}

body[data-view="list"] .shell,
body[data-view="detail"] .detail-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.search-panel,
.panel,
.vocab-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 18px;
  margin-bottom: 20px;
}

.eyebrow,
.card-kicker,
.stat-label {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.word {
  margin: 10px 0 0;
  font-size: 48px;
  line-height: 1;
}

.lead,
.reading,
.note p,
.example-cn,
.panel-head p,
.source-section p,
.back-link {
  color: var(--muted);
}

.lead {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: 18px;
  line-height: 1.7;
}

.search-bar {
  display: flex;
  gap: 10px;
}

.search-bar input,
.search-bar button,
.pagination button {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font: inherit;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  background: #fffdf8;
}

.search-bar button,
.pagination button {
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.search-bar button:disabled,
.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel {
  padding: 22px;
}

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

.panel-head h2,
.section h2 {
  margin: 0;
  font-size: 22px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr {
  transition: background-color 160ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.46);
}

.mini-word {
  font-weight: 700;
  font-size: 18px;
}

.mini-kana {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.detail-link,
.back-link {
  text-decoration: none;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

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

.detail-page {
  display: grid;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  padding: 0 0 4px;
}

.vocab-card {
  padding: 30px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.reading {
  margin-top: 12px;
  font-size: 18px;
}

.meaning {
  margin: 22px 0 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
}

.section {
  margin-top: 26px;
}

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

.note,
.example {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.note {
  padding: 16px;
  background: #fffdf8;
}

.note strong {
  display: block;
  margin-bottom: 8px;
}

.examples {
  display: grid;
  gap: 12px;
}

.example {
  padding: 14px 16px;
  background: rgba(14, 109, 97, 0.06);
  border-left: 4px solid var(--brand);
}

.example-jp {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.example-cn {
  margin: 0;
  line-height: 1.7;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

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

@media (max-width: 780px) {
  .search-panel,
  .panel,
  .vocab-card {
    padding: 20px;
  }

  .word {
    font-size: 38px;
  }

  .panel-head,
  .card-top,
  .pagination,
  .search-bar {
    display: grid;
  }

  .note-grid {
    grid-template-columns: 1fr;
  }

}
