/* 猛牛速報 - 馬鳥速報スタイル再現 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Rajdhani:wght@600;700&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Meiryo', 'メイリオ', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background-color: #1a1a1a;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.15) 1px, rgba(0, 0, 0, 0.15) 2px), repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(0, 0, 0, 0.15) 1px, rgba(0, 0, 0, 0.15) 2px);
  background-size: 20px 20px;
  color: #222;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.7;
}

a {
  color: #3a7abf;
  text-decoration: none;
}

a:hover {
  color: #e05c00;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* ===== 全体ラッパー ===== */
#wrapper {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0;
}

/* ===== 左右広告カラム ===== */
.ad-column-left,
.ad-column-right {
  width: 160px;
  flex-shrink: 0;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ad-block {
  background: #2a2a2a;
  border: 1px solid #444;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 10px;
  text-align: center;
  overflow: hidden;
}

.ad-block-skyscraper {
  width: 160px;
  min-height: 600px;
}

.ad-block-banner {
  width: 160px;
  min-height: 160px;
}

/* ===== メインエリア ===== */
#main-area {
  flex: 1;
  min-width: 0;
  background: #1a1a1a;
}

/* ===== ヘッダーバナー ===== */
#header-banner {
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: #0a0e1a;
  border-bottom: 3px solid #2a4a7f;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#header-banner .header-bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/header_bg.png');
  background-size: cover;
  background-position: center 25%;
}

#header-banner .header-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(10, 14, 26, 0.4) 0%, rgba(10, 14, 26, 0.9) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
}

#header-banner .site-title {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
}

.site-title-text {
  font-size: 3.8rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    4px 4px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 0 20px rgba(0, 0, 0, 0.9),
    2px 0 8px rgba(255, 100, 50, 0.7);
  letter-spacing: 0.1em;
  line-height: 1;
  font-family: 'Noto Sans JP', sans-serif;
}

.site-subtitle {
  font-size: 0.75rem;
  color: #8899cc;
  letter-spacing: 0.15em;
  margin-top: 6px;
}

.header-url {
  font-size: 0.7rem;
  color: #667799;
  margin-top: 4px;
}

/* ===== ナビゲーション ===== */
#site-nav {
  background: #111;
  border-bottom: 1px solid #333;
}

.nav-inner {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.nav-link {
  color: #ccc;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  border-right: 1px solid #333;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: #333;
  color: #fff;
  text-decoration: none;
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
}

.nav-icon {
  color: #999;
  padding: 8px;
  font-size: 15px;
  border-radius: 4px;
  transition: color 0.15s;
}

.nav-icon:hover {
  color: #fff;
  text-decoration: none;
}

/* ===== コンテンツエリア ===== */
#content-area {
  background: #f5f5f0;
  display: flex;
  gap: 0;
  min-height: 500px;
}

/* ===== サイドバー（左） ===== */
#sidebar {
  width: 320px;
  flex-shrink: 0;
  background: #efefea;
  border-right: 1px solid #d0d0c8;
  padding: 10px 0;
}

/* ===== メイン記事エリア ===== */
#article-area {
  flex: 1;
  min-width: 0;
  padding: 0;
}

/* ===== おすすめ記事ヘッダー ===== */
.recommend-header {
  background: #111;
  color: #fff;
  padding: 12px 18px;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 8px solid #4a7fc0;
  border-bottom: 2px solid #333;
  margin-bottom: 0;
}

