/* 妈妈情绪急救工具箱 - 高级重设计 v3 */
:root {
  --primary-color: #B5394F;
  --primary-light: #D4697E;
  --primary-dark: #892B3C;
  --secondary-color: #B5394F;
  --bg-color: #F5F0ED;
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-solid: #FFFFFF;
  --text-primary: #111111;
  --text-secondary: #5C5C5C;
  --text-tertiary: #A8A8A8;
  --border-color: rgba(0, 0, 0, 0.06);
  --border-light: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14);
  --shadow-primary: 0 6px 24px rgba(181, 57, 79, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --accent-color: #B5394F;
  --accent-hover: #892B3C;
  --bg-secondary: rgba(255, 255, 255, 0.90);
  --bg-tertiary: rgba(0, 0, 0, 0.04);
  --input-bg: rgba(0, 0, 0, 0.04);
  --input-border: rgba(0, 0, 0, 0.10);
  --user-message-bg: linear-gradient(135deg, #B5394F, #D4697E);
  --assistant-message-bg: rgba(0, 0, 0, 0.04);
  --transition-speed: 0.22s;
  --transition-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-height: 72px;  /* bottom tab bar */
  --blur-sm: blur(12px);
  --blur: blur(20px);
  --blur-lg: blur(32px);
}

* {
  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: #F5F0ED;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.2px;
  font-feature-settings: 'kern' 1;
  overflow-x: hidden;
}

/* Premium serif for key headings */
.inspiration-title,
.scene-title,
.services-title,
.user-center-title,
.coming-title {
  font-family: 'Noto Serif SC', 'PingFang SC', 'Hiragino Mincho ProN', serif;
}

/* ========== 语言切换按钮 ========== */
.language-toggle-bottom {
  display: none; /* 已移至用户中心 */
}

.lang-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.2s ease;
  outline: none;
}

.lang-btn:hover {
  color: var(--primary-color);
  background: var(--bg-tertiary);
}

.lang-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(200, 75, 110, 0.2);
}

/* ========== 底部导航栏 (iOS 风格) ========== */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(250, 248, 246, 0.95);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 900;
  height: var(--nav-height);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
}

.nav-container {
  max-width: 640px;
  margin: 0 auto;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.nav-tabs {
  display: flex;
  height: 100%;
  justify-content: space-around;
  align-items: stretch;
  width: 100%;
  gap: 0;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.18s var(--transition-spring);
  position: relative;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}

.nav-tab:active {
  opacity: 0.6;
}

.nav-tab .tab-icon {
  font-size: 22px;
  color: var(--text-tertiary);
  transition: all 0.18s ease;
  line-height: 1;
}

.nav-tab .tab-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  transition: all 0.18s ease;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.nav-tab.active .tab-icon {
  color: var(--primary-color);
  transform: translateY(-1px);
}

.nav-tab.active .tab-label {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

/* ========== 主内容区 ========== */
.main-content {
  padding-top: 0;
  min-height: 100vh;
}

.main-content.with-nav {
  padding-top: var(--nav-height);
}

.tab-content {
  display: none;
  min-height: 100vh;
  animation: tabFadeIn 0.32s var(--transition-spring);
}

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

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

/* ========== Coming Soon 页面 ========== */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 80px);
  padding: 60px 24px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.coming-icon {
  font-size: 72px;
  color: var(--primary-color);
  margin-bottom: 32px;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 75, 110, 0.08);
  border-radius: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.coming-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.coming-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  max-width: 400px;
}

.coming-hint {
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
  margin-top: 24px;
  padding: 8px 20px;
  background: rgba(200, 75, 110, 0.08);
  border-radius: 20px;
  display: inline-block;
}

.login-prompt-btn {
  margin-top: 24px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border: none;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-primary);
  letter-spacing: 0.2px;
}

.login-prompt-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(200, 75, 110, 0.40);
}

.login-prompt-btn:active {
  transform: translateY(0) scale(0.99);
}

/* ========== 用户中心样式 ========== */
.user-center-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
}

.user-center-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 640px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.8);
  animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-center-icon {
  font-size: 80px;
  color: var(--primary-color);
  margin-bottom: 28px;
  opacity: 0.9;
  width: 100px;
  height: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 75, 110, 0.08);
  border-radius: 50%;
}

.user-center-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.user-center-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.6;
}

.user-center-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.user-center-actions .btn-primary,
.user-center-actions .btn-secondary {
  flex: 1;
  max-width: 160px;
  padding: 14px 28px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.user-center-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: var(--shadow-primary);
}

.user-center-actions .btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(200, 75, 110, 0.40);
}

.user-center-actions .btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.user-center-actions .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

/* 已登录用户中心 */
.user-center-loggedin {
  display: flex;
  justify-content: center;
  padding: 60px 24px;
}

.user-info-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.8);
  animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-avatar-section {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 2px solid #f5f5f5;
  margin-bottom: 32px;
}

.user-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(200, 75, 110, 0.25);
}

.user-basic-info {
  flex: 1;
}

.user-display-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.user-username {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

.user-details-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.user-detail-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.025);
  border-radius: var(--radius);
  transition: all 0.22s ease;
  border: 1px solid rgba(0,0,0,0.05);
}

.user-detail-item:hover {
  background: rgba(200, 75, 110, 0.05);
  transform: translateX(4px);
  border-color: rgba(200, 75, 110, 0.15);
}

.user-detail-item i {
  font-size: 22px;
  color: var(--primary-color);
  width: 28px;
  text-align: center;
}

.user-detail-item > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-detail-item label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.user-detail-item span {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
}

/* 优惠券激活区域样式 */
.coupon-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
}

.coupon-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.coupon-header i {
  font-size: 22px;
}

.coupon-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.coupon-input-group input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.coupon-input-group input:focus {
  outline: none;
  border-color: white;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.coupon-input-group button {
  padding: 12px 24px;
  border-radius: 12px;
  background: white;
  color: #667eea;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.coupon-input-group button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.coupon-input-group button:active {
  transform: translateY(0);
}

.coupon-hint {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  text-align: center;
}

.user-actions-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-block {
  width: 100%;
  padding: 16px 28px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-secondary.btn-block {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary.btn-block:hover {
  background: rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

/* ========== 用户中心语言设置 (内联式) ========== */
.user-detail-item-inline {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  background: #fafafa;
  border-radius: 16px;
  margin-bottom: 20px;
}

.user-detail-item-inline i {
  font-size: 22px;
  color: var(--primary-color);
  width: 28px;
  text-align: center;
  margin-top: 4px;
  flex-shrink: 0;
}

.user-detail-item-inline > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-detail-item-inline label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.language-toggle-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-toggle-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.lang-toggle-btn:hover {
  border-color: var(--primary-color);
  background: rgba(200, 75, 110, 0.05);
  transform: translateY(-1px);
}

.lang-toggle-btn.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(200, 75, 110, 0.25);
}

.lang-toggle-btn span:first-child {
  font-size: 18px;
  line-height: 1;
}

.lang-toggle-btn span:last-child {
  font-size: 14px;
  font-weight: 600;
}

/* 已登录状态的语言设置 */
.user-detail-item .language-toggle-inline {
  margin-top: 4px;
}

.user-detail-item .lang-toggle-btn {
  flex: 1;
  min-width: 90px;
}

/* ========== 更多服务 - 心理测试 ========== */
.services-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.services-header {
  text-align: center;
  margin-bottom: 48px;
}

.services-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.8px;
}

.services-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 服务大类卡片 */
.service-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.service-category-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.28s ease;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.7);
  border: 1.5px solid transparent;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.service-category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.service-category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(200, 75, 110, 0.20);
  border-color: rgba(200, 75, 110, 0.4);
}

.service-category-card:hover::before {
  transform: scaleX(1);
}

.service-category-card.coming-soon-card {
  cursor: default;
  opacity: 0.6;
}

.service-category-card.coming-soon-card:hover {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-color: transparent;
}

.service-category-card.coming-soon-card::before {
  display: none;
}

.service-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(200, 75, 110, 0.10), rgba(200, 75, 110, 0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.28s ease;
}

.service-category-card:hover .service-card-icon {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  transform: rotate(5deg) scale(1.05);
  box-shadow: 0 6px 16px rgba(200, 75, 110, 0.35);
}

.service-card-icon i {
  font-size: 32px;
  color: var(--primary-color);
  transition: all 0.28s ease;
}

.service-category-card:hover .service-card-icon i {
  color: white;
}

.service-card-content {
  flex: 1;
}

.service-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.service-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.service-card-meta {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 500;
}

.service-card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.28s ease;
}

.service-category-card:hover .service-card-arrow {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(200, 75, 110, 0.3);
}

.service-card-arrow i {
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.service-category-card:hover .service-card-arrow i {
  color: white;
}

.coming-soon-card .service-card-arrow {
  display: none;
}

/* 服务详情页 */
.service-detail {
  animation: fadeIn 0.3s ease;
}

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

.back-button {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.back-button:hover {
  background: rgba(0,0,0,0.08);
  transform: translateX(-4px);
}

.back-button i {
  font-size: 14px;
}

.service-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.8);
}

.detail-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-icon i {
  font-size: 36px;
  color: white;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.detail-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* 测试卡片网格（原有样式保持） */
.service-category {
  margin-bottom: 48px;
}

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

.category-header i {
  font-size: 24px;
  color: var(--primary-color);
}

.category-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.category-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 32px 36px;
  line-height: 1.6;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-left: 0;
}

.test-section-label {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin: 28px 0 14px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #fafafa, #fff);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--primary-color);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.test-section-sub {
  font-weight: 400;
  color: #bbb;
  font-size: 12px;
  margin-left: 2px;
}

/* 场景→测试推荐横幅 */
.test-rec-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 12px 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff8f0, #fff3e8);
  border: 1px solid #ffdcb5;
  border-radius: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}
.test-rec-icon { font-size: 18px; flex-shrink: 0; }
.test-rec-text { flex: 1; color: #555; min-width: 120px; }
.test-rec-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  background: #FF8C42;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.test-rec-btn:hover { background: #e6752e; }

.test-card {
  background: white;
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  overflow: hidden;
}

.test-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
  border-color: rgba(0,0,0,0.06);
}

/* Legacy icon — hidden in new design */
.test-icon { display: none; }
.test-icon i { display: none; }

/* ── Card Header Banner ── */
.tc-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 14px 14px 0 0;
}

.tc-header .tc-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.3s ease;
}

.test-card:hover .tc-header .tc-icon {
  transform: scale(1.08);
}

.tc-header .tc-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tc-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,0.28);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.35);
  letter-spacing: 0.3px;
}

/* ── Card Body ── */
.tc-body {
  padding: 18px 20px 20px;
}

.tc-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.test-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 7px 0;
  line-height: 1.3;
}

.test-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  line-height: 1.55;
}

.test-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.test-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.test-meta i {
  font-size: 11px;
}

