/* rem适配方案 - 设计稿宽度430px，基准rem=43px */
/* 转换公式: px值 / 43 = rem值 */

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

:root {
  --primary-color: #ff6b35;
  --primary-dark: #e55a2b;
  --primary-light: #ff8c61;
  --primary-bg: rgba(255, 107, 53, 0.08);
  --secondary-color: #f7931e;
  --accent-color: #ffb347;
  --danger-color: #ef4444;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #fff8f0;
  --bg-tertiary: #fff0e6;
  --bg-card: #ffffff;
  --bg-dark: #1a1a2e;
  --border-color: #fed7c2;
  --border-light: #ffe4d6;
  --shadow-sm: 0 0.023rem 0.047rem 0 rgba(255, 107, 53, 0.05);
  --shadow: 0 0.023rem 0.070rem 0 rgba(255, 107, 53, 0.1), 0 0.023rem 0.047rem -0.023rem rgba(255, 107, 53, 0.1);
  --shadow-md: 0 0.093rem 0.140rem -0.023rem rgba(255, 107, 53, 0.15), 0 0.047rem 0.093rem -0.047rem rgba(255, 107, 53, 0.1);
  --shadow-lg: 0 0.233rem 0.349rem -0.070rem rgba(255, 107, 53, 0.2), 0 0.093rem 0.140rem -0.093rem rgba(255, 107, 53, 0.1);
  --shadow-xl: 0 0.465rem 0.581rem -0.116rem rgba(255, 107, 53, 0.25), 0 0.186rem 0.233rem -0.140rem rgba(255, 107, 53, 0.1);
  --radius-sm: 0.186rem;
  --radius: 0.279rem;
  --radius-lg: 0.372rem;
  --radius-xl: 0.558rem;
  
  /* 字体大小变量 */
  --font-size-xs: 0.279rem;   /* 12px */
  --font-size-sm: 0.302rem;   /* 13px */
  --font-size-base: 0.326rem; /* 14px */
  --font-size-md: 0.349rem;   /* 15px */
  --font-size-lg: 0.372rem;   /* 16px */
  --font-size-xl: 0.419rem;   /* 18px */
  --font-size-xxl: 0.465rem;  /* 20px */
  
  /* 动物主题额外颜色 */
  --jungle-green: #4ade80;
  --safari-brown: #92400e;
  --lion-yellow: #fcd34d;
  --tiger-orange: #f97316;
  --paw-print: #c2410c;
}

html[data-theme="dark"] {
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-light: rgba(255, 255, 255, 0.55);
  --bg-primary: #0b0f19;
  --bg-secondary: #0f1626;
  --bg-tertiary: #111c2f;
  --bg-card: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.14);
  --border-light: rgba(255, 255, 255, 0.10);
  --primary-bg: rgba(255, 107, 53, 0.18);
  --shadow-sm: 0 0.023rem 0.047rem 0 rgba(0, 0, 0, 0.35);
  --shadow: 0 0.023rem 0.070rem 0 rgba(0, 0, 0, 0.45), 0 0.023rem 0.047rem -0.023rem rgba(0, 0, 0, 0.35);
  --shadow-md: 0 0.093rem 0.140rem -0.023rem rgba(0, 0, 0, 0.55), 0 0.047rem 0.093rem -0.047rem rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 0.233rem 0.349rem -0.070rem rgba(0, 0, 0, 0.65), 0 0.093rem 0.140rem -0.093rem rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 0.465rem 0.581rem -0.116rem rgba(0, 0, 0, 0.75), 0 0.186rem 0.233rem -0.140rem rgba(0, 0, 0, 0.55);
}

html {
  font-size: 43px; /* 基准rem值，由rem.js动态计算 */
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  font-size: var(--font-size-base);
  background: linear-gradient(135deg, #fff8f0 0%, #fff0e6 50%, #ffe8d6 100%);
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-theme="dark"] body {
  background: radial-gradient(1200px 800px at 20% 10%, rgba(255, 107, 53, 0.18) 0%, rgba(11, 15, 25, 0.0) 55%),
    radial-gradient(900px 700px at 80% 20%, rgba(99, 102, 241, 0.16) 0%, rgba(11, 15, 25, 0.0) 60%),
    linear-gradient(135deg, #070a12 0%, #0b0f19 45%, #090c14 100%);
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.326rem 0.651rem;
  border-radius: var(--radius);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
  transform: translateY(-0.047rem);
  box-shadow: var(--shadow-lg), 0 0 0.465rem rgba(255, 107, 53, 0.3);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 0.023rem solid var(--border-color);
  padding: 0.279rem 0.558rem;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.btn-danger {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 0.326rem 0.651rem;
  border-radius: var(--radius);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-0.023rem);
  box-shadow: var(--shadow-lg);
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 0.372rem 0.744rem;
  font-size: var(--font-size-xl);
  border-radius: var(--radius-lg);
}

/* 输入框样式 */
.input-group {
  margin-bottom: 0.372rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.186rem;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 0.326rem 0.372rem;
  border: 0.023rem solid var(--border-color);
  border-radius: var(--radius);
  font-size: var(--font-size-md);
  transition: all 0.2s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-light);
}

.input-group input:hover,
.input-group select:hover,
.input-group textarea:hover {
  border-color: #d1d5db;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.070rem var(--primary-bg);
}

.input-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.326rem center;
  padding-right: 1.023rem;
}