.recommend-header .kanji-deco {
  font-size: 2.8rem;
  font-weight: 900;
  color: #f0e060;
  line-height: 1;
  padding-right: 15px;
  border-right: 4px solid #444;
  margin-right: 10px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

/* ===== おすすめ記事グリッド ===== */
.recommend-grid {
  background: #ddd;
  border-bottom: 2px solid #bbb;
  display: flex;
  flex-direction: column;
}

.recommend-item {
  padding: 8px 12px;
  border-bottom: 1px solid #d8d8d0;
  line-height: 1.4;
}

.recommend-item:last-child {
  border-bottom: none;
}

.recommend-item a {
  color: #1a5fab;
  display: block;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-item a:hover {
  color: #e05c00;
  text-decoration: underline;
}

/* ===== 記事カード（大：2カラム風） ===== */
.post-list-section {
  background: #f5f5f0;
}

/* 記事リスト（馬鳥スタイル：1カラム） */
.posts-list-v2 {
  background: #fff;
  border-top: 1px solid #ddd;
}

.post-item-v2 {
  border-bottom: 2px solid #efefef;
  transition: background 0.1s;
}

.post-item-v2:hover {
  background: #fdfdfd;
}

.post-item-inner {
  display: flex;
  padding: 12px 14px;
  align-items: flex-start;
  gap: 15px;
  position: relative;
}

/* サムネイル部 */
.post-item-thumb {
  width: 150px;
  height: 95px;
  flex-shrink: 0;
  overflow: hidden;
  background: #eee;
  border: 4px solid #f8f8f8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-thumb-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: #efefea;
  color: #bbb;
}

/* メイン情報部 */
.post-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-item-title {
  margin: -2px 0 8px;
  line-height: 1.4;
}

.post-item-title a {
  font-size: 1.15rem;
  font-weight: 900;
  color: #337ab7;
  text-decoration: none;
}

.post-item-title a:hover {
  color: #ff6600;
  text-decoration: underline;
}

.post-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: #888;
}

.meta-time,
.meta-cat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-cat a {
  color: #ee8800;
  font-weight: 700;
}

.meta-social-btns {
  display: flex;
  gap: 4px;
  margin-left: 10px;
}

.s-btn {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  color: #fff;
}

.b-hatena {
  background: #00a4de;
}

.b-tweet {
  background: #1da1f2;
}

/* コメントバブル（右側） */
.post-item-comment {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

.comment-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 52px;
  background: #fff;
  border: 1px solid #c9d2db;
  border-radius: 4px;
  text-decoration: none !important;
  position: relative;
  transition: border-color 0.15s;
}

.comment-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 15px;
  border-width: 8px 6px 0 0;
  border-style: solid;
  border-color: #c9d2db transparent transparent transparent;
}

.comment-bubble:hover {
  border-color: #337ab7;
}

.c-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #337ab7;
  line-height: 1;
}

.c-label {
  font-size: 9px;
  color: #888;
  margin-top: -2px;
}

/* ===== 広告（インフィード） ===== */
.infeed-ad {
  background: #f0f0e8;
  border: 1px solid #ddd;
  border-top: 2px solid #aaa;
  padding: 8px;
  text-align: center;
  color: #999;
  font-size: 11px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
}

/* ===== ページネーション ===== */
.pagination {
  background: #eee;
  border-top: 2px solid #ccc;
  padding: 10px;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 2px;
  transition: all 0.15s;
  text-decoration: none;
  cursor: pointer;
}

.page-btn:hover,
.page-btn.active {
  background: #2a5ca8;
  color: #fff;
  border-color: #2a5ca8;
  text-decoration: none;
}

.page-btn.disabled {
  color: #bbb;
  cursor: default;
  pointer-events: none;
}

/* ===== サイドバーウィジェット ===== */
.widget {
  margin-bottom: 0;
  border-bottom: 1px solid #d0d0c8;
}

.widget-title {
  background: #333;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  letter-spacing: 0.05em;
}

.widget-body {
  background: #efefea;
  padding: 8px 10px;
  font-size: 12px;
}

/* サイドバー検索 */
.sb-search {
  display: flex;
  gap: 4px;
}

.sb-search input {
  flex: 1;
  border: 1px solid #bbb;
  padding: 5px 8px;
  font-size: 12px;
  background: #fff;
  border-radius: 2px;
}

.sb-search input:focus {
  outline: none;
  border-color: #2a5ca8;
}

.sb-search button {
  background: #555;
  color: #fff;
  border: none;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 2px;
  cursor: pointer;
}

.sb-search button:hover {
  background: #2a5ca8;
}

/* カテゴリリスト */
.sb-cat-list {
  list-style: none;
}

.sb-cat-list li {
  border-bottom: 1px dotted #ccc;
}

.sb-cat-list li:last-child {
  border-bottom: none;
}

.sb-cat-list li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  color: #333;
  font-size: 12px;
  transition: color 0.15s;
}

.sb-cat-list li a:hover {
  color: #e05c00;
  text-decoration: none;
  background: #e5e5de;
}

