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

:root {
  --primary: #4f8cff;
  --primary-dark: #3a7bd5;
  --primary-light: rgba(79, 140, 255, 0.15);
  --brand-gold: #d4a017;
  --brand-gold-soft: rgba(212, 160, 23, 0.18);
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text: #e8ecf0;
  --text-secondary: #9ca3af;
  --text-light: #6b7280;
  --bg: #0f1115;
  --bg-card: #1a1d23;
  --bg-elevated: #22262d;
  --bg-secondary: #161920;
  --bg-hover: rgba(79, 140, 255, 0.1);
  --border: #2a2f37;
  --border-light: #23272f;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.navbar {
  background: rgba(26, 29, 35, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius);
  transition: var(--transition);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.navbar-brand:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.navbar-brand:hover .navbar-brand-logo {
  transform: scale(1.05);
  box-shadow: 0 0 0 1px var(--brand-gold-soft);
}

.navbar-brand-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.navbar-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.navbar-brand .brand-text {
  color: var(--text);
  white-space: nowrap;
}

.navbar-brand .brand-highlight {
  display: inline-block;
  margin-left: 2px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-gold-soft);
  color: #e8c547;
  font-weight: 700;
}

.navbar-brand .brand-sub {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a,
.navbar-nav button {
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: var(--transition);
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
}

.navbar-nav a:hover,
.navbar-nav button:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.navbar-nav a.active {
  background: var(--primary);
  color: white;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
  gap: 6px;
}

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

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

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

.btn-success:hover {
  filter: brightness(1.1);
  color: white;
}

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

.btn-danger:hover {
  filter: brightness(1.1);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

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

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 0;
}

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

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

.page {
  min-height: calc(100vh - 64px);
  padding: 28px 0 48px;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  margin-top: 48px;
  padding: 28px 20px 36px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}

.site-footer .footer-brand img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
  padding: 2px;
}

@media (max-width: 768px) {
  .navbar-brand .brand-text {
    font-size: 16px;
  }
  .navbar-brand-logo {
    width: 34px;
    height: 34px;
  }
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: rgba(82, 196, 26, 0.15); color: var(--success); border: 1px solid rgba(82, 196, 26, 0.3); }
.badge-warning { background: rgba(250, 173, 20, 0.15); color: var(--warning); border: 1px solid rgba(250, 173, 20, 0.3); }
.badge-danger  { background: rgba(255, 77, 79, 0.15); color: var(--danger);  border: 1px solid rgba(255, 77, 79, 0.3); }
.badge-primary { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(79, 140, 255, 0.3); }
.badge-default { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-right: 4px;
}

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

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 15px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.login-modal {
  max-width: 440px;
}

.login-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.login-tab:hover {
  color: var(--primary);
}

.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.login-panel {
  display: none;
}

.login-panel.active {
  display: block;
}

.sms-button-row {
  display: flex;
  gap: 8px;
}

.sms-button-row .form-control {
  flex: 1;
}

.user-menu-trigger {
  background: none;
  border: none;
}

.user-dropdown a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-block {
  display: block;
  width: 100%;
}

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

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

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  z-index: 2000;
  animation: slideDown 0.3s ease;
  box-shadow: var(--shadow-hover);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--primary); }

@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 24px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

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

.feature-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.feature-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.feature-price {
  color: var(--primary);
  font-weight: 600;
  font-size: 18px;
}

.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

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

.image-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.image-upload:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.image-upload.has-image {
  padding: 0;
  border-style: solid;
}

.image-upload img {
  max-width: 100%;
  max-height: 300px;
  display: block;
  margin: 0 auto;
}

.image-upload-placeholder {
  color: var(--text-light);
}

.image-upload-placeholder-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.image-upload-placeholder-text {
  font-size: 14px;
}

.image-preview {
  position: relative;
  margin-top: 16px;
}

.image-preview img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.image-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.result-image {
  margin-top: 20px;
  text-align: center;
}

.result-image img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.result-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.result-images img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
}

.result-images img:hover {
  transform: scale(1.02);
}

.result-gallery img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-elevated);
}

.result-gallery img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

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

.payment-qr {
  margin: 20px auto;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.payment-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-qr-placeholder {
  color: var(--text-light);
  font-size: 13px;
}

.payment-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--danger);
  margin: 16px 0;
}

.payment-timer {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 12px;
}

.payment-timer span {
  color: var(--primary);
  font-weight: 600;
}

.order-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.order-card:hover {
  box-shadow: var(--shadow-hover);
}

.order-info {
  flex: 1;
}

.order-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

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

.order-amount {
  font-size: 18px;
  font-weight: 600;
  color: var(--danger);
  margin-right: 16px;
}

.order-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  object-fit: cover;
  margin-left: 16px;
  cursor: pointer;
}

.status-tab {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
}

.status-tab-item {
  padding: 12px 24px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.status-tab-item:hover {
  color: var(--primary);
}

.status-tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
  }

  .navbar-nav {
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    margin-top: 8px;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .page {
    padding: 20px 0;
  }

  .page-title {
    font-size: 22px;
  }

  .container {
    padding: 16px;
  }

  .card {
    padding: 16px;
  }
}