:root {
  --gradient-page: linear-gradient(160deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  --gradient-btn: linear-gradient(135deg, #667eea, #764ba2);
  --primary: #667eea;
  --secondary: #764ba2;
  --dark-bg: #0f0f23;
  --dark-card: #16213e;
  --dark-bar: #1a1a2e;
  --text: #333;
  --text-muted: #999;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.page-gradient {
  min-height: 100vh;
  background: var(--gradient-page);
  position: relative;
  overflow: hidden;
}

.page-dark {
  min-height: 100vh;
  background: var(--dark-bg);
  color: #fff;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
}

.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn-primary { background: var(--gradient-btn); color: #fff; }
.btn-white { background: #fff; color: var(--primary); }
.btn-ghost { background: rgba(255,255,255,0.15); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: #fff;
  text-align: center;
  padding: 24px;
}

.state-icon { font-size: 48px; margin-bottom: 12px; }
.state-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.state-text { font-size: 14px; opacity: 0.85; }

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 9999;
  font-size: 14px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-mask[hidden] {
  display: none !important;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: var(--dark-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  color: #fff;
}

.modal-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
}

.input::placeholder { color: rgba(255, 255, 255, 0.4); }

.input-light {
  background: #f5f5f5;
  color: var(--text);
}

.input-light::placeholder { color: #bbb; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
}

.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-closed { background: #fce4ec; color: #c62828; }

@media (min-width: 768px) {
  .container { max-width: 480px; margin: 0 auto; }
}
