/* ===========================
   リセット・ベーススタイル
=========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f0f4f8;
  color: #333;
  line-height: 1.6;
}

/* ===========================
   ヘッダー
=========================== */
header {
  background: linear-gradient(135deg, #2d7dd2, #3ab5a0);
  color: white;
  padding: 18px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

header p {
  font-size: 0.88rem;
  opacity: 0.85;
  margin-top: 4px;
}

/* ===========================
   コンテナ
=========================== */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ===========================
   単語追加ボタン
=========================== */
.open-form-btn {
  background: #2d7dd2;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  transition: background 0.2s;
  display: inline-block;
}

.open-form-btn:hover {
  background: #2568b8;
}

/* ===========================
   フォームセクション
=========================== */
.form-section {
  background: white;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
}

.form-section h2 {
  font-size: 1.1rem;
  color: #2d7dd2;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f1fb;
}

/* フォームグループ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.required-mark {
  color: #e55;
  margin-left: 2px;
}

.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
  color: #333;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #2d7dd2;
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.1);
}

/* エラーメッセージ */
.error-msg {
  color: #e55;
  font-size: 0.82rem;
  margin-top: 5px;
  display: none;
}

/* 動的入力リスト */
.dynamic-input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.dynamic-input-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dynamic-input-item input[type="text"] {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.dynamic-input-item input[type="text"]:focus {
  outline: none;
  border-color: #2d7dd2;
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.1);
}

.remove-item-btn {
  background: #fde8e8;
  color: #e55;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s;
  line-height: 1;
}

.remove-item-btn:hover {
  background: #fbd0d0;
}

.add-item-btn {
  background: transparent;
  color: #3ab5a0;
  border: 1.5px dashed #3ab5a0;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.add-item-btn:hover {
  background: #e8faf7;
}

/* フォームボタン */
.form-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.btn-primary {
  background: #2d7dd2;
  color: white;
  border: none;
  padding: 11px 26px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2568b8;
}

.btn-cancel {
  background: #f0f0f0;
  color: #666;
  border: none;
  padding: 11px 22px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

/* ===========================
   コントロールセクション（検索・並び替え・フィルター）
=========================== */
.controls-section {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
}

/* 検索・並び替え行 */
.search-sort-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 13px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #2d7dd2;
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.1);
}

.sort-select {
  padding: 10px 13px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-select:focus {
  outline: none;
  border-color: #2d7dd2;
}

/* フィルターボタン行 */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.filter-btn {
  background: #f0f4f8;
  color: #666;
  border: 1.5px solid #ddd;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.83rem;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #2d7dd2;
  color: white;
  border-color: #2d7dd2;
}

.filter-btn:hover:not(.active) {
  background: #e5edf7;
  border-color: #c5d5e8;
}

/* 意味表示トグル */
.meaning-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}

/* トグルスイッチ */
.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #3ab5a0;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9rem;
  color: #555;
}

/* 単語件数 */
.word-count-text {
  font-size: 0.83rem;
  color: #999;
  margin-top: 10px;
}

/* ===========================
   単語カード一覧
=========================== */
.word-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 単語カード */
.word-card {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  border-left: 5px solid #2d7dd2;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.word-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

/* カードの左ボーダー色：お気に入り・苦手の状態に応じて変える */
.word-card.is-favorite {
  border-left-color: #f5a623;
}

.word-card.is-weak {
  border-left-color: #ff9500;
}

.word-card.is-favorite.is-weak {
  border-left-color: #e55;
}

/* カードヘッダー */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.word-title-area {
  flex: 1;
  min-width: 0;
}

.word-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  word-break: break-word;
}

.pos-badge {
  display: inline-block;
  background: #e8f1fb;
  color: #2d7dd2;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 5px;
}

/* 品詞タブ */
.pos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.pos-tab-btn {
  padding: 3px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1.5px solid #c5d3f7;
  border-radius: 12px;
  background: white;
  color: #5b86e5;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.pos-tab-btn:hover {
  background: #eef2fd;
}

.pos-tab-btn.active {
  background: #2d7dd2;
  color: white;
  border-color: #2d7dd2;
}

/* フラグボタン群 */
.card-flag-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.flag-btn {
  border: 1.5px solid #ddd;
  background: white;
  color: #999;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.flag-btn:hover {
  background: #f5f5f5;
}

