/* ------------------------------
  全体共通
------------------------------ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  overflow-x: hidden;
  background-color: #f5f8fa;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ------------------------------
  固定ヘッダー
------------------------------ */
.floating-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 450px;
  height: 50px;
  background-color: #fff;
  border-bottom: 1px solid #e1e8ed;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.floating-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: #1da1f2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.menu {
  font-size: 14px;
  color: #555;
  flex-shrink: 0;
  margin-left: 8px;
  white-space: nowrap;
}

.logout-container {
  margin-left: 4px;
  max-width: 70px; /* 幅制限を追加 */
  flex-shrink: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.logout-link {
  font-size: 14px;
  color: #e0245e;
  font-weight: 600;
}

/* ------------------------------
  コンテンツ共通
------------------------------ */
.container {
  max-width: 450px;
  margin: 60px auto 20px;
  padding: 0 10px;
  background-color: #fff;
  border-radius: 8px;
  word-break: break-word;
}

/* ------------------------------
  フォーム
------------------------------ */
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form label {
  font-size: 14px;
  color: #333;
  font-weight: bold;
}

.form input[type="text"],
textarea {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
}

/* ------------------------------
  ボタン
------------------------------ */
.button {
  display: inline-block;
  background-color: #1da1f2;
  color: white;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 6px;
  text-align: center;
  margin-top: 8px;
}

/* ------------------------------
  タイムライン表示
------------------------------ */
.timeline-container {
  margin-top: 60px;
}

.post {
  border-bottom: 1px solid #eee;
  padding: 12px 0;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

/* 投稿ヘッダー */
.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: #333;
  max-width: 100%;
  flex: 1;
}

/* 投稿本文 */
.post p {
  font-size: 14px;
  line-height: 1.5;
  margin: 6px 0 0;
  white-space: pre-wrap;
}

/* 投稿画像 */
.post-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 8px auto 0; /* ← 修正: 中央揃え */
  border-radius: 8px;
}

/* 投稿ボタン */
.floating-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #1da1f2;
  color: white;
  font-size: 24px;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  text-align: center;
  line-height: 52px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1300;
}

/* ------------------------------
  レスポンシブ対応
------------------------------ */
@media (max-width: 320px) {
  .floating-header {
    height: 48px;
    padding: 0 4px;
    max-width: 100%; /* ← 修正: max-widthを画面幅に合わせる */
    left: 0; /* ← 修正: 固定位置を左寄せに変更 */
    transform: none; /* ← 修正: 中央寄せ無効化 */
  }

  .floating-header h1 {
    font-size: 15px;
  }

  .menu,
  .logout-link {
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 70px; /* 幅制限を追加 */
  }

  .container {
    margin: 56px 6px 16px;
    padding: 0 6px;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
  }

  .post p {
    font-size: 13px;
  }

  .floating-button {
    width: 46px;
    height: 46px;
    font-size: 20px;
    line-height: 46px;
    bottom: 16px;
    right: 16px;
  }

  .user-info {
    font-size: 12px;
  }

  .post-image {
    max-height: 180px;
    margin: 8px auto 0; /* ← 修正: 中央揃え（再定義） */
  }
}

.post-actions {
　　　　margin-top: 10px;
}
.post-actions button {
    padding: 5px 10px;
    margin-right: 5px;
    background-color: #f0f0f0;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: pointer;
}

.post-actions button:hover {
    background-color: #e0e0e0;
}
