/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 新的配色方案 */
  --header-blue: #527deb;
  --primary-blue: #8ad8ec;
  --secondary-blue: #1c7690;
  --primary-teal: #6dd5ed;
  --secondary-teal: #4ec8e5;
  --gradient-start: #8eecaa;
  --gradient-end: #6dd5ed;
  --light-teal: rgba(109, 213, 237, 0.1);
  --medium-teal: rgba(33, 147, 176, 0.15);
  --dark-teal: rgba(33, 147, 176, 0.8);
  --light-gray: #f8fafb;
  --dark-gray: #2c3e50;
  --white: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--dark-gray);
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  min-height: 100vh;
}

.main-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部样式 */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px 0;
}
/* 底部样式 */
.footer {
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  color: var(--header-blue);
  margin-bottom: 10px;
  font-weight: 700;
}

.subtitle {
  font-size: 1.2em;
  color: var(--primary-purple);
}

/* 内容区域样式 */
.content {
  flex: 1;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(33, 147, 176, 0.2);
}

#intro-container {
  text-align: center;
  padding: 20px;
}

#intro-container p {
  margin-bottom: 24px;
  font-size: 1.1em;
  color: var(--dark-gray);
  line-height: 1.8;
}

/* 按钮样式 */
#start-button {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  box-shadow: 0 4px 12px rgba(33, 147, 176, 0.2);
  color: var(--white);
  border: none;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

#start-button:hover {
  background: linear-gradient(135deg, var(--primary-teal), var(--primary-blue));
  box-shadow: 0 6px 15px rgba(33, 147, 176, 0.3);
  transform: translateY(-2px);
}

/* 进度条样式 */
.progress-container {
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  padding: 20px;
  border-radius: 15px;
}

.progress-text {
  text-align: center;
  margin-bottom: 15px;
  font-size: 1.1em;
  color: var(--primary-blue);
  font-weight: 600;
}

.progress-line {
  height: 10px;
  background-color: var(--light-teal);
  border-radius: 5px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  background: linear-gradient(
    to right,
    var(--primary-blue),
    var(--primary-teal)
  );
  width: 0;
  transition: width 0.4s ease;
}

/* 问题容器样式 */
.question-container {
  margin-bottom: 30px;
  padding: 20px 15px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.85)
  );
  backdrop-filter: blur(5px);
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(33, 147, 176, 0.15);
}

#question-text {
  font-size: 1.5em;
  color: var(--dark-gray);
  margin-bottom: 35px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  padding: 0 10px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

#options-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 10px;
}

.option {
  padding: 28px 25px;
  border: 2.5px solid var(--light-teal);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.25em;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  color: var(--dark-gray);
  box-shadow: 0 4px 12px rgba(33, 147, 176, 0.08);
  min-height: 90px;
  margin-bottom: 15px;
}

.option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 6px;
  background-color: transparent;
  transition: background-color 0.3s ease;
  border-radius: 3px 0 0 3px;
}

.option:hover {
  border-color: var(--primary-blue);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    var(--light-teal)
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(33, 147, 176, 0.15);
}

.option.selected {
  border-color: var(--primary-blue);
  background: linear-gradient(
    135deg,
    var(--light-teal),
    rgba(255, 255, 255, 0.9)
  );
  color: var(--primary-blue);
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(33, 147, 176, 0.2);
}

.option.selected::before {
  background: linear-gradient(
    to bottom,
    var(--primary-blue),
    var(--primary-teal)
  );
}

/* 为选项添加序号样式 */
.option::after {
  content: "A";
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4em;
  font-weight: 700;
  color: #dddddd;
  transition: color 0.3s ease;
  opacity: 0.8;
}

.option:nth-child(2)::after {
  content: "B";
}

.option.selected::after {
  color: var(--primary-blue);
  opacity: 1;
}

/* 选项文本容器 */
.option-text {
  flex: 1;
  padding-right: 50px; /* 为选项字母留出空间 */
}

/* 导航按钮容器样式 */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 35px;
  padding: 0 10px;
}

#prev-button,
#next-button {
  padding: 16px 30px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.15em;
  min-width: 140px;
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

#prev-button:disabled,
#next-button:disabled {
  background: #cccccc !important;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none !important;
  transform: none !important;
}

#prev-button {
  background: linear-gradient(
    135deg,
    var(--primary-blue),
    var(--secondary-blue)
  );
  box-shadow: 0 4px 12px rgba(33, 147, 176, 0.2);
}

