/* GSC 全维度明细日报库 · 与 baidu-searchword-admin 同一设计语言 */
:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #111827;
  --ink-soft: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e5eaf2;
  --blue: #1769e0;
  --blue-dark: #0b4fd7;
  --blue-soft: #edf5ff;
  --green: #10a878;
  --red: #dc4747;
  --shadow-sm: 0 5px 18px rgba(27, 45, 79, .06);
  --radius: 16px;
  --radius-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: radial-gradient(circle at 5% 5%, rgba(23,105,224,.08), transparent 26rem), var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55;
}
button, input, select { font: inherit; }
.hidden { display: none !important; }

/* 顶栏 */
.topbar {
  color: #fff;
  background: radial-gradient(circle at 80% -50%, rgba(82,214,255,.34), transparent 34%),
    linear-gradient(120deg, #0a2a5e, #0b4fd7);
  padding: 18px 0;
}
.topbar-inner { width: min(1800px, calc(100vw - 24px)); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.brand-copy .eyebrow { margin: 0; font-size: 11px; letter-spacing: .14em; opacity: .75; }
.brand-copy h1 { margin: 2px 0; font-size: 20px; }
.brand-copy p { margin: 0; font-size: 12px; opacity: .8; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-link { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.topbar-link:hover { background: rgba(255,255,255,.12); }
.topbar-action { color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.topbar-action:hover { background: rgba(255,255,255,.22); }

/* 登录 */
.login-shell { display: flex; justify-content: center; padding: 64px 16px; }
.login-card { width: 360px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 28px; }
.login-card h2 { margin: 0 0 6px; }
.login-hint { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.input-wrap input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.input-wrap input:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.login-submit { width: 100%; background: var(--blue); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 11px; cursor: pointer; font-size: 15px; }
.login-submit:hover { background: var(--blue-dark); }
.msg { color: var(--red); min-height: 20px; margin: 10px 0 0; }

/* 主区 */
.dashboard { width: min(1800px, calc(100vw - 24px)); margin: 20px auto 60px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.grow { flex: 1; min-width: 180px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: #fff; }
.actions { display: flex; gap: 8px; margin-left: auto; }
button { border-radius: var(--radius-sm); cursor: pointer; }
.action-primary { background: var(--blue); color: #fff; border: 0; padding: 9px 18px; }
.action-primary:hover { background: var(--blue-dark); }
.secondary { background: #fff; color: var(--ink-soft); border: 1px solid var(--line); padding: 8px 14px; }
.secondary:hover { border-color: var(--blue); color: var(--blue); }
.secondary:disabled { opacity: .45; cursor: not-allowed; }

/* 汇总卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.metric p { margin: 0; color: var(--muted); font-size: 13px; }
.metric strong { font-size: 26px; font-weight: 700; }

.by-site { display: flex; flex-wrap: wrap; gap: 10px; }
.site-chip { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--blue-soft); font-size: 13px; }
.site-chip b { color: var(--blue-dark); }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); }
th:hover { color: var(--blue); }
th.sorted-asc::after { content: " ▲"; }
th.sorted-desc::after { content: " ▼"; }
td.num, th.num { text-align: right; }
td.query { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
td.page { max-width: 360px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
tr:hover td { background: #f8fafd; }
.empty { text-align: center; color: var(--muted); padding: 24px 0 8px; }
.error-banner {
  margin: 0; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--red-soft, #fff0f0); color: var(--red);
  border: 1px solid #f5c2c2; font-size: 13px;
}

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 12px; color: var(--muted); }
.pager select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.pager button { padding: 5px 10px; }

/* 采集记录 */
.log-table td, .log-table th { font-size: 13px; }
.status-ok { color: var(--green); }
.status-error { color: var(--red); }

@media (max-width: 720px) {
  .brand-copy p { display: none; }
  .actions { margin-left: 0; width: 100%; }
}
