:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --ink: #172033;
  --muted: #667085;
  --line: #e5e9f0;
  --brand: #1768e5;
  --brand-2: #12a594;
  --brand-dark: #0c2348;
  --danger: #d92d20;
  --success: #079455;
  --shadow: 0 20px 60px rgba(15, 35, 70, 0.12);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
}

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

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

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

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f8fafc;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #d7dee8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  color: #fff;
}

.site-header.is-solid,
.site-header.inner {
  background: rgba(9, 22, 42, 0.94);
  box-shadow: 0 12px 40px rgba(6, 18, 36, 0.16);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 210px;
}

.brand img {
  width: 214px;
  max-height: 54px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-weight: 600;
}

.nav a {
  position: relative;
  opacity: 0.9;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.18s ease;
}

.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
}

.menu-button span,
.menu-button span::before,
.menu-button span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  margin: 0 auto;
  content: "";
}

.menu-button span::before {
  transform: translateY(-7px);
}

.menu-button span::after {
  transform: translateY(5px);
}

.hero {
  min-height: 720px;
  display: grid;
  align-items: center;
  color: #fff;
  background-size: cover;
  background-position: center;
  position: relative;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(8, 20, 39, 0.86), rgba(8, 20, 39, 0.42)), rgba(0, 0, 0, 0.24);
}

.hero-content {
  width: min(860px, 100%);
  padding-top: 80px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #b9d7ff;
  font-weight: 700;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--brand-2);
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.18;
  font-weight: 800;
}

.hero p {
  max-width: 760px;
  margin: 24px 0 34px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 104, 229, 0.28);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
}

.btn.light {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--line);
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  border-color: #c9dcff;
}

.btn.danger {
  background: #fff2f0;
  color: var(--danger);
  border-color: #ffd3cc;
}

.section {
  padding: 86px 0;
  background: #fff;
}

.section.alt {
  background: var(--bg);
}

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

.section-kicker {
  color: var(--brand);
  font-weight: 800;
  margin: 0 0 8px;
}

.section h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.section-desc {
  color: var(--muted);
  max-width: 680px;
  margin: 12px 0 0;
}

.intro-grid,
.choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 52px;
  align-items: center;
}

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

.visual-frame {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--panel-soft);
}

.visual-frame img {
  width: 100%;
  aspect-ratio: 1.12 / 1;
  object-fit: cover;
}

.copy h2 {
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.28;
}

.copy p {
  color: var(--muted);
  margin: 0 0 14px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.feature-chip {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 700;
}

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

.service-card,
.article-card,
.contact-card,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.service-card {
  padding: 24px;
}

.service-card:hover,
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #cddcff;
}

.service-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 18px;
}

.service-card h3,
.article-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

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

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

.article-card {
  overflow: hidden;
}

.article-card img {
  width: 100%;
  aspect-ratio: 1.62 / 1;
  object-fit: cover;
  background: #e8eef6;
}

.article-body {
  padding: 18px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #175cd3;
  font-size: 12px;
  font-weight: 800;
}

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

.stat-card {
  padding: 22px;
}

.stat-value {
  font-size: 34px;
  font-weight: 850;
  color: var(--brand);
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  margin-top: 8px;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.partner {
  min-height: 86px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.partner img {
  max-height: 54px;
  object-fit: contain;
}

.page-hero {
  min-height: 360px;
  display: grid;
  align-items: end;
  padding: 130px 0 58px;
  color: #fff;
  background-size: cover;
  background-position: center;
  position: relative;
  isolation: isolate;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(8, 20, 39, 0.86), rgba(8, 20, 39, 0.48));
}

.breadcrumbs {
  color: rgba(255, 255, 255, 0.76);
  margin-top: 10px;
}

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

#categorySearch {
  display: flex;
  align-items: center;
  gap: 12px;
}

#categorySearch .search-input {
  width: 280px;
}

.search-input,
.field input,
.field select,
.field textarea,
.admin-toolbar input,
.admin-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d7deea;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-toolbar input:focus,
.admin-toolbar select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 104, 229, 0.12);
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
}

.article-main,
.side-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article-main {
  padding: 34px;
}

.article-main h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.28;
}

.content-html {
  color: #303949;
  word-break: break-word;
}

.content-html p {
  margin: 0 0 16px;
}

.content-html img {
  height: auto;
  border-radius: var(--radius);
  margin: 20px auto;
}

.side-panel {
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 106px;
}

.side-panel h3 {
  margin: 0 0 14px;
}

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

.side-list a {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.contact-card {
  padding: 24px;
}

.contact-card strong {
  display: block;
  margin-bottom: 8px;
}

.site-footer {
  background: #08162a;
  color: rgba(255, 255, 255, 0.78);
  padding: 46px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}

.footer-grid h3 {
  color: #fff;
  margin: 0 0 12px;
}

.empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed #cfd8e6;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.pagination button {
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

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

.admin-body {
  background: #eef3f9;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(23, 104, 229, 0.2), transparent 28%), #eef3f9;
}

.login-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

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

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

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 700;
  color: #344054;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.admin-sidebar {
  background: #08162a;
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-logo {
  display: flex;
  align-items: center;
  min-height: 54px;
  margin-bottom: 26px;
}

.admin-logo img {
  max-width: 184px;
  max-height: 50px;
  object-fit: contain;
}

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

.admin-nav button {
  width: 100%;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
}

.admin-nav button.active,
.admin-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  padding: 28px;
}

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

.admin-topbar h1 {
  margin: 0;
  font-size: 26px;
}

.admin-topbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.admin-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px 140px auto;
  gap: 12px;
  margin-bottom: 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #475467;
  font-size: 13px;
  background: #f8fafc;
}

td {
  color: #273244;
}

.thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f7;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 18, 34, 0.55);
}

.modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.28);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 22px;
}

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

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

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

.field textarea.content-editor {
  min-height: 300px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.media-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.media-item img {
  width: 100%;
  aspect-ratio: 1.25 / 1;
  object-fit: cover;
  background: #eef2f7;
}

.media-item div {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #101828;
  color: #fff;
  box-shadow: var(--shadow);
}

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

.toast.success {
  background: var(--success);
}

@media (max-width: 980px) {
  .nav {
    position: fixed;
    top: 82px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 20px;
    background: rgba(9, 22, 42, 0.98);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 0;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 38px;
  }

  .intro-grid,
  .choice-grid,
  .contact-grid,
  .article-shell,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-toolbar,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 1180px);
  }

  .brand img {
    width: 178px;
  }

  .hero {
    min-height: 640px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 31px;
  }

  .section {
    padding: 62px 0;
  }

  .section-head,
  .toolbar,
  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  #categorySearch {
    align-items: stretch;
    flex-direction: column;
  }

  #categorySearch .search-input {
    width: 100%;
  }

  .service-grid,
  .card-grid,
  .feature-list,
  .stats-grid,
  .partner-grid,
  .form-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .article-main {
    padding: 22px;
  }

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