:root {
  --tq-ink: #14231a;
  --tq-muted: #5b6b60;
  --tq-green: #0f7a45;
  --tq-green-deep: #0a5c34;
  --tq-soft: #e8f5ee;
  --tq-line: #d5e4db;
  --tq-warn: #b45309;
  --tq-bad: #b91c1c;
  --tq-good: #15803d;
  --tq-card: #ffffff;
}

.tq-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 64px;
  color: var(--tq-ink);
  font-family: Georgia, "Times New Roman", serif;
}

.tq-hero {
  padding: 28px 22px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(15, 122, 69, 0.18), transparent 45%),
    linear-gradient(165deg, #f4fbf7 0%, #eef6f1 55%, #ffffff 100%);
  border: 1px solid var(--tq-line);
  margin-bottom: 22px;
}

.tq-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tq-green);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.tq-hero h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--tq-green-deep);
}

.tq-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--tq-muted);
}

.tq-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.tq-stats span {
  background: #fff;
  border: 1px solid var(--tq-line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--tq-muted);
}

.tq-stats strong {
  color: var(--tq-ink);
}

.tq-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.9rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--tq-muted);
}

.tq-crumb a {
  color: var(--tq-green);
  text-decoration: none;
  font-weight: 600;
}

.tq-section {
  margin-bottom: 28px;
}

.tq-section h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  color: var(--tq-green-deep);
}

.tq-section-note {
  margin: 0 0 14px;
  color: var(--tq-muted);
}

.tq-chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.tq-chapter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--tq-card);
  border: 1px solid var(--tq-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.tq-chapter-card:hover {
  border-color: #8fcdb0;
  box-shadow: 0 8px 20px rgba(15, 122, 69, 0.1);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}

.tq-ch-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.tq-ch-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  flex-shrink: 0;
}

.tq-count {
  color: var(--tq-muted);
  font-size: 1rem;
}

.tq-start {
  background: var(--tq-green);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 8px;
}

.tq-empty,
.tq-seo-box {
  background: var(--tq-soft);
  border: 1px solid var(--tq-line);
  border-radius: 12px;
  padding: 16px 18px;
}

.tq-seo-box h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--tq-green-deep);
}

.tq-seo-box p {
  margin: 0 0 10px;
  color: var(--tq-muted);
  line-height: 1.55;
}

.tq-seo-box a {
  color: var(--tq-green);
  font-weight: 700;
}

/* ===== Quiz player ===== */
.tq-player {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 14px 56px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--tq-ink);
}

.tq-player-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.tq-player-top h1 {
  margin: 0;
  font-size: 1.55rem;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--tq-green-deep);
}

.tq-player-sub {
  color: #5b6b60;
  font-size: 1.05rem;
  margin-top: 4px;
}

.tq-back {
  color: var(--tq-green);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

.tq-progress-wrap {
  margin-bottom: 18px;
}

.tq-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tq-muted);
  margin-bottom: 6px;
}

.tq-progress-bar {
  height: 8px;
  background: #e5eee8;
  border-radius: 999px;
  overflow: hidden;
}

.tq-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--tq-green), #22a35d);
  transition: width 0.25s ease;
}

.tq-card {
  background: #fff;
  border: 1px solid var(--tq-line);
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 10px 28px rgba(20, 35, 26, 0.06);
}

.tq-qtext {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 22px;
  color: var(--tq-ink);
}

.tq-qtext p {
  margin: 0 0 0.4em;
  font-weight: 700;
  font-size: inherit;
}

.tq-qtext p:last-child {
  margin-bottom: 0;
}

.tq-options {
  display: grid;
  gap: 14px;
}

.tq-option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--tq-line);
  background: #fbfdfc;
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--tq-ink);
}

.tq-option:hover:not(:disabled) {
  border-color: #8fcdb0;
  background: #f3faf6;
}

.tq-option:disabled {
  cursor: default;
}

.tq-option .tq-letter {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  background: #e8f5ee;
  color: var(--tq-green-deep);
}

.tq-option .tq-opt-html {
  flex: 1;
  padding-top: 6px;
  font-size: 1.55rem;
  font-weight: 600;
}

