/* =========================================
   common.css
   全站统一基础样式（以第4套为母版）
   ========================================= */

:root {
  /* ===== 主视觉系统：第4套基准 ===== */
  --primary: #6C8BA7;
  --primary-light: #8FAFCA;
  --primary-soft: #AFC4D6;
  --primary-dark: #4A6572;

  --accent: #7E9BB6;
  --accent-soft: #DCE8F1;

  --text-strong: #243746;
  --text-main: #2C3E50;
  --text-body: #5C6B77;
  --text-muted: #7E8B96;
  --text-light: #97A3AE;

  --bg-page: #F8F9FA;
  --bg-page-2: #F0F4F8;
  --bg-white: #FFFFFF;
  --bg-soft: rgba(255, 255, 255, 0.72);
  --bg-soft-strong: rgba(255, 255, 255, 0.84);

  --border: #E1E8ED;
  --border-soft: rgba(255, 255, 255, 0.72);
  --line-soft: rgba(108, 139, 167, 0.12);

  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #F44336;

  --radius-2xl: 32px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 8px 30px rgba(108, 139, 167, 0.08);
  --shadow-card: 0 4px 12px rgba(108, 139, 167, 0.08);
  --shadow-hover: 0 12px 28px rgba(108, 139, 167, 0.16);
  --shadow-focus: 0 0 0 3px rgba(108, 139, 167, 0.18);

  --gradient-page: linear-gradient(135deg, #F8F9FA 0%, #F0F4F8 100%);
  --gradient-page-alt: linear-gradient(160deg, #F8F9FA 0%, #F4F7FA 55%, #EEF3F7 100%);
  --gradient-card: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.74) 100%
  );
  --gradient-primary: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);

  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;

  --container-xl: 1200px;
  --container-lg: 1080px;
  --container-md: 920px;
  --container-sm: 760px;

  --transition-fast: 0.2s ease;
  --transition: 0.28s ease;
  --transition-slow: 0.4s ease;
}

/* ===== 主题覆盖变量接口 ===== */
:root[data-theme="1"] {}
:root[data-theme="2"] {}
:root[data-theme="3"] {}
:root[data-theme="4"] {}
:root[data-theme="5"] {}
:root[data-theme="6"] {}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--gradient-page);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.page-test,
body.page-result {
  background: var(--gradient-page-alt);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ===== 背景装饰 ===== */
.bg-grid,
.site-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.34) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.bg-orb,
.ambient-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(44px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
}

.orb-1,
.ambient-orb--1 {
  width: 380px;
  height: 380px;
  top: -60px;
  left: -90px;
  background: rgba(143, 175, 202, 0.42);
}

.orb-2,
.ambient-orb--2 {
  width: 320px;
  height: 320px;
  top: 180px;
  right: -60px;
  background: rgba(108, 139, 167, 0.18);
}

.orb-3,
.ambient-orb--3 {
  width: 280px;
  height: 280px;
  bottom: 40px;
  left: 55%;
  transform: translateX(-50%);
  background: rgba(74, 101, 114, 0.10);
}

/* ===== 容器 ===== */
.page-shell,
.site-shell,
.landing-shell,
.test-shell,
.result-shell {
  position: relative;
  z-index: 1;
  width: min(var(--container-lg), calc(100% - 32px));
  margin: 0 auto;
}

.page-shell--wide {
  width: min(var(--container-xl), calc(100% - 32px));
}

.page-shell--narrow {
  width: min(var(--container-sm), calc(100% - 32px));
}

.section {
  margin-top: 24px;
}

.stack-lg > * + * {
  margin-top: 28px;
}

.stack-md > * + * {
  margin-top: 20px;
}

.stack-sm > * + * {
  margin-top: 12px;
}

/* ===== 卡片系统 ===== */
.glass-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft);
}