.flag-btn.favorite-on {
  background: #fff8e1;
  border-color: #f5a623;
  color: #d48806;
  font-weight: 600;
}

.flag-btn.weak-on {
  background: #fff3e0;
  border-color: #ff9500;
  color: #c67400;
  font-weight: 600;
}

/* 意味セクション */
.card-section {
  margin-bottom: 10px;
}

.card-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.meanings-list {
  list-style: none;
  padding: 0;
}

.meanings-list li {
  font-size: 0.95rem;
  color: #444;
  padding: 2px 0;
}

.meanings-list li::before {
  content: '・';
  color: #2d7dd2;
}

/* 意味が非表示のときのプレースホルダー */
.meaning-hidden-text {
  font-size: 0.88rem;
  color: #bbb;
  font-style: italic;
  padding: 4px 0;
}

/* 例文リスト（カード表示） */
.examples-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.examples-list li {
  padding: 6px 10px;
  border-left: 3px solid #e0e0e0;
  background: #fafafa;
  border-radius: 0 4px 4px 0;
}

.example-english {
  font-size: 0.88rem;
  color: #555;
  font-style: italic;
}

.example-japanese {
  font-size: 0.82rem;
  color: #999;
  margin-top: 2px;
}

/* コピーボタン（単語・例文共通） */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 0.75rem;
  color: #666;
  background: #f0f0f0;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 28px;
}

.copy-btn:hover {
  background: #e2e2e2;
  color: #333;
}

.copy-btn.copied {
  background: #d4edda;
  color: #1a7f37;
  border-color: #a8d5b5;
}

/* 単語タイトル行（単語名＋コピーボタン横並び） */
.word-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 例文行（テキスト＋コピーボタン横並び） */
.example-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.example-row .example-english {
  flex: 1;
  min-width: 0;
}

/* コピー完了トースト通知 */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2c3e50;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   画像機能
=========================== */

/* カード内の画像表示エリア */
.card-image-area {
  margin: 10px 0 4px;
  text-align: center;
}

.card-image-img {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* フォーム内の画像入力エリア */
.image-form-area {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.image-preview-box {
  width: 110px;
  height: 110px;
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: #fafafa;
}

.image-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.no-image-text {
  font-size: 0.78rem;
  color: #bbb;
  text-align: center;
  padding: 4px;
}

.image-form-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
}

/* 画像選択ボタン（label要素） */
.image-select-btn {
  display: inline-block;
  padding: 7px 14px;
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #444;
  transition: background 0.15s;
  text-align: center;
  white-space: nowrap;
}

.image-select-btn:hover {
  background: #e4e4e4;
}

/* 画像操作ボタン（削除・取り消しなど） */
.image-action-btn {
  padding: 7px 14px;
  background: white;
  border: 1px solid #e0a0a0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #c0392b;
  transition: background 0.15s;
  white-space: nowrap;
}

.image-action-btn:hover {
  background: #fff0f0;
}

/* 例文ペア入力欄（フォーム） */
.example-pair-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.example-pair-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.example-pair-inputs input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.example-pair-inputs input[type="text"]:focus {
  outline: none;
  border-color: #2d7dd2;
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.1);
}

.example-pair-inputs input.input-japanese {
  border-color: #e8e8e8;
  background: #fafafa;
  font-size: 0.88rem;
}

.example-pair-inputs input.input-japanese:focus {
  border-color: #3ab5a0;
  box-shadow: 0 0 0 3px rgba(58, 181, 160, 0.1);
  background: white;
}

/* クイズ成績表示（カード内） */
.card-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: #f8f9fb;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.stat-item {
  color: #888;
  white-space: nowrap;
}

.stat-item span {
  font-weight: 600;
  color: #555;
}

