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

:root {
  --ink: #1a1a2e;
  --ink-soft: #4a4a5e;
  --muted: #8e8ea0;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.14);
  --accent: #1a7a5c;
  
  --accent-hover: #0f6650;
  --accent-faint: rgba(26, 122, 92, 0.08);
  --accent-light: rgba(26, 122, 92, 0.04);
  --accent-warm: #b8954a;
  --warn: #d97706;
  --bg-subtle: #f4f5f7;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.04), 0 16px 48px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-xl: 14px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --dim-e: #d4785c;
  --dim-i: #5c7dd4;
  --dim-s: #b88a5c;
  --dim-n: #8b6cb8;
  --dim-t: #5c9eb8;
  --dim-f: #c96b8b;
  --dim-j: #4a8a6a;
  --dim-p: #c9a84a;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes load-dots {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

body {
  font-family: var(--font-sans);
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(150deg, #f7f8fa 0%, #eef0f3 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---- 全屏背景动画 ---- */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-animation canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.app {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(24px, 4vw, 48px) 20px;
  position: relative;
  z-index: 2;
}

.container {
  width: 100%;
  max-width: 520px;
}

.card {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 40px) clamp(22px, 4vw, 36px);
  animation: enter 0.35s ease-out;
  position: relative;
}

/* ---- 开始页 ---- */
.start-card { text-align: left; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  flex-shrink: 0;
  background: var(--accent);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(47, 93, 80, 0.15);
}

.logo-mark span {
  border-radius: 1px;
}

.logo-mark .q1 { background: var(--dim-e); }
.logo-mark .q2 { background: var(--dim-n); }
.logo-mark .q3 { background: var(--dim-f); }
.logo-mark .q4 { background: var(--dim-j); }

.brand-row {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.start-card h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.start-card .subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 6px 0 0;
  max-width: 36em;
}

.version-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.version-btn {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: left;
  font-family: inherit;
}

.version-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.version-btn.active {
  border-color: var(--accent);
  background: var(--accent-faint);
}

.version-btn.active .version-name {
  color: var(--accent);
}

.version-btn.active .version-badge {
  color: var(--accent-warm);
  border-color: var(--accent-warm);
}

.version-num {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 14px;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.version-btn.active .version-num {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.version-info { flex: 1; min-width: 0; }

.version-name {
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 3px;
}

.version-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.version-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  margin-left: 8px;
  transition: border-color 0.2s, color 0.2s;
}

.start-btn {
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.start-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.start-btn:active { transform: scale(0.98); }
.start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.error-msg {
  color: var(--warn);
  font-size: 0.82rem;
  margin-top: 12px;
  min-height: 1.4em;
}

.footer-note {
  margin-top: 18px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---- 测试页 ---- */
.quiz-card { display: none; }

.progress-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.progress-percent {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  border-radius: 3px;
  transform-origin: left;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-badge {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-subtle);
  border-radius: 20px;
}

.question-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 26px;
  font-weight: 500;
  color: var(--ink);
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  line-height: 1.55;
  gap: 14px;
  font-family: inherit;
}

.option-btn:active {
  transform: scale(0.99);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--ink-soft);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 122, 92, 0.08);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-faint);
  border-width: 1.5px;
}

