/* ===== 基础变量与重置 ===== */
:root {
  --primary-color: #F03292;
  --primary-hover: #d92c82;
  --primary-light: #FDE8F3;
  --text-color: #222;
  --text-secondary: #555;
  --muted-color: #999;
  --border-color: #eee;
  --bg-color: #f8f8f8;
  --white: #fff;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --blue: #3498db;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

/* ===== 容器 ===== */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* ===== 头部 ===== */
.header {
  text-align: center;
  padding: 24px 0 16px;
}
.header h1 {
  font-size: 22px;
  color: var(--primary-color);
}
.header .subtitle {
  font-size: 13px;
  color: var(--muted-color);
  margin-top: 4px;
}

/* ===== 步骤条 ===== */
.steps-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
}
.steps-bar::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border-color);
  z-index: 0;
}
.step-item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--muted-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}
.step-item.active .step-dot {
  background: var(--primary-color);
  color: #fff;
}
.step-item.done .step-dot {
  background: var(--success);
  color: #fff;
}
.step-label {
  font-size: 11px;
  color: var(--muted-color);
  display: block;
}
.step-item.active .step-label {
  color: var(--primary-color);
  font-weight: bold;
}

/* ===== 卡片 ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}
.card-subtitle {
  font-size: 13px;
  color: var(--muted-color);
  margin-bottom: 12px;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 16px;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}
.form-input, .form-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-color);
  background: var(--white);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(240, 50, 146, 0.1);
}
.form-input.error {
  border-color: var(--danger);
}
.form-hint {
  font-size: 12px;
  color: var(--muted-color);
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.form-error.show {
  display: block;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  width: 100%;
  height: 48px;
  line-height: 48px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary-color);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.btn-outline {
  background: var(--white);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}
.btn-sm {
  height: 36px;
  line-height: 36px;
  font-size: 14px;
  width: auto;
  padding: 0 20px;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* ===== 提示信息 ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error {
  background: #fde8e8;
  color: var(--danger);
  border: 1px solid #f5c6cb;
}
.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}
.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ===== 结果页 ===== */
.result-header {
  background: linear-gradient(135deg, var(--primary-color), #e02a7a);
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -16px -16px 0;
}
.result-header h2 {
  font-size: 22px;
  margin-bottom: 6px;
}
.result-section {
  margin-top: 16px;
}

/* ===== 表格(手机端) ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  background: var(--bg-color);
  white-space: nowrap;
}
td {
  color: var(--text-color);
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}

/* ===== 联系方式卡片 ===== */
.contact-card {
  background: var(--primary-light);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.contact-card .contact-name {
  font-size: 17px;
  font-weight: bold;
  color: var(--primary-color);
}
.contact-card .contact-info {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.8;
}
.contact-qrcode {
  width: 120px;
  height: 120px;
  margin: 10px auto;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.contact-qrcode img {
  max-width: 100%;
  max-height: 100%;
}

/* ===== 风险提示列表 ===== */
.risk-list {
  list-style: none;
}
.risk-list li {
  padding: 10px 14px;
  background: #fff3cd;
  border-left: 3px solid var(--warning);
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #856404;
}
.risk-list li.suggestion {
  background: #d1ecf1;
  border-left-color: var(--blue);
  color: #0c5460;
}

/* ===== 免责声明 ===== */
.disclaimer {
  background: var(--bg-color);
  border-radius: 8px;
  padding: 14px;
  font-size: 12px;
  color: var(--muted-color);
  line-height: 1.7;
  margin-top: 16px;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted-color);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ===== 底部 ===== */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--muted-color);
  font-size: 12px;
}

/* ===== 加载动画 ===== */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--muted-color);
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-bottom: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 后台 ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 220px;
  background: #1a1a2e;
  color: #ccc;
  padding: 20px 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
}
.admin-sidebar .logo {
  padding: 0 20px 20px;
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
  border-bottom: 1px solid #333;
  margin-bottom: 10px;
}
.admin-sidebar a {
  display: block;
  padding: 12px 20px;
  color: #ccc;
  font-size: 14px;
  transition: all 0.2s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(240, 50, 146, 0.15);
  color: var(--primary-color);
}
.admin-main {
  margin-left: 220px;
  flex: 1;
  padding: 24px;
  background: var(--bg-color);
  min-height: 100vh;
}
.admin-main h2 {
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
}

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted-color);
  margin-top: 4px;
}

/* ===== 后台表格 ===== */
.admin-table {
  width: 100%;
  font-size: 13px;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th {
  background: #fafafa;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border-color);
}
.admin-table td {
  padding: 10px;
}

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar input, .filter-bar select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
}
.filter-bar button {
  height: 38px;
  padding: 0 16px;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.tag-a { background: #d4edda; color: #155724; }
.tag-b { background: #d1ecf1; color: #0c5460; }
.tag-c { background: #fff3cd; color: #856404; }
.tag-d { background: #f8d7da; color: #721c24; }
.tag-active { background: #d4edda; color: #155724; }
.tag-used { background: #e2e3e5; color: #383d41; }
.tag-expired { background: #fff3cd; color: #856404; }
.tag-disabled { background: #f8d7da; color: #721c24; }

/* ===== 后台参数表单 ===== */
.param-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.param-form .form-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.param-form .form-row:last-child {
  border-bottom: none;
}
.param-form .param-label {
  flex: 0 0 200px;
  font-size: 14px;
  font-weight: 500;
}
.param-form .param-value {
  flex: 1;
}
.param-form .param-desc {
  font-size: 11px;
  color: var(--muted-color);
  margin-top: 2px;
}
.param-form input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  width: 120px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 60px;
  }
  .admin-sidebar .logo {
    font-size: 14px;
    padding: 10px;
    text-align: center;
  }
  .admin-sidebar a {
    padding: 12px 10px;
    font-size: 11px;
    text-align: center;
  }
  .admin-main {
    margin-left: 60px;
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-bar {
    flex-direction: column;
  }
  .filter-bar input, .filter-bar select {
    width: 100%;
  }
}
