/**
 * DD电竞 UI Framework v1
 * 统一组件库 - 所有页面通用
 * 使用方式: <button class="btn btn-primary">按钮</button>
 */

/* ── CSS变量 ── */
:root {
  --green: #0F766E;
  --green-light: #14B8A6;
  --green-bg: #F0FDF9;
  --text: #134D4A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E8F0F2;
  --border-green: rgba(153,245,228,0.4);
  --bg-card: #fff;
  --bg-page: #F8FAFB;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 6px 20px rgba(15,118,110,0.15);
}

/* ════════════════════════════
   按钮系统
   ════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-primary { background: linear-gradient(135deg, var(--green-light), var(--green)); color: #fff; box-shadow: var(--shadow-lg); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-secondary { background: #F1F5F9; color: #475569; }
.btn-secondary:hover { background: #E2E8F0; }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-page); border-color: #94A3B8; }

.btn-danger { background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,0.2); }

.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; border-radius: var(--radius-pill); }
.btn-xs { height: 30px; padding: 0 12px; font-size: 12px; border-radius: var(--radius-pill); }

/* ════════════════════════════
   弹窗系统
   ════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px;
}
body.modal-open { overflow: hidden; position: fixed; width: 100%; }
body.modal-open { overflow: hidden; position: fixed; width: 100%; }

.modal-card {
  background: #fff; border-radius: var(--radius-lg);
  width: min(420px, 92vw) !important;
  max-width: min(420px, 92vw) !important;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  animation: modalIn .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 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; background: #F1F5F9; color: var(--text-muted);
  cursor: pointer; font-size: 16px; transition: all .2s;
}
.modal-close-btn:hover { background: #E2E8F0; color: var(--text); }

.modal-body { padding: 20px 22px; }
.modal-footer {
  display: flex; gap: 10px; padding: 14px 22px 20px;
}
.modal-footer .btn { flex: 1; }
.modal-footer--center { justify-content: center; }
.modal-footer--center .btn { flex: none; min-width: 140px; }

/* ════════════════════════════
   卡片系统
   ════════════════════════════ */
.card {
  background: #fff; border-radius: var(--radius);
  padding: 14px 16px;
}
.card-bordered { border: 1px solid var(--border-green); box-shadow: var(--shadow); }
.card-gradient { background: linear-gradient(135deg, var(--green), #0D9488); color: #fff; }

/* ════════════════════════════
   表单输入
   ════════════════════════════ */
.input {
  width: 100%; height: 48px; padding: 0 16px;
  background: var(--bg-page); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 14px; color: var(--text);
  outline: none; box-sizing: border-box;
  transition: border .2s;
}
.input:focus { border-color: var(--green-light); background: #fff; }
.input::placeholder { color: var(--text-light); }

.label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ════════════════════════════
   标签/Badge
   ════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.badge-pending { background: #FCF2E0; color: #D97706; }
.badge-done { background: rgba(15,118,110,0.1); color: var(--green); }
.badge-rejected { background: rgba(239,68,68,0.1); color: #EF4444; }

/* ════════════════════════════
   布局工具
   ════════════════════════════ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.flex-none { flex: none; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-green { color: var(--green); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.p-0 { padding: 0; }
.p-12 { padding: 12px; }
.p-14 { padding: 14px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.m-0 { margin: 0; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }

.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-pill { border-radius: var(--radius-pill); }

/* ════════════════════════════
   表格系统
   ════════════════════════════ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.table th {
  padding: 10px 12px; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--border);
}
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td {
  padding: 14px 12px; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--border-green);
  border-left: none; border-right: none;
}
.table td:first-child { border-left: 1px solid var(--border-green); border-radius: 10px 0 0 10px; }
.table td:last-child { border-right: 1px solid var(--border-green); border-radius: 0 10px 10px 0; }

/* ════════════════════════════
   响应式
   ════════════════════════════ */
@media (max-width: 767px) {
  .modal-card { border-radius: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 10px 16px 16px; }
  .btn { height: 40px; font-size: 13px; padding: 0 18px; }
  .card { padding: 12px; }
  .hide-mobile { display: none; }
}
