:root {
  --ink: #151719;
  --nav: #343a40;
  --line: #d9dde2;
  --muted: #6c757d;
  --paper: #f3f4f6;
  --brand: #d5b462;
  --brand-dark: #b08e3e;
  --link: #3150b9;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: #1d3278;
}

.page-shell {
  width: min(100% - 32px, 1220px);
  margin: 0 auto;
}

.brand-band {
  background: #111315;
  color: #fff;
}

.brand-content {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  display: inline-grid;
  gap: 2px;
  color: var(--brand);
  line-height: 1;
  text-decoration: none;
}

.brand-mark:hover {
  color: #e8cf86;
}

.logo-name {
  font-family: "Segoe Print", "Comic Sans MS", "Segoe UI", sans-serif;
  font-size: 3.1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-tagline {
  color: #c1a061;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .2em;
  margin-left: 6px;
  text-transform: uppercase;
}

.header-search,
.search-box {
  display: flex;
}

.header-search input,
.search-box input {
  border: 1px solid #454b52;
  border-radius: 4px 0 0 4px;
  min-width: 260px;
  padding: 10px 14px;
}

.header-search input {
  background: #30363c;
  color: #fff;
}

.header-search button,
.search-box button {
  border: 0;
  border-radius: 0 4px 4px 0;
  background: var(--nav);
  color: #fff;
  font-weight: 700;
  padding: 0 18px;
}

.site-nav {
  background: var(--nav);
  min-height: 44px;
  padding: 0;
}

.nav-shell {
  width: 100%;
  position: relative;
}

.site-nav .navbar-collapse,
.site-nav .navbar-nav {
  align-items: stretch;
}

.site-nav .navbar-collapse {
  justify-content: center;
}

.site-nav .nav-link,
.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 500;
  line-height: 1;
}

.feedback-link {
  background: #252c34;
  color: #ffe183;
}

.site-nav .nav-link:hover,
.contact-link:hover {
  background: #4a5159;
  color: #ffe183;
}

.contact-link {
  position: absolute;
  right: 0;
  top: 0;
}

.admin-login {
  min-height: 540px;
  display: grid;
  place-items: center;
  padding: 48px 16px;
}

.admin-login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.admin-login-card h1 {
  font-size: 1.6rem;
  margin: 0;
}

.admin-login-card p {
  color: var(--muted);
  margin: 0 0 8px;
}

.admin-login-card input,
.admin-login-card button,
.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  padding: 10px 12px;
}

.admin-login-card button,
.admin-form button,
.admin-action {
  border: 1px solid #202832;
  border-radius: 6px;
  background: #202832;
  color: #fff;
  padding: 10px 14px;
  font-weight: 600;
}

.admin-page {
  width: min(100% - 32px, 1720px);
  margin: 28px auto 64px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.post-admin-page {
  grid-template-columns: 230px minmax(0, 1fr);
}

.admin-sidebar,
.admin-content,
.admin-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-sidebar {
  overflow: hidden;
}

.admin-brand {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: #111315;
  color: #fff;
}

.admin-brand span {
  color: #aeb7c2;
  font-size: .9rem;
}

.admin-sidebar nav {
  display: grid;
  padding: 10px;
}

.admin-sidebar nav a {
  border-radius: 6px;
  color: #26313d;
  padding: 10px 12px;
}

.admin-sidebar nav a:hover {
  background: #f0f3f6;
}

.admin-sidebar nav a.active {
  background: #202832;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 4px 0 0 var(--brand);
}

.table-actions button {
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  background: #fff;
  color: #303a45;
  padding: 7px 10px;
}

.admin-thumb {
  width: 92px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef1f4;
  object-fit: contain;
}

.admin-content {
  padding: 24px;
  min-width: 0;
}

.admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-title p {
  color: var(--brand-dark);
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0;
  text-transform: uppercase;
}

.admin-title h1 {
  font-size: 1.8rem;
  margin: 2px 0 0;
}

.admin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.admin-action:hover {
  color: #fff;
  background: #303a45;
}

.admin-action.subtle {
  background: #fff;
  color: #26313d;
  border-color: #cbd3dc;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.admin-stat-grid a {
  display: grid;
  gap: 4px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 18px;
}

.admin-stat-grid strong {
  font-size: 2rem;
}

.admin-stat-grid span,
.row-sub {
  color: var(--muted);
}

.admin-panel {
  padding: 18px;
}

.admin-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}

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