.stat-accuracy {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.stat-accuracy.not-tried {
  background: #f0f0f0;
  color: #aaa;
}

.stat-accuracy.low {
  background: #fde8e8;
  color: #c44;
}

.stat-accuracy.mid {
  background: #fff3e0;
  color: #b36200;
}

.stat-accuracy.high {
  background: #e6f7f3;
  color: #1d7a6a;
}

/* カードアクションボタン */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.btn-edit {
  background: #e8f1fb;
  color: #2d7dd2;
  border: none;
  padding: 7px 18px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-edit:hover {
  background: #d1e5f8;
}

.btn-delete {
  background: #fde8e8;
  color: #e55;
  border: none;
  padding: 7px 18px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-delete:hover {
  background: #fbd0d0;
}

/* ===========================
   空の状態
=========================== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #bbb;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.empty-state p {
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ===========================
   削除確認モーダル
=========================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 14px;
  padding: 28px 24px;
  max-width: 360px;
  width: 92%;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
}

.modal-box h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 10px;
}

.modal-box p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 22px;
  line-height: 1.6;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-modal-cancel {
  background: #f0f0f0;
  color: #666;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-modal-cancel:hover {
  background: #e0e0e0;
}

.btn-modal-delete {
  background: #e55;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-modal-delete:hover {
  background: #cc3333;
}

/* ===========================
   クイズセクション
=========================== */

/* クイズへ遷移ボタン（index.html） */
.go-quiz-btn {
  background: #3ab5a0;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  margin-left: 10px;
  transition: background 0.2s;
  display: inline-block;
  text-decoration: none;
}

.go-quiz-btn:hover {
  background: #2e9e8c;
}

/* ===========================
   クイズページ専用レイアウト
=========================== */

/* quiz.html のコンテナ：クイズエリアを中央に集中させる */
.quiz-page-container {
  max-width: 640px;
}

/* 単語帳に戻るボタン */
.back-to-vocab-btn {
  display: inline-block;
  color: #2d7dd2;
  background: #eaf1fb;
  border: 1.5px solid #c5d5e8;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 18px;
  transition: background 0.2s, border-color 0.2s;
}

.back-to-vocab-btn:hover {
  background: #d6e6f7;
  border-color: #2d7dd2;
}

/* クイズエリア全体 */
.quiz-section {
  background: white;
  border-radius: 14px;
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  border-top: 4px solid #3ab5a0;
}

.quiz-section h2 {
  font-size: 1.1rem;
  color: #3ab5a0;
  margin-bottom: 6px;
}

/* クイズのメッセージ表示 */
.quiz-message {
  font-size: 0.92rem;
  color: #888;
  margin-bottom: 20px;
}

/* 問題の英単語 */
.quiz-question-word {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  padding: 20px 10px 8px;
  letter-spacing: 0.03em;
}

/* 問題の品詞バッジ */
.quiz-question-pos {
  text-align: center;
  margin-bottom: 28px;
}

/* 4択ボタン群 */
.quiz-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-choice-btn {
  background: #f5f7fa;
  border: 2px solid #e0e4ea;
  color: #333;
  padding: 14px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  word-break: break-all;
}

.quiz-choice-btn:hover:not(:disabled) {
  background: #eaf1fb;
  border-color: #2d7dd2;
}

/* 正解 */
.quiz-choice-btn.correct {
  background: #e6f7f3;
  border-color: #3ab5a0;
  color: #1d7a6a;
  font-weight: 700;
}

/* 不正解（選んだ選択肢） */
.quiz-choice-btn.wrong {
  background: #fde8e8;
  border-color: #e55;
  color: #a33;
  font-weight: 700;
}

/* 判定後はボタンを無効化 */
.quiz-choice-btn:disabled {
  cursor: default;
}

/* 正解 / 不正解フィードバック */
.quiz-feedback {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 10px 0 6px;
  min-height: 32px;
}

.quiz-feedback.correct {
  color: #3ab5a0;
}

.quiz-feedback.wrong {
  color: #e55;
}

/* 次の問題へボタン */
.quiz-next-btn {
  display: block;
  width: 100%;
  background: #2d7dd2;
  color: white;
  border: none;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 16px;
  transition: background 0.2s;
}

.quiz-next-btn:hover {
  background: #2568b8;
}

/* クイズ終了ボタン */
.quiz-end-btn {
  display: block;
  width: 100%;
  background: #f0f0f0;
  color: #666;
  border: none;
  padding: 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 10px;
  transition: background 0.2s;
}

.quiz-end-btn:hover {
  background: #e0e0e0;
}

/* クイズモード選択UI */
.quiz-mode-group {
  margin-bottom: 18px;
}

.quiz-mode-row-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.quiz-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-mode-btn {
  background: #f0f4f8;
  color: #555;
  border: 1.5px solid #ddd;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.quiz-mode-btn.selected {
  background: #3ab5a0;
  color: white;
  border-color: #3ab5a0;
  font-weight: 600;
}

.quiz-mode-btn:hover:not(.selected) {
  background: #e5edf7;
}

.quiz-pos-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: #f5f9f8;
  border-radius: 8px;
}

.quiz-pos-select-row label {
  font-size: 0.85rem;
  color: #555;
  white-space: nowrap;
  font-weight: 600;
}

.quiz-pos-select-row select {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  color: #333;
}

.quiz-pos-select-row select:focus {
  outline: none;
  border-color: #3ab5a0;
}

.quiz-start-btn {
  display: block;
  width: 100%;
  background: #3ab5a0;
  color: white;
  border: none;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 16px;
  transition: background 0.2s;
}

.quiz-start-btn:hover {
  background: #2e9e8c;
}

.quiz-mode-error {
  color: #e55;
  font-size: 0.88rem;
  margin-top: 10px;
  padding: 8px 12px;
  background: #fde8e8;
  border-radius: 8px;
  display: none;
}

/* ===========================
   スペル入力クイズ
=========================== */

/* 問題文（日本語の意味） */
.quiz-question-meaning {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  padding: 20px 10px 8px;
  line-height: 1.5;
}

.quiz-question-hint {
  text-align: center;
  margin-bottom: 24px;
}

/* 入力欄 + 解答ボタンの行 */
.spell-input-area {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.spell-input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
  min-width: 0;
}

.spell-input:focus {
  outline: none;
  border-color: #2d7dd2;
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.1);
}

.spell-input:disabled {
  background: #f5f5f5;
  color: #aaa;
}

.spell-submit-btn {
  background: #2d7dd2;
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.spell-submit-btn:hover:not(:disabled) {
  background: #2568b8;
}

.spell-submit-btn:disabled {
  background: #aaa;
  cursor: default;
}

/* 不正解時の正解詳細ボックス */
.spell-answer-detail {
  background: #fafafa;
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}

.spell-answer-word {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.spell-answer-meanings {
  margin-top: 4px;
}

/* 英文入力クイズのヒント表示 */
.sentence-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f5f7fa;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sentence-hint-label {
  font-size: 0.78rem;
  color: #aaa;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 2px;
}

.sentence-hint {
  font-family: monospace;
  font-size: 1rem;
  color: #999;
  letter-spacing: 0.08em;
  word-break: break-all;
}

/* 例文クイズの問題文（英文） */
.quiz-question-sentence {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.6;
  margin-bottom: 8px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #5b86e5;
}

/* 例文クイズの出典（単語・品詞） */
.quiz-question-source {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 20px;
}

/* 例文穴埋めクイズ */
.fillblank-sentence {
  font-size: 1.15rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.7;
  margin-bottom: 10px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1.5px solid #d0dde8;
  border-radius: 10px;
  word-break: break-word;
}

.fillblank-japanese {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 12px;
  padding: 0 2px;
}

.fillblank-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.fillblank-hint-label {
  font-size: 0.82rem;
  color: #999;
  white-space: nowrap;
}

.fillblank-hint-chars {
  font-family: monospace;
  font-size: 1rem;
  color: #2d7dd2;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.fillblank-source {
  font-size: 0.82rem;
  color: #aaa;
  margin-bottom: 14px;
}

/* クイズ種別選択（4択 / スペル入力 / 英文入力） */
.quiz-type-group {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

/* ===========================
   データ管理セクション
=========================== */
.data-manage-section {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  border-top: 3px solid #8b9dc3;
}

.data-manage-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.data-manage-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-export {
  background: #f0f4f8;
  color: #2d7dd2;
  border: 1.5px solid #c5d5e8;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.btn-export:hover {
  background: #d6e6f7;
  border-color: #2d7dd2;
}

.btn-import {
  background: #f0faf7;
  color: #3ab5a0;
  border: 1.5px solid #b0ddd5;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
  display: inline-block;
  user-select: none;
}

.btn-import:hover {
  background: #d6f0ea;
  border-color: #3ab5a0;
}

.data-manage-note {
  font-size: 0.8rem;
  color: #bbb;
  margin-top: 10px;
}

/* 結果通知エリア */
.data-manage-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
}

.data-manage-result.success {
  background: #e6f7f3;
  color: #1d7a6a;
  border: 1px solid #b0ddd5;
}

.data-manage-result.error {
  background: #fde8e8;
  color: #a33;
  border: 1px solid #f5b8b8;
}

/* ===========================
   インポートモーダル
=========================== */
.import-modal-box {
  max-width: 460px;
}

.import-file-info {
  font-size: 0.88rem;
  color: #555;
  background: #f5f7fa;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 18px !important;
}

.import-mode-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.import-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #e0e4ea;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.import-mode-option:has(input:checked) {
  border-color: #3ab5a0;
  background: #f0faf7;
}

.import-mode-option input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #3ab5a0;
}

.import-mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.import-mode-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
}

