/* ========== 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #00d4ff;
  --primary-hover: #00b8e6;
  --primary-glow: rgba(0, 212, 255, 0.3);
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #0a0e27;
  --bg-alt: #0f1535;
  --card: rgba(20, 24, 50, 0.85);
  --card-border: rgba(0, 212, 255, 0.15);
  --text: #e2e8f0;
  --text-muted: #8892b0;
  --border: rgba(0, 212, 255, 0.2);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --glow: 0 0 20px rgba(0, 212, 255, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0, 212, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(124, 58, 237, 0.06) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== 容器 ========== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
}

.card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: var(--shadow), var(--glow);
  transition: all 0.3s ease;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary);
  letter-spacing: 0.5px;
}

/* ========== 表单 ========== */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: rgba(15, 21, 53, 0.8);
  color: var(--text);
}

.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-input:disabled { background: rgba(10, 14, 39, 0.6); color: var(--text-muted); }

.input-group {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.input-group .form-input { flex: 1; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  width: 100%;
}

.btn:active { transform: scale(.98); }

.btn-primary { background: var(--primary); color: #0a0e27; font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--glow); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 0 16px rgba(16, 185, 129, 0.3); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: rgba(0, 212, 255, 0.08); box-shadow: var(--glow); }

.btn-sm { padding: 6px 14px; font-size: 13px; width: auto; }
.btn-xs { padding: 3px 10px; font-size: 12px; width: auto; border-radius: 6px; }

/* ========== 帮助图标 ========== */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--accent-glow);
}

.help-link {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  margin-left: 8px;
  white-space: nowrap;
}

/* ========== 弹窗 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-alt);
  color: var(--text);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 图片轮播 ========== */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-alt);
  margin-bottom: 12px;
}

.carousel-track {
  display: flex;
  transition: transform .3s ease;
}

.carousel-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.carousel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-radius: 8px;
  width: 100%;
  min-height: 200px;
}

.carousel-placeholder .icon { font-size: 40px; margin-bottom: 8px; }
.carousel-placeholder .text { font-size: 14px; }

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.carousel-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.carousel-nav button:hover { background: rgba(0, 212, 255, 0.1); }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.2);
  border: none;
  cursor: pointer;
}

.carousel-dot.active { background: var(--primary); box-shadow: 0 0 6px var(--primary-glow); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: opacity .3s;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ========== 统计看板 ========== */
.stats-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.stats-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.stats-tab:hover { background: rgba(0, 212, 255, 0.08); }
.stats-tab.active {
  background: var(--primary);
  color: #0a0e27;
  border-color: var(--primary);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-item {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== 信息行 ========== */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.info-row:last-child { border-bottom: none; }

.info-label { color: var(--text-muted); }
.info-value { font-weight: 500; }

/* ========== 标签 ========== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.badge-verified { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-unverified { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-processed { background: rgba(0, 212, 255, 0.15); color: #00d4ff; }
.badge-unprocessed { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* ========== 链接复制 ========== */
.invite-link-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.invite-link-box .form-input {
  flex: 1;
  font-family: monospace;
  font-size: 13px;
  background: rgba(15, 21, 53, 0.8);
  color: var(--primary);
}

/* ========== 表格 ========== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: var(--bg-alt);
  font-weight: 600;
  position: sticky;
  top: 0;
  color: var(--primary);
}

/* ========== 页面头部 ========== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  margin-bottom: 8px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* ========== PC 适配 ========== */
@media (min-width: 769px) {
  .container { max-width: 640px; padding: 24px; }
  .card { padding: 28px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  table { font-size: 14px; }

  .admin-container { max-width: 960px; }
}

/* 管理后台专用 */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

@media (min-width: 769px) {
  .admin-container { padding: 24px; }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: transparent;
}

.empty-state .icon { font-size: 48px; margin-bottom: 10px; }

/* ========== 单选按钮 ========== */
.radio-group {
  display: flex;
  gap: 24px;
  margin-top: 4px;
}

.radio-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400 !important;
  cursor: pointer;
  margin-bottom: 0 !important;
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ========== 汉堡菜单 ========== */
.hamburger-menu {
  position: relative;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hamburger-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: var(--glow);
}

.hamburger-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), var(--glow);
  z-index: 100;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.hamburger-dropdown.active {
  display: block;
}

.hamburger-dropdown a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.hamburger-dropdown a:last-child {
  border-bottom: none;
}

.hamburger-dropdown a:hover {
  background: rgba(0, 212, 255, 0.08);
  color: var(--primary);
}

/* 点击空白处关闭 */
.hamburger-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
}

.hamburger-backdrop.active {
  display: block;
}