.input-group select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.input-group textarea {
  min-height: 2.326rem;
  resize: vertical;
  line-height: 1.5;
}

.input-row {
  display: flex;
  gap: 0.279rem;
}

.input-row .input-group {
  flex: 1;
}

.hint {
  font-size: var(--font-size-xs);
  color: var(--text-light);
  margin-top: 0.140rem;
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 0.558rem;
  left: 50%;
  transform: translateX(-50%) translateY(-2.326rem);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.326rem 0.558rem;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 80%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 0.023rem solid var(--border-color);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.toast.success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.toast.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 0.465rem;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 9.302rem;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl), 0 0.581rem 1.163rem -0.279rem rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.465rem 0.558rem;
  border-bottom: 0.023rem solid var(--border-light);
}

.modal-header h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: var(--bg-secondary);
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 0.744rem;
  height: 0.744rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 0.558rem;
  overflow-y: auto;
  color: var(--text-primary);
}

/* 复选框样式 */
.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group input[type="checkbox"] {
  width: 0.419rem;
  height: 0.419rem;
  margin-right: 0.233rem;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.checkbox-group label {
  font-size: var(--font-size-base);
  color: var(--text-primary);
  cursor: pointer;
}

/* 上传区域 */
.upload-area {
  border: 0.047rem dashed var(--border-color);
  border-radius: var(--radius);
  padding: 0.558rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: var(--bg-tertiary);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background: var(--primary-bg);
}

.upload-icon {
  font-size: 1.163rem;
  margin-bottom: 0.233rem;
}

.upload-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.upload-hint {
  font-size: var(--font-size-xs);
  color: var(--text-light);
  margin-top: 0.093rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 1.163rem 0.465rem;
}

.empty-icon {
  font-size: 1.488rem;
  margin-bottom: 0.372rem;
  opacity: 0.5;
}

.empty-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.558rem;
}

.loading-spinner {
  width: 0.651rem;
  height: 0.651rem;
  border: 0.070rem solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 分隔线 */
.divider {
  height: 0.023rem;
  background: var(--border-light);
  margin: 0.372rem 0;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 0.093rem 0.186rem;
  background: var(--bg-secondary);
  border-radius: 0.140rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-right: 0.093rem;
  margin-bottom: 0.093rem;
}

.tag.primary {
  background: var(--primary-bg);
  color: var(--primary-color);
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.372rem;
  height: 0.372rem;
  padding: 0 0.093rem;
  background: var(--danger-color);
  color: white;
  border-radius: 0.372rem;
  font-size: 0.256rem;
  font-weight: 600;
}

/* 头像 */
.avatar {
  width: 0.930rem;
  height: 0.930rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-secondary);
}

.avatar-sm {
  width: 0.558rem;
  height: 0.558rem;
}

.avatar-lg {
  width: 1.395rem;
  height: 1.395rem;
}

/* 卡片 */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 0.465rem;
  box-shadow: var(--shadow-sm);
  border: 0.023rem solid var(--border-light);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.372rem;
}

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

.card-body {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

/* 响应式辅助类 */
.hide-mobile {
  display: block;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }
  
  .show-mobile {
    display: block;
  }
}

/* 文本样式 */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-danger { color: var(--danger-color); }
.text-success { color: #10b981; }
.text-warning { color: var(--secondary-color); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-xxl { font-size: var(--font-size-xxl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* 边距辅助类 */
.mt-1 { margin-top: 0.023rem; }
.mt-2 { margin-top: 0.047rem; }
.mt-3 { margin-top: 0.070rem; }
.mt-4 { margin-top: 0.093rem; }
.mb-1 { margin-bottom: 0.023rem; }
.mb-2 { margin-bottom: 0.047rem; }
.mb-3 { margin-bottom: 0.070rem; }
.mb-4 { margin-bottom: 0.093rem; }

.p-1 { padding: 0.023rem; }
.p-2 { padding: 0.047rem; }
.p-3 { padding: 0.070rem; }
.p-4 { padding: 0.093rem; }

/* 响应式 */
@media (max-width: 480px) {
  .input-row {
    flex-direction: column;
  }
}
