/* ========================================
   角色工坊 - 明亮活泼设计系统
   Design System: Bright & Lively
   ======================================== */

/* ========== CSS变量 - 色彩系统 ========== */
:root {
  /* 背景色阶 - 明亮温暖 */
  --bg-primary: #f8f9ff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2ff;
  --bg-accent-soft: #faf5ff;
  --bg-yellow-soft: #fef3c7;
  
  /* 品牌色 - 渐变活泼 */
  --brand-primary: #8b5cf6;
  --brand-secondary: #ec4899;
  --brand-tertiary: #f59e0b;
  --brand-cyan: #06b6d4;
  
  /* 语义色 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* 文字色 */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  
  /* 边框 */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-strong: #9ca3af;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(139, 92, 246, 0.1);
  --shadow-md: 0 4px 12px rgba(139, 92, 246, 0.15);
  --shadow-lg: 0 12px 24px rgba(139, 92, 246, 0.2);
  --shadow-color: 0 8px 20px rgba(236, 72, 153, 0.25);
  --shadow-hover: 0 12px 32px rgba(236, 72, 153, 0.35);
  
  /* 渐变 */
  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gradient-brand-alt: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-bg-purple: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  --gradient-bg-yellow: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  
  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  
  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 按钮组件 ========== */
.btn-new {
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

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

.btn-primary-new {
  background: var(--gradient-brand);
  color: white;
  box-shadow: var(--shadow-color);
}

.btn-primary-new:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-primary-new:active:not(:disabled) {
  transform: translateY(-1px);
}

.btn-secondary-new {
  background: white;
  border: 2px solid var(--border-medium);
  color: var(--text-primary);
}

.btn-secondary-new:hover:not(:disabled) {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-success-new {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success-new:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-sm-new {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-xs-new {
  padding: 6px 14px;
  font-size: 12px;
}

/* ========== 输入框组件 ========== */
.input-new {
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all var(--transition-base);
  outline: none;
  width: 100%;
}

.input-new:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.input-new::placeholder {
  color: var(--text-tertiary);
}

.input-new:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
}

/* ========== 徽章组件 ========== */
.badge-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success-new {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.badge-warning-new {
  background: linear-gradient(135deg, #fed7aa 0%, #fbbf24 100%);
  color: #78350f;
}

.badge-info-new {
  background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
  color: #1e3a8a;
}

.badge-purple-new {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #6b21a8;
}

.badge-danger-new {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

/* ========== 卡片组件 ========== */
.card-new {
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-smooth);
  position: relative;
}

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

/* 卡片渐变边框效果 */
.card-new::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 2px;
  background: var(--gradient-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.card-new:hover::before {
  opacity: 1;
}

/* ========== 进度条组件 ========== */
.progress-new {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill-new {
  height: 100%;
  background: var(--gradient-brand);
  transition: width 0.6s ease;
  border-radius: 3px;
}

/* ========== 模态框 ========== */
.modal-new {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.modal-content-new {
  background: white;
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

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

/* ========== 工具提示 ========== */
.tooltip-new {
  position: relative;
  display: inline-block;
}

.tooltip-new::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 6px 12px;
  background: var(--text-primary);
  color: white;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.tooltip-new:hover::after {
  opacity: 1;
}

/* ========== 加载动画 ========== */
.spinner-new {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== 空状态 ========== */
.empty-state-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-new .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-new .title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-new .desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ========== 表单布局 ========== */
.form-group-new {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.form-label-new {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-hint-new {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ========== 分割线 ========== */
.divider-new {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-xl) 0;
}

/* ========== 标签页 ========== */
.tabs-new {
  display: flex;
  gap: var(--space-sm);
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-xl);
}

.tab-new {
  padding: 12px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-base);
}

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

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

/* ========== 通知提示 ========== */
.toast-new {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInRight 0.3s ease;
  z-index: 10000;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-new.success {
  border-color: var(--success);
}

.toast-new.error {
  border-color: var(--danger);
}

.toast-new.warning {
  border-color: var(--warning);
}

/* ========== 响应式工具类 ========== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ========== 文本工具类 ========== */
.text-gradient-new {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-sm-new { font-size: 13px; }
.text-base-new { font-size: 15px; }
.text-lg-new { font-size: 18px; }
.text-xl-new { font-size: 20px; }
.text-2xl-new { font-size: 24px; }

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

/* ========== 间距工具类 ========== */
.mt-xs-new { margin-top: var(--space-xs); }
.mt-sm-new { margin-top: var(--space-sm); }
.mt-md-new { margin-top: var(--space-md); }
.mt-lg-new { margin-top: var(--space-lg); }
.mt-xl-new { margin-top: var(--space-xl); }

.mb-xs-new { margin-bottom: var(--space-xs); }
.mb-sm-new { margin-bottom: var(--space-sm); }
.mb-md-new { margin-bottom: var(--space-md); }
.mb-lg-new { margin-bottom: var(--space-lg); }
.mb-xl-new { margin-bottom: var(--space-xl); }

.p-sm-new { padding: var(--space-sm); }
.p-md-new { padding: var(--space-md); }
.p-lg-new { padding: var(--space-lg); }
.p-xl-new { padding: var(--space-xl); }

/* ========== Flex 工具类 ========== */
.flex-new { display: flex; }
.flex-col-new { flex-direction: column; }
.items-center-new { align-items: center; }
.justify-center-new { justify-content: center; }
.justify-between-new { justify-content: space-between; }
.gap-sm-new { gap: var(--space-sm); }
.gap-md-new { gap: var(--space-md); }
.gap-lg-new { gap: var(--space-lg); }

/* ========== 动画效果 ========== */
.hover-lift {
  transition: transform var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-rotate {
  transition: all var(--transition-smooth);
}

.hover-rotate:hover {
  transform: translateY(-8px) rotate(2deg);
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}
