/* =============================================
   ビジネス会計検定 問題道場 - スタイルシート
   ============================================= */

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

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: #f4f6f9;
  color: #333;
  line-height: 1.7;
}

/* ヘッダー */
header {
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  color: white;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
}

.site-title span {
  font-size: 0.85rem;
  display: block;
  font-weight: normal;
  opacity: 0.85;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

nav a {
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.9;
  transition: opacity 0.2s;
}

nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ヒーローセクション */
.hero {
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  color: white;
  text-align: center;
  padding: 60px 20px 80px;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* メインコンテンツ */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* グレードカード */
.grade-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.grade-card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border-top: 5px solid #2d6a9f;
  transition: transform 0.2s, box-shadow 0.2s;
}

.grade-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.grade-card.grade2 {
  border-top-color: #c0392b;
}

.grade-card h2 {
  font-size: 1.5rem;
  color: #1a3a5c;
  margin-bottom: 12px;
}

.grade-card.grade2 h2 {
  color: #c0392b;
}

.grade-card p {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.topic-list {
  list-style: none;
  margin-bottom: 24px;
}

.topic-list li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  color: #555;
}

.topic-list li::before {
  content: "▶ ";
  color: #2d6a9f;
  font-size: 0.7rem;
}

.grade-card.grade2 .topic-list li::before {
  color: #c0392b;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #2d6a9f;
  color: white;
}

.btn-primary:hover {
  background: #1a3a5c;
  transform: translateY(-1px);
}

.btn-danger {
  background: #c0392b;
  color: white;
}

.btn-danger:hover {
  background: #922b21;
  transform: translateY(-1px);
}

/* 広告エリア */
.ad-area {
  background: #f8f9fa;
  border: 1px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 30px 0;
  color: #999;
  font-size: 0.85rem;
}

/* 問題ページ */
.page-header {
  background: white;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 6px solid #2d6a9f;
}

.page-header.grade2 {
  border-left-color: #c0392b;
}

.page-header h1 {
  font-size: 1.6rem;
  color: #1a3a5c;
  margin-bottom: 8px;
}

.page-header p {
  color: #666;
  font-size: 0.95rem;
}

/* カテゴリタブ */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 8px 18px;
  border: 2px solid #2d6a9f;
  border-radius: 20px;
  background: white;
  color: #2d6a9f;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn:hover,
.tab-btn.active {
  background: #2d6a9f;
  color: white;
}

.tab-btn.grade2-tab {
  border-color: #c0392b;
  color: #c0392b;
}

.tab-btn.grade2-tab:hover,
.tab-btn.grade2-tab.active {
  background: #c0392b;
  color: white;
}

/* 問題カード */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quiz-number {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 8px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quiz-question {
  font-size: 1.05rem;
  font-weight: bold;
  color: #1a3a5c;
  margin-bottom: 20px;
  line-height: 1.6;
}

.quiz-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.quiz-table th {
  background: #f0f4f8;
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: center;
}

.quiz-table td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: right;
}

.quiz-table td:first-child {
  text-align: left;
}

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

.option-btn {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
  color: #333;
}

.option-btn:hover:not(:disabled) {
  border-color: #2d6a9f;
  background: #f0f7ff;
}

.option-btn.correct {
  border-color: #27ae60;
  background: #eafaf1;
  color: #1e8449;
  font-weight: bold;
}

.option-btn.wrong {
  border-color: #e74c3c;
  background: #fef9f9;
  color: #c0392b;
}

.option-btn:disabled {
  cursor: not-allowed;
}

.answer-area {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #27ae60;
}

.answer-area.show {
  display: block;
}

.answer-area.wrong-answer {
  border-left-color: #e74c3c;
}

.answer-label {
  font-weight: bold;
  color: #27ae60;
  margin-bottom: 8px;
}

.answer-area.wrong-answer .answer-label {
  color: #e74c3c;
}

.explanation {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.7;
}

.show-answer-btn {
  padding: 8px 20px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  color: #555;
  transition: background 0.2s;
}

.show-answer-btn:hover {
  background: #e0e0e0;
}

/* 進捗バー */
.progress-bar-wrap {
  background: #e8ecf0;
  border-radius: 10px;
  height: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2d6a9f, #5b9bd5);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: #888;
  text-align: right;
  margin-top: 6px;
}

/* スコア表示 */
.score-display {
  background: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.score-display .score-num {
  font-size: 2.5rem;
  font-weight: bold;
  color: #2d6a9f;
}

.score-display .score-label {
  color: #888;
  font-size: 0.9rem;
}

/* フッター */
footer {
  background: #1a3a5c;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 32px 20px;
  margin-top: 60px;
  font-size: 0.88rem;
}

footer a {
  color: rgba(255,255,255,0.8);
  margin: 0 12px;
  text-decoration: none;
}

footer a:hover {
  color: white;
}

.footer-links {
  margin-bottom: 12px;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .grade-cards {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  nav ul {
    gap: 16px;
  }

  .quiz-card {
    padding: 20px;
  }
}
