/* public/zd.css —— 智档管家 共享样式（无构建，纯 CSS 变量）
 * 视觉口径：合规/档案类产品，深绿主色 + 琥珀警示，浅色底，信息密度高但不拥挤。
 */

:root {
  --brand: #0e7c66;
  --brand-dark: #0a5c4c;
  --brand-soft: #e6f4f0;
  --ink: #16211f;
  --ink-2: #485955;
  --ink-3: #7b8b87;
  --line: #e2e8e6;
  --bg: #f5f8f7;
  --card: #ffffff;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warning: #c47f17;
  --warning-soft: #fdf3e2;
  --caution: #8a6d1d;
  --caution-soft: #fbf6e4;
  --ok: #1e7f4f;
  --ok-soft: #e7f5ee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 36, .06), 0 8px 24px rgba(16, 40, 36, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn.danger { background: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }

input[type=text], input[type=password], input[type=date], input[type=month],
input[type=number], input[type=tel], select, textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: .15s;
}
textarea { height: auto; min-height: 80px; padding: 9px 11px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, .12);
}
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------- 卡片 / 布局 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 20px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .sub { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: 1fr; }
  .grid.c2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid.c4 { grid-template-columns: 1fr; }
}

/* ---------- 徽标 / 状态 ---------- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.warning { background: var(--warning-soft); color: var(--warning); }
.tag.caution { background: var(--caution-soft); color: var(--caution); }
.tag.mute { background: #f1f4f3; color: var(--ink-3); }
.tag.brand { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 620px;
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  background: #fafcfb;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:hover { background: #fbfdfc; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 34px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- 提示条 / 弹窗 ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 74px;
  transform: translateX(-50%) translateY(-12px);
  z-index: 90;
  padding: 11px 18px;
  border-radius: 10px;
  background: #1f2d2a;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transition: .22s;
  max-width: 84vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 26, 23, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal header h3 { margin: 0; font-size: 16px; }
.modal .body { padding: 20px; }
.modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fafcfb;
  border-radius: 0 0 14px 14px;
}
.x-btn {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 6px;
}

/* ---------- 说明块 ---------- */
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}
.notice.info { background: var(--brand-soft); color: var(--brand-dark); }
.notice.warn { background: var(--warning-soft); color: #7a4d10; }
.notice.danger { background: var(--danger-soft); color: #8c2a1e; }
.notice.mute { background: #f4f6f5; color: var(--ink-2); }

/* ---------- 品牌标识 ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .2px; }
.logo .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--brand), #14a184);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}