.tq-option .tq-opt-html p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.tq-option.is-correct {
  border-color: #86efac;
  background: #ecfdf5;
}

.tq-option.is-wrong {
  border-color: #fecaca;
  background: #fef2f2;
}

.tq-option.is-correct .tq-letter {
  background: var(--tq-good);
  color: #fff;
}

.tq-option.is-wrong .tq-letter {
  background: var(--tq-bad);
  color: #fff;
}

.tq-feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  display: none;
}

.tq-feedback.show {
  display: block;
}

.tq-feedback.ok {
  background: #ecfdf5;
  color: var(--tq-good);
}

.tq-feedback.bad {
  background: #fef2f2;
  color: var(--tq-bad);
}

.tq-expl {
  margin-top: 14px;
  display: none;
}

.tq-expl.show {
  display: block;
}

.tq-expl-btn {
  border: none;
  background: var(--tq-green);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  border-radius: 10px;
  padding: 16px 20px;
  cursor: pointer;
}

.tq-expl-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tq-expl-body {
  margin-top: 10px;
  padding: 14px;
  background: #f8faf9;
  border: 1px solid var(--tq-line);
  border-radius: 10px;
  line-height: 1.55;
  font-size: 1.15rem;
  font-family: Georgia, "Times New Roman", serif;
}

.tq-nav {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 4px;
  position: sticky;
  bottom: 12px;
  z-index: 5;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--tq-line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 35, 26, 0.12);
}

.tq-nav button {
  flex: 1;
  border-radius: 10px;
  padding: 18px 12px;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--tq-line);
  background: #fff;
  color: var(--tq-ink);
}

.tq-nav .tq-next {
  background: var(--tq-green);
  border-color: var(--tq-green);
  color: #fff;
}

.tq-nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tq-summary {
  display: none;
  text-align: center;
  padding: 28px 18px;
  background: #fff;
  border: 1px solid var(--tq-line);
  border-radius: 16px;
}

.tq-summary.show {
  display: block;
}

.tq-summary h2 {
  margin: 0 0 10px;
  color: var(--tq-green-deep);
  font-family: Georgia, "Times New Roman", serif;
}

.tq-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 22px;
}

.tq-summary-stats div {
  background: var(--tq-soft);
  border-radius: 12px;
  padding: 12px 8px;
}

.tq-summary-stats strong {
  display: block;
  font-size: 1.4rem;
  color: var(--tq-ink);
}

.tq-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tq-summary-actions a,
.tq-summary-actions button {
  display: inline-block;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.tq-summary-actions .primary {
  background: var(--tq-green);
  color: #fff;
}

.tq-summary-actions .ghost {
  background: #fff;
  color: var(--tq-green-deep);
  border: 1px solid var(--tq-line);
}

.tq-empty-quiz {
  text-align: center;
  padding: 40px 16px;
  font-size: 1.15rem;
}

.tq-new-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.tq-subject-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.tq-subject-switch a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--tq-line);
  background: #fff;
  color: var(--tq-green-deep);
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
}

.tq-subject-switch a.is-active {
  background: var(--tq-green);
  border-color: var(--tq-green);
  color: #fff;
}

.tq-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.tq-hub-card {
  display: block;
  padding: 20px 18px;
  border-radius: 16px;
  border: 1px solid var(--tq-line);
  background: linear-gradient(180deg, #f4fbf7 0%, #fff 70%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tq-hub-card:hover {
  border-color: #8fcdb0;
  box-shadow: 0 10px 24px rgba(15, 122, 69, 0.12);
  text-decoration: none;
  color: inherit;
}

.tq-hub-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
  color: var(--tq-green-deep);
}

.tq-hub-card small {
  display: block;
  margin-top: 6px;
  color: var(--tq-muted);
  font-size: 1rem;
  line-height: 1.4;
}

.tq-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 20px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.tq-action-bar--compact {
  margin-top: 0;
  margin-bottom: 16px;
}

.tq-action-btn {
  display: inline-block;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--tq-line);
  background: #fff;
  color: var(--tq-green-deep);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.25;
}

