* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #eef2ff 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;   /* 空间不足时允许换行，避免右侧链接被挤出视口 */
  gap: 6px 12px;
}
.brand {
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 110;
  flex-wrap: wrap;   /* 链接组内部也可换行，保证始终在可视区内 */
  gap: 2px 4px;
}
.nav-links a {
  margin-left: 16px;
  text-decoration: none;
  color: var(--text);       /* 深色，明确可点击，避免误判为禁用 */
  font-size: 15px;
  padding: 6px 2px;
  transition: color 0.2s;
  cursor: pointer;
  white-space: nowrap;      /* 链接文字不换行，避免内部断裂 */
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
}

/* ---------- 响应式适配 ---------- */
/* 平板（窄屏）：压缩间距与标题 */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .card { padding: 24px 20px; }
  h1 { font-size: 24px; }
  .hero h1 { font-size: 30px; }
  .stat-card .value { font-size: 22px; }
  .filters input[type="search"] { width: 100%; }
}

/* 手机（<=640px）：导航链接占满一行换行，卡片紧凑，网格单列，横向表格可滑动 */
@media (max-width: 640px) {
  .nav-inner {
    padding: 12px 14px;
    gap: 8px;
  }
  .brand { font-size: 19px; }
  .nav-links {
    width: 100%;            /* 占满一行，链接换行展示 */
    justify-content: flex-start;
    gap: 4px 12px;
  }
  .nav-links a {
    margin-left: 0;         /* 用 gap 控制间距 */
    font-size: 14px;
    padding: 5px 0;
  }

  /* 页面主体手机适配 */
  .container { padding: 0 14px; }
  .card { padding: 20px 14px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; }

  /* hero 标题缩小，保证不溢出 */
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; }

  /* 步骤卡片：单列堆叠，去掉过大留白 */
  .steps { gap: 12px; margin: 22px 0; }
  .step { min-width: 100%; max-width: 100%; padding: 16px; }

  /* 统计卡：单列 */
  .stats { grid-template-columns: 1fr; gap: 10px; }

  /* 管理头部：按钮换行，避免挤压 */
  .admin-head { flex-direction: column; align-items: stretch; }
  .admin-auth { flex-direction: column; }
  .admin-auth input { width: 100%; }

  /* 筛选区：输入框/下拉占满整行，方便触控 */
  .filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters input[type="search"],
  .filters select { width: 100%; margin: 0; }

  /* 表单/按钮触控友好 */
  input[type="text"], input[type="email"], input[type="password"], input[type="search"],
  .btn, select {
    font-size: 16px;        /* 防 iOS 缩放 */
  }
  .btn { padding: 12px 16px; }

  /* 结果页激活码：缩小字号防止横向溢出 */
  .code-box { font-size: 18px; letter-spacing: 1px; padding: 16px; word-break: break-all; }

  /* 价格区 */
  .price-tag strong { font-size: 22px; }

  /* 横向表格：保持可滚动容器，表内文字紧凑 */
  .table { font-size: 13px; }
  .table th, .table td { padding: 10px 8px; }

  /* 下载页按钮不撑太宽 */
  .btn-block { max-width: 100% !important; }
}

/* 超小屏（<=400px）：进一步压缩，保证所有内容在视口内 */
@media (max-width: 400px) {
  .brand { font-size: 17px; }
  .nav-links a { font-size: 13px; }
  .card { padding: 16px 12px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

h1 { font-size: 26px; margin-bottom: 10px; color: var(--text); font-weight: 700; }
h2 { font-size: 18px; color: var(--text); }
.muted { color: var(--muted); font-size: 15px; }
.small { font-size: 13px; }

label { display: block; margin-bottom: 8px; font-weight: 600; color: #334155; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* 密码可见性切换 */
.pwd-wrap {
  position: relative;
  margin-bottom: 18px;
}
.pwd-wrap input {
  margin-bottom: 0;
  padding-right: 46px;
}
.toggle-pwd {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 8px;
  color: var(--muted);
  transition: color 0.2s;
}
.toggle-pwd:hover { color: var(--primary); }

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; display: flex; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.btn.success { background: var(--success); color: #fff; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); }
.btn.ghost { background: #f1f5f9; color: #334155; border: 1px solid var(--border); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.msg { margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 14px; display: none; }
.msg.show { display: block; animation: fadeIn 0.3s ease; }
.msg.error { background: #fee2e2; color: #991b1b; }
.msg.success { background: #d1fae5; color: #065f46; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.order-info { margin: 20px 0; padding: 18px 20px; background: #f8fafc; border-radius: 12px; border: 1px solid var(--border); }
.order-info p { margin-bottom: 8px; font-size: 14px; }
.order-info p:last-child { margin-bottom: 0; }
.order-info strong { color: var(--primary); font-size: 20px; }

.hero { text-align: center; padding: 20px 0 8px; }
.hero h1 { font-size: 34px; background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--muted); font-size: 16px; }

.steps { display: flex; gap: 16px; margin: 28px 0; flex-wrap: wrap; justify-content: center; }
.step {
  flex: 1; min-width: 180px; max-width: 260px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; text-align: center;
}
.step .num {
  width: 36px; height: 36px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--muted); }

.price-tag { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.price-tag strong { color: var(--danger); font-size: 26px; }

.result-card { text-align: center; }
.result-icon {
  width: 72px; height: 72px; margin: 0 auto 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}
.code-box {
  font-size: 24px; font-weight: 700; letter-spacing: 2px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #34d399;
  padding: 22px; border-radius: 12px; margin: 24px 0;
  word-break: break-all;
  user-select: all;
}
.result-meta { text-align: left; }

.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.admin-head h1 { margin: 0; }
.admin-auth { display: flex; gap: 10px; }
.admin-auth input { width: 220px; margin: 0; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters input[type="search"] { width: 260px; margin: 0; }
.filters select {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; background: #fff; outline: none; cursor: pointer;
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px; }
.table tr:hover td { background: #fafbff; }

.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.paid { background: #d1fae5; color: #065f46; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.failed { background: #fee2e2; color: #991b1b; }

.mono { font-family: "JetBrains Mono", "Courier New", monospace; font-size: 13px; }
.hidden-val { letter-spacing: 1px; color: #94a3b8; user-select: none; }
.copy-ico {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 3px;
  vertical-align: middle;
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.1s;
}
.copy-ico:hover { opacity: 1; transform: scale(1.1); }
.copy-ico:active { transform: scale(0.9); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.pagination span { color: var(--muted); font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px;
}
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-card.paid .value { color: var(--success); }
.stat-card.pending .value { color: var(--warning); }
.stat-card.total .value { color: var(--primary); }
