﻿/* ================================================================
   星涵智联小游戏平台 - 用户认证 & 会员样式
   基于 Bootstrap 3.3.5 风格
================================================================ */

/* —— 顶部用户栏 —— */
.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #9c27b0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  color: #3C4858;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* 会员徽章 */
.member-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.member-free  { background: #e0e0e0; color: #999; }
.member-vip    { background: #f0ad4e; color: #fff; }
.member-svip   { background: #9c27b0; color: #fff; }

/* 导航按钮 */
.nav-btn {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 3px;
  text-decoration: none !important;
  white-space: nowrap;
  font-weight: 600;
  transition: all .2s;
  line-height: 1.4;
  cursor: pointer;
  border: none;
  display: inline-block;
}
.nav-btn:hover { opacity: .85; text-decoration: none; }

.btn-login    { background: #9c27b0; color: #fff !important; }
.btn-register { background: #fff; color: #9c27b0 !important; border: 1px solid #9c27b0; }
.btn-vip      { background: #f0ad4e; color: #fff !important; }
.btn-logout   { background: #f5f5f5; color: #888 !important; }
.btn-pwd      { background: #fff; color: #666 !important; border: 1px solid #ddd; }
.btn-pwd:hover { background: #f9f9f9; color: #333 !important; }

/* —— 弹窗 —— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-box {
  background: #fff;
  border-radius: 4px;
  padding: 0;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 3px 9px rgba(0,0,0,.5);
  max-height: 92vh;
  overflow: hidden;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.modal-wide { max-width: 560px; }

.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  font-size: 21px;
  font-weight: 700;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  z-index: 10;
}
.modal-close:hover { color: #333; }

/* 弹窗头部 */
.modal-box .modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e5e5e5;
  background: #f5f5f5;
}
.modal-box .modal-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.modal-box .modal-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #999;
}

.modal-box .modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(92vh - 130px);
}

.modal-box .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
  text-align: right;
}

/* 登录/注册 Tab */
.modal-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 18px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.tab-btn.active {
  color: #9c27b0;
  border-bottom-color: #9c27b0;
}

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group input,
.form-group select {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  box-sizing: border-box;
}
.form-group input:focus {
  border-color: #9c27b0;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 3px rgba(156,39,176,.3);
}
.form-group input::placeholder { color: #aaa; }

.form-msg {
  font-size: 12px;
  min-height: 16px;
  margin-bottom: 8px;
  color: #999;
}
.form-msg.error   { color: #d9534f; }
.form-msg.success { color: #5cb85c; }

/* Bootstrap 按钮 */
.btn-submit {
  display: inline-block;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.42857143;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #fff;
  background: #9c27b0;
  transition: background .2s, box-shadow .2s;
  width: 100%;
}
.btn-submit:hover { background: #7b1fa2; color: #fff; }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.btn-submit.btn-sm { padding: 6px 12px; font-size: 12px; }

/* —— 会员中心 —— */

/* 用户信息卡片 */
.panel-user {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.panel-user .uic-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #9c27b0;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  flex-shrink: 0;
}
.panel-user .uic-name   { font-size: 15px; font-weight: 700; color: #333; }
.panel-user .uic-status { font-size: 12px; color: #9c27b0; font-weight: 600; margin-top: 2px; }
.panel-user .uic-expire { font-size: 11px; color: #999; margin-top: 2px; }

/* 权益说明 */
.member-benefits {
  margin-bottom: 16px;
}
.member-benefits .benefit-title {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}
.benefit-item {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
  background: #f5f5f5;
  color: #999;
  margin: 0 4px 6px 0;
  font-weight: 500;
}
.benefit-item.active {
  background: #ede7f6;
  color: #7b1fa2;
  font-weight: 700;
}

/* 套餐区标题 */
.plans-title {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

/* 套餐网格 */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.plan-card {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 14px 10px;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  position: relative;
}
.plan-card:hover {
  border-color: #9c27b0;
  box-shadow: 0 2px 6px rgba(156,39,176,.2);
}

.plan-vip  { border-color: #e8c56f; }
.plan-svip { border-color: #ce93d8; }

/* 推荐标签 */
.plan-recommended {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  background: #9c27b0;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0 0 3px 3px;
}

.plan-badge { font-size: 22px; margin-bottom: 4px; }
.plan-name  { font-size: 12px; font-weight: 700; color: #333; margin-bottom: 6px; }
.plan-price {
  font-size: 22px;
  font-weight: 700;
  color: #9c27b0;
  line-height: 1.1;
  margin-bottom: 2px;
}
.plan-price small { font-size: 11px; color: #999; font-weight: 400; }
.plan-days  { font-size: 11px; color: #999; margin-bottom: 10px; }

.plan-buy-btn {
  display: inline-block;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #9c27b0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
  width: 100%;
}
.plan-buy-btn:hover:not(:disabled) { background: #7b1fa2; color: #fff; text-decoration: none; }
.plan-buy-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 分隔线 */
.modal-divider {
  border-top: 1px solid #eee;
  margin: 14px 0;
}

/* 修改密码区块 */
.change-pwd-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin: 0 0 10px;
}
.change-pwd-section .form-group:last-of-type { margin-bottom: 10px; }

/* —— 移动端适配 —— */
@media (max-width: 991px) {
  .user-bar { padding: 0 6px; gap: 4px; }
  .user-name  { display: none; }
  .member-badge { display: none; }
  .user-avatar { width: 28px; height: 28px; font-size: 12px; }
  .nav-btn { padding: 4px 9px; font-size: 11px; }
  .btn-register { display: none; }
}

@media (max-width: 480px) {
  .modal-box { border-radius: 3px; }
  .plans-grid { gap: 8px; }
  .plan-price { font-size: 20px; }
  .plan-card { padding: 12px 8px; }
  .panel-user { padding: 12px; gap: 10px; }
  .panel-user .uic-avatar { width: 40px; height: 40px; font-size: 16px; }
}

/* —— 桌面端 navbar 内用户栏颜色修正 —— */
.navbar .user-bar .user-name { color: #3C4858; }
.navbar .user-bar .user-avatar { box-shadow: 0 2px 6px rgba(156,39,176,.3); }
.navbar .user-bar .btn-login    { background: #9c27b0; color: #fff !important; }
.navbar .user-bar .btn-register { background: #fff; color: #9c27b0 !important; border: 1px solid #9c27b0; }
.navbar .user-bar .btn-vip      { background: #f0ad4e; color: #fff !important; }
.navbar .user-bar .btn-logout   { background: #f5f5f5; color: #888 !important; }
.navbar .user-bar .btn-pwd      { background: #fff; color: #666 !important; border: 1px solid #ddd; }
.navbar .user-bar .member-badge { display: inline-block; }

/* —— 电脑端顶部登录注册/会员入口强制显示 —— */
@media (min-width: 992px) {
  .navbar .user-bar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 50px;
    padding: 0 10px;
  }
  .navbar .user-bar .nav-btn {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 6px 14px;
    font-size: 12px;
    line-height: 1.4;
  }
  .navbar .user-bar .btn-login {
    background: #9c27b0 !important;
    color: #fff !important;
  }
  .navbar .user-bar .btn-register {
    background: #fff !important;
    color: #9c27b0 !important;
    border: 1px solid #9c27b0 !important;
  }
  .navbar .user-bar .btn-vip {
    background: #f0ad4e !important;
    color: #fff !important;
  }
  .navbar .user-bar .btn-pwd {
    background: #fff !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
  }
  .navbar .user-bar .btn-logout {
    background: #f5f5f5 !important;
    color: #888 !important;
  }
}
