/* 自定义样式 - 微信支付商户系统 */

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

.card-body {
  padding: 20px;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #576b95 0%, #4a5c80 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4a5c80 0%, #3d4e6b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(87, 107, 149, 0.3);
}

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

.btn-secondary {
  background: #f5f7fa;
  color: #666;
  border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #eee;
  border-color: #ccc;
}

.btn-success {
  background: linear-gradient(135deg, #52c41a 0%, #43a047 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4d4f 0%, #d32f2f 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #faad14 0%, #f59e0b 100%);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(250, 173, 20, 0.3);
}

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

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* 表单样式 */
.form-group {
  margin-bottom: 16px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: #576b95;
  box-shadow: 0 0 0 3px rgba(87, 107, 149, 0.1);
}

.form-control::placeholder {
  color: #aaa;
}

.form-control.error {
  border-color: #ff4d4f;
  animation: shake 0.5s ease-in-out;
}

.form-text {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* 表格样式 */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
  font-size: 13px;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background: #fafafa;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* 徽章样式 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #f6ffed;
  color: #52c41a;
}

.badge-warning {
  background: #fff7e6;
  color: #faad14;
}

.badge-danger {
  background: #fff1f0;
  color: #ff4d4f;
}

.badge-info {
  background: #e6f7ff;
  color: #1890ff;
}

.badge-default {
  background: #f5f5f5;
  color: #666;
}

/* 模态框样式 */
.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;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 4px;
}

.modal-close:hover {
  color: #666;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 进度条样式 */
.progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-bar-fill.success {
  background: linear-gradient(90deg, #52c41a, #73d13d);
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, #faad14, #ffc53d);
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, #ff4d4f, #ff7875);
}

/* 时间线样式 */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #eee;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #eee;
}

.timeline-item.active::before {
  background: #576b95;
  box-shadow: 0 0 0 2px rgba(87, 107, 149, 0.2);
}

.timeline-item.done::before {
  background: #52c41a;
  box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.2);
}

.timeline-time {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.timeline-title {
  font-weight: 500;
  color: #333;
}

.timeline-desc {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* 步骤指示器 */
.steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: calc(50% + 16px);
  right: calc(50% - 16px);
  height: 2px;
  background: #ddd;
}

.step.active:not(:last-child)::after {
  background: #576b95;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.step.active .step-num {
  background: #576b95;
  color: white;
  transform: scale(1.1);
}

.step.done .step-num {
  background: #52c41a;
  color: white;
}

.step-label {
  font-size: 13px;
  color: #666;
}

.step.active .step-label {
  color: #576b95;
  font-weight: 500;
}

/* 统计卡片 */
.stat-card {
  background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid #eee;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
}

.stat-icon.primary {
  background: linear-gradient(135deg, #e6f4ff, #b3d9ff);
  color: #1890ff;
}

.stat-icon.success {
  background: linear-gradient(135deg, #f6ffed, #b7eb8f);
  color: #52c41a;
}

.stat-icon.warning {
  background: linear-gradient(135deg, #fff7e6, #ffe082);
  color: #faad14;
}

.stat-icon.danger {
  background: linear-gradient(135deg, #fff1f0, #ffccc7);
  color: #ff4d4f;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #888;
}

/* 搜索框样式 */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 36px;
  background: #f5f7fa;
  border-color: #e0e0e0;
}

.search-box input:focus {
  background: white;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 14px;
}

/* 通知提示 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  z-index: 2000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: linear-gradient(135deg, #52c41a, #73d13d);
}

.notification.error {
  background: linear-gradient(135deg, #ff4d4f, #ff7875);
}

.notification.warning {
  background: linear-gradient(135deg, #faad14, #ffc53d);
}

.notification.info {
  background: linear-gradient(135deg, #1890ff, #40a9ff);
}

/* 加载动画 */
.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #576b95;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

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

.empty-title {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .card-body {
    padding: 16px;
  }
  
  .table th,
  .table td {
    padding: 10px 8px;
    font-size: 12px;
  }
  
  .modal {
    width: 95%;
    margin: 10px;
  }
  
  .steps {
    flex-wrap: wrap;
  }
  
  .step {
    width: 33.33%;
    margin-bottom: 10px;
  }
}

/* Tailwind 自定义工具类 */
.content-auto { content-visibility: auto; }
.transition-all-300 { transition: all 0.3s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.12); }

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a2e;
    color: #e0e0e0;
  }
  
  .card {
    background: #252542;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .card-header {
    background: linear-gradient(135deg, #2d2d4a 0%, #252542 100%);
    border-color: #3a3a5c;
  }
  
  .form-control {
    background: #1a1a2e;
    border-color: #3a3a5c;
    color: #e0e0e0;
  }
  
  .form-control:focus {
    border-color: #576b95;
  }
  
  .table th {
    background: #2d2d4a;
    color: #ccc;
  }
  
  .table tbody tr:hover {
    background: #2d2d4a;
  }
  
  .table td,
  .table th {
    border-color: #3a3a5c;
  }
}