.option-btn.selected .option-letter {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-btns {
  display: flex;
  gap: 10px;
}

.nav-btn {
  flex: 1;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.nav-btn:hover {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: scale(0.98);
}

.nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.nav-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ---- 加载 ---- */
.loading-card {
  display: none;
  text-align: center;
  padding: 52px 32px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: load-dots 1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

.loading-text {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* ---- 结果 ---- */
.result-card {
  display: none;
  text-align: left;
}

.result-head {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.result-overline {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 12px;
}

.result-type {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.12em;
  line-height: 1.1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--ink) 30%, var(--accent) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-name {
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.dims-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.dim-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
}

.dim-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
}

.dim-card[data-dim="EI"]::before { background: linear-gradient(90deg, var(--dim-e), var(--dim-i)); }
.dim-card[data-dim="SN"]::before { background: linear-gradient(90deg, var(--dim-s), var(--dim-n)); }
.dim-card[data-dim="TF"]::before { background: linear-gradient(90deg, var(--dim-t), var(--dim-f)); }
.dim-card[data-dim="JP"]::before { background: linear-gradient(90deg, var(--dim-j), var(--dim-p)); }

.dim-card .dim-pair {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.dim-card .dim-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.dim-card .dim-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.action-row { display: flex; gap: 10px; }

.restart-btn {
  flex: 1;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.restart-btn:hover {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.restart-btn:active { transform: scale(0.98); }

/* ---- AI 深度解析 ---- */
.ai-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.ai-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ai-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-faint);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 122, 92, 0.08);
}

.ai-btn:active {
  transform: scale(0.98);
}

.ai-btn.loading {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
  transform: none;
}

.ai-btn .ai-sparkle {
  font-size: 1.05rem;
  transition: transform 0.4s ease;
}

.ai-btn:hover .ai-sparkle {
  transform: rotate(180deg) scale(1.15);
}

/* ============ MBTI 角色头像 ============ */
.mbti-character {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px auto 20px;
  width: 100%;
  max-width: 200px;
}
.mbti-character .mbti-character-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.1));
  animation: charEnter 0.6s ease-out;
}

@keyframes charEnter {
  0% { opacity: 0; transform: scale(0.7) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.ai-result {
  display: none;
  margin-top: 14px;
  padding: 20px 22px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  animation: enter 0.3s ease-out;
}

.ai-result.visible {
  display: block;
}

.ai-result .ai-error {
  color: var(--warn);
}

.ai-result h2,
.ai-result h3,
.ai-result h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  margin: 1.2em 0 0.4em;
  line-height: 1.3;
}

.ai-result h2 { font-size: 1rem; }
.ai-result h3 { font-size: 0.95rem; }
.ai-result h4 { font-size: 0.92rem; }

.ai-result h2:first-child,
.ai-result h3:first-child,
.ai-result h4:first-child {
  margin-top: 0;
}

.ai-result strong {
  font-weight: 600;
  color: var(--accent);
}

.ai-result ul {
  margin: 0.4em 0 0.8em;
  padding-left: 1.2em;
  list-style: none;
}

.ai-result ul li {
  position: relative;
  padding-left: 0.6em;
  margin-bottom: 0.25em;
}

.ai-result ul li::before {
  content: '•';
  position: absolute;
  left: -0.2em;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 480px) {
  .dims-grid { grid-template-columns: 1fr; }
  .chat-panel { right: 12px; left: 12px; width: auto; bottom: 140px; max-height: 55vh; }
  .chat-btn { bottom: 16px; right: 16px; width: 100px; height: 100px; }
}

/* ---- 底部 ---- */
.app-footer {
  text-align: center;
  padding: 20px 20px 32px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
}
/* ---- AI 聊天助手 ---- */
.chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.chat-btn:focus-visible { outline: none; }
.chat-btn dotlottie-wc { width: 100%; height: 100%; pointer-events: none; }

/* Chat Panel */
.chat-panel {
  position: fixed;
  bottom: 156px; right: 24px;
  width: 350px; height: 60vh; max-height: 540px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: none;
  flex-direction: column;
  animation: enter 0.25s ease-out;
  overflow: hidden;
}
.chat-panel.open { display: flex; }

/* Header */
.chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  flex-direction: column;
}
.chat-header-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}
.chat-header-status {
  font-size: 0.65rem;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-header-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.chat-close {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.15); color: #fff; cursor: pointer;
  font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.chat-close:hover { background: rgba(255,255,255,0.25); }

/* Messages */
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 16px 14px 10px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-subtle);
}
.chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: msgIn 0.25s ease-out;
}
.chat-msg-row.user { flex-direction: row-reverse; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chat-msg-avatar.bot { background: var(--accent-faint); }
.chat-msg-avatar.user { background: #e8eef5; }

.chat-msg {
  max-width: 80%; padding: 10px 14px; border-radius: 14px;
  font-size: 0.85rem; line-height: 1.55;
  word-break: break-word;
  position: relative;
}
.chat-msg.user {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.chat-msg.bot h2, .chat-msg.bot h3, .chat-msg.bot h4 { margin: 4px 0 2px; font-size: 0.88rem; font-weight: 600; }
.chat-msg.bot ul { margin: 2px 0; padding-left: 18px; }
.chat-msg.bot li { margin: 1px 0; }
.chat-msg.bot strong { font-weight: 600; }
.chat-msg.bot br + br { display: none; }
.chat-msg.bot .typing { display: inline-flex; gap: 3px; }
.chat-msg.bot .typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: load-dots 1s ease-in-out infinite; }
.chat-msg.bot .typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg.bot .typing span:nth-child(3) { animation-delay: 0.3s; }

/* Input */
.chat-input-row {
  display: flex; gap: 8px; padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
  align-items: flex-end;
}
.chat-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 0.85rem; font-family: inherit; background: var(--bg-subtle); color: var(--ink);
  outline: none; transition: border-color 0.2s, background 0.2s;
  resize: none; line-height: 1.45; max-height: 100px;
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--accent); background: #fff; }
.chat-input::placeholder { color: var(--muted); }
.chat-send {
  width: 38px; height: 38px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.chat-send:hover { background: var(--accent-hover); transform: translateY(-1px); }
.chat-send:active { transform: scale(0.95); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.chat-send svg { width: 16px; height: 16px; }

/* ---- 登录页面 ---- */
.login-card { text-align: left; }

.auth-input-group { margin-bottom: 16px; }
.auth-input-group label {
  display: block; font-size: 0.8rem; font-weight: 500;
  margin-bottom: 6px; color: var(--ink-soft);
}

.auth-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
  outline: none; transition: border-color 0.2s; background: #fff; color: var(--ink);
}
.auth-input:focus { border-color: var(--accent); }

.auth-code-row { display: flex; gap: 10px; }
.auth-code-row .auth-input { flex: 1; }

.auth-code-btn {
  flex-shrink: 0; padding: 11px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent); background: #fff; color: var(--accent);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit;
  white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.auth-code-btn:hover { background: var(--accent-faint); }
.auth-code-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-submit-btn {
  width: 100%; padding: 13px; border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-top: 4px;
  transition: background 0.2s;
}
.auth-submit-btn:hover { background: var(--accent-hover); }
.auth-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-error { color: var(--warn); font-size: 0.82rem; margin-top: 10px; min-height: 1.4em; }

.save-prompt {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--accent-faint); border: 1px dashed var(--accent);
  border-radius: var(--radius-sm); font-size: 0.82rem;
  color: var(--accent); cursor: pointer; transition: background 0.2s;
}
.save-prompt:hover { background: var(--accent-light); }
.save-error {
  padding: 10px 14px; margin-bottom: 16px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm);
  font-size: 0.82rem; color: var(--warn);
}