.tq-action-btn:hover {
  border-color: #8fcdb0;
  background: #f3faf6;
  text-decoration: none;
  color: var(--tq-green-deep);
}

.tq-action-btn--primary {
  background: var(--tq-green);
  border-color: var(--tq-green);
  color: #fff;
}

.tq-action-btn--primary:hover {
  background: var(--tq-green-deep);
  border-color: var(--tq-green-deep);
  color: #fff;
}

.tq-action-btn--hot {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.tq-chapter-card--academy {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 75%);
}

.tq-chapter-card--academy .tq-start {
  background: #d97706;
}

.tq-player-top h1 {
  margin: 0;
  font-size: 1.85rem;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--tq-green-deep);
}

.tq-player-sub {
  color: #5b6b60;
  font-size: 1.2rem;
  margin-top: 4px;
}

.tq-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tq-muted);
  margin-bottom: 6px;
}

.tq-feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  display: none;
}

.tq-ch-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.tq-start {
  background: var(--tq-green);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 8px;
}

.tq-section h2 {
  margin: 0 0 4px;
  font-size: 1.65rem;
  color: var(--tq-green-deep);
}

.tq-section-note {
  margin: 0 0 14px;
  color: var(--tq-muted);
  font-size: 1.15rem;
}

.mdcat-ilinks__head strong {
  display: block;
  font-size: 1.35rem;
  color: #0a5c34;
}

.mdcat-ilinks__head span {
  color: #5b6b60;
  font-size: 1.1rem;
}

.mdcat-ilinks__grid span {
  display: block;
  font-weight: 800;
  font-size: 1.2rem;
  color: #0f7a45;
}

.mdcat-ilinks__grid small {
  display: block;
  margin-top: 2px;
  color: #5b6b60;
  font-size: 1.05rem;
  line-height: 1.35;
}

.mdcat-ilinks__grid a {
  display: block;
  padding: 14px 14px;
  border-radius: 10px;
  border: 1px solid #d5e4db;
  background: #fff;
  text-decoration: none;
  color: #14231a;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tq-section--mix h2 {
  color: #9a3412;
}

.tq-chapter-card--mix {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 75%);
}

.tq-chapter-card--mix .tq-start {
  background: #c2410c;
}

@media (max-width: 640px) {
  .tq-chapter-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .tq-ch-meta {
    width: 100%;
    justify-content: space-between;
  }

  .tq-hero h1 {
    font-size: 1.55rem;
  }

  .tq-qtext {
    font-size: 1.65rem;
  }

  .tq-option,
  .tq-option .tq-opt-html {
    font-size: 1.4rem;
  }

  .tq-nav button {
    font-size: 1.25rem;
    padding: 16px 8px;
  }

  .tq-action-btn {
    font-size: 1.1rem;
  }

  .mdcat-ilinks__grid span {
    font-size: 1.1rem;
  }
}

/* ===== MDCAT internal link hub ===== */
.mdcat-ilinks {
  margin: 28px 0;
  padding: 18px 16px 14px;
  border-radius: 16px;
  border: 1px solid #d5e4db;
  background: linear-gradient(180deg, #f4fbf7 0%, #ffffff 70%);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.mdcat-ilinks__head {
  margin-bottom: 12px;
}

.mdcat-ilinks__head strong {
  display: block;
  font-size: 1.05rem;
  color: #0a5c34;
}

.mdcat-ilinks__head span {
  color: #5b6b60;
  font-size: 0.9rem;
}

.mdcat-ilinks__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.mdcat-ilinks__grid a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d5e4db;
  background: #fff;
  text-decoration: none;
  color: #14231a;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mdcat-ilinks__grid a:hover {
  border-color: #8fcdb0;
  box-shadow: 0 6px 16px rgba(15, 122, 69, 0.1);
  text-decoration: none;
  color: #14231a;
}

.mdcat-ilinks__grid span {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f7a45;
}

.mdcat-ilinks__grid small {
  display: block;
  margin-top: 2px;
  color: #5b6b60;
  font-size: 0.9rem;
  line-height: 1.35;
}

.mdcat-ilinks__grid li.is-active a {
  border-color: #0f7a45;
  background: #e8f5ee;
}
