/* 公共样式 */
:root {
  --primary: #88be45;
  --primary-dark: #7aad38;
  --primary-light: #e8f5d8;
  --primary-lighter: #f0f9e8;
  --white: #ffffff;
  --text-main: #333333;
  --text-sub: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  --bg: #f5f8f2;
  --shadow: 0 2px 12px rgba(136,190,69,0.1);
  --red: #e05555;
  --orange: #f5a623;
  --blue: #4a90d9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--text-main);
  background: var(--bg);
  font-size: 14px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 3px 10px rgba(136,190,69,0.3); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #c94444; }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-gray { background: #f0f0f0; color: var(--text-sub); }
.btn-gray:hover { background: #e5e5e5; }
.btn-warning { background: #f5a623; color: white; }
.btn-warning:hover { background: #e09620; }
.btn-info { background: #4a90d9; color: white; }
.btn-info:hover { background: #3a80c9; }
.btn-success { background: #5a9a20; color: white; }
.btn-success:hover { background: #4a8a18; }
.btn-disabled { background: #e0e0e0; color: #999; cursor: not-allowed; pointer-events: none; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-success { background: #e8f5d8; color: #5a9a20; }
.tag-warning { background: #fff4e6; color: #d48806; }
.tag-danger  { background: #ffeaea; color: #c0392b; }
.tag-default { background: #f0f0f0; color: #888; }

/* 模态框 */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
  width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; color: var(--text-main); }
.modal-close {
  width: 28px; height: 28px;
  border: none; background: #f5f5f5; border-radius: 50%;
  cursor: pointer; font-size: 16px; color: #888;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: #e8e8e8; color: #333; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1/-1; }
.form-item label { font-size: 13px; color: var(--text-sub); font-weight: 500; }
.form-item input, .form-item select, .form-item textarea {
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-main);
  background: #fafafa;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-item textarea { height: 60px; padding: 8px 10px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(136,190,69,0.1);
}

/* Toast */
.toast {
  position: fixed;
  top: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: white;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  pointer-events: none;
}
.toast.success { background: #5a9a20; }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--orange); }
@keyframes toastIn {
  from { opacity: 0; top: 10px; }
  to   { opacity: 1; top: 24px; }
}

/* 确认框 */
.confirm-box { width: 360px; }
.confirm-body { padding: 24px; text-align: center; }
.confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-body p { color: var(--text-main); font-size: 15px; line-height: 1.6; }

/* 无数据 */
.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }
