/* ==========================================================================
   nexlaw · 设计系统
   参考 moritzlegal.com / arceus.legal 的视觉语言：大字主张、数据锚点、
   卡片式、大留白、克制的色彩。全站共用。
   ========================================================================== */

:root {
  /* 墨色与灰阶 */
  --ink: #0A1A2A;
  --ink-2: #2B3F52;
  --ink-3: #55697C;
  --mut: #7C8DA0;
  --line: #E4EAF0;
  --line-2: #EDF1F5;
  --bg: #F7F9FC;
  --bg-2: #FFFFFF;
  --card: #FFFFFF;
  --dark: #08131F;
  --dark-2: #0E2033;

  /* 品牌 */
  --brand: #14507D;
  --brand-2: #1D6BA8;
  --brand-soft: #EAF2F9;
  --accent: #B9832F;
  --accent-soft: #FAF3E7;

  /* 状态（与后端 db.js 的预警分级一致） */
  --blue: #2F7ED8;
  --yellow: #C99A16;
  --orange: #E0761F;
  --red: #C93A2E;
  --green: #2E8B57;
  --blue-bg: #EAF3FD;
  --yellow-bg: #FBF5E2;
  --orange-bg: #FDF0E5;
  --red-bg: #FBEBE9;
  --green-bg: #EAF6EF;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-s: 0 1px 2px rgba(10,26,42,.06), 0 1px 3px rgba(10,26,42,.04);
  --shadow: 0 4px 16px rgba(10,26,42,.07), 0 1px 3px rgba(10,26,42,.05);
  --shadow-l: 0 18px 48px rgba(10,26,42,.13);
  --maxw: 1180px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.65; font-size: 15px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 布局 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.wrapflex { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}.mt-5{margin-top:56px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}

/* ---------- 字体 ---------- */
.display { font-size: clamp(30px, 5.2vw, 60px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.h1 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 750; letter-spacing: -.02em; }
.h2 { font-size: clamp(19px, 2.2vw, 24px); font-weight: 700; }
.h3 { font-size: 17px; font-weight: 650; }
.lead { font-size: clamp(15px, 1.5vw, 18px); color: var(--ink-3); line-height: 1.75; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mut { color: var(--mut); }
.mut2 { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; transition: all .2s var(--ease); white-space: nowrap;
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; border-color: #CFDAE4; color: var(--ink); box-shadow: var(--shadow-s); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #F2F6FA; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: var(--dark-2); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #A6751F; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); }
.card-pad { padding: 22px; }
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-b { padding: 20px; }
.card-hover { transition: all .25s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); border-color: #D5E0EA; }

/* ---------- 徽标 / 标签 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--bg); color: var(--ink-3); border: 1px solid var(--line); white-space: nowrap; }
.badge-lg { padding: 5px 13px; font-size: 13px; }
.badge-blue { background: var(--blue-bg); color: #1B5FA8; border-color: #CCE1F7; }
.badge-yellow { background: var(--yellow-bg); color: #8A6A0A; border-color: #F0E2B4; }
.badge-orange { background: var(--orange-bg); color: #A85510; border-color: #F6D9BE; }
.badge-red { background: var(--red-bg); color: #9E2A20; border-color: #F2CDC8; }
.badge-green { background: var(--green-bg); color: #1F6B42; border-color: #C9E6D6; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: #CFE0EF; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.blue{background:var(--blue)}.dot.yellow{background:var(--yellow)}.dot.orange{background:var(--orange)}.dot.red{background:var(--red)}.dot.green{background:var(--green)}
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: all .18s var(--ease); font-size: 14.5px;
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29,107,168,.12); }
.input::placeholder, .textarea::placeholder { color: #A9B6C2; }
.hint { font-size: 12px; color: var(--mut); }
.err { font-size: 13px; color: var(--red); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 650; font-size: 12.5px; color: var(--mut); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .02em; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #FAFCFE; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 进度 ---------- */
.bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand-2); transition: width .4s var(--ease); }
.bar.thin { height: 4px; }

/* ---------- 空状态 ---------- */
.empty { padding: 44px 20px; text-align: center; color: var(--mut); }
.empty .ico { font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* ---------- 提示条 ---------- */
.note { padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.6; border: 1px solid; }
.note-info { background: var(--brand-soft); border-color: #CFE0EF; color: #14507D; }
.note-warn { background: var(--yellow-bg); border-color: #F0E2B4; color: #7A5D08; }
.note-red { background: var(--red-bg); border-color: #F2CDC8; color: #8E251C; }
.note-ai { background: #F4F6F9; border-color: var(--line); color: var(--ink-3); font-size: 12.5px; }
.note-ok { background: var(--green-bg); border-color: #C9E6D6; color: #1F6B42; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(8,19,31,.44); backdrop-filter: blur(3px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-l); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }
.modal.wide { max-width: 820px; }
.modal-h { padding: 20px 24px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-b { padding: 22px 24px; }
.modal-f { padding: 16px 24px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: #fff; }
.x { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--mut); font-size: 19px; line-height: 1; }
.x:hover { background: var(--bg); color: var(--ink); }

/* ---------- Toast ---------- */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow-l); animation: pop .3s var(--ease); max-width: 90vw; }
.toast.err { background: var(--red); }
.toast.ok { background: #1F6B42; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C9D4DE; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #A9B8C6; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 动效 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 徽标（Logo） ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #14507D, #1D6BA8); display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800; flex: none; }
.logo.on-dark { color: #fff; }
.logo.on-dark .mark { background: linear-gradient(135deg, #2F7ED8, #5AA3E8); }

@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .wrap, .wrap-narrow { padding: 0 18px; }
  .card-pad { padding: 18px; }
  .card-b { padding: 16px; }
}
