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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}
header h1 { font-size: 20px; }
header nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
header nav a:hover { color: var(--primary-dark); }

/* Container */
.container { max-width: 1100px; margin: 24px auto; padding: 0 24px; }

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  padding: 28px;
  margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 20px; }

/* Channel Section */
.channel-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.channel-header h3 { font-size: 16px; }

/* Toggle Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.switch input { display: none; }
.slider {
  width: 48px; height: 26px;
  background: #cbd5e1;
  border-radius: 13px;
  position: relative;
  transition: background .25s;
}
.slider::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform .25s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::after { transform: translateX(22px); }
.switch-label { font-size: 13px; color: var(--text-muted); min-width: 40px; }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-group textarea { min-height: 80px; resize: vertical; font-family: monospace; font-size: 12px; }

.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}
.hint a { color: var(--primary); }

.btn-save {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: 12px;
}
.btn-save:hover { background: var(--primary-dark); }
.btn-save:active { transform: scale(.98); }

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.info-item label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.info-item code {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
}

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-weight: 600; color: var(--text-muted); font-size: 13px; }
td code { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 13px; }

/* Status Badge */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.empty { color: var(--text-muted); font-size: 14px; }

/* Login Page */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  width: 380px;
  max-width: 90vw;
  text-align: center;
}
.login-box h1 { font-size: 22px; margin-bottom: 8px; }
.login-box .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.login-box button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.login-box button:hover { background: var(--primary-dark); }
.error { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }

/* Pay Page */
.pay-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.pay-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}
.pay-header h1 { font-size: 18px; }
.pay-body {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.pay-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 36px;
  width: 420px;
  max-width: 100%;
  text-align: center;
}
.pay-card .amount {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0 24px;
}
.pay-card .order-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.pay-card .order-meta code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.pay-buttons { display: flex; flex-direction: column; gap: 12px; }
.pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, box-shadow .2s;
}
.pay-btn:active { transform: scale(.98); }
.pay-btn-wechat {
  background: #07c160;
  color: #fff;
}
.pay-btn-wechat:hover { box-shadow: 0 4px 16px rgba(7,193,96,.35); }
.pay-btn-alipay {
  background: #1677ff;
  color: #fff;
}
.pay-btn-alipay:hover { box-shadow: 0 4px 16px rgba(22,119,255,.35); }
.pay-btn-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
}
.pay-paid {
  color: var(--success);
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
}
.pay-qr { margin: 20px 0; }
.pay-qr img { max-width: 220px; border-radius: 8px; }
