/* 抖音数据采集系统 · 界面样式 */
:root {
  --ink: #0f1f1c;
  --ink-2: #3d4f4b;
  --sub: #6b7d78;
  --line: #e2e8e5;
  --line-2: #eef2f0;
  --bg: #f4f7f6;
  --card: #ffffff;
  --brand: #0f766e;
  --brand-dark: #0b5d57;
  --brand-soft: #e6f2f0;
  --accent: #2dd4bf;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #15803d;
  --sidebar: #0b2b27;
  --sidebar-2: #0e342f;
  --shadow: 0 1px 2px rgba(15, 31, 28, .04), 0 8px 24px rgba(15, 31, 28, .05);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #123f39 0%, #071f1c 55%, #051614 100%);
  z-index: 90;
}
.login-card {
  width: 392px; background: var(--card); border-radius: 18px; padding: 38px 36px 30px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.login-card .sub { color: var(--sub); font-size: 13px; margin: 4px 0 26px; }
.login-card label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.login-card .err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--sub); text-align: center; }

/* ---------- 骨架 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; background: linear-gradient(180deg, var(--sidebar) 0%, #08211e 100%);
  color: #d7e4e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand-bar { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-bar .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff; }
.brand-bar .logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2dd4bf, #0f766e);
  display: grid; place-items: center; font-size: 15px; color: #04211e; font-weight: 800;
}
.brand-bar .ver { margin-top: 6px; font-size: 11px; color: #7f9d97; letter-spacing: .4px; }
.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11px; color: #6f8d87; letter-spacing: 1px; padding: 14px 10px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #c4d6d2; cursor: pointer; font-size: 13.5px; margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(45, 212, 191, .14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item .ic { width: 16px; text-align: center; opacity: .85; font-size: 14px; }
.nav-item .badge { margin-left: auto; background: rgba(255, 255, 255, .12); border-radius: 20px; padding: 0 7px; font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.topbar .crumb { color: var(--sub); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 20px; background: var(--brand-soft); }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; }
.user-chip .name { font-size: 13px; font-weight: 600; }
.user-chip .role { font-size: 11px; color: var(--brand-dark); }
.content { padding: 26px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page { display: none; animation: fade .24s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片与网格 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head .desc { color: var(--sub); font-size: 12.5px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: 1.35fr .65fr; }
.mt16 { margin-top: 16px; }
.mt12 { margin-top: 12px; }
.mt24 { margin-top: 24px; }
.muted { color: var(--sub); }
.small { font-size: 12.5px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--sub); margin-top: 4px; }
.kpi .spark { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 15px; }

/* ---------- 表单 ---------- */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none;
  background: #fff; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.6; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.field.grow { flex: 1; }
