* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: #f5f6f7;
  color: #1a1a1a;
  line-height: 1.6;
}
/* ===== 通用组件 ===== */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.btn-primary {
  background: #0066ff;
  color: #fff;
}
.btn-primary:hover {
  background: #0052cc;
}
.btn-success {
  background: #52c41a;
  color: #fff;
}
.btn-success:hover {
  background: #45a615;
}
.btn-outline {
  background: #fff;
  color: #0066ff;
  border: 1px solid #0066ff;
}
.btn-outline:hover {
  background: #f0f7ff;
}
.btn-danger {
  background: #ff4d4f;
  color: #fff;
}
.btn-danger:hover {
  background: #d9363e;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success {
  background: #f6ffed;
  color: #52c41a;
}
.badge-warning {
  background: #fffbe6;
  color: #faad14;
}
.badge-error {
  background: #fff2f0;
  color: #ff4d4f;
}
.badge-info {
  background: #e6f7ff;
  color: #1890ff;
}
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2000;
}
.toast.show {
  opacity: 1;
}
/* ===== 登录/注册页面 ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.auth-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: #666;
  font-size: 14px;
  text-align: center;
  margin-bottom: 32px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
}
.form-group.code .code_box{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group.code input {
  width: 65%;
}
.form-group.code span {
  display: inline-block;
  width: 30%;
  padding: 12px 16px;
  cursor: pointer;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 12px;
  transition: border-color 0.2s;
  background: #0066ff;
  color: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: #0066ff;
}
.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #666;
}
.auth-footer a {
  color: #0066ff;
  text-decoration: none;
}
.auth-footer a:hover {
  text-decoration: underline;
}
.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}
.auth-toggle a {
  color: #0066ff;
  text-decoration: none;
  font-weight: 500;
}
/* ===== 主布局 ===== */
.app-container {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid #e5e5e5;
  padding: 24px 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 0 24px 24px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 24px;
}
.sidebar-logo span {
  color: #0066ff;
}
.nav-menu {
  list-style: none;
}
.nav-item {
  padding: 12px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
}
.nav-item:hover {
  background: #f5f6f7;
  color: #0066ff;
}
.nav-item.active {
  background: #e6f7ff;
  color: #0066ff;
  border-right: 2px solid #0066ff;
}
.nav-item i {
  margin-right: 12px;
  font-size: 18px;
}
.main-content {
  margin-left: 240px;
  padding: 32px;
}
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-size: 24px;
  font-weight: 600;
}
.page-subtitle {
  color: #666;
  font-size: 14px;
  margin-top: 4px;
}
/* ===== 订阅页面 ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.product-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #ff4d4f;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}
.product-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}
.product-desc {
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
  min-height: 68px;
}
.product-status {
  margin-bottom: 16px;
  font-size: 14px;
  min-height: 24px;
}
.product-pricing {
  margin-bottom: 20px;
}
.original-price {
  color: #999;
  text-decoration: line-through;
  font-size: 14px;
  margin-right: 8px;
}
.current-price {
  color: #ff4d4f;
  font-size: 24px;
  font-weight: 600;
}
.current-price span {
  font-size: 14px;
  margin-right: 4px;
}
.product-features {
  list-style: none;
  margin-bottom: 20px;
}
.product-features li {
  font-size: 14px;
  color: #666;
  padding: 4px 0;
  display: flex;
  align-items: center;
}
.product-features li::before {
  content: "✓";
  color: #52c41a;
  margin-right: 8px;
  font-weight: bold;
}
.subscribe-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.subscribe-btn.primary {
  background: #0066ff;
  color: #fff;
}
.subscribe-btn.primary:hover {
  background: #0052cc;
}
.subscribe-btn.success {
  background: #52c41a;
  color: #fff;
}
.subscribe-btn.renew {
  background: #faad14;
  color: #fff;
}
.subscribe-btn.renew:hover {
  background: #d48806;
}
/* ===== 表格样式 ===== */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
}
.table th {
  background: #f5f6f7;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}
.table td {
  font-size: 14px;
  color: #666;
}
.table tr:hover td {
  background: #f5f6f7;
}
/* ===== API Keys 页面 ===== */
.api-key-card {
  background: #f5f6f7;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  margin-bottom: 12px;
}
.api-key-value {
  color: #333;
  word-break: break-all;
}
.api-key-info {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}
.api-key-actions {
  display: flex;
  gap: 8px;
}
/* ===== 个人中心 ===== */
.profile-card {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #0066ff;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: 600;
}
.profile-info h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.profile-info p {
  color: #666;
  font-size: 14px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #0066ff;
}
.stat-label {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}
/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  background: #f5f6f7;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  line-height: 30px;
  cursor: pointer;
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
}
.qr-code {
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
  background: #f5f6f7;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.qr-code img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.modal-amount {
  font-size: 28px;
  font-weight: 600;
  color: #ff4d4f;
  margin-bottom: 16px;
}
.modal-timer {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
}
.modal-buttons {
  display: flex;
  gap: 12px;
}
.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
}
.modal-btn-cancel {
  background: #f5f6f7;
  color: #333;
}
.modal-btn-cancel:hover {
  background: #e5e5e5;
}
.modal-btn-confirm {
  background: #0066ff;
  color: #fff;
}
.modal-btn-confirm:hover {
  background: #0052cc;
}
/* ===== 页面切换 ===== */
.page {
  display: none;
}
.page.active {
  display: block;
}

