/* 付费进群系统 - 全局样式 */
:root {
  --bg: #f0f2f5;
  --card: #fff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --primary: #e85d04;
  --primary-dark: #d00000;
  --accent: #370617;
  --ok: #16a34a;
  --warn: #ca8a04;
  --danger: #dc2626;
  --border: #e5e7eb;
  --sidebar: #1f2937;
  --sidebar-text: #e5e7eb;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,.06);
  --font: "PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 22px 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: .5px;
}
.sidebar .brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
  margin-top: 4px;
}
.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: #d1d5db;
  font-size: 14px;
  transition: .15s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(232,93,4,.15);
  color: #fff;
  border-right: 3px solid var(--primary);
}
.sidebar .foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: #9ca3af;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.content { padding: 24px; flex: 1; }

/* Cards & Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--accent);
}
.stat-card .value.money { color: var(--primary); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.card-header h2 { font-size: 16px; font-weight: 600; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border .15s;
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,93,4,.12);
}
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; color: #111; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: #f9fafb;
  font-weight: 600;
  color: #4b5563;
  font-size: 13px;
  white-space: nowrap;
}
tr:hover td { background: #fafafa; }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef9c3; color: #854d0e; }
.badge-muted { background: #f3f4f6; color: #6b7280; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #e0f2fe; color: #075985; }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(232,93,4,.18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(55,6,23,.12), transparent 50%),
    linear-gradient(160deg, #fff7ed 0%, #f0f2f5 50%, #fef2f2 100%);
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.1);
}
.login-box h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 6px;
}
.login-box .sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}

/* Empty */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

/* Link copy */
.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-box input { flex: 1; }

/* Modal simple */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }

/* Pagination */
.pager {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pager a, .pager span {
  padding: 6px 12px;
  border-radius: 6px;
  background: #f3f4f6;
  font-size: 13px;
  color: #374151;
}
.pager a:hover { background: var(--primary); color: #fff; }
.pager .cur { background: var(--primary); color: #fff; }

/* Template cards */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.tpl-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: .15s;
  text-align: center;
}
.tpl-card:hover, .tpl-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,93,4,.15);
}
.tpl-preview {
  height: 100px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}
.tpl-classic { background: linear-gradient(135deg, #e85d04, #d00000); }
.tpl-business { background: linear-gradient(135deg, #1e3a5f, #3b82f6); }
.tpl-fresh { background: linear-gradient(135deg, #059669, #34d399); }
.tpl-chuangke { background: linear-gradient(135deg, #3b82f6, #8b5cf6 50%, #ec4899); }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0; }
  .sidebar nav a {
    white-space: nowrap;
    border-right: none !important;
    border-bottom: 3px solid transparent;
  }
  .sidebar nav a.active { border-bottom-color: var(--primary); }
  .content { padding: 16px; }
}
