:root {
  color-scheme: light;
  --bg: #f5f9ff;
  --panel: #ffffff;
  --panel-2: #eaf4ff;
  --line: rgba(30, 99, 190, 0.16);
  --text: #10233f;
  --muted: #60728a;
  --soft: #334d6d;
  --brand: #1e88ff;
  --brand-2: #4f6df5;
  --warn: #ffcf70;
  --danger: #d6425b;
  --shadow: 0 22px 70px rgba(43, 109, 202, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(30, 136, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(79, 109, 245, 0.13), transparent 30rem),
    linear-gradient(180deg, #eef7ff 0%, #ffffff 42%, #f5f9ff 100%),
    var(--bg);
  color: var(--text);
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(30, 136, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #1e88ff, #4f6df5);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
}

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

.site-nav a,
.ghost-btn,
.secondary-btn,
.primary-btn,
.file-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.site-nav a {
  color: var(--soft);
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(30, 136, 255, 0.08);
}

.primary-btn {
  border-color: rgba(30, 136, 255, 0.45);
  background: linear-gradient(135deg, #1e88ff, #536dfe);
  color: #ffffff;
  font-weight: 800;
}

.secondary-btn,
.file-btn {
  border-color: var(--line);
  background: rgba(30, 136, 255, 0.07);
  color: var(--text);
}

.ghost-btn {
  border-color: var(--line);
  background: transparent;
  color: var(--soft);
}

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

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(30, 136, 255, 0.07);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--brand);
}

.section-band,
.hero,
.admin-shell,
.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 128px);
  padding: clamp(42px, 8vw, 96px) 0 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.35rem, 6vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-text {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.8;
}

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

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.metric-row div {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.metric-row strong {
  display: block;
  font-size: 1.8rem;
}

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

.hero-visual {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: contain;
  background: #ffffff;
}

.section-band,
.admin-shell {
  padding: 78px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.section-head.align-left {
  margin-inline: 0;
  text-align: left;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.16;
}

.feature-grid,
.category-grid,
.article-grid {
  display: grid;
  gap: 16px;
}

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

.feature-card,
.category-card,
.article-card,
.admin-card,
.admin-workspace,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.feature-card,
.category-card,
.article-card {
  min-height: 188px;
  padding: 22px;
}

.feature-card .icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 8px;
  background: rgba(30, 136, 255, 0.1);
  color: var(--brand);
  font-weight: 800;
}

.feature-card h3,
.category-card h3,
.article-card h3 {
  margin: 0;
  font-size: 1.12rem;
}

.feature-card p,
.category-card p,
.article-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

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

.side-panel {
  padding: 18px;
  position: sticky;
  top: 86px;
}

.side-panel.compact {
  position: static;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 22px;
}

.filter-btn,
.tab-btn,
.card-action {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(30, 136, 255, 0.06);
  color: var(--soft);
  cursor: pointer;
}

.filter-btn.active,
.tab-btn.active {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

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

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.article-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--brand);
  background: rgba(30, 136, 255, 0.08);
}

.article-card .card-action {
  align-self: flex-start;
  margin-top: auto;
}

.article-page,
.article-directory {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.article-page h1,
.article-directory h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
}

.article-page h2,
.directory-group h2 {
  margin: 34px 0 16px;
}

.lead {
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.85;
}

.article-page p {
  color: var(--soft);
  font-size: 1.02rem;
  line-height: 1.95;
}

.article-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
}

.article-page-meta span,
.back-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
}

.back-link {
  margin-bottom: 24px;
  color: var(--brand);
}

.related-box {
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.related-links,
.directory-grid {
  display: grid;
  gap: 12px;
}

.related-links a,
.directory-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.directory-group {
  margin-top: 42px;
}

.directory-group h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.directory-group h2 span,
.directory-card small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

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

.directory-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
}

.directory-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: center;
}

.contact-card,
.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(30, 136, 255, 0.26);
  border-radius: 8px;
  padding: 18px;
  background: rgba(30, 136, 255, 0.08);
}

.contact-card {
  min-height: 118px;
}

.contact-card strong,
.contact-card small {
  display: block;
}

.contact-card small {
  margin-top: 8px;
  color: var(--muted);
}

.tg-icon,
.floating-tg span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e88ff, #536dfe);
  color: #ffffff;
  font-weight: 900;
}

.floating-tg {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(30, 136, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.floating-tg strong {
  font-size: 0.95rem;
}

.admin-shell {
  padding-bottom: 46px;
}

.admin-card,
.admin-workspace {
  padding: 22px;
  box-shadow: var(--shadow);
}

.admin-card h3 {
  margin: 0 0 18px;
}

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

.compact-form {
  max-width: 820px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(30, 136, 255, 0.78);
}

.wide,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions,
.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-toolbar span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.file-btn input {
  display: none;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.admin-panel {
  display: none;
}

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

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

.admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

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

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

.admin-note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: center;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid rgba(30, 136, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .split-layout,
  .article-layout,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

  .side-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    inset: 72px 18px auto 18px;
    justify-content: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: grid;
  }

  .site-nav a,
  .site-nav button {
    width: 100%;
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .metric-row,
  .feature-grid,
  .category-grid,
  .article-grid,
  .contact-band,
  .form-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

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

  .toolbar-actions,
  .form-actions,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .file-btn {
    width: 100%;
  }

  .floating-tg {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}
