/* Chu-Link — iTLロゴ配色(黒 × オフホワイト × 朱色) */

:root {
  --bg: #0d0d0f;
  --surface: #17171a;
  --ink: #ececea;
  --ink-2: #9b9b9e;
  --line: #2c2c30;
  --accent: #f0512a;
  --accent-soft: #33170f;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
}

.inner { max-width: 600px; margin: 0 auto; padding: 0 16px; }
main.timeline-page { max-width: 880px; }

/* タイムラインの2カラムレイアウト(左: 学年選択、右: 本体) */
.layout { display: flex; gap: 28px; align-items: flex-start; }
.sidebar {
  width: 150px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
}
.sidebar-title {
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--ink-2);
  font-weight: 700;
  margin: 0 0 4px 14px;
}
.side-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.side-link:hover { background: var(--surface); }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.t-main { flex: 1; min-width: 0; }

@media (max-width: 720px) {
  .layout { flex-direction: column; gap: 4px; }
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 4px;
  }
  .sidebar-title { display: none; }
  .side-link { white-space: nowrap; font-size: 13px; padding: 6px 12px; }
}

/* ヘッダー */
.site-head {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
}
.head-row { display: flex; align-items: baseline; gap: 12px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: .02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo-accent { color: var(--accent); }
.tagline { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--accent); text-decoration: none; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.nav-link:hover { text-decoration: underline; }
button.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  padding: 4px 14px;
  white-space: nowrap;
}

/* スマホ: ロゴの行とメニューの行の2段に分け、文字の縦折れを防ぐ */
@media (max-width: 720px) {
  .site-head { padding: 10px 0; }
  .head-row { flex-wrap: wrap; row-gap: 2px; }
  .tagline { display: none; }
  .nav {
    flex-basis: 100%;
    justify-content: flex-end;
    gap: 16px;
  }
}

/* フラッシュメッセージ */
.flash {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  margin: 16px 0 0;
  font-size: 13.5px;
  font-weight: 600;
}

/* 投稿フォーム */
.compose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.body-input, .field input, .field select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
}
.body-input { resize: vertical; font-size: 15px; }
.body-input:focus, .field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.compose-foot { display: flex; justify-content: space-between; align-items: center; }
.char-count { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 24px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }

/* タイムライン */
.timeline { border-top: 1px solid var(--line); }
.post {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.post-main { display: flex; gap: 12px; }
.repost-label {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 700;
  margin: 0 0 6px 24px;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.name { font-weight: 700; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.name:hover { text-decoration: underline; }
.handle { font-size: 12.5px; color: var(--ink-2); }
.time { font-size: 12px; color: var(--ink-2); }
.text { font-size: 15px; overflow-wrap: break-word; white-space: pre-wrap; margin-top: 2px; }

.tags { display: flex; gap: 6px; margin-top: 2px; }
.tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0 7px;
}

.empty { color: var(--ink-2); text-align: center; padding: 48px 0; }

/* アクションバー(リプライ・リポスト・いいね・削除) */
.acts { display: flex; align-items: center; gap: 28px; margin-top: 8px; }
.acts form { display: contents; }
.act {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.act:hover { color: var(--ink); }
.act.liked { color: var(--accent); font-weight: 700; }
.act.reposted { color: var(--good); font-weight: 700; }
.act.danger:hover { color: var(--accent); }
.act.protected-on { color: var(--good); font-weight: 700; }
.pin-label {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 700;
  margin: 0 0 6px 24px;
}

/* 投稿詳細ページ */
.back-link { margin-top: 16px; font-size: 13px; }
.back-link a { color: var(--ink-2); text-decoration: none; }
.back-link a:hover { color: var(--accent); }
.parent-context { opacity: .75; margin-top: 8px; }
.thread-line {
  width: 2px; height: 20px;
  background: var(--line);
  margin-left: 40px;
}
.detail-main { border-top: none; }
.detail-main .post { border-bottom: none; }
.deleted-note {
  color: var(--ink-2);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  margin-top: 16px;
}
.reply-compose { margin-top: 4px; }

/* フッターと各種ページ */
.site-foot {
  max-width: 600px;
  margin: 32px auto 24px;
  padding: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
}
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.page-title { font-size: 20px; margin: 24px 0 16px; }
.agree-note { font-size: 12px; color: var(--ink-2); margin: 4px 0 10px; }
.agree-note a { color: var(--accent); }

/* 利用ルール */
.rules { margin-top: 8px; line-height: 1.9; }
.rules h2 { font-size: 15.5px; margin: 24px 0 8px; color: var(--accent); }
.rules ul { padding-left: 1.3em; }
.rules li { margin-bottom: 4px; }
.rules-foot { color: var(--ink-2); font-size: 12.5px; margin-top: 24px; }

/* 通報一覧(運営用) */
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 14px 0;
}
.report-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.report-author { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.report-acts { display: flex; gap: 24px; margin-top: 12px; }
.report-acts form { display: contents; }

/* 認証フォーム(登録・ログイン) */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 32px auto;
  max-width: 420px;
}
.auth-card h1 { font-size: 22px; margin-bottom: 2px; }
.auth-lede { color: var(--ink-2); font-size: 13px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; flex: 1; }
.field span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { width: 100%; padding-right: 40px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.pw-toggle:hover { color: var(--ink); background: var(--accent-soft); }
.field-row { display: flex; gap: 12px; }
button.wide { width: 100%; padding: 10px; margin-top: 6px; }
.auth-switch { font-size: 13px; color: var(--ink-2); margin-top: 16px; text-align: center; }
.auth-switch a { color: var(--accent); }

/* プロフィール */
.profile-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 20px; line-height: 1.3; }
.profile-handle { color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }
.profile-stats { font-size: 13.5px; margin-top: 8px; }
.profile-stats strong { font-weight: 800; }
.profile-stats a { color: inherit; text-decoration: none; }
.profile-stats a:hover { text-decoration: underline; color: var(--accent); }
.profile-meta { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.follow-btn { flex-shrink: 0; }
.follow-btn.following {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* 設定ページ */
.settings-card { margin: 16px auto; }
.settings-card h2 { font-size: 16px; margin-bottom: 12px; }
.settings-note { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.danger-card { border-color: var(--accent); }
.danger-btn { background: none; border: 1px solid var(--accent); color: var(--accent); }
.danger-btn:hover { background: var(--accent); color: #fff; filter: none; }

/* 検索 */
.search-bar {
  display: flex;
  gap: 8px;
  margin: 20px 0 0;
}
.search-bar input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 8px 18px;
}
.search-bar input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-bar button { padding: 8px 20px; font-size: 13.5px; }
.section-title {
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-2);
  font-weight: 700;
  margin: 24px 0 8px;
}
.user-results { display: flex; flex-direction: column; gap: 8px; }
.user-result {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--ink);
}
.user-result:hover { border-color: var(--accent); }
.user-result-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-result .handle { font-size: 12.5px; color: var(--ink-2); }

/* 返信ラベル(タイムライン上のリプライに付く) */
.reply-label {
  display: inline-block;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  margin: 2px 0;
}
a.reply-label:hover { color: var(--accent); text-decoration: underline; }
