/* ==================== 《他人意志人格报告》样式 ==================== */
:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a28;
  --surface: #1e1e2e;
  --surface2: #262640;
  --border: #2a2a45;
  --text: #e8e8f0;
  --text2: #a0a0b8;
  --text3: #6a6a88;
  --accent: #7c6aef;
  --accent2: #a78bfa;
  --accent3: #c4b5fd;
  --accent-bg: rgba(124, 106, 239, 0.1);
  --warm: #f59e0b;
  --warm2: #fbbf24;
  --cool: #38bdf8;
  --rose: #fb7185;
  --green: #34d399;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 背景粒子/氛围 */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124,106,239,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(56,189,248,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== 通用组件 ==================== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .container { max-width: 560px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font);
  letter-spacing: 0.02em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,106,239,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124,106,239,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--accent2); }

.btn-block { width: 100%; }

.btn-sm { padding: 10px 18px; font-size: 0.875rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent {
  background: var(--accent-bg);
  color: var(--accent2);
  border: 1px solid rgba(124,106,239,0.2);
}

.badge-warm {
  background: rgba(245,158,11,0.1);
  color: var(--warm2);
  border: 1px solid rgba(245,158,11,0.2);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(124,106,239,0.3);
  box-shadow: 0 4px 20px rgba(124,106,239,0.08);
}

.text-accent { color: var(--accent2); }
.text-warm { color: var(--warm2); }
.text-cool { color: var(--cool); }
.text-rose { color: var(--rose); }
.text-green { color: var(--green); }
.text-muted { color: var(--text3); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ==================== 首页 ==================== */
.home-header {
  text-align: center;
  padding: 60px 0 40px;
}

.home-logo {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: grayscale(0.2);
}

.home-title {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.home-subtitle {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.7;
}

.home-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 36px 0;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  position: relative;
}

.flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 52px;
  bottom: -4px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent) 0%, transparent 100%);
  opacity: 0.3;
}

.flow-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid rgba(124,106,239,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent2);
}

.flow-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.flow-text p {
  font-size: 0.825rem;
  color: var(--text2);
}

/* 价格卡片 */
.pricing-cards {
  display: flex;
  gap: 12px;
  margin: 28px 0;
}

.pricing-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.pricing-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.pricing-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124,106,239,0.08), rgba(139,92,246,0.04));
  box-shadow: 0 0 20px rgba(124,106,239,0.15);
}

.pricing-card.recommended::before {
  content: '推荐';
  position: absolute;
  top: 10px;
  right: -20px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 24px;
  transform: rotate(45deg);
}

.pricing-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent2);
  margin: 8px 0 4px;
}
.pricing-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text3);
}

.pricing-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pricing-features {
  list-style: none;
  font-size: 0.75rem;
  color: var(--text2);
  text-align: left;
  padding: 0;
}

.pricing-features li {
  padding: 3px 0;
}
.pricing-features li::before {
  content: '✓ ';
  color: var(--green);
}

/* ==================== 答题页 ==================== */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}

.quiz-header h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
}

.quiz-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
}
.quiz-close:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

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

.part-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px 14px;
  background: var(--accent-bg);
  border: 1px solid rgba(124,106,239,0.15);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent2);
}

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 24px;
  min-height: 60px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  font-family: var(--font);
  font-size: 0.925rem;
  color: var(--text);
  line-height: 1.4;
}

.option-btn:hover {
  border-color: rgba(124,106,239,0.4);
  background: rgba(124,106,239,0.06);
}

.option-btn.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124,106,239,0.12), rgba(139,92,246,0.06));
  box-shadow: 0 0 16px rgba(124,106,239,0.1);
}

.option-key {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text3);
  transition: all var(--transition);
}

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

.option-btn:hover .option-key {
  border-color: var(--accent);
  color: var(--accent2);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-bottom: 40px;
}

.quiz-counter {
  font-size: 0.8rem;
  color: var(--text3);
}

