/* user.css - 用户中心页面样式 */

/* ===== Header layout: logo | nav | [search + avatar] ===== */
.top-header .header-inner {
  display: flex !important;
  align-items: center !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  height: 60px !important;
  gap: 16px !important;
}
.top-header .site-logo { flex-shrink: 0 !important; }
.top-header .site-logo a { color: var(--primary, #1e3a5f) !important; font-size: 1.2rem !important; font-weight: 700 !important; text-decoration: none !important; }
.top-header .site-nav { display: flex !important; gap: 16px !important; flex-shrink: 0 !important; }
.top-header .site-nav a { color: #374151 !important; font-size: 0.92rem !important; text-decoration: none !important; white-space: nowrap !important; }
.top-header .site-nav a:hover { color: #2563eb !important; }

/* header-right: search + avatar, pushed to the right */
.top-header .header-right {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}
.top-header .header-search-center {
  display: flex !important;
  justify-content: center !important;
}
.top-header .header-search-center .search-box {
  margin-left: 0 !important;
}
.top-header .site-user-nav {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  position: relative !important;
}

/* ===== Avatar dropdown ===== */
.top-header .user-avatar-dropdown { position: relative !important; }
.top-header .user-avatar-dropdown::after {
  content: '' !important; position: absolute !important; top: 100% !important; left: 0 !important; right: 0 !important; height: 8px !important;
}
.top-header .user-avatar-trigger { cursor: pointer !important; display: flex !important; align-items: center !important; padding: 4px !important; border-radius: 50% !important; }
.top-header .user-avatar-trigger:hover { opacity: 0.85 !important; }
.top-header .avatar-circle {
  width: 36px !important; height: 36px !important; border-radius: 50% !important;
  background: #1e3a5f !important; color: #fff !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-size: 0.9rem !important; font-weight: 600 !important; flex-shrink: 0 !important; overflow: hidden !important;
}
.top-header .user-avatar-dropdown:hover .dropdown-menu { display: block !important; }
.top-header .dropdown-menu {
  display: none !important; position: absolute !important; right: 0 !important; top: 100% !important;
  margin-top: 6px !important; background: #fff !important; border: 1px solid #e5e7eb !important;
  border-radius: 10px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
  min-width: 200px !important; padding: 0 !important; z-index: 1000 !important;
}
.dropdown-user-card { padding: 16px !important; text-align: center !important; border-bottom: 1px solid #f3f4f6 !important; }
.dropdown-user-card .du-avatar {
  width: 48px !important; height: 48px !important; border-radius: 50% !important;
  background: #1e3a5f !important; color: #fff !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-size: 1.1rem !important; font-weight: 600 !important; margin: 0 auto 8px !important; overflow: hidden !important;
}
.dropdown-user-card .du-name { font-size: 0.95rem !important; font-weight: 600 !important; color: #111827 !important; margin-bottom: 4px !important; }
.dropdown-user-card .du-vip { font-size: 0.78rem !important; padding: 2px 8px !important; border-radius: 10px !important; display: inline-block !important; }
.dropdown-user-card .du-vip.vip-active { background: #dcfce7 !important; color: #16a34a !important; }
.dropdown-user-card .du-vip.vip-none { background: #f3f4f6 !important; color: #6b7280 !important; }
.top-header .dropdown-menu .dropdown-item {
  display: flex !important; align-items: center !important; gap: 8px !important;
  padding: 10px 16px !important; color: #374151 !important; text-decoration: none !important;
  font-size: 0.88rem !important; white-space: nowrap !important;
}
.top-header .dropdown-menu .dropdown-item:hover { background: #f3f4f6 !important; }
.top-header .dropdown-menu .dropdown-item svg { color: #6b7280 !important; flex-shrink: 0 !important; }
.top-header .dropdown-divider { height: 1px !important; background: #f3f4f6 !important; margin: 0 !important; }

/* 用户中心页面布局 */
.profile-layout {
  display: flex;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* 左侧边栏 */
.profile-sidebar {
  width: 220px;
  flex-shrink: 0;
}
.profile-card-mini {
  background: #fff;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-bottom: 10px;
}
.profile-avatar-wrap .profile-avatar-lg {
  display: block;
}
.avatar-upload-mask {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  top: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-avatar-wrap:hover .avatar-upload-mask {
  opacity: 1;
}
.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #1e3a5f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto;
  overflow: hidden;
}
.profile-card-mini h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #111827;
}
.profile-nav {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.profile-nav-item:hover {
  background: #f9fafb;
}
.profile-nav-item.active {
  color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}
.profile-nav-item:last-child {
  border-bottom: none;
}

/* 右侧内容区 */
.profile-content {
  flex: 1;
  min-width: 0;
}
.profile-section {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.profile-section h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: #111827;
}
.info-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.info-item:last-child {
  border-bottom: none;
}
.info-label {
  width: 80px;
  flex-shrink: 0;
  color: #6b7280;
  font-size: 0.9rem;
}
.info-value {
  color: #111827;
  font-size: 0.9rem;
}

/* VIP 卡片 */
.vip-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.vip-plan-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
  position: relative;
}
.vip-plan-card:hover {
  border-color: #2563eb;
}
.plan-name {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}
.plan-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 4px;
}
.plan-days {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 12px;
}
.plan-detail {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 16px;
}
.plan-detail p { margin: 0; }

/* VIP 联系方式 */
.vip-contact {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #166534;
  line-height: 1.8;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-info { background: #e2e8f0; color: #64748b; }

/* 表格 */
.profile-table {
  width: 100%;
  border-collapse: collapse;
}
.profile-table th,
.profile-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.88rem;
}
.profile-table th {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.82rem;
}
.profile-table a {
  color: #2563eb;
  text-decoration: none;
}

/* 表单 */
.admin-form .form-group {
  margin-bottom: 14px;
}
.admin-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
  color: #374151;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}
.form-input:focus {
  border-color: #2563eb;
}
.form-actions {
  margin-top: 16px;
}
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn-primary:hover {
  background: #1d4ed8;
}
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}
.btn-sm {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
  color: #374151;
  text-decoration: none;
}
.btn-sm:hover {
  background: #f3f4f6;
}
.btn-outline {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  color: #2563eb;
  background: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-outline:hover {
  background: #eff6ff;
}

/* Alert */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.88rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fef2f2; color: #dc2626; }

/* 卡密激活弹框 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 420px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}
.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
  background: none;
  border: none;
  padding: 4px;
}
.modal-body {
  padding: 20px;
}

/* 移动端响应 */
@media (max-width: 768px) {
  /* 手机端 header：隐藏导航、搜索、登录注册，头像靠右，站名居中 */
  .top-header .site-nav { display: none !important; }
  .top-header .site-user-nav { display: none !important; }
  .top-header .header-right .header-search-center { display: none !important; }
  .top-header .header-inner {
    justify-content: center !important;
    padding: 0 12px !important;
    height: 52px !important;
    gap: 0 !important;
    position: relative !important;
  }
  .top-header .site-logo { font-size: 1.05rem !important; text-align: center !important; }
  .top-header .header-right {
    margin-left: 0 !important;
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  /* ===== 手机端个人中心：头像 + 选项卡横向 ===== */
  .profile-layout {
    flex-direction: column;
    padding: 16px 12px;
    gap: 0;
  }
  .profile-sidebar {
    width: 100%;
    margin-bottom: 0;
  }
  .profile-card-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 0;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
  }
  .profile-card-mini .profile-avatar-wrap {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .profile-card-mini .profile-avatar-lg {
    width: 48px;
    height: 48px;
  }
  .profile-card-mini h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
  }
  .profile-card-mini p {
    margin: 0;
  }
  /* 选项卡一行显示 */
  .profile-nav {
    display: flex;
    flex-wrap: nowrap;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .profile-nav-item {
    flex: 0 0 auto;
    padding: 8px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
    border-bottom: none;
    border-right: 1px solid #f3f4f6;
    gap: 2px;
  }
  .profile-nav-item:last-child {
    border-right: none;
    border-bottom: none;
  }
  .profile-nav-item svg {
    width: 12px;
    height: 12px;
  }
  .profile-content {
    width: 100%;
  }
  .profile-section {
    padding: 16px;
  }
  .pay-method-list { width: 100% !important; flex-direction: column; }
  .pay-method-option { width: 100% !important; flex: none !important; padding: 12px 14px !important; font-size: 0.85rem; }

  /* VIP 页面 */
  .vip-page {
    max-width: 100% !important;
    padding: 14px 14px 80px !important;
    box-sizing: border-box;
  }
  .vip-plans {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .vip-plan-card {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 16px;
  }
  .vip-plan-card.featured {
    border-color: #2563eb;
    border-width: 2px;
    padding-top: 28px;
  }
  .vip-plan-card.featured .plan-tag {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 16px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
  }
  .plan-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #dc2626;
  }
  .plan-action .btn {
    padding: 11px 0;
    font-size: 0.95rem;
    font-weight: 700;
  }
}