/* 遮罩层：全屏固定、居中布局 */
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4); /* 半透明黑色背景 */
  z-index: 3001;
  display: flex; /* 使用 flex 轻松实现居中 */
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s; /* 可选：增加淡入淡出效果 */
}

/* 隐藏状态 */
.loading-mask.hidden {
  display: none;
}

/* 内容容器：白色卡片背景 */
.loading-content {
  background-color: #fff;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

/* 纯CSS绘制的旋转圆圈 */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3; /* 浅灰色底圈 */
  border-top: 3px solid #3498db; /* 蓝色转动部分 */
  border-radius: 50%;
  margin-bottom: 10px;
  animation: spin 1s linear infinite; /* 绑定旋转动画 */
}

/* 文字样式 */
.loading-text {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* 定义旋转动画的关键帧 */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 3001;
  display: flex;
  justify-content: center;
  align-items: center;
}
.loading-mask.hidden {
  display: none;
}

.loading-content {
  background: rgba(255, 255, 255, 0.9);
  padding: 16px 24px;
  border-radius: 4px;
  box-shadow:
    0 3px 6px -4px rgba(0, 0, 0, 0.12),
    0 6px 16px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ant Design 风格的四点旋转器 */
.ant-loading-spinner {
  width: 30px;
  height: 30px;
  position: relative;
  animation: antRotate 1.2s infinite linear;
  margin-bottom: 8px;
}
.ant-loading-spinner span {
  position: absolute;
  display: block;
  width: 12px;
  height: 12px;
  background-color: #1890ff; /* 主题色 */
  border-radius: 100%;
  opacity: 0.3;
  transform: scale(0.75);
  transform-origin: 50% 50%;
  animation: antSpinMove 1s infinite linear alternate;
}
.ant-loading-spinner span:nth-child(1) {
  top: 0;
  left: 0;
}
.ant-loading-spinner span:nth-child(2) {
  top: 0;
  right: 0;
  animation-delay: 0.4s;
}
.ant-loading-spinner span:nth-child(3) {
  right: 0;
  bottom: 0;
  animation-delay: 0.8s;
}
.ant-loading-spinner span:nth-child(4) {
  bottom: 0;
  left: 0;
  animation-delay: 1.2s;
}

.loading-text {
  margin: 0;
  color: rgba(0, 0, 0, 0.65);
  font-size: 14px;
}

@keyframes antRotate {
  to {
    transform: rotate(360deg);
  }
}
@keyframes antSpinMove {
  to {
    opacity: 1;
  }
}

/* --- 核心分页样式 Start --- */

/* 容器：Flex布局，两端对齐 */
.pagination-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  background-color: transparent; /* 如果是在列表底部，通常不需要额外背景 */
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none; /* 防止双击选中文本 */
}

/* 左侧统计信息文本 */
.pagination-info-text {
  color: #8b9bb4; /* 浅蓝灰色 */
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.5px;
}

/* 右侧按钮组容器 */
.pagination {
  display: flex;
  gap: 8px; /* 按钮之间的间距 */
  align-items: center;
}

/* 通用按钮样式 */
.page-btn {
  background-color: #1e2235; /* 深色背景块 */
  border: 1px solid #2d3748; /* 微弱的边框 */
  color: #cbd5e0; /* 默认文字颜色 */
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px; /* 圆角 */
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

/* 鼠标悬停效果 (非禁用状态) */
.page-btn:not(:disabled):not(.active):hover {
  border-color: #00f0ff; /* 悬停变青色边框 */
  color: #fff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2); /* 微弱发光 */
}

/* 激活状态 (当前页) */
.page-btn.active {
  background-color: rgba(0, 240, 255, 0.15); /* 青色半透明背景 */
  border-color: #00f0ff; /* 青色边框 */
  color: #00f0ff; /* 青色文字 */
  font-weight: bold;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3); /* 发光效果 */
}

/* 禁用状态 (上一页/下一页不可点) */
.page-btn:disabled,
.page-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  background-color: #151825;
  border-color: transparent;
  color: #5a6b8c;
}

/* "..." 省略号样式 */
.page-btn.dots {
  cursor: default;
  border: none;
  background: transparent;
  color: #5a6b8c;
}
.page-btn.dots:hover {
  box-shadow: none;
  border-color: transparent;
}

/* 移动端适配：屏幕变窄时调整布局 */
@media (max-width: 768px) {
  .pagination-box {
    flex-direction: column;
    gap: 15px;
  }
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}
/* --- 核心分页样式 End --- */

#captcha-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}