/* ---- Landing 页（登录/注册） ---- */
body.landing-mode {
  background: #0c0c14;
}
body.landing-mode .app { padding: 28px 20px; }
body.landing-mode .bg-animation { display: block; }

.landing-card {
  background: rgba(26, 26, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.02) inset;
  padding: 36px 32px 32px;
  position: relative;
  text-align: center;
}

.landing-brand { margin-bottom: 22px; }
.landing-logo { margin-bottom: 12px; }
.landing-logo .logo-mark { width: 52px; height: 52px; margin: 0 auto; border-radius: 14px; }
.landing-title {
  font-size: clamp(1.3rem,4vw,1.6rem);
  font-weight: 700;
  color: #f0f0f4;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.landing-subtitle {
  color: rgba(255,255,255,0.42);
  font-size: 0.82rem;
  font-weight: 400;
}

.landing-features {
  display: flex; justify-content: center;
  gap: 6px; margin-bottom: 22px; flex-wrap: wrap;
}
.feature-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: rgba(255,255,255,0.45);
  padding: 3px 10px; background: rgba(255,255,255,0.05);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.04);
}
.feature-item .feature-icon { color: #34d399; font-size: 0.5rem; }

.landing-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; color: rgba(255,255,255,0.3);
  font-size: 0.7rem; letter-spacing: 0.06em;
}
.landing-divider::before,
.landing-divider::after {
  content: ''; flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ---- Auth tabs ---- */
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
}
.auth-tab {
  flex: 1; padding: 8px 12px;
  background: transparent; border: none; border-radius: 7px;
  color: rgba(255,255,255,0.4); font-size: 0.82rem;
  font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.auth-tab:hover { color: rgba(255,255,255,0.65); }
.auth-tab.active {
  background: rgba(255,255,255,0.1);
  color: #fff; font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.auth-panel { animation: landing-slide-up 0.28s ease-out; }
@keyframes landing-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-input-group {
  margin-bottom: 12px;
  position: relative;
  text-align: left;
}
.landing-input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: 10px; font-size: 0.9rem; font-family: inherit;
  color: #f0f0f4; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.landing-input::placeholder { color: rgba(255,255,255,0.25); }
.landing-input:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.landing-input:focus {
  border-color: #4ade80;
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(74,222,128,0.1), 0 0 24px rgba(74,222,128,0.04);
}

.landing-btn {
  width: 100%; padding: 12px 16px; border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a8a6a, #0e5e44);
  color: #fff;
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  font-family: inherit; letter-spacing: 0.02em;
  transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.landing-btn:hover {
  background: linear-gradient(135deg, #1e9c78, #106a4e);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(26,138,106,0.3);
}
.landing-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(26,138,106,0.2);
}
.landing-btn:disabled {
  opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none;
}

.landing-code-row { display: flex; gap: 10px; }
.landing-code-row .landing-input { flex: 1; }
.landing-code-input { letter-spacing: 0.3em; font-weight: 600; font-size: 1.05rem; }

.landing-code-btn {
  flex-shrink: 0; padding: 11px 16px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.landing-code-btn:hover {
  border-color: #4ade80;
  color: #4ade80;
  background: rgba(74,222,128,0.06);
}
.landing-code-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.landing-error {
  color: #f87171; font-size: 0.78rem; margin-top: 8px; min-height: 1.3em;
  display: flex; align-items: center; gap: 4px; justify-content: center;
}
.landing-error::before {
  content: '⚠';
  font-size: 0.75rem;
  opacity: 0.7;
}

.auth-links {
  display: flex; justify-content: center;
  gap: 16px;
  margin-top: 14px; font-size: 0.78rem;
}
.auth-links a {
  color: rgba(74,222,128,0.75);
  text-decoration: none; cursor: pointer;
  transition: color 0.2s;
}
.auth-links a:hover { color: #4ade80; }

@media (max-width: 480px) {
  .landing-card { padding: 26px 16px; border-radius: 14px; }
  .landing-features { flex-direction: column; align-items: center; }
  .landing-btn { padding: 11px 14px; }
}

/* ---- CAPTCHA ---- */
.captcha-wrap { margin-bottom: 12px; }
.captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.captcha-img {
  width: 130px;
  height: 46px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.captcha-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #f0f0f4;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  font-weight: 600;
}
.captcha-input::placeholder {
  color: rgba(255,255,255,0.25);
  font-weight: 400;
}
.captcha-input:focus { border-color: var(--accent); }
.captcha-refresh {
  flex-shrink: 0;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.captcha-refresh:hover {
  border-color: var(--accent);
  color: #4ade80;
}
.captcha-hint {
  color: rgba(255,255,255,0.3);
  font-size: 0.72rem;
  margin-top: 4px;
}
.captcha-err {
  color: #f87171;
  font-size: 0.72rem;
  margin-top: 4px;
  min-height: 1.2em;
}

/* ---- 顶部导航 ---- */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e4e7ec;
  display: none;
  font-family: inherit;
}
.top-nav-inner {
  width: 100%;
  display: flex; align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 clamp(20px, 4vw, 40px);
}
.top-nav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.top-nav-logo {
  display: flex; align-items: center; justify-content: center;
}
.top-nav-logo svg { display: block; }
.top-nav-title {
  font-weight: 700; font-size: 1rem; color: #1e1e2a;
}
.top-nav-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.top-nav-email {
  font-size: 0.85rem; color: #555; margin-right: 12px;
}
.top-nav-link {
  background: none; border: none;
  color: #666; font-size: 0.82rem; cursor: pointer;
  font-family: inherit; padding: 6px 10px;
  transition: color 0.15s;
}
.top-nav-link:hover { color: var(--accent); }
.top-nav-logout {
  background: none; border: 1px solid #dde0e5;
  border-radius: 6px; color: #666; font-size: 0.82rem;
  cursor: pointer; font-family: inherit; padding: 5px 12px;
  margin-left: 6px; transition: border-color 0.15s, color 0.15s;
}
.top-nav-logout:hover { border-color: #c0392b; color: #c0392b; }

/* ---- Footer ---- */
.site-footer {
  text-align: center; padding: 16px 20px 24px;
  font-size: 0.7rem; color: #a0a0a8;
  pointer-events: none;
}

/* ---- 账户设置 ---- */
.settings-section { padding: 8px 0; }
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.settings-header h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.settings-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: inherit;
  line-height: 1;
}
.settings-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--bg-subtle);
}
.settings-field { margin-bottom: 16px; }
.settings-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.settings-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-input {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-input::placeholder { color: var(--muted); }
.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}
.settings-input[readonly] {
  background: var(--bg-subtle);
  opacity: 0.7;
}
.settings-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s;
}
.settings-btn:hover { background: var(--accent-hover); }
.settings-btn:disabled { opacity: 0.5; cursor: default; }
/* ---- 密码显示/隐藏 ---- */
.pw-wrap {
  position: relative;
  margin-bottom: 8px;
}
.pw-wrap .settings-input {
  padding-right: 38px;
  margin-bottom: 0;
}
.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.pw-toggle:hover { color: var(--ink-soft); background: var(--bg-subtle); }
.pw-toggle svg {
  width: 18px;
  height: 18px;
}
/* 暗色主题（登录/注册页） */
.landing-input-group .pw-wrap { margin-bottom: 0; }
.pw-wrap--dark .pw-toggle {
  color: rgba(255,255,255,0.3);
  width: 32px;
  height: 32px;
  right: 6px;
  border-radius: 7px;
}
.pw-wrap--dark .pw-toggle:hover {
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.07);
}
.settings-hint {
  font-size: 0.72rem;
  color: var(--muted);
  min-height: 1.3em;
  margin-top: 4px;
}
.settings-divider {
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
#settingsPwHint { color: var(--accent); }

/* ============ SEO 隐藏内容（对爬虫可见，对用户不可见） ============ */
.mbti-seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