.sb-cat-count {
  margin-left: auto;
  background: #ddd;
  color: #666;
  padding: 0 5px;
  border-radius: 2px;
  font-size: 10px;
}

/* ランキングリスト */
.sb-rank-list {
  list-style: none;
}

.sb-rank-item {
  display: flex;
  gap: 8px;
  padding: 5px 4px;
  border-bottom: 1px dotted #ccc;
  align-items: flex-start;
}

.sb-rank-item:last-child {
  border-bottom: none;
}

.sb-rank-num {
  font-size: 14px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
}

.sb-rank-num.rk1 {
  color: #c9a800;
}

.sb-rank-num.rk2 {
  color: #888;
}

.sb-rank-num.rk3 {
  color: #a05030;
}

.sb-rank-num.rk-other {
  color: #aaa;
}

.sb-rank-title {
  font-size: 11px;
  color: #333;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sb-rank-title:hover {
  color: #e05c00;
  text-decoration: none;
}

/* サイドバー広告 */
.sb-ad {
  background: #e8e8e0;
  border: 1px dashed #ccc;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 10px;
  text-align: center;
}

/* サイドバーリンク */
.sb-link-list {
  list-style: none;
}

.sb-link-list li {
  border-bottom: 1px dotted #ccc;
}

.sb-link-list li a {
  display: block;
  padding: 4px 6px;
  color: #1a5fab;
  font-size: 11px;
}

.sb-link-list li a:hover {
  color: #e05c00;
  text-decoration: underline;
}

/* ===== 記事詳細ページ ===== */
.article-wrapper {
  background: #f5f5f0;
  display: flex;
  gap: 0;
}

.article-main {
  flex: 1;
  min-width: 0;
  padding: 14px;
}

.article-header {
  background: #fff;
  border: 1px solid #ddd;
  border-bottom: 3px solid #2a5ca8;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.article-cat-badge {
  display: inline-block;
  background: #2a5ca8;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
  font-weight: 700;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.5;
  color: #111;
  margin-bottom: 10px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #888;
  flex-wrap: wrap;
}

.article-content {
  background: #fff;
  border: 1px solid #ddd;
  padding: 18px;
  margin-bottom: 14px;
  line-height: 1.8;
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.article-content h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  border-left: 4px solid #2a5ca8;
  padding-left: 10px;
  margin: 20px 0 10px;
}

.article-content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
  margin: 16px 0 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.article-content p {
  margin-bottom: 12px;
}

.article-content blockquote {
  background: #f0f0e8;
  border-left: 4px solid #6699cc;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: #444;
  border-radius: 0 4px 4px 0;
}

.article-content blockquote p {
  margin-bottom: 0;
  color: #444;
}

.article-content a {
  color: #1a5fab;
}

.article-content a:hover {
  color: #e05c00;
  text-decoration: underline;
}

.article-content ul,
.article-content ol {
  margin: 10px 0 10px 20px;
}

.article-content li {
  margin-bottom: 4px;
}

.article-content img {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin: 12px 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 20px 0;
}

/* シェアボタン */
.share-area {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}

.share-btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.share-x {
  background: #111;
  color: #fff;
}

.share-hatena {
  background: #00a4de;
  color: #fff;
}

.share-copy {
  background: #ddd;
  color: #333;
  border: 1px solid #bbb;
}

/* 関連記事 */
.related-posts {
  background: #fff;
  border: 1px solid #ddd;
  margin-bottom: 14px;
}

