* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #e8657f;
  --brand-dark: #d44f6a;
  --brand-soft: #fdf0f3;
  --ink: #23262f;
  --muted: #8b90a0;
  --line: #ececf3;
  --bg: #f6f7fb;
  --ok: #2e9e6b;
  --danger: #e64340;
  --radius: 14px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 20% 0%, #ffeef2 0%, transparent 60%), var(--bg); }
.login-card { width: 380px; max-width: 100%; background: #fff; border-radius: 20px; padding: 36px 32px;
  box-shadow: 0 18px 50px rgba(35, 38, 47, .10); text-align: center; }
.login-card h1 { font-size: 22px; margin-top: 14px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card label { display: block; text-align: left; margin-bottom: 14px; font-size: 13px; color: #666; }
.login-card input { width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; outline: none; }
.login-card input:focus, .field select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 101, 127, .12); }
.logo-mark { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), #f090a4); color: #fff; font-weight: 700; font-size: 24px;
  box-shadow: 0 8px 20px rgba(232, 101, 127, .30); }
.logo-mark.small { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; box-shadow: none; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 24px; height: 62px;
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.topbar-sep { width: 1px; height: 20px; background: var(--line); }
.topbar h1 { font-size: 15px; font-weight: 600; color: #444; }
.config-hint { font-size: 12px; color: var(--muted); }
.config-hint.warn { color: #c77b00; background: #fff7e6; border: 1px solid #ffe1a8; padding: 4px 10px; border-radius: 20px; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.link-btn:hover { color: var(--brand); background: var(--brand-soft); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 6px; padding: 16px 24px 0; }
.tab { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 600; border-radius: 12px 12px 0 0; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.on { background: #fff; color: var(--brand); border-color: var(--line); border-bottom-color: #fff; margin-bottom: -1px; }
.tab-icon { font-size: 12px; }

/* ---------- 主体 ---------- */
.main { padding: 0 24px 32px; }
.pane { background: #fff; border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius);
  min-height: calc(100vh - 150px); padding: 24px; }
.layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .pane { border-radius: var(--radius); } }

.panel h2 { font-size: 18px; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; color: #555; font-weight: 600; margin-bottom: 8px; }
textarea { width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 12px; font-size: 14px;
  font-family: inherit; line-height: 1.7; resize: vertical; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea::placeholder { color: #b6bac6; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.chip { border: 1px solid var(--line); background: #fafafd; color: #666; font-size: 12px; padding: 6px 12px;
  border-radius: 20px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 420px) { .row-2 { grid-template-columns: 1fr; } }
.field { display: block; font-size: 13px; color: #555; font-weight: 600; }
.field select, .field input[type="file"] { width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid #ddd;
  border-radius: 10px; font-size: 13px; background: #fff; outline: none; }
.field input[type="file"] { padding: 6px; color: var(--muted); }
.field input[type="file"]::file-selector-button { border: 0; background: var(--brand-soft); color: var(--brand);
  padding: 6px 10px; border-radius: 7px; margin-right: 10px; cursor: pointer; font-size: 12px; }

.ref-preview { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 14px;
  background: #fafafd; border: 1px dashed #dcdcea; border-radius: 10px; font-size: 12px; color: var(--muted); }
.ref-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; background: #eee; }
.ref-preview .remove { margin-left: auto; border: 0; background: #eee; color: #666; width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }

.btn { border: 0; border-radius: 11px; padding: 11px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .05s, background .15s, box-shadow .15s; }
.btn.primary { background: linear-gradient(135deg, var(--brand), #ef7d93); color: #fff;
  box-shadow: 0 8px 18px rgba(232, 101, 127, .28); }
.btn.primary:hover { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.btn.primary:active { transform: translateY(1px); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; margin-top: 6px; }
.btn.small { padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: #555; }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ---------- 结果区 ---------- */
.stage { min-height: 420px; }
.empty { height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px dashed #dfe0ea; border-radius: 16px; color: var(--muted); background: #fcfcfe; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: #f1f1f8; color: #b9bccb; font-size: 22px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty p { font-size: 14px; color: #666; }
.empty span { font-size: 12px; margin-top: 4px; }

.loading { height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #f0e3e7; border-top-color: var(--brand);
  animation: spin .9s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 14px; color: #555; }
.loading span { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.result-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.result-card img, .result-card video { width: 100%; display: block; background: #f2f2f6; }
.result-card .body { padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.result-card .meta { font-size: 12px; color: var(--muted); }
.result-card .actions { margin-left: auto; display: flex; gap: 6px; }
.result-card.wide { grid-column: 1 / -1; }
.result-card.wide video { max-height: 62vh; object-fit: contain; background: #111; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .topbar { padding: 0 14px; height: 56px; gap: 10px; }
  .topbar h1, .topbar-sep { display: none; }
  .tabs { padding: 12px 14px 0; }
  .main { padding: 0 14px 24px; }
  .pane { padding: 16px; min-height: auto; }
  .results { grid-template-columns: 1fr; }
  .empty, .loading { height: 300px; }
}
