/* 百度收录批量查询工具 — 样式 v2 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e8ecf3;
  --ink: #1f2733;
  --muted: #8a93a3;
  --primary: #2f6bff;
  --primary-d: #1f54e0;
  --hit: #16a34a;
  --nohit: #d97706;
  --none: #64748b;
  --fail: #e0405a;
  --run: #2f6bff;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 1280px; margin: 0 auto; padding: 24px 22px 60px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 22px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #2f6bff, #5b8cff);
  color: #fff; font-size: 22px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(47,107,255,.35);
}
.brand-text h1 { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.brand-text p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.brand-text b { color: var(--ink); }
.balance-box {
  display: flex; flex-direction: column; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 16px; cursor: pointer;
  box-shadow: var(--shadow); transition: .15s;
}
.balance-box:hover { border-color: #cfd9ee; }
.balance-label { font-size: 12px; color: var(--muted); }
.balance-num { font-size: 20px; font-weight: 700; color: var(--primary); }

/* ---------- 卡片 / 输入 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); font-size: 12px; }
textarea {
  width: 100%; height: 170px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font-size: 13px; line-height: 1.7; color: var(--ink);
  background: #fbfcfe; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: .15s;
}
textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(47,107,255,.12); }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: .15s;
}
.btn:hover:not(:disabled) { border-color: #c4d0e8; background: #f7f9ff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); border-color: var(--primary-d); }
.btn-ghost { background: transparent; }
.progress { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 220px; }
.progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar { flex: 1; height: 6px; background: #eef1f7; border-radius: 99px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#2f6bff,#5b8cff); border-radius: 99px; transition: width .3s; }

/* ---------- 统计概览 ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 12px; cursor: pointer; text-align: left; transition: .15s;
  display: flex; flex-direction: column; gap: 2px; position: relative; box-shadow: var(--shadow);
}
.stat:hover { transform: translateY(-1px); border-color: #cfd9ee; }
.stat.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-hit  .stat-num { color: var(--hit); }
.stat-nohit .stat-num { color: var(--nohit); }
.stat-none .stat-num { color: var(--none); }
.stat-fail .stat-num { color: var(--fail); }
.stat-run  .stat-num { color: var(--run); }

/* ---------- 复制条 ---------- */
.copybar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s; color: var(--ink);
}
.chip:hover { background: #f7f9ff; border-color: #c4d0e8; }
.chip b { margin-left: 4px; font-weight: 700; }
.chip-nohit b { color: var(--nohit); }
.chip-hit b { color: var(--hit); }
.chip-none b { color: var(--none); }
.grow { flex: 1; }
.search {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  font-size: 13px; width: 230px; background: #fbfcfe;
}
.search:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(47,107,255,.12); }

/* ---------- 表格 ---------- */
.table-card { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 12px;
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
  text-transform: none; letter-spacing: .3px;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }
.c-idx { width: 50px; } .c-num { width: 90px; } .c-status { width: 92px; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.domain { font-weight: 500; }
.note { color: var(--muted); font-size: 12.5px; }
tr.row-hit { background: #f1fdf5; }
tr.row-hit:hover { background: #e9fbf0; }

/* 关键词 */
.kw { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.kw span { background: #e7f6ee; color: var(--hit); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.dash { color: #cbd2de; }
.nohit-text { color: var(--nohit); font-size: 12px; }

/* 状态标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.tag.wait { background: #eef1f7; color: #64748b; }
.tag.run  { background: #e7eeff; color: #2f6bff; }
.tag.done { background: #e7f6ee; color: #16a34a; }
.tag.err  { background: #fdebef; color: #e0405a; }

.empty { padding: 48px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: #1f2733; color: #fff; padding: 11px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s;
  box-shadow: 0 10px 30px rgba(16,24,40,.25); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .progress { width: 100%; margin-left: 0; }
}