.import-mode-desc {
  font-size: 0.82rem;
  color: #888;
  line-height: 1.5;
}

.import-warning {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c05000;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 18px !important;
}

/* インポートモーダルの実行ボタン */
.btn-modal-confirm {
  background: #3ab5a0;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-modal-confirm:hover {
  background: #2e9e8c;
}

/* ===========================
   レスポンシブ（スマホ対応）
=========================== */
@media (max-width: 520px) {
  header h1 {
    font-size: 1.3rem;
  }

  .card-header {
    flex-direction: column;
    gap: 10px;
  }

  .card-flag-buttons {
    justify-content: flex-start;
  }

  .word-title {
    font-size: 1.15rem;
  }

  .form-buttons {
    flex-direction: column;
  }

  .btn-primary,
  .btn-cancel {
    width: 100%;
    text-align: center;
  }

  .open-quiz-btn {
    margin-left: 0;
    margin-top: 8px;
  }

  .quiz-choices {
    grid-template-columns: 1fr;
  }

  .quiz-question-word {
    font-size: 1.6rem;
  }

  .copy-btn {
    min-height: 32px;
    padding: 4px 10px;
  }
}

/* ===========================
   フラッシュカードページ
=========================== */

/* フラッシュカードへ遷移ボタン（index.html） */
.go-flashcard-btn {
  background: #7c5cbf;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  margin-left: 10px;
  transition: background 0.2s;
  display: inline-block;
  text-decoration: none;
}

