:root {
  --admin-brand: #5c70e8;
  --admin-brand-dark: #4056d6;
  --admin-brand-soft: #edf0ff;
  --admin-ink: #18213b;
  --admin-muted: #6d7890;
  --admin-line: #e5e9f2;
  --admin-page: #f4f6fb;
  --admin-card: #fff;
  --admin-danger: #db3c48;
  --admin-success: #27864f;
  --admin-warning: #bc6a00;
  --admin-radius: 14px;
  --admin-shadow: 0 12px 35px rgba(28, 42, 83, .08);
  --site-font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --site-font-heading: var(--site-font-body);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body, button, input, textarea, select { font: inherit; }
body { margin: 0; color: var(--admin-ink); font-family: var(--site-font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-family: var(--site-font-heading); }
a { color: inherit; text-decoration: none; }
button { border: 0; }

.admin-body { background: var(--admin-page); }
.admin-shell { min-height: 100vh; display: flex; }
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: 264px;
  padding: 22px 17px 18px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,.15), transparent 31%),
    linear-gradient(160deg, #6175ec 0%, #4e63df 52%, #3d50c9 100%);
  box-shadow: 12px 0 38px rgba(28, 42, 83, .12);
  overflow-y: auto;
}
.admin-brand { min-height: 58px; padding: 7px 9px; display: flex; align-items: center; gap: 12px; border-radius: 12px; }
.admin-brand-mark { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; color: var(--admin-brand-dark); background: #fff; border-radius: 12px; font-weight: 850; font-size: 21px; box-shadow: 0 8px 20px rgba(20,32,100,.2); }
.admin-brand strong { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.admin-brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.68); font-size: 11px; }
.admin-nav { margin-top: 28px; display: grid; gap: 6px; }
.admin-nav a { min-height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 12px; border-radius: 11px; color: rgba(255,255,255,.76); font-size: 14px; font-weight: 650; transition: .18s ease; }
.admin-nav a span { width: 22px; text-align: center; font-size: 18px; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(255,255,255,.15); transform: translateX(2px); }
.admin-sidebar-foot { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }
.view-site-link, .logout-button { width: 100%; min-height: 42px; padding: 0 13px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.view-site-link { color: #fff; background: rgba(255,255,255,.13); }
.logout-button { color: rgba(255,255,255,.8); background: rgba(17,25,91,.22); }

.admin-main { width: calc(100% - 264px); min-height: 100vh; margin-left: 264px; }
.admin-topbar { min-height: 100px; padding: 22px clamp(22px, 3vw, 42px); display: flex; align-items: center; gap: 18px; background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(223,228,239,.85); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 50; }
.admin-topbar > div:nth-child(2) { min-width: 0; }
.admin-topbar h1 { margin: 2px 0 0; font-size: clamp(23px, 2.3vw, 31px); line-height: 1.15; letter-spacing: -.025em; }
.admin-eyebrow { margin: 0; color: var(--admin-brand); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .16em; }
.admin-menu-button { display: none; width: 42px; height: 42px; flex: 0 0 auto; color: var(--admin-brand-dark); background: var(--admin-brand-soft); border-radius: 10px; cursor: pointer; }
.admin-user-chip { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--admin-muted); font-size: 13px; white-space: nowrap; }
.admin-user-chip span { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#7a53d9,#5b70e8); border-radius: 50%; font-weight: 800; }
.admin-content { max-width: 1520px; margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 60px; }

.admin-alert { margin-bottom: 18px; padding: 13px 16px; border: 1px solid; border-radius: 11px; font-size: 14px; transition: opacity .35s, transform .35s; }
.admin-alert.success { color: #1f7444; background: #edf9f2; border-color: #9cd8b8; }
.admin-alert.error { color: #a42b37; background: #fff0f2; border-color: #f2a4ac; }
.admin-alert.info { color: #315bad; background: #eef4ff; border-color: #b3c9f4; }
.admin-alert.hiding { opacity: 0; transform: translateY(-8px); }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.stat-card { min-height: 128px; padding: 21px; background: #fff; border: 1px solid #edf0f5; border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -22px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--stat-soft,#eef1ff); }
.stat-card small { color: var(--admin-muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 10px; font-size: 32px; line-height: 1; }
.stat-card span { display: block; margin-top: 10px; color: var(--admin-muted); font-size: 12px; }

.admin-section { margin-top: 28px; }
.section-head { margin-bottom: 14px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 4px 0 0; color: var(--admin-muted); font-size: 13px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.tutorial-admin-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 17px; }
.tutorial-admin-card { background: #fff; border: 1px solid #e9edf4; border-radius: var(--admin-radius); overflow: hidden; box-shadow: var(--admin-shadow); transition: transform .2s, box-shadow .2s; }
.tutorial-admin-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(28,42,83,.12); }
.tutorial-card-banner { min-height: 116px; padding: 24px; color: #fff; background: linear-gradient(125deg,var(--card-start),var(--card-end)); position: relative; overflow: hidden; }
.tutorial-card-banner h3 { margin: 0 0 7px; font-size: 28px; }
.tutorial-card-banner p { margin: 0; max-width: 76%; font-size: 13px; opacity: .9; }
.tutorial-card-banner .card-icon { position: absolute; right: 15px; top: 50%; width: 82px; height: 82px; transform: translateY(-50%); opacity: .19; }
.tutorial-card-banner svg { width: 100%; height: 100%; }
.tutorial-card-body { padding: 17px 18px 18px; }
.tutorial-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--admin-muted); font-size: 11px; }
.status-pill { display: inline-flex; min-height: 24px; padding: 0 9px; align-items: center; border-radius: 999px; font-weight: 750; }
.status-pill.published { color: #247a48; background: #e9f8ef; }
.status-pill.draft { color: #9c6410; background: #fff3dc; }
.tutorial-card-actions { margin-top: 16px; display: flex; gap: 8px; }

.admin-card { padding: clamp(20px, 2.6vw, 30px); background: #fff; border: 1px solid #e9edf4; border-radius: var(--admin-radius); box-shadow: var(--admin-shadow); }
.admin-card + .admin-card { margin-top: 18px; }
.admin-card-title { margin: 0 0 4px; font-size: 19px; }
.admin-card-subtitle { margin: 0 0 22px; color: var(--admin-muted); font-size: 13px; line-height: 1.7; }

.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1/-1; }
.form-field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 720; }
.form-field .help { margin: 7px 0 0; color: var(--admin-muted); font-size: 11px; line-height: 1.55; }
.form-control, .form-select, .form-textarea { width: 100%; color: var(--admin-ink); background: #fbfcfe; border: 1px solid #dfe4ee; border-radius: 10px; outline: none; transition: border .18s, box-shadow .18s, background .18s; }
.form-control, .form-select { height: 44px; padding: 0 13px; }
.form-textarea { min-height: 118px; padding: 11px 13px; line-height: 1.7; resize: vertical; }
.form-control:focus, .form-select:focus, .form-textarea:focus { background: #fff; border-color: #8293ed; box-shadow: 0 0 0 4px rgba(92,112,232,.12); }
.color-pair { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.color-pair input[type="color"] { width: 52px; height: 44px; padding: 4px; background: #fff; border: 1px solid #dfe4ee; border-radius: 10px; cursor: pointer; }
.toggle-row { min-height: 44px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: #fbfcfe; border: 1px solid #dfe4ee; border-radius: 10px; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--admin-brand); }
.form-footer { margin-top: 24px; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--admin-line); }

.button { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; font-size: 13px; font-weight: 750; cursor: pointer; transition: transform .16s, filter .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); filter: brightness(1.02); }
.button.primary { color: #fff; background: linear-gradient(135deg,#6679ed,#4b61df); box-shadow: 0 8px 18px rgba(75,97,223,.2); }
.button.secondary { color: var(--admin-brand-dark); background: var(--admin-brand-soft); }
.button.ghost { color: var(--admin-muted); background: #f5f7fb; border: 1px solid #e2e6ee; }
.button.danger { color: #b12836; background: #fff0f2; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.button.icon-only { width: 34px; padding: 0; }

.quick-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.quick-card { min-height: 96px; padding: 17px; display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e9edf4; border-radius: 13px; box-shadow: var(--admin-shadow); }
.quick-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--admin-brand-dark); background: var(--admin-brand-soft); border-radius: 12px; font-size: 20px; }
.quick-card strong { display: block; font-size: 14px; }
.quick-card small { display: block; margin-top: 4px; color: var(--admin-muted); font-size: 11px; line-height: 1.5; }

/* Tutorial block editor */
.editor-intro { margin-bottom: 18px; padding: 14px 16px; color: #46536b; background: #f5f7ff; border: 1px solid #dfe4ff; border-radius: 11px; font-size: 13px; line-height: 1.7; }
.editor-toolbar { position: sticky; top: 99px; z-index: 30; margin-bottom: 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; background: rgba(255,255,255,.92); border: 1px solid #e2e6ef; border-radius: 12px; box-shadow: 0 8px 25px rgba(28,42,83,.08); backdrop-filter: blur(10px); }
.editor-canvas { display: grid; gap: 13px; }
.editor-block { background: #fff; border: 1px solid #dde3ed; border-radius: 13px; overflow: hidden; box-shadow: 0 6px 18px rgba(28,42,83,.05); }
.editor-block-head { min-height: 48px; padding: 9px 11px 9px 15px; display: flex; align-items: center; gap: 10px; background: #f7f8fc; border-bottom: 1px solid #e7eaf1; }
.editor-block-badge { min-width: 78px; color: var(--admin-brand-dark); font-size: 12px; font-weight: 800; }
.editor-block-summary { min-width: 0; flex: 1; color: var(--admin-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-move { display: flex; gap: 4px; }
.editor-mini-button { width: 30px; height: 30px; display: grid; place-items: center; color: #68758d; background: #fff; border: 1px solid #e0e4ec; border-radius: 7px; cursor: pointer; }
.editor-mini-button:hover { color: var(--admin-brand-dark); border-color: #bcc6f2; }
.editor-mini-button.delete:hover { color: var(--admin-danger); border-color: #f1b0b7; }
.editor-block-body { padding: 16px; }
.editor-step-number { max-width: 160px; }
.editor-items { margin-top: 14px; display: grid; gap: 10px; }
.editor-item { padding: 13px; background: #fafbfe; border: 1px solid #e5e9f1; border-radius: 10px; }
.editor-item-head { margin-bottom: 11px; display: flex; align-items: center; gap: 8px; }
.editor-item-head select { width: auto; min-width: 132px; height: 34px; padding: 0 9px; }
.editor-item-head .item-spacer { flex: 1; }
.item-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.item-fields .full { grid-column: 1/-1; }
.item-fields .form-control, .item-fields .form-select { height: 39px; font-size: 12px; }
.item-fields .form-textarea { min-height: 96px; font-size: 12px; }
.add-item-row { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.editor-empty { padding: 35px 20px; color: var(--admin-muted); background: #fff; border: 1px dashed #cfd6e4; border-radius: 12px; text-align: center; font-size: 13px; }
.editor-savebar { position: sticky; bottom: 15px; z-index: 35; margin-top: 18px; padding: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; background: rgba(255,255,255,.94); border: 1px solid #e0e5ef; border-radius: 13px; box-shadow: 0 13px 35px rgba(28,42,83,.13); backdrop-filter: blur(12px); }
.upload-inline { display: flex; gap: 7px; align-items: center; }
.upload-inline input[type="file"] { max-width: 220px; font-size: 11px; }
.upload-status { color: var(--admin-muted); font-size: 11px; }

.media-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; }
.media-card { background: #fff; border: 1px solid #e5e9f1; border-radius: 12px; overflow: hidden; }
.media-thumb { aspect-ratio: 4/3; background: #eef1f6; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-body { padding: 11px; }
.media-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.media-meta { margin-top: 4px; color: var(--admin-muted); font-size: 10px; }
.media-actions { margin-top: 10px; display: flex; gap: 6px; }
.upload-drop { padding: 28px; border: 2px dashed #cdd5e8; border-radius: 13px; text-align: center; background: #f9faff; }
.upload-drop input { max-width: 100%; }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
.admin-table th { color: var(--admin-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.admin-table td:last-child, .admin-table th:last-child { text-align: right; }

.auth-body { min-height: 100vh; background: #f4f6fb; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px,1.05fr) minmax(420px,.95fr); }
.auth-visual { min-height: 100vh; padding: clamp(30px,5vw,72px); color: #fff; background: linear-gradient(145deg,#687bed 0%,#5368df 52%,#3c4fc5 100%); position: relative; overflow: hidden; }
.auth-brand { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.auth-brand span { width: 39px; height: 39px; display: grid; place-items: center; color: var(--admin-brand-dark); background: #fff; border-radius: 12px; font-size: 20px; }
.auth-copy { position: relative; z-index: 2; max-width: 670px; margin-top: min(22vh,180px); }
.auth-copy .admin-eyebrow { color: rgba(255,255,255,.68); }
.auth-copy h1 { margin: 18px 0 17px; font-size: clamp(38px,4.2vw,68px); line-height: 1.11; letter-spacing: -.045em; }
.auth-copy > p:last-child { max-width: 580px; color: rgba(255,255,255,.74); font-size: 15px; line-height: 1.9; }
.auth-orb { position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.orb-one { width: 360px; height: 360px; right: -110px; top: -95px; }
.orb-two { width: 520px; height: 520px; left: -230px; bottom: -300px; }
.auth-panel { padding: 40px clamp(28px,6vw,90px); display: grid; place-items: center; }
.auth-card { width: min(100%,480px); }
.auth-card h2 { margin: 0 0 8px; font-size: 30px; }
.auth-card > p { margin: 0 0 28px; color: var(--admin-muted); font-size: 14px; line-height: 1.7; }
.auth-card .form-field + .form-field { margin-top: 16px; }
.auth-submit { width: 100%; margin-top: 22px; }
.auth-foot { margin-top: 20px; color: var(--admin-muted); font-size: 12px; text-align: center; }
.auth-error { margin-bottom: 18px; padding: 12px 14px; color: #a12d39; background: #fff0f2; border: 1px solid #f2abb2; border-radius: 10px; font-size: 13px; }
.password-note { margin-top: 10px; padding: 11px 13px; color: #6b5528; background: #fff8e9; border-radius: 9px; font-size: 11px; line-height: 1.6; }

.admin-sidebar-overlay { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tutorial-admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-105%); transition: transform .24s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar-overlay { position: fixed; inset: 0; z-index: 70; display: block; visibility: hidden; opacity: 0; background: rgba(20,27,50,.42); transition: .22s; }
  .admin-sidebar-overlay.open { visibility: visible; opacity: 1; }
  .admin-main { width: 100%; margin-left: 0; }
  .admin-menu-button { display: grid; place-items: center; }
  .editor-toolbar { top: 99px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 330px; padding: 32px; }
  .auth-copy { margin-top: 70px; }
  .auth-copy h1 { font-size: 38px; }
  .auth-panel { min-height: 500px; padding: 48px 24px; }
  .media-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .admin-topbar { min-height: 84px; padding: 16px; }
  .admin-topbar h1 { font-size: 22px; }
  .admin-user-chip strong, .admin-eyebrow { display: none; }
  .admin-content { padding: 20px 14px 42px; }
  .stats-grid, .tutorial-admin-grid, .quick-grid, .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .admin-card { padding: 18px 15px; border-radius: 12px; }
  .form-field.full { grid-column: auto; }
  .item-fields { grid-template-columns: 1fr; }
  .item-fields .full { grid-column: auto; }
  .editor-toolbar { top: 83px; }
  .editor-block-head { flex-wrap: wrap; }
  .editor-block-summary { order: 3; width: 100%; flex-basis: 100%; }
  .editor-savebar { bottom: 8px; justify-content: stretch; }
  .editor-savebar .button { flex: 1; }
  .media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-visual { min-height: 285px; }
  .auth-copy { margin-top: 48px; }
  .auth-copy h1 { font-size: 30px; }
  .auth-copy > p:last-child { font-size: 13px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .tutorial-card-actions { flex-direction: column; }
}

/* Rich media library */
.rich-upload { text-align: left; }
.upload-form-row {
  display: grid;
  grid-template-columns: minmax(170px,.55fr) minmax(260px,1.45fr) auto;
  gap: 13px;
  align-items: end;
}
.upload-kind-field,
.upload-file-field { display: grid; gap: 7px; }
.upload-kind-field > span,
.upload-file-field > span { font-size: 12px; font-weight: 750; }
.upload-file-field .form-control { padding: 7px 10px; }
.upload-limit-note { margin: 13px 0 0; color: var(--admin-muted); font-size: 11px; line-height: 1.65; }
.media-filters { margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 8px; }
.media-filters a {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--admin-muted);
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.media-filters a span {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  color: #75819a;
  background: #f1f3f8;
  border-radius: 999px;
  font-size: 10px;
}
.media-filters a.active { color: #fff; background: var(--admin-brand); border-color: var(--admin-brand); }
.media-filters a.active span { color: var(--admin-brand-dark); background: #fff; }
.media-thumb { position: relative; display: grid; place-items: center; }
.media-thumb video { width: 100%; height: 100%; object-fit: contain; display: block; background: #171a22; }
.media-thumb-audio { padding: 14px 10px 10px; grid-template-rows: 1fr auto; gap: 8px; }
.media-thumb-audio audio { width: 100%; height: 32px; }
.media-file-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--admin-brand-dark);
  background: #fff;
  border: 1px solid #e0e5f0;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(28,42,83,.08);
  font-size: 30px;
  font-weight: 850;
}
.media-file-icon small { display: block; margin-top: -18px; font-size: 9px; letter-spacing: .08em; }
.media-type-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  min-height: 23px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: rgba(24,33,59,.72);
  border-radius: 999px;
  backdrop-filter: blur(7px);
  font-size: 9px;
  font-weight: 800;
}
.media-actions form { margin: 0; }

@media (max-width: 760px) {
  .upload-form-row { grid-template-columns: 1fr; }
  .upload-form-row .button { width: 100%; }
  .upload-inline { align-items: stretch; flex-direction: column; }
  .upload-inline input[type="file"] { max-width: 100%; }
}

/* Typography settings */
.settings-divider {
  margin-top: 32px;
  padding-top: 30px;
  border-top: 1px solid var(--admin-line);
}
.settings-section-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.settings-section-heading .admin-card-subtitle { margin-bottom: 0; }
.feature-pill {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--admin-brand-dark);
  background: var(--admin-brand-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.font-preview {
  --site-font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --site-font-heading: var(--site-font-body);
  position: relative;
  margin-top: 20px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  color: #19233f;
  background:
    radial-gradient(circle at 92% 8%, rgba(103,121,237,.16), transparent 28%),
    linear-gradient(135deg, #f8f9ff, #f2f5ff);
  border: 1px solid #dce2ff;
  border-radius: 16px;
}
.font-preview::after {
  content: "Aa";
  position: absolute;
  right: 22px;
  bottom: -25px;
  color: rgba(78,96,205,.07);
  font-family: var(--site-font-heading);
  font-size: 128px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}
.font-preview-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 25px;
  padding: 0 9px;
  align-items: center;
  color: #4f62cf;
  background: #fff;
  border: 1px solid #dce2ff;
  border-radius: 999px;
  font-family: var(--site-font-body);
  font-size: 10px;
  font-weight: 800;
}
.font-preview h3 {
  position: relative;
  z-index: 1;
  margin: 20px 0 10px;
  max-width: 820px;
  font-family: var(--site-font-heading);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.25;
  letter-spacing: -.025em;
}
.font-preview p {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0;
  color: #64708a;
  font-family: var(--site-font-body);
  font-size: 14px;
  line-height: 1.8;
}
.font-preview-ui {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  font-family: var(--site-font-body);
}
.font-preview-ui span,
.font-preview-ui code {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #dfe4f5;
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(49,65,137,.06);
  font-size: 11px;
}
.font-preview-ui span:first-child { color: #fff; background: #5269df; border-color: #5269df; font-weight: 760; }
.font-preview-ui code { color: #3f4a62; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.custom-font-panel {
  margin-top: 18px;
  padding: 20px;
  background: #fbfcff;
  border: 1px solid #e2e6f0;
  border-radius: 14px;
}
.custom-font-copy { margin-bottom: 17px; }
.custom-font-copy h3 { margin: 0 0 5px; font-size: 15px; }
.custom-font-copy p { margin: 0; color: var(--admin-muted); font-size: 11px; line-height: 1.65; }
.file-control { padding: 7px 10px; }
.current-font-file {
  margin-top: 15px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f2fbf6;
  border: 1px solid #ccebd9;
  border-radius: 11px;
}
.current-font-file > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 8px; }
.current-font-file .status-dot { width: 9px; height: 9px; grid-row: 1 / span 2; background: #31a664; border-radius: 50%; box-shadow: 0 0 0 4px rgba(49,166,100,.12); }
.current-font-file strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.current-font-file small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--admin-muted); font-size: 10px; }
.current-font-file .toggle-row { min-height: 36px; flex: 0 0 auto; font-size: 11px; }
.danger-toggle { color: #a02e3a; background: #fff; border-color: #efcbd0; }
.font-upload-empty,
.font-license-note { margin: 13px 0 0; color: var(--admin-muted); font-size: 10px; line-height: 1.65; }
.font-upload-empty { padding: 11px 13px; background: #f5f7fb; border-radius: 9px; }
.font-license-note { color: #8a6c39; }
.apply-admin-font { margin-top: 15px; font-size: 12px; font-weight: 700; }

@media (max-width: 680px) {
  .settings-section-heading,
  .current-font-file { align-items: stretch; flex-direction: column; }
  .current-font-file .toggle-row { width: 100%; }
  .font-preview { padding: 22px 18px; }
  .font-preview::after { right: 5px; font-size: 96px; }
}

/* Help articles and knowledge base */
.article-stats { margin-bottom: 4px; }
.admin-searchbar {
  margin-bottom: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 9px;
  background: #fff;
  border: 1px solid #e5e9f2;
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(28,42,83,.055);
}
.admin-empty-state {
  min-height: 300px;
  padding: 38px 22px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  background: #fff;
  border: 1px dashed #cfd6e4;
  border-radius: var(--admin-radius);
}
.admin-empty-state.compact { min-height: 220px; }
.admin-empty-state > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--admin-brand-dark);
  background: var(--admin-brand-soft);
  border-radius: 18px;
  font-size: 25px;
  font-weight: 850;
}
.admin-empty-state h3 { margin: 16px 0 7px; font-size: 19px; }
.admin-empty-state p { max-width: 520px; margin: 0 0 18px; color: var(--admin-muted); font-size: 13px; line-height: 1.7; }

.article-admin-list { display: grid; gap: 13px; }
.article-admin-card {
  min-width: 0;
  padding: 13px;
  display: grid;
  grid-template-columns: 154px minmax(0,1fr) auto;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(28,42,83,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.article-admin-card:hover { transform: translateY(-2px); box-shadow: 0 15px 34px rgba(28,42,83,.1); }
.article-admin-cover {
  width: 154px;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--admin-brand-dark);
  background:
    radial-gradient(circle at 82% 20%, rgba(92,112,232,.18), transparent 28%),
    linear-gradient(135deg,#f6f7ff,#edf1ff);
  border: 1px solid #e1e5f6;
  border-radius: 11px;
}
.article-admin-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-admin-cover span { font-size: 28px; font-weight: 850; }
.article-admin-main { min-width: 0; }
.article-admin-kicker { display: flex; flex-wrap: wrap; gap: 7px; }
.article-admin-kicker span {
  min-height: 23px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  color: #536079;
  background: #f2f4f8;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 780;
}
.article-admin-kicker span.featured { color: #8b5b00; background: #fff2d8; }
.article-admin-main h3 { margin: 8px 0 5px; overflow-wrap: anywhere; font-size: 17px; line-height: 1.35; }
.article-admin-main h3 a:hover { color: var(--admin-brand-dark); }
.article-admin-main > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 11px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.article-admin-meta { gap: 6px; }
.article-admin-actions {
  max-width: 190px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.article-admin-actions form { margin: 0; }

.article-editor-heading { margin-bottom: 22px; }
.article-cover-settings { margin-bottom: 2px; }
.article-cover-editor {
  display: grid;
  grid-template-columns: minmax(220px,.7fr) minmax(320px,1.3fr);
  gap: 22px;
  align-items: start;
}
.article-cover-preview {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #72809b;
  background: #f4f6fb;
  border: 1px dashed #ccd4e3;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 750;
}
.article-cover-preview:not(.empty) { border-style: solid; background: #edf0f5; }
.article-cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dashboard-article-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
}
.dashboard-article-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e7ebf2;
  border-radius: 14px;
  box-shadow: var(--admin-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.dashboard-article-card:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(28,42,83,.11); }
.dashboard-article-cover {
  aspect-ratio: 16 / 8.7;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--admin-brand-dark);
  background:
    radial-gradient(circle at 88% 12%, rgba(110,126,237,.23), transparent 28%),
    linear-gradient(135deg,#f7f8ff,#edf1ff);
}
.dashboard-article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dashboard-article-cover span { width: 46px; height: 46px; opacity: .82; }
.dashboard-article-cover svg { width: 100%; height: 100%; }
.dashboard-article-copy { padding: 15px; }
.dashboard-article-copy > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dashboard-article-copy > div span,
.dashboard-article-copy > div b {
  min-height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  color: #536079;
  background: #f2f4f8;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}
.dashboard-article-copy > div b { color: #8c5b00; background: #fff2d8; }
.dashboard-article-copy h3 {
  min-height: 44px;
  margin: 10px 0 6px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dashboard-article-copy p {
  min-height: 39px;
  margin: 0 0 12px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dashboard-article-copy small { display: flex; align-items: center; gap: 6px; color: #7b879e; font-size: 10px; }
.status-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
.status-dot.published { background: #32a666; box-shadow: 0 0 0 3px rgba(50,166,102,.12); }
.status-dot.draft { background: #d58b20; box-shadow: 0 0 0 3px rgba(213,139,32,.12); }
.dashboard-article-more { margin-top: 14px; display: flex; justify-content: center; }
.quick-grid { grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); }

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

@media (max-width: 960px) {
  .article-admin-card { grid-template-columns: 132px minmax(0,1fr); }
  .article-admin-cover { width: 132px; }
  .article-admin-actions { max-width: none; grid-column: 1 / -1; justify-content: flex-end; padding-top: 3px; }
  .article-cover-editor { grid-template-columns: 1fr; }
  .article-cover-preview { max-width: 520px; }
}

@media (max-width: 680px) {
  .admin-searchbar { grid-template-columns: 1fr; }
  .admin-searchbar .button { width: 100%; }
  .article-admin-card { grid-template-columns: 92px minmax(0,1fr); gap: 12px; align-items: start; }
  .article-admin-cover { width: 92px; }
  .article-admin-main h3 { margin-top: 7px; font-size: 15px; }
  .article-admin-main > p { display: none; }
  .article-admin-meta .status-pill:nth-last-child(-n+2) { display: none; }
  .article-admin-actions { justify-content: stretch; }
  .article-admin-actions > a,
  .article-admin-actions > form { flex: 1 1 calc(50% - 7px); }
  .article-admin-actions form .button { width: 100%; }
  .dashboard-article-grid { grid-template-columns: 1fr; }
  .dashboard-article-copy h3,
  .dashboard-article-copy p { min-height: 0; }
}

@media (max-width: 420px) {
  .article-admin-card { grid-template-columns: 1fr; }
  .article-admin-cover { width: 100%; }
  .article-admin-actions > a,
  .article-admin-actions > form { flex-basis: 100%; }
}
