/* 外链资源库 —— 工具级样式，不做产品化设计（AGENTS.md 红线） */
:root {
  --bg: #f6f7f9;
  --card-bg: #fff;
  --border: #e2e5ea;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2563eb;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 1100px;
  padding: 20px 16px 60px;
  font-family: -apple-system, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

h1 { font-size: 20px; margin: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.add-form { display: flex; gap: 8px; flex: 1; max-width: 640px; }
.add-form input[type="text"] { flex: 1; }
.add-form input:first-child { flex: 2; }

input, select, button {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
}
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }

.btn { cursor: pointer; }
.btn:hover { background: #eef1f6; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* 统计卡片 */
.cards { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card {
  flex: 1;
  min-width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}
.card-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-label { color: var(--muted); margin-top: 2px; }
.card-instant .card-num { color: #15803d; }
.card-reverify .card-num { color: #b45309; }

/* 筛选 chips + 搜索 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  background: var(--card-bg);
}
.chip:hover { background: #eef1f6; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#search { min-width: 220px; }

/* 列表 */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #fafbfc; font-weight: 600; color: var(--muted); font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
td.url { max-width: 320px; }
td.url a { color: var(--accent); text-decoration: none; word-break: break-all; }
td.url a:hover { text-decoration: underline; }
td.domain { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
td.date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
td.note { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
td.empty { text-align: center; color: var(--muted); padding: 24px 0; }

.col-actions { width: 110px; }
.actions { white-space: nowrap; }
.actions button { margin-right: 4px; padding: 3px 8px; font-size: 13px; }
.btn-del { color: var(--danger); }

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef1f6;
  color: var(--muted);
  white-space: nowrap;
}
.s-candidate { background: #eef1f6; color: #475569; }
.s-inspected { background: #dbeafe; color: #1d4ed8; }
.s-instant { background: #dcfce7; color: #15803d; }
.s-blocked { background: #fee2e2; color: #b91c1c; }
.s-pending_review { background: #fef3c7; color: #b45309; }
.s-dead { background: #e5e7eb; color: #9ca3af; text-decoration: line-through; }

/* 编辑态 */
tr.editing td { background: #f8fafc; }
tr.editing input, tr.editing select { width: 100%; }
td.url input { word-break: break-all; }
.muted { color: var(--muted); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; color: var(--muted); }

/* 访问令牌门：背景必须完全不透明，输入令牌时不得透出背后任何数据 */
.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.auth-gate.hidden { display: none; }
.auth-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-box h2 { margin: 0; font-size: 16px; }
.auth-box p { margin: 0; }
.auth-box .muted { font-size: 13px; color: var(--muted); }