.soft-card {
  background: var(--bg-soft-strong);
  border: 1px solid rgba(225, 232, 237, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.card-padding-xl { padding: 32px; }
.card-padding-lg { padding: 28px; }
.card-padding-md { padding: 22px; }
.card-padding-sm { padding: 16px; }

/* ===== 文字层级 ===== */
.page-title,
.hero-title,
.result-title {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.18;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.page-subtitle,
.hero-subtitle,
.result-subtitle {
  margin: 10px 0 0;
  color: var(--text-body);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.75;
}

.section-title {
  margin: 0 0 14px;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 700;
}

.card-title {
  margin: 0 0 10px;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
}

.lead {
  color: var(--text-main);
  font-size: 17px;
  line-height: 1.85;
}

.body-text,
.analysis-text,
.result-summary,
.muted-copy {
  color: var(--text-body);
  line-height: 1.8;
  font-size: 15px;
}

.muted,
.subtle,
.meta-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ===== badge / tag ===== */
.badge,
.pill,
.question-tag,
.brand-badge,
.result-code,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(108, 139, 167, 0.10);
  color: var(--primary-dark);
  border: 1px solid rgba(108, 139, 167, 0.16);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.result-code {
  background: rgba(108, 139, 167, 0.14);
}

/* ===== 按钮 ===== */
.btn,
.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 18px;
  font-weight: 600;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled,
.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary,
.primary-btn {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(108, 139, 167, 0.18);
}

.btn-primary:hover,
.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(108, 139, 167, 0.24);
}

.btn-secondary,
.secondary-btn {
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary-dark);
  border: 1px solid rgba(108, 139, 167, 0.18);
  box-shadow: var(--shadow-card);
}

.btn-secondary:hover,
.secondary-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-hover);
}

.ghost-btn {
  background: transparent;
  color: var(--primary-dark);
  border: 1px dashed rgba(108, 139, 167, 0.25);
}

.ghost-btn:hover {
  background: rgba(108, 139, 167, 0.06);
  transform: translateY(-1px);
}

.btn-sm { min-height: 40px; padding: 0 16px; border-radius: 14px; font-size: 14px; }
.btn-lg { min-height: 58px; padding: 0 28px; border-radius: 20px; font-size: 16px; }

.btn:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.ghost-btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ===== 顶部导航 ===== */
.site-nav,
.page-nav,
.test-topbar,
.result-topbar,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.test-topbar.glass-card,
.result-topbar.glass-card,
.topbar.glass-card {
  padding: 18px 22px;
}

.topbar-left,
.topbar-right,
.test-topbar__left,
.test-topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-link {
  color: var(--primary-dark);
  font-size: 14px;
  transition: color var(--transition), transform var(--transition);
}

.back-link:hover {
  color: var(--primary);
  transform: translateX(-2px);
}

.mini-brand,
.page-mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}

.mini-logo,
.page-mini-dot,
.mini-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gradient-primary);
  flex: 0 0 auto;
}

/* ===== 主页卡片 ===== */
.test-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.test-card {
  grid-column: span 4;
  min-height: 260px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--gradient-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.test-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.test-card__title {
  margin: 14px 0 8px;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-strong);
}

.test-card__desc {
  margin: 0;
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.75;
}

.test-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

/* ===== 进度 ===== */
.progress-panel,
.progress-card {
  padding: 18px 22px;
  border-radius: var(--radius-xl);
}

.progress-label-row,
.progress-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-body);
}

.progress-track,
.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(108, 139, 167, 0.10);
  overflow: hidden;
}

.progress-fill,
.progress-bar__fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-primary);
  transition: width var(--transition-slow);
}

/* ===== 测试页问题卡 ===== */
.question-card {
  padding: 28px;
  border-radius: var(--radius-2xl);
}

.question-title {
  margin: 10px 0 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.5;
  color: var(--text-strong);
}

.dimension-hint,
.hint-text {
  margin: 12px 0 0;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.8;
}