.go-flashcard-btn:hover {
  background: #6a4caa;
}

/* フラッシュカードページのコンテナ */
.fc-page-container {
  max-width: 680px;
}

/* 絞り込み・設定パネル */
.fc-filter-section {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
}

/* メインフィルター行（すべて・お気に入り・苦手） */
.fc-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fc-filter-btn {
  background: #f0f4f8;
  color: #666;
  border: 1.5px solid #ddd;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.83rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.fc-filter-btn.active {
  background: #2d7dd2;
  color: white;
  border-color: #2d7dd2;
}

.fc-filter-btn:hover:not(.active) {
  background: #e5edf7;
  border-color: #c5d5e8;
}

/* 品詞フィルター行 */
.fc-filter-pos-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.fc-pos-filter-btn {
  background: #f5f0ff;
  color: #7c5cbf;
  border: 1.5px solid #d5c8f0;
  padding: 4px 13px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.fc-pos-filter-btn.active {
  background: #7c5cbf;
  color: white;
  border-color: #7c5cbf;
}

.fc-pos-filter-btn:hover:not(.active) {
  background: #ece4ff;
  border-color: #b9a5e0;
}

/* ランダムトグル行 */
.fc-random-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.fc-card-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: #999;
}

/* ===========================
   フラッシュカードエリア
=========================== */

.fc-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* 空メッセージ */
.fc-empty {
  background: white;
  border-radius: 14px;
  padding: 52px 24px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  width: 100%;
  color: #888;
  font-size: 0.95rem;
  line-height: 2;
}

/* カードラッパー（中央寄せ） */
.fc-card-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* フラッシュカード本体（3D パースペクティブコンテナ） */
.fc-card {
  width: 100%;
  max-width: 560px;
  height: 340px;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* カード内側（回転する要素） */
.fc-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.fc-card-inner.flipped {
  transform: rotateY(180deg);
}

/* 表面・裏面 共通 */
.fc-card-front,
.fc-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 表面 */
.fc-card-front {
  background: white;
  border-top: 6px solid #2d7dd2;
}

.fc-card-front-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 24px 28px 0;
}

