/* いあわせ - スタイルシート (初期2ch風レトロ & モダンレスポンシブ) */

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --text-color: #222222;
  --border-color: #e0e0e0;
  --header-bg: #fafafa;
  --link-color: #0000ee;
  --visited-color: #551a8b;
  --name-color: #117722;
  --quote-color: #2b7828;
  --sub-text: #666666;
  --active-bg: #eef2ff;
  --ad-bg: #f9f9f9;
}

/* テーマ1: 2ch風クラシック (Classic Beige) */
html[data-theme="classic"] {
  --bg-color: #f7f5ef;
  --card-bg: #ffffff;
  --text-color: #222222;
  --border-color: #d8d3c5;
  --header-bg: #efece4;
  --link-color: #0000ee;
  --visited-color: #551a8b;
  --name-color: #117722;
  --quote-color: #2b7828;
  --sub-text: #777777;
  --active-bg: #e6e2d5;
  --ad-bg: #f2eee3;
}

/* テーマ2: ダーク (Dark Mode) */
html[data-theme="dark"] {
  --bg-color: #18191a;
  --card-bg: #242526;
  --text-color: #e4e6eb;
  --border-color: #3e4042;
  --header-bg: #202124;
  --link-color: #6ea8fe;
  --visited-color: #b39ddb;
  --name-color: #4cd964;
  --quote-color: #8bc34a;
  --sub-text: #b0b3b8;
  --active-bg: #333842;
  --ad-bg: #1e1e1e;
}

/* テーマ3: セピア (Sepia) */
html[data-theme="sepia"] {
  --bg-color: #f4ecd8;
  --card-bg: #fcf8ee;
  --text-color: #383127;
  --border-color: #ded2be;
  --header-bg: #ebe0c7;
  --link-color: #8a3b14;
  --visited-color: #6c4b38;
  --name-color: #2a6634;
  --quote-color: #517a26;
  --sub-text: #7c7263;
  --active-bg: #e5d8be;
  --ad-bg: #ebe1cb;
}

/* テーマ4: 若草・薄緑 (Soft Green) */
html[data-theme="green"] {
  --bg-color: #f7f5ee;
  --card-bg: #fffef9;
  --text-color: #24342c;
  --border-color: #deded2;
  --header-bg: #eaf0e5;
  --link-color: #225c43;
  --visited-color: #3b7359;
  --name-color: #225c43;
  --quote-color: #477935;
  --sub-text: #7b8075;
  --active-bg: #e2ebd9;
  --ad-bg: #eeeee3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.15s ease;
  font-size: 14px;
}

a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:visited {
  color: var(--visited-color);
}

/* ヘッダー */
.top {
  border-bottom: 2px solid var(--border-color);
  background: var(--header-bg);
  padding: 10px 0;
}
.top-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-mascot {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.logo {
  font-weight: bold;
  font-size: 1.35rem;
  color: var(--text-color) !important;
  text-decoration: none !important;
  letter-spacing: 0.05em;
}
.tagline {
  font-size: 0.82rem;
  color: var(--sub-text);
}
.top-nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
}
.top-nav a {
  font-size: 13px;
  font-weight: bold;
}

/* レイアウト */
.wrap {
  max-width: 1060px;
  margin: 16px auto 40px;
  padding: 0 16px;
}
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* 左サイドバー */
.left-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pane {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}
.pane-h {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.cat-list li a {
  display: block;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-color);
}
.cat-list li a:hover,
.cat-list li a.is-active {
  background: var(--active-bg);
  text-decoration: none;
  font-weight: bold;
}
.cat-list li.new-thread-li {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}
.cat-list li.new-thread-li a {
  color: #cc0000;
  font-weight: bold;
}

/* カラーテーマパレット */
.color-pane {
  padding-bottom: 10px;
}
.color-box {
  padding: 10px 12px;
}
.color-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.btn-color {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 6px 4px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
}
.btn-color:hover {
  background: var(--active-bg);
}
.btn-color.current {
  border-color: var(--link-color);
  font-weight: bold;
}
.custom-color-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}
.custom-color-picker input[type="color"] {
  border: 1px solid var(--border-color);
  width: 32px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}
.btn-color-reset {
  display: block;
  width: 100%;
  background: none;
  border: 1px dashed var(--border-color);
  color: var(--sub-text);
  font-size: 11px;
  padding: 4px;
  cursor: pointer;
  border-radius: 3px;
}
.btn-color-reset:hover {
  color: var(--text-color);
}

