/* ベース設定 */
body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f2f2f2;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #4a90e2;
  color: white;
}

h1 {
  margin: 0;
  font-size: 2rem;
}

.tab-nav {
  display: flex;
  justify-content: center;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 2rem;
  gap: 2px;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background-color: #e2e8f0;
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #4a5568;
  position: relative;
  transition: all 0.3s ease;
  margin-top: 4px;
}

.tab-button:hover {
  background-color: #cbd5e0;
  transform: translateY(-2px);
}

.tab-button.active {
  background-color: #ffffff;
  color: #2d3748;
  font-weight: 600;
  transform: translateY(0);
  border: 1px solid #e2e8f0;
  border-bottom: 1px solid #ffffff;
  z-index: 1;
}

.tab-button.active:hover {
  transform: translateY(0);
}

main {
  padding: 0;
  display: flex;
  justify-content: center;
  background-color: #f8f9fa;
  min-height: calc(100vh - 200px);
}

.tab-content {
  display: none;
  max-width: 1200px;
  width: 100%;
  background: white;
  padding: 2rem;
  margin: 0 2rem 2rem 2rem;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  border-top: none;
}

.tab-content.active {
  display: block;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #666;
  background-color: #f8f8f8;
  margin-top: 2rem;
}

/* 学習カードスタイル */
.learn-cards {
  display: grid;
  gap: 1.5rem;
}

.learn-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-icon {
  font-size: 1.5rem;
}

.card-analogy {
  padding: 0.75rem 1.5rem;
  background-color: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.95rem;
  color: #4a5568;
  font-weight: 500;
}

.card-content {
  padding: 1.5rem;
}

.card-description {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #2d3748;
  font-weight: 500;
}

.card-details {
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.card-details h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-details p {
  margin: 0;
  color: #4a5568;
  line-height: 1.6;
  font-size: 0.95rem;
}

.card-example {
  padding: 0.75rem 1rem;
  background-color: #edf2f7;
  border-left: 3px solid #4a90e2;
  border-radius: 4px;
}

.card-example .example-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a90e2;
  margin-bottom: 0.25rem;
}

.card-example p {
  margin: 0;
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* シミュレーションスタイル */
.simulate-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.simulate-input-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  width: 100%;
}

.simulate-input-section h3 {
  margin-top: 0;
  color: #2d3748;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

/* シナリオ選択エリア */
.scenario-selection {
  margin-bottom: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0f7ff, #e6f3ff);
  border: 1px solid #b3d9ff;
  border-radius: 8px;
}

.scenario-selection label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.scenario-selection select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 1rem;
  background: white;
  margin-bottom: 0.75rem;
}

.scenario-description {
  margin: 0;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #4a5568;
  font-style: italic;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.5rem;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group small {
  display: block;
  color: #718096;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
  margin-bottom: 0;
}

.radio-group input[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
}

.simulate-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.simulate-btn:hover {
  transform: translateY(-2px);
}

.simulate-result-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  width: 100%;
}

/* プログレスバー */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #667eea);
  width: 0%;
  transition: width 0.5s ease;
}

/* 検証ステップ */
.verification-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.verification-step {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.step-header h4 {
  margin: 0;
  flex: 1;
  color: #2d3748;
}

.step-icon {
  font-size: 1.5rem;
}

.step-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pass {
  background: #c6f6d5;
  color: #2f855a;
}

.status-fail {
  background: #fed7d7;
  color: #c53030;
}

.status-quarantine {
  background: #fefcbf;
  color: #d69e2e;
}

.status-reject {
  background: #fed7d7;
  color: #c53030;
}

.status-policynone {
  background: #bee3f8;
  color: #2b6cb7;
}

.step-description {
  color: #718096;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.step-details {
  background: #f7fafc;
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 0.75rem;
}

.step-details p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #4a5568;
}

/* 最終結果 */
.final-result {
  margin-top: 1.5rem;
}

