/* マナビバ - スタイルシート (モバイルファースト) */

/* ===== CSS変数 ===== */
:root {
  /* ブランドカラー */
  --color-primary: #5B8C3E;
  --color-primary-hover: #4a7632;
  --color-secondary: #A2C553;
  --color-accent: #FF905A;
  --color-accent-hover: #E67A45;
  --color-bg: #F9F9F5;
  --color-text: #312521;
  --color-text-sub: #666666;
  --color-white: #FFFFFF;
  --color-border: #E0E0E0;
  --color-border-focus: #5B8C3E;
  
  /* 職種カラー */
  --color-doctor: #8B7AB8;
  --color-nurse: #5B8C3E;
  --color-rehab: #4A90E2;
  --color-care: #E85D75;
  --color-office: #FF905A;
  --color-other: #7D7D7D;
  
  /* タイポグラフィ */
  --font-family: 'Noto Sans JP', 'Hiragino Sans', '游ゴシック', 'Yu Gothic', sans-serif;
  --font-size-base: 20px;      /* スマホ基準 */
  --font-size-sm: 16px;        /* 補助テキスト最小 */
  --font-size-lg: 26px;        /* 見出し */
  --font-size-xl: 30px;        /* 大見出し */
  --font-size-btn: 20px;       /* ボタンテキスト */
  
  /* スペース */
  --header-height: 64px;
  --bottom-nav-height: 72px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-full: 9999px;
  
  /* シャドウ */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-accent: 0 4px 12px rgba(255,144,90,0.4);
}

/* ===== リセット・基本 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* フォーカス可視化（アクセシビリティ） */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

button, a, input, select, textarea {
  font-family: inherit;
}

/* ===== ローディング画面 ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
}

.loading-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 900;
  color: var(--color-primary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== レイアウト ===== */
#app {
  min-height: 100vh;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* コンテンツエリア（ヘッダー・ボトムナビの高さ分オフセット） */
.main-content {
  padding-top: var(--header-height);
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  min-height: 100vh;
}

/* ===== ヘッダー ===== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-white);
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}

.header-logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-white);
  font-size: 20px;
  position: relative;
  transition: background 0.2s;
  text-decoration: none;
}

.header-icon-btn:hover, .header-icon-btn:focus-visible {
  background: rgba(255,255,255,0.3);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background-color: var(--color-accent);
  border-radius: 50%;
  font-size: 10px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ===== ボトムナビゲーション ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: var(--color-white);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--color-text-sub);
  font-size: 11px;
  padding: 8px 0;
  min-height: 44px;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
  position: relative;
}

.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-item.active .nav-icon {
  color: var(--color-primary);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

/* 中央の投稿ボタン */
.bottom-nav-post-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
}

.post-fab {
  width: 64px;
  height: 64px;
  background-color: var(--color-accent);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: transform 0.2s, box-shadow 0.2s;
  color: white;
  font-size: 28px;
  margin-top: -20px;
  position: relative;
}

.post-fab:hover, .post-fab:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255,144,90,0.6);
}

.post-fab:active {
  transform: scale(0.95);
}

/* ===== カード ===== */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 12px;
}

.card:hover {
  box-shadow: var(--shadow-sm);
}

/* 質問カード */
.post-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
  text-decoration: none;
  display: block;
  color: inherit;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.post-card:active {
  transform: translateY(0);
}

.post-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.post-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-sm);
  color: var(--color-text-sub);
}

.post-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== タグ・バッジ ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-category {
  background-color: rgba(91, 140, 62, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(91, 140, 62, 0.3);
}

.tag-anonymous {
  background-color: rgba(102, 102, 102, 0.1);
  color: var(--color-text-sub);
  border: 1px solid rgba(102, 102, 102, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: 12px;
  font-weight: 700;
}

.badge-unanswered {
  background-color: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFB74D;
}

.badge-answered {
  background-color: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #81C784;
}

.badge-best {
  background-color: #FFF8E1;
  color: #F57F17;
  border: 1px solid #FFD54F;
}

/* ===== アバター ===== */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-white);
  flex-shrink: 0;
  font-size: 18px;
}

