:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
  --shadow: 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);
}

[data-theme="dark"] {
  --bg-primary: #1a202c;
  --bg-secondary: #2d3748;
  --text-primary: #f7fafc;
  --text-secondary: #a0aec0;
  --border-color: #4a5568;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

/* 页面容器 */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* 顶部标题区 */
.hero-section {
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  background: var(--bg-primary);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
  border-left: 4px solid #667eea;
}

.hero-description strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 主题切换按钮 */
.theme-toggle-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(15deg);
}

/* 卡片样式 */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 1.125rem;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header i {
  font-size: 1.25rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-body {
  padding: 1.5rem;
}

/* 表单样式 */
.form-control,
.form-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--bg-secondary);
}

.form-control-lg {
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  border-radius: 0.875rem;
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label i {
  color: #667eea;
}

/* 按钮样式 */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

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

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

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

.btn-outline-primary {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline-danger {
  background: transparent;
  border: 2px solid #eb3349;
  color: #eb3349;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: 0.875rem;
}

/* 头像样式 */
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow);
}

/* 二维码容器 */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#qrImage,
#plQrImage {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  padding: 1rem;
  background: white;
  box-shadow: var(--shadow);
  border: 2px solid var(--border-color);
}

#qrImage img,
#qrImage canvas,
#plQrImage img,
#plQrImage canvas {
  width: 220px !important;
  height: 220px !important;
  display: block;
  border-radius: 0.5rem;
}

.qr-placeholder {
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.875rem;
}

/* 二维码提示 */
.qr-tip {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  border-left: 4px solid #667eea;
}

.qr-tip-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.qr-tip-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 信息展示 */
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.info-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* 进度条 */
.progress {
  height: 2rem;
  border-radius: 0.75rem;
  background: var(--bg-primary);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: width 0.3s ease;
}

.progress-bar-striped {
  background: var(--primary-gradient);
  background-size: 1rem 1rem;
}

/* 日志框 */
.log-box {
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-primary);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.log-box::-webkit-scrollbar {
  width: 8px;
}

.log-box::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.log-box::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.log-entry {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* 通知弹窗 */
.notice-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.notice-card {
  width: min(480px, 100%);
  background: var(--bg-secondary);
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 2rem;
  position: relative;
  animation: slideUp 0.3s ease;
}

.notice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 1.25rem 1.25rem 0 0;
}

.notice-card.notice-success::before {
  background: var(--success-gradient);
}

.notice-card.notice-danger::before {
  background: var(--danger-gradient);
}

.notice-card.notice-warning::before {
  background: var(--warning-gradient);
}

.notice-card.notice-info::before {
  background: var(--info-gradient);
}

.notice-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notice-title i {
  font-size: 1.5rem;
}

.notice-success .notice-title i {
  color: #11998e;
}

.notice-danger .notice-title i {
  color: #eb3349;
}

.notice-warning .notice-title i {
  color: #f5576c;
}

.notice-info .notice-title i {
  color: #4facfe;
}

.notice-text {
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  margin-bottom: 1.5rem;
}

.notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.75rem;
}

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

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

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

.badge-warning {
  background: var(--warning-gradient);
  color: white;
}

.badge-info {
  background: var(--info-gradient);
  color: white;
}

/* 警告框 */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-info {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
  color: #4facfe;
  border-left: 4px solid #4facfe;
}

.alert-success {
  background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
  color: #11998e;
  border-left: 4px solid #11998e;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(235, 51, 73, 0.1) 0%, rgba(244, 92, 67, 0.1) 100%);
  color: #eb3349;
  border-left: 4px solid #eb3349;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
  color: #f5576c;
  border-left: 4px solid #f5576c;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* 响应式设计 */
@media (max-width: 991.98px) {
  .page-container {
    padding: 1.5rem 1rem;
  }

  .hero-section {
    padding: 1.5rem;
    border-radius: 1rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .theme-toggle-btn {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 575.98px) {
  .page-container {
    padding: 1rem 0.75rem;
  }

  .hero-section {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-description {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  .card-body {
    padding: 1rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
  }

  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  #qrImage,
  #plQrImage {
    width: 200px;
    height: 200px;
  }

  #qrImage img,
  #qrImage canvas,
  #plQrImage img,
  #plQrImage canvas {
    width: 180px !important;
    height: 180px !important;
  }

  .notice-card {
    padding: 1.5rem;
  }

  .notice-title {
    font-size: 1.125rem;
  }
}

/* 工具类 */
.text-muted {
  color: var(--text-secondary) !important;
}

.text-success {
  color: #11998e !important;
}

.text-danger {
  color: #eb3349 !important;
}

.text-warning {
  color: #f5576c !important;
}

.text-primary {
  color: #667eea !important;
}

.d-none {
  display: none !important;
}

.w-100 {
  width: 100% !important;
}

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

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.small {
  font-size: 0.875rem !important;
}

.fw-bold {
  font-weight: 700 !important;
}