#prev-button:not(:disabled):hover {
  background: linear-gradient(
    135deg,
    var(--secondary-blue),
    var(--primary-blue)
  );
  box-shadow: 0 6px 15px rgba(33, 147, 176, 0.3);
}

#next-button {
  background: linear-gradient(
    135deg,
    var(--primary-teal),
    var(--secondary-teal)
  );
  box-shadow: 0 4px 12px rgba(109, 213, 237, 0.2);
}

#next-button:not(:disabled):hover {
  background: linear-gradient(
    135deg,
    var(--secondary-teal),
    var(--primary-teal)
  );
  box-shadow: 0 6px 15px rgba(109, 213, 237, 0.3);
}

#submit-button {
  display: none;
  background-color: var(--primary-purple);
  padding: 15px 40px;
  border-radius: 25px;
  font-weight: 600;
}

#submit-button:hover {
  background-color: var(--secondary-purple);
}

/* 结果容器样式 */
#result-container {
  text-align: center;
  padding: 30px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(33, 147, 176, 0.15);
}

#result-container h2 {
  color: var(--primary-blue);
  font-size: 2em;
  margin-bottom: 30px;
}

.result-section {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 30px;
}

.qrcode-section {
  text-align: center;
}

.qrcode-image {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hashcode-section {
  text-align: center;
}

.hashcode-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

#hashCode {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--primary-blue);
  padding: 10px 20px;
  background: var(--light-teal);
  border-radius: 8px;
  user-select: all;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 147, 176, 0.2);
}

.copy-btn.copied {
  background: #4caf50;
}

.copy-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

.tip {
  color: #666;
  font-size: 0.9em;
  margin-top: 10px;
}

.type-section {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
  background: var(--light-teal);
  border-radius: 15px;
}

#mbtiType {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--primary-blue);
  margin: 20px 0;
}

#typeDescription {
  font-size: 1.1em;
  line-height: 1.6;
  color: var(--dark-gray);
  text-align: left;
  margin-top: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-container {
    padding: 10px;
  }

  .content {
    padding: 20px;
    background: rgba(255, 255, 255, 0.98);
  }

  .header h1 {
    font-size: 2em;
  }

  .subtitle {
    font-size: 1em;
  }

  .question-container {
    padding: 15px 10px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.95);
  }

  #question-text {
    font-size: 1.35em;
    margin-bottom: 30px;
    padding: 0 5px;
  }

  .option {
    padding: 24px 20px;
    font-size: 1.2em;
    min-height: 80px;
  }

  .option::after {
    right: 20px;
    font-size: 1.3em;
  }

  #prev-button,
  #next-button {
    padding: 14px 25px;
    font-size: 1.1em;
    min-width: 120px;
  }

  .result-section {
    flex-direction: column;
  }

  .qrcode-image {
    width: 180px;
    height: 180px;
  }

  #hashCode {
    font-size: 1.1em;
  }
}

@media (max-width: 480px) {
  .question-container {
    padding: 12px 8px;
    margin-bottom: 20px;
  }

  #question-text {
    font-size: 1.25em;
    margin-bottom: 25px;
  }

  #options-container {
    gap: 20px;
    padding: 0 5px;
  }

  .option {
    padding: 20px 16px;
    font-size: 1.15em;
    min-height: 70px;
    border-radius: 16px;
  }

  .option::before {
    width: 6px;
  }

  .option::after {
    right: 15px;
    font-size: 1.2em;
  }

  .option-text {
    padding-right: 40px;
  }

  #prev-button,
  #next-button {
    padding: 12px 20px;
    font-size: 1.05em;
    min-width: 100px;
  }

  body {
    background: linear-gradient(
      150deg,
      var(--gradient-start) 0%,
      var(--gradient-end) 100%
    );
  }

  .content {
    background: rgba(255, 255, 255, 0.99);
  }
}

/* 加载动画样式 */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  color: #666;
  font-size: 16px;
}

/* 结果内容样式 */
#result-content {
  padding: 20px;
}

.result-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 20px;
}

.qrcode-section {
  text-align: center;
}

.qrcode-image {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.hashcode-section {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.hashcode-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

#hashCode {
  font-size: 18px;
  font-family: monospace;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
}

.tip {
  color: #666;
  font-size: 14px;
  margin-top: 10px;
}
