/* job-radar · 北京应届生第一份工作雷达 — 设计系统
   移动优先 · 年轻清爽 · 强信任感(不套用参谋长期刊风) */

:root {
  --primary: #4f46e5;        /* 主色 indigo */
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #06b6d4;         /* 青色点缀 */
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --trust-high: #16a34a;
  --trust-high-bg: #dcfce7;
  --trust-mid: #64748b;
  --trust-mid-bg: #f1f5f9;
  --risk: #dc2626;
  --risk-bg: #fee2e2;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.05);
  --shadow-hover: 0 4px 12px rgba(79,70,229,.12), 0 12px 32px rgba(15,23,42,.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px; /* 给底部导航留位 */
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ───────── 顶栏 ───────── */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 60%, var(--accent) 140%);
  color: #fff; padding: 18px 18px 16px;
  box-shadow: 0 2px 16px rgba(79,70,229,.25);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.auth-btn {
  flex: none; background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.45); border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(4px); white-space: nowrap;
}
.auth-btn:active { transform: scale(.95); }
.auth-btn.authed { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.appbar h1 { font-size: 19px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.appbar .sub { font-size: 12.5px; opacity: .9; margin-top: 3px; }
.appbar .radar { font-size: 22px; }

/* ───────── 搜索 + 排序 ───────── */
.toolbar { padding: 14px 16px 4px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 16px; box-shadow: var(--shadow);
}
.search input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; color: var(--ink); }
.search .ico { color: var(--ink-3); font-size: 16px; }

.sortbar { display: flex; gap: 8px; padding: 12px 16px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sortbar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 13px; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
  transition: all .15s; white-space: nowrap;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.chip-ghost { background: transparent; }

/* ───────── 筛选抽屉 ───────── */
.filters { padding: 4px 16px 8px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.filter-row::-webkit-scrollbar { display: none; }
.toggle-dispatch {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a;
}

/* ───────── 岗位卡片 ───────── */
.list { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border: 1px solid #f1f5f9;
  transition: transform .12s, box-shadow .12s; position: relative;
}
.card:active { transform: scale(.99); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { font-size: 16px; font-weight: 650; line-height: 1.4; color: var(--ink); flex: 1; }
.card .company { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.score-ring {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  background: conic-gradient(var(--primary) calc(var(--v) * 1%), #eef2ff 0);
  color: var(--primary);
}
.score-ring span { width: 34px; height: 34px; background: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 7px; font-weight: 600; }
.tag.trust-high { background: var(--trust-high-bg); color: var(--trust-high); }
.tag.trust-mid { background: var(--trust-mid-bg); color: var(--trust-mid); }
.tag.campus { background: var(--primary-soft); color: var(--primary); }
.tag.batch { background: #f0fdfa; color: #0d9488; }
.tag.major { background: #fdf4ff; color: #a21caf; }
.tag.risk { background: var(--risk-bg); color: var(--risk); }
.tag.plain { background: #f8fafc; color: var(--ink-2); }

.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.deadline { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.deadline.urgent { color: var(--risk); font-weight: 600; }
.deadline .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.btn-detail { font-size: 13px; color: var(--primary); font-weight: 600; }

/* 风险提示横幅(卡片内) */
.risk-banner {
  margin-top: 10px; background: var(--risk-bg); color: var(--risk);
  font-size: 12px; padding: 7px 11px; border-radius: 9px; display: flex; gap: 6px; align-items: center;
}

/* ───────── 校招日历 ───────── */
.cal-wrap { padding: 16px; }
.section-title { font-size: 16px; font-weight: 700; margin: 6px 2px 12px; display: flex; align-items: center; gap: 8px; }
.timeline { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.tl-item {
  background: var(--card); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow);
  border-left: 4px solid var(--primary); position: relative;
}
.tl-item.active { border-left-color: var(--trust-high); }
.tl-head { display: flex; justify-content: space-between; align-items: center; }
.tl-batch { font-size: 15px; font-weight: 700; }
.tl-months { font-size: 12px; color: var(--ink-3); }
.tl-count { font-size: 12px; background: var(--primary-soft); color: var(--primary); padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.tl-tip { font-size: 13px; color: var(--ink-2); margin-top: 7px; }

.dl-item {
  background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px;
}
.dl-left h4 { font-size: 14px; font-weight: 600; line-height: 1.4; }
.dl-left p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.dl-badge { flex: 0 0 auto; text-align: center; }
.dl-num { font-size: 20px; font-weight: 800; color: var(--risk); line-height: 1; }
.dl-num.safe { color: var(--trust-high); }
.dl-unit { font-size: 10.5px; color: var(--ink-3); }

/* ───────── AI 匹配 ───────── */
.match-wrap { padding: 16px; }
.match-form { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 15px; font-family: inherit; outline: none; color: var(--ink); background: #fcfcfd;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }
.field textarea { resize: vertical; min-height: 64px; }
.btn-primary {
  width: 100%; background: linear-gradient(135deg, var(--primary), #6366f1); color: #fff;
  font-size: 16px; font-weight: 700; padding: 14px; border-radius: var(--radius-sm);
  box-shadow: 0 6px 16px rgba(79,70,229,.3); transition: transform .1s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; }
.match-result { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.rec-card { background: var(--card); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); border: 1px solid #f1f5f9; }
.rec-card .rank { font-size: 12px; color: var(--primary); font-weight: 700; }
.rec-reason { font-size: 13px; color: var(--ink-2); margin-top: 8px; background: var(--primary-soft); padding: 9px 11px; border-radius: 9px; line-height: 1.5; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; background: linear-gradient(135deg,#7c3aed,#06b6d4); color:#fff; padding: 2px 8px; border-radius: 999px; }

/* ───────── 公司库 ───────── */
.co-grid { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.co-card { background: var(--card); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); }
.co-card h4 { font-size: 14.5px; font-weight: 650; }
.co-card .meta { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.co-card .ats { display: inline-block; margin-top: 8px; font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.co-card .verified { color: var(--trust-high); font-size: 11px; margin-left: 5px; }

/* ───────── 底部导航 ───────── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-3); font-size: 11px; padding: 6px 0; }
.tabbar button.on { color: var(--primary); }
.tabbar .ti { font-size: 20px; }

/* ───────── 通用 ───────── */
.empty { text-align: center; color: var(--ink-3); padding: 60px 20px; font-size: 14px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 12px; }
.loading { text-align: center; padding: 40px; color: var(--ink-3); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view { display: none; }
.view.on { display: block; animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stat-strip { display: flex; gap: 10px; padding: 0 16px 4px; }
.stat { flex: 1; background: var(--card); border-radius: var(--radius-sm); padding: 11px; text-align: center; box-shadow: var(--shadow); }
.stat .n { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat .l { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* 开关 switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; }
.slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 采集状态 / 日志面板 */
.crawl-card { background: var(--card); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); margin-top: 16px; }
.crawl-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.crawl-badge { font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.crawl-badge.running { background: var(--warn-bg); color: var(--warn); }
.crawl-badge.done { background: var(--trust-high-bg); color: var(--trust-high); }
.crawl-badge.error { background: var(--risk-bg); color: var(--risk); }
.crawl-meta { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.crawl-meta b { color: var(--primary); font-size: 15px; }
.crawl-log { margin-top: 12px; background: #0f172a; color: #cbd5e1; border-radius: 10px; padding: 11px 13px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.65; max-height: 260px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }

/* 轻提示 toast */
#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 12px);
  background: rgba(15,23,42,.9); color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 999px; z-index: 95; opacity: 0; pointer-events: none; transition: all .2s;
}
#toast.toast-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.06); }
  .tabbar, .appbar { max-width: 480px; margin: 0 auto; }
}

/* ───────── 登录 / 注册 浮层 ───────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.auth-overlay.on { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.auth-card {
  position: relative; width: 100%; max-width: 360px; background: var(--card);
  border-radius: 20px; padding: 26px 22px 22px; box-shadow: var(--shadow-hover);
  animation: pop .22s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes pop { from { transform: translateY(12px) scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.auth-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border: none; background: var(--bg); border-radius: 50%; font-size: 20px;
  color: var(--ink-3); cursor: pointer; line-height: 1;
}
.auth-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.auth-sub { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 18px; line-height: 1.5; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.auth-switch a { color: var(--primary); font-weight: 600; margin-left: 4px; text-decoration: none; }
.auth-err { color: var(--risk); font-size: 12.5px; text-align: center; margin-top: 10px; min-height: 16px; }

/* ───────── 登录引导 CTA(AI 匹配游客态)───────── */
.gate-cta {
  text-align: center; padding: 40px 22px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); margin: 6px 2px;
}
.gate-emoji { font-size: 44px; }
.gate-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 12px 0 6px; }
.gate-desc { font-size: 13px; color: var(--ink-3); line-height: 1.6; margin-bottom: 20px; }

/* ───────── 定制搜索 ───────── */
.search-req .sr-tip { font-size: 12px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
.sr-list-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 2px 8px; }
.sr-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius-sm); padding: 11px 14px;
  box-shadow: var(--shadow); margin-bottom: 8px;
}
.sr-kw { font-size: 14px; font-weight: 600; color: var(--ink); }
.sr-intent { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.sr-status { font-size: 12px; font-weight: 600; flex: 0 0 auto; color: var(--ink-2); }
.sr-status.done { color: var(--trust-high); }
.sr-status.running { color: var(--primary); }
.sr-status.failed { color: var(--risk); }
.sr-status.pending { color: var(--warn); }
