/*
 * 兴农购管理后台 · 公共样式
 * v1.0（2026-10-28）：首版原型。配色照现有后台截图：蓝色渐变顶栏、浅灰左侧菜单、页签栏、青绿分页
 * 遵守全局 UI 铁律：弹窗居中、按钮全部有边线、弹窗内边距 ≥32px、同行按钮等大
 */

:root {
  --blue: #1e9fff;          /* 查询、链接等主操作蓝 */
  --blue-dark: #1482d6;
  --teal: #16b5a0;          /* 分页、选中页签青绿，取自现有后台 */
  --teal-dark: #109583;
  --red: #e5484d;
  --red-dark: #c73a3f;
  --orange: #f59e0b;
  --line: #e6e8eb;
  --line-gray: #d1d5db;     /* 次要按钮边线 */
  --text: #333;
  --text-light: #888;
  --bg: #f2f3f5;
  --side-width: 200px;
  --head-height: 104px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
/* v1.1（2026-10-29）：顶栏高度 64→104px，logo 60px，标题 36px，左侧菜单顶部留 20px 空隙 */
.admin-header {
  height: var(--head-height);
  background: linear-gradient(90deg, #4f7fd1 0%, #7aa3e3 60%, #a9c4ec 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.admin-header .platform-name { display: flex; align-items: center; gap: 14px; font-size: 36px; font-weight: 600; letter-spacing: 2px; white-space: nowrap; }
.admin-header .platform-name img { height: 60px; width: 60px; border-radius: 10px; }
.admin-header .header-right { display: flex; align-items: center; gap: 28px; font-size: 13px; }
.admin-header .btn-orange-solid { background: #f97316; border: 1px solid #ea580c; color: #fff; padding: 6px 22px; border-radius: 4px; font-size: 14px; cursor: pointer; }

/* ---------- 左侧菜单 ---------- */
.admin-body { display: flex; height: calc(100% - var(--head-height)); }
.admin-side {
  width: var(--side-width); flex-shrink: 0; background: #f7f8fa;
  border-right: 1px solid var(--line); overflow-y: auto; padding-top: 20px;
}
.admin-side .side-brand {
  height: 48px; line-height: 48px; text-align: center; font-size: 16px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.admin-side .menu-group-title { padding: 14px 16px 6px; font-size: 12px; color: var(--text-light); }
.admin-side .menu-item {
  display: block; padding: 11px 16px 11px 28px; color: var(--text); font-size: 14px;
}
.admin-side .menu-item:hover { background: #eef3fc; text-decoration: none; }
.admin-side .menu-item.active { background: #8ab4f8; color: #fff; }
.admin-side .menu-badge {
  float: right; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}

/* ---------- 内容区 ---------- */
.admin-main { flex: 1; min-width: 0; overflow: auto; padding: 16px; }
.page-card { background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.page-title-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.page-title { font-size: 16px; font-weight: 600; }
.page-desc { font-size: 12px; color: var(--text-light); margin-left: 12px; font-weight: normal; }
/* ---------- 页签：身份页签（下划线）+ 状态页签（分段按钮） ---------- */
.role-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 20px; }
.role-tab {
  padding: 14px 20px; cursor: pointer; color: #555; border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.role-tab:hover { color: var(--teal); }
.role-tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.count { display: inline-block; margin-left: 4px; color: var(--text-light); font-weight: normal; }
.role-tab.active .count { color: var(--teal); }

.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.toolbar .spacer { flex: 1; }
.status-tabs { display: inline-flex; }
.status-tab {
  padding: 0 18px; height: 34px; line-height: 32px; cursor: pointer; background: #fff;
  border: 1px solid var(--line-gray); margin-left: -1px; color: #555; white-space: nowrap;
}
.status-tab:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.status-tab:last-child { border-radius: 0 4px 4px 0; }
.status-tab.active { background: var(--teal); border-color: var(--teal); color: #fff; position: relative; }
.status-tab.active .count { color: #fff; }

/* ---------- 输入框（标题融入 placeholder，不单独占行） ---------- */
.input, .select {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-gray); border-radius: 4px;
  font-size: 14px; background: #fff; color: var(--text);
}
.input:focus, .select:focus { outline: none; border-color: var(--blue); }
.input-search { width: 260px; }

/* ---------- 按钮：全部有边线；实心=待办动作，空心=查看/次要 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 16px;
  border-radius: 4px; font-size: 14px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-gray); background: #fff; color: #555;
}
.btn:hover { border-color: #9ca3af; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-line-blue { color: var(--blue); border-color: var(--blue); }
.btn-line-red { color: var(--red); border-color: var(--red); }
.btn-line-teal { color: var(--teal); border-color: var(--teal); }
/* 表格行内小按钮统一 66px 宽（放得下 4 个字），同一行按钮大小完全一致 */
.btn-sm { height: 28px; padding: 0 4px; font-size: 13px; width: 66px; }
.btn-group { display: inline-flex; gap: 8px; justify-content: flex-end; }

/* ---------- 表格：名称列不挤压，横向超出时表格内部滚动 ---------- */
.table-box { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
}
.data-table th { background: #fafbfc; font-weight: 600; color: #555; }
.data-table tbody tr:hover { background: #f7faff; }
.data-table .col-name { min-width: 240px; white-space: normal; }
.data-table .col-money { text-align: right; }
.data-table .col-action { text-align: right; }
.data-table .empty { text-align: center; color: var(--text-light); padding: 48px 0; }
.data-table tr.row-disabled td { color: #aaa; }

.tag {
  display: inline-block; padding: 0 8px; line-height: 22px; border-radius: 3px; font-size: 12px;
  border: 1px solid transparent; margin-right: 4px;
}
.tag-green { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.tag-orange { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.tag-red { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.tag-blue { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.tag-gray { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* ---------- 分页（青绿，照现有后台） ---------- */
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 20px; color: #666; }
.pager .page-num {
  min-width: 30px; height: 30px; line-height: 28px; text-align: center; border: 1px solid var(--line-gray);
  border-radius: 3px; cursor: pointer; background: #fff;
}
.pager .page-num.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- 统计卡片 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 16px; }
.stat-card .stat-label { color: var(--text-light); font-size: 13px; }
.stat-card .stat-value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--blue); }
/* ---------- 弹窗：一律垂直水平居中，四角圆角一致，内边距 32px ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 8px; width: 560px; max-width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-box.modal-wide { width: 960px; }
.modal-box.modal-small { width: 420px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-head .modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border: 1px solid var(--line-gray); border-radius: 4px; background: #fff;
  cursor: pointer; font-size: 16px; color: #888; line-height: 28px;
}
.modal-body { padding: 24px 32px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 12px; padding: 16px 32px;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.modal-foot .btn { min-width: 96px; }
.modal-message { line-height: 1.8; color: #444; }

/* 弹窗内页签 */
.inner-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px 0 20px; }
.inner-tab { padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: #555; }
.inner-tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.inner-panel { display: none; }
.inner-panel.active { display: block; }

/* 详情：两列信息表 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.info-row { display: flex; padding: 10px 0; border-bottom: 1px dashed #eceef1; }
.info-row .info-label { width: 110px; flex-shrink: 0; color: var(--text-light); }
.info-row .info-value { flex: 1; word-break: break-all; }
.info-row.full { grid-column: 1 / -1; }
.section-title { font-size: 14px; font-weight: 600; margin: 20px 0 10px; padding-left: 8px; border-left: 3px solid var(--teal); }
.section-title:first-child { margin-top: 0; }

/* 上传资料缩略图（原型用色块代替真实图片） */
.file-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; cursor: pointer; }
.file-card:hover { border-color: var(--blue); }
.file-thumb {
  height: 96px; background: repeating-linear-gradient(45deg, #f3f6fb, #f3f6fb 8px, #e9eef7 8px, #e9eef7 16px);
  display: flex; align-items: center; justify-content: center; color: #7b8aa6; font-size: 12px;
}
.file-name { padding: 6px 8px; font-size: 12px; text-align: center; border-top: 1px solid var(--line); }
.file-card.missing .file-thumb { background: #fafafa; color: #c0c4cc; }

/* 表单：标题融入 placeholder；必须单独说明的字段用左侧小标题，同一行不占整行 */
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.form-row .form-label { width: 96px; flex-shrink: 0; color: #555; text-align: right; }
.form-row .form-control { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-row .input, .form-row .select { flex: 1; min-width: 0; }
.form-hint { font-size: 12px; color: var(--text-light); }
.required::before { content: "*"; color: var(--red); margin-right: 2px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-right: 16px; }

/* 收费标准组合卡片 */
.fee-block { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 14px; }
.fee-block-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #fafbfc; font-weight: 600; }
.fee-block-head .form-hint { font-weight: normal; }
.fee-block-body { padding: 14px 16px; display: none; }
.fee-block.on .fee-block-body { display: block; }
.fee-block.on { border-color: var(--teal); }

/* 证据链时间轴 */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--teal);
}
.timeline-item.missing::before { border-color: #cbd5e1; }
.timeline-item .tl-title { font-weight: 600; }
.timeline-item .tl-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* 简易柱状图（月度统计） */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding: 12px 8px 0; border-bottom: 1px solid var(--line); }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-fill { width: 100%; max-width: 40px; background: var(--teal); border-radius: 3px 3px 0 0; }
.bar-value { font-size: 12px; color: #555; margin-bottom: 4px; }
.bar-label { display: flex; gap: 14px; padding: 6px 8px 0; }
.bar-label span { flex: 1; text-align: center; font-size: 12px; color: var(--text-light); }

/* 截屏预览卡（发银联用） */
.snapshot-card { border: 1px solid #cbd5e1; border-radius: 6px; padding: 24px 28px; background: #fbfcfe; }
.snapshot-card .snap-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 16px; }
.snapshot-card table { width: 100%; border-collapse: collapse; }
.snapshot-card td { border: 1px solid #dfe3ea; padding: 8px 10px; }
.snapshot-card td:first-child { width: 120px; background: #f3f5f9; color: #555; }

/* 提示条 */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 2000;
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 4px; display: none;
}
.toast.show { display: block; }
.notice-bar {
  margin: 0 20px 14px; padding: 10px 14px; border: 1px solid #fde68a; background: #fffbeb;
  color: #92400e; border-radius: 4px; font-size: 13px;
}
