:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #20242a;
  --muted: #6d747c;
  --line: #e8e2d7;
  --green: #1f6f68;
  --yellow: #f8d66d;
  --red: #b44439;
  --shadow: 0 22px 70px rgba(33, 36, 42, 0.1);
}

:root[data-theme="dark"] {
  --bg: #121416;
  --surface: #1b1f23;
  --ink: #f2f4f7;
  --muted: #aab2bd;
  --line: #30363d;
  --green: #5bc8b8;
  --yellow: #f2cf6b;
  --red: #ff8a7d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(232, 226, 215, 0.78);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .site-header {
  background: rgba(18, 20, 22, 0.9);
}

.brand,
.nav,
.hero-actions,
.card-top,
.tag-row,
.form-actions,
.row-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.nav {
  gap: 14px;
  color: var(--muted);
}

.theme-toggle,
.login-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.login-toggle {
  width: auto;
  max-width: 112px;
  padding: 0 10px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle:hover,
.login-toggle:hover {
  border-color: rgba(31, 111, 104, 0.36);
  color: var(--green);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 190px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] .button,
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .notice,
:root[data-theme="dark"] .stats div,
:root[data-theme="dark"] .resource-card,
:root[data-theme="dark"] .admin-item,
:root[data-theme="dark"] .login-panel,
:root[data-theme="dark"] .editor,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .nav-edit-card,
:root[data-theme="dark"] .admin-sidebar,
:root[data-theme="dark"] .category-picker,
:root[data-theme="dark"] .rich-toolbar,
:root[data-theme="dark"] .rich-editor {
  background: var(--surface);
}

:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .page-button,
:root[data-theme="dark"] dialog,
:root[data-theme="dark"] .detail-empty,
:root[data-theme="dark"] .subnav-row > span,
:root[data-theme="dark"] .hero-slide-caption,
:root[data-theme="dark"] .carousel-arrow {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .tag-row span,
:root[data-theme="dark"] .check-pill span,
:root[data-theme="dark"] .subnav-row {
  background: #22272e;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(31, 111, 104, 0.08);
  color: var(--green);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: 58px clamp(20px, 5vw, 72px) 44px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 22px;
  font-size: 56px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.28;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.hero-text {
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

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

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: rgba(180, 68, 57, 0.22);
  background: rgba(180, 68, 57, 0.08);
  color: var(--red);
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 440px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-carousel {
  position: relative;
}

.hero-slide {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-slide img {
  border-radius: 8px;
  box-shadow: none;
  transition: transform 0.32s ease;
}

.hero-slide:hover img {
  transform: scale(1.025);
}

.hero-slide-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(32, 36, 42, 0.12);
}

.hero-slide-caption strong {
  font-size: 18px;
  line-height: 1.35;
}

.hero-slide-caption small {
  color: var(--green);
  font-weight: 800;
}

.hero-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.hero-carousel-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 111, 104, 0.28);
  cursor: pointer;
}

.hero-carousel-dots button.active {
  width: 24px;
  background: var(--green);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(32, 36, 42, 0.14);
  cursor: pointer;
  transform: translateY(-50%);
}

.carousel-arrow:hover {
  background: #fff;
  color: var(--green);
}

.carousel-arrow.prev {
  left: 14px;
}

.carousel-arrow.next {
  right: 14px;
}

.toolbar,
.layout,
.footer {
  padding-inline: clamp(20px, 5vw, 72px);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  padding-bottom: 22px;
}

.search {
  display: grid;
  gap: 8px;
  min-width: min(420px, 100%);
  color: var(--muted);
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

input {
  height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 14px;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.12);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 26px;
  padding-bottom: 58px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.notice {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notice p {
  color: var(--muted);
  line-height: 1.7;
}

.notice a,
.text-action {
  color: var(--green);
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stats div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

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

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

.resource-card,
.admin-item,
.login-panel,
.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.resource-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-content: start;
  min-height: 190px;
  padding: 22px;
}

.resource-cover-link {
  display: block;
  align-self: start;
}

.resource-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}

.resource-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.resource-title {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.resource-summary {
  color: var(--muted);
  line-height: 1.75;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.resource-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 13px;
}

.detail-meta {
  margin: -8px 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.admin-meta {
  margin: 4px 0 8px;
}

.resource-card p,
.admin-item p {
  color: var(--muted);
  line-height: 1.75;
}

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

.category,
.badge,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.category {
  background: rgba(31, 111, 104, 0.1);
  color: var(--green);
}

.badge {
  background: rgba(248, 214, 109, 0.45);
}

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

.tag-row span {
  background: #f3f0e9;
  color: var(--muted);
}

.text-action {
  align-self: end;
  justify-self: start;
}

.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.page-button {
  min-width: 42px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.page-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

dialog {
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.login-dialog {
  width: min(420px, calc(100vw - 28px));
}

.login-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 28px;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.login-card .button {
  width: 100%;
}

dialog::backdrop {
  background: rgba(32, 36, 42, 0.38);
}

.detail {
  position: relative;
  padding: 30px;
}

.detail-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}

.detail-page {
  width: min(960px, calc(100% - 40px));
  margin: 44px auto 80px;
}

.detail-article {
  width: min(840px, 100%);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
}

.detail-page-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.detail-page-content {
  padding-top: 6px;
}

.detail-page-content p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.detail-summary {
  color: var(--ink);
}

.rich-content {
  font-size: 17px;
  line-height: 1.95;
}

.rich-content h2 {
  margin: 30px 0 12px;
  font-size: 26px;
}

.rich-content p,
.rich-content li {
  color: var(--muted);
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content figure {
  margin: 0 0 18px;
}

.rich-content ul,
.rich-content ol {
  padding-left: 1.35em;
}

.rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.rich-content figcaption {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.detail-image-gallery {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.detail-image-gallery img {
  display: block;
  width: 100%;
  max-height: 680px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.detail-empty {
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail p {
  color: var(--muted);
  line-height: 1.8;
}

.icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 24px 34px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.admin-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 42px auto 70px;
}

.login-panel {
  max-width: 460px;
  margin: 0 auto;
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-panel label,
.editor label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.login-panel .button {
  width: 100%;
  margin-top: 16px;
}

.form-hint {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--red);
}

.hidden {
  display: none !important;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-workbench {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.admin-tab.active,
.admin-tab:hover {
  background: rgba(31, 111, 104, 0.1);
  color: var(--green);
  font-weight: 800;
}

.admin-panel {
  display: none;
}

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

.settings-panel,
.nav-edit-card {
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.panel-note {
  color: var(--muted);
  line-height: 1.7;
}

.nav-editor,
.nav-editor-grid,
.hero-settings-grid {
  display: grid;
  gap: 14px;
}

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

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

.nav-editor-grid,
.nav-editor .full,
.hero-settings-grid .full {
  grid-column: 1 / -1;
}

.site-subsection {
  padding-top: 6px;
}

.nav-edit-row {
  display: grid;
  grid-template-columns: 34px repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.nav-edit-row > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(31, 111, 104, 0.1);
  color: var(--green);
  font-weight: 800;
}

.nav-row-actions,
.subnav-actions {
  align-self: end;
  flex-wrap: nowrap;
}

.subnav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.subnav-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.subnav-row {
  display: grid;
  grid-template-columns: 34px minmax(120px, 0.7fr) minmax(140px, 0.8fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
}

.about-subnav-row {
  grid-template-columns: 34px minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.footer-link-row {
  grid-template-columns: 34px minmax(140px, 0.8fr) minmax(180px, 1fr) auto;
}

.subnav-row > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  margin-bottom: 22px;
}

.editor .full {
  grid-column: 1 / -1;
}

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

.admin-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
}

.admin-thumb {
  width: 150px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}

.row-actions {
  gap: 10px;
}

.cover-upload span {
  color: var(--muted);
  font-size: 13px;
}

.logo-upload {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.logo-upload span {
  color: var(--muted);
  font-size: 13px;
}

.logo-preview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  overflow: hidden;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#coverPreview {
  display: none;
  width: min(360px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}

#coverPreview.visible {
  display: block;
}

#summaryInput,
#richImageInput {
  display: none;
}

.field-label {
  margin-bottom: 8px;
  color: var(--muted);
}

.rich-field {
  display: block;
}

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

.rich-toolbar button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.rich-toolbar button:hover {
  border-color: rgba(31, 111, 104, 0.32);
  color: var(--green);
}

.rich-editor {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.85;
  outline: 0;
}

.rich-editor:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.12);
}

.rich-editor.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 68, 57, 0.12);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #9aa0a6;
}

.rich-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.rich-editor figure {
  margin: 18px 0;
}

.rich-editor figcaption {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-pill {
  display: inline-flex !important;
  align-items: center;
  gap: 6px !important;
  color: var(--muted);
  cursor: pointer;
}

.check-pill input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.check-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f0e9;
  font-size: 12px;
  font-weight: 800;
}

.check-pill input:checked + span {
  background: rgba(31, 111, 104, 0.12);
  color: var(--green);
}

.form-hint.inline {
  margin: 0;
}

.detail-image-upload span {
  color: var(--muted);
  font-size: 13px;
}

.detail-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.detail-image-chip {
  position: relative;
}

.detail-image-chip img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg);
}

.detail-image-chip .icon-button {
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
}

@media (max-width: 980px) {
  .hero,
  .layout,
  .detail-hero,
  .admin-workbench {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .admin-sidebar {
    position: static;
  }

  .admin-sidebar {
    display: flex;
    overflow-x: auto;
  }

  .admin-tab {
    flex: 0 0 auto;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .site-header,
  .toolbar,
  .dashboard-head,
  .section-head,
  .footer,
  .admin-item {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    gap: 14px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .dropdown-menu {
    left: 0;
    right: auto;
  }

  .hero {
    padding-top: 34px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.18;
  }

  h2 {
    font-size: 24px;
  }

  .toolbar {
    display: grid;
  }

  .stats,
  .resource-grid,
  .resource-card,
  .editor,
  .nav-editor,
  .hero-settings-grid,
  .nav-edit-row,
  .subnav-row {
    grid-template-columns: 1fr;
  }

  .hero-media {
    display: block;
    margin-top: 8px;
  }

  .hero-media img {
    aspect-ratio: 4 / 3;
    max-height: 320px;
  }

  .hero-slide-caption {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px;
  }

  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 26px;
  }

  .hero-text,
  .detail-page-content p,
  .rich-content {
    font-size: 16px;
    line-height: 1.85;
  }

  .detail-page {
    width: min(100% - 28px, 960px);
    margin-top: 28px;
  }

  .resource-card {
    padding: 16px;
  }

  .resource-cover {
    max-height: 180px;
  }

  .admin-shell {
    width: min(100% - 24px, 1280px);
    margin-top: 24px;
  }

  .editor,
  .settings-panel,
  .nav-edit-card {
    padding: 16px;
  }

  .rich-toolbar {
    gap: 6px;
  }

  .rich-toolbar button {
    min-height: 36px;
    padding: 0 10px;
  }

  .row-actions {
    flex-wrap: wrap;
  }
}
