/* 密室人格测试 - 微信风格高级简约设计 */
:root {
  --bg-color: #EDEDED;
  --primary-color: #07C160;
  --primary-dark: #05964F;
  --text-primary: #191919;
  --text-secondary: #888888;
  --text-tertiary: #C7C7C7;
  --card-bg: #FFFFFF;
  --danger-color: #FA5151;
  --warning-color: #FF9500;
  --success-color: #07C160;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  position: relative;
}

/* 页面切换 */
.page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  transform: translateX(20px);
}

.page.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* ========== 启动页 ========== */
#start-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.start-content {
  text-align: center;
  padding: 40px 20px;
}

/* 密室门插画 */
.door-illustration {
  margin-bottom: 60px;
  position: relative;
}

.door {
  width: 120px;
  height: 200px;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  border-radius: 8px 8px 0 0;
  margin: 0 auto;
  position: relative;
  box-shadow: 
    inset -4px 0 8px rgba(0,0,0,0.3),
    0 10px 40px rgba(0,0,0,0.5);
}

.door::before {
  content: '';
  position: absolute;
  top: 20px;
  right: 15px;
  width: 12px;
  height: 12px;
  background: #FA5151;
  border-radius: 50%;
  box-shadow: 0 0 10px #FA5151;
}

.door::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 15px;
  width: 10px;
  height: 40px;
  background: linear-gradient(90deg, #c9a227 0%, #e6c84a 50%, #c9a227 100%);
  border-radius: 2px;
  transform: translateY(-50%);
}

.door-handle {
  display: none;
}

.door-frame {
  position: absolute;
  top: -10px;
  left: -15px;
  right: -15px;
  bottom: -10px;
  border: 4px solid #c9a227;
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}

.slogan {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.subtitle {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 48px;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 16px 48px;
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.3);
}

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

/* ========== 模式选择页 ========== */
#mode-page {
  background: var(--bg-color);
  padding: 40px 20px;
}

.mode-content h2 {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mode-card {
  background: var(--card-bg);
  border: none;
  padding: 24px;
  border-radius: var(--border-radius);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mode-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mode-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.mode-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.mode-desc {
  font-size: 13px;
  color: var(--text-tertiary);
}

.mode-fast { border-left: 4px solid var(--primary-color); }
.mode-standard { border-left: 4px solid #FF9500; }
.mode-pro { border-left: 4px solid #FA5151; }

/* ========== 答题页 ========== */
#quiz-page {
  background: var(--bg-color);
  padding: 20px;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 32px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  animation: slideUp 0.3s ease;
}

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

.question-dimension {
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 32px;
  color: var(--text-primary);
}

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

.option-btn {
  background: var(--bg-color);
  border: 2px solid transparent;
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.option-btn:hover {
  border-color: var(--primary-color);
  background: rgba(7, 193, 96, 0.05);
}

.option-btn:active {
  border-color: var(--primary-color);
  background: rgba(7, 193, 96, 0.1);
}

/* 李克特风格圆点 */
.likert-options {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.likert-options .option-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  font-size: 24px;
}

.likert-options .option-btn span {
  font-size: 12px;
  display: block;
  margin-top: 8px;
  font-weight: normal;
}

/* ========== 结果页 ========== */
#result-page {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  padding: 24px;
}

.result-content {
  max-width: 400px;
  margin: 0 auto;
}

/* 加载动画 */
.loading {
  text-align: center;
  padding-top: 100px;
}

.loading-text {
  color: #fff;
  font-size: 18px;
  margin-bottom: 24px;
}

.loading-bar {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: var(--primary-color);
  animation: loadingMove 1.5s ease-in-out infinite;
}

@keyframes loadingMove {
  0% { width: 0; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0; margin-left: 100%; }
}

/* 结果卡片 */
.result-card {
  animation: fadeIn 0.5s ease;
}

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

.result-header {
  text-align: center;
  margin-bottom: 24px;
}

.dimension-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 700;
  font-family: 'SF Mono', 'Monaco', monospace;
  letter-spacing: 2px;
}

.character-image {
  text-align: center;
  margin-bottom: 24px;
}

.character-icon {
  font-size: 80px;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
}

.character-info {
  text-align: center;
  margin-bottom: 32px;
}

.character-name {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.character-fullname {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 16px;
  font-family: 'SF Mono', 'Monaco', monospace;
}

.character-quote {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  font-style: italic;
  padding: 16px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--border-radius);
}

/* 五维图 */
.dimension-chart {
  background: rgba(255,255,255,0.08);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.chart-title {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.chart-canvas {
  width: 100%;
  height: 200px;
}

/* 详细维度 */
.result-details {
  margin-bottom: 32px;
}

.detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.detail-label {
  width: 80px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.detail-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 12px;
}

.detail-value {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.detail-score {
  width: 36px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  text-align: right;
}

/* 分享区域 */
.share-section {
  text-align: center;
}

.share-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  margin-bottom: 20px;
}

.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-share {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.3);
}

.btn-share:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

/* ==================== 简洁高级分享卡片 ==================== */
.share-card-preview {
  position: fixed;
  top: -9999px;
  left: -9999px;
  visibility: hidden;
}

.share-card-inner {
  width: 320px;
  padding: 32px 24px;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.share-badge {
  display: inline-block;
  background: rgba(7, 193, 96, 0.2);
  color: #07C160;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'SF Mono', 'Monaco', monospace;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.share-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.share-name {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.share-quote {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  margin-bottom: 24px;
  line-height: 1.5;
}

.share-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* 移动端适配 */
@media (max-width: 375px) {
  .slogan { font-size: 22px; }
  .question-text { font-size: 16px; }
  .character-name { font-size: 24px; }
  .character-icon { font-size: 60px; }
}

/* 暗色模式适配 (自动) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #636366;
  }
}