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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  display: flex;
  flex-direction: column;
}

.header {
  width: 100%;
  background: linear-gradient(90deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .header-content {
    padding: 14px 24px;
    gap: 14px;
  }
}

@media (min-width: 1025px) {
  .header-content {
    justify-content: flex-start;
    padding: 16px 32px;
    gap: 16px;
  }
}

.logo {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) and (max-width: 1024px) {
  .logo {
    width: 44px;
    height: 44px;
  }
}

@media (min-width: 1025px) {
  .logo {
    width: 48px;
    height: 48px;
  }
}

.logo svg {
  width: 24px;
  height: 24px;
  color: #1d4ed8;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .logo svg {
    width: 28px;
    height: 28px;
  }
}

@media (min-width: 1025px) {
  .logo svg {
    width: 32px;
    height: 32px;
  }
}

.header-text {
  color: white;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .header-title {
    font-size: 1.25rem;
  }
}

@media (min-width: 1025px) {
  .header-title {
    font-size: 1.5rem;
  }
}

.header-subtitle {
  font-size: 0.7rem;
  color: #dbeafe;
  margin-top: 2px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .header-subtitle {
    font-size: 0.725rem;
  }
}

@media (min-width: 1025px) {
  .header-subtitle {
    font-size: 0.75rem;
  }
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .main {
    padding: 36px 24px;
  }
}

@media (min-width: 1025px) {
  .main {
    padding: 48px 32px;
  }
}

.page-container {
  width: 100%;
  max-width: 360px;
  animation: fadeInUp 0.5s ease-out;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .page-container {
    max-width: 380px;
  }
}

@media (min-width: 1025px) {
  .page-container {
    max-width: 400px;
  }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #dbeafe;
  overflow: hidden;
}

.card-header {
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.card-header .back-btn {
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.card-header .back-btn:hover {
  color: white;
}

.card-header .spacer {
  width: 20px;
}

.card-body {
  padding: 20px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .card-body {
    padding: 28px;
  }
}

@media (min-width: 1025px) {
  .card-body {
    padding: 32px;
  }
}

.alert {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
  text-align: center;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  text-align: center;
}

.alert-warning {
  background: #fefce8;
  border: 1px solid #fde047;
  color: #a16207;
  font-size: 0.8rem;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-size: 0.8rem;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
}

.form-input:hover {
  border-color: #93c5fd;
}

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

.form-input.error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.error-message {
  display: none;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #ef4444;
  align-items: center;
  gap: 4px;
}

.error-message.show {
  display: flex;
}

.captcha-row {
  display: flex;
  gap: 12px;
}

.captcha-row .input-wrapper {
  flex: 1;
}

.captcha-code {
  padding: 10px 16px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #374151;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  min-width: 100px;
  text-align: center;
}

.captcha-code:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.btn {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #1e40af 0%, #1d4ed8 100%);
  box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

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

.btn-group .btn {
  flex: 1;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading .spinner {
  display: block;
}

.btn.loading .btn-text {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-links {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.form-links a, .form-links button {
  color: #2563eb;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.form-links a:hover, .form-links button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  cursor: pointer;
}

.checkbox-wrapper label {
  font-size: 0.8rem;
  color: #4b5563;
  cursor: pointer;
}

.security-badges {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  font-size: 0.7rem;
  color: #6b7280;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .security-badges {
    margin-top: 22px;
    gap: 14px;
    font-size: 0.725rem;
  }
}

@media (min-width: 1025px) {
  .security-badges {
    margin-top: 24px;
    gap: 16px;
    font-size: 0.75rem;
  }
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 22px;
  }
}

@media (min-width: 1025px) {
  .dashboard-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }
}

.stat-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-card.blue { background: #eff6ff; border-color: #dbeafe; }
.stat-card.green { background: #f0fdf4; border-color: #dcfce7; }
.stat-card.orange { background: #fff7ed; border-color: #ffedd5; }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card.blue .stat-icon { background: #3b82f6; }
.stat-card.green .stat-icon { background: #22c55e; }
.stat-card.orange .stat-icon { background: #f97316; }

.stat-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.stat-info p {
  font-size: 0.875rem;
  color: #64748b;
}

.stat-info .number {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.user-info {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.user-info h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: #6b7280;
}

.info-row .value {
  color: #111827;
  font-weight: 500;
}

.user-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.user-avatar {
  width: 64px;
  height: 64px;
  background: #dbeafe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar svg {
  width: 32px;
  height: 32px;
  color: #2563eb;
}

.user-title h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.user-title p {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 4px;
}

.footer {
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 20px 16px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .footer {
    padding: 24px 24px;
  }
}

@media (min-width: 1025px) {
  .footer {
    padding: 28px 32px;
  }
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

@media (min-width: 1025px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-left {
  text-align: center;
}

@media (min-width: 768px) {
  .footer-left {
    text-align: left;
  }
}

.footer-copyright {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.footer-contact {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
}

.footer-info {
  margin-top: 8px;
}

.footer-hint {
  font-size: 0.7rem;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 4px;
}

.footer-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  transition: all 0.2s;
}

.wechat-qr:hover {
  background: #dcfce7;
  transform: scale(1.02);
}

.qr-small {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.qr-label {
  font-size: 0.7rem;
  color: #16a34a;
  font-weight: 500;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.qr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.qr-modal.active {
  display: flex;
}

.qr-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.qr-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: fadeInUp 0.3s ease-out;
  max-width: 90vw;
}

.qr-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.qr-modal-close:hover {
  color: #111827;
}

.qr-large {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
}

.qr-modal-text {
  margin-top: 16px;
  font-size: 0.9375rem;
  color: #374151;
  font-weight: 500;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

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

.font-semibold {
  font-weight: 600;
}

.text-lg {
  font-size: 1.125rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-gray-500 {
  color: #6b7280;
}

.mt-2 {
  margin-top: 8px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}