:root {
  --bg: #06110d;
  --bg2: #0b1c16;
  --panel: rgba(10, 32, 26, 0.78);
  --line: rgba(124, 240, 212, 0.18);
  --text: #e8fff6;
  --muted: #8fb8ab;
  --accent: #7cf0d4;
  --accent2: #2ee6a6;
  --danger: #ff7a8a;
  --warn: #ffd36b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(46, 230, 166, 0.16), transparent 55%),
    radial-gradient(900px 500px at 110% 10%, rgba(80, 160, 255, 0.1), transparent 50%),
    linear-gradient(180deg, var(--bg), #040c0a 70%);
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 8px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 750;
  letter-spacing: 0.04em;
}
.logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, #12352b, #1d6b55);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(46, 230, 166, 0.2);
}
.nav { display: flex; gap: 10px; align-items: center; }
.nav a, .ghost, .btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
}
.btn {
  background: linear-gradient(135deg, #1ec9a0, #7cf0d4);
  color: #04231a;
  font-weight: 700;
  border: none;
}
.btn.danger { background: linear-gradient(135deg, #ff7a8a, #ffb0ba); }
.ghost:hover, .nav a:hover { border-color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  padding: 28px 0 12px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  margin: 0 0 12px;
}
.hero p { color: var(--muted); font-size: 17px; max-width: 52ch; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.kpi {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 110px;
}
.kpi b { display: block; font-size: 20px; }
.kpi span { color: var(--muted); font-size: 12px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 18px;
}
.toolbar input, .toolbar select, .field input, .field textarea, .field select {
  background: #07140f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  min-width: 0;
}
.toolbar input { flex: 1; min-width: 180px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-bottom: 60px;
}
.card {
  background: rgba(7, 22, 18, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 250px;
}
.thumb {
  height: 140px;
  background: #081510;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.card .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-weight: 650; word-break: break-all; }
.card .sub { color: var(--muted); font-size: 12px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--accent);
}

.preview-page { padding: 20px 0 70px; }
.preview-box {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
}
.stage {
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050e0b;
}
.stage img, .stage video { max-width: 100%; max-height: 72vh; }
.stage audio { width: min(100%, 520px); }
.stage pre, .stage iframe, .stage embed { width: 100%; min-height: 420px; border: 0; background: #07140f; color: var(--text); }
.info { padding: 22px; }
.info h2 { margin: 0 0 8px; word-break: break-all; }
.row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.login {
  min-height: 80vh;
  display: grid;
  place-items: center;
}
.login .panel { width: min(420px, 100%); padding: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field label { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 12px 0 50px; }
.side { padding: 14px; height: fit-content; position: sticky; top: 16px; }
.side button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
}
.side button.active, .side button:hover { background: rgba(124, 240, 212, 0.1); color: var(--text); }
.admin-main { padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.ok { color: var(--accent2); }
.warn { color: var(--warn); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.drop {
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
}
.drop.over { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .hero, .preview-box, .admin-layout, .stats { grid-template-columns: 1fr; }
  .side { position: static; }
}