.related-header {
  background: #333;
  color: #fff;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}

.related-list {
  list-style: none;
  padding: 6px 12px;
}

.related-list li {
  padding: 4px 0;
  border-bottom: 1px dotted #ddd;
  font-size: 12px;
}

.related-list li:last-child {
  border-bottom: none;
}

.related-list a {
  color: #1a5fab;
}

.related-list a:hover {
  color: #e05c00;
  text-decoration: underline;
}

/* ===== コメントセクション ===== */
.comment-section {
  background: #fff;
  border: 1px solid #ddd;
  margin-bottom: 14px;
}

.comment-section-header {
  background: #2a5ca8;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-count-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.comment-list {
  padding: 10px 14px;
}

.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-num {
  font-size: 12px;
  font-weight: 700;
  color: #2a5ca8;
  min-width: 24px;
}

.comment-nick {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}

.comment-date-small {
  font-size: 10px;
  color: #aaa;
  margin-left: auto;
}

.comment-body-text {
  font-size: 13px;
  color: #444;
  line-height: 1.7;
  padding-left: 30px;
  white-space: pre-wrap;
}

/* コメントフォーム */
.comment-form-area {
  background: #f5f5f0;
  border-top: 2px solid #ddd;
  padding: 14px;
}

.comment-form-title {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.comment-rules-box {
  background: #fffbee;
  border: 1px solid #e0d080;
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #665500;
  line-height: 1.8;
}

.comment-rules-box ul {
  margin-left: 16px;
}

.cf-group {
  margin-bottom: 10px;
}

.cf-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  margin-bottom: 4px;
}

.cf-group input,
.cf-group textarea {
  width: 100%;
  border: 1px solid #ccc;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  border-radius: 2px;
}

.cf-group input:focus,
.cf-group textarea:focus {
  outline: none;
  border-color: #2a5ca8;
  box-shadow: 0 0 0 2px rgba(42, 92, 168, 0.15);
}

.cf-group textarea {
  min-height: 100px;
  resize: vertical;
}

.comment-submit-btn {
  background: #2a5ca8;
  color: #fff;
  border: none;
  padding: 8px 24px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

.comment-submit-btn:hover {
  background: #1a4c98;
}

/* ===== フラッシュメッセージ ===== */
.flash-messages {
  padding: 6px 14px 0;
}

.flash-msg {
  padding: 8px 14px;
  border-radius: 3px;
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.3s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-msg.success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #2e7d32;
}

.flash-msg.error {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: #c62828;
}

.flash-msg.info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  color: #1565c0;
}

.flash-msg.warning {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #e65100;
}

/* ===== フッター ===== */
#footer {
  background: #111;
  color: #ccc;
  border-top: 3px solid #333;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px 20px;
}

.footer-col h3 {
  font-size: 12px;
  font-weight: 700;
  color: #aaa;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-link-list {
  list-style: none;
}

.footer-link-list li {
  margin-bottom: 4px;
}

.footer-link-list a {
  color: #888;
  font-size: 11px;
}

.footer-link-list a:hover {
  color: #ccc;
  text-decoration: underline;
}

.footer-rank-item {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: flex-start;
}

.footer-rank-num {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  min-width: 16px;
  flex-shrink: 0;
}

.footer-rank-item a {
  color: #888;
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.footer-rank-item a:hover {
  color: #ccc;
}

.footer-bottom {
  background: #0a0a0a;
  border-top: 1px solid #222;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copyright {
  font-size: 10px;
  color: #555;
  line-height: 1.7;
}

.footer-nav-links {
  display: flex;
  gap: 12px;
}

.footer-nav-links a {
  color: #555;
  font-size: 10px;
}

.footer-nav-links a:hover {
  color: #888;
}

/* ===== 戻るボタン ===== */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #2a5ca8;
  border-color: #2a5ca8;
}

/* ===== 管理画面 ===== */
.admin-body {
  background: #1a1d28;
  color: #e0e2ea;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  min-height: 100vh;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 管理サイドバー */
.admin-sidebar {
  width: 220px;
  background: #0d1117;
  border-right: 1px solid #21262d;
  flex-shrink: 0;
  padding-top: 0;
}

.admin-sidebar-logo {
  padding: 16px 16px 14px;
  border-bottom: 1px solid #21262d;
  background: #090d14;
}

.admin-sidebar-logo .logo-name {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}

.admin-sidebar-logo .logo-sub {
  font-size: 0.6rem;
  color: #666;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.admin-nav-section {
  padding: 12px 14px 4px;
  font-size: 10px;
  color: #484f58;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #8b949e;
  font-size: 12px;
  transition: all 0.15s;
  text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
}

.admin-badge {
  background: #da3633;
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}

/* 管理メインエリア */
.admin-main {
  flex: 1;
  overflow: auto;
}

.admin-topbar {
  background: #161b22;
  border-bottom: 1px solid #21262d;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-topbar h1 {
  font-size: 14px;
  font-weight: 700;
  color: #f0f6fc;
}

.admin-content {
  padding: 20px;
}

/* 統計カード */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}

