:root {
  --bg: #f4f7fc;
  --card: #ffffff;
  --line: #dbe4f2;
  --text: #1f2937;
  --muted: #64748b;
  --brand: #196ee7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  padding: 20px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-nav-link {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #38506f;
  background: #fff;
}

.top-nav-link.active {
  color: #0f4e9b;
  border-color: #cfe4ff;
  background: #eaf3ff;
}

.hero h1 { margin: 0; }
.hero p { margin: 8px 0 0; color: var(--muted); }

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

.studio-link {
  background: linear-gradient(120deg, #ef4444, #dc2626);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

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

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 13px;
  font-weight: 700;
  color: #3b4a63;
}

input, select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
}

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

button, .link-btn {
  height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 700;
  background: linear-gradient(120deg, #2f8fff, #1f7ae0);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button.ghost {
  background: #fff;
  color: #2b4d70;
  border: 1px solid var(--line);
}

.status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.preview {
  width: 100%;
  max-height: 320px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000;
}

.frames {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

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

.frame-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  cursor: zoom-in;
}

.frame-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 12px;
}

.frame-meta a {
  color: #0f4e9b;
  text-decoration: none;
  font-weight: 700;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
}

.lightbox img {
  max-width: min(1200px, 96vw);
  max-height: 88vh;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #000;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: auto;
  height: 38px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  color: #fff;
  padding: 0 12px;
}

.hidden { display: none !important; }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}
