/* TCM Constitution H5 - mobile-first for TikTok in-app browser */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #f5efe6 0%, #e8ddd0 100%);
  min-height: 100vh;
  color: #333;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 420px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}
.screen {
  display: none;
  padding: 10px 0;
}
.screen.active {
  display: block;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.lang-label {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 6px;
}
.lang-select {
  display: block;
  width: 100%;
  max-width: 200px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #e0d5c7;
  border-radius: 10px;
  background: #fff;
  color: #2c1810;
  margin-bottom: 20px;
  cursor: pointer;
}
.lang-select-small {
  max-width: 120px;
  padding: 6px 10px;
  font-size: 0.875rem;
  margin-bottom: 0;
}
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.quiz-header .progress {
  margin-bottom: 0;
  flex: 1;
  text-align: right;
}
.card h1 {
  font-size: 1.5rem;
  margin: 0 0 12px;
  color: #2c1810;
}
.card h2 {
  font-size: 1.25rem;
  margin: 0 0 16px;
  color: #2c1810;
}
.card p {
  margin: 0 0 16px;
  line-height: 1.5;
  color: #555;
}
.btn {
  display: inline-block;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn.primary {
  background: #8b6914;
  color: #fff;
}
.btn.primary:hover {
  background: #7a5c12;
}
.btn.secondary {
  background: #eee;
  color: #333;
}
.btn.secondary:hover {
  background: #e0e0e0;
}
.progress {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 8px;
}
.part-title {
  font-size: 0.95rem;
  color: #6b5b4f;
  margin-bottom: 12px;
  font-weight: 600;
}
.question {
  font-size: 1.05rem;
  font-weight: 500;
  color: #2c1810;
  margin-bottom: 8px !important;
}
.bilingual {
  line-height: 1.5;
}
.bilingual br {
  display: block;
  content: "";
  margin-top: 4px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option {
  padding: 12px 14px;
  border: 2px solid #e0d5c7;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}
.option:hover {
  border-color: #c4b59a;
  background: #faf8f5;
}
.option.selected {
  border-color: #8b6914;
  background: #f5f0e0;
}
.nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.nav-buttons .btn {
  flex: 1;
}
.result-type-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #8b6914;
  margin: 8px 0 12px;
}
.result-teaser-intro,
.result-teaser-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b5b4f;
  margin: 12px 0 6px;
}
.result-teaser-list {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
}
.result-teaser-list li {
  margin-bottom: 6px;
}
.disclaimer {
  font-size: 0.8rem;
  color: #888;
  margin-top: 16px !important;
}
.small {
  font-size: 0.875rem;
  color: #888;
}
.report-card {
  max-height: 80vh;
  overflow-y: auto;
}
.report-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e0d5c8;
}
.report-actions .btn {
  margin-bottom: 0;
}
.report-actions .btn-save-report {
  background: linear-gradient(135deg, #8b6914 0%, #a67c1a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 24px;
  box-shadow: 0 4px 12px rgba(139, 105, 20, 0.35);
}
.report-actions .btn-save-report:hover {
  background: linear-gradient(135deg, #7a5c12 0%, #8b6914 100%);
  box-shadow: 0 6px 16px rgba(139, 105, 20, 0.4);
}
.report-actions .btn-save-report:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.report-card #report-content {
  line-height: 1.6;
  color: #444;
}
.report-card #report-content .report-type-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #8b6914;
  margin: 0 0 16px;
}
.report-card #report-content h3 {
  font-size: 1rem;
  margin: 20px 0 8px;
  color: #2c1810;
}
.report-card #report-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b5b4f;
  margin: 16px 0 6px;
}
.report-card #report-content p {
  margin: 0 0 12px;
}
.report-card #report-content .report-constitution-primary {
  font-size: 1.1rem;
  font-weight: 600;
  color: #8b6914;
  margin: 0 0 8px;
}
.report-card #report-content .report-secondary {
  font-size: 0.95rem;
  color: #6b5b4f;
  margin-bottom: 12px;
  font-weight: 500;
}
.report-card #report-content .report-part-title {
  font-size: 1.05rem;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #2c1810;
  border-bottom: 1px solid #e0d5c8;
  padding-bottom: 6px;
}
.report-card #report-content .report-test-media {
  margin-bottom: 20px;
  padding: 12px;
  background: #faf8f5;
  border-radius: 8px;
  border: 1px solid #e0d5c8;
}
.report-card #report-content .report-test-img {
  display: block;
  margin: 8px 0;
}
.report-card #report-content .report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9rem;
}
.report-card #report-content .report-table th,
.report-card #report-content .report-table td {
  border: 1px solid #e0d5c8;
  padding: 8px 12px;
  text-align: left;
}
.report-card #report-content .report-table th {
  background: #f5f0e0;
  font-weight: 600;
  color: #6b5b4f;
}
.report-card #report-content .report-table tbody tr:nth-child(even) {
  background: #faf8f5;
}
.report-card #report-content .report-list-num,
.report-card #report-content .report-list-bullet {
  margin: 8px 0 16px;
  padding-left: 24px;
}
.report-card #report-content .report-list-num li,
.report-card #report-content .report-list-bullet li {
  margin: 4px 0;
}
.report-ingredients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}
.report-ingredient-card {
  border: 1px solid #e0d5c8;
  border-radius: 8px;
  overflow: hidden;
  background: #faf8f5;
}
.report-ingredient-img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  background: #fff;
}
.report-ingredient-info {
  padding: 8px;
  font-size: 0.85rem;
}
.report-ingredient-efficacy,
.report-ingredient-indications {
  margin: 4px 0;
  font-size: 0.8rem;
  color: #6b5b4f;
  line-height: 1.4;
}
.report-acupoints-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 12px 0 20px;
}
.report-acupoint-card {
  border: 1px solid #e0d5c8;
  border-radius: 8px;
  overflow: hidden;
  background: #faf8f5;
  max-width: 100%;
}
.report-acupoint-img-wrap {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5e6d3;
  overflow: hidden;
  padding: 12px;
  box-sizing: border-box;
}
.report-acupoint-img-wrap img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  display: block;
}
.report-acupoint-img-wrap .report-acupoint-svg-fb,
.report-acupoint-img-wrap > svg {
  max-width: 100%;
  max-height: 120px;
  width: auto;
  height: auto;
}
.report-acupoint-img-wrap > div.report-acupoint-svg-fb {
  padding: 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.report-acupoint-img-wrap > div.report-acupoint-svg-fb svg {
  max-width: 100%;
  max-height: 120px;
  width: auto;
  height: auto;
}
.report-acupoint-info {
  padding: 12px;
  font-size: 0.9rem;
}
.report-acupoint-name {
  display: block;
  margin: 0 0 6px;
  font-size: 1rem;
  color: #4a4035;
}
.report-acupoint-loc,
.report-acupoint-eff {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #6b5b4f;
  line-height: 1.4;
}
.report-schedule-table {
  margin: 12px 0 20px;
  overflow-x: auto;
}
.report-schedule-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.report-schedule-table th,
.report-schedule-table td {
  border: 1px solid #e0d5c8;
  padding: 8px 12px;
  text-align: left;
}
.report-expected-outcomes-wrap {
  margin: 16px 0 24px;
  padding: 16px;
  border: 1px solid #e0d5c8;
  border-radius: 8px;
  background: #faf8f5;
}
.report-expected-outcomes-wrap h4 {
  margin-top: 0;
}
.report-schedule-table th {
  background: #f0e9e0;
  color: #6b5b4f;
  font-weight: 600;
}
.report-outcomes-chart {
  display: flex;
  gap: 12px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}
.report-outcome-bar {
  flex: 1;
  min-width: 120px;
  border: 1px solid #e0d5c8;
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, #faf8f5 0%, #f0e9e0 100%);
}
.report-outcome-period {
  font-weight: 600;
  color: #8b6914;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.report-outcome-content {
  font-size: 0.85rem;
  color: #6b5b4f;
  line-height: 1.4;
}

/* Quiz submit button */
.quiz-submit-wrap {
  margin-top: 16px;
}
.quiz-submit-wrap .btn-submit {
  width: 100%;
}

/* Calculating overlay */
.calculating-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.calculating-overlay.active {
  display: flex !important;
}
.calculating-overlay .card {
  max-width: 320px;
  width: 100%;
}
.calculating-text {
  font-size: 1rem;
  color: #2c1810;
  margin: 0 0 20px !important;
  text-align: center;
}
.progress-bar-wrap {
  height: 10px;
  background: #e0d5c7;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b6914, #a88a1f);
  border-radius: 5px;
  transition: width 0.15s ease-out;
}
.progress-percent {
  font-size: 1.1rem;
  font-weight: 600;
  color: #8b6914;
  text-align: center;
  margin: 0 !important;
}

/* Result rarity */
.result-rarity {
  font-size: 1.05rem;
  font-weight: 600;
  color: #8b6914;
  margin: 0 0 16px !important;
  text-align: center;
  padding: 12px 16px;
  background: #f5f0e0;
  border-radius: 10px;
}

/* Landing page */
.landing-header {
  margin-bottom: 20px;
}
.landing-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 16px;
  text-align: center;
  color: #2c1810;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.landing-header-row2 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.landing-header-row2 .landing-lang-label {
  margin-right: 4px;
}
.landing-header-row2 .lang-select {
  margin-bottom: 0;
  min-width: 100px;
}
.landing-lang-label {
  font-size: 0.9rem;
  color: #555;
}
.btn-history {
  padding: 8px 12px;
  border: 2px solid #8b6914;
  border-radius: 10px;
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  color: #8b6914;
}
.btn-history:hover {
  background: #f5f0e0;
}
.landing-card {
  margin-bottom: 20px;
}
.landing-desc {
  margin: 0 0 24px !important;
  color: #555;
  line-height: 1.6;
}
.gender-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.gender-card {
  padding: 20px 16px;
  border: 2px solid #e0d5c7;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  background: #fff;
}
.gender-card:hover {
  border-color: #c4b59a;
  background: #faf8f5;
}
.gender-card.selected {
  border-color: #8b6914;
  background: #f5f0e0;
}
.gender-label {
  font-size: 1rem;
  font-weight: 600;
  color: #2c1810;
}
.gender-hint {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 20px !important;
  text-align: center;
}
.btn-start {
  margin-bottom: 20px;
}
.btn-start:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* 首页三组说明文字：统一字号与段落 */
.pay-disclaimer,
.pre-requisites-list,
.intro-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555;
}
.pay-disclaimer {
  margin: 0 !important;
  padding-top: 8px;
  border-top: 1px solid #eee;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2c1810;
  margin: 0 0 12px;
}
.pre-requisites-list {
  margin: 0;
  padding-left: 1.2rem;
}
.pre-requisites-list li {
  margin-bottom: 8px;
}
.intro-body {
  margin: 0 !important;
}

/* History screen */
.history-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.history-header h2 {
  flex: 1;
  min-width: 0;
  font-size: 1.2rem;
}
.btn-back {
  padding: 8px 12px;
  border: none;
  background: #eee;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #333;
}
.btn-back:hover {
  background: #e0e0e0;
}
.history-header h2 {
  margin: 0;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
}
.history-item {
  padding: 14px 16px;
  border: 1px solid #e0d5c7;
  border-radius: 10px;
  background: #faf8f5;
  cursor: pointer;
  transition: background 0.2s;
}
.history-item:hover {
  background: #f5f0e0;
}
.history-item-date {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 4px;
}
.history-item-type {
  font-size: 1rem;
  font-weight: 600;
  color: #2c1810;
}
.history-empty {
  color: #888;
  text-align: center;
  padding: 24px 0;
  margin: 0 0 16px !important;
}