.options-list,
.options-wrap,
.options-container {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.option-item,
.option-card,
.option,
.answer-option {
  width: 100%;
  text-align: left;
  padding: 18px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(108, 139, 167, 0.12);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
  color: var(--text-main);
}

.option-item:hover,
.option-card:hover,
.option:hover,
.answer-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(108, 139, 167, 0.24);
  background: rgba(255, 255, 255, 0.95);
}

.option-item.is-selected,
.option-card.is-selected,
.option.selected,
.answer-option.is-selected {
  border-color: rgba(108, 139, 167, 0.38);
  background: rgba(143, 175, 202, 0.12);
  box-shadow: 0 0 0 2px rgba(108, 139, 167, 0.10), var(--shadow-card);
}

.option-label,
.option-letter {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: rgba(108, 139, 167, 0.10);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  margin-right: 10px;
}

.nav-row,
.nav-buttons,
.nav-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ===== 结果页 ===== */
.result-hero,
.result-header,
.result-topline,
.result-grid,
.detail-grid,
.result-columns,
.result-summary-grid {
  position: relative;
  z-index: 1;
}

.result-hero {
  padding: 28px;
  border-radius: var(--radius-2xl);
}

.result-head,
.result-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.mantra-box,
.result-mantra-box {
  min-width: 240px;
  max-width: 320px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(225, 232, 237, 0.9);
  box-shadow: var(--shadow-card);
}

.mantra-text,
.result-mantra {
  margin: 0;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.85;
}

.analysis-card,
.result-panel,
.metric-card {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.result-grid,
.detail-grid,
.result-columns,
.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.result-grid > *,
.detail-grid > *,
.result-columns > *,
.result-summary-grid > * {
  grid-column: span 6;
}

.radar-wrap,
.chart-wrapper {
  width: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.axis-legend,
.axis-cards-wrap {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.axis-card,
.metric-row {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(108, 139, 167, 0.10);
}

.metric-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-value {
  color: var(--text-strong);
  font-size: 28px;
  font-weight: 700;
}

.metric-subtext {
  color: var(--text-body);
  font-size: 13px;
  margin-top: 8px;
}

.metric-bar {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  background: rgba(108, 139, 167, 0.10);
  border-radius: 999px;
  overflow: hidden;
}

.metric-bar > span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: inherit;
}

/* ===== 表单 ===== */
.input,
.search-input,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(108, 139, 167, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-main);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field-textarea {
  min-height: 140px;
  padding: 14px 16px;
  resize: vertical;
}

.search-input::placeholder,
.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-light);
}

/* ===== footer ===== */
.page-footer,
.site-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin-top: 28px;
  padding: 0 0 28px;
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .test-card {
    grid-column: span 6;
  }

  .result-grid > *,
  .detail-grid > *,
  .result-columns > *,
  .result-summary-grid > * {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {
  .page-shell,
  .site-shell,
  .landing-shell,
  .test-shell,
  .result-shell {
    width: min(100%, calc(100% - 20px));
  }

  .glass-card,
  .question-card,
  .result-hero,
  .analysis-card,
  .metric-card,
  .test-topbar.glass-card,
  .result-topbar.glass-card {
    border-radius: 22px;
  }

  .card-padding-xl,
  .card-padding-lg,
  .card-padding-md,
  .question-card,
  .result-hero,
  .analysis-card,
  .metric-card {
    padding: 20px;
  }

  .site-nav,
  .page-nav,
  .test-topbar,
  .result-topbar,
  .topbar,
  .result-head,
  .result-headline,
  .nav-row,
  .nav-buttons,
  .nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .test-grid,
  .card-grid {
    gap: 16px;
  }

  .test-card {
    grid-column: span 12;
    min-height: auto;
  }

  .question-title {
    font-size: 24px;
  }

  .page-title,
  .hero-title,
  .result-title {
    font-size: 30px;
  }

  .mantra-box,
  .result-mantra-box {
    min-width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .page-title,
  .hero-title,
  .result-title {
    font-size: 26px;
  }

  .question-title {
    font-size: 22px;
  }

  .btn,
  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }
}