/* ============================================================
   Profile Page — personal dashboard
   ============================================================ */

.profile-main {
  max-width: 900px;
  margin: 24px auto 60px;
  padding: 0 20px;
}

.profile-card {
  background: #fff;
  border: 1px solid #e8d5b7;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0e6d6;
}

.profile-card-header h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: #8b0000;
  letter-spacing: 1px;
  margin: 0;
}

.profile-hint {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

/* ---- Tabs (login / register) ---- */
.profile-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid #f0e6d6;
}

.profile-tab {
  padding: 10px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 500;
  color: #6b4c3b;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.profile-tab.active {
  color: #8b0000;
  border-bottom-color: #8b0000;
  font-weight: 700;
}

.tab-panel {
  display: none;
  padding: 8px 4px 4px;
}
.tab-panel.active {
  display: block;
}

.tab-panel h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  color: #1a1a2e;
  margin: 0 0 16px;
  letter-spacing: 1px;
}

.profile-tip {
  font-size: 13px;
  color: #6b4c3b;
  margin-top: 14px;
  text-align: center;
}
.profile-tip a {
  color: #8b0000;
  text-decoration: underline;
}

/* ---- Auth card spacing ---- */
.auth-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 36px !important;
}
.auth-card h3 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 8px;
}
.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  margin: 0 0 20px;
}
.auth-card .pm-field {
  margin-bottom: 22px;
}
.auth-card .pm-field label {
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
  color: #2d1b0e;
  font-size: 14px;
}
.auth-card .pm-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e8d5b7;
  border-radius: 8px;
  font-size: 15px;
  background: #fdf6ec;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.auth-card .pm-field input:focus {
  border-color: #d4a017;
  outline: none;
  background: #fff;
}
/* 密码复杂度提示 */
.pm-field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #8b6b52;
  line-height: 1.5;
}

/* 实时密码强度检查列表 */
.pw-checklist {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 10px 12px;
  background: #fdf6ec;
  border: 1px solid #e8d5b7;
  border-radius: 8px;
}
.pw-checklist li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #8b6b52;
  line-height: 1.7;
  transition: color 0.2s;
}
.pw-checklist li .pw-icon {
  display: inline-block;
  width: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  transition: color 0.2s, transform 0.2s;
}
.pw-checklist li.ok {
  color: #2d8a3e;
}
.pw-checklist li.ok .pw-icon {
  color: #2d8a3e;
  transform: scale(1.1);
}

/* 错误提示加强 — 红框 + 抖动一次让用户注意到 */
.pm-error {
  color: #c41e3a !important;
}
.pm-error.pm-error-active {
  animation: pm-shake 0.4s ease;
  background: rgba(196, 30, 58, 0.08);
  border: 1px solid rgba(196, 30, 58, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}
@keyframes pm-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.auth-card .pm-btn-primary {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  font-size: 16px;
}

/* ---- Field grid ---- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.profile-field {
  display: flex;
  flex-direction: column;
}

.profile-field label {
  font-size: 13px;
  color: #6b4c3b;
  font-weight: 500;
  margin-bottom: 6px;
}

.profile-field input,
.profile-field select {
  padding: 10px 12px;
  border: 1px solid #e8d5b7;
  border-radius: 6px;
  font-size: 14px;
  background: #fffaf0;
  font-family: inherit;
  color: #2d1b0e;
}

.profile-field input:focus,
.profile-field select:focus {
  outline: none;
  border-color: #d4a017;
  background: #fff;
}

.profile-field-val {
  padding: 10px 12px;
  border: 1px solid #f0e6d6;
  border-radius: 6px;
  font-size: 14px;
  background: #faf5eb;
  color: #2d1b0e;
  min-height: 20px;
}

.profile-card-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

.profile-btn-secondary {
  padding: 9px 20px;
  background: #faf5eb;
  color: #6b4c3b;
  border: 1px solid #e8d5b7;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.profile-btn-secondary:hover {
  background: #f5ecd9;
}

/* ---- Query history list ---- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fbf6ea;
  border: 1px solid #e8d5b7;
  border-radius: 10px;
  transition: all 0.15s;
  cursor: pointer;
}
.history-item:hover {
  background: #fff8e0;
  border-color: #d4a017;
  transform: translateX(3px);
}

.history-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4a017, #b8860b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-family: 'Noto Serif SC', serif;
}

.history-body {
  flex: 1;
  min-width: 0;
}

.history-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 3px;
}

.history-subtitle {
  font-size: 12px;
  color: #6b4c3b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  text-align: right;
  flex-shrink: 0;
}

.history-amount {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: #c41e3a;
}

.history-date {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.history-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}
.history-status.paid { background: #d1fae5; color: #065f46; }
.history-status.pending { background: #fef3c7; color: #92400e; }
.history-status.failed, .history-status.expired, .history-status.cancelled {
  background: #fee2e2; color: #991b1b;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .profile-main { padding: 0 12px; margin: 16px auto 40px; }
  .profile-card { padding: 18px 16px; }
  .profile-grid { grid-template-columns: 1fr; gap: 14px; }
  .profile-card-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .profile-card-footer { flex-direction: column; }
  .profile-card-footer button { width: 100%; }
  .history-item { flex-wrap: wrap; padding: 12px; }
  .history-meta { flex-basis: 100%; text-align: left; margin-top: 6px; }
}
