/* 全局样式 */
* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 页面切换动画 */
.page {
  animation: fadeIn 0.2s ease;
}

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

/* 导航激活状态 */
.nav-active {
  color: #a78bfa !important;
}

/* 订阅类型按钮 */
.sub-type-btn.selected {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.15);
}

/* 筛选按钮 */
.sub-filter-btn {
  background: rgba(31, 41, 55, 0.8);
  color: #9ca3af;
  border: 1px solid rgba(75, 85, 99, 0.5);
}
.sub-filter-btn.active {
  background: rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  border-color: rgba(124, 58, 237, 0.5);
}

.notif-filter-btn {
  background: rgba(31, 41, 55, 0.8);
  color: #9ca3af;
  border: 1px solid rgba(75, 85, 99, 0.5);
}
.notif-filter-btn.active {
  background: rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  border-color: rgba(124, 58, 237, 0.5);
}

/* Toggle开关 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #374151;
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: #7c3aed;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* 通知卡片 */
.notif-card {
  transition: all 0.2s;
}
.notif-card:hover {
  border-color: rgba(124, 58, 237, 0.4) !important;
  transform: translateX(2px);
}
.notif-card.unread {
  border-left: 3px solid #7c3aed;
}

/* 订阅卡片 */
.sub-card {
  transition: all 0.2s;
}
.sub-card:hover {
  border-color: rgba(124, 58, 237, 0.4) !important;
}

/* Toast动画 */
#toast.show {
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 定价卡片 */
.pricing-card {
  transition: all 0.3s;
}
.pricing-card:hover {
  transform: translateY(-4px);
}
.pricing-card.popular {
  border-color: #7c3aed !important;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.2);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #111827;
}
::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* 加载动画 */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 状态指示点 */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.active {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}
.status-dot.inactive {
  background: #6b7280;
}

/* 移动端适配 */
@media (max-width: 767px) {
  #nav-user { display: none !important; }
  #mobile-menu-btn { display: block !important; }
}
@media (min-width: 768px) {
  #mobile-menu-btn { display: none !important; }
  .modal-bg {
    backdrop-filter: blur(0);
  }
  .modal-overlay > .relative {
    margin: 8px;
    max-height: calc(100vh - 16px) !important;
  }
}
