html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

/* App 容器 */
#app {
  max-width: 720px;
  margin: 20px auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#app-title {
  text-align: center;
  font-size: 28px;
  color: #2c3e50;
  margin-bottom: 8px;
}

#app-desc {
  text-align: center;
  font-size: 15px;
  color: #7f8c8d;
  margin-bottom: 24px;
}

/* 模式切换选项卡 */
#mode-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #4A90D9;
}

.mode-tab {
  flex: 1;
  max-width: 200px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: #fff;
  color: #4A90D9;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: #4A90D9;
  color: #fff;
}

.mode-tab:hover:not(.active) {
  background: #eaf2fb;
}

/* 输入区域 */
#input-area {
  margin-bottom: 20px;
}

.input-mode {
  display: none;
}

.input-mode.active {
  display: block;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.input-group label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
  min-width: 60px;
}

.input-field {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: "Consolas", "Menlo", "Courier New", monospace;
  border: 2px solid #dcdde1;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-field:focus {
  border-color: #4A90D9;
}

.btn-primary {
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #4A90D9;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #357ABD;
}

.btn-primary:active {
  background: #2C68A4;
}

/* 结果区域 */
#result-area {
  display: none;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#result-area.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

#result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

#result-status {
  font-size: 20px;
  font-weight: 700;
}

#result-status.status-prime {
  color: #27AE60;
}

#result-status.status-composite {
  color: #E74C3C;
}

#result-time {
  font-size: 13px;
  color: #95a5a6;
}

#result-content {
  font-size: 15px;
  color: #2c3e50;
  line-height: 1.7;
  margin-bottom: 12px;
}

.prime-result {
  color: #27AE60;
}

.composite-result {
  color: #E74C3C;
}

.prime-list {
  font-family: "Consolas", "Menlo", "Courier New", monospace;
  font-size: 14px;
  color: #27AE60;
  word-break: break-all;
  line-height: 1.8;
}

#result-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #4A90D9;
  background: #fff;
  border: 1px solid #4A90D9;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #eaf2fb;
}

.btn-secondary:active {
  background: #d5e6f8;
}

/* 步骤区域 */
#steps-area {
  margin-bottom: 20px;
}

#steps-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f0f4f8;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  transition: background 0.2s ease;
  user-select: none;
}

#steps-toggle:hover {
  background: #e4eaf0;
}

#steps-arrow {
  font-size: 12px;
  color: #7f8c8d;
}

#steps-content {
  background: #fafbfc;
  border: 1px solid #e8ecf0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

#steps-content.collapsed {
  display: none;
}

.steps-list {
  margin: 0;
  padding-left: 20px;
}

.step-item {
  font-family: "Consolas", "Menlo", "Courier New", monospace;
  font-size: 13px;
  color: #555;
  line-height: 1.8;
  padding: 2px 0;
}

/* 功能介绍区域 */
#features {
  max-width: 720px;
  margin: 30px auto;
  padding: 0 24px;
}

#features h2 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 12px;
}

#features p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

/* 应用场景区域 */
#scenarios {
  max-width: 720px;
  margin: 30px auto;
  padding: 0 24px;
}

#scenarios h2 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 12px;
}

#scenarios ul {
  list-style: none;
  padding: 0;
}

#scenarios li {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

#scenarios li::before {
  content: "•";
  color: #4A90D9;
  font-weight: bold;
  position: absolute;
  left: 4px;
}

/* FAQ 区域 */
#FAQ {
  max-width: 720px;
  margin: 30px auto 40px;
  padding: 0 24px;
}

#FAQ h2 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 16px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 16px;
  margin-bottom: 4px;
}

#FAQ dd {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin-left: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

/* fork 按钮 */
#__fork {
  text-align: center;
  margin: 20px 0;
}

#__fork button {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #4A90D9;
  background: #fff;
  border: 2px solid #4A90D9;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#__fork button:hover {
  background: #4A90D9;
  color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
  #app {
    padding: 16px;
    margin: 10px auto;
  }

  #app-title {
    font-size: 24px;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .input-group label {
    min-width: auto;
  }

  .input-field {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
  }

  #result-status {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  #app-title {
    font-size: 22px;
  }

  #app-desc {
    font-size: 14px;
  }

  .mode-tab {
    font-size: 14px;
    padding: 8px 12px;
  }

  #result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  #result-actions {
    flex-direction: column;
  }

  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}
