:root {
  --bg: #0f1419;
  --panel: #171d24;
  --panel-2: #1d252e;
  --border: #2a333d;
  --text: #e6edf3;
  --muted: #8b98a5;
  --primary: #3b82f6;
  --primary-hover: #2f6fd8;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

[hidden] { display: none !important; }

/* ── 登录 ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
}
.login-logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 4px;
}
.login-title { font-size: 18px; margin: 8px 0 4px; }
.login-sub { color: var(--muted); font-size: 12px; margin: 0 0 22px; }
.login-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
}
.login-foot { color: var(--muted); font-size: 12px; text-align: center; margin: 18px 0 0; }

/* ── 布局 ── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.whoami { color: var(--muted); font-size: 13px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--primary); }

.content { padding: 24px; flex: 1; }

.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.muted { color: var(--muted); font-size: 13px; }

/* ── 卡片与表单 ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-title { font-weight: 600; margin-bottom: 14px; }

.row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 12px; }

input, select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--primary); }
input[type="file"] { padding: 7px; }

.inline-error { color: #fca5a5; font-size: 13px; }

/* ── 按钮 ── */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #3a4a5f; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { background: transparent; color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.btn-danger:hover { background: rgba(239,68,68,0.12); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ── 表格 ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table tbody tr:hover { background: var(--panel); }
.empty-hint { color: var(--muted); text-align: center; padding: 40px 0; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.badge-published { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-draft { background: rgba(245,158,11,0.15); color: #fbbf24; }

.asset-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px;
  margin: 2px 4px 2px 0;
}
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; }

/* ── 清单 ── */
.manifest-pre {
  background: #0a0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  color: #a5d6a7;
  margin: 0 0 14px;
}
.help-list { color: var(--muted); font-size: 13px; padding-left: 18px; }
.help-list li { margin-bottom: 6px; }

/* ── 弹窗 ── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
}
.modal-title { font-weight: 600; margin-bottom: 16px; }

.progress { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin: 12px 0; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width 0.2s; }

/* ── toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.toast.ok { border-color: var(--success); }
.toast.err { border-color: var(--danger); }
