:root {
  --primary: #5b5fc7;
  --primary-hover: #4a4eb8;
  --secondary: #0078d4;
  --success: #107c10;
  --warning: #ffb900;
  --danger: #d13438;
  --text: #242424;
  --text-secondary: #616161;
  --text-muted: #8a8a8a;
  --border: #e0e0e0;
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 隐藏滚动条 */
::-webkit-scrollbar { display: none; }
html, body { scrollbar-width: none; -ms-overflow-style: none; }

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif; 
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

.page { padding: 0 16px 20px; max-width: 480px; margin: 0 auto; }
.page-center { 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  padding: 20px;
}

.loading-box { text-align: center; }
.loading-spinner { 
  width: 32px; height: 32px; 
  border: 3px solid var(--border); 
  border-top-color: var(--primary); 
  border-radius: 50%; 
  animation: spin 0.8s linear infinite; 
  margin: 0 auto 12px; 
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box p { color: var(--text-muted); font-size: 13px; }

.auth-card { 
  background: var(--bg-card); 
  border-radius: 12px; 
  padding: 32px 24px; 
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-logo { 
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.auth-logo i { font-size: 28px; color: #fff; }
.auth-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.auth-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group input, .auth-card input { 
  width: 100%; 
  padding: 12px 14px; 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  font-size: 14px;
}
.form-group input:focus, .auth-card input:focus { 
  border-color: var(--primary); 
  outline: none; 
  box-shadow: 0 0 0 2px rgba(91,95,199,0.15);
}

.btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px; 
  border: none; 
  border-radius: var(--radius); 
  font-size: 14px; 
  font-weight: 500;
  cursor: pointer; 
  transition: all 0.15s;
}
.btn i { font-size: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-lg { padding: 12px 24px; }
.btn-block { width: 100%; }

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.header-icon { font-size: 22px; color: var(--primary); }
.header-title { font-size: 17px; font-weight: 600; }
.header-right { font-size: 12px; color: var(--text-muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow);
}
.stat-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-header i { font-size: 14px; }
.stat-value { font-size: 18px; font-weight: 600; }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.card-title { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  font-size: 14px; 
  font-weight: 600; 
}
.card-title i { font-size: 16px; color: var(--primary); }
.user-id-copy { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  font-size: 12px; 
  color: var(--text-muted); 
}
.user-id-copy i { cursor: pointer; font-size: 14px; }
.user-id-copy i:hover { color: var(--primary); }

.recharge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.recharge-item {
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.recharge-item:hover { border-color: var(--primary); }
.recharge-item.active { 
  border-color: var(--primary); 
  background: var(--primary); 
  color: #fff; 
}
.recharge-action {
  display: flex;
  gap: 8px;
}
.recharge-action input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.recharge-action input:focus { border-color: var(--primary); outline: none; }

.tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.tab i { font-size: 15px; }
.tab.active { background: var(--primary); color: #fff; }

.panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.sub-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 16px;
}
.sub-tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.sub-tab.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow); }

.form-section { margin-bottom: 16px; }
.section-label { 
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px; 
  font-weight: 500; 
  color: var(--text-secondary); 
  margin-bottom: 10px; 
}
.section-label i { font-size: 14px; }

.options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.option {
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.option:hover { border-color: var(--primary); }
.option.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.option .name { font-size: 13px; font-weight: 500; }
.option .price { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.option.active .price { color: rgba(255,255,255,0.8); }

.custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
}
.custom-row input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
}
.custom-row input:focus { border-color: var(--primary); outline: none; }
.price-display { font-size: 14px; font-weight: 600; color: var(--primary); }

.result-box {
  background: var(--success);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 14px;
  color: #fff;
}
.result-header { 
  display: flex; 
  align-items: center; 
  gap: 5px; 
  font-size: 12px; 
  margin-bottom: 8px;
  opacity: 0.9;
}
.result-content { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}
.result-content button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.result-content button:hover { background: rgba(255,255,255,0.3); }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 14px;
}
.search-bar i { color: var(--text-muted); font-size: 16px; }
.search-bar input {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 13px;
}
.search-bar input:focus { outline: none; }
.search-bar button {
  padding: 6px 12px;
  background: var(--primary);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 14px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 14px;
}
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 22px; font-weight: 600; color: var(--primary); }
.stat-num.warn { color: var(--danger); }
.stat-label { font-size: 12px; color: var(--text-muted); }

.list { margin-bottom: 14px; min-height: 100px; }
.list-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
}
.list-item.used { opacity: 0.5; }
.list-item .code {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.list-item .info { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.list-item .actions { display: flex; gap: 6px; margin-top: 10px; }
.list-item .actions button {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.list-item .actions button:hover { border-color: var(--primary); color: var(--primary); }
.btn-copy {
  padding: 3px 8px;
  background: var(--bg);
  border: none;
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-copy:hover { background: var(--primary); color: #fff; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.pagination button {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button i { font-size: 18px; }
.pagination span { font-size: 13px; color: var(--text-muted); }

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-mask {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
}
.modal-box {
  position: relative;
  background: var(--bg-card);
  border-radius: 10px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}
.modal-header i { font-size: 20px; color: var(--text-muted); cursor: pointer; }
.modal-header i:hover { color: var(--text); }
.modal-body { padding: 16px; }
.modal-body input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}
.modal-body input:focus { border-color: var(--primary); outline: none; }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  color: #fff;
  z-index: 2000;
  animation: fadeIn 0.2s;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.empty { text-align: center; padding: 30px; color: var(--text-muted); font-size: 13px; }
