/* ==========================================================================
   成果中介服务平台 · 公共样式
   ========================================================================== */
:root {
  --brand-900: #0f3b2e;
  --brand-700: #14513e;
  --brand-600: #1a6b51;
  --brand-500: #22805f;
  --brand-100: #e3f1ea;
  --brand-50:  #f2f8f5;

  --gold-600: #a8762a;
  --gold-500: #c8913f;
  --gold-100: #f7eddc;

  --ink-900: #1c2321;
  --ink-700: #3d4744;
  --ink-500: #6b7673;
  --ink-400: #939c99;

  --line: #e3e8e6;
  --line-soft: #eef2f0;
  --bg: #f5f7f6;
  --white: #ffffff;

  --danger: #c0392b;
  --danger-bg: #fdecea;
  --warn: #b8791f;
  --warn-bg: #fdf3e2;
  --info: #2b6cb0;
  --info-bg: #e8f1fb;
  --ok: #1e7a52;
  --ok-bg: #e4f4ec;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 45, 36, .06);
  --shadow: 0 2px 10px rgba(18, 45, 36, .08);
  --shadow-lg: 0 12px 40px rgba(15, 59, 46, .18);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
          "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------------- 通用按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 8px;
  background: var(--brand-600); color: #fff;
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all .16s ease;
}
.btn:hover { background: var(--brand-700); box-shadow: 0 2px 8px rgba(26, 107, 81, .25); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink-700); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a5311f; box-shadow: 0 2px 8px rgba(192, 57, 43, .25); }
.btn.gold { background: var(--gold-500); }
.btn.gold:hover { background: var(--gold-600); box-shadow: 0 2px 8px rgba(200, 145, 63, .28); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 6px; }
.btn.lg { height: 44px; padding: 0 24px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; line-height: 1.7;
  background: var(--line-soft); color: var(--ink-500);
}
.tag.green { background: var(--ok-bg); color: var(--ok); }
.tag.blue  { background: var(--info-bg); color: var(--info); }
.tag.gold  { background: var(--gold-100); color: var(--gold-600); }
.tag.red   { background: var(--danger-bg); color: var(--danger); }
.tag.amber { background: var(--warn-bg); color: var(--warn); }

/* ---------------- 纯文字标注（无底色）----------------
   用于表格内的状态与操作，弱化视觉噪音，信息靠文字本身传达。
   颜色仍保留语义（绿=有效/完成，灰=进行中，红=危险操作）。 */
.tag-text {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  white-space: nowrap;
}
.tag-text.green { color: var(--ok); }
.tag-text.blue  { color: var(--info); }
.tag-text.gold  { color: var(--gold-600); }
.tag-text.red   { color: var(--danger); }
.tag-text.amber { color: var(--warn); }
.tag-text.muted { color: var(--ink-500); }

/* 纯文字操作链接：默认灰，hover 显色 */
.op-link {
  padding: 0;
  margin: 0 10px 0 0;
  border: 0;
  background: none;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-700);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.op-link:last-child { margin-right: 0; }
.op-link:hover { color: var(--brand-600); border-bottom-color: currentColor; }
.op-link.primary { color: var(--brand-600); }
.op-link.primary:hover { color: var(--brand-700); }
.op-link.gold { color: var(--gold-600); }
.op-link.gold:hover { color: var(--gold-500); }
.op-link.danger { color: var(--danger); }
.op-link.danger:hover { color: var(--danger); border-bottom-color: currentColor; }
.op-link[disabled] {
  color: var(--ink-400);
  cursor: not-allowed;
  border-bottom: 0;
}
.op-link[disabled]:hover { color: var(--ink-400); border-bottom: 0; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block; margin-bottom: 6px;
  font-weight: 500; color: var(--ink-700); font-size: 13px;
}
.field > label .req { color: var(--danger); margin-left: 3px; }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--ink-400); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(34, 128, 95, .12);
}
.textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
.input[readonly] { background: #f7f9f8; color: var(--ink-500); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* ---------------- 卡片 / 面板 ---------------- */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-body { padding: 20px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 30, 25, .48);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 640px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2);
  overflow: hidden;
}
.modal.wide { max-width: 860px; }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 20px; color: var(--ink-400); cursor: pointer; border-radius: 6px; line-height: 1;
}
.modal-close:hover { background: var(--line-soft); color: var(--ink-900); }
.modal-body { padding: 22px; overflow: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line-soft); background: #fafcfb;
}

/* ---------------- 提示条 ---------------- */
.toast-wrap {
  position: fixed; top: 20px; right: 20px; z-index: 1200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 240px; max-width: 380px;
  padding: 12px 16px; border-radius: 10px;
  background: #fff; border-left: 4px solid var(--brand-500);
  box-shadow: var(--shadow-lg); font-size: 13px;
  animation: slideIn .22s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast strong { display: block; margin-bottom: 2px; font-size: 14px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px) } to { opacity: 1; transform: none } }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 11px 14px;
  background: #f7faf9; color: var(--ink-500);
  font-weight: 600; font-size: 12px; letter-spacing: .02em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--brand-50); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl .num { font-variant-numeric: tabular-nums; }
.empty {
  padding: 56px 20px; text-align: center; color: var(--ink-400);
}
.empty .ico { font-size: 34px; opacity: .5; margin-bottom: 10px; }

/* ---------------- 打印 ---------------- */
@media print {
  body { background: #fff; }
  .no-print, .admin-side, .admin-top, .modal-mask { display: none !important; }
}