.admin-list a {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #5c6875;
  font-size: .86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.table-actions form {
  display: inline;
}

.table-actions a {
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  color: #303a45;
  padding: 7px 10px;
}

.truncate {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: #344050;
  font-weight: 600;
}

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

.check-line {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-line input {
  width: auto;
}

.content-editor {
  min-height: 360px;
  font-family: Consolas, "Courier New", monospace;
  tab-size: 4;
}

.editor-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.builder-head h2 {
  margin-bottom: 4px;
}

.builder-head p {
  color: #5f6b78;
  margin: 0;
}

.editor-panel h2 {
  font-size: 1.2rem;
  margin: 0;
}

.editor-mode-grid,
.visual-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.radio-card {
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: start;
  border: 1px solid #cbd3dc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.radio-card input {
  width: auto;
  margin-top: 4px;
}

.radio-card span {
  display: grid;
  gap: 3px;
  color: #5f6b78;
  font-weight: 400;
}

.radio-card strong {
  color: #1f2933;
}

.rich-editor-shell {
  display: grid;
  gap: 12px;
}

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

.rich-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.rich-toolbar button {
  width: auto;
  min-height: 34px;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  background: #fff;
  color: #26313d;
  padding: 0 10px;
}

.rich-toolbar button:hover {
  background: #f0f3f6;
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.color-swatches button {
  width: 28px;
  min-height: 28px;
  border: 1px solid #b8c0ca;
  border-radius: 50%;
  background: var(--swatch);
  padding: 0;
}

.color-swatches button:hover,
.color-swatches button:focus-visible {
  border-color: #26313d;
  box-shadow: 0 0 0 3px rgba(32, 40, 50, .12);
}

.rich-toolbar label {
  width: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5b6673;
  font-size: .9rem;
}

.rich-toolbar select,
.rich-toolbar input[type="color"] {
  width: auto;
  min-height: 34px;
  padding: 3px 6px;
}

.rich-editor {
  min-height: 360px;
  border: 1px solid #cbd3dc;
  border-radius: 8px;
  background: #fff;
  padding: 16px 16px 16px 54px;
  outline: none;
}

.rich-editor:focus {
  border-color: #7b8794;
  box-shadow: 0 0 0 3px rgba(32, 40, 50, .08);
}

.rich-editor pre,
.html-source,
.post-body pre,
.post-body pre code {
  white-space: pre;
  tab-size: 4;
}

.rich-editor pre,
.post-body pre {
  max-width: 100%;
  min-width: 0;
  background: #111722;
  color: #f3f7fb;
  border-radius: 8px;
  padding: 14px 14px 14px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-block code {
  display: block;
  counter-reset: code-line;
  font-family: Consolas, "Courier New", monospace;
  min-width: 100%;
  width: max-content;
}

.code-line {
  counter-increment: code-line;
  display: block;
  box-sizing: border-box;
  min-height: 1.45em;
  min-width: 100%;
  padding-left: 56px;
  padding-right: 14px;
  position: relative;
  width: max-content;
}

.code-line::before {
  content: counter(code-line);
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  color: #7f8a98;
  text-align: right;
  user-select: none;
}

.code-line::after {
  content: "";
  position: absolute;
  left: 48px;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, .12);
}

.terminal-output {
  background: #17202b !important;
}

.article-canvas {
  counter-reset: article-row;
}

.article-canvas > * {
  counter-increment: article-row;
  position: relative;
}

.article-canvas > *::before {
  content: counter(article-row);
  position: absolute;
  left: -38px;
  top: .15em;
  width: 24px;
  color: #98a3af;
  font-family: Consolas, "Courier New", monospace;
  font-size: .82rem;
  text-align: right;
}

.widget-tree {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.widget-tree h3 {
  font-size: 1rem;
  margin: 0;
}

.widget-group {
  display: grid;
  gap: 7px;
}

.widget-group span {
  color: var(--brand-dark);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.widget-group button {
  width: 100%;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  background: #fff;
  color: #26313d;
  padding: 8px 10px;
  text-align: left;
}

.widget-group button:hover {
  background: #f2f5f8;
  border-color: #98a3af;
}

.image-upload-field {
  display: grid;
  gap: 8px;
}

.image-upload-field img {
  max-width: 260px;
  max-height: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.table-size-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.table-size-controls label {
  display: grid;
  gap: 4px;
  color: #5f6b78;
  font-size: .82rem;
  font-weight: 600;
}

.table-size-controls input {
  width: 100%;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  padding: 7px 8px;
}

.generated-html textarea {
  background: #f6f8fa;
}

.article-image img,
.post-body .article-image img {
  display: block;
  width: 100%;
  max-width: 860px;
  max-height: 480px;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
}

.article-image,
.post-body .article-image {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin: 18px 0;
}

.article-image figcaption,
.post-body .article-image figcaption {
  color: #66717f;
  font-size: .9rem;
  text-align: center;
}

.article-image-placeholder,
.note-block,
.warning-block,
.practice-block,
.api-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.article-image-placeholder {
  background: #eef2f6;
}

.note-block {
  background: #f5f9ff;
  border-color: #bdd7ff;
}

.warning-block {
  background: #fff8e8;
  border-color: #ead28a;
}

.check-list {
  list-style: none;
  padding-left: 0;
}

.check-list li::before {
  content: "□";
  color: #56616f;
  margin-right: 8px;
}

.lead {
  color: #405060;
  font-size: 1.08rem;
}

.rich-editor table,
.post-body table {
  width: 100%;
  border-collapse: collapse;
}

.rich-editor th,
.rich-editor td,
.post-body th,
.post-body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.editor-hints {
  display: grid;
  gap: 4px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #4a5563;
  padding: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-actions a {
  color: #4b5563;
}

.admin-empty,
.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 18px;
}

.navbar-toggler {
  background: #23282d;
  border-color: #5b646d;
  margin: 6px 0;
}

.home-main {
  background: var(--paper);
  padding: 36px 0 58px;
}

.home-shell {
  max-width: 1160px;
}

.search-box {
  justify-content: center;
  margin: 0 auto 34px;
}

.search-box input {
  width: min(100%, 640px);
  border-color: #b8bec5;
  background: #fff;
}

.search-page {
  padding: 34px 0 64px;
}

.search-shell {
  max-width: 980px;
}

.search-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.search-heading h1 {
  margin: 0;
  font-size: 1.9rem;
}

.search-page-form {
  display: flex;
  width: min(100%, 720px);
}

.search-page-form input {
  flex: 1;
  border: 1px solid #b8c0ca;
  border-radius: 6px 0 0 6px;
  padding: 11px 14px;
}

.search-page-form button {
  border: 0;
  border-radius: 0 6px 6px 0;
  background: #202832;
  color: #fff;
  font-weight: 700;
  padding: 0 20px;
}

.search-count {
  color: #596575;
  margin-bottom: 14px;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
}

.search-result-item:hover {
  border-color: var(--brand-dark);
  color: var(--ink);
}

.search-result-item strong {
  color: #243e9f;
  font-size: 1.04rem;
  font-weight: 600;
}

.search-result-item small {
  color: #4c5968;
  line-height: 1.6;
}

.search-meta {
  color: #9f2f52;
  font-size: .84rem;
  font-weight: 600;
}

.search-hit {
  color: #b32653;
  font-weight: 800;
  background: #fff0a8;
  border-radius: 3px;
  padding: 0 2px;
}

.topics-section {
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--brand-dark);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-heading h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

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

.topic-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 336px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.topic-visual {
  height: 168px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f7f9fb 0%, #eef2f6 100%);
  padding: 0;
  overflow: hidden;
}

.topic-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.topic-body {
  padding: 18px 20px;
  flex: 1;
}

.topic-body h2 {
  color: #2f48b4;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.topic-body p {
  margin: 0;
}

.topic-footer {
  border-top: 1px solid var(--line);
  background: #f8f8f8;
  padding: 12px 20px;
}

.topic-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid #c5ccd4;
  border-radius: 6px;
  background: #fff;
  color: #3d4752;
  font-size: .94rem;
  padding: 0 14px;
  transition: border-color .15s ease, background-color .15s ease;
}

.topic-footer a:hover {
  border-color: #7b8794;
  background: #f3f5f7;
  color: #20262d;
}

.category-hero {
  background: #202428;
  color: #fff;
  padding: 34px 0;
}

.category-hero-inner {
  width: min(100% - 48px, 1320px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.category-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 14px;
}

.category-hero p:last-child {
  max-width: 1040px;
  color: #edf0f3;
  margin: 0;
}

.category-badge {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #399d2d, #6b35a7);
  font-size: 2.7rem;
  font-weight: 800;
  border: 5px solid rgba(255, 255, 255, .4);
}

.learning-layout {
  width: min(100% - 48px, 1320px);
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  padding: 26px 0 58px;
  min-width: 0;
}

.lesson-sidebar {
  background: #edf4ec;
  color: #1f2b22;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
  min-width: 0;
}

.lesson-group h2 {
  margin: 0;
  background: #9f2f52;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 600;
  padding: 9px 14px;
}

.lesson-sections {
  display: grid;
}

.lesson-section {
  display: grid;
}

.lesson-section-toggle {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #c7d3bd;
  background: #ffeeb0;
  color: #1f2b22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  padding: 6px 8px;
  text-align: left;
}

.lesson-section-toggle:hover,
.lesson-section-toggle:focus-visible {
  background: #f8df7b;
  color: #111315;
}

.lesson-section-toggle:focus-visible {
  outline: 2px solid #151719;
  outline-offset: -2px;
}

.lesson-section-toggle span:first-child::before {
  content: "\25b8";
  margin-right: 4px;
}

.lesson-section-toggle[aria-expanded="true"] {
  background: #f3d568;
  border-bottom-color: #b9a953;
  color: #111315;
}

.lesson-section-toggle[aria-expanded="true"] span:first-child::before {
  content: "\25be";
}

.lesson-toggle-icon::before {
  content: "+";
  font-weight: 700;
}

.lesson-section-toggle[aria-expanded="true"] .lesson-toggle-icon::before {
  content: "-";
}

.lesson-section-panel {
  margin: 0;
  padding: 0;
  display: grid;
}

.lesson-section-panel[hidden] {
  display: none;
}

.lesson-post-link {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: #d9e8d4;
  border-bottom: 1px solid #bdcfb5;
  color: #18321f;
  font-size: .88rem;
  font-weight: 400;
  padding: 7px 10px 7px 18px;
  min-width: 0;
}

.lesson-post-link span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lesson-post-link:hover,
.lesson-post-link.active {
  background: #c6ddb8;
  color: #0f2314;
  font-weight: 600;
}

.lesson-post-link.standalone {
  background: #eef6ea;
  border-bottom-color: #c8dac1;
  padding-left: 12px;
  font-weight: 600;
}

.lesson-post-link.standalone:hover,
.lesson-post-link.standalone.active {
  background: #bfd8b6;
  color: #0f2314;
}

.lesson-number {
  color: #e04b5a;
  flex: 0 0 auto;
  font-size: .82rem;
  font-weight: 700;
}

.lesson-post-link.active .lesson-number,
.lesson-post-link:hover .lesson-number {
  color: #ff6572;
}

.lesson-content {
  background: #fff;
  padding: 24px 34px 34px;
  min-height: 620px;
  font-size: .96rem;
  min-width: 0;
  max-width: 100%;
}

.breadcrumb-line {
  color: #9aa1aa;
  margin-bottom: 6px;
}

.lesson-content h2 {
  color: #4b9b32;
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 8px;
}

.lesson-content p {
  margin-bottom: 14px;
}

.lesson-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  min-height: 88px;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, #23104f, #6a35d8);
}

.lesson-banner span {
  color: #ffe183;
  font-weight: 700;
}

.lesson-banner strong {
  font-size: 1.2rem;
  font-weight: 600;
}

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

.post-preview {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  color: var(--ink);
}

.post-preview:hover {
  border-color: var(--brand-dark);
}

.post-preview span {
  color: #b32653;
  font-size: .84rem;
  font-weight: 600;
}

.post-preview strong {
  font-size: .96rem;
  font-weight: 500;
}

.post-preview small {
  color: var(--muted);
}

.site-footer {
  flex-shrink: 0;
  background: #111315;
  color: #d8dde3;
  padding: 28px 0;
}

.post-detail h1 {
  font-size: 2rem;
  margin: 4px 0 12px;
}

.post-summary {
  color: #42505f;
  font-size: 1.05rem;
}

.post-hero-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin: 10px 0 20px;
}

.post-body {
  color: #17202a;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.post-body h2 {
  color: #3f8f32;
  font-size: 1.45rem;
  font-weight: 400;
  margin: 24px 0 10px;
}

.post-body p,
.post-body li {
  line-height: 1.75;
}

.post-body pre code {
  display: block;
  font-family: Consolas, "Courier New", monospace;
}

.post-body .code-block code {
  display: block;
}

.post-body pre,
.post-body .code-block,
.post-body table,
.post-body img,
.post-body iframe {
  max-width: 100%;
}

.post-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-body .keyword-box {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.post-body .keyword-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)) !important;
  gap: 6px 8px;
  max-width: 100%;
  min-width: 0;
}

.post-body .keyword-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.post-body h3 {
  color: #294f8f;
  font-size: 1.18rem;
  font-weight: 500;
  margin: 20px 0 8px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.site-footer p {
  margin: 6px 0 0;
}

.site-footer a {
  color: #ffe183;
}

.site-footer span {
  display: block;
  color: #8f98a3;
}

.feedback-page {
  padding: 36px 0 64px;
}

.feedback-shell {
  max-width: 860px;
}

.feedback-card {
  display: grid;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.feedback-card h1 {
  margin: 0;
  font-size: 1.9rem;
}

.eyebrow {
  margin: 0;
  color: var(--brand-dark);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.feedback-form {
  display: grid;
  gap: 16px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: #344050;
  font-weight: 600;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  padding: 10px 12px;
}

.feedback-form button {
  justify-self: start;
  border: 1px solid #202832;
  border-radius: 6px;
  background: #202832;
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
}

.feedback-success {
  border: 1px solid #9bc89d;
  border-radius: 6px;
  background: #edf8ed;
  color: #245c2b;
  padding: 10px 12px;
}

.feedback-admin-list {
  display: grid;
  gap: 14px;
}

.feedback-admin-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.feedback-admin-item header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.feedback-admin-item header div {
  display: grid;
  gap: 2px;
}

.feedback-admin-item p {
  margin: 0;
  white-space: pre-wrap;
}

.feedback-admin-item time {
  color: #667382;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .brand-content,
  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-hero-inner {
    grid-template-columns: 1fr;
  }

  .brand-content {
    padding: 20px 0;
  }

  .logo-name {
    font-size: 2.5rem;
  }

  .logo-tagline {
    font-size: .74rem;
  }

  .header-search {
    width: 100%;
  }

  .header-search input {
    min-width: 0;
    width: 100%;
  }

  .learning-layout {
    grid-template-columns: 1fr;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-page {
    grid-template-columns: 1fr;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-link {
    position: static;
  }

  .builder-layout {
    grid-template-columns: 1fr;
  }

  .widget-tree {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell,
  .category-hero-inner,
  .learning-layout {
    width: min(100% - 20px, 1220px);
  }

  .brand-content {
    min-height: 0;
  }

  .logo-name {
    font-size: 2rem;
  }

  .logo-tagline {
    font-size: .62rem;
    letter-spacing: .14em;
  }

  .home-main {
    padding-top: 20px;
  }

  .section-heading h1 {
    font-size: 1.35rem;
  }

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

  .topic-card {
    min-height: 0;
  }

  .lesson-content {
    padding: 20px 16px;
  }

  .category-badge {
    width: 96px;
    height: 96px;
    font-size: 2rem;
  }

  .admin-page {
    width: min(100% - 20px, 1320px);
  }

  .admin-content {
    padding: 16px;
    overflow-x: auto;
  }

  .admin-title,
  .form-actions,
  .table-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stat-grid,
  .form-grid,
  .editor-mode-grid,
  .visual-editor-grid {
    grid-template-columns: 1fr;
  }
}