.avatar-sm {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.avatar-md {
  width: 64px;
  height: 64px;
  font-size: 26px;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 32px;
}

/* 職種別ボーダー */
.avatar-border {
  outline: 3px solid;
  outline-offset: 2px;
}

.avatar-doctor { background-color: var(--color-doctor); }
.avatar-nurse { background-color: var(--color-nurse); }
.avatar-rehab { background-color: var(--color-rehab); }
.avatar-care { background-color: var(--color-care); }
.avatar-office { background-color: var(--color-office); }
.avatar-other { background-color: var(--color-other); }

.border-doctor { outline-color: var(--color-doctor); }
.border-nurse { outline-color: var(--color-nurse); }
.border-rehab { outline-color: var(--color-rehab); }
.border-care { outline-color: var(--color-care); }
.border-office { outline-color: var(--color-office); }
.border-other { outline-color: var(--color-other); }

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
  min-height: 56px;
  padding: 16px 32px;
  font-size: var(--font-size-btn);
  line-height: 1.2;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* プライマリボタン（アクセントオレンジ） */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}
.btn-primary:hover:not(:disabled) { background-color: var(--color-accent-hover); }

/* セカンダリボタン（グリーン） */
.btn-secondary {
  background-color: var(--color-primary);
  color: var(--color-white);
}
.btn-secondary:hover:not(:disabled) { background-color: var(--color-primary-hover); }

/* アウトラインボタン */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  min-height: 48px;
  padding: 14px 28px;
}
.btn-outline:hover:not(:disabled) {
  background-color: rgba(91, 140, 62, 0.1);
}

/* 小さいボタン */
.btn-sm {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 16px;
}

/* フルワイドボタン */
.btn-full { width: 100%; }

/* いいねボタン */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-full);
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-sub);
  transition: all 0.2s;
  min-height: 44px;
  font-family: var(--font-family);
  font-weight: 500;
}

.like-btn:hover { 
  background-color: #FFF0F0;
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.like-btn.liked {
  background-color: #FFF0F0;
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* ===== フォーム ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.form-label .required {
  color: var(--color-accent);
  margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  border: 2px solid #CCCCCC;
  border-radius: var(--border-radius);
  padding: 14px 16px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-white);
  transition: border-color 0.2s;
  min-height: 56px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-border-focus);
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-sub);
  margin-top: 6px;
}

.form-error {
  font-size: var(--font-size-sm);
  color: #DC2626;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.char-count {
  text-align: right;
  font-size: var(--font-size-sm);
  color: var(--color-text-sub);
  margin-top: 4px;
}

.char-count.over { color: #DC2626; font-weight: bold; }

/* ===== ベストアンサー ===== */
.best-answer-card {
  background-color: #FFF9E6;
  border: 2px solid #FFD700;
  border-left: 4px solid #FFD700;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.best-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #FFD700;
  color: #7A5800;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* 回答カード */
.answer-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 12px;
}

/* ===== 検索・フィルター ===== */
.search-bar {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--color-text-sub);
  pointer-events: none;
}

.search-input-wrap .form-input {
  padding-left: 46px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--font-family);
  font-weight: 500;
  min-height: 44px;
  color: var(--color-text);
}

.filter-chip.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ===== カテゴリチップ（pill形状・カテゴリ固有色） ===== */
.category-chip {
  border-radius: 999px;  /* pill形状 */
}

.category-chip.active {
  /* 色はインラインstyleで上書き（カテゴリ固有色）。フォールバックはprimary */
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ===== ソート/ステータスチップ（やや角丸・グレーボーダー） ===== */
.sort-chip {
  border-radius: 8px;
  border-color: #B0B0B0;
}

.sort-chip.active {
  background-color: #5B8C3E;  /* オリーブグリーン */
  border-color: #5B8C3E;
  color: white;
}

/* ===== フィルターセクションラベル ===== */
.filter-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-sub);
  letter-spacing: 0.03em;
  padding: 8px 16px 0;
  white-space: nowrap;
}

/* ===== カテゴリ段と並び順段の区切り線 ===== */
.filter-divider {
  height: 1px;
  background: #E0E0E0;
  margin: 0 16px;
}

.filter-chips-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* カテゴリチップは常に折り返しなし・横スクロール */
  flex-wrap: nowrap;
}

.filter-chips-wrap::-webkit-scrollbar { display: none; }

/* PC（769px以上）: 折り返し許可・スクロール不要 */
@media (min-width: 769px) {
  .filter-chips-wrap {
    flex-wrap: wrap;
    overflow-x: hidden;
    /* 折り返し後も余白を保つ */
    row-gap: 8px;
  }
}