/* ==================== 报告页 ==================== */
.report-hero {
  text-align: center;
  padding: 48px 0 32px;
}

.report-category {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.cat-O { background: rgba(56,189,248,0.1); color: var(--cool); border: 1px solid rgba(56,189,248,0.2); }
.cat-B { background: rgba(251,113,133,0.1); color: var(--rose); border: 1px solid rgba(251,113,133,0.2); }
.cat-D { background: rgba(245,158,11,0.1); color: var(--warm2); border: 1px solid rgba(245,158,11,0.2); }
.cat-G { background: rgba(52,211,153,0.1); color: var(--green); border: 1px solid rgba(52,211,153,0.2); }
.cat-A { background: rgba(124,106,239,0.1); color: var(--accent2); border: 1px solid rgba(124,106,239,0.2); }
.cat-H { background: rgba(168,162,255,0.1); color: #a8a2ff; border: 1px solid rgba(168,162,255,0.2); }

.report-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.report-tagline {
  font-size: 1.05rem;
  color: var(--text2);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 8px;
}

.report-id {
  font-size: 0.75rem;
  color: var(--text3);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
}

.report-section {
  margin: 24px 0;
}

.report-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.report-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.report-metaphor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent-bg), rgba(139,92,246,0.04));
  border: 1px solid rgba(124,106,239,0.15);
  border-radius: var(--radius);
}

.metaphor-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.metaphor-text {
  font-size: 0.95rem;
  color: var(--accent3);
  font-weight: 500;
}

.report-advice {
  padding: 16px 20px;
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.15);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--green);
  line-height: 1.6;
}

.report-advice::before {
  content: '💡 ';
}

.trait-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.trait-tag {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
}

.score-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

.score-label {
  width: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text3);
}

.score-track {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 6px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-fill-a { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.score-fill-b { background: linear-gradient(90deg, var(--cool), #60a5fa); }
.score-fill-c { background: linear-gradient(90deg, var(--warm), var(--warm2)); }
.score-fill-d { background: linear-gradient(90deg, var(--rose), #f9a8d4); }

.score-num {
  width: 28px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
}

.share-actions {
  display: flex;
  gap: 10px;
  margin: 32px 0;
}

.share-actions .btn { flex: 1; }

/* ==================== 我的报告页 ==================== */
.my-reports-header {
  padding: 40px 0 24px;
}

.my-reports-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.my-reports-header p {
  font-size: 0.85rem;
  color: var(--text2);
}

.report-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
}

.report-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.report-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.report-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.report-item-info {
  flex: 1;
  min-width: 0;
}
.report-item-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.report-item-info p {
  font-size: 0.8rem;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-item-arrow {
  color: var(--text3);
  font-size: 1.1rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 24px;
}

/* ==================== 链接生成页 ==================== */
.link-generated {
  text-align: center;
  padding: 48px 0;
}

.link-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.link-generated h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.link-generated p {
  font-size: 0.9rem;
  color: var(--text2);
  margin-bottom: 24px;
}

.link-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  word-break: break-all;
  font-size: 0.85rem;
  color: var(--accent2);
  font-family: 'Courier New', monospace;
}

.link-box-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.link-box-row input {
  flex: 1;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent2);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  outline: none;
}
.link-box-row input:focus {
  border-color: var(--accent);
}

/* ==================== 加载动画 ==================== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 40px 20px;
}

.loading-dots {
  display: flex;
  gap: 8px;
  margin: 24px 0;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ==================== 过渡动画 ==================== */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

.slide-in {
  animation: slideIn 0.4s ease forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==================== toast ==================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ==================== 响应式 ==================== */
@media (max-width: 400px) {
  .pricing-cards { flex-direction: column; }
  .pricing-card.recommended::before { display: none; }
  .report-name { font-size: 1.6rem; }
  .question-text { font-size: 1.05rem; }
}

/* ==================== 打字效果 ==================== */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  animation: typing 2s steps(20, end), blink 0.8s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent); }
}

/* ==================== 自定义滚动条 ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }
