/* 《猫咪攻击与防御行为科学自检》柔玫瑰陶土 · 燕麦暖米 · 安抚鼠尾草绘本主题 */

:root {
  --bg-top: #fdf7f5;
  --bg-bottom: #f4e8e3;
  --card-bg: rgba(255, 253, 251, 0.95);
  --card-border: #ead7cf;
  --text-main: #432f2b;
  --text-sub: #7d645e;
  --text-muted: #a18982;
  --terra: #b85d53;
  --terra-dark: #97453c;
  --terra-soft: #fceeed;
  --sage: #3d7e68;
  --sage-soft: #e7f5ef;
  --amber: #c77a28;
  --amber-soft: #fdf2e3;
  --shadow-soft: 0 10px 28px rgba(138, 78, 70, 0.09);
  --radius-lg: 22px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: linear-gradient(165deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  overflow-x: hidden;
  line-height: 1.6;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 240px;
  height: 240px;
  background: #f0cfc7;
  top: -60px;
  right: -50px;
}

.orb-2 {
  width: 220px;
  height: 220px;
  background: #cbe4d7;
  bottom: 12%;
  left: -70px;
}

.orb-3 {
  width: 180px;
  height: 180px;
  background: #f5dec2;
  top: 42%;
  right: -60px;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 15px 46px;
}

.view {
  display: none;
  animation: fadeUp 0.28s ease;
}

.view.active {
  display: block;
}

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

.hidden {
  display: none !important;
}

/* Badges & Cards */
.top-badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pill-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--terra-soft);
  color: var(--terra-dark);
  border: 1px solid #ecc6c1;
}

.pill-badge.soft {
  background: var(--sage-soft);
  color: var(--sage);
  border-color: #c2e3d4;
}

.card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

/* Hero Card */
.hero-card {
  background: linear-gradient(180deg, #fffdfb 0%, #fbf0ec 100%);
  border: 1.5px solid #ead2c8;
  border-radius: 26px;
  padding: 20px 18px 18px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.hero-art-wrap {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto 14px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  border: 4px solid #fffdfb;
  box-shadow: 0 10px 24px rgba(184, 93, 83, 0.17);
}

.hero-seal {
  position: absolute;
  right: -10px;
  bottom: -6px;
  background: linear-gradient(135deg, #c96f64 0%, #a44c42 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  border: 2.5px solid #fffdfb;
  box-shadow: 0 4px 12px rgba(164, 76, 66, 0.3);
  transform: rotate(-5deg);
}

.hero-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.28;
  font-weight: 800;
  color: var(--text-main);
}

.hero-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.65;
}

.hero-sub strong {
  color: var(--terra-dark);
}

.dim-preview-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.dim-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  color: #6d534d;
  border: 1px solid #ead7cf;
}

/* Safety Notice */
.safety-notice {
  background: #fffbf2;
  border: 1.5px solid #edd6a7;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #6f5228;
  line-height: 1.62;
  margin-bottom: 14px;
}

.safety-notice strong {
  color: #9e5c16;
}

.pain-alert-banner {
  background: #fff4f2;
  border: 2px solid #e39d94;
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 13px;
  color: #7d332c;
  line-height: 1.65;
  margin-bottom: 14px;
}

/* Gate Card */
.gate-card {
  border-color: #e6bfb9;
  background: linear-gradient(180deg, #fffdfb 0%, #fcf1ef 100%);
}

.gate-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.gate-icon {
  font-size: 28px;
}

.gate-head h2 {
  margin: 0;
  font-size: 16px;
}

.gate-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-sub);
}

.gate-input-row {
  display: flex;
  gap: 8px;
}

.gate-input-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1.5px solid #e2c2bc;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
  outline: none;
}

.gate-input-row input:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(184, 93, 83, 0.14);
}

.gate-msg {
  margin: 8px 0 0;
  font-size: 12.5px;
  min-height: 18px;
}

.gate-msg.err {
  color: var(--terra-dark);
}

.gate-msg.ok {
  color: var(--sage);
  font-weight: 600;
}

.preview-bypass-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e6cbc4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.demo-hint code {
  background: #f6e7e4;
  color: var(--terra-dark);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.mode-section.locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.25);
}

/* Section Head */
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 13px;
}

.sec-emoji {
  font-size: 22px;
  line-height: 1.2;
}

.section-head h3 {
  margin: 0;
  font-size: 15.5px;
}

.section-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-sub);
}

/* Profile Inputs */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.input-group input {
  width: 100%;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1.5px solid #e6d3cb;
  background: #fff;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
}

.input-group input:focus {
  border-color: var(--terra);
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px dashed #ecdbd4;
}

.avatar-preview-box {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--terra-soft);
  border: 2px solid #e6bfb9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.avatar-placeholder {
  font-size: 26px;
}

.photo-upload-meta {
  flex: 1;
}

.tiny-note {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #c96c61 0%, #a54b41 100%);
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(165, 75, 65, 0.25);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

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

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary.full {
  width: 100%;
  padding: 13px;
  font-size: 15px;
}

.btn-secondary {
  background: #f3e6e1;
  color: #6d534d;
  border: 1.5px solid #e3cec6;
  border-radius: 13px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-upload-outline {
  display: inline-block;
  background: #fff;
  color: var(--terra-dark);
  border: 1.5px solid #dfb4ad;
  border-radius: 11px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-upload-outline.sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-ghost-sm {
  background: var(--terra-soft);
  color: var(--terra-dark);
  border: 1px solid #e7c0ba;
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn {
  background: rgba(255, 253, 251, 0.92);
  border: 1.5px solid #e5cfc7;
  color: var(--text-sub);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Mode Cards */
.mode-title-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 16px 4px 10px;
}

.mode-title-bar h3 {
  margin: 0;
  font-size: 16px;
}

.mode-title-bar span {
  font-size: 12px;
  color: var(--text-muted);
}

.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.mode-card {
  width: 100%;
  text-align: left;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 15px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease;
}

.mode-card:active {
  transform: scale(0.985);
}

.mode-card.featured {
  background: linear-gradient(155deg, #fffdfb 0%, #fbefeb 100%);
  border-color: #dda59c;
}

.mode-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #c96c61, #a54b41);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 9px;
}

.mode-badge.soft {
  background: var(--sage-soft);
  color: var(--sage);
}

.mode-top {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.mode-icon {
  font-size: 28px;
  line-height: 1.1;
}

.mode-info h4 {
  margin: 0 0 4px;
  font-size: 15.5px;
}

.mode-info p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.55;
}

.mode-cta {
  margin-top: 11px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--terra-dark);
}

.home-footnote {
  margin: 16px 4px 0;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

/* ==================== 视图二：答题页 ==================== */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quiz-mode-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--terra-soft);
  color: var(--terra-dark);
  border: 1px solid #ecc6c1;
}

.progress-wrap {
  margin-bottom: 12px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.quiz-dim-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--terra-dark);
}

.quiz-counter {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
}

.progress-track {
  height: 9px;
  background: #ebdcd6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #cf7a6e, #3d7e68);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.question-card {
  padding: 18px 16px;
}

.q-scene-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.q-title {
  margin: 0 0 15px;
  font-size: 16.5px;
  line-height: 1.55;
}

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

.opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1.5px solid #e8d5cd;
  background: #fff;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.15s ease;
}

.opt-btn:hover {
  border-color: var(--terra);
  background: #fff9f7;
}

.opt-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f5e8e3;
  color: var(--terra-dark);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.opt-btn.selected {
  border-color: var(--terra);
  background: var(--terra-soft);
  box-shadow: 0 3px 10px rgba(184, 93, 83, 0.14);
}

.opt-btn.selected .opt-dot {
  background: var(--terra);
  color: #fff;
}

/* Feedback Box */
.feedback-box {
  margin-top: 15px;
  padding: 14px;
  border-radius: 16px;
  background: #f9f5f2;
  border: 1.5px solid #e8d6ce;
  animation: fadeUp 0.22s ease;
}

.fb-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--sage);
  margin-bottom: 5px;
}

.feedback-box > p {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.65;
}

.fb-voice-block {
  background: #fff;
  border-radius: 12px;
  padding: 9px 11px;
  border: 1px dashed #e2c5bd;
}

.fb-voice-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--terra-dark);
  margin-bottom: 3px;
}

.fb-voice-block p {
  margin: 0;
  font-size: 13px;
  color: #624a44;
  font-style: italic;
}

.quiz-footer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.quiz-footer .btn-secondary {
  flex: 0.42;
}

.quiz-footer .btn-primary {
  flex: 1;
}

/* ==================== 视图三：报告页 ==================== */
.result-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-top-tag {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--terra-dark);
}

.grade-hero-card {
  background: linear-gradient(175deg, #fffdfb 0%, #fbf0ec 100%);
  border: 2px solid #e5c3b9;
}

.grade-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.res-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
}

.res-stamp {
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid currentColor;
  transform: rotate(-4deg);
}

.score-hero-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.score-big-wrap {
  background: #fff;
  border: 2px solid #e8cbc2;
  border-radius: 18px;
  padding: 10px 13px;
  text-align: center;
  min-width: 98px;
}

.score-big-num {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.score-unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.res-light-title {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.3;
}

.res-primary-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--terra-soft);
  color: var(--terra-dark);
  border: 1px solid #ecc6c1;
}

.res-subtitle {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 700;
}

.res-desc {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.65;
}

.res-advice-box {
  background: #fff;
  border-radius: 13px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #ead5cd;
}

/* Poster Card & Save-to-Photos Fix */
.poster-tools-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.poster-stage {
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #e7cbc2;
  background: #f8efeb;
  box-shadow: 0 8px 22px rgba(138, 78, 70, 0.14);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.poster-stage.pulse-highlight {
  border-color: var(--sage);
  box-shadow: 0 0 0 5px rgba(61, 126, 104, 0.22);
}

.poster-img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
  pointer-events: auto !important;
}

.save-hint-text {
  margin: 10px 0 12px;
  font-size: 12.5px;
  color: var(--text-sub);
  text-align: center;
  background: var(--terra-soft);
  padding: 8px 10px;
  border-radius: 11px;
}

/* Radar & Bars */
.radar-canvas-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}

#radar-canvas {
  width: 100%;
  max-width: 340px;
  height: auto;
}

.dim-bars-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dim-bar-item {
  background: #fdf9f7;
  border: 1px solid #eedcd5;
  border-radius: 12px;
  padding: 9px 11px;
}

.dim-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

.dim-bar-track {
  height: 8px;
  background: #efe2dc;
  border-radius: 999px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* Top 3 Protocols */
.protocols-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.protocol-card {
  background: #fffaf8;
  border: 1.5px solid #ebd4cb;
  border-radius: 16px;
  padding: 14px;
}

.protocol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.protocol-head strong {
  font-size: 14.5px;
  color: var(--text-main);
}

.protocol-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
}

.protocol-summary {
  margin: 0 0 9px;
  font-size: 12.5px;
  color: var(--terra-dark);
  font-weight: 600;
}

.protocol-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.65;
}

.protocol-steps li {
  margin-bottom: 5px;
}

/* Wiki */
.wiki-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.filter-pill {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #e4cfc7;
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter-pill.hot-pill {
  border-color: #eab9b3;
  color: var(--terra-dark);
  background: var(--terra-soft);
}

.filter-pill.active {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}

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

.wiki-item {
  background: #fffdfb;
  border: 1.5px solid #ebd9d1;
  border-radius: 15px;
  padding: 13px;
}

.wiki-item.high {
  border-color: #e6b4ad;
  background: #fff8f7;
}

.wiki-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wiki-qnum {
  font-size: 12px;
  font-weight: 800;
  color: var(--terra-dark);
}

.wiki-level {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.wiki-level.low {
  background: var(--sage-soft);
  color: var(--sage);
}

.wiki-level.mid {
  background: var(--amber-soft);
  color: var(--amber);
}

.wiki-level.high {
  background: var(--terra-soft);
  color: var(--terra-dark);
}

.wiki-title {
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 700;
}

.wiki-yours {
  font-size: 12.5px;
  color: #6d534d;
  background: #f7ece8;
  padding: 5px 9px;
  border-radius: 8px;
  margin-bottom: 7px;
}

.wiki-science {
  margin: 0 0 7px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.62;
}

.wiki-voice {
  margin: 0;
  font-size: 12.5px;
  color: var(--terra-dark);
  background: #fcf2ef;
  padding: 6px 9px;
  border-radius: 9px;
  font-style: italic;
}

.wiki-empty {
  text-align: center;
  padding: 22px 12px;
  color: var(--sage);
  font-weight: 700;
  font-size: 14px;
  background: var(--sage-soft);
  border-radius: 14px;
}

.result-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 16px;
}

.result-footer p {
  margin: 3px 0;
}