.stat-card:hover {
  border-color: #388bfd;
}

.stat-label {
  font-size: 11px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0f6fc;
  line-height: 1;
}

.stat-value.clr-gold {
  color: #e3b341;
}

.stat-value.clr-blue {
  color: #388bfd;
}

.stat-value.clr-red {
  color: #f85149;
}

.stat-value.clr-green {
  color: #3fb950;
}

/* テーブル */
.admin-table-wrap {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  background: #0d1117;
  color: #8b949e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #21262d;
}

.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #21262d;
  color: #c9d1d9;
  vertical-align: top;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.2;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.88;
}

.btn-primary {
  background: #1f6feb;
  color: #fff;
  border-color: #1f6feb;
}

.btn-success {
  background: #238636;
  color: #fff;
  border-color: #238636;
}

.btn-danger {
  background: #da3633;
  color: #fff;
  border-color: #da3633;
}

.btn-warning {
  background: #9e6a03;
  color: #fff;
  border-color: #9e6a03;
}

.btn-secondary {
  background: #21262d;
  color: #c9d1d9;
  border-color: #30363d;
}

.btn-gold {
  background: #b08800;
  color: #fff;
  border-color: #b08800;
}

.btn-sm {
  padding: 3px 8px;
  font-size: 10px;
}

.btn-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ステータスバッジ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.status-published {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

.status-draft {
  background: rgba(227, 179, 65, 0.2);
  color: #e3b341;
}

.status-hidden {
  background: rgba(110, 118, 129, 0.2);
  color: #6e7681;
}

.status-pending {
  background: rgba(227, 179, 65, 0.2);
  color: #e3b341;
}

.status-approved {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

.status-rejected {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.status-spam {
  background: rgba(248, 81, 73, 0.3);
  color: #f85149;
}

/* フォーム（管理） */
.form-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 16px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #f0f6fc;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: #388bfd;
}

.admin-form textarea.content-editor {
  min-height: 420px;
  font-family: 'Noto Sans JP', monospace;
  line-height: 1.8;
}

.admin-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #8b949e;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group {
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-select {
  background: #21262d;
  border: 1px solid #30363d;
  color: #f0f6fc;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

/* ログイン */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1117;
  padding: 20px;
}

.login-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

.login-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: #f0f6fc;
}

.login-logo .admin-text {
  font-size: 11px;
  color: #484f58;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* AI パネル */
.ai-panel {
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(139, 68, 168, 0.08));
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 18px;
}

.source-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.source-tab {
  padding: 5px 14px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #30363d;
  background: #21262d;
  color: #8b949e;
  transition: all 0.15s;
}

.source-tab.active {
  background: #1f6feb;
  color: #fff;
  border-color: #1f6feb;
}

.ai-result {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 5px;
  padding: 12px;
  margin-top: 14px;
  font-size: 11px;
  color: #8b949e;
  min-height: 60px;
}

.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #8b949e;
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 12px;
}

/* チェックボックス */
.comment-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #1f6feb;
}

/* ===== レスポンシブ ===== */

