:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f0f3f7;
  --text: #101828;
  --muted: #667085;
  --line: #d7dce3;
  --primary: #1769ff;
  --primary-strong: #0f56d9;
  --green: #13834e;
  --cyan: #19bdd6;
  --yellow: #ffc61a;
  --ink: #1c2b39;
  --danger: #d92d20;
  --warning: #b7791f;
  --radius: 8px;
  --shadow: 0 10px 26px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(215, 220, 227, 0.88);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.site-header__inner,
.site-footer__inner,
.page-wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand-name {
  display: block;
  font-size: 18px;
}

.brand-sub {
  display: block;
  margin-top: -3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav a {
  border-radius: var(--radius);
  padding: 8px 11px;
  color: #344054;
  font-size: 14px;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--primary);
  background: #edf4ff;
}

.nav-user {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: var(--radius);
  border: 0;
  padding: 7px 10px;
  color: #125e3c;
  background: #dff8ec;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.nav-user::-webkit-details-marker {
  display: none;
}

.nav-user::after {
  content: "v";
  margin-left: 7px;
  color: #0f6b40;
  font-size: 12px;
}

.user-menu {
  position: relative;
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.user-menu__panel a {
  border-radius: 0;
  padding: 10px 12px;
}

.user-menu__panel a:hover {
  background: #edf4ff;
}

.user-menu__meta {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  color: #344054;
  font-size: 13px;
}

.user-menu__meta span {
  color: var(--muted);
  font-size: 12px;
}

.hero {
  min-height: 390px;
  display: grid;
  align-items: end;
  color: #fff;
  background:
    linear-gradient(rgba(7, 15, 22, 0.42), rgba(7, 15, 22, 0.68)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80")
      center/cover;
}

.hero__content {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 82px 0 54px;
}

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

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

.hero-actions,
.row-actions,
.form-actions,
.toolbar,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin-top: 26px;
}

.section {
  padding: 44px 0;
}

.section--tight {
  padding-top: 24px;
}

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

.section-head h2,
.section-head h1 {
  margin: 0;
  line-height: 1.18;
}

.section-head p {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.article-card,
.feature-item,
.info-panel,
.admin-panel,
.login-box,
.table-card {
  border: 1px solid rgba(215, 220, 227, 0.82);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-card {
  overflow: hidden;
}

.article-card__image {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--surface-soft);
}

.article-card__body {
  padding: 18px;
}

.article-card h3 {
  margin: 8px 0;
  line-height: 1.25;
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.tag,
.status-pill,
.filter-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: var(--radius);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  color: #125e3c;
  background: #dff8ec;
}

.filter-pill {
  border: 1px solid var(--line);
  color: #344054;
  background: #fff;
}

.filter-pill.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: #edf4ff;
}

.status-pill {
  color: #344054;
  background: #eef2f6;
}

.status-pill--published,
.status-pill--approved {
  color: #0f6b40;
  background: #dff8ec;
}

.status-pill--draft,
.status-pill--pending {
  color: #9a6700;
  background: #fff4cf;
}

.status-pill--offline,
.status-pill--rejected,
.status-pill--deleted {
  color: #b42318;
  background: #ffe9e6;
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 14px;
  color: #fff;
  background: var(--ink);
  font-weight: 700;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn-primary {
  background: var(--primary);
}

.btn-green {
  background: var(--green);
}

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

.btn-muted {
  color: #344054;
  border-color: #9aa4b2;
  background: #fff;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

.feature-item,
.info-panel {
  padding: 20px;
}

.feature-item h3,
.info-panel h3 {
  margin: 0 0 8px;
}

.feature-item p,
.info-panel p {
  margin: 0;
  color: var(--muted);
}

.article-hero {
  position: relative;
  display: grid;
  min-height: 360px;
  align-items: end;
  color: #fff;
  overflow: hidden;
  background: #111827;
}

.article-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.article-hero__inner {
  position: relative;
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 74px 0 44px;
}

.article-hero h1 {
  max-width: 860px;
  margin: 12px 0 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.05;
}

.article-body {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.article-body h2,
.article-body h3 {
  margin-top: 34px;
  line-height: 1.25;
}

.article-body p {
  color: #344054;
  font-size: 17px;
}

.article-body code {
  border-radius: 5px;
  padding: 2px 6px;
  background: #edf0f5;
}

.article-body pre {
  overflow-x: auto;
  border-radius: var(--radius);
  padding: 18px;
  color: #f8fafc;
  background: #111827;
}

.article-body blockquote {
  margin: 24px 0;
  border-left: 4px solid var(--green);
  padding: 8px 0 8px 18px;
  color: #344054;
  background: #f0fbf5;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select,
.search-input {
  width: 100%;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-input {
  max-width: 360px;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
  background: #f4f5f7;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #d8dde5;
  background: #fff;
  padding: 34px 24px;
}

.admin-sidebar__title {
  margin: 0 0 18px;
  color: #4b5563;
  font-size: 15px;
  font-weight: 800;
}

.admin-nav-group {
  margin-bottom: 26px;
}

.admin-nav-group h3 {
  margin: 0 0 9px;
  color: #4b5563;
  font-size: 15px;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 7px 0;
  color: #1769ff;
  font-size: 16px;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  color: var(--primary-strong);
  font-weight: 800;
}

.admin-main {
  min-width: 0;
  padding: 22px 42px 56px;
}

.admin-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d8dde5;
  padding: 0 0 12px;
  color: #475467;
}

.breadcrumb a {
  color: var(--primary);
}

.admin-title {
  margin: 18px 0 26px;
  font-size: 30px;
  line-height: 1.2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 70px;
}

.stat-card {
  min-height: 122px;
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #fff;
  box-shadow: var(--shadow);
}

.stat-card--blue {
  background: #1769ff;
}

.stat-card--green {
  background: #14814c;
}

.stat-card--cyan {
  background: #1fbad2;
}

.stat-card--yellow {
  color: #111827;
  background: #ffc51a;
}

.stat-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.stat-icon {
  font-size: 30px;
  line-height: 1;
  opacity: 0.86;
}

.stat-number {
  display: block;
  margin-top: 10px;
  font-size: 31px;
  font-weight: 500;
  line-height: 1;
}

.stat-foot {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

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

.admin-panel,
.table-card {
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(16, 24, 40, 0.06);
}

.admin-panel__head,
.table-card__head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d8dde5;
  padding: 8px 16px;
}

.admin-panel__head h2,
.table-card__head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
}

.admin-panel__body,
.table-card__body {
  padding: 16px;
}

.quick-panel {
  margin-top: 48px;
}

.quick-actions {
  padding: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e5e9ef;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #475467;
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.user-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.6fr);
  gap: 24px;
  align-items: start;
}

.user-card-head {
  align-items: flex-start;
}

.user-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  max-width: 560px;
}

.user-search-input {
  max-width: none;
}

.user-side-stack {
  display: grid;
  gap: 16px;
}

.user-rule-panel {
  box-shadow: 0 5px 18px rgba(16, 24, 40, 0.06);
}

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

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(245, 246, 248, 0.92), rgba(245, 246, 248, 0.92)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80")
      center/cover;
}

.login-box {
  width: min(420px, 100%);
  padding: 28px;
}

.login-box h1 {
  margin: 0 0 8px;
}

.login-box p {
  margin: 0 0 18px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(380px, calc(100% - 40px));
  border-radius: var(--radius);
  padding: 12px 14px;
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
}

.toast.is-error {
  background: var(--danger);
}

.hidden {
  display: none !important;
}

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

  .grid--3,
  .admin-grid,
  .split-layout,
  .user-admin-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    margin-bottom: 36px;
  }
}

@media (max-width: 820px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .user-menu__panel {
    left: 0;
    right: auto;
  }

  .grid--2,
  .grid--4,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 18px 18px 12px;
  }

  .admin-main {
    padding: 18px 16px 40px;
  }

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

  .admin-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-toolbar {
    grid-template-columns: 1fr;
  }

  .verification-row {
    grid-template-columns: 1fr;
  }

  .admin-table {
    min-width: 720px;
  }

  .table-scroll {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .site-header__inner,
  .site-footer__inner,
  .page-wrap,
  .hero__content,
  .article-hero__inner,
  .article-body {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    min-height: 350px;
  }

  .site-footer__inner,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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