/* ── Per-test gradient themes ── */
.tc-stress    .tc-header { background: linear-gradient(135deg, #FF6B6B, #FF8E53); }
.tc-stress    .tc-tag    { background: rgba(255,107,107,0.12); color: #d44; }
.tc-stress    .test-meta i { color: #FF6B6B; }

.tc-depression .tc-header { background: linear-gradient(135deg, #667EEA, #764BA2); }
.tc-depression .tc-tag    { background: rgba(102,126,234,0.12); color: #5a6fd6; }
.tc-depression .test-meta i { color: #667EEA; }

.tc-anxiety   .tc-header { background: linear-gradient(135deg, #11998E, #38EF7D); }
.tc-anxiety   .tc-tag    { background: rgba(17,153,142,0.12); color: #0d8a7f; }
.tc-anxiety   .test-meta i { color: #11998E; }

.tc-self-worth .tc-header { background: linear-gradient(135deg, #F953C6, #B91D73); }
.tc-self-worth .tc-tag    { background: rgba(249,83,198,0.12); color: #b91d73; }
.tc-self-worth .test-meta i { color: #B91D73; }

.tc-compassion .tc-header { background: linear-gradient(135deg, #FC5C7D, #6A3093); }
.tc-compassion .tc-tag    { background: rgba(252,92,125,0.12); color: #c44669; }
.tc-compassion .test-meta i { color: #FC5C7D; }

.tc-sleep      .tc-header { background: linear-gradient(135deg, #2C3E50, #4CA1AF); }
.tc-sleep      .tc-tag    { background: rgba(44,62,80,0.10); color: #2C3E50; }
.tc-sleep      .test-meta i { color: #4CA1AF; }

.tc-attachment .tc-header { background: linear-gradient(135deg, #ED213A, #93291E); }
.tc-attachment .tc-tag    { background: rgba(237,33,58,0.10); color: #c41c30; }
.tc-attachment .test-meta i { color: #ED213A; }

.tc-anxiety-sas .tc-header { background: linear-gradient(135deg, #F09819, #EDDE5D); }
.tc-anxiety-sas .tc-tag    { background: rgba(240,152,25,0.12); color: #b97200; }
.tc-anxiety-sas .test-meta i { color: #d08819; }

.tc-depression-sds .tc-header { background: linear-gradient(135deg, #373B44, #4286F4); }
.tc-depression-sds .tc-tag    { background: rgba(66,134,244,0.12); color: #3a70d4; }
.tc-depression-sds .test-meta i { color: #4286F4; }

.tc-mbti       .tc-header { background: linear-gradient(135deg, #4776E6, #8E54E9); }
.tc-mbti       .tc-tag    { background: rgba(71,118,230,0.12); color: #4776E6; }
.tc-mbti       .test-meta i { color: #4776E6; }

.tc-comprehensive .tc-header { background: linear-gradient(135deg, #1D4350, #A43931); }
.tc-comprehensive .tc-tag    { background: rgba(29,67,80,0.12); color: #1D4350; }
.tc-comprehensive .test-meta i { color: #A43931; }

.tc-personality .tc-header { background: linear-gradient(135deg, #3A1C71, #D76D77); }
.tc-personality .tc-tag    { background: rgba(58,28,113,0.10); color: #3A1C71; }
.tc-personality .test-meta i { color: #9B4DBE; }

/* ========== 首页样式 ========== */
.home-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}

/* ========== 首页 Hero 区域 ========== */
.home-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 28px 36px;
  background: linear-gradient(160deg, #1C0F14 0%, #2C1420 40%, #1A1028 100%);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/static/image/home_hero.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  transition: opacity 1s ease;
}

.home-hero-bg.loaded {
  opacity: 0.5;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28, 15, 20, 0.3) 0%,
    rgba(28, 15, 20, 0.1) 30%,
    rgba(28, 15, 20, 0.7) 70%,
    rgba(28, 15, 20, 0.9) 100%
  );
}

.home-hero-content {
  position: relative;
  z-index: 2;
}

.home-hero-greeting {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.home-hero-title {
  font-family: 'Noto Serif SC', 'PingFang SC', serif;
  font-size: 32px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.home-hero-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  max-width: 320px;
}

.home-hero-date {
  position: absolute;
  top: 52px;
  right: 28px;
  z-index: 2;
  text-align: right;
}

.home-hero-date-num {
  font-family: 'Noto Serif SC', serif;
  font-size: 48px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  line-height: 1;
}

.home-hero-date-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
}

/* 首页正文区 */
.home-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.inspiration-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 0;
  box-shadow: var(--shadow);
  border: none;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.inspiration-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
}

.inspiration-card::after {
  display: none;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.inspiration-loading {
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.inspiration-loading i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.9;
}

.inspiration-loading p {
  font-size: 16px;
  opacity: 0.9;
}

.inspiration-content {
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease;
}

.inspiration-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 1;
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

.inspiration-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px 0;
  line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.inspiration-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.inspiration-quote {
  padding: 16px 20px;
  background: rgba(181, 57, 79, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-color);
  margin-top: 16px;
}

.inspiration-quote-icon {
  font-size: 24px;
  color: var(--primary-color);
  opacity: 0.8;
  margin-bottom: 8px;
}

.inspiration-quote-text {
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.6;
  color: #555;
}

.inspiration-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(181, 57, 79, 0.08);
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: none;
}

/* 快捷入口区域 */
.quick-access-section {
  margin-bottom: 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.section-title i {
  display: none;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-access-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.18s var(--transition-spring), box-shadow 0.18s ease;
  box-shadow: var(--shadow-sm);
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.quick-access-item:active {
  transform: scale(0.97);
  box-shadow: none;
}

.quick-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quick-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
  letter-spacing: -0.2px;
}

.quick-text p {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}

/* 移动端响应式 - 首页 */
@media (max-width: 768px) {
  .home-hero {
    min-height: 220px;
    padding: 44px 20px 28px;
  }
  
  .home-hero-title {
    font-size: 26px;
  }
  
  .home-body {
    padding: 16px 16px;
    gap: 16px;
  }
  
  .inspiration-card {
    padding: 20px 16px;
    border-radius: var(--radius);
    min-height: 160px;
  }
  
  .inspiration-title {
    font-size: 18px;
  }
  
  .inspiration-text {
    font-size: 14px;
  }
  
  .quick-access-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .quick-access-item {
    padding: 16px;
    min-height: 110px;
  }
  
  .quick-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* ========== 聊天陪伴 ========== */
.chatbot-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height));
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}

/* 聊天陪伴头部 */
.chatbot-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.chatbot-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: rgba(250, 247, 245, 0.7);
  border-radius: 0;
  margin-bottom: 0;
}

.chatbot-welcome {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.chatbot-welcome i {
  font-size: 64px;
  color: var(--primary-color);
  margin-bottom: 20px;
  opacity: 0.8;
}

.chatbot-welcome h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.chatbot-welcome p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

.chatbot-message {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  animation: fadeInUp 0.3s ease;
}

.chatbot-message.user {
  flex-direction: row-reverse;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(200, 75, 110, 0.3);
}

.chatbot-message.user .chatbot-avatar {
  background: #e8e8e8;
  color: var(--text-primary);
}

.chatbot-bubble {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chatbot-message.user .chatbot-bubble {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: 0 4px 15px rgba(200, 75, 110, 0.30);
}

/* 聊天系统提示消息 */
.chatbot-system-message {
  text-align: center;
  padding: 8px 16px;
  margin: 12px auto;
  max-width: 80%;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chatbot-system-message i {
  font-size: 12px;
  opacity: 0.8;
}

.chatbot-input-area {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.04);
}

.chatbot-textarea {
  flex: 1;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  transition: all 0.22s ease;
  background: var(--input-bg);
}

.chatbot-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(200, 75, 110, 0.10);
}

.chatbot-send-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.30);
}

.chatbot-send-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(200, 75, 110, 0.40);
}

.chatbot-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 聊天风格选择模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.style-modal-content {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.8);
  animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.style-modal-content .modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1;
}

.style-modal-content .modal-close-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: rotate(90deg);
}

.style-modal-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-align: center;
}

.style-modal-content p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  text-align: center;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0 0 0;
}

.style-card {
  background: white;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.style-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.15);
}

.style-card i {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.style-card h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.style-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.modal-close-btn {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: #f5f5f5;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.modal-close-btn:hover {
  background: #e8e8e8;
}

/* ========== 认证模态框 ========== */
.auth-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  animation: modalSlideIn 0.3s ease;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 18px;
}

.modal-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.auth-title {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
  font-weight: 700;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  text-align: center;
}

.auth-form {
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.2s;
  box-sizing: border-box;
  height: 46px;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(200, 75, 110, 0.1);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.3);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.send-code-btn {
  padding: 12px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 100px;
  height: 46px;
  box-sizing: border-box;
}

.send-code-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(200, 75, 110, 0.3);
}

.send-code-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.forgot-password-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.forgot-password-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.mama-helper-app {
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

/* ========== 昵称输入弹窗 ========== */
.nickname-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.nickname-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(229, 114, 154, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nickname-modal-content h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.nickname-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.6;
}

.nickname-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
  margin-bottom: 20px;
}

.nickname-input:focus {
  border-color: var(--primary-color);
}

.nickname-buttons {
  display: flex;
  gap: 12px;
}

.nickname-skip,
.nickname-submit {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nickname-skip {
  background: var(--bg-color);
  color: var(--text-secondary);
}

.nickname-skip:active {
  opacity: 0.7;
}

.nickname-submit {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

.nickname-submit:active {
  transform: scale(0.98);
  background: var(--accent-hover);
}

/* ========== 场景选择页 ========== */
.scene-selection {
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.scene-header {
  position: relative;
  text-align: center;
  margin-bottom: 32px;
  padding-top: 20px;
}

.scene-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
  letter-spacing: -0.8px;
}

.scene-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  text-align: center;
  font-weight: 400;
}

.scene-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.scene-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255,255,255,0.7);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.scene-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.28s ease;
}

.scene-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(200, 75, 110, 0.16), inset 0 0 0 1.5px rgba(200, 75, 110, 0.4);
  border-color: rgba(200, 75, 110, 0.4);
}

.scene-card:hover::before {
  transform: scaleX(1);
}

.scene-card:hover .scene-card-arrow {
  transform: translateX(4px);
  color: var(--primary-color);
}

.scene-card:active {
  transform: translateY(-2px);
}

.scene-card-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.28s ease;
}

.scene-card:hover .scene-card-icon-wrapper {
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  transform: scale(1.06);
}

.scene-card-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.scene-card:hover .scene-card-icon {
  transform: scale(1.08);
}

.scene-card-content {
  flex: 1;
  min-width: 0;
}

.scene-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.scene-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.scene-card-arrow {
  font-size: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.scene-card-users {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 500;
}

.ai-help-link {
  text-align: center;
  padding: 16px;
  color: var(--primary-color);
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
  transition: all 0.2s;
}

.ai-help-link:active {
  opacity: 0.7;
}

/* ========== 具体场景选择页 ========== */
.subscene-selection {
  padding: 20px;
  max-width: 640px;
  margin: 0 auto;
}

.back-button {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 16px;
  padding: 8px 0;
  cursor: pointer;
  margin-bottom: 16px;
  font-weight: 500;
}

.back-icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: #666;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  padding: 0;
}

.back-icon-button:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.back-icon-button:active {
  transform: scale(0.95);
}

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

.subscene-item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.subscene-item:active {
  transform: scale(0.98);
}

.subscene-item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subscene-item-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== 对话页面 ========== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-color);
}

.chat-header {
  position: relative;
  padding: 16px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* 聊天风格选择按钮 */
.chat-style-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chat-style-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.chat-style-btn i:first-child {
  font-size: 14px;
}

.chat-style-btn i:last-child {
  font-size: 10px;
  margin-left: 2px;
}

/* 风格下拉菜单 */
.style-dropdown {
  position: absolute;
  top: 100%;
  right: 20px;
  margin-top: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 180px;
  max-height: 400px;
  overflow-y: auto;
  animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.style-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border-color);
}

.style-dropdown-item:last-child {
  border-bottom: none;
}

.style-dropdown-item:hover {
  background: var(--bg-tertiary);
}

.style-dropdown-item i {
  font-size: 16px;
  color: var(--primary-color);
  width: 20px;
  text-align: center;
}

.style-dropdown-item span {
  font-size: 14px;
  color: var(--text-primary);
}

.style-dropdown-item.active {
  background: rgba(200, 75, 110, 0.1);
}

.style-dropdown-item.active i {
  color: var(--primary-color);
}

.style-dropdown-item.active span {
  font-weight: 600;
  color: var(--primary-color);
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .chat-header {
    padding: 12px 16px;
  }
  
  .chat-style-btn {
    padding: 5px 10px;
    font-size: 12px;
    gap: 4px;
  }
  
  .chat-style-btn i:first-child {
    font-size: 13px;
  }
  
  .chat-style-btn span {
    display: none; /* 移动端只显示图标 */
  }
  
  .style-dropdown {
    right: 10px;
    min-width: 160px;
  }
  
  .style-dropdown-item {
    padding: 10px 14px;
  }
  
  .style-dropdown-item i {
    font-size: 15px;
  }
  
  .style-dropdown-item span {
    font-size: 13px;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0; /* 确保flex子元素正确计算高度 */
}

.message {
  display: flex;
  gap: 10px;
  animation: messageSlideIn 0.3s ease;
  margin-bottom: 16px;
}

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

.message.assistant {
  flex-direction: row;
  justify-content: flex-start;
}

.message.user {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message.assistant .message-avatar {
  background: white;
  border: 1px solid var(--border-color);
}

.message.user .message-avatar {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  word-wrap: break-word;
}

.message.assistant .message-bubble {
  background: var(--assistant-message-bg);
  color: var(--text-primary);
  border-radius: 4px 12px 12px 12px;
}

.message.user .message-bubble {
  background: var(--user-message-bg);
  color: white;
  border-radius: 12px 4px 12px 12px;
}

/* ========== 正在输入动画 ========== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px !important;
  min-height: 32px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.message-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: right;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border-top: 1px solid var(--border-color);
  max-height: 120px;
  overflow-y: auto;
}

.chat-input-area {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-top: 1px solid var(--border-color);
  padding: 12px 20px 20px;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.05);
}

.quick-reply-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.quick-reply-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.15);
}

.quick-reply-btn:active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border-color: transparent;
  transform: scale(0.95);
}

.chat-input-container {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#chatInput {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--input-border);
  border-radius: 20px;
  font-size: 15px;
  resize: none;
  max-height: 120px;
  font-family: inherit;
  background: var(--input-bg);
  transition: all 0.22s ease;
}

#chatInput:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(200, 75, 110, 0.10);
}

.chat-send-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.30);
}

.chat-send-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* ========== 卡片展示页面 ========== */
.card-container {
  padding: 20px;
  max-width: 640px;
  margin: 0 auto;
  overflow-y: auto;
  height: 100vh;
}

.card-header {
  text-align: center;
  margin-bottom: 24px;
  padding-top: 20px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-content {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.8);
  margin-bottom: 24px;
  line-height: 1.8;
}

.card-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 20px 0 12px 0;
}

.card-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 16px 0 8px 0;
}

.card-content p {
  margin: 8px 0;
  color: var(--text-secondary);
}

.card-content ol, .card-content ul {
  padding-left: 20px;
  margin: 12px 0;
}

.card-content li {
  margin: 8px 0;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.card-action-btn {
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  background: rgba(255,255,255,0.85);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.22s ease;
}

.card-action-btn.primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border: none;
  box-shadow: var(--shadow-primary);
}

.card-action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 75, 110, 0.40);
}

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

.card-feedback {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255,255,255,0.8);
  margin-bottom: 16px;
}

.feedback-title {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}

.feedback-buttons {
  display: flex;
  justify-content: space-around;
  gap: 12px;
}

.feedback-btn {
  flex: 1;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.feedback-btn:active {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.feedback-btn:active .feedback-emoji,
.feedback-btn:active .feedback-text {
  filter: brightness(0) invert(1);
}

.feedback-emoji {
  font-size: 32px;
}

.feedback-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.continue-chat-link {
  text-align: center;
  padding: 16px;
  color: var(--primary-color);
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 20px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
  .scene-card {
    padding: 16px;
  }
  
  .scene-card-title {
    font-size: 18px;
  }
  
  .scene-title {
    font-size: 20px;
  }
  
  .chat-messages {
    padding: 16px;
  }
  
  .message-bubble {
    max-width: 80%;
  }
  
  .test-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .test-card {
    padding: 20px 18px;
  }
  
  .services-title {
    font-size: 24px;
  }
  
  .service-categories {
    grid-template-columns: 1fr;
  }
  
  .service-category-card {
    padding: 20px 16px;
    grid-template-columns: auto 1fr;
    gap: 16px;
  }
  
  .service-card-icon {
    width: 48px;
    height: 48px;
  }
  
  .service-card-icon i {
    font-size: 24px;
  }
  
  .service-card-title {
    font-size: 17px;
  }
  
  .service-card-desc {
    font-size: 13px;
  }
  
  .service-card-arrow {
    width: 28px;
    height: 28px;
  }
  
  .back-button {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .service-detail-header {
    padding: 16px;
    gap: 16px;
  }
  
  .detail-icon {
    width: 56px;
    height: 56px;
  }
  
  .detail-icon i {
    font-size: 28px;
  }
  
  .detail-title {
    font-size: 20px;
  }
  
  .detail-subtitle {
    font-size: 14px;
  }
  
  .category-header h3 {
    font-size: 20px;
  }
}

/* ========== 滚动条优化 ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

.flex-direction-column {
  padding: 1rem;
  gap: 0.5rem;
}

.sidebar-header {
  margin-bottom: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
}

.logo-image {
  flex-shrink: 0;
}

.app-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo-icon {
  color: var(--accent-color);
  width: 24px;
  height: 24px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-speed);
  font-size: 0.95rem;
  white-space: nowrap;
  font-family: inherit;
}

.sidebar-button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-color);
}

.sidebar-button.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.sidebar-spacer {
  flex: 1;
}

/* Chat History */
.chat-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 0.5rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-history-item {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-speed);
  border: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.chat-history-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.chat-history-item.active {
  background: var(--bg-tertiary);
  border-color: var(--accent-color);
}

.chat-history-title {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-delete {
  opacity: 0;
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.chat-history-item:hover .chat-history-delete {
  opacity: 1;
}

.settings-group input {
  width: 100%;
  padding: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

.settings-group input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.chat-history-delete:hover {
  background: var(--bg-primary);
  color: #f85149;
}

.chat-history-delete svg {
  width: 16px;
  height: 16px;
}

/* Usage Quota */
.usage-quota {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.quota-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.quota-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.sidebar-controls {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.icon-button {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.icon-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-color);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

/* Settings Panel */
.settings-panel {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

.settings-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.settings-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.settings-group small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.settings-group select,
.settings-group input[type="range"],
.settings-group input[type="password"] {
  padding: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

.settings-group input[type="password"] {
  width: 100%;
}

.settings-group input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-color);
}

.settings-group input[type="range"] {
  cursor: pointer;
  padding: 0;
}

/* Settings panel close button (top-right icon) */
.settings-panel {
  position: relative;
}
.settings-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  z-index: 1200;
}
.settings-close i {
  width: 18px;
  height: 18px;
}
.settings-close:hover {
  color: var(--accent-color);
  transform: scale(1.03);
}

/* Chat Area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-area::-webkit-scrollbar {
  width: 8px;
}

.chat-area::-webkit-scrollbar-track {
  background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 1rem;
}

.welcome-icon {
  color: var(--accent-color);
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-screen h1 {
  font-size: 2rem;
  font-weight: 600;
}

.welcome-screen p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.message-wrapper {
  display: flex;
  width: 100%;
  animation: slideIn 0.3s ease-out;
}

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

.message-wrapper.user {
  justify-content: flex-end;
}

.message-wrapper.assistant {
  justify-content: flex-start;
}

.message-content {
  max-width: 70%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  line-height: 1.6;
}

.message-wrapper.user .message-content {
  background: var(--user-message-bg);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-wrapper.assistant .message-content {
  background: var(--assistant-message-bg);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.message-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-markdown {
  word-wrap: break-word;
}

.message-markdown p {
  margin: 0.5rem 0;
}

.message-markdown p:first-child {
  margin-top: 0;
}

.message-markdown p:last-child {
  margin-bottom: 0;
}

.message-markdown code {
  background: rgba(110, 118, 129, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

.message-markdown pre {
  background: rgba(110, 118, 129, 0.2);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message-markdown pre code {
  background: none;
  padding: 0;
}

.thinking-indicator {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border-radius: 50%;
  animation: thinking 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinking {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Input Area */
.input-area {
  padding: 1.5rem 2rem 2rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.input-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-speed);
}

.input-container:focus-within {
  border-color: var(--accent-color);
}

.input-container textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  resize: none;
  min-height: 24px;
  max-height: 200px;
  overflow-y: auto;
  font-family: inherit;
  line-height: 1.5;
  transition: height 0.1s ease;
}

.input-container textarea::placeholder {
  color: var(--text-secondary);
}

.send-button {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
  flex-shrink: 0;
}

.send-button svg {
  width: 20px;
  height: 20px;
}

.send-button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Image Generation */
.image-gen-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.image-gen-container {
  max-width: 800px;
  margin: 0 auto;
}

.image-gen-container h2 {
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.image-prompt-input {
  width: 100%;
  padding: 1rem;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 1rem;
  transition: border-color var(--transition-speed);
}

.image-prompt-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.generate-button {
  width: 100%;
  padding: 1rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-family: inherit;
}

.generate-button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.generate-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.generated-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-speed);
}

.generated-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Responsive */

@media (max-width: 768px) {
  .sidebar {
    width: 100vw;
    max-width: 100vw;
    position: fixed;
    left: -100vw;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    background: var(--bg-secondary);
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-header {
    padding-top: 1rem;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .input-area {
    padding: 1rem 0.5rem 1.5rem;
  }
  .input-container {
    padding: 0.5rem 0.5rem;
  }
  .chat-area, .image-gen-area {
    padding: 1rem 0.5rem;
  }
  .message-content {
    max-width: 98vw;
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
  .welcome-screen h1 {
    font-size: 1.3rem;
  }
  .welcome-icon i {
    width: 48px !important;
    height: 48px !important;
  }
  .settings-panel {
    padding: 1rem 0.5rem;
    max-height: 80vh;
    grid-template-columns: 1fr;
  }
  .image-prompt-input {
    font-size: 1rem;
    padding: 0.75rem;
  }
  .generate-button {
    font-size: 1rem;
    padding: 0.75rem;
  }
  .image-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .btn-text, .logo-text {
    display: none;
  }
  /* When sidebar is opened on mobile, show button labels for clarity */
  .sidebar.open .btn-text,
  .sidebar.open .logo-text {
    display: inline-block;
  }
  .sidebar.open .sidebar-button {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  .sidebar.open .sidebar-button i {
    margin-right: 0.6rem;
  }
}

@media (max-width: 480px) {
  .message-content {
    font-size: 0.95rem;
    padding: 0.5rem 0.5rem;
  }
  .input-container textarea {
    font-size: 1rem;
  }
  .sidebar-header {
    padding-top: 0.5rem;
  }
}

/* 登录界面样式 */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-modal {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.8);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.login-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.login-modal h2 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  text-align: center;
  font-size: 24px;
}

.login-subtitle {
  margin: 0 0 30px 0;
  color: var(--text-secondary);
  text-align: center;
  font-size: 14px;
}

.login-option {
  margin-bottom: 20px;
}

.login-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.wechat-btn {
  background: #07c160;
  color: white;
}

.wechat-btn:hover {
  background: #06ad56;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.phone-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.30);
}

.phone-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(200, 75, 110, 0.40);
}

.email-btn {
  background: #67c23a;
  color: white;
}

.email-btn:hover {
  background: #5daf34;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3);
}

.phone-login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  margin-bottom: 12px;
  box-sizing: border-box;
}

.phone-login-form input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.code-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.code-input-group input {
  flex: 1;
  margin-bottom: 0;
}

.code-btn {
  padding: 12px 20px;
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  background: transparent;
  color: var(--accent-color);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.code-btn:hover {
  background: var(--accent-color);
  color: white;
}

.code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-footer {
  margin-top: 30px;
  text-align: center;
}

.login-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.login-footer a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  margin-left: 5px;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* 认证表单 */
.auth-form {
  width: 100%;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  margin-bottom: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.auth-form .login-btn {
  margin-top: 8px;
  background: var(--accent-color);
  color: white;
}

.auth-form .login-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

/* 用户信息显示 */
.user-info {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}

.user-phone {
  font-size: 12px;
  color: var(--text-secondary);
}

.logout-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ========== 卡片类型选择网格 ========== */
.card-type-selection {
  width: 100%;
  margin: 16px 0;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-type-header {
  margin-bottom: 16px;
}

.card-ready-message {
  text-align: center;
  padding: 20px 16px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(200, 75, 110, 0.05), rgba(255, 107, 122, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(200, 75, 110, 0.1);
}

.ready-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.ready-text {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.ready-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.card-selection-title {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: center;
  margin: 16px 0 0 0;
}

.card-type-header p {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: center;
}

.card-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.card-type-item {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.card-type-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.15);
}

.card-type-item:active {
  transform: scale(0.98);
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.card-type-item:active .card-type-title,
.card-type-item:active .card-type-desc {
  color: white;
}

.card-type-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-type-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ========== 卡片确认弹窗 ========== */
.card-confirm-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(200, 75, 110, 0.2);
  animation: modalSlideIn 0.3s ease;
}

.card-selected-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.6;
}

.card-selected-title strong {
  color: var(--primary-color);
  font-weight: 600;
}

.additional-info-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  margin-bottom: 20px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.additional-info-input:focus {
  border-color: var(--primary-color);
}

/* ========== 生成的卡片展示 ========== */
.generated-card-display {
  width: 100%;
  margin: 16px 0;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-image-container {
  width: 100%;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.generated-card-image {
  width: 100%;
  height: auto;
  display: block;
}

.card-content-text {
  padding: 20px;
  background: var(--bg-color);
  border-radius: var(--radius);
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

.card-content-text h1,
.card-content-text h2,
.card-content-text h3 {
  color: var(--primary-color);
  margin-top: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.card-content-text h1 {
  font-size: 20px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.card-content-text h2 {
  font-size: 18px;
}

.card-content-text h3 {
  font-size: 16px;
}

.card-content-text p {
  margin: 12px 0;
  color: var(--text-primary);
}

.card-content-text ul,
.card-content-text ol {
  padding-left: 24px;
  margin: 12px 0;
}

.card-content-text li {
  margin: 8px 0;
  line-height: 1.6;
}

.card-content-text strong {
  color: var(--primary-color);
  font-weight: 600;
}

.card-content-text blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-action-btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--primary-color);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.card-action-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.card-action-btn.secondary {
  background: var(--bg-color);
  color: var(--text-secondary);
}

/* 卡片完成提示 */
.card-complete-message {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 100%);
  border-radius: 12px;
  margin-bottom: 16px;
}

.complete-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.complete-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 8px 0;
}

.complete-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0;
}

/* ========== 卡片生成动画 ========== */
.card-generating-animation {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  margin: 20px 0;
}

.card-gen-container {
  background: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 100%);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(200, 75, 110, 0.1);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.card-gen-icon {
  font-size: 56px;
  animation: cardGenPulse 2s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes cardGenPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.card-gen-text {
  color: #333;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

.card-gen-progress {
  width: 100%;
  height: 6px;
  background: rgba(200, 75, 110, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.card-gen-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
  background-size: 200% 100%;
  animation: cardGenProgress 2s linear infinite;
  border-radius: 3px;
}

@keyframes cardGenProgress {
  0% {
    width: 0%;
    background-position: 0% 50%;
  }
  50% {
    width: 100%;
    background-position: 100% 50%;
  }
  100% {
    width: 100%;
    background-position: 200% 50%;
  }
}

.card-gen-tips {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(200, 75, 110, 0.1);
}

.tip-text {
  color: #999;
  font-size: 14px;
  animation: tipFade 3s ease-in-out infinite;
}

@keyframes tipFade {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .scene-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .nav-container {
    padding: 0 4px;
  }

  .nav-tabs {
    width: 100%;
    gap: 0;
  }

  .nav-tab {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    gap: 3px;
    border-radius: 0;
  }

  .nav-tab .tab-icon {
    font-size: 18px;
  }

  .nav-tab .tab-label {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .scene-selection {
    padding: 24px 16px;
  }
  
  .scene-title {
    font-size: 24px;
  }
  
  .scene-subtitle {
    font-size: 14px;
  }
  
  .scene-card {
    padding: 20px;
  }
  
  .scene-card-icon-wrapper {
    width: 48px;
    height: 48px;
  }
  
  .scene-card-title {
    font-size: 16px;
  }
  
  .scene-card-desc {
    font-size: 13px;
  }
  
  .coming-icon {
    font-size: 64px;
    width: 100px;
    height: 100px;
  }
  
  .coming-title {
    font-size: 20px;
  }
  
  .coming-desc {
    font-size: 13px;
  }
  
  .auth-modal-content {
    padding: 32px 24px;
    max-width: 90%;
  }
  
  .auth-title {
    font-size: 20px;
  }
  
  /* 卡片类型网格 */
  .card-type-grid {
    gap: 8px;
  }
  
  .card-type-item {
    padding: 10px 8px;
  }
  
  .card-type-title {
    font-size: 12px;
  }
  
  .card-type-desc {
    font-size: 10px;
  }
  
  .card-confirm-modal-content {
    padding: 24px 20px;
  }
  
  .card-gen-container {
    padding: 24px 20px;
  }
  
  .chatbot-container {
    padding: 12px;
  }
  
  .chatbot-messages {
    padding: 16px 12px;
  }
  
  .chatbot-bubble {
    max-width: 60%;
    padding: 6px 10px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  
  @media (max-width: 768px) {
    .chatbot-bubble {
      max-width: 70%;
      padding: 6px 8px;
      font-size: 13px;
      border-radius: 12px;
    }
    
    .chatbot-system-message {
      font-size: 12px;
      padding: 6px 12px;
      max-width: 85%;
    }
  }
  
  @media (max-width: 480px) {
    .chatbot-bubble {
      max-width: 60%;
      padding: 5px 6px;
      font-size: 12px;
      border-radius: 10px;
    }
  }
  
  .chatbot-textarea {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .style-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .style-modal-content {
    padding: 24px 16px;
    max-width: 95%;
    max-height: 85vh;
  }
  
  .style-modal-content .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .style-modal-content h3 {
    font-size: 20px;
    margin-bottom: 6px;
    padding-right: 40px;
  }
  
  .style-modal-content p {
    font-size: 13px;
    margin-bottom: 16px;
  }
  
  .style-card {
    padding: 16px;
  }
  
  .style-card i {
    font-size: 24px;
    margin-bottom: 8px;
  }
  
  .style-card h4 {
    font-size: 15px;
  }
  
  .style-card p {
    font-size: 12px;
  }
  
  /* 480px下的语言切换按钮 */
  .lang-toggle-btn {
    min-width: 70px;
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
  }
  
  .lang-toggle-btn span:first-child {
    font-size: 14px;
  }
  
  .lang-toggle-btn span:last-child {
    font-size: 12px;
  }
  
  .user-detail-item-inline {
    padding: 14px;
    gap: 12px;
  }
  
  .user-center-card {
    padding: 24px 20px;
  }
  
  .user-center-icon {
    font-size: 64px;
    width: 80px;
    height: 80px;
  }
  
  .user-center-title {
    font-size: 20px;
  }
  
  .user-center-desc {
    font-size: 14px;
  }
  
  .user-center-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .user-center-actions .btn-primary,
  .user-center-actions .btn-secondary {
    max-width: 100%;
  }
  
  .user-info-card {
    padding: 24px 20px;
  }
  
  .user-avatar {
    width: 72px;
    height: 72px;
    font-size: 32px;
  }
  
  .user-display-name {
    font-size: 20px;
  }
  
  .user-detail-item {
    padding: 16px;
    gap: 16px;
  }
  
  .user-detail-item i {
    font-size: 20px;
    width: 24px;
  }
}

/* 平板设备 (481px - 768px) */
@media (max-width: 768px) {
  .style-modal-content {
    padding: 32px 24px;
    max-width: 92%;
  }
  
  .style-grid {
    gap: 14px;
  }
  
  .style-card {
    padding: 18px;
  }
}

/* ========== SCL-90 测试样式 / 通用测试框架 ========== */
.scl90-test-container,
.test-framework-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

.scl90-test-header,
.test-framework-header {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.8);
}

.test-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.test-progress-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.scl90-test-content,
.test-framework-content {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.test-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.intro-icon {
  font-size: 64px;
  color: var(--primary-color);
  margin-bottom: 24px;
}

.test-intro h2 {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.intro-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.intro-instructions, .rating-guide {
  text-align: left;
  margin: 24px 0;
  padding: 24px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
}

.intro-instructions h3, .rating-guide h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.intro-instructions ul {
  list-style: none;
  padding: 0;
}

.intro-instructions li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  font-size: 15px;
  color: var(--text-secondary);
}

.intro-instructions li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 20px;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
}

.rating-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 8px;
}

.rating-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.rating-desc {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.btn-large {
  padding: 16px 48px;
  font-size: 16px;
  margin-top: 32px;
}

/* 问题卡片 */
.question-card {
  max-width: 600px;
  margin: 0 auto;
}

.question-number {
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  font-weight: 500;
}

.question-text {
  font-size: 28px;
  color: #000000;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.6;
  font-weight: 700;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

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

.option-btn {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  color: var(--text-primary);
}

.option-btn:hover {
  background: white;
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.option-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 16px;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
}

.option-btn:hover .option-num {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.option-label {
  font-weight: 500;
}

.option-btn.selected {
  background: white;
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.option-btn.selected .option-num {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 导航按钮 */
.question-nav-buttons {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  justify-content: space-between;
}

.btn-nav {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-prev {
  background: var(--bg-color);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-prev:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

.btn-next {
  background: var(--primary-color);
  color: white;
}

.btn-next:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.3);
}

.btn-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-nav i {
  font-size: 14px;
}

/* 测试结果 */
.test-result {
  max-width: 800px;
  margin: 0 auto;
}

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

.result-icon {
  font-size: 64px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.result-header h2 {
  font-size: 28px;
  color: var(--text-primary);
}

.result-summary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-hover));
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-align: center;
}

.result-summary h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.result-summary p {
  font-size: 16px;
  opacity: 0.95;
}

.result-factors {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.factor-item {
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--border-color);
}

.factor-item.alert {
  border-left-color: #f56c6c;
  background: rgba(245, 108, 108, 0.05);
}

.factor-item.warning {
  border-left-color: #e6a23c;
  background: rgba(230, 162, 60, 0.05);
}

.factor-item.normal {
  border-left-color: #67c23a;
  background: rgba(103, 194, 58, 0.05);
}

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

.factor-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.factor-score {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.factor-level {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.ai-analysis-section {
  background: var(--bg-color);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.ai-analysis-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.ai-analysis-section h3 i {
  color: var(--primary-color);
  margin-right: 8px;
}

.ai-analysis-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.ai-analysis-loading i {
  font-size: 24px;
  margin-right: 12px;
  color: var(--primary-color);
}

.ai-analysis-content {
  line-height: 1.8;
  color: var(--text-primary);
}

.ai-analysis-content h4 {
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--primary-color);
}

.ai-analysis-content p {
  margin-bottom: 12px;
}

.ai-analysis-content ul {
  padding-left: 24px;
  margin: 12px 0;
}

.ai-analysis-content li {
  margin: 8px 0;
}

/* 结果页面操作按钮（已在后面统一定义） */

/* featured-test \u2014 badge is now inline .tc-badge inside each card */
.featured-test {
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

/* ========== SCL-90 测试样式增强 ========== */
.summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.summary-card h3 {
  margin-bottom: 20px;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.3);
}

.level-normal {
  background: rgba(76, 217, 100, 0.3);
}

.level-warning {
  background: rgba(255, 149, 0, 0.3);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(10px);
}

.stat-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.factors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.factor-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition-speed);
}

.factor-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.factor-abnormal {
  border-color: #ff9500;
  background: #fff9f0;
}

.factor-normal {
  border-color: #34c759;
  background: #f0fdf4;
}

.factor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

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

.factor-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.factor-abnormal .factor-status {
  background: #ff9500;
  color: white;
}

.factor-normal .factor-status {
  background: #34c759;
  color: white;
}

.factor-score {
  margin-bottom: 12px;
}

.score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.score-norm {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.factor-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ai-analysis-section {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}

.ai-analysis-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-analysis-section h3 i {
  color: var(--primary-color);
}

.ai-analysis-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary);
}

.ai-analysis-loading i {
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ai-analysis-content {
  line-height: 1.8;
  color: var(--text-primary);
}

.ai-analysis-content h2,
.ai-analysis-content h3,
.ai-analysis-content h4 {
  margin-top: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.ai-analysis-content ul,
.ai-analysis-content ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.ai-analysis-content li {
  margin-bottom: 8px;
}

.ai-analysis-content p {
  margin-bottom: 12px;
}

.ai-analysis-content strong {
  font-weight: 600;
  color: var(--primary-color);
}

.error-message {
  text-align: center;
  padding: 24px;
  color: #ff3b30;
}

.result-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
  flex: 1;
  min-width: 180px;
  max-width: 240px;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.result-actions .btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.3);
}

.result-actions .btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 75, 110, 0.4);
}

.result-actions .btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.result-actions .btn-secondary:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* 响应式 */
@media (max-width: 768px) {
  .scl90-test-container,
  .test-framework-container {
    padding: 16px;
  }
  
  .scl90-test-content,
  .test-framework-content {
    padding: 24px 20px;
  }
  
  .rating-options {
    grid-template-columns: 1fr;
  }
  
  .question-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .result-actions .btn-primary,
  .result-actions .btn-secondary {
    width: 100%;
    max-width: 100%;
  }
  
  .factors-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== MBTI测试专用样式 ========== */
.mbti-options-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.mbti-option-group {
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
}

.mbti-option-header {
  margin-bottom: 16px;
}

.option-label-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
}

.mbti-score-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.score-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: white;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.score-btn:hover {
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.score-btn.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(200, 75, 110, 0.3);
}

.mbti-score-display {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.mbti-score-display strong {
  color: var(--primary-color);
  font-size: 24px;
}

.mbti-score-hint {
  text-align: center;
  padding: 16px;
  background: #fff3cd;
  border-radius: var(--radius-sm);
  color: #856404;
  font-size: 14px;
}

.mbti-score-hint i {
  margin-right: 8px;
}

.mbti-score-hint strong {
  font-size: 18px;
  margin-left: 4px;
}

/* MBTI结果样式 */
.mbti-result-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 24px;
}

.mbti-type-badge {
  margin-bottom: 16px;
}

.mbti-type-letters {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 8px;
  margin-bottom: 8px;
}

.mbti-type-name {
  font-size: 24px;
  font-weight: 600;
  opacity: 0.95;
}

.mbti-type-description {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.9;
}

/* MBTI维度分析 */
.mbti-dimensions {
  display: grid;
  gap: 24px;
}

.mbti-dimension-card {
  background: var(--bg-color);
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
}

.mbti-dimension-card h4 {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 18px;
}

.mbti-dimension-pair {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  margin-bottom: 16px;
}

.mbti-option {
  flex: 1;
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.mbti-option.winner {
  border-color: var(--primary-color);
  background: rgba(200, 75, 110, 0.05);
}

.mbti-letter {
  font-size: 36px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.mbti-option.winner .mbti-letter {
  color: var(--primary-color);
}

.mbti-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.mbti-score {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.mbti-vs {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.mbti-progress-bar {
  display: flex;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.mbti-progress-fill {
  height: 100%;
  transition: width 0.5s ease;
}

.mbti-dim-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* 移动端MBTI样式优化 */
@media (max-width: 768px) {
  .mbti-score-selector {
    gap: 6px;
  }
  
  .score-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .mbti-type-letters {
    font-size: 48px;
    letter-spacing: 4px;
  }
  
  .mbti-type-name {
    font-size: 20px;
  }
  
  .mbti-dimension-pair {
    flex-direction: column;
    gap: 12px;
  }
  
  .mbti-vs {
    transform: rotate(90deg);
  }
}

/* ========== EPQ 儿童个性问卷样式 ========== */
.epq-result-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px;
  border-radius: var(--radius);
  color: white;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}

.epq-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.epq-summary-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.temperament-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.temperament-badge i {
  font-size: 20px;
}

.temperament-desc {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 25px;
  opacity: 0.95;
}

.epq-dimensions-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.dimension-mini {
  background: rgba(255, 255, 255, 0.15);
  padding: 15px;
  border-radius: var(--radius-sm);
  text-align: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dimension-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 5px;
}

.dimension-value {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.dimension-score {
  font-size: 14px;
  opacity: 0.8;
  font-family: 'Courier New', monospace;
}

.epq-dimensions-detail {
  display: grid;
  gap: 20px;
  margin-bottom: 30px;
}

.epq-dimension-card {
  background: white;
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

.dimension-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.dimension-header h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.dimension-scores {
  display: flex;
  gap: 15px;
  font-size: 14px;
}

.raw-score, .t-score {
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-weight: 500;
}

.dimension-level {
  margin-bottom: 15px;
}

.level-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.dimension-bar {
  margin: 20px 0;
}

.bar-container {
  position: relative;
  height: 30px;
  background: #f0f0f0;
  border-radius: 15px;
  overflow: visible;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  transition: width 0.6s ease;
}

.bar-marker {
  position: absolute;
  top: -25px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-tertiary);
}

.bar-marker span {
  display: block;
  text-align: center;
}

.bar-marker::after {
  content: '';
  display: block;
  width: 1px;
  height: 10px;
  background: var(--text-tertiary);
  margin: 2px auto 0;
}

.dimension-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 15px 0;
}

.dimension-info {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.dimension-info small {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* 颜色主题 */
.color-danger {
  border-left-color: #f44336;
}

.color-danger .level-badge {
  background: #f44336;
}

.color-danger .bar-fill {
  background: linear-gradient(90deg, #f44336 0%, #e91e63 100%);
}

.color-warning {
  border-left-color: #ff9800;
}

.color-warning .level-badge {
  background: #ff9800;
}

.color-warning .bar-fill {
  background: linear-gradient(90deg, #ff9800 0%, #ff5722 100%);
}

.color-success {
  border-left-color: #4caf50;
}

.color-success .level-badge {
  background: #4caf50;
}

.color-success .bar-fill {
  background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
}

.color-info {
  border-left-color: #2196f3;
}

.color-info .level-badge {
  background: #2196f3;
}

.color-info .bar-fill {
  background: linear-gradient(90deg, #2196f3 0%, #03a9f4 100%);
}

.color-primary {
  border-left-color: #9c27b0;
}

.color-primary .level-badge {
  background: #9c27b0;
}

.color-primary .bar-fill {
  background: linear-gradient(90deg, #9c27b0 0%, #673ab7 100%);
}

.color-neutral {
  border-left-color: #607d8b;
}

.color-neutral .level-badge {
  background: #607d8b;
}

.color-neutral .bar-fill {
  background: linear-gradient(90deg, #607d8b 0%, #78909c 100%);
}

/* 气质类型详细说明 */
.temperament-detail {
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.temperament-detail h3 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.temperament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.temperament-item {
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.temperament-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.temperament-item h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.temperament-item p {
  margin: 0;
  font-size: 13px;
  opacity: 0.8;
}

.temperament-explanation {
  background: #f8f9ff;
  padding: 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid #667eea;
}

.temperament-explanation h4 {
  margin: 0 0 12px 0;
  color: #667eea;
  font-size: 18px;
}

.temperament-explanation p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* T分数说明 */
.score-explanation {
  background: #fff9e6;
  padding: 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid #ffc107;
}

.score-explanation h4 {
  margin: 0 0 12px 0;
  color: #f57c00;
  font-size: 16px;
}

.score-explanation ul {
  margin: 0;
  padding-left: 20px;
}

.score-explanation li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .epq-summary-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .temperament-badge {
    font-size: 16px;
  }
  
  .epq-dimensions-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dimension-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .temperament-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== 订阅功能样式 ========== */

.subscription-status {
  transition: color 0.3s ease;
}

.subscription-status i {
  color: #ffd700;
}

.subscription-btn {
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #1A1A1A;
  font-weight: 600;
  transition: all 0.3s ease;
}

.subscription-btn:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.subscription-plan {
  text-align: center;
  padding: 20px;
}

.plan-price {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.price-currency {
  font-size: 24px;
  margin-right: 4px;
  margin-top: 8px;
}

.price-amount {
  font-size: 56px;
}

.price-period {
  font-size: 18px;
  color: var(--text-secondary);
  margin-left: 4px;
  margin-top: 16px;
}

.plan-features {
  text-align: left;
  margin: 30px 0;
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 16px;
}

.feature-item i {
  color: #4CAF50;
  font-size: 20px;
  flex-shrink: 0;
}

.subscription-note {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

.subscription-note p {
  margin: 4px 0;
}

/* ========== 三档会员套餐卡片 ========== */
.membership-plans {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.membership-plan-card {
  position: relative;
  flex: 1 1 140px;
  max-width: 160px;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.membership-plan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.plan-free   { border-color: #bdbdbd; }
.plan-silver { border-color: #78909C; box-shadow: 0 4px 14px rgba(120,144,156,.18); }
.plan-gold   { border-color: #FFC107; box-shadow: 0 4px 14px rgba(255,193,7,.22); }

.plan-badge-top {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #78909C;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-header {
  text-align: center;
}

.plan-header .plan-badge {
  font-size: 26px;
  display: block;
  margin-bottom: 4px;
}

.plan-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-price-row {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.plan-price-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-color);
}

.plan-price-unit {
  font-size: 11px;
  color: var(--text-secondary);
}

.plan-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
}

.plan-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 3px 0;
}

.plan-feature-list li i.fa-check { color: #4CAF50; flex-shrink: 0; margin-top: 2px; }
.plan-feature-list li i.fa-times { color: #ccc; flex-shrink: 0; margin-top: 2px; }
.plan-feature-list .plan-disabled { opacity: 0.5; text-decoration: line-through; }

.plan-current-badge {
  text-align: center;
  font-size: 12px;
  color: #9E9E9E;
  font-style: italic;
  margin-top: 4px;
}

.plan-subscribe-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.2s, transform 0.1s;
}

.plan-subscribe-btn:active { transform: scale(.97); }

.btn-silver {
  background: linear-gradient(135deg, #78909C, #546E7A);
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, #FFC107, #FF8C00);
  color: #fff;
}

/* ========== Footer 页脚 ========== */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 20px;
  margin-top: 60px;
  text-align: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.footer-content a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-content a:hover {
  color: var(--primary-color);
}

.footer-divider {
  color: var(--border-color);
}

/* Footer响应式 */
@media (max-width: 768px) {
  .site-footer {
    padding: 16px;
    margin-top: 40px;
  }
  
  .footer-content {
    font-size: 12px;
    gap: 8px;
  }
}

/* ========== 卡特尔16PF 人格因素测验样式 ========== */
.pf16-summary-card {
  background: linear-gradient(135deg, #1a237e 0%, #4a148c 100%);
  padding: 28px;
  border-radius: var(--radius);
  color: white;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.pf16-summary-card h3,
.pf16-summary-card h4 {
  color: white;
  margin: 0 0 16px 0;
}

.pf16-factors-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.pf16-factor-mini {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.pf16-factor-mini.color-high { background: rgba(76, 175, 80, 0.35); }
.pf16-factor-mini.color-low  { background: rgba(244, 67, 54, 0.30); }
.pf16-factor-mini.color-mid  { background: rgba(255,255,255,0.10); }

.pf16-factor-mini .factor-label {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.pf16-factor-mini .factor-bar-wrap {
  height: 5px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  margin-bottom: 4px;
}

.pf16-factor-mini .factor-bar-fill {
  height: 100%;
  background: rgba(255,255,255,0.8);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.pf16-factor-mini .factor-score {
  font-size: 15px;
  font-weight: 700;
}

.pf16-secondary,
.pf16-health {
  margin-top: 20px;
}

.pf16-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.sec-item {
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
}

.sec-item.color-high { background: rgba(76, 175, 80, 0.30); }
.sec-item.color-low  { background: rgba(244, 67, 54, 0.25); }
.sec-item.color-mid  { background: rgba(255,255,255,0.10); }

.sec-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.sec-value {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sec-desc {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.4;
}

/* 详细卡片 */
.pf16-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.pf16-detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.pf16-detail-card.color-high {
  border-left: 4px solid #4caf50;
}

.pf16-detail-card.color-low {
  border-left: 4px solid #f44336;
}

.pf16-detail-card.color-mid {
  border-left: 4px solid var(--primary);
}

.pf16-detail-card .detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.pf16-detail-card .detail-header h4 {
  margin: 0;
  font-size: 15px;
}

.pf16-detail-card .detail-scores {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-level-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-light, rgba(102,126,234,0.15));
  color: var(--primary);
  margin-bottom: 10px;
}

.detail-bar {
  margin: 10px 0;
}

.bar-track {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.bar-fill-pf16 {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-secondary);
}

.detail-character {
  font-size: 13px;
  color: var(--text-primary);
  margin: 8px 0;
  line-height: 1.5;
}

.detail-poles {
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pole {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.low-pole strong { color: #f44336; }
.high-pole strong { color: #4caf50; }

/* 响应式 */
@media (max-width: 768px) {
  .pf16-factors-overview {
    grid-template-columns: repeat(3, 1fr);
  }

  .pf16-secondary-grid {
    grid-template-columns: 1fr;
  }

  .pf16-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pf16-factors-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== 锚点卡 Anchor Cards ========== */
.anchor-cards-page {
  min-height: calc(100vh - var(--nav-height));
  background: transparent;
  padding-bottom: 40px;
}

/* 页头 */
.anchor-page-header {
  position: relative;
  overflow: hidden;
  padding: 48px 24px 40px;
  background: linear-gradient(135deg, #1e1038 0%, #2a1545 40%, #1a2a50 100%);
  text-align: center;
}

.anchor-header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(100, 160, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 100, 160, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, rgba(120, 80, 255, 0.10) 0%, transparent 50%);
  pointer-events: none;
}

.anchor-header-content {
  position: relative;
  z-index: 1;
}

.anchor-page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.anchor-page-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  letter-spacing: 1.5px;
}

/* 筛选栏 */
.anchor-filter-bar {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: var(--nav-height);
  z-index: 10;
}

.anchor-filter-bar::-webkit-scrollbar {
  display: none;
}

.anchor-filter-chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.anchor-filter-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(200, 75, 110, 0.05);
}

.anchor-filter-chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(200, 75, 110, 0.3);
}

/* 卡片网格 */
.anchor-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 20px 16px;
}

/* 单张 anchor card */
.anchor-card {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.8);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
}

.anchor-card:hover,
.anchor-card:active {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(200, 75, 110, 0.2);
}

/* 卡片图片区 */
.anchor-card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #e0e8ff 0%, #f0e8ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.anchor-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.anchor-card-category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 卡片文字区 */
.anchor-card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.anchor-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.anchor-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

/* 卡片底部操作 */
.anchor-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 14px 12px;
}

.anchor-card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.anchor-card-action-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

/* 空状态 */
.anchor-cards-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 16px;
}

.anchor-cards-empty i {
  font-size: 52px;
  color: var(--border-color);
}

.anchor-cards-empty p {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.anchor-cards-empty span {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

/* 翻转卡片 */
.anchor-card.flip-card {
  perspective: 1200px; /* depth for 3D flip; 1000-1500px gives a natural card-turn feel */
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.anchor-card.flip-card:hover,
.anchor-card.flip-card:active {
  transform: none;
  box-shadow: none;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  /* ease-in-out variant: fast start, slow middle, fast end for a satisfying card-flip feel */
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.anchor-card.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-front {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.flip-card-front:hover {
  box-shadow: var(--shadow-lg);
}

.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #1a1a2e 0%, #0f3460 100%);
  transform: rotateY(180deg);
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  box-sizing: border-box;
}

.flip-back-question {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.flip-back-steps {
  margin: 0;
  padding-left: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flip-back-steps li {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.flip-back-insight {
  font-size: 11px;
  color: rgba(255, 220, 100, 0.9);
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-style: italic;
}

/* 响应式：大屏切到3列 */
@media (min-width: 600px) {
  .anchor-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .anchor-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 24px 24px;
  }

  .anchor-page-header {
    padding: 64px 40px 56px;
  }

  .anchor-page-title {
    font-size: 42px;
  }
}

/* ========== Anchor Cards Redesign ========== */

/* Deck 列表网格容器 */
.anchor-deck-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* 分区块 */
.adeck-section {
  margin-bottom: 8px;
}

/* 分区标题 */
.adeck-section-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 4px 10px;
  border-bottom: 1.5px solid rgba(0,0,0,0.08);
  margin-bottom: 12px;
}
.adeck-section-label-cn {
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}
.adeck-section-label-en {
  font-size: 9px;
  font-weight: 700;
  color: #aaa;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* 分区内的 2 列卡片网格 */
.adeck-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Deck list redesign — product card style */
.adeck-card {
  background: #F7F4EF;
  border-radius: 20px;
  padding: 14px 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.08);
  transition: transform 0.18s, box-shadow 0.18s;
  overflow: hidden;
}
.adeck-card:active { transform: scale(0.97); box-shadow: 0 1px 6px rgba(0,0,0,0.1); }

.adeck-cat {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.adeck-title {
  font-size: 19px;
  font-weight: 900;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.15;
}

.adeck-fan {
  position: relative;
  width: 100%;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adeck-fan-card {
  position: absolute;
  width: 68px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  background: white;
  transform-origin: center center;
}
.adeck-fan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adeck-fan-plain { opacity: 0.75; }

.adeck-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 5px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  width: 100%;
  box-sizing: border-box;
}

/* 旧 deck card 样式保留（未使用） */
.anchor-deck-card {
  border-radius: 20px;
  padding: 24px 18px;
  cursor: pointer;
  color: white;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.anchor-deck-card:active {
  transform: scale(0.97);
}

.anchor-deck-icon { font-size: 36px; margin-bottom: 8px; }
.anchor-deck-title { font-size: 18px; font-weight: 700; }
.anchor-deck-subtitle { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.anchor-deck-count { font-size: 11px; opacity: 0.7; margin-top: 8px; }
.anchor-deck-arrow {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 18px;
  opacity: 0.8;
}

/* 卡片列表页头 */
.anchor-card-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 8px;
  position: sticky;
  top: 0;
  background: var(--bg-color);
  z-index: 10;
}

.anchor-back-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}
.anchor-back-btn:hover { background: var(--bg-tertiary); }

.anchor-card-list-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 迷你卡片网格 */
.anchor-mini-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 12px 16px 40px;
  max-width: 600px;
  margin: 0 auto;
}
/* 国学套组分区模式 */
.anchor-mini-cards-grid.xs-grouped {
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-template-columns: unset;
}

/* 来源分区 */
.xs-source-section {
  padding: 0 16px 20px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.xs-source-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
  border-bottom: 1.5px solid #e8e2d8;
  margin-bottom: 12px;
}
.xs-source-header-name {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.3px;
}
.xs-source-header-sub {
  font-size: 11px;
  color: #aaa;
  flex: 1;
}
.xs-source-header-count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
}
.xs-source-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* source tag 行 */
.anchor-mini-source-row {
  margin-bottom: 5px;
}

.anchor-mini-card {
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 3/4;
  display: flex;
  flex-direction: column;
  position: relative;
}
.anchor-mini-card:active { transform: scale(0.97); }

.anchor-mini-card-header {
  flex: 0 0 58%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 10px 8px;
  position: relative;
  overflow: hidden;
}
.anchor-mini-card-title {
  color: white;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
.anchor-mini-card-avatar {
  display: none;
}
.anchor-mini-card-body {
  background: #F7F4EF;
  padding: 8px 10px 10px;
  flex: 1;
  overflow: hidden;
}
.anchor-mini-card-label {
  font-size: 10px;
  font-weight: 600;
  color: #6B6B6B;
  margin-bottom: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.anchor-mini-card-text {
  font-size: 11px;
  color: #5A5A5A;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 全屏详情遮罩 */
.anchor-card-detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 56px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-content: flex-start;
}

/* Background blur on pseudo-element so it doesn't break preserve-3d on children */
.anchor-card-detail-overlay::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: -1;
}

.anchor-card-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: background 0.2s;
}
.anchor-card-close-btn:hover { background: rgba(255,255,255,0.35); }

/* 翻转容器 */
/* ── 翻转卡尺寸由 flip-card / flip-inner 统一控制 ─────────────────────────
   规则：
   1. 宽度 → .anchor-flip-card max-width
   2. 高度 → .anchor-flip-inner height（唯一来源，不要在 front/back-design 再写 height）
   3. 正面 / 背面 → width:100%; height:100%; 各自继承，永远对齐
   ───────────────────────────────────────────────────────────────────────── */
.anchor-flip-card {
  width: 100%;
  max-width: 380px;
  flex-shrink: 0;
  perspective: 1200px;
  cursor: pointer;
  animation: anchorCardIn 0.3s ease-out;
  /* Ensure 3D context is not flattened by a stacking-context ancestor */
  position: relative;
  z-index: 0;
}

.anchor-flip-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 380 / 560; /* 比例锁定，高度随宽度自动计算 */
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.anchor-flip-inner.flipped {
  transform: rotateY(180deg);
}

.anchor-flip-front,
.anchor-flip-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.anchor-flip-back {
  transform: rotateY(180deg);
}

.anchor-flip-hint {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
  display: block;
}

@keyframes anchorCardIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* 桌面端放大：只改 flip-card 宽度，比例由 aspect-ratio 自动维持 */
@media (min-width: 640px) {
  .anchor-flip-card { max-width: 460px; }
  .anchor-card-detail-overlay {
    justify-content: center;
    padding: 40px 20px;
  }
}
@media (min-width: 900px) {
  .anchor-flip-card { max-width: 520px; }
}

/* 卡片正面设计：宽高全部从父容器继承 */
.anchor-card-front-design {
  background: #F7F4EF;
  border-radius: 20px;
  overflow: hidden;
  width: 100%;
  height: 100%;            /* 继承 flip-inner 高度 */
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.anchor-card-header {
  padding: 24px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.anchor-card-main-title {
  color: white;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  flex: 1;
}

.anchor-card-avatar-circle {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  margin-left: 16px;
}

.anchor-card-header-desc {
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  margin-top: 8px;
  line-height: 1.4;
}

.anchor-card-core {
  padding: 18px 20px;
  background: #F7F4EF;
  border-bottom: 1px solid #E8E3DC;
}

.anchor-card-core-label {
  font-size: 13px;
  font-weight: 700;
  color: #2D5A27;
  margin-bottom: 8px;
}

.anchor-card-core-text {
  font-size: 14px;
  color: #3D3D3D;
  line-height: 1.7;
}

.anchor-card-compare {
  display: flex;
  padding: 16px 20px;
  gap: 12px;
  background: #F7F4EF;
  border-bottom: 1px solid #E8E3DC;
}

.anchor-card-compare-col {
  flex: 1;
  border-right: 1px solid #E0DAD2;
}
.anchor-card-compare-col:last-child { border-right: none; }

.anchor-compare-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}
.anchor-compare-badge.left { background: #D4874A; }
.anchor-compare-badge.right { background: #4A8C6A; }

.anchor-compare-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}

.anchor-card-compare-text {
  font-size: 12px;
  color: #5A5A5A;
  line-height: 1.6;
}

.anchor-card-footer-section {
  background: #EDEAD4;
  padding: 14px 20px 28px;
  text-align: left;
  border-left: 4px solid rgba(45,90,39,0.35);
  margin: 0 20px 20px;
  border-radius: 0 8px 8px 0;
}

.anchor-card-footer-title {
  font-size: 12px;
  font-weight: 700;
  color: #4A4A4A;
  margin-bottom: 6px;
}

.anchor-card-footer-text {
  font-size: 12px;
  color: #6A6A6A;
  font-style: italic;
  line-height: 1.5;
}

.anchor-card-footer-avatar {
  display: none;
}

/* 水印：伪元素，完全不占布局空间 */
.anchor-card-back-watermark {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  user-select: none;
}

.anchor-card-watermark {
  display: none;
}

/* ========== Multi-Layout Card System ========== */

/* Shared header */
.ac-header {
  padding: 22px 20px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ac-header-text { flex: 1; min-width: 0; }
.ac-main-title {
  color: white;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}
.ac-subtitle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.ac-subtitle {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
}
.ac-source-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.anchor-mini-source-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.ac-header-desc {
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.45;
}
.ac-avatar {
  width: 84px;
  height: 84px;
  background: white;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  margin-left: 8px;
}
.ac-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Shared footer — always at bottom */
.ac-footer {
  background: #EDEAD4;
  padding: 13px 18px 18px;
  border-left: 4px solid rgba(0,0,0,0.18);
  margin: 0 18px 18px;
  border-radius: 0 8px 8px 0;
  margin-top: auto;
  flex-shrink: 0;
}
.ac-footer-label {
  font-size: 11px;
  font-weight: 700;
  color: #4A4A4A;
  margin-bottom: 4px;
}
.ac-footer-text {
  font-size: 12px;
  color: #6A6A6A;
  font-style: italic;
  line-height: 1.5;
}

/* Shared core question (non-compare layouts) */
.ac-core-q {
  font-size: 14px;
  font-weight: 600;
  color: #2a2a2a;
  padding: 16px 20px 8px;
  line-height: 1.5;
}

/* --- Layout: compare --- */
.ac-core {
  padding: 16px 20px;
  border-bottom: 1px solid #E8E3DC;
  flex-shrink: 0;
}
.ac-core-label {
  font-size: 12px;
  font-weight: 700;
  color: #3D6B55;
  margin-bottom: 6px;
}
.ac-core-text {
  font-size: 13px;
  color: #3A3A3A;
  line-height: 1.5;
}
.ac-compare {
  display: flex;
  padding: 14px 16px;
  gap: 0;
  border-bottom: 1px solid #E8E3DC;
  flex: 1;
}
.ac-compare-col {
  flex: 1;
  min-width: 0;
}
.ac-divider {
  width: 1px;
  background: #DDD8D0;
  margin: 0 10px;
  flex-shrink: 0;
}
.ac-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.ac-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ac-badge-left  { background: #E8905533; color: #B05A20; }
.ac-badge-left::before  { background: #C4622D; }
.ac-badge-right { background: #3D6B5533; color: #2A5040; }
.ac-badge-right::before { background: #3D6B55; }
.ac-compare-text {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}

/* --- Layout: venn --- */
.ac-venn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 16px;
  gap: 0;
  flex: 1;
}
.ac-venn-circle {
  flex: 1;
  border: 2px solid;
  border-radius: 50%;
  width: 110px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  box-sizing: border-box;
  text-align: center;
  opacity: 0.9;
}
.ac-venn-left  { margin-right: -22px; z-index: 1; background: rgba(255,255,255,0.85); }
.ac-venn-right { margin-left:  -22px; z-index: 1; background: rgba(255,255,255,0.85); }
.ac-venn-label {
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0.8;
}
.ac-venn-item {
  font-size: 10px;
  color: #444;
  line-height: 1.3;
}
.ac-venn-mid {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ac-venn-mid-text {
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
}

/* --- Layout: chain --- */
.ac-chain {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 16px 8px;
  gap: 4px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ac-chain-insight {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 10px;
  justify-content: center;
}

.ac-chain-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
}

.ac-chain-insight-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.ac-chain-insight-text {
  font-size: 12px;
  color: #444;
  line-height: 1.5;
}
.ac-chain-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ac-chain-node {
  padding: 8px 12px;
  border-radius: 22px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.ac-chain-cut {
  box-shadow: 0 0 0 3px rgba(0,0,0,0.12);
}
.ac-chain-cut-label {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.ac-chain-arrow {
  font-size: 18px;
  color: #aaa;
  padding-top: 8px;
  flex-shrink: 0;
}

/* --- Layout: breathe --- */
.ac-breath {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px 8px;
  flex-shrink: 0;
}
.ac-breath-step { display: flex; align-items: center; }
.ac-breath-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
}
.ac-breath-label {
  font-size: 11px;
  font-weight: 700;
  color: #333;
}
.ac-breath-dur {
  font-size: 15px;
  font-weight: 900;
  margin-top: 2px;
}
.ac-breath-dot {
  font-size: 18px;
  color: #ccc;
  padding: 0 2px;
}
.ac-breath-note {
  font-size: 12px;
  text-align: center;
  color: #777;
  padding: 0 20px 4px;
  font-style: italic;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ac-body-signs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px 20px 8px;
  flex-shrink: 0;
}
.ac-body-sign {
  background: white;
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ac-body-sign-icon { font-size: 16px; flex-shrink: 0; }
.ac-body-sign-text { font-size: 12px; color: #444; font-weight: 500; }

/* --- Layout: checklist --- */
.ac-checklist {
  padding: 8px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: center;
}
.ac-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ac-check-badge {
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.ac-check-text {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}

/* ===== Quote layout — 儒家经典名言卡 ===== */
.aq-quote-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  height: 100%;
}
.aq-header {
  padding: 18px 20px 16px;
  color: white;
  flex-shrink: 0;
}
.aq-avatar {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.aq-serial {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.75;
}
.aq-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}
.aq-source {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* ── Pullquote：带左侧彩色竖条的原典文本 ── */
.aq-pullquote {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FDF8F0;
  padding: 12px 16px;
  border-bottom: 1px solid #EEE8DC;
  flex-shrink: 0;
}
.aq-pullquote-bar {
  width: 3px;
  min-width: 3px;
  border-radius: 2px;
  align-self: stretch;
}
.aq-pullquote-text {
  font-size: 13px;
  font-weight: 600;
  color: #3B2F1E;
  line-height: 1.7;
  font-style: italic;
}

/* ── 核心洞见 chip 行 ── */
.aq-insight-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #FFFCF6;
  padding: 9px 16px;
  border-bottom: 1px solid #EEE8DC;
  flex-shrink: 0;
}
.aq-insight-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  margin-top: 1px;
  flex-shrink: 0;
  opacity: 0.85;
}
.aq-insight-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #2C2218;
  line-height: 1.5;
}

/* ── 阐释正文 ── */
.aq-explain-block {
  background: #fff;
  padding: 10px 16px;
  flex: 1;
  border-bottom: 1px solid #F0EDE8;
  overflow: hidden;
}
.aq-explain-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #9B8060;
  margin-bottom: 6px;
}
.aq-explain-text {
  font-size: 11.5px;
  color: #4A4035;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 今日实践 行动条 ── */
.aq-apply-block {
  background: #FAFAF7;
  padding: 10px 16px 14px;
  flex-shrink: 0;
}
.aq-apply-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 5px;
}
.aq-apply-text {
  font-size: 11.5px;
  color: #3B2F1E;
  line-height: 1.6;
  font-weight: 500;
}

/* 卡片背面设计：宽高全部从父容器继承 */
.anchor-card-back-design {
  border-radius: 20px;
  padding: 32px 28px;
  color: white;
  width: 100%;
  height: 100%;            /* 继承 flip-inner 高度 */
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 视图切换容器 */
.anchor-view {
  width: 100%;
}

/* 视图2：套组内卡片列表页头 */
.anchor-deck-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 8px;
  position: sticky;
  top: 0;
  background: var(--bg-color, #fff);
  z-index: 10;
  max-width: 600px;
  margin: 0 auto;
}

.anchor-deck-header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0;
}

/* ==========================================
   每日情绪打卡 Widget
   ========================================== */

.mood-widget {
  background: linear-gradient(135deg, rgba(255,245,248,0.95) 0%, rgba(255,235,245,0.90) 100%);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(200, 75, 110, 0.12);
}

.mood-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.mood-widget-header i {
  color: var(--primary-color);
  font-size: 16px;
}

.mood-widget-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.mood-date {
  font-size: 12px;
  color: #999;
}

.mood-login-prompt {
  text-align: center;
  padding: 8px 0;
  color: #aaa;
  font-size: 13px;
}

.mood-login-prompt a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.mood-picker {
  display: none;
}

.mood-question {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  text-align: center;
}

.mood-emojis {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.mood-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(200, 75, 110, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.mood-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(200, 75, 110, 0.20);
  background: white;
}

.mood-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mood-emoji {
  font-size: 22px;
  line-height: 1;
}

.mood-icon-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  display: block;
}

.mood-label {
  font-size: 10px;
  color: #888;
  white-space: nowrap;
}

.mood-done {
  display: none;
  text-align: center;
}

.mood-done-emoji {
  font-size: 40px;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.mood-done-text {
  font-size: 13px;
  color: #555;
  margin-bottom: 2px;
}

.mood-streak {
  font-size: 11px;
  color: #ff6b9d;
  font-weight: 500;
  margin-bottom: 10px;
}

.mood-week-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mood-strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.strip-date {
  font-size: 9px;
  color: #bbb;
}

/* ==========================================
   呼吸练习 Modal
   ========================================== */

.breathing-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.breathing-panel {
  background: linear-gradient(160deg, #0f2027, #203a43, #2c5364);
  border-radius: 24px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  color: white;
  position: relative;
  text-align: center;
}

.breathing-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 18px;
}

.breathing-tech-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.tech-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tech-btn.active,
.tech-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  color: white;
}

.breathing-circle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  margin-bottom: 16px;
}

.breathing-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, #7ec8e3 0%, #0099cc 60%, #006699 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(0, 180, 255, 0.4);
  transform-origin: center;
}

.breathing-phase-text {
  font-size: 15px;
  font-weight: 700;
  color: white;
}

.breathing-count {
  font-size: 28px;
  font-weight: 700;
  color: white;
  min-width: 40px;
}

.breathing-instruction {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
  min-height: 20px;
}

.breathing-start-btn {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: white;
  border: none;
  padding: 12px 36px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}

.breathing-start-btn:hover {
  opacity: 0.88;
}

/* ==========================================
   用户中心 — 我的记录
   ========================================== */

.my-records-section {
  background: white;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.my-records-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.my-records-title i {
  color: #ff6b9d;
}

.records-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 14px;
}

.rec-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.18s;
  font-family: inherit;
}

.rec-tab.active {
  color: #ff6b9d;
  font-weight: 600;
  border-bottom-color: #ff6b9d;
}

.test-history-list,
.mood-history-list {
  max-height: 260px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.history-item:last-child {
  border-bottom: none;
}

.history-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd6e7, #ffb3d1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  color: #e05585;
}

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

.history-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}

.history-date {
  font-size: 11px;
  color: #bbb;
}

.history-summary {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.history-empty {
  text-align: center;
  padding: 24px 0;
  color: #ccc;
  font-size: 13px;
  line-height: 1.8;
}

.retest-banner {
  background: linear-gradient(135deg, #fff5f7, #ffe8ec);
  border-left: 3px solid var(--primary-color);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #c0392b;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.retest-banner i { color: var(--primary-color); }

/* ===== 练习 Tab 子导航 ===== */
.practice-subnav {
    display: flex;
    background: var(--card-bg, #fff);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    position: sticky;
    top: 0;
    z-index: 10;
}
.prac-nav-btn {
    flex: 1;
    padding: 12px 8px 10px;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: color .15s, border-color .15s;
}
.prac-nav-btn i { font-size: 15px; }
.prac-nav-btn.active {
    color: var(--primary-color, #B5394F);
    border-bottom-color: var(--primary-color, #B5394F);
}
.practice-section { min-height: 60vh; }

/* ===== 情绪工具包 ===== */
.tk-ex-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg, #fff);
    border-radius: var(--radius, 16px);
    padding: 18px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}
.tk-ex-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.tk-ex-icon { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.tk-ex-info { flex: 1; min-width: 0; }
.tk-ex-info h4 { font-size: 15px; font-weight: 700; color: var(--text-primary, #222); margin: 0 0 4px; }
.tk-ex-info p { font-size: 13px; color: var(--text-secondary, #666); margin: 0 0 4px; }
.tk-ex-meta { font-size: 11px; color: var(--text-tertiary, #999); }
.tk-ex-arr { color: var(--text-tertiary, #bbb); font-size: 13px; flex-shrink: 0; }
.toolkit-ex-view { padding-bottom: 40px; }
.tk-back-btn { background: none; border: none; color: var(--text-secondary, #666); font-size: 14px; cursor: pointer; padding: 4px 0 20px; display: flex; align-items: center; gap: 6px; }
.tk-ex-title { font-size: 22px; font-weight: 800; color: var(--text-primary, #222); margin: 0 0 8px; }
.tk-ex-desc { font-size: 14px; color: var(--text-secondary, #666); margin: 0 0 22px; line-height: 1.7; }
.tk-step-card { background: var(--card-bg, #fff); border-radius: var(--radius, 16px); padding: 28px; margin-bottom: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); min-height: 150px; }
.tk-big-num { font-size: 80px; font-weight: 900; color: rgba(39,174,96,0.15); line-height: 1; }
.tk-step-sense { font-size: 17px; font-weight: 700; color: #27AE60; margin-bottom: 12px; }
.tk-step-prompt { font-size: 16px; font-weight: 600; color: var(--text-primary, #222); margin: 0 0 8px; line-height: 1.6; }
.tk-step-example { font-size: 13px; color: var(--text-tertiary, #999); margin: 0; font-style: italic; line-height: 1.6; }
.tk-progress-bar { height: 4px; background: rgba(0,0,0,0.08); border-radius: 2px; margin-bottom: 20px; overflow: hidden; }
.tk-progress-fill { height: 4px; background: var(--primary-color, #B5394F); border-radius: 2px; transition: width 0.4s ease; }
.tk-complete-msg { text-align: center; padding: 32px 0; }
.tk-complete-icon { font-size: 52px; display: block; margin-bottom: 12px; }
.tk-complete-msg h4 { font-size: 20px; font-weight: 800; color: var(--text-primary, #222); margin: 0 0 10px; }
.tk-complete-msg p { font-size: 14px; color: var(--text-secondary, #666); line-height: 1.8; margin: 0; }
.tk-action-btn { width: 100%; margin-top: 4px; }
.tk-affirmation-card { background: var(--card-bg, #fff); border-radius: var(--radius, 16px); padding: 30px 28px; margin-bottom: 16px; min-height: 170px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-top: 4px solid #F5A623; }
.tk-quote-mark { font-size: 56px; color: rgba(245,166,35,0.25); font-family: Georgia, serif; line-height: 0.5; display: block; margin-bottom: 14px; }
.tk-affirmation-text { font-size: 18px; font-weight: 700; color: var(--text-primary, #222); line-height: 1.7; margin: 0 0 12px; }
.tk-affirmation-idx { font-size: 12px; color: var(--text-tertiary, #999); }
.tk-affirmation-nav { display: flex; gap: 10px; margin-bottom: 12px; }
.tk-affirmation-nav button { flex: 1; }
.tk-emotion-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.tk-emotion-chip { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; border: 2px solid rgba(0,0,0,0.1); font-size: 13px; cursor: pointer; color: var(--text-primary, #222); transition: all 0.15s; background: transparent; }
.tk-em-name { font-weight: 700; font-size: 14px; }
.tk-em-desc { font-size: 11px; color: var(--text-tertiary, #999); margin-top: 2px; }
.tk-emotion-chip:hover { background: rgba(0,0,0,0.03); }
.tk-emotion-chip.selected { background: rgba(181,57,79,0.07); border-color: var(--primary-color, #B5394F); }
.tk-emotion-chip.selected .tk-em-name { color: var(--primary-color, #B5394F); }
.tk-emotion-resp-text { font-size: 15px; color: var(--text-primary, #222); line-height: 1.8; }
.tk-scan-text { font-size: 16px; color: var(--text-primary, #222); line-height: 1.9; margin: 0; }
.tk-step-badge { display: inline-block; font-size: 11px; font-weight: 700; color: var(--primary-color, #B5394F); letter-spacing: 1px; margin-bottom: 16px; }
.tk-pme-part { font-size: 42px; font-weight: 900; color: rgba(26,188,156,0.3); margin-bottom: 14px; }
.tk-pme-action { font-size: 16px; line-height: 1.8; margin: 0; }
.tk-pme-tense { color: var(--text-primary, #222); }
.tk-pme-relax { color: #1ABC9C; font-weight: 600; }