.hint { font-size: 12px; color: var(--sub); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 600; transition: background .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--line-2); }
.btn.soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3c8c8; }
.btn.danger:hover { background: #fdf2f2; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: #f1f5f3; color: var(--ink-2); font-weight: 600; text-align: left;
  padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:hover td { background: #fafcfb; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .nowrap { white-space: nowrap; }
.thumb { width: 42px; height: 56px; border-radius: 6px; object-fit: cover; background: #e9efed; display: block; }
.thumb.wide { width: 96px; height: 54px; }
.ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #e9efed; }
.cell-title { display: flex; flex-direction: column; gap: 3px; max-width: 380px; }
.cell-title b { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell-title span { color: var(--sub); font-size: 12px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; background: var(--line-2); color: var(--ink-2); }
.pill.ok { background: #e7f5ec; color: var(--ok); }
.pill.warn { background: #fdf3e3; color: var(--warn); }
.pill.err { background: #fdeaea; color: var(--danger); }
.pill.info { background: var(--brand-soft); color: var(--brand-dark); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; margin: 1px 3px 1px 0; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); justify-content: flex-end; color: var(--sub); font-size: 12.5px; }
.empty { padding: 44px 0; text-align: center; color: var(--sub); }
.empty h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }

/* ---------- Cookie 获取步骤 ---------- */
.ac-steps { display: grid; gap: 10px; }
.ac-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--line-2); }
.ac-step .n { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--brand-dark); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.ac-step b { font-size: 13px; color: var(--ink); }
.ac-step p { margin: 4px 0 0; font-size: 12px; color: var(--sub); line-height: 1.6; }
.ac-parse { margin-top: 8px; }
.ac-parse .tag { font-family: ui-monospace, Menlo, monospace; }

/* ---------- 采集预览卡片 ---------- */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pv { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.pv .cover { width: 100%; height: 150px; object-fit: cover; background: #eef3f1; }
.pv .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.pv .t { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.pv .meta { display: flex; gap: 10px; color: var(--sub); font-size: 11.5px; }
.pv .auth { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; }

/* ---------- 图文作品卡 ---------- */
.vcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vcard { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.vcard .vcover { position: relative; background: #eef3f1; }
.vcard .vcover img { width: 100%; height: 168px; object-fit: cover; display: block; }
.vcard .vcover .ph { height: 168px; display: grid; place-items: center; color: var(--sub); font-size: 12px; }
.vcard .vbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.vcard .vt { font-size: 13.5px; font-weight: 650; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.vcard .vc { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; padding: 8px 10px; background: var(--line-2); border-radius: 8px; }
.vcard .vmeta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--sub); font-size: 11.5px; align-items: center; }
.vcard .vact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

/* ---------- 评论按作品归类 ---------- */
.cgroup { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; background: #fff; overflow: hidden; }
.cgroup-head { display: flex; gap: 14px; padding: 12px 14px; align-items: center; }
.cgroup-cover img { width: 76px; height: 52px; object-fit: cover; border-radius: 8px; display: block; }
.cgroup-cover:empty { display: none; }
.cgroup-info { flex: 1; min-width: 0; }
.cgroup-title { font-weight: 650; font-size: 13.5px; line-height: 1.5; margin-bottom: 6px; word-break: break-word; }
.cgroup-info .vmeta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--sub); font-size: 11.5px; align-items: center; }
.cgroup-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cgroup-body { display: none; border-top: 1px dashed var(--line-2); }
.cgroup-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px 12px; }
.cm-user { display: flex; gap: 8px; align-items: center; }

/* ---------- 任务提示 ---------- */
.task-tip { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; margin-top: 8px; line-height: 1.6; }
.task-tip.warn { background: #fdf3e3; color: #92400e; }
.task-tip.err { background: #fdeaea; color: #991b1b; }

/* ---------- 进度 ---------- */
.progress-line { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; background: var(--line-2); border-radius: 20px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2dd4bf, #0f766e); transition: width .4s ease; }
.bar.warn > i { background: linear-gradient(90deg, #fbbf24, #b45309); }
.task-box { padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: #fbfdfc; }
.task-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.task-head .name { font-weight: 600; }
.log-line { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--sub); max-height: 120px; overflow: auto; margin-top: 8px; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 24, 21, .48); display: flex; align-items: center;
  justify-content: center; z-index: 60; padding: 20px;
}
.modal { background: #fff; border-radius: 16px; width: 780px; max-width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.modal.head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal.head h3 { margin: 0; font-size: 16px; }
.modal.head .x { margin-left: auto; cursor: pointer; color: var(--sub); font-size: 18px; line-height: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line-2); }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast {
  min-width: 240px; max-width: 420px; padding: 11px 14px; border-radius: 10px; background: #10231f; color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: 13px; animation: slide .2s ease;
}
.toast.ok { background: #0f5132; }
.toast.err { background: #7f1d1d; }
.toast.warn { background: #78350f; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- 热榜 ---------- */
.hot-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.hot-rank { width: 26px; text-align: center; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums; }
.hot-rank.top { color: #b91c1c; }
.hot-word { flex: 1; font-weight: 550; }
.hot-val { color: var(--sub); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hot-up { color: #b91c1c; font-size: 12px; }
.hot-down { color: #15803d; font-size: 12px; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 280px; }
.chart.short { height: 240px; }

/* ---------- 账号检测 ---------- */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.check-item .name { width: 90px; font-weight: 600; font-size: 13px; }
.check-item .msg { flex: 1; color: var(--sub); font-size: 12.5px; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .crumb { display: none; }
}
