/* 暗黑主题 - 售卡网 */
:root {
  --bg-primary: #0f0f14;
  --bg-secondary: #1a1a24;
  --bg-card: #22222e;
  --bg-hover: #2a2a38;
  --text-primary: #f0f0f5;
  --text-secondary: #d0d0dd;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --success: #00cec9;
  --warning: #fdcb6e;
  --danger: #ff7675;
  --border: #333345;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

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

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.header {
  text-align: center;
  padding: 3rem 0 2rem;
}
.header h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header p {
  color: var(--text-primary);
  margin-top: .5rem;
  opacity: .85;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.nav a {
  color: var(--text-primary);
  font-size: .95rem;
  transition: color .2s;
  opacity: .85;
}
.nav a:hover, .nav a.active {
  color: var(--accent-light);
  text-decoration: none;
}

/* Product Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.product-card.selected {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
}
.product-card .price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-light);
  margin: .5rem 0;
}
.product-card .price small {
  font-size: .9rem;
  color: var(--text-secondary);
}
.product-card .name {
  color: var(--text-primary);
  font-size: .9rem;
  opacity: .9;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  margin-bottom: .4rem;
  color: var(--text-primary);
  font-size: .9rem;
  opacity: .9;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .7rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: .95rem;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
/* Hide number input spin buttons (Firefox + Chrome) */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .7rem 1.5rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-primary);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
}
.btn-success {
  background: var(--success);
  color: #000;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Pay Type Selector */
.pay-types {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}
.pay-type {
  flex: 1;
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.pay-type:hover { border-color: var(--accent); }
.pay-type.selected {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
}
.pay-type img {
  width: 32px;
  height: 32px;
  margin-bottom: .4rem;
}

/* Result / Status */
.result-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}
.result-box .status-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.result-box .card-key {
  background: var(--bg-secondary);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  word-break: break-all;
  color: var(--success);
}

/* Table */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: .7rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  color: var(--text-primary);
}
th {
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-secondary);
}
tr:hover td {
  background: var(--bg-hover);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 500;
}
.badge-success { background: rgba(0,206,201,.15); color: var(--success); }
.badge-pending { background: rgba(253,203,110,.15); color: var(--warning); }
.badge-danger { background: rgba(255,118,117,.15); color: var(--danger); }

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}
.admin-tabs button {
  padding: .5rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  opacity: .8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.admin-tabs button.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

/* Cards / Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.stat-card .label {
  color: var(--text-primary);
  font-size: .85rem;
  opacity: .85;
}
.stat-card .value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: .3rem;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  min-width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 1rem .8rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .header { padding: 1.5rem 0 1rem; }
  .header h1 { font-size: 1.4rem; }
  .pay-types { flex-direction: column; gap: .6rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .8rem; }
  .admin-tabs { flex-wrap: wrap; gap: .3rem; }
  .admin-tabs button { padding: .4rem .6rem; font-size: .85rem; }
  .modal { min-width: auto !important; width: 95vw; padding: 1.2rem; }
  table { font-size: .8rem; }
  th, td { padding: .5rem .4rem; }
  .stat-card { padding: .8rem; }
  .stat-card .value { font-size: 1.3rem; }
  .nav { gap: 1rem; }
  .product-card { padding: 1rem; }
  .product-card .price { font-size: 1.5rem; }
  .result-box { padding: 1.2rem; margin: 1rem 0; }
}

@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .product-card .price { font-size: 1.3rem; }
  .header h1 { font-size: 1.2rem; }
}
