/**
 * 文件: css/user.css (用户中心页)
 * 说明: 账号信息行、配额条、同步开关、表单与按钮样式，沿用宣纸底与朱砂主色
 */

/* palace-pages.css 的 .palace-content 会覆盖 UA 的 [hidden] 样式，需显式补回 */
#uc-guest[hidden],
#uc-main[hidden] {
  display: none !important;
}

/* 其他宫位页靠 .palace-layout 的 margin-top 撑开 hero 与卡片区间距，本页没有该包裹层，自行补齐 */
#uc-guest,
#uc-main {
  margin-top: 28px;
}


.uc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(51, 48, 46, 0.15);
}

.uc-row:last-child {
  border-bottom: none;
}

.uc-label {
  color: var(--text-color, #33302e);
  opacity: 0.65;
  font-size: 14px;
  flex-shrink: 0;
}

.uc-muted {
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.8;
}

/* 档案卡 */
.uc-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color, #872d2d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(51, 48, 46, 0.2);
}

.uc-profile-info {
  min-width: 0;
}

.uc-profile-email {
  font-size: 16px;
  font-weight: 600;
  word-break: break-all;
}

.uc-profile-plan {
  margin-top: 5px;
  font-size: 13px;
  opacity: 0.8;
}

/* 配额：日/月双条 */
.uc-quota-item {
  margin-bottom: 14px;
}

.uc-quota-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 6px;
}

.uc-quota-num {
  font-weight: bold;
  color: var(--primary-color, #872d2d);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.uc-quota-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(51, 48, 46, 0.1);
  overflow: hidden;
}

.uc-quota-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #872d2d, #b44230);
  transition: width 0.4s ease;
}

.uc-quota-bar-fill.month {
  background: linear-gradient(90deg, #8a6d2f, #b8894d);
}

.uc-quota-bar-fill.is-low {
  background: linear-gradient(90deg, #c07a2b, #d19a4a);
}

.uc-quota-bar-fill.is-empty {
  background: linear-gradient(90deg, #b44230, #c0532f);
}

.uc-quota-bonus {
  color: #8a6d2f;
  opacity: 1;
}

/* 会员权益列表标记 */
#uc-vip-card .x6r-vip-perks {
  list-style: none;
  padding-left: 2px;
}

#uc-vip-card .x6r-vip-perks li::before {
  content: '✦';
  color: #b8894d;
  margin-right: 8px;
  font-size: 12px;
}

/* VIP 卡片高亮 */
.uc-vip-card.is-vip,
.palace-card.is-vip {
  border: 1px solid rgba(184, 137, 77, 0.6);
  background: linear-gradient(135deg, rgba(184, 137, 77, 0.08), rgba(212, 175, 106, 0.06));
}

/* 按钮 */
.uc-btn {
  display: inline-block;
  margin: 8px 0 0;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: var(--button-bg, #872d2d);
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
}

.uc-btn:hover {
  opacity: 0.92;
}

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

.uc-btn.secondary {
  background: transparent;
  border: 1px solid var(--primary-color, #872d2d);
  color: var(--primary-color, #872d2d);
}

.uc-btn.danger {
  background: transparent;
  border: 1px solid #b44230;
  color: #b44230;
}

.uc-btn.danger:hover {
  background: #b44230;
  color: #fff;
}

.uc-login-card {
  text-align: center;
}

/* 开关 */
.uc-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.uc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.uc-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: rgba(51, 48, 46, 0.25);
  cursor: pointer;
  transition: background 0.25s;
}

.uc-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.uc-switch input:checked + .uc-switch-slider {
  background: var(--primary-color, #872d2d);
}

.uc-switch input:checked + .uc-switch-slider::before {
  transform: translateX(22px);
}

/* 表单 */
.uc-form input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(51, 48, 46, 0.25);
  border-radius: 8px;
  background: #fff;
  color: var(--text-color, #33302e);
  font-size: 14px;
}

.uc-form input:focus {
  outline: none;
  border-color: var(--primary-color, #872d2d);
  box-shadow: 0 0 0 2px rgba(135, 45, 45, 0.12);
}

.uc-form-msg {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.uc-form-msg.is-ok {
  background: rgba(104, 142, 38, 0.1);
  color: #688e26;
  border: 1px solid rgba(104, 142, 38, 0.3);
}

.uc-form-msg.is-error {
  background: rgba(180, 66, 48, 0.1);
  color: #b44230;
  border: 1px solid rgba(180, 66, 48, 0.3);
}

/* VIP 开通引导 */
.uc-vip-price {
  margin: 6px 0 4px;
  font-size: 26px;
  font-weight: bold;
  color: var(--primary-color, #872d2d);
  font-variant-numeric: tabular-nums;
}

.uc-vip-price span {
  font-size: 14px;
  font-weight: normal;
  opacity: 0.7;
}

.uc-vip-steps {
  margin: 6px 0 10px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
  opacity: 0.85;
}

.uc-vip-uid {
  margin: 4px 0;
  font-size: 13px;
  word-break: break-all;
}

#uc-vip-activate .uc-btn {
  text-decoration: none;
}

/* 联系方式与二维码 */
.uc-contacts {
  margin-top: 8px;
  font-size: 14px;
  line-height: 2;
}

.uc-copy {
  border-bottom: 1px dashed var(--primary-color, #872d2d);
  color: var(--primary-color, #872d2d);
  cursor: pointer;
}

.uc-copy-tip {
  font-size: 12px;
  opacity: 0.55;
  margin-left: 4px;
}

.uc-qrcode {
  width: 140px;
  height: 140px;
  margin-top: 6px;
  border: 1px solid rgba(51, 48, 46, 0.15);
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
}

.uc-qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(51, 48, 46, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: zoom-out;
  padding: 24px;
}

.uc-qr-overlay img {
  width: min(80vw, 420px);
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* 卡片进入动画（依次淡入） */
@keyframes uc-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#uc-main .palace-card {
  animation: uc-card-in 0.35s ease both;
}

#uc-main .palace-card:nth-child(2) { animation-delay: 0.04s; }
#uc-main .palace-card:nth-child(3) { animation-delay: 0.08s; }
#uc-main .palace-card:nth-child(4) { animation-delay: 0.12s; }
#uc-main .palace-card:nth-child(5) { animation-delay: 0.16s; }
#uc-main .palace-card:nth-child(6) { animation-delay: 0.2s; }

@media (max-width: 768px) {
  .uc-avatar {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .uc-form input {
    font-size: 16px;
  }
}
