/* ============================================
   Nyx Studio - 全局样式
   ============================================ */

/* CSS 变量 - 颜色主题 */
:root {
  --bg: #0a0a12;
  --bg-light: #12121f;
  --bg-card: #1a1a2e;
  --bg-hover: #252540;
  --primary: #9d4edd;
  --primary-light: #c77dff;
  --accent: #ffd700;
  --accent-dark: #b8860b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d2d44;
  --normal-order: #3b82f6;
  --gift-order: #ec4899;
  --monthly-order: #10b981;
  --prepaid-order: #f59e0b;
  --bonus: #ffd700;
}

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

body {
  font-family: 'Noto Sans SC', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-light) 50%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 背景装饰 */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(157, 78, 221, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(199, 125, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* 星星背景 */
.stars-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.6;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@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% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 主内容区 */
.main-content {
  position: relative;
  z-index: 1;
}

/* 通用容器 */
.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

.container-wide {
  max-width: 600px;
}

/* 卡片样式 */
.card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-light));
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 var(--border);
  animation: fadeIn 0.5s ease-out;
}

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

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

.form-input, .form-select {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-input-readonly {
  background: var(--bg);
  color: var(--text-muted);
}

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

/* 按钮样式 */
.btn {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 20px rgba(157, 78, 221, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(157, 78, 221, 0.5);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-light);
  cursor: pointer;
  font-size: 14px;
  padding: 8px;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

/* 错误提示 */
.error-message {
  padding: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 16px;
  white-space: pre-line;
}

/* 成功提示 */
.success-message {
  padding: 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--success);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* Logo 区域 */
.logo-section {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(157, 78, 221, 0.5));
}

.logo-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.logo-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* 页面头部 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 返回按钮 */
.back-button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* 用户卡片 */
.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.25), rgba(199, 125, 255, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 22px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-role {
  color: var(--text-muted);
  font-size: 14px;
}

/* 余额显示 */
.balance-card {
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.balance-card-normal {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(184, 134, 11, 0.06));
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.balance-card-failed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.06));
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.balance-label {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.balance-amount {
  font-size: 36px;
  font-weight: 700;
}

.balance-amount-normal {
  color: var(--accent);
}

.balance-amount-failed {
  color: var(--danger);
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.status-tag-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-tag-accent {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent);
}

.status-tag-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* 提示横幅 */
.alert-banner {
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.alert-banner-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.alert-banner-accent {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--accent);
}

/* 进度条 */
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-light);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  transition: width 0.5s ease;
}

.progress-fill-warning {
  background: linear-gradient(90deg, var(--warning), var(--accent-dark));
}

.progress-fill-success {
  background: linear-gradient(90deg, var(--success), #059669);
}

.progress-fill-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* 订单类型颜色 */
.order-type-normal { color: var(--normal-order); }
.order-type-gift { color: var(--gift-order); }
.order-type-monthly { color: var(--monthly-order); }
.order-type-prepaid { color: var(--prepaid-order); }
.order-type-bonus { color: var(--bonus); }

/* 订单卡片 */
.order-card {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  position: relative;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.order-card-type {
  font-weight: 600;
}

.order-card-amount {
  color: var(--accent);
  font-weight: 600;
}

.order-card-details {
  font-size: 13px;
  color: var(--text-muted);
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

/* Emoji 选择器 */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.emoji-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.emoji-btn:hover {
  background: var(--bg-hover);
}

.emoji-btn.selected {
  border: 2px solid var(--primary);
  background: rgba(157, 78, 221, 0.2);
}

.emoji-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.emoji-category-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--bg-hover);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
}

.emoji-category-btn.active {
  background: var(--primary);
}

/* 日历 */
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-nav-btn {
  background: var(--bg-hover);
  border: none;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekday {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 10px;
  border: none;
  background: var(--bg-light);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  color: var(--text);
  font-size: 14px;
}

.calendar-day:hover {
  background: var(--bg-hover);
}

.calendar-day.selected {
  border: 2px solid var(--primary);
  background: rgba(157, 78, 221, 0.2);
}

.calendar-day.today {
  border: 1px solid var(--accent);
}

.calendar-day-dots {
  display: flex;
  gap: 2px;
}

.calendar-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* 图例 */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* 删除小猫按钮 */
.delete-cat-btn {
  cursor: pointer;
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 999;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 182, 193, 0.3);
  border-radius: 50%;
  border: none;
  padding: 0;
}

/* 通知气泡 */
.notification-bubble {
  position: relative;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

/* 任务打勾按钮 */
.task-check-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 余额明细 */
.balance-detail {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
  text-align: left;
}

.balance-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.balance-detail-label {
  color: var(--text-muted);
}

.balance-detail-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 0 0;
  margin-top: 4px;
  font-weight: 600;
}

/* 任务区块 */
.task-block {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-light);
}

/* 结算勾选框 */
.settle-checkbox {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settle-checkbox.checked {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

/* Flex 工具类 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }

/* 间距工具类 */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* 文本工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 600; }

/* 隐藏元素 */
.hidden { display: none !important; }

/* 居中页面 */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 管理者统计区块 */
.stats-section {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.stats-section-red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.stats-section-green {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.stats-section-yellow {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.stats-section-title {
  margin-bottom: 12px;
}

/* 列表项 */
.list-item {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-light);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.list-item:hover {
  background: var(--bg-hover);
}

.list-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.list-item-avatar {
  font-size: 24px;
}

.list-item-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

/* 工资明细 */
.salary-detail {
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 13px;
}

.salary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.salary-total {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}
