* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #ffffff;
  color: #6A4C80;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app-root {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
}

.app-logo {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.app-logo img {
  height: 24px;
  width: auto;
  display: block;
}

.app-logo-text {
  font-size: 14px;
  font-weight: 600;
  color: #6A4C80;
}

.lang-switch {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px;
  background-color: #f5f0ff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.lang-switch button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 12px;
  color: #6A4C80;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-switch button.active {
  background: linear-gradient(135deg, #F6CFFF, #FFD6DC);
  color: #6A4C80;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.lang-switch button:active {
  transform: scale(0.96);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.home-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-top: 8px;
  color: #6A4C80;
}

.home-subtitle {
  text-align: center;
  font-size: 14px;
  margin-top: 4px;
  color: #888888;
}

.home-tag-cloud {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tag-card {
  position: relative;
  padding: 16px 12px;
  border-radius: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.tag-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #6A4C80;
  line-height: 1.3;
}

.tag-card-subtitle {
  font-size: 12px;
  color: #888888;
  margin-top: 4px;
}

.tag-card:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.tag-card:active {
  transform: scale(0.96) translateY(1px);
}

.home-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #CCCCCC;
  line-height: 1.5;
}

.home-links {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
}

.link-button {
  border: none;
  background: transparent;
  color: #888888;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
}

.link-button:active {
  opacity: 0.7;
}

.section-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  margin-top: 8px;
  color: #6A4C80;
}

.section-subtitle {
  text-align: center;
  font-size: 14px;
  margin-top: 4px;
  color: #888888;
}

.content-block {
  margin-top: 18px;
  padding: 14px 12px;
  border-radius: 16px;
  background-color: #fdf7ff;
  color: #6A4C80;
  font-size: 14px;
  line-height: 1.6;
}

.content-block p + p {
  margin-top: 8px;
}

.content-list {
  margin-top: 10px;
  padding-left: 18px;
  font-size: 14px;
  color: #6A4C80;
  line-height: 1.6;
}

.content-list li + li {
  margin-top: 4px;
}

.page-footer {
  margin-top: 24px;
  padding-top: 16px;
}

.weak-tip {
  text-align: center;
  font-size: 12px;
  color: #CCCCCC;
  line-height: 1.6;
  margin-top: 8px;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary,
.btn-secondary {
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #F6CFFF, #FFD6DC);
  color: #6A4C80;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
  background-color: #FFF5CC;
  color: #6A4C80;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.96) translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.quiz-header {
  margin-top: 4px;
}

.progress-container {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background-color: #f3f3f3;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.progress-text {
  margin-top: 6px;
  font-size: 13px;
  text-align: right;
  color: #888888;
}

.quiz-question {
  margin-top: 18px;
  font-size: 17px;
  font-weight: 600;
  color: #6A4C80;
  line-height: 1.6;
}

.quiz-options {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-options-scale {
}

.quiz-option {
  width: 100%;
  border-radius: 18px;
  padding: 12px 14px;
  border: none;
  text-align: left;
  font-size: 15px;
  color: #6A4C80;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}

.quiz-option:active {
  transform: scale(0.97) translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.result-title {
  margin-top: 16px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #6A4C80;
  line-height: 1.5;
}

.result-list {
  margin-top: 14px;
  padding-left: 18px;
  font-size: 14px;
  color: #6A4C80;
  line-height: 1.6;
}

.result-list li + li {
  margin-top: 6px;
}

.result-graph {
  margin-top: 16px;
  padding: 12px 10px;
  border-radius: 14px;
  background-color: #fdf7ff;
}

.mbti-type-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #6A4C80;
  background: linear-gradient(135deg, #F6CFFF, #FFD6DC);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mbti-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mbti-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mbti-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888888;
}

.mbti-bar-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background-color: #f3f3f3;
  overflow: hidden;
}

.mbti-bar-front,
.mbti-bar-back {
  position: absolute;
  top: 0;
  bottom: 0;
}

.mbti-bar-front {
  left: 0;
}

.mbti-bar-back {
  right: 0;
}

.mbti-bar-front-ei {
  background: linear-gradient(90deg, #FF8A7A, #FFB199);
}

.mbti-bar-back-ei {
  background: linear-gradient(270deg, #7AA9FF, #9CC5FF);
}

.mbti-bar-front-sn {
  background: linear-gradient(90deg, #FFCF6B, #FFE797);
}

.mbti-bar-back-sn {
  background: linear-gradient(270deg, #A68BFF, #C4B5FF);
}

.mbti-bar-front-tf {
  background: linear-gradient(90deg, #6AD0FF, #9AE6FF);
}

.mbti-bar-back-tf {
  background: linear-gradient(270deg, #FF9BCD, #FFC2E1);
}

.mbti-bar-front-jp {
  background: linear-gradient(90deg, #8EE08E, #B8F3B0);
}

.mbti-bar-back-jp {
  background: linear-gradient(270deg, #FFCF7A, #FFE2A8);
}

.disc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.disc-icon-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.disc-type-icon {
  width: 48px;
  height: 48px;
}

.disc-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disc-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.disc-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888888;
}

.disc-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background-color: #f3f3f3;
  overflow: hidden;
}

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

.disc-bar-fill-D {
  background: linear-gradient(90deg, #FF5C5C, #FF9A7B);
}

.disc-bar-fill-I {
  background: linear-gradient(90deg, #FFB74D, #FFE082);
}

.disc-bar-fill-S {
  background: linear-gradient(90deg, #81C784, #C5E1A5);
}

.disc-bar-fill-C {
  background: linear-gradient(90deg, #64B5F6, #BBDEFB);
}

.legal-page {
  margin-top: 8px;
}

.legal-text {
  margin-top: 12px;
  font-size: 13px;
  color: #6A4C80;
  line-height: 1.7;
}

.legal-text p + p {
  margin-top: 8px;
}

.legal-text ul {
  margin-top: 8px;
  padding-left: 18px;
}

.legal-text li + li {
  margin-top: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.76);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  max-width: 80%;
  text-align: center;
  z-index: 50;
  animation: toast-fade 1.5s ease forwards;
}

@keyframes toast-fade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
}

@media (max-width: 360px) {
  .home-title {
    font-size: 20px;
  }

  .tag-card-title {
    font-size: 13px;
  }

  .tag-card-subtitle {
    font-size: 10px;
  }

  .btn-primary,
  .btn-secondary {
    min-width: 110px;
  }
}

@media (min-width: 768px) {
  body {
    background-color: #f3f3f7;
  }

  #app {
    align-items: center;
  }

  .app-root {
    max-width: 720px;
    margin: 32px auto;
    border-radius: 24px;
    background-color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  }

  .quiz-question {
    font-size: 18px;
    text-align: center;
  }

  .quiz-options-scale {
    flex-direction: row;
    gap: 8px;
  }

  .quiz-options-scale .quiz-option {
    text-align: center;
    padding: 10px 8px;
  }
}
