/* ========== 设计系统：色彩变量、基础组件 ==========
   参照 需求确认过程文档/images 里的线框图配色重做（深蓝标题/绿色主操作/橙色强调/浅蓝信息条/圆角徽章） */

:root {
  --color-primary: #1a73c7;
  --color-primary-dark: #145a9e;
  --color-success: #43a047;
  --color-success-dark: #357a38;
  --color-warning: #f39c12;
  --color-warning-dark: #d1830a;
  --color-danger: #e74c3c;
  --color-danger-bg: #fdecea;
  --color-danger-text: #c0392b;
  --color-info-bg: #eaf3fc;
  --color-info-border: #b8dcf7;
  --color-page-bg: #f4f6f9;
  --color-card-bg: #ffffff;
  --color-border: #e1e5ea;
  --color-text: #2c3e50;
  --color-text-muted: #8a96a3;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  margin: 0;
  background: var(--color-page-bg);
  color: var(--color-text);
}

a { color: var(--color-primary); }

/* ---------- 标题条 ---------- */
.header-bar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.header-bar.warning { background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark)); }

/* ---------- 信息摘要条 ---------- */
.info-box {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.info-box .info-item { font-size: 14px; }
.info-box .info-item .label { color: var(--color-text-muted); margin-right: 6px; }
.info-box .info-item .value { font-weight: 600; }

/* ---------- 状态徽章 ---------- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: #e6f7ec; color: #1e8e3e; }
.badge-info { background: #e8f0fe; color: #1967d2; }
.badge-muted { background: #eef1f4; color: #8a96a3; }
.badge-warning { background: #fff4e0; color: #b26a00; }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, opacity .15s;
  background: #eef1f4;
  color: var(--color-text);
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; }
.btn-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.btn-outline-primary {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid rgba(26, 115, 199, .28);
}
.btn-outline-primary:hover {
  background: var(--color-info-bg);
  filter: none;
}
.btn-icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--color-card-bg); }
th, td { padding: 10px 14px; font-size: 14px; text-align: left; }
th {
  color: var(--color-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 2px solid var(--color-border);
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-card-bg);
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 var(--color-border);
}
td { border-bottom: 1px solid var(--color-border); }
tbody tr:nth-child(even) td { background: #fafbfc; }
tbody tr:hover td { background: #f0f3f6; }
.status-inactive { color: var(--color-text-muted); }

/* ---------- 表单弹框 ---------- */
.form-box {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
  overflow: auto;
}
.form-box.open { display: flex; }
.form-panel {
  width: min(560px, 100%);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
  overflow: hidden;
}
.form-panel h3 {
  margin: 0;
  padding: 18px 20px 8px;
}
.form-box label {
  display: block;
  padding: 10px 20px 0;
  font-size: 13px;
  color: var(--color-text-muted);
}
.form-panel .form-actions,
.form-panel .form-footer {
  padding: 16px 20px 20px;
}
.form-box input, .form-box select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
}
.form-box .form-actions {
  display: flex;
  gap: 8px;
}

/* ---------- 拖拽上传区 ---------- */
.dropzone {
  border: 2px dashed #b7d3ef;
  border-radius: var(--radius);
  background: #f8fbfe;
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
  margin-top: 16px;
}
.dropzone.dragover { border-color: var(--color-primary); background: var(--color-info-bg); }
.dropzone.disabled { opacity: .5; }
.dropzone-icon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid var(--color-primary); color: var(--color-primary);
  margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}

/* ---------- 消息提示 ---------- */
#message, .message-text { margin-top: 12px; font-size: 14px; color: var(--color-danger-text); }
.message-success { color: var(--color-success-dark); }

/* ---------- 弹窗（用 .form-box 模拟居中弹窗时使用） ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 10px; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; }
.modal-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.modal-header .close-btn { cursor: pointer; background: none; border: none; color: #fff; font-size: 18px; line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--color-border); text-align: center; }

/* ---------- 页脚 ---------- */
.page-footer { margin-top: 30px; padding: 14px; text-align: center; color: var(--color-text-muted); font-size: 12px; background: #f8f9fb; border-radius: var(--radius); }