.final-result-card {
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.final-result-card.success {
  background: linear-gradient(135deg, #68d391, #48bb78);
  color: white;
}

.final-result-card.warning {
  background: linear-gradient(135deg, #f6e05e, #ecc94b);
  color: #744210;
}

.final-result-card.danger {
  background: linear-gradient(135deg, #fc8181, #f56565);
  color: white;
}

.final-result-card h3 {
  margin-top: 0;
}

.final-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 1.2rem;
}

.status-icon {
  font-size: 1.5rem;
}

.additional-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.95rem;
  border-left: 3px solid rgba(255, 255, 255, 0.5);
}

.result-breakdown {
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  text-align: center;
}

.result-breakdown small {
  opacity: 0.9;
}

/* DNS可視化 */
.dns-visualization {
  margin-bottom: 1.5rem;
}

.dns-viz-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dns-viz-container h4 {
  margin-top: 0;
  color: #2d3748;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.dns-query-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dns-query-step {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.query-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.query-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.query-detail {
  font-size: 0.8rem;
  color: #718096;
  line-height: 1.4;
}

.dns-record {
  margin: 0.25rem 0;
  padding: 0.25rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
}

.spf-record {
  background: #e6fffa;
  color: #234e52;
}

.dmarc-record {
  background: #fef5e7;
  color: #744210;
}

.dns-arrow {
  font-size: 1.2rem;
  color: #4a90e2;
  margin: 0 0.25rem;
}

/* 解説モード */
.explanation-mode {
  margin-bottom: 1.5rem;
}

.explanation-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.explanation-container h4 {
  margin-top: 0;
  color: #2d3748;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.explanation-item {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #4a90e2;
}

.explanation-item h5 {
  margin: 0 0 0.5rem 0;
  color: #2d3748;
  font-size: 1rem;
}

.explanation-content {
  margin: 0 0 0.5rem 0;
  color: #4a5568;
  line-height: 1.6;
}

.technical-details {
  margin-top: 0.5rem;
}

.technical-details summary {
  cursor: pointer;
  color: #4a90e2;
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.technical-details p {
  margin: 0.5rem 0 0 0;
  padding: 0.5rem;
  background: #edf2f7;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #4a5568;
}

/* 推奨設定 */
.recommendations {
  margin-bottom: 1.5rem;
}

.recommendations-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.recommendations-container h4 {
  margin-top: 0;
  color: #2d3748;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.security-level {
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
}

.security-level.high {
  background: #c6f6d5;
  color: #2f855a;
  border: 1px solid #9ae6b4;
}

.security-level.medium {
  background: #fefcbf;
  color: #d69e2e;
  border: 1px solid #f6e05e;
}

.security-level.low {
  background: #fed7d7;
  color: #c53030;
  border: 1px solid #fc8181;
}

.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recommendation-item {
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid;
}

.recommendation-item.error {
  background: #fed7d7;
  border-left-color: #e53e3e;
}

.recommendation-item.warning {
  background: #fefcbf;
  border-left-color: #d69e2e;
}

.recommendation-item.info {
  background: #bee3f8;
  border-left-color: #3182ce;
}

.recommendation-item h5 {
  margin: 0 0 0.5rem 0;
  color: #2d3748;
}

.recommendation-item p {
  margin: 0 0 0.75rem 0;
  color: #4a5568;
  line-height: 1.5;
}

.recommendation-action {
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #2d3748;
}

.all-good {
  text-align: center;
  padding: 2rem;
  color: #2f855a;
  font-size: 1.1rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .simulate-container {
    gap: 1rem;
  }
  
  .dns-query-flow {
    flex-direction: column;
  }
  
  .dns-arrow {
    transform: rotate(90deg);
  }
}

/* チャレンジタブスタイル */
.challenge-container {
  max-width: 800px;
  margin: 0 auto;
}

.challenge-header {
  text-align: center;
  margin-bottom: 2rem;
}

.challenge-header h3 {
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.challenge-header p {
  color: #718096;
  font-size: 1.1rem;
}

/* レベル選択 */
.level-selector {
  margin-bottom: 2rem;
}

.level-selector h4 {
  text-align: center;
  margin-bottom: 1rem;
  color: #4a5568;
}

.level-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.level-btn {
  padding: 1rem 1.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  min-width: 120px;
  font-weight: 600;
}

.level-btn:hover {
  border-color: #4a90e2;
  transform: translateY(-2px);
}

.level-btn.active {
  border-color: #4a90e2;
  background: #4a90e2;
  color: white;
}

.level-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f7fafc;
}

.level-btn.locked:hover {
  transform: none;
  border-color: #e2e8f0;
}

.level-btn small {
  display: block;
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* プログレス表示 */
.progress-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}

.score-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.score-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.score-label {
  display: block;
  font-size: 0.9rem;
  color: #718096;
  margin-bottom: 0.5rem;
}

.score-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #2d3748;
}

.level-progress {
  text-align: center;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #48bb78, #68d391);
  width: 0%;
  transition: width 0.5s ease;
}

/* 問題表示 */
.question-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.start-btn {
  width: 100%;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.start-btn:hover {
  transform: translateY(-2px);
}

.question-card {
  padding: 2rem;
}

.question-header {
  margin-bottom: 1.5rem;
}

.question-header h4 {
  margin: 0 0 1rem 0;
  color: #2d3748;
  font-size: 1.2rem;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.level-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.level-badge.level-1 {
  background: #c6f6d5;
  color: #2f855a;
}

.level-badge.level-2 {
  background: #fefcbf;
  color: #d69e2e;
}

.level-badge.level-3 {
  background: #fed7d7;
  color: #c53030;
}

.scenario-text {
  color: #718096;
  font-style: italic;
  font-size: 0.9rem;
}

/* ログ表示 */
.log-display {
  margin-bottom: 2rem;
}

.log-display h5 {
  margin: 0 0 0.5rem 0;
  color: #4a5568;
}

.auth-log {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
}

/* 回答選択肢 */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.answer-option {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.answer-option:hover {
  border-color: #4a90e2;
  background: #f0f7ff;
}

.answer-option input[type="radio"] {
  display: none;
}

.answer-option input[type="radio"]:checked + .option-text {
  color: #4a90e2;
  font-weight: 600;
}

.answer-option:has(input[type="radio"]:checked) {
  border-color: #4a90e2;
  background: #f0f7ff;
}

.option-text {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.answer-option small {
  color: #718096;
  font-size: 0.85rem;
}

.answer-option input[type="radio"]:disabled + .option-text {
  color: #a0aec0;
}

.answer-option:has(input[type="radio"]:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

.answer-option:has(input[type="radio"]:disabled):hover {
  border-color: #e2e8f0;
  background: #ffffff;
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: #48bb78;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.submit-btn:hover {
  background: #38a169;
}

.submit-btn:disabled {
  background: #cbd5e0;
  color: #a0aec0;
  cursor: not-allowed;
}

.submit-btn:disabled:hover {
  background: #cbd5e0;
}

/* 結果表示 */
.quiz-result {
  margin-top: 2rem;
}

.result-card {
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid;
}

.result-card.correct {
  background: #f0fff4;
  border-color: #48bb78;
}

.result-card.incorrect {
  background: #fffaf0;
  border-color: #ed8936;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.result-icon {
  font-size: 1.5rem;
}

.result-header h5 {
  margin: 0;
  color: #2d3748;
}

.answer-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

.explanation {
  margin-bottom: 1.5rem;
}

.explanation h6 {
  margin: 0 0 0.5rem 0;
  color: #4a5568;
}

.explanation p {
  margin: 0;
  color: #2d3748;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.next-btn, .level-btn-small {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s;
}

.next-btn {
  background: #4a90e2;
  color: white;
}

.next-btn:hover {
  background: #357abd;
  transform: translateY(-2px);
}

.level-btn-small {
  background: #e2e8f0;
  color: #4a5568;
}

.level-btn-small:hover {
  background: #cbd5e0;
  transform: translateY(-2px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .level-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .score-display {
    grid-template-columns: 1fr;
  }
  
  .answer-comparison {
    grid-template-columns: 1fr;
  }
  
  .result-actions {
    flex-direction: column;
  }
}

/* フロー図スタイル */
.flow-section {
  margin-top: 3rem;
}

.flow-section h2 {
  margin-bottom: 0.5rem;
}

.flow-section p {
  margin-bottom: 1.5rem;
  color: #666;
}

.flow-container {
  margin-bottom: 2rem;
}

.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(to right, #f0f7ff, #f7f0ff);
  border-radius: 12px;
  overflow-x: auto;
  min-height: 180px;
  gap: 0.5rem;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  min-width: 90px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.flow-step:hover {
  transform: translateY(-5px);
}

.flow-step.active {
  background-color: rgba(74, 144, 226, 0.1);
  border-radius: 12px;
  transform: scale(1.1);
}

.flow-step.animated {
  animation: pulse 0.6s ease;
  background-color: rgba(74, 144, 226, 0.2);
  border-radius: 12px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.step-label {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  text-align: center;
}

.step-detail {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  max-width: 100px;
  word-wrap: break-word;
}

.check-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #4a90e2;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
}

.check-badge.spf-check {
  background: #ff6b6b;
}

.check-badge.dkim-check {
  background: #4ecdc4;
}

.check-badge.dmarc-check {
  background: #95e77e;
}

.flow-arrow {
  font-size: 1.3rem;
  color: #4a90e2;
  opacity: 0.7;
  flex-shrink: 0;
}

.flow-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.control-btn {
  padding: 0.7rem 1.5rem;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
  min-width: 180px;
}

.control-btn:hover {
  background: #357abd;
}

.control-btn.playing {
  background: #e53e3e;
}

.control-btn.playing:hover {
  background: #c53030;
}

.step-explanation {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #4a90e2;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.step-explanation.show {
  opacity: 1;
  max-height: 200px;
}

.step-explanation h4 {
  margin-top: 0;
  color: #4a90e2;
  font-size: 1.1rem;
}

.step-explanation p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 0;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
  .flow-diagram {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .flow-diagram {
    flex-direction: column;
    padding: 1rem;
    justify-content: flex-start;
  }
  
  .flow-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }
  
  .flow-step {
    margin: 0.5rem 0;
    min-width: auto;
  }
}

/* ヘルプボタン */
.help-button {
  position: fixed;
  top: 2rem; /* ヘッダーの高さに合わせてツール名と同じ行に配置 */
  right: calc(50% - 600px + 2rem + 50px); /* コンテンツエリア右端から50px内側 */
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  color: #4a90e2;
  border: 2px solid rgba(74, 144, 226, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 1000;
}

@media (max-width: 1300px) {
  .help-button {
    right: 20px; /* 画面幅が狭い時は従来の位置に戻す */
  }
}

.help-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: rgba(74, 144, 226, 0.4);
  background: #f8fafc;
}

.help-button:active {
  transform: translateY(0) scale(0.95);
}

/* ヘルプモーダル */
.help-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.help-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-modal-content {
  background-color: #fff;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: slideInModal 0.3s ease;
}

@keyframes slideInModal {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.help-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.help-close {
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1.5rem;
  color: #4a90e2;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.help-close:hover {
  background-color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.help-modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.help-modal-body::-webkit-scrollbar {
  width: 8px;
}

.help-modal-body::-webkit-scrollbar-track {
  background: #f7fafc;
}

.help-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.help-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f1f5f9;
}

.help-section:last-child {
  border-bottom: none;
}

.help-section h3 {
  margin: 0 0 1rem 0;
  color: #2d3748;
  font-size: 1.2rem;
  border-left: 4px solid #4a90e2;
  padding-left: 0.75rem;
}

.help-section p {
  margin: 0 0 1rem 0;
  color: #4a5568;
  line-height: 1.6;
}

.help-section p:last-child {
  margin-bottom: 0;
}

.help-section ul {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
  color: #4a5568;
}

.help-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.help-section a {
  color: #4a90e2;
  text-decoration: none;
}

.help-section a:hover {
  text-decoration: underline;
}

/* タブナビゲーションのレスポンシブ対応 */
@media (max-width: 768px) {
  .tab-nav {
    padding: 0 1rem;
    gap: 1px;
  }
  
  .tab-button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  main {
    min-height: calc(100vh - 180px);
  }
  
  .tab-content {
    margin: 0 1rem 1rem 1rem;
    padding: 1.5rem;
    border-radius: 0 8px 8px 8px;
  }
}

/* ヘルプボタンとモーダルのモバイル対応 */
@media (max-width: 768px) {
  .help-button {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    top: 1.5rem; /* モバイルでもヘッダーと同じ行に配置 */
    right: 15px;
  }
  
  .help-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .help-modal-header {
    padding: 1rem 1.5rem;
  }
  
  .help-modal-header h2 {
    font-size: 1.3rem;
  }
  
  .help-section {
    padding: 1rem 1.5rem;
  }
  
  .help-section h3 {
    font-size: 1.1rem;
  }
}
