/**
 * 统一主题样式
 */

/* 全局变量 */
:root {
  --primary-color: #667eea;
  --primary-dark: #764ba2;
  --secondary-color: #f093fb;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-radius: 12px;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Sticky Footer布局 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.theme-page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 渐变背景 */
.theme-gradient-primary {
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.theme-gradient-secondary {
  background: linear-gradient(to bottom right, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* 卡片样式 */
.theme-card {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: none;
}

.theme-card-header {
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  padding: 1rem 1.25rem;
}

.theme-card-body {
  padding: 1.25rem;
}

/* 按钮样式 */
.theme-btn {
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.theme-btn-primary {
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.theme-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  color: #fff;
}

.theme-btn-secondary {
  background: #6c757d;
  color: #fff;
}

.theme-btn-secondary:hover {
  background: #5a6268;
  color: #fff;
}

.theme-btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.theme-btn-outline:hover {
  background: var(--primary-color);
  color: #fff;
}

/* 输入框样式 */
.theme-input {
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.theme-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 列表项样式 */
.theme-list-item {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.3s ease;
}

.theme-list-item:hover {
  background: #f8fafc;
}

.theme-list-item:last-child {
  border-bottom: none;
}

/* 图标框 */
.theme-icon-box {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: linear-gradient(to bottom right, var(--primary-color) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: #fff;
  font-size: 1.5rem;
}

/* 标签样式 */
.theme-badge {
  display: inline-block;
  padding: 0.25em 0.75em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* 进度条 */
.theme-progress {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.theme-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-dark) 100%);
  transition: width 0.5s ease;
}

/* 表格样式 */
.theme-table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.theme-table th,
.theme-table td {
  padding: 0.75rem;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.theme-table th {
  background: #f8fafc;
  font-weight: 600;
}

.theme-table tr:hover {
  background: #f8fafc;
}

/* 导航链接 */
.theme-nav-link {
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.theme-nav-link:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .theme-card-body {
    padding: 1rem;
  }
  
  .theme-icon-box {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-fade-in {
  animation: fadeIn 0.3s ease;
}

/* 底部样式 */
.theme-footer {
  background: #1a1a2e;
  padding: 1rem 0;
  text-align: center;
}

.theme-footer p {
  margin: 0.5rem 0;
}

.theme-footer a {
  color: #64748b;
  transition: color 0.3s ease;
}

.theme-footer a:hover {
  color: #667eea;
}

/* 八字排盘样式 */
.bazi-box {
  text-align: center;
  padding: 15px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  margin: 0 5px;
  min-width: 100px;
}

.bazi-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.bazi-value {
  font-size: 24px;
  font-weight: bold;
}

.card-header.bg-purple {
  background: linear-gradient(135deg, #6f42c1 0%, #5a3d8c 100%);
}

/* 步骤编号 */
.theme-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

/* FAQ常见问题样式 */
.theme-faq-item {
  padding-left: 0.5rem;
  border-left: 3px solid var(--primary-color);
  transition: all 0.3s ease;
}

.theme-faq-item:hover {
  border-left-width: 5px;
  background: rgba(102, 126, 234, 0.05);
}

.theme-faq-item h6 {
  margin-bottom: 0.75rem;
}

/* 搜索结果样式 */
.theme-search-results {
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--border-radius);
}

/* 内容详情样式 - 图片最大宽度100% */
.detail-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 1rem 0;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* 搜索相关样式 */
.search-highlight {
  background-color: rgba(102, 126, 234, 0.2);
  padding: 0 2px;
  border-radius: 2px;
}

.theme-search-box {
  position: relative;
}

.theme-search-box .form-control {
  padding-right: 40px;
}

.theme-search-box .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* 分页样式增强 */
.pagination {
  margin: 0;
}

.pagination .page-link {
  color: var(--primary-color);
  border-color: #e2e8f0;
}

.pagination .page-link:hover {
  color: var(--primary-dark);
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
  color: #a0aec0;
}

/* 其他实用工具类 */
.font-bold {
  font-weight: 600;
}

.text-primary {
  color: var(--primary-color) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 0.25rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.ml-2 {
  margin-left: 0.5rem !important;
}

.ml-4 {
  margin-left: 1.5rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.me-3 {
  margin-right: 1rem !important;
}

.gap-2 {
  gap: 0.5rem;
}

.flex-fill {
  flex: 1 1 auto;
}

.flex-wrap {
  flex-wrap: wrap;
}

.d-flex {
  display: flex !important;
}

.d-none {
  display: none !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.text-center {
  text-align: center !important;
}

.text-decoration-none {
  text-decoration: none !important;
}

.h-100 {
  height: 100%;
}

.w-100 {
  width: 100%;
}

.border-0 {
  border: 0 !important;
}

.bg-transparent {
  background-color: transparent !important;
}

.bg-light {
  background-color: #f8fafc !important;
}

.rounded {
  border-radius: 0.25rem !important;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-text {
  font-size: 0.875rem;
  line-height: 1.5;
}

.card-footer {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.col-md-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-md-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

.col-lg-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-lg-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.border-bottom {
  border-bottom: 1px solid #e2e8f0 !important;
}

.mx-1 {
  margin-left: 0.25rem !important;
  margin-right: 0.25rem !important;
}

.mx-2 {
  margin-left: 0.5rem !important;
  margin-right: 0.5rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

@media (max-width: 768px) {
  .col-md-4,
  .col-md-6,
  .col-md-8,
  .col-lg-4,
  .col-lg-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ==================== 性格测试模块样式 ==================== */
/* 渐变背景 */
.quiz-gradient-primary {
  background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
}

.quiz-gradient-secondary {
  background: linear-gradient(to bottom right, #667eea 0%, #764ba2 100%);
}

/* 卡片样式 */
.quiz-card {
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: none;
}

.quiz-card-header {
  border-radius: 12px 12px 0 0 !important;
  padding: 1.25rem 1.5rem;
}

.quiz-card-body {
  padding: 1.5rem;
}

/* 选项样式 */
.quiz-option-item {
  display: block;
  width: 100%;
  padding: 15px 20px;
  margin-bottom: 12px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 1rem;
  line-height: 1.6;
}

.quiz-option-item:hover {
  border-color: #667eea;
  background: #f8f9fa;
  transform: translateX(5px);
}

.quiz-option-item.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #f0f4ff 0%, #e6ebff 100%);
}

.quiz-option-item.selected::before {
  content: '✓';
  color: #667eea;
  font-weight: bold;
  margin-right: 10px;
}

.quiz-option-label {
  font-weight: 600;
  color: #667eea;
  margin-right: 8px;
}

/* 进度条 */
.quiz-progress {
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* 结果页面 */
.quiz-result-icon {
  font-size: 64px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.quiz-result-content {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  line-height: 1.8;
}

.quiz-advice-box {
  background: #fff3e0;
  border-radius: 12px;
  border-left: 4px solid #FF9800;
  padding: 1.5rem;
  line-height: 1.8;
}

/* 标签样式 */
.quiz-badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  background: #667eea;
}

/* 按钮样式 */
.quiz-btn {
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.quiz-btn-primary {
  background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
}

.quiz-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quiz-btn-secondary {
  background: #6c757d;
  border: none;
  color: #fff;
}

.quiz-btn-secondary:hover {
  background: #5a6268;
}

/* 列表项样式 */
.quiz-item-card {
  transition: all 0.3s ease;
}

.quiz-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.quiz-emoji-box {
  width: 80px;
  height: 80px;
  background: linear-gradient(to bottom right, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
}

/* 测试列表卡片样式 */
.quiz-card-container {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.quiz-card-container:hover {
  text-decoration: none;
  transform: translateY(-4px);
}

.quiz-card-container:hover .quiz-item-card {
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
}

.quiz-card-content {
  display: flex;
  align-items: flex-start;
}

.quiz-emoji-wrapper {
  flex-shrink: 0;
  margin-right: 1rem;
}

.quiz-emoji-box {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease;
}

.quiz-card-container:hover .quiz-emoji-box {
  transform: scale(1.05);
}

.quiz-info {
  flex: 1;
  min-width: 0;
}

.quiz-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-card-container:hover .quiz-title {
  color: var(--primary-color);
}

.quiz-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.quiz-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.quiz-meta-item i {
  font-size: 0.75rem;
}

.quiz-meta .hot-count {
  color: #dc3545;
  font-weight: 500;
}

/* 分类导航样式 */
.quiz-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-category-item {
  margin-bottom: 0.25rem;
}

.quiz-category-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.25s ease;
  font-weight: 500;
}

.quiz-category-link:hover {
  background: rgba(102, 126, 234, 0.08);
  color: var(--primary-color);
  padding-left: 1.25rem;
}

.quiz-category-link.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
}

.quiz-category-link i {
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

/* 页面标题区域 */
.quiz-header-card {
  position: relative;
  overflow: hidden;
}

.quiz-header-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}

.quiz-header-title {
  position: relative;
  z-index: 1;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.quiz-header-subtitle {
  position: relative;
  z-index: 1;
  opacity: 0.9;
  font-size: 0.95rem;
}

/* 进度条增强 */
.quiz-progress-wrapper {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quiz-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.quiz-progress-label {
  font-weight: 600;
  color: var(--text-muted);
}

.quiz-progress-text {
  font-weight: 600;
  color: var(--primary-color);
}

.quiz-progress {
  height: 10px;
  border-radius: 5px;
  background: #e2e8f0;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  transition: width 0.5s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 问题卡片样式 */
.quiz-question-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: none;
}

.quiz-question-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.quiz-question-number {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.quiz-question-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.6;
}

/* 选项样式 */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 1rem;
  line-height: 1.6;
}

.quiz-option-item:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
  transform: translateX(8px);
}

.quiz-option-item.selected {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #f0f4ff 0%, #e6ebff 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.quiz-option-item.selected::before {
  content: '✓';
  color: var(--primary-color);
  font-weight: bold;
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.quiz-option-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-right: 0.75rem;
  min-width: 24px;
}

/* 操作按钮区域 */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.quiz-btn-group {
  display: flex;
  gap: 0.75rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .quiz-option-item {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  .quiz-emoji-box {
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
  }
  
  .quiz-title {
    font-size: 1rem;
  }
  
  .quiz-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .quiz-header-title {
    font-size: 1.25rem;
  }
  
  .quiz-question-text {
    font-size: 1rem;
  }
  
  .quiz-actions {
    flex-direction: column;
  }
  
  .quiz-btn-group {
    width: 100%;
    justify-content: space-between;
  }
}
