:root {
  --bg: #07111f;
  --panel: #0d1a2e;
  --panel-2: #10243d;
  --line: #1d3657;
  --text: #edf6ff;
  --muted: #9bb2c9;
  --brand: #55c2ff;
  --brand-2: #7ddbc1;
  --danger: #ff8d8d;
  --shadow: 0 20px 60px rgba(0, 0, 0, .26);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(85, 194, 255, .12), transparent 30%), var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 12px clamp(16px, 5vw, 56px);
  background: rgba(7, 17, 31, .86);
  border-bottom: 1px solid rgba(85, 194, 255, .14);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: auto;
  height: 38px;
  max-height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.admin-sidebar .brand-logo {
  height: 32px;
  max-height: 32px;
}
.brand span {
  color: var(--text);
  white-space: nowrap;
  line-height: 1;
  font-size: clamp(15px, 4vw, 18px);
}
.site-nav { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); }

.hero {
  padding: 72px clamp(16px, 5vw, 56px) 28px;
}
.hero--small { padding-top: 48px; }
.hero__inner, .content-wrap, .article-page, .detail {
  width: min(1120px, 100%);
  margin: 0 auto;
}
.hero h1, .detail h1, .article-page h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: .95;
  letter-spacing: 0;
}
.hero p, .lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}
.hero-heading {
  margin: 0 0 8px;
  max-width: 680px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  color: #c8e4f8;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.filters {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(220px, 2fr) auto;
  gap: 12px;
  align-items: end;
}
.filters--icons {
  grid-template-columns: 52px 52px 1fr 52px;
  align-items: center;
}
.filter-icon-wrap {
  position: relative;
  width: 52px;
  height: 46px;
}
.filter-icon-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 52px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 26, 46, .95);
  color: var(--brand);
  pointer-events: none;
}
.filter-icon-btn--inline {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  background: transparent;
  width: 44px;
  height: 100%;
  z-index: 1;
}
.filter-icon-btn--submit {
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #06111c;
}
.filter-icon-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.filters__search {
  position: relative;
}
.filters__search input {
  padding-left: 44px;
}
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%;
  color: var(--text);
  background: rgba(13, 26, 46, .95);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(85, 194, 255, .8);
  box-shadow: 0 0 0 3px rgba(85, 194, 255, .12);
}
button, .button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #06111c;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 800;
  cursor: pointer;
}
.button-muted {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.content-wrap { padding: 22px clamp(16px, 5vw, 56px) 64px; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.video-card {
  overflow: hidden;
  border: 1px solid rgba(85, 194, 255, .13);
  border-radius: 8px;
  background: rgba(13, 26, 46, .78);
  box-shadow: var(--shadow);
}
.thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: #09182a;
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.video-card:hover .thumb img { transform: scale(1.035); }
.thumb-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(85, 194, 255, .22), rgba(125, 219, 193, .14));
}
.video-card__body {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.video-title {
  min-height: 52px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
}
.tag {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(125, 219, 193, .35);
  border-radius: 999px;
  padding: 5px 10px;
  color: #b7f5e6;
  background: rgba(125, 219, 193, .08);
  font-size: 12px;
  font-weight: 700;
}

.ad-slot {
  display: grid;
  place-items: center;
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  padding: 16px clamp(12px, 3vw, 20px);
  margin-bottom: 20px;
  border: 1px solid rgba(85, 194, 255, .14);
  border-radius: 12px;
  background: rgba(13, 26, 46, .62);
  overflow: hidden;
}
.ad-slot iframe,
.ad-slot > div {
  max-width: 100%;
}
.ad-slot--top {
  min-height: auto;
  padding: 14px clamp(12px, 4vw, 24px);
  margin-bottom: 18px;
}
.ad-slot--native {
  min-height: auto;
  padding: 18px clamp(14px, 4vw, 28px);
  margin-bottom: 22px;
}
.ad-slot--300 {
  min-height: auto;
  padding: 20px clamp(14px, 4vw, 28px);
  margin-bottom: 20px;
}
.ad-slot--600 {
  min-height: auto;
  padding: 22px 18px;
  margin-bottom: 20px;
}
.ad-slot--footer {
  min-height: auto;
  padding: 14px clamp(12px, 4vw, 24px);
  margin: 0 0 16px;
}
.ad-slot--side {
  min-height: auto;
  padding: 16px 12px;
  margin: 0;
  position: sticky;
  top: 88px;
}
.ad-slot__desktop,
.ad-slot__mobile {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 6px 0;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 20px;
  align-items: start;
}
.detail-layout__main { min-width: 0; }
.detail-layout__side { min-width: 0; }
@media (max-width: 960px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-layout__side { display: none; }
  .ad-slot__desktop { display: none; }
  .ad-slot__mobile { display: grid; }
}
@media (min-width: 961px) {
  .ad-slot__mobile { display: none; }
}
.ad-slot--placeholder span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 28px;
}
.loader span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1s infinite ease-in-out;
}
.loader span:nth-child(2) { animation-delay: .14s; }
.loader span:nth-child(3) { animation-delay: .28s; }
@keyframes pulse {
  0%, 80%, 100% { transform: scale(.7); opacity: .45; }
  40% { transform: scale(1); opacity: 1; }
}
.end-message { text-align: center; color: var(--muted); }

