:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1d2129;
  --muted: #86909c;
  --border: #ebedf0;
  --primary: #ff2e4d;
  --primary-dark: #d81e3a;
  --accent: #2b5cff;
  --shadow: 0 2px 12px rgba(0, 0, 0, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(135deg, var(--primary), #ff6a3d);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.topbar h1 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.topbar .nav a { color: #fff; opacity: .9; margin-left: 18px; font-size: 14px; }
.topbar .nav a:hover { opacity: 1; text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card h2 .hint { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .label { color: var(--muted); font-size: 12px; margin-top: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select, .toolbar input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  background: var(--primary);
  color: #fff;
  transition: .15s;
}
button:hover { background: var(--primary-dark); }
button.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.ghost:hover { background: #f2f3f5; }
button.accent { background: var(--accent); }
button.accent:hover { background: #1e44cc; }
button:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr:hover td { background: #fafbfc; }

.rank-badge { font-weight: 700; font-size: 16px; width: 34px; text-align: center; }
.rank-1 { color: #f5a623; } .rank-2 { color: #9aa0aa; } .rank-3 { color: #cd7f32; }

.note-cell { display: flex; gap: 10px; align-items: center; }
.note-cell img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #eee; flex: none; }
.note-cell .t { font-weight: 500; max-width: 360px; }
.note-cell .meta { color: var(--muted); font-size: 12px; }

.metric { display: inline-flex; gap: 3px; align-items: center; color: #4e5969; font-size: 13px; white-space: nowrap; }
.metric + .metric { margin-left: 10px; }
.score { font-weight: 700; color: var(--primary); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.badge.on { background: #e8f7ee; color: #19be6b; }
.badge.off { background: #f2f3f5; color: var(--muted); }
.badge.video { background: #eaf0ff; color: var(--accent); }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.field input { min-width: 220px; }
.grow { flex: 1; }
.grow input { width: 100%; }

.toast { position: fixed; top: 20px; right: 20px; background: #1d2129; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); transition: .25s; z-index: 999; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: #d81e3a; }
.toast.ok { background: #19be6b; }

.logbox { background: #0f1115; color: #cdd3de; font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 14px; border-radius: 10px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.log-error { color: #ff6b6b; } .log-warn { color: #ffd166; } .log-info { color: #8fd19e; }

.muted { color: var(--muted); }
.right { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.row-actions button { padding: 6px 12px; font-size: 12px; margin-left: 6px; }

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .note-cell .t { max-width: 180px; }
}

label.ck { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; cursor: pointer; }
label.ck input { width: auto; margin: 0; }
button.danger { color: #c0392b; }
button.danger:hover { background: #fdecea; border-color: #e6b0aa; }

/* 检索页 / 平台标记 */
.badge.douyin { background: #ecebff; color: #6b4dff; }
.badge.xhs { background: #ffe9ec; color: var(--primary); }
.task-meta { color: var(--muted); font-size: 13px; margin: -4px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kw { display: inline-block; background: #f2f3f5; color: #4e5969; border-radius: 6px; padding: 1px 8px; font-size: 12px; }
.kw.sm { font-size: 11px; padding: 0 6px; margin-left: 4px; }
td.loc { color: #4e5969; font-size: 12px; max-width: 130px; }
.task-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.task-card .th { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.task-card .tt { font-weight: 600; }
.task-card .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
