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

:root {
  --primary-color: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --secondary-color: #64748b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  margin-bottom: 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.primary {
  background: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn.secondary:hover {
  background: var(--bg-color);
  border-color: var(--primary-light);
  color: var(--primary-color);
}

.main-content {
  padding-bottom: 60px;
}

.user-card {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  padding: 32px;
  border-radius: 16px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  color: white;
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 500;
}

.points-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.points-label {
  font-size: 14px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.points-value {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.user-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.user-actions .btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-actions .btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.app-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.app-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
}

.app-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.app-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.app-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: var(--primary-color);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 24px;
}

.modal-content {
  background: var(--card-bg);
  padding: 32px;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-content.large {
  max-width: 800px;
}

.close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  background: transparent;
  border: none;
}

.close:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s ease;
  background: var(--card-bg);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.code-input {
  display: flex;
  gap: 12px;
}

.code-input input {
  flex: 1;
}

.register-link {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.register-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.register-link a:hover {
  text-decoration: underline;
}

.logs-container {
  max-height: 500px;
  overflow-y: auto;
  margin: -8px;
  padding: 8px;
}

.log-item {
  padding: 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
  margin-bottom: 4px;
}

.log-item:hover {
  background: var(--bg-color);
}

.log-info {
  flex: 1;
}

.log-reason {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 15px;
}

.log-time {
  font-size: 13px;
  color: var(--text-secondary);
}

.log-amount {
  font-size: 18px;
  font-weight: 700;
}

.log-amount.deduct {
  color: var(--danger-color);
}

.log-amount.recharge,
.log-amount.bonus {
  color: var(--success-color);
}

.app-detail {
  text-align: center;
}

.app-detail .app-icon {
  font-size: 72px;
  margin-bottom: 20px;
}

.app-detail .app-title {
  font-size: 28px;
  margin-bottom: 12px;
}

.app-detail .app-description {
  font-size: 16px;
  margin-bottom: 28px;
  line-height: 1.7;
}

.app-detail .app-cost {
  font-size: 16px;
  padding: 10px 20px;
  margin-bottom: 28px;
}

.app-detail .btn {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.btn-group .btn {
  flex: 1;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .app-container {
    padding: 0 16px;
  }

  .header-content {
    padding: 14px 16px;
  }

  .logo {
    font-size: 20px;
  }

  .user-card {
    padding: 24px;
  }

  .points-value {
    font-size: 36px;
  }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .app-card {
    padding: 20px;
  }

  .modal-content {
    padding: 24px;
    border-radius: 12px;
  }

  .user-actions {
    gap: 8px;
  }

  .user-actions .btn {
    flex: 1;
    justify-content: center;
  }
}