.detail-page { padding: 42px clamp(16px, 5vw, 56px) 70px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: 44px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(13, 26, 46, .78);
  font-size: 14px;
  font-weight: 600;
}
.back-link span { color: var(--text); }
.back-link:hover { color: var(--text); border-color: rgba(85, 194, 255, .4); }
.detail h1 { margin-top: 18px; font-size: clamp(34px, 5vw, 64px); }
.detail-meta { margin: 18px 0; }
.player {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #020711;
  aspect-ratio: 16 / 9;
}
.player iframe, .player img, .player video { width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.detail-description, .article-content {
  color: #d7e8f8;
  white-space: pre-wrap;
  font-size: 17px;
}
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  font-weight: 800;
  color: #06111c;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.download-btn:hover { filter: brightness(1.06); }

.download-page { padding: 42px clamp(16px, 5vw, 56px) 70px; }
.download-gate {
  width: min(640px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}
.download-gate__title { margin: 0; color: var(--muted); font-size: 18px; }
.download-steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.download-steps__dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
  background: var(--panel);
}
.download-steps__dot.is-active {
  border-color: var(--brand);
  color: var(--text);
  background: rgba(85, 194, 255, .12);
}
.download-steps__dot.is-done {
  border-color: var(--brand-2);
  color: #06111c;
  background: var(--brand-2);
}
.download-steps__line {
  flex: 1;
  height: 2px;
  background: var(--line);
}
.download-step {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 26, 46, .78);
}
.download-step .ad-slot {
  margin-bottom: 0;
}
.download-step__label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.download-countdown { margin: 0; color: var(--text); }
.download-countdown strong { color: var(--brand); font-size: 1.2em; }
.download-next {
  width: 100%;
  min-height: 48px;
}
.download-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.download-final {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
  color: #06111c;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.download-final.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.4);
}
.article-page { padding: 64px clamp(16px, 5vw, 56px); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(16px, 5vw, 56px);
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card, .admin-form, .memory-card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 26, 46, .86);
  box-shadow: var(--shadow);
}
.login-card { display: grid; gap: 16px; }
.login-card h1 { margin: 0; }
.form-error { color: var(--danger); margin: 0; }
.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.form-hint code {
  color: #c8e4f8;
  word-break: break-all;
}
.btn-submit.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}
.btn-submit.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid rgba(6, 17, 28, .25);
  border-top-color: #06111c;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.admin-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  background: var(--bg);
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 17, 31, .96);
}
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
}
.admin-sidebar nav a:hover { background: var(--panel); color: var(--text); }
.admin-main { padding: 30px; min-width: 0; }
.admin-head {
  margin-bottom: 22px;
}
.admin-head h1 { margin: 0 0 5px; font-size: 34px; }
.admin-head p { margin: 0; color: var(--muted); }
.admin-head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stats-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-search {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.admin-search select {
  flex: 0 0 160px;
  width: auto;
}
.admin-search button {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}
.admin-search .button-muted {
  flex: 0 0 auto;
  width: auto;
  min-height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}
.admin-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.admin-pagination a,
.admin-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}
.admin-pagination a:hover { color: var(--text); }
.admin-pagination span.is-active {
  color: #06111c;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 800;
}
.stats-grid div {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.stats-grid strong { font-size: 34px; }
.stats-grid span { color: var(--muted); }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--panel);
}
th, td {
  text-align: left;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-size: 13px; }
.table-actions { display: flex; gap: 10px; align-items: center; }
.table-actions button {
  min-height: 34px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger);
}
.admin-form {
  width: 100%;
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compact-form, .inline-editor {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}
.inline-editor {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}
.stack { display: grid; gap: 14px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.memory-card p { margin-bottom: 0; color: var(--muted); white-space: pre-wrap; }

@media (max-width: 860px) {
  .filters, .filters--icons, .video-grid, .stats-grid, .form-grid, .compact-form, .inline-editor {
    grid-template-columns: 1fr;
  }
  .filters--icons {
    grid-template-columns: 52px 52px 1fr 52px;
  }
  .hero { padding-top: 44px; }
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
  }
  .admin-main { padding: 20px; }
  .admin-head--row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .hero h1, .detail h1, .article-page h1 { font-size: 38px; }
  .content-wrap { padding-left: 14px; padding-right: 14px; }
  .video-title { min-height: auto; }
}