/* ===== ページ共通 ===== */
.page-header {
  padding: 16px 16px 0;
  margin-bottom: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--color-text);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  padding: 16px 16px 8px;
  border-bottom: 2px solid var(--color-border);
}

/* ===== 投稿詳細タイトル ===== */
.post-detail-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 14px;
  color: var(--color-text);
}

@media (min-width: 769px) {
  .post-detail-title {
    font-size: 26px;
  }
}

/* ===== 通報ボタン ===== */
.report-btn {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-sub);
  padding: 6px 10px;
  min-height: 36px;
  border-radius: var(--border-radius);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}

.report-btn:hover:not(:disabled) {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* ===== ログイン画面 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #5B8C3E 0%, #4a7632 50%, #3d6128 100%);
}

.login-card {
  background: var(--color-white);
  border-radius: 20px;
  padding: 40px 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  background-color: var(--color-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
  font-weight: 900;
  color: white;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 14px;
  color: var(--color-text-sub);
}

/* ===== プロフィールページ ===== */
.profile-header {
  background: var(--color-white);
  padding: 24px 16px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--color-primary);
}

.profile-stat-label {
  font-size: 13px;
  color: var(--color-text-sub);
}

/* ===== 管理者ページ ===== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.admin-stat-card {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--color-border);
}

.admin-stat-num {
  font-size: 36px;
  font-weight: 900;
  color: var(--color-primary);
}

.admin-stat-label {
  font-size: 14px;
  color: var(--color-text-sub);
  margin-top: 4px;
}

/* ===== プレースホルダー画面（未実装機能） ===== */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
  padding: 40px 24px;
  text-align: center;
}

.placeholder-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.placeholder-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--color-text);
  margin-bottom: 12px;
}

.placeholder-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-sub);
  max-width: 280px;
  line-height: 1.8;
}

.placeholder-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 16px;
  background-color: rgba(255, 144, 90, 0.1);
  color: var(--color-accent);
  border-radius: var(--border-radius-full);
  font-size: 14px;
  font-weight: 700;
}

/* ===== トースト通知 ===== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
  width: 100%;
  max-width: 480px;
}

.toast {
  padding: 16px 20px;
  border-radius: var(--border-radius-lg);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

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

.toast-success {
  background-color: #DCFCE7;
  color: #166534;
  border-left: 4px solid #16A34A;
}

.toast-error {
  background-color: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid #DC2626;
}

.toast-info {
  background-color: #DBEAFE;
  color: #1E40AF;
  border-left: 4px solid #3B82F6;
}

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--color-white);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

/* ===== 区切り線 ===== */
.divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 16px 0;
}

/* ===== 空状態 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}
.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-sub);
}

/* ===== 画像グリッド ===== */
.image-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.image-grid-1 { grid-template-columns: 1fr; }
.image-grid-2 { grid-template-columns: 1fr 1fr; }
.image-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.image-grid-4,
.image-grid-5 { grid-template-columns: 1fr 1fr; }

.image-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

/* 画像アップロードエリア */
.image-upload-area {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.image-upload-btn {
  width: 72px;
  height: 72px;
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-sub);
  gap: 4px;
  transition: all 0.2s;
  background: none;
  font-family: var(--font-family);
}

.image-upload-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.image-preview-item {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== ページネーション ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
}

.pagination-btn {
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--color-text);
  padding: 0 12px;
}

.pagination-btn.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination-btn:hover:not(.active):not(:disabled) {
  background-color: rgba(91, 140, 62, 0.1);
  border-color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== タブ ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-white);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  padding: 14px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-sub);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s;
  min-height: 44px;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

/* ===== テーブル（管理者用） ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

th {
  background-color: var(--color-bg);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-sub);
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--color-border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

tr:hover td { background-color: rgba(91, 140, 62, 0.03); }

/* ===== スクロール復元 ===== */
.scroll-top-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 48px;
  height: 48px;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== PC（768px以上）レイアウト拡張 ===== */
