/* ============================================================
   闲鱼违规词检测 · 公共样式
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1d1f23;
  --ink-soft: #4b5058;
  --muted: #868d96;
  --line: #e6e8ec;
  --brand: #ffd400;
  --brand-deep: #f0c400;
  --brand-ink: #1d1f23;
  --high: #e5484d;
  --high-bg: #ffeded;
  --medium: #d98200;
  --medium-bg: #fff4e2;
  --low: #2f7ed8;
  --low-bg: #e9f2ff;
  --ok: #12924f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

.wrap { width: 100%; max-width: 1020px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------- 头部 */

.site-header {
  background: linear-gradient(180deg, #fffbe0 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 13px;
  font-weight: 800;
  font-size: 22px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
  flex: none;
}

.brand h1 { font-size: 21px; }
.brand-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.header-meta { display: flex; align-items: center; gap: 14px; }

.pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 212, 0, .22);
  color: #7a5d00;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.link-muted {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid transparent;
}
.link-muted:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------------------------------------------------------- 布局 */

.main { padding: 26px 20px 48px; display: grid; gap: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.card-head h2 { font-size: 16px; }

.hint { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------- 表单 */

.field { margin-bottom: 16px; }

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.field-label label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }

.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.full { color: var(--high); }

input[type="text"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  background: #fcfcfd;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

textarea { resize: vertical; min-height: 120px; line-height: 1.7; }

input[type="text"]:focus, textarea:focus, select:focus {
  border-color: #f2c200;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 212, 0, .25);
}

/* ---------------------------------------------------------- 按钮 */

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 20px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 2px 0 var(--brand-deep);
}
.btn-primary:hover:not(:disabled) { background: #ffdc2e; }

.btn-ghost {
  background: #fff;
  border-color: #dcdfe4;
  color: var(--ink-soft);
}
.btn-ghost:hover:not(:disabled) { background: #f7f8fa; border-color: #c9ced6; }

.btn-danger {
  background: #fff;
  border-color: #f3c1c3;
  color: var(--high);
}
.btn-danger:hover:not(:disabled) { background: var(--high-bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.status { font-size: 13px; color: var(--muted); }
.status.error { color: var(--high); }

/* ---------------------------------------------------------- 结果 */

.result { display: grid; gap: 18px; }

.verdict {
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.verdict-icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  font-weight: 800;
}

.verdict-title { font-size: 17px; font-weight: 750; }
.verdict-sub { font-size: 13px; color: var(--ink-soft); }

.verdict.is-high { background: linear-gradient(90deg, #fff2f2, #fff); border-color: #f6c9cb; }
.verdict.is-high .verdict-icon { background: var(--high-bg); color: var(--high); }
.verdict.is-high .verdict-title { color: #b3262b; }

.verdict.is-medium { background: linear-gradient(90deg, #fff8ec, #fff); border-color: #f2ddb7; }
.verdict.is-medium .verdict-icon { background: var(--medium-bg); color: var(--medium); }
.verdict.is-medium .verdict-title { color: #9a5d00; }

.verdict.is-low { background: linear-gradient(90deg, #f2f7ff, #fff); border-color: #cfe0f6; }
.verdict.is-low .verdict-icon { background: var(--low-bg); color: var(--low); }
.verdict.is-low .verdict-title { color: #1e5fa8; }

.verdict.is-clean { background: linear-gradient(90deg, #effaf3, #fff); border-color: #c6ecd6; }
.verdict.is-clean .verdict-icon { background: #e2f7ea; color: var(--ok); }
.verdict.is-clean .verdict-title { color: var(--ok); }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  min-width: 112px;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 20px; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat.high .stat-num { color: var(--high); }
.stat.medium .stat-num { color: var(--medium); }
.stat.low .stat-num { color: var(--low); }
.stat.total .stat-num { color: var(--ink); }

.preview {
  border: 1px dashed #dcdfe4;
  background: #fbfbfc;
  border-radius: 10px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.95;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 60px;
}

mark.hit {
  padding: 1px 2px;
  border-radius: 4px;
  font-weight: 650;
  color: inherit;
  border-bottom: 2px solid currentColor;
  cursor: help;
}
mark.hit-high { background: var(--high-bg); color: #b3262b; }
mark.hit-medium { background: var(--medium-bg); color: #9a5d00; }
mark.hit-low { background: var(--low-bg); color: #1e5fa8; }

.legend { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 4px; }
.dot-high { background: var(--high); }
.dot-medium { background: var(--medium); }
.dot-low { background: var(--low); }

/* ---------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; margin: 0 -4px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 660px; }

.table th {
  text-align: left;
  font-weight: 650;
  font-size: 12.5px;
  color: var(--muted);
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 11px 10px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: top;
  color: var(--ink-soft);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fcfcfd; }

.hit-word { font-weight: 650; color: var(--ink); }
.hit-context { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-high { background: var(--high-bg); color: #b3262b; }
.badge-medium { background: var(--medium-bg); color: #9a5d00; }
.badge-low { background: var(--low-bg); color: #1e5fa8; }
.badge-cat { background: #f0f2f5; color: var(--ink-soft); }

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

/* ---------------------------------------------------------- 说明与页脚 */

.tips ul { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 13.5px; }
.tips li { margin: 4px 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0 30px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  background: #fff;
}

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-meta { width: 100%; justify-content: space-between; }
  .card { padding: 18px; }
  .main { padding-top: 18px; gap: 14px; }
  .brand h1 { font-size: 19px; }
  .btn { flex: 1 1 auto; }
  .status { flex: 1 1 100%; }
}