/* カード表面の英単語 */
.fc-word {
  font-size: 2.8rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 0.02em;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

/* カード表面のヒント文 */
.fc-flip-hint {
  font-size: 0.72rem;
  color: #c8c8c8;
  padding: 12px 0 18px;
  letter-spacing: 0.06em;
}

/* 裏面 */
.fc-card-back {
  background: #f7f4ff;
  border-top: 6px solid #7c5cbf;
  transform: rotateY(180deg);
  justify-content: flex-start;
  padding: 22px 28px;
  overflow-y: auto;
}

.fc-card-back-content {
  width: 100%;
}

/* 裏面：品詞バッジ */
.fc-back-pos {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7c5cbf;
  background: #ede8ff;
  padding: 3px 13px;
  border-radius: 12px;
  margin-bottom: 13px;
  letter-spacing: 0.03em;
}

/* 裏面：意味リスト */
.fc-back-meanings {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.fc-back-meanings li {
  font-size: 1.0rem;
  color: #333;
  padding: 3px 0;
  line-height: 1.55;
}

.fc-back-meanings li::before {
  content: '・';
  color: #7c5cbf;
}

/* 裏面：例文リスト */
.fc-back-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-back-example-item {
  padding: 8px 12px;
  border-left: 3px solid #c4b0f0;
  background: white;
  border-radius: 0 6px 6px 0;
}

.fc-back-example-en {
  font-size: 0.88rem;
  color: #555;
  font-style: italic;
  line-height: 1.55;
}

.fc-back-example-ja {
  font-size: 0.82rem;
  color: #888;
  margin-top: 3px;
  line-height: 1.4;
}

/* ===========================
   表/裏ボタン・ナビゲーション
=========================== */

/* 表を見る / 裏を見る ボタン */
.fc-face-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.fc-face-btn {
  background: white;
  color: #555;
  border: 1.5px solid #ddd;
  padding: 8px 22px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.fc-face-btn:hover {
  background: #f0f0f0;
  border-color: #bbb;
}

/* 前へ / 次へ ナビゲーション */
.fc-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  width: 100%;
  max-width: 560px;
}

.fc-nav-btn {
  background: white;
  color: #2d7dd2;
  border: 1.5px solid #c5d5e8;
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}

.fc-nav-btn:hover:not(:disabled) {
  background: #eaf1fb;
  border-color: #2d7dd2;
}

.fc-nav-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.fc-progress {
  font-size: 0.9rem;
  color: #888;
  min-width: 64px;
  text-align: center;
}

/* ===========================
   レスポンシブ（フラッシュカード）
=========================== */
@media (max-width: 520px) {
  .fc-card {
    height: 280px;
  }

  .fc-word {
    font-size: 2.1rem;
  }

  .fc-card-back {
    padding: 16px 18px;
  }

  .fc-back-meanings li {
    font-size: 0.95rem;
  }

  .fc-nav-btn {
    padding: 9px 16px;
    font-size: 0.88rem;
  }

  .go-flashcard-btn {
    margin-left: 0;
    margin-top: 0;
  }
}

/* ===========================
   フラッシュカード自動モード
=========================== */

/* モード切替行 */
.fc-mode-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.fc-mode-btn {
  background: #f0f4f8;
  color: #666;
  border: 1.5px solid #ddd;
  padding: 7px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
}

.fc-mode-btn.active {
  background: #2d7dd2;
  color: white;
  border-color: #2d7dd2;
}

.fc-mode-btn:hover:not(.active) {
  background: #e5edf7;
  border-color: #c5d5e8;
}

/* ステップインジケーター */
.fc-auto-step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.fc-step-item {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ccc;
  transition: color 0.3s;
  letter-spacing: 0.03em;
}

.fc-step-item::before {
  content: '●';
  font-size: 0.5rem;
  margin-right: 5px;
  vertical-align: middle;
}

.fc-step-item.active  { color: #7c5cbf; }
.fc-step-item.done    { color: #3ab5a0; }
.fc-step-item.pending { color: #ccc; }
.fc-step-item.skip    { color: #e8e8e8; }

.fc-step-sep {
  color: #ddd;
  font-size: 0.78rem;
}

/* 自動モード：再生コントロール */
.fc-auto-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.fc-auto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 30px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.fc-auto-btn:active {
  transform: scale(0.97);
}

.fc-auto-start-btn {
  background: #7c5cbf;
  color: white;
}
.fc-auto-start-btn:hover { background: #6a4caa; }

.fc-auto-pause-btn {
  background: #f0f4f8;
  color: #555;
  border: 1.5px solid #ddd;
}
.fc-auto-pause-btn:hover { background: #e0e0e0; }

.fc-auto-resume-btn {
  background: #3ab5a0;
  color: white;
}
.fc-auto-resume-btn:hover { background: #2e9e8c; }

/* 例文の段階表示（自動モード step 1 で例文を一時的に隠す） */
.fc-card-back .fc-back-examples {
  transition: opacity 0.4s ease;
}

.fc-card-back.hide-examples .fc-back-examples {
  opacity: 0;
  pointer-events: none;
}

/* ===========================
   レスポンシブ（自動モード）
=========================== */
@media (max-width: 520px) {
  .fc-auto-btn {
    padding: 10px 20px;
    font-size: 0.88rem;
  }

  .fc-step-item {
    font-size: 0.75rem;
  }
}

/* ===========================
   例文管理ページ
=========================== */

/* 例文管理ページへ遷移するボタン（index.html） */
.go-sentences-btn {
  background: #e67e22;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  margin-left: 10px;
  transition: background 0.2s;
  display: inline-block;
  text-decoration: none;
}

.go-sentences-btn:hover {
  background: #ca6f1e;
}

/* 例文管理ページのコンテナ幅 */
.sentences-page-container {
  max-width: 820px;
}

/* 例文カード */
.sentence-card {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  border-left: 5px solid #e67e22;
  transition: box-shadow 0.2s;
}

.sentence-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

/* 英文テキスト */
.sentence-card-english {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.6;
  margin-bottom: 6px;
  word-break: break-word;
}

/* 日本語訳テキスト */
.sentence-card-japanese {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* 関連単語エリア */
.sentence-card-related {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sentence-related-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-top: 2px;
}

.sentence-related-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* 関連単語バッジ */
.sentence-related-word {
  display: inline-block;
  background: #fef3e8;
  color: #c0681a;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #f0c090;
}

/* 関連単語なしの表示 */
.sentence-no-related {
  font-size: 0.82rem;
  color: #ccc;
  font-style: italic;
}

/* ===========================
   レスポンシブ（例文管理）
=========================== */
@media (max-width: 520px) {
  .go-sentences-btn {
    margin-left: 0;
    margin-top: 0;
  }

  .sentence-card-english {
    font-size: 1rem;
  }
}

/* ===========================
   作品一覧ページ（sentences.html）
=========================== */

/* カテゴリーセクション */
.work-category-section {
  margin-bottom: 28px;
}

.work-category-section-header {
  margin-bottom: 10px;
}

/* カテゴリーバッジ（作品一覧用） */
.work-cat-badge {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.work-cat-movie  { background: #dbeafe; color: #1e40af; }
.work-cat-song   { background: #fce7f3; color: #9d174d; }
.work-cat-book   { background: #d1fae5; color: #065f46; }
.work-cat-tv     { background: #ede9fe; color: #5b21b6; }
.work-cat-game   { background: #ffedd5; color: #9a3412; }
.work-cat-other  { background: #f3f4f6; color: #4b5563; }

/* 作品カードのコンテナ */
.work-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 作品カード */
.work-card {
  background: white;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.work-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.work-card-info {
  flex: 1;
  min-width: 0;
}

.work-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 3px;
  word-break: break-word;
}

.work-card-count {
  font-size: 0.82rem;
  color: #999;
}

/* 「開く」ボタン */
.btn-open-work {
  background: #e8f1fb;
  color: #2d7dd2;
  border: 1.5px solid #c5d5e8;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.btn-open-work:hover {
  background: #d6e6f7;
  border-color: #2d7dd2;
}

/* ===========================
   作品ページ（sentence-work.html）
=========================== */

/* コピーボタン行（英文カードの中） */
.sentence-copy-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ===========================
   レスポンシブ（作品ページ）
=========================== */
@media (max-width: 520px) {
  .work-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .sentence-copy-buttons {
    gap: 5px;
  }
}
