:root {
  --bg: #f3f6f9;
  --panel: rgba(255,255,255,0.92);
  --ink: #18212b;
  --muted: #5f6d79;
  --line: #d6dde4;
  --accent: #1f5b88;
  --accent-2: #d87528;
  --shadow: 0 14px 36px rgba(21,32,43,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31,91,136,0.12), transparent 24%),
    linear-gradient(180deg, #f8fafc, var(--bg));
}

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; line-height: 1.05; }
.sub, .muted { color: var(--muted); }

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

input, button {
  font: inherit;
}

input {
  min-width: 220px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

button.primary {
  padding: 11px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #2f7fba);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.jumpbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.jumpbar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

#statusText {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel.wide {
  padding-bottom: 22px;
}

.panel-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.refs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.ref-card, .shot-card, .history-card, .beat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  overflow: hidden;
}

.ref-card img, .shot-card img, .history-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  background: #e4eaf0;
}

.ref-meta, .shot-meta, .history-meta, .beat-meta {
  padding: 12px;
}

.ref-meta h3, .shot-meta h3, .history-meta h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.shot-card {
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}

.shot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(21,32,43,0.08);
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef4f9;
  color: var(--accent);
}

.tag.warn {
  background: #fff2e8;
  color: var(--accent-2);
}

.beat-list, .history-list {
  display: grid;
  gap: 12px;
}

.beat-card {
  display: grid;
  grid-template-columns: 120px 1fr;
}

.beat-thumb img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  display: block;
}

.beat-meta h3 {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.beat-no {
  color: var(--accent);
  font-weight: 700;
}

.kv {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.kv div strong {
  color: var(--muted);
  margin-right: 8px;
}

.history-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255,255,255,0.65);
}

@media (max-width: 960px) {
  .hero { flex-direction: column; align-items: stretch; }
  .toolbar { width: 100%; }
  .field, input { width: 100%; }
}

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