﻿:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --panel: rgba(30, 41, 59, 0.85);
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #f59e0b;
  --accent2: #fb923c;
  --ok: #34d399;
  --err: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1e3a5f 0%, var(--bg) 55%) fixed;
  color: var(--text);
  min-height: 100vh;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 26px; }
.brand h1 { font-size: 20px; margin: 0; font-weight: 600; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.busy { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* 布局 */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 20px 24px 40px;
  max-width: 1440px;
  margin: 0 auto;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

/* 面板 */
.panel, .gallery { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel h2, .gallery h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.panel h2:not(:first-child) { margin-top: 22px; }

form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
form input[type="date"], form input[type="number"], form input[type="text"], form select {
  width: 100%; margin-top: 5px; padding: 8px 10px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
form label.check input { width: auto; margin: 0; }

button {
  cursor: pointer; border: none; border-radius: 10px;
  padding: 11px 14px; font-size: 15px; font-weight: 600; width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1a1206;
  transition: transform 0.06s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { filter: grayscale(0.6); cursor: not-allowed; }
button.secondary { background: var(--bg2); color: var(--text); border: 1px solid var(--border); font-weight: 500; margin-top: 8px; }
button.small { width: auto; padding: 6px 12px; font-size: 13px; }

.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }

/* 日志 */
.log {
  background: #0b1120; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; height: 300px; overflow-y: auto;
  font-family: Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.7;
}
.log-empty { color: var(--muted); }
.log .line { color: var(--text); white-space: pre-wrap; word-break: break-all; }
.log .line.err { color: var(--err); }
.log .line.ok { color: var(--ok); }

/* 画廊 */
.gallery-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gallery-head h2 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1024/1536; object-fit: cover; display: block; background: #000; }
.card-info { padding: 10px 12px; }
.card-info .date { font-weight: 600; font-size: 14px; }
.card-info .sub { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.5; }
.card-info .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(245, 158, 11, 0.15); color: var(--accent); border: 1px solid rgba(245, 158, 11, 0.35); }
.tag.gray { background: rgba(148, 163, 184, 0.12); color: var(--muted); border-color: rgba(148, 163, 184, 0.3); }

/* 通用隐藏（自定义场景输入框等） */
.hidden { display: none !important; }

/* 大图弹窗 */
.lightbox {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.9);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 30px;
}
.lightbox.hidden { display: none; }
.lightbox-body { max-width: min(920px, 92vw); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; }
.lightbox-body img { max-width: 100%; max-height: 80vh; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.btn-mini {
  cursor: pointer; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg2); color: var(--text); padding: 6px 12px; font-size: 13px; text-decoration: none;
}
.btn-mini:hover { border-color: var(--accent); }
.btn-mini.danger { color: #ff7b72; border-color: #ff7b72; }
