* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}

.user-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

.user-container.logged-in {
  max-width: 1100px;
}

.user-page {
  width: 100%;
}

/* ==================== 登录卡片 ==================== */

.login-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 16px;
  padding: 40px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 26px;
  background: linear-gradient(135deg, #ff0050, #00f2ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: #888;
  font-size: 14px;
  margin-top: 8px;
}

.login-form label {
  display: block;
  font-size: 13px;
  color: #a0a0b0;
  margin-bottom: 6px;
  margin-top: 16px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #3a3a5a;
  background: #12122a;
  color: #e0e0e0;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: #00f2ea;
}

.login-form input[readonly] {
  opacity: 0.7;
  cursor: default;
}

.btn-login {
  width: 100%;
  padding: 13px;
  margin-top: 24px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #ff0050, #ff3d7f);
  color: #fff;
  transition: all 0.2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 0, 80, 0.35);
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-back {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid #3a3a5a;
  background: transparent;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-back:hover {
  color: #e0e0e0;
}

.login-error {
  text-align: center;
  color: #ff0050;
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

.login-hint {
  text-align: center;
  color: #555;
  font-size: 12px;
  margin-top: 24px;
  line-height: 1.6;
}

/* ==================== 商城头部 ==================== */

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 16px;
  padding: 20px 28px;
  margin-bottom: 24px;
}

.shop-header-left h1 {
  font-size: 22px;
  background: linear-gradient(135deg, #ff0050, #00f2ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shop-header-left span {
  color: #888;
  font-size: 14px;
}

.shop-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shop-points-badge {
  background: linear-gradient(135deg, #ff0050, #ff3d7f);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
}

.btn-logout {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #3a3a5a;
  background: transparent;
  color: #888;
  font-size: 13px;
  cursor: pointer;
}

.btn-logout:hover {
  color: #ff0050;
  border-color: #ff0050;
}

/* ==================== 商城主体 ==================== */

.shop-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.shop-section {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 16px;
  padding: 24px;
}

.shop-section h3 {
  color: #00f2ea;
  font-size: 16px;
  margin-bottom: 16px;
}

/* ==================== 奖励物品网格 ==================== */

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.reward-card {
  background: #12122a;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.reward-card:hover {
  border-color: #00f2ea;
  transform: translateY(-2px);
}

.reward-emoji {
  font-size: 48px;
  margin-bottom: 12px;
  line-height: 1;
}

.reward-image-wrap {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0a1e;
}

.reward-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.reward-name {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  margin-bottom: 6px;
}

.reward-desc {
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
  line-height: 1.5;
  min-height: 36px;
}

.reward-cost {
  font-size: 14px;
  color: #ffd700;
  font-weight: 600;
  margin-bottom: 6px;
}

.reward-stock {
  font-size: 12px;
  color: #555;
  margin-bottom: 14px;
}

.reward-stock.limited {
  color: #ff0050;
}

.btn-redeem {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-redeem:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-redeem:disabled {
  background: #3a3a5a;
  color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==================== 兑换记录表格 ==================== */

.redemption-table-wrap {
  max-height: 400px;
  overflow-y: auto;
}

.redemption-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.redemption-table th {
  color: #00f2ea;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #2a2a4a;
  position: sticky;
  top: 0;
  background: #1a1a2e;
}

.redemption-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a3a;
  color: #c0c0d0;
}

.redemption-table tbody tr:hover {
  background: #1a1a36;
}

.redemption-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.redemption-status.completed {
  background: rgba(0, 242, 234, 0.12);
  color: #00f2ea;
}

/* ==================== Toast ==================== */

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: #00b894;
  color: #fff;
}

.toast.error {
  background: #ff0050;
  color: #fff;
}

.toast.info {
  background: #0984e3;
  color: #fff;
}

/* ==================== Empty ==================== */

.empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 14px;
}

/* ==================== 自行调整积分 ==================== */

.self-adjust-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.self-adjust-form input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #3a3a5a;
  background: #12122a;
  color: #e0e0e0;
  font-size: 14px;
  outline: none;
}

.self-adjust-form input:focus {
  border-color: #ffd700;
}

.self-adjust-form .btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .user-container {
    padding: 16px;
  }

  .login-card {
    padding: 28px 20px;
  }

  .shop-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .reward-grid {
    grid-template-columns: 1fr;
  }

  .redemption-table th,
  .redemption-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}
