/* 推广助手 · 样式 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f6fa;
  color: #222;
  font-size: 14px;
}
a { color: #2a6df4; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* 顶栏 */
.topbar {
  background: #1f2733;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  flex-wrap: wrap;
}
.brand { font-size: 17px; font-weight: 600; padding: 14px 0; }
.brand .sub { font-size: 12px; color: #9fb0c8; font-weight: 400; margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: #c8d4e6;
  padding: 14px 12px;
  display: inline-block;
  border-bottom: 3px solid transparent;
}
.topbar nav a.on { color: #fff; border-bottom-color: #ff7a45; }
.topbar nav a:hover { color: #fff; text-decoration: none; }

.wrap { max-width: 1180px; margin: 20px auto 60px; padding: 0 16px; }

/* 面板 */
.panel {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(20, 40, 80, .06);
}
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.panel.narrow { max-width: 420px; margin: 60px auto; }
.grid2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #fff; border-radius: 12px; padding: 16px; text-align: center;
  box-shadow: 0 1px 4px rgba(20, 40, 80, .06);
}
.stat .num { font-size: 26px; font-weight: 700; color: #ff7a45; }
.stat .label { color: #78849a; margin-top: 4px; }

/* 表单 */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; color: #445; font-size: 13px; }
.form-grid input, .form-grid select, .form-grid textarea,
.form-row input, .form-row select {
  padding: 8px 10px; border: 1px solid #d6dde8; border-radius: 8px; font-size: 14px;
  background: #fbfcfe; outline: none;
}
.form-grid input:focus, .form-grid select:focus, .form-row input:focus { border-color: #ff7a45; }
.form-actions { display: flex; align-items: flex-end; }
.chk { flex-direction: row !important; align-items: center; display: flex; gap: 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.mode-box { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mode-box textarea { font-family: Consolas, monospace; }
.hint { color: #8692a8; font-size: 12.5px; margin: 8px 0; }

/* 按钮 */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid #d6dde8;
  background: #fff; color: #333; cursor: pointer; font-size: 13.5px;
}
.btn:hover { border-color: #ff7a45; color: #ff7a45; text-decoration: none; }
.btn.primary { background: #ff7a45; border-color: #ff7a45; color: #fff; }
.btn.primary:hover { background: #ff8f60; color: #fff; }
.btn.danger { color: #d64545; }
.btn.danger:hover { border-color: #d64545; }
.btn.mini { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 8px; text-align: left; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.table th { color: #78849a; font-weight: 500; font-size: 12.5px; }
.table tr:hover td { background: #fafbfe; }
.dim { color: #8692a8; font-size: 12.5px; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops { white-space: nowrap; }
.ops .btn { margin: 1px 2px; }

/* 徽章 / 状态 */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px;
  background: #eef1f6; color: #445;
}
.b-douyin { background: #0f1c2e; color: #fff; }
.b-xiaohongshu { background: #ff2442; color: #fff; }
.b-zhihu { background: #056de8; color: #fff; }
.b-qq { background: #12b7f5; color: #fff; }
.b-wechat { background: #07c160; color: #fff; }
.status { padding: 1px 8px; border-radius: 20px; font-size: 12px; background: #eef1f6; }
.st-done { background: #e2f7e9; color: #1d8a4a; }
.st-failed { background: #fdeaea; color: #c33; }
.st-running { background: #fff4de; color: #b07a00; }
.st-waiting_manual { background: #e8f1ff; color: #2a6df4; }
.st-queued { background: #f0e9ff; color: #6a3de8; }

/* 提示条 */
.alert {
  background: #fff7e6; border: 1px solid #ffe1a8; color: #8a6100;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
}
.alert.small { padding: 6px 10px; font-size: 12.5px; margin-top: 6px; }
.flash { background: #e8f1ff; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; color: #2a6df4; }

/* 生成结果卡片 */
.result-list { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.copy-card { border: 1px solid #e6ebf4; border-radius: 10px; padding: 12px 14px; background: #fbfcfe; }
.copy-card pre {
  white-space: pre-wrap; word-break: break-word; font-family: inherit;
  margin: 8px 0; font-size: 13.5px; line-height: 1.7;
}
.copy-card .card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.copy-card .tags { color: #6a3de8; font-size: 12.5px; }
.content-preview { color: #556; font-size: 13px; white-space: pre-wrap; max-height: 44px; overflow: hidden; }
.content-cell .title { font-weight: 600; margin-bottom: 2px; }

/* 日志 */
.logs {
  background: #10151d; color: #c9d6e8; border-radius: 10px; padding: 14px;
  font-size: 12px; line-height: 1.7; max-height: 360px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}

.risks { margin: 0; padding-left: 18px; color: #445; line-height: 2; }

/* 队列状态行着色 */
tr.task-failed td { background: #fffafa; }
tr.task-waiting_manual td { background: #f7faff; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(30px);
  background: #1f2733; color: #fff; padding: 10px 18px; border-radius: 24px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 99;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 账号：顶栏用户区 */
.userbox {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  color: #c8d4e6; font-size: 13.5px;
}
.userbox a { color: #c8d4e6; }
.userbox a:hover { color: #fff; text-decoration: none; }
.userbox .uname { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; }
.userbox .logout { border-left: 1px solid #3a4657; padding-left: 14px; }
.role-tag { background: #ff7a45; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.badge.role-admin { background: #fff4de; color: #b07a00; }

/* 账号：登录 / 注册表单 */
.auth-panel { max-width: 460px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 4px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; color: #445; font-size: 13px; }
.auth-form input {
  padding: 9px 11px; border: 1px solid #d6dde8; border-radius: 8px;
  font-size: 14px; background: #fbfcfe; outline: none;
}
.auth-form input:focus { border-color: #ff7a45; }
.btn.block { width: 100%; text-align: center; padding: 10px; font-size: 14.5px; }
.auth-foot { text-align: center; color: #8692a8; font-size: 13px; margin: 14px 0 2px; }
.auth-foot a { font-weight: 600; }
tr.u-row-off td { opacity: .55; }