/* キャラクターひとことウィジェット */
.character-box {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
}
.character-box img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.character-balloon {
  font-size: 11px;
  color: var(--sub-text);
  line-height: 1.4;
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
  position: relative;
}

/* メインコンテンツエリア */
.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}
.box-h {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 14px;
  font-weight: bold;
  font-size: 14px;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-sm {
  background: #cc2200;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 3px;
  text-decoration: none !important;
  display: inline-block;
}
.btn-sm:hover {
  background: #aa1b00;
}

/* スレッド一覧 */
.threadlist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.thread-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}
.thread-item:last-child {
  border-bottom: none;
}
.thread-item:hover {
  background: var(--active-bg);
}
.thread-num {
  font-weight: bold;
  color: var(--sub-text);
  min-width: 28px;
}
.cat-pill {
  font-size: 11px;
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--sub-text);
}
.thread-link {
  font-weight: bold;
  font-size: 15px;
  color: var(--link-color);
}
.res-count {
  font-weight: bold;
  color: #cc0000;
  font-size: 13px;
}
.last-bump {
  margin-left: auto;
  font-size: 12px;
  color: var(--sub-text);
}
.empty-notice {
  padding: 30px;
  text-align: center;
  color: var(--sub-text);
}

/* スレッド画面 (2ch風 レス一覧) */
.thread-box {
  padding: 0;
}
.thread-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.thread-h h1 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: var(--text-color);
}
.cat-tag {
  font-size: 12px;
  color: #cc0000;
  font-weight: bold;
}

.res-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}
.post-item:target {
  background: #fff8e1;
}
.res-h {
  font-size: 13px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}
.res-h .no a {
  font-weight: bold;
  color: var(--link-color);
}
.res-h .name {
  color: var(--name-color);
  font-weight: bold;
}
.res-h .mail-link {
  color: #cc0000 !important;
  text-decoration: underline;
}
.res-h .time {
  color: var(--sub-text);
  font-size: 12px;
}
.res-h .uid {
  color: var(--sub-text);
  font-size: 12px;
  margin-left: 4px;
}
.res-b {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 10px;
}
.res-b .quote {
  color: var(--quote-color);
}
.res-b .anchor {
  color: var(--link-color);
  font-weight: bold;
}

/* スレ内広告 */
.post-ad {
  background: var(--ad-bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

/* フォーム */
.reply-box {
  padding: 16px;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-row {
  display: flex;
  gap: 10px;
}
.form-row input,
.form-group input,
.form-group select {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text-color);
}
.input-name {
  flex: 2;
}
.input-mail {
  flex: 1;
}
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-color);
  resize: vertical;
  line-height: 1.6;
}
.form-action {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-submit {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
}
.btn-submit:hover {
  background: #0052a3;
}
.form-tip {
  font-size: 12px;
  color: var(--sub-text);
}
.stop-box {
  padding: 18px;
  background: #fff0f0;
  border-color: #ffcccc;
  color: #cc0000;
  text-align: center;
  font-size: 14px;
}

/* 広告スロット */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  margin: 4px 0;
}
.ad-label {
  font-size: 10px;
  color: var(--sub-text);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ad-placeholder {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--sub-text);
  font-size: 12px;
  padding: 10px;
}
.ad-sidebar .ad-placeholder {
  min-height: 200px;
}

/* フッター */
.foot {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--sub-text);
}
.foot a {
  color: var(--sub-text);
  margin: 0 8px;
}

/* トップページ（初期レトロ玄関口スタイル） */
.top-page-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.top-page-container {
  max-width: 600px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.top-main-visual {
  margin-bottom: 24px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.top-main-visual:hover {
  transform: scale(1.03);
}
.top-main-visual img {
  max-width: 260px;
  height: auto;
  border: none;
}
.top-enter-link {
  font-size: 1.6rem;
  font-weight: bold;
  color: #0000ee;
  text-decoration: underline;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.top-enter-link:hover {
  color: #cc0000;
}
.top-tagline {
  font-size: 1rem;
  color: var(--sub-text);
  margin-bottom: 24px;
}
.top-quick-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  max-width: 500px;
}
.top-quick-cats a {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--header-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-color);
}
.top-footer {
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 30px;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .left-menu {
    order: 2;
  }
  .main-content {
    order: 1;
  }
  .top-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .top-nav {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .form-row {
    flex-direction: column;
  }
}
