* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  margin-bottom: 20px;
}
h1 { font-size: 28px; margin-bottom: 8px; color: #1a1a2e; }
h2 { font-size: 20px; margin-bottom: 16px; color: #333; }
.subtitle { color: #666; margin-bottom: 24px; font-size: 15px; }
.nav { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  font-size: 14px;
  transition: background 0.2s;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.35); }
.btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5a6fd6; transform: translateY(-1px); }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-block { display: block; width: 100%; }
.price-tag {
  font-size: 36px;
  font-weight: 700;
  color: #667eea;
  margin: 16px 0;
}
.price-tag small { font-size: 16px; color: #999; font-weight: 400; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #555; }
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #667eea; }
.result-box {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}
.result-box.error { background: #fef2f2; border-color: #fca5a5; }
.email-display {
  font-size: 22px;
  font-weight: 700;
  color: #059669;
  word-break: break-all;
  margin: 12px 0;
  padding: 12px;
  background: #ecfdf5;
  border-radius: 8px;
  cursor: pointer;
}
.otp-display {
  font-size: 42px;
  font-weight: 800;
  color: #667eea;
  letter-spacing: 8px;
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  background: #f5f3ff;
  border-radius: 12px;
  cursor: pointer;
}
.otp-display-sm {
  font-size: 34px;
  letter-spacing: 6px;
  margin: 8px 0 4px;
  padding: 16px;
}
.otp-item {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e5e7eb;
}
.otp-item:last-child { border-bottom: none; margin-bottom: 0; }
.otp-item-label {
  font-size: 12px;
  color: #667eea;
  font-weight: 600;
  margin-bottom: 4px;
}
.otp-meta {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 4px;
  word-break: break-all;
}

.admin-container {
  max-width: 1400px;
}

.mail-tab h2 {
  margin-bottom: 4px;
}
.mail-tab-desc {
  margin: 0;
  font-size: 13px;
  color: #888;
}
.mail-tab-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mail-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mail-filter-input {
  width: 260px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}
.btn-ghost {
  background: #f3f4f6;
  color: #374151;
}
.mail-meta {
  font-size: 13px;
  color: #666;
  margin: 0 0 10px;
}
.mail-table-wrap {
  overflow-x: auto;
  margin-top: 0;
}
#emailsTable {
  margin-top: 0;
  font-size: 13px;
}
#emailsTable th,
#emailsTable td {
  padding: 8px 10px;
  vertical-align: middle;
}
#emailsTable .mail-tr {
  cursor: pointer;
}
#emailsTable .mail-tr:hover {
  background: #f8fafc;
}
#emailsTable .mail-tr.selected {
  background: #eff6ff;
}
.mail-time {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mail-addr {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-otp-cell { text-align: center; }
.mail-order-cell {
  font-size: 11px;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-otp {
  display: inline-block;
  padding: 2px 8px;
  background: #dcfce7;
  color: #166534;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
}
.mail-otp-none { color: #cbd5e1; }
.mail-order { font-size: 11px; color: #64748b; }
.mail-empty-cell {
  text-align: center;
  color: #999;
  padding: 32px !important;
}
.mail-detail-panel {
  margin-top: 14px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}
.mail-detail-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
  font-size: 13px;
  color: #4338ca;
}
.mail-body-panel {
  margin: 0;
  padding: 14px 16px;
  background: #fff;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  font-family: ui-monospace, Consolas, monospace;
}
.mail-pager {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mail-pager-info {
  font-size: 13px;
  color: #666;
  margin-right: 4px;
}
.copy-hint { font-size: 12px; color: #999; text-align: center; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.feature {
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
  text-align: center;
}
.feature .icon { font-size: 28px; margin-bottom: 8px; }
.feature h3 { font-size: 14px; color: #555; }
.loading { text-align: center; padding: 20px; color: #999; }
.hidden { display: none; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background: #f9fafb; font-weight: 600; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: #f9fafb;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-card .num { font-size: 28px; font-weight: 700; color: #667eea; }
.stat-card .label { font-size: 12px; color: #888; margin-top: 4px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  background: #f3f4f6;
  border: none;
  font-size: 14px;
}
.tab.active { background: #667eea; color: #fff; }
textarea.codes-output {
  width: 100%;
  height: 200px;
  font-family: monospace;
  font-size: 13px;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  margin-top: 12px;
}
@media (max-width: 600px) {
  .card { padding: 20px; }
  h1 { font-size: 22px; }
  .otp-display { font-size: 32px; letter-spacing: 4px; }
}

.pay-loading {
  text-align: center;
  color: #667eea;
  font-size: 15px;
  margin: 12px 0;
  animation: pulse 1s ease-in-out infinite;
}
.qr-skeleton {
  width: 220px;
  height: 220px;
  margin: 16px auto;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