/* --- タブレット (900px以下) --- */
@media (max-width: 900px) {

  html,
  body {
    overflow-x: hidden;
  }

  #wrapper {
    flex-direction: column;
    overflow-x: hidden;
  }

  /* ヘッダーをスマホ・タブレットでコンパクトに */
  #header-banner {
    min-height: 80px !important;
  }

  #header-banner .site-title {
    padding: 10px 16px;
  }

  .site-title-text {
    font-size: 2rem;
  }

  .site-subtitle {
    font-size: 0.6rem;
    margin-top: 3px;
  }

  .ad-column-left,
  .ad-column-right {
    display: none !important;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  #content-area {
    flex-direction: column !important;
    width: 100%;
    overflow-x: hidden;
  }

  /* サイドバーを記事の下に移動・幅強制 */
  #sidebar {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
    flex-basis: auto !important;
    border-right: none;
    border-bottom: 1px solid #d0d0c8;
    order: 2;
    box-sizing: border-box;
  }

  #article-area {
    order: 1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .ad-unit.sidebar-rect {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 300 / 250;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- スマートフォン (600px以下) --- */
@media (max-width: 600px) {

  /* ヘッダー */
  #header-banner {
    min-height: 90px;
  }

  #header-banner .site-title {
    padding: 12px;
  }

  .site-title-text {
    font-size: 2rem;
  }

  .site-subtitle {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  /* ナビゲーション */
  .nav-inner {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-inner::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* フッター */
  .footer-grid {
    grid-template-columns: 1fr;
  }

  /* --- トップページ 記事リスト --- */
  .post-item-inner {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .post-item-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .post-item-main {
    width: 100%;
  }

  .post-item-title a {
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    /* スマホでは折り返し */
  }

  .post-item-comment {
    display: none;
    /* コメントバブルは非表示 */
  }

  /* おすすめ記事 */
  .recommend-item a {
    white-space: normal;
    /* タイトル折り返しON */
    overflow: visible;
    text-overflow: clip;
  }

  /* --- 記事本文ページ --- */
  .article-header,
  .article-content,
  .article-footer {
    padding: 0 10px;
  }

  .article-title {
    font-size: 1.15rem !important;
    line-height: 1.5 !important;
    padding: 12px 10px !important;
  }

  .article-content {
    font-size: 14px;
    line-height: 1.8;
  }

  /* 記事内の画像を横幅いっぱいに */
  .article-content img {
    max-width: 100%;
    height: auto;
  }

  /* 記事内テーブルをスクロール可能に */
  .article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* シェアボタン */
  .share-area {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }

  .share-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* コメント欄 */
  .comment-item {
    padding: 10px;
  }

  .comment-form-area {
    padding: 10px;
  }

  .comment-form-area input,
  .comment-form-area textarea {
    font-size: 16px;
    /* iOSでズームしないように16px以上 */
  }

  /* 広告 */
  .ad-unit.infeed {
    flex-direction: column;
    align-items: flex-start;
  }

  /* ページネーション */
  .pagination {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    padding: 10px;
  }

  .page-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* サイドバー内 人気記事 */
  .sb-rank-list {
    padding: 0;
  }

  /* --- 管理画面 --- */
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    position: static;
  }

  .admin-content {
    padding: 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- さらに小さい画面 (400px以下) --- */
@media (max-width: 400px) {
  .site-title-text {
    font-size: 2rem;
  }

  .article-title {
    font-size: 1rem !important;
  }

  .article-content {
    font-size: 13px;
  }
}


/* ===== ユーティリティ ===== */
.w-full {
  width: 100%;
}

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

.mt-2 {
  margin-top: 8px;
}

.mb-2 {
  margin-bottom: 8px;
}

.hidden {
  display: none;
}

/* ===== 広告表示システム (Mock UI for Dev) ===== */
.ad-unit {
  margin: 10px 0;
  text-align: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eee;
  position: relative;
}

.ad-unit::before {
  content: "広告 (AdSense Simulation)";
  position: absolute;
  top: 0;
  left: 0;
  background: #eee;
  padding: 2px 6px;
  font-size: 8px;
  color: #aaa;
  z-index: 5;
}

/* 横長バナー (728x90) */
.ad-unit.horizontal {
  width: 100%;
  max-width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f9f9f9;
}

/* サイドバー角版 (300x250) */
.ad-unit.sidebar-rect {
  width: 300px;
  height: 250px;
  margin: 5px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
}

/* インフィード広告 (リストの中用) */
.ad-unit.infeed {
  padding: 12px 14px;
  border-bottom: 2px solid #efefef;
  display: flex;
  gap: 15px;
  background: #f9f9f9;
  align-items: center;
}

.ad-unit.infeed::after {
  content: "PR";
  position: absolute;
  top: 12px;
  right: 14px;
  background: #ee8800;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  font-weight: bold;
  border-radius: 2px;
}

.mock-ad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mock-ad-content {
  flex: 1;
  text-align: left;
}

.mock-ad-title {
  color: #337ab7;
  font-weight: 900;
  font-size: 1.15rem;
  margin-bottom: 8px;
  display: block;
}

.mock-ad-text {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

/* Aboutページなどの通常テキスト用 */
.about-text {
  font-weight: 500 !important;
  font-size: 14px !important;
  line-height: 1.8;
}