:root {
  --moka-orange: #ff6540;
  --moka-orange-light: #fff1ee;
  --moka-navy: #1a2b4b;
  --text-primary: #1a1a2e;
  --text-secondary: #666b7a;
  --text-muted: #9aa0ac;
  --border: #e8ecf2;
  --border-strong: #c8d0dc;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-header: #f0f3f8;
  --bg-section: #eef2f8;
  --bg-total: #fff8f6;
  --bg-stripe: #fafbfc;
  --form-blue: #1f4e79;
  --form-blue-soft: #dce6f1;
  --form-green: #e2efda;
  --form-green-text: #375623;
  --form-orange-soft: #fce4d6;
  --form-grid: #b7c0ca;
  --form-grid-strong: #8f9aa6;
  --soft-blue: #eef5ff;
  --shadow: 0 14px 34px rgba(26, 43, 75, 0.08);
  --grade-s: #7c3aed;
  --grade-a: #0284c7;
  --grade-b: #059669;
  --grade-c: #d97706;
  --grade-d: #dc2626;
  --grade-e: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

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

.app-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: var(--moka-navy);
  color: #fff;
  box-shadow: 0 2px 14px rgba(10, 19, 38, 0.2);
}

.brand,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--moka-orange);
  color: #fff;
}

.nav-title {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: clamp(320px, 36vw, 560px);
  height: 40px;
  padding: 0 16px 0 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  transition: width 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.search-wrap:focus-within {
  width: clamp(360px, 42vw, 640px);
  border-color: rgba(255, 101, 64, 0.75);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 3px rgba(255, 101, 64, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  transform: rotate(45deg);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.48);
  font-weight: 500;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 56px;
}

.toolbar,
.detail-hero,
.content-panel,
.toc-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.toolbar {
  padding: 24px;
  box-shadow: var(--shadow);
}

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

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

.toolbar h1,
.detail-hero h1 {
  font-size: 26px;
  line-height: 1.35;
}

.toolbar p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.count-box {
  min-width: 116px;
  padding: 13px 16px;
  border-radius: 8px;
  background: var(--moka-orange-light);
  color: var(--moka-orange);
  text-align: right;
}

.count-box strong {
  display: block;
  font-size: 26px;
}

.count-box span {
  color: #9b4c3a;
  font-size: 13px;
}

.filter-group {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding-top: 18px;
}

.filter-label {
  padding-top: 5px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-pill {
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.filter-pill.active {
  border-color: var(--moka-orange);
  background: var(--moka-orange-light);
  color: var(--moka-orange);
  font-weight: 700;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.result-head strong {
  color: var(--text-primary);
}

.ghost-button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

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

.template-card {
  display: flex;
  min-height: 226px;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.template-card:hover {
  border-color: var(--moka-orange);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.doc-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: #1565c0;
  font-weight: 800;
}

.doc-icon.table {
  background: #e8f5e9;
  color: #2e7d32;
}

.card-title {
  min-height: 48px;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.42;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 6px;
  background: #f7f8fb;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.mode-kpi { background: #ebf4ff; color: #1565c0; }
.mode-okr { background: #e8f5e9; color: #2e7d32; }
.mode-mix { background: #fff3e0; color: #e65100; }
.mode-score { background: #f3e5f5; color: #6a1b9a; }
.mode-bonus { background: #fbe9e7; color: #bf360c; }
.mode-commit { background: #e0f2f1; color: #00695c; }

.card-meta {
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.empty-state {
  padding: 52px 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.empty-state h2 {
  font-size: 20px;
}

.empty-state p {
  margin-top: 8px;
  color: var(--text-secondary);
}

.detail-shell {
  width: calc(100% - 40px);
  margin: 24px auto 50px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 22px 24px;
}

.type-chip {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--moka-orange-light);
  color: var(--moka-orange);
  font-size: 13px;
  font-weight: 700;
}

.meta-strip {
  display: flex;
  max-width: 560px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.detail-layout.table-mode {
  grid-template-columns: minmax(0, 1fr);
}

.detail-layout.markdown-mode {
  grid-template-columns: minmax(0, 1fr);
}

.detail-layout.table-mode .content-panel {
  width: 100%;
  padding: 12px;
  background: #f0f0f0;
}

.detail-layout.markdown-mode .content-panel {
  width: 100%;
  padding: 34px 42px;
}

.detail-layout.markdown-mode .doc-content {
  width: 100%;
  max-width: 1080px;
}

.toc-panel {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 16px;
}

.toc-panel:empty {
  display: none;
}

.toc-title {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 700;
}

.toc-link {
  display: block;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.toc-link:hover {
  background: var(--moka-orange-light);
  color: var(--moka-orange);
}

.toc-link.level-3 {
  padding-left: 22px;
}

.content-panel {
  min-width: 0;
  padding: 20px;
}

.doc-content {
  min-height: 360px;
}

.markdown-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.markdown-meta .meta-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafd;
}

.markdown-meta .meta-label::after {
  content: "：";
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
  margin: 22px 0 12px;
  line-height: 1.35;
}

.doc-content h1:first-child,
.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content p,
.doc-content li {
  color: #303546;
  line-height: 1.8;
}

.doc-content table,
.csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.doc-content table {
  display: block;
  overflow: auto;
}

.doc-content th,
.doc-content td,
.csv-table th,
.csv-table td {
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.doc-content tr:nth-child(even),
.csv-table tr:nth-child(even) {
  background: #fafbfe;
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sheet-tab {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.sheet-tab.active {
  border-color: var(--moka-orange);
  background: var(--moka-orange-light);
  color: var(--moka-orange);
  font-weight: 700;
}

.table-scroll {
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.csv-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f5fa;
}

.sheet-container {
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--form-grid-strong);
  border-radius: 4px;
  background: var(--bg-card);
  box-shadow: 0 8px 20px rgba(31, 78, 121, 0.08);
}

.split-sheet .sheet-container,
.vertical-sheet .sheet-container {
  margin-bottom: 18px;
}

.sheet-title {
  padding: 10px 16px;
  background: var(--form-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--form-grid-strong);
  background: var(--form-blue-soft);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-right: 1px solid var(--form-grid);
  font-size: 12px;
}

.meta-label {
  color: #555;
  white-space: nowrap;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 600;
}

.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-scroll-wrap::-webkit-scrollbar {
  height: 7px;
}

.table-scroll-wrap::-webkit-scrollbar-track {
  background: var(--bg-page);
}

.table-scroll-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-strong);
}

.perf-table {
  width: 100%;
  min-width: var(--table-min-width, 720px);
  border-collapse: collapse;
  table-layout: fixed;
  color: #222;
  font-size: 12px;
}

.perf-table.compact {
  font-size: 12px;
}

.perf-table.wide-reading {
  width: max(100%, var(--table-min-width, 1600px));
}

.perf-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 8px;
  border: 1px solid var(--form-grid-strong);
  background: var(--form-blue-soft);
  color: var(--form-blue);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.perf-table td {
  padding: 7px 8px;
  border: 1px solid var(--form-grid);
  vertical-align: top;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.doc-content .perf-table th,
.doc-content .perf-table td {
  min-width: 0;
}

.perf-table th:last-child,
.perf-table td:last-child {
  border-right: 1px solid var(--form-grid);
}

.section-header-row td {
  padding: 7px 10px;
  border: 1px solid var(--form-grid);
  background: var(--form-green);
  color: var(--form-green-text);
  font-size: 13px;
  font-weight: 700;
}

.doc-title-row td {
  padding: 12px 16px;
  border-bottom: 1px solid #ffd4c8;
  background: var(--moka-orange-light);
  color: var(--moka-orange);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.data-row:nth-child(even) td {
  background: #fbfcfe;
}

.data-row:hover td {
  background: #fffbe6;
}

.total-row td {
  padding: 7px 8px;
  border: 1px solid var(--form-grid-strong);
  background: #fff2cc;
  color: #7f6000;
  font-weight: 700;
}

.col-index {
  width: 44px;
  min-width: 44px;
  color: #555;
  text-align: center;
}

.perf-table .col-index {
  padding-right: 8px;
  padding-left: 8px;
}

.col-main {
  font-weight: 600;
}

.col-weight {
  width: 64px;
  min-width: 64px;
  color: #c00000;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.col-score {
  min-width: 60px;
  color: #c00000;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.col-desc {
  color: #333;
  font-size: 12px;
  line-height: 1.7;
  min-width: 220px;
}

.perf-table.wide-reading .col-desc {
  min-width: 260px;
}

.group-label {
  background: var(--form-green) !important;
  color: var(--form-green-text);
  font-weight: 800;
}

.theme-section {
  background: var(--form-green) !important;
  color: var(--form-green-text);
  font-weight: 800;
  text-align: center;
}

.theme-total {
  background: #fff2cc !important;
  color: #7f6000;
  font-weight: 800;
}

.cell-empty {
  color: var(--text-muted);
}

.cell-empty::after {
  content: "—";
}

.score-high { color: #059669; font-weight: 700; }
.score-mid { color: #d97706; font-weight: 700; }
.score-low { color: #dc2626; font-weight: 700; }
.score-empty { color: var(--text-muted); }
.score-total { color: var(--moka-orange); font-weight: 800; }

.grade-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.grade-s { background: #f3e8ff; color: var(--grade-s); }
.grade-a { background: #e0f2fe; color: var(--grade-a); }
.grade-b { background: #d1fae5; color: var(--grade-b); }
.grade-c { background: #fef3c7; color: var(--grade-c); }
.grade-d { background: #fee2e2; color: var(--grade-d); }
.grade-e { background: #f3f4f6; color: var(--grade-e); }

.cell-content {
  max-height: 74px;
  overflow: hidden;
  transition: max-height 0.18s ease;
}

.cell-content.expanded {
  max-height: none;
}

.cell-toggle {
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--moka-orange);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.cell-toggle:hover {
  text-decoration: underline;
}

.perf-table.sticky-first-col td:first-child,
.perf-table.sticky-first-col th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 5px rgba(26, 43, 75, 0.08);
}

.perf-table.sticky-first-col thead th:first-child {
  z-index: 3;
  background: var(--form-blue-soft);
}

.pbc-form {
  width: 100%;
  margin: 0;
  color: #222;
  border: 1px solid var(--form-grid-strong);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 78, 121, 0.08);
  overflow: hidden;
}

.scorecard-form {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--form-grid-strong);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 78, 121, 0.08);
}

.scorecard-header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--form-grid-strong);
  background: var(--form-blue);
  color: #fff;
  text-align: center;
}

.scorecard-header h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 1px;
}

.scorecard-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--form-grid);
  background: var(--form-blue-soft);
  color: #555;
  font-size: 12px;
}

.scorecard-info b {
  color: #333;
}

.scorecard-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.scorecard-section {
  overflow: hidden;
  border: 1px solid var(--form-grid);
  border-radius: 2px;
  background: #fff;
}

.scorecard-section-title {
  padding: 8px 12px;
  border-bottom: 1px solid var(--form-grid);
  background: var(--form-green);
  color: var(--form-green-text);
  font-size: 13px;
  font-weight: 800;
}

.scorecard-table .scorecard-metric {
  background: #f5f8ff;
  color: #222;
  font-weight: 700;
}

.scorecard-table .scorecard-score {
  color: #c00000;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.scorecard-table .scorecard-fill {
  min-height: 34px;
  background: #fff;
}

.plan-form {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--form-grid-strong);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 78, 121, 0.08);
}

.plan-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--form-grid-strong);
  background: var(--form-blue);
  color: #fff;
}

.plan-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 1px;
}

.plan-header span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.plan-groups {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #fff;
}

.plan-group {
  overflow: hidden;
  border: 1px solid var(--form-grid);
  border-radius: 2px;
  background: #fff;
}

.plan-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--form-grid);
  background: var(--form-green);
  color: var(--form-green-text);
}

.plan-group-title strong {
  font-size: 13px;
}

.plan-group-title span {
  color: var(--text-secondary);
  font-size: 13px;
}

.plan-table th,
.plan-table td {
  text-align: left;
}

.plan-table th:nth-child(2),
.plan-table td:nth-child(2),
.plan-table th:nth-child(4),
.plan-table td:nth-child(4),
.plan-table th:nth-child(5),
.plan-table td:nth-child(5) {
  text-align: center;
}

.score-cell,
.total-cell {
  color: var(--text-muted);
  font-weight: 700;
}

.total-cell {
  background: #fff2cc;
  color: #7f6000;
  vertical-align: middle !important;
}

.pbc-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--form-grid-strong);
  background: #fff;
  text-align: center;
}

.pbc-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.pbc-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pbc-info span {
  padding: 6px 10px;
  border: 1px solid var(--form-grid);
  border-radius: 2px;
  background: #f7f7f7;
  color: #555;
  font-size: 12px;
}

.pbc-section {
  padding: 0 16px 16px;
  margin-top: 0;
}

.pbc-section h3 {
  margin: 0 -16px 12px;
  padding: 8px 16px;
  border-top: 1px solid var(--form-grid);
  border-bottom: 1px solid var(--form-grid);
  background: var(--form-blue);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.readable-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--form-grid);
  border-radius: 2px;
  background: #fff;
}

.section-empty {
  width: 100%;
  padding: 16px 18px;
  border: 1px dashed var(--form-grid);
  border-radius: 2px;
  background: #fffbe6;
  color: #555;
  font-size: 12px;
  text-align: center;
}

.readable-table {
  display: table;
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.doc-content .readable-table {
  display: table;
  overflow: visible;
}

.doc-content .readable-table th,
.doc-content .readable-table td {
  min-width: 0;
}

.readable-table th,
.readable-table td {
  padding: 7px 8px;
  border: 1px solid var(--form-grid);
  vertical-align: top;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
  min-width: 0;
}

.readable-table th {
  background: var(--form-blue-soft);
  color: var(--form-blue);
  font-weight: 700;
  text-align: center;
}

.readable-table tbody tr:nth-child(even) {
  background: #fbfcfe;
}

.pbc-section .readable-table th:first-child,
.pbc-section .readable-table td:first-child {
  text-align: center;
}

.pbc-section .readable-table th:nth-child(3),
.pbc-section .readable-table td:nth-child(3) {
  text-align: center;
}

.pbc-section .readable-table th:last-child,
.pbc-section .readable-table td:last-child {
  text-align: center;
}

@media (max-width: 1180px) {
  .readable-table-wrap {
    overflow-x: auto;
  }
}

.error-box {
  padding: 20px;
  border-radius: 8px;
  background: #fff1ee;
  color: #9a341c;
}

@media (max-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .meta-strip {
    justify-content: flex-start;
  }

  .toc-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .app-nav {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .search-wrap {
    width: 100%;
    max-width: none;
  }

  .search-wrap:focus-within {
    width: 100%;
  }

  .page-shell,
  .detail-shell {
    width: min(100% - 24px, 1180px);
    margin-top: 16px;
  }

  .toolbar,
  .detail-hero,
  .content-panel {
    padding: 16px;
  }

  .toolbar-head,
  .result-head {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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