@media (min-width: 768px) {
  :root {
    --font-size-base: 18px;
    --font-size-lg: 24px;
    --font-size-xl: 28px;
  }

  .main-content {
    padding-bottom: 32px;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }

  /* PCではボトムナビを非表示、サイドナビを表示 */
  .bottom-nav { display: none; }
  .main-content { padding-bottom: 32px; }

  /* PCサイドナビ */
  .pc-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    width: 220px;
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    padding: 20px 0;
    z-index: 90;
    overflow-y: auto;
  }

  .pc-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    text-decoration: none;
    color: var(--color-text-sub);
    font-size: 17px;
    font-weight: 500;
    border-left: 3px solid transparent;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-family);
    width: 100%;
    transition: all 0.2s;
  }

  .pc-sidebar-item:hover {
    background-color: rgba(91, 140, 62, 0.08);
    color: var(--color-primary);
  }

  .pc-sidebar-item.active {
    color: var(--color-primary);
    background-color: rgba(91, 140, 62, 0.12);
    border-left: 3px solid var(--color-primary);
    font-weight: 700;
  }

  .pc-sidebar-post-btn {
    margin: 16px 16px 0;
    width: calc(100% - 32px);
  }

  /* PCはサイドナビ分ずらす */
  .has-sidebar .main-content {
    padding-left: calc(220px + 24px);
    max-width: 1100px;
    margin-left: 220px;   /* margin:0 auto を上書き → main-content を x=220px から開始 */
    margin-right: 0;      /* 右マージンをリセット */
  }

  /* PC: 戻るボタンをメインエリア左端に固定 */
  .back-btn-wrap {
    /* サイドバー境界すぐ右(padding-left=244px を打ち消してx≈228px に配置) */
    margin-left: calc(-220px - 24px + 8px);
    padding: 6px 0 2px 8px !important;  /* インラインのpadding-left:16pxを上書き */
  }

  /* ハンバーガーボタンはPC非表示 */
  .hamburger-btn { display: none !important; }

  .admin-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal-overlay {
    align-items: center;
  }

  .modal {
    border-radius: 20px;
    max-width: 560px;
    margin: auto;
  }

  .login-card {
    padding: 48px 40px;
  }
}

@media (min-width: 1024px) {
  :root {
    --font-size-base: 18px;
  }
}

/* ===== アクセシビリティ ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* スクリーンリーダー専用テキスト */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== ユーティリティ ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-sub { color: var(--color-text-sub); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* ===== 未対応通報バッジ ===== */
.report-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #E74C3C;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border: 1.5px solid #fff;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== ダッシュボード通報アラートカード ===== */
.report-alert-card {
  margin: 0 16px 16px;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.report-alert-card.has-pending {
  background: #FFF3CD;
  border: 2px solid #FFC107;
}

.report-alert-card.all-clear {
  background: #D4EDDA;
  border: 2px solid #28A745;
}

.report-alert-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.report-alert-body {
  flex: 1;
  min-width: 0;
}

.report-alert-title {
  font-size: 15px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 4px;
}

.report-alert-card.has-pending .report-alert-title {
  color: #856404;
}

.report-alert-card.all-clear .report-alert-title {
  color: #155724;
}

.report-alert-sub {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 10px;
}

.report-alert-card.has-pending .report-alert-sub {
  color: #856404;
}

/* ===== 戻るボタンラッパー（スマホデフォルト） ===== */
.back-btn-wrap {
  padding: 6px 0 2px 0;
}

/* ===== ハンバーガーボタン（スマホのみ） ===== */
.hamburger-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-white);
  font-size: 22px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.hamburger-btn:hover,
.hamburger-btn:focus-visible {
  background: rgba(255,255,255,0.3);
  outline: none;
}

/* ===== スライドインサイドメニュー ===== */
.slide-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.slide-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.slide-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(80vw, 300px);
  background: #fff;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}
.slide-menu.open {
  transform: translateX(0);
}

.slide-menu-header {
  background: var(--color-primary);
  color: #fff;
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.slide-menu-header-logo {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}
.slide-menu-header-title {
  font-size: 20px;
  font-weight: 900;
}

.slide-menu-body {
  padding: 12px 0;
  flex: 1;
}

.slide-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: none;
  background: none;
  padding: 16px 20px;
  font-size: 18px;
  font-family: var(--font-family);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  position: relative;
}
.slide-menu-item:hover,
.slide-menu-item:focus-visible {
  background: #f0f7e8;
  outline: none;
}
.slide-menu-item.active {
  background: #f0f7e8;
  color: var(--color-primary);
  font-weight: 700;
}
.slide-menu-item.danger {
  color: #dc2626;
}
.slide-menu-divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 16px;
}
/* 通報バッジ（スライドメニュー内） */
.slide-menu-badge {
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 1px 7px;
  margin-left: auto;
}
