/* 全局樣式 */
:root {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --link-color: #e0e0e0;
  --link-visited: #e0e0e0;
  --border-color: #333333;
  --sidebar-width: 240px;
  --header-height: 48px;
  --content-max-width: 800px;
  --card-bg: #2d2d2d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none !important;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: inherit !important; /* 點擊後保持原來顏色 */
}

a {
  color: #bbbbbb;         /* 溫和的灰色 */
  text-decoration: none;  /* 移除底線 */
  transition: color 0.2s;
}

a:hover {
  color: #ffffff;         /* 滑鼠懸停時變亮一點 */
  text-decoration: none; /* 可選，加底線表示可點 */
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Microsoft JhengHei", "Meiryo", sans-serif;
  line-height: 1.6;
  display: flex;
}

/* 時間 */
.time {
  visibility: hidden;
}

/* 側邊欄樣式 */
.sidebar {
  background: var(--card-bg);
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 1px solid var(--border-color);
  padding: 1rem;
  overflow-y: auto;
  transition: transform 0.3s ease;
  transform: translateX(0);     /* ⭐ 預設顯示 */
  z-index: 1000;
  will-change: transform;      /* ⭐ 優化動畫效能 */
  padding-bottom: 4rem;
}

.sort-options {
  display: flex;
  justify-content: center;
  margin:0.5rem ;
}

.sidebar h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-color);
}

.toggle-sidebar {
  display: none;
  position: fixed;
  top: 0rem;
  left: 0rem;
  z-index: 2000;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-color);
}

.user-info {
  text-align: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-size: 1.5rem;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.auth-buttons a,
.logout-btn,
.admin-link,
.profile-link,
.notification-link  {
  display: block;
  padding: 0.5rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  background: var(--card-bg);
  transition: all 0.3s ease;
}

.auth-buttons a:hover,
.logout-btn:hover,
.admin-link:hover,
.profile-link:hover  {
  background: var(--border-color);
}

.side-nav {
  padding-top: 1rem;
}

.side-nav h3 {
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  color: var(--text-color);
}

.side-nav ul {
  list-style: none;
}

.side-nav a {
  display: block;
  padding: 0.4rem;
  text-decoration: none;
  color: var(--link-color);
  transition: color 0.3s ease;
}

.side-nav a:visited {
  color: var(--link-visited);
}

.sub-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0px 10px; /* 上下左右間距 */
  margin-left: 1rem; /* 保持有縮排 */
  padding: 0;
  list-style: none;
}

.sub-categories li {
  flex: 0 1 calc(50% - 10px); /* 每個子分類大概占一半寬度 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/*分頁*/
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 2rem auto 5rem;
  font-size: 14px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 6px 12px;
  background: #333;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  min-width: 32px;
  text-align: center;
}

.pagination .current-page {
  background: #2c2c2c;
  font-weight: bold;
}

.pagination .ellipsis {
  pointer-events: none;
  opacity: 0.5;
}


/* 主要內容區域 */
.main-content {
  margin-left: 0;
  flex-grow: 1;
  padding: 0.5rem;
  width: 100vw;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.create-post {
  margin-left: 0;
  flex-grow: 1;
  padding: 0.2rem;
  width: 100vw;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* 當有側邊欄時的樣式 */
body:has(.sidebar:not(.active)) .main-content {
  margin-left: var(--sidebar-width);
  width: calc(100vw - var(--sidebar-width));
}

/* 文章列表 */
.posts-list {
  list-style: none;
  margin: 1rem auto 6rem;
}

.post-card {
  display: block;
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  margin-bottom: 0.5rem;
  color: #ddd;
  text-decoration: none; /* ✅ 取消底線 */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  background-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 標題樣式 */
.post-card .post-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #eee;
}


.posts-list li:hover {
  transform: translateY(-2px);
}

.posts-list a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 1.1rem;
}

.posts-list small {
  display: block;
  color: var(--text-color);
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* 文章頁面 */
.post-container {
  margin: 2rem auto 6rem;   /* ⬅️ 將 bottom margin 改大，避免被 footer 蓋住 */
  padding: 1rem;
  background: #2c2c2c;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
}

/* 修正 post-container 因 sidebar 被遮擋問題 */
body:has(.sidebar:not(.active)) .post-container {
  margin-left: var(--sidebar-width);
  width: calc(100vw - var(--sidebar-width) - 4rem);
}

.post-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.post-info {
  display: flex;
  justify-content: space-between; /* 左右分散排列 */
  gap: 0.75rem;
  color: var(--text-color);
  /*opacity: 0.8;*/
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-top: 0.5rem;
}

.post-meta-left,
.post-meta-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}


/* 內容區塊 */
.post-content {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: var(--text-color);
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal;
}

.responsive-img {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  margin-top: 1rem;
  margin-bottom: 1rem;
}


/* YouTube 容器 */
.youtube-container {
  position: relative;
  width: 50%;              /* ✅ 預設寬度 50%，桌面較美觀 */
  max-width: 800px;        /* ✅ 桌面最大寬度 */
  min-width: 300px;        /* ✅ 手機最小寬度 */
  padding-bottom: 28.125%; /* ✅ 50% * 0.5625 = 16:9 高度比例 */
  margin: 1rem 0;       /* ✅ 自動置中 */
  background: var(--bg-color);
  border-radius: 4px;
  overflow: hidden;
  z-index: 100;
}

.youtube-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 100;
}
/* 回覆區塊 */

.replies-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 3rem;
}

.reply-item {
  background: var(--card-bg);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  word-wrap: break-word;
  transition: all 0.3s ease;
  scroll-margin-top: 80px;
}

.reply-item:hover {
  background-color: #2f2f2f;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.reply-header {
  display: flex;
  justify-content: space-between; /* 左右排開 */
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.reply-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* ✅ 控制間距（可依喜好調整） */
}

.author-name {
  font-weight: 600;
  color: var(--text-color);
}

.time {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 0.9rem;
}

.reply-content {
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.8;
  letter-spacing: 0.3px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.replies-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.reply-form textarea {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  resize: vertical;
}

.reply-form button {
  background: var(--link-color);
  color: var(--text-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.reply-form button:hover {
  background: var(--link-visited);
}

.icon-img {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.icon-img:hover {
  opacity: 1;
}


/* 發貼表單 */
#editor {
  background: #adadad;
  color: #000;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
  border: 1px solid #ccc;
}

.admin-options {
  display: flex;
  border: 1px solid #000000;
}

/* 回覆表單 */
/* Modal 背景 */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}

/* Modal 內容 */
.modal-content {
  background-color: #1a1a1a;
  margin: 5vh auto;
  padding: 1.5rem;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 500px;
}

/* Modal 標題欄 */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.2rem;
  color: white;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #aaa;
  cursor: pointer;
}

/* 表單內容 */
#reply-form textarea {
  font-size: 16px; 
  line-height: 1.6;
  width: 100%;
  min-height: 300px;
  background: #121212;
  color: #eee;
  padding: 1rem;
  border: 0px solid #333;
  resize: vertical;
  margin-bottom: 1rem;
}

#reply-form .submit-btn {
border: 1px solid #34487f;
    display: inline-block;
    padding: 10px 14px;
    font-size: 13px;
    background: #171b26;
    color: #d5d9e6;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-radius: 25px 0px 25px 0px;
  margin-top: 0.6rem;
}

#reply-form .cancel-btn {
  border: 1px solid #555;           /* 灰色邊框 */
  display: inline-block;
  padding: 10px 14px;
  font-size: 13px;
  background: #252525;              /* 深灰背景 */
  color: #bbb;                      /* 淺灰文字 */
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-radius: 25px 0px 25px 0px; /* 保持相同的特殊圓角 */
  margin-top: 0.6rem;
}

#create-post-form input,
#create-post-form textarea,
#create-post-form select {
  width: 100%;
  margin-bottom: 0.2rem;
  padding: 1rem;
  background: #121212;
  color: #eee;
  border: 0px solid #333;
  border-radius: 0px;
  font-size: 1rem;
}

#create-post-form .submit-btn {
border: 1px solid #34487f;
    display: inline-block;
    padding: 10px 14px;
    font-size: 13px;
    background: #171b26;
    color: #d5d9e6;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-radius: 25px 0px 25px 0px;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #eee;
}

.post-category {
  font-size: 0.85rem;
  color: #a7a7a7;
  background: #333;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.instagram-container,
.twitter-container {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  overflow: hidden;
  display: flex;
}

.instagram-container blockquote.instagram-media,
.twitter-container blockquote.twitter-tweet {
  transform: scale(0.95);              /* ✅ 常規畫面縮小一點 */
  transform-origin: top center;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

/* 🔧 滾動條樣式：適用於整個網站（WebKit 瀏覽器） */
*::-webkit-scrollbar {
  width: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.sidebar .category-children {
  margin-left: 1rem;
  font-size: 0.92em;
  line-height: 1.6;
}

/* ✅ 顯示貼文段落與換行 */
.post-content p {
  white-space: normal; /* 讓 <br> 生效，避免被 pre-wrap 蓋過 */
}

.post-content br {
  display: block;
  content: "";
  margin-top: 0.3em;
}

/* Quill 深色主體 */
.ql-toolbar.ql-snow {
  border: 1px solid #1a1a1a !important;
  background: #1e1e1e;
  color: white;
}
.ql-container.ql-snow {
  border: 1px solid #111111 !important;
  background: #111;
  color: white;
}
.ql-editor {
  color: white;
  font-size: 16px;
  line-height: 1.6; /* 建議加行高讓手機閱讀更舒服 */
}


/* Quill 工具列 icon 白色化 */
.ql-snow .ql-stroke {
  stroke: white !important;
}
.ql-snow .ql-fill {
  fill: white !important;
}
.ql-snow .ql-picker {
  color: white !important;
}
.ql-snow .ql-picker-options {
  background-color: #1e1e1e !important;
  color: white !important;
}
.ql-snow .ql-picker-label {
  color: white !important;
}
.ql-editor.ql-blank::before {
  color: #ffffff !important; /* 淺灰色，可調成 #999 或 #888 */
  font-style: normal !important;
}

/* =========================================
   引用主線頁面樣式 (Quote Chain)
   ========================================= */
/* 🔥 修改：改名為專用 class，避免影響全站 */
.quote-chain-container {
  padding: 0.5rem;
  max-width: 800px;
  margin: 2rem auto;
  background: #2c2c2c;
  border-radius: 8px;
  min-height: 50vh; /* 增加最小高度，避免內容少時太扁 */
}

/* 引用頁面的返回連結 */
.quote-chain-container .back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #4caf50;
  text-decoration: none;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.reply-block {
  background-color: #1e1e1e;
  color: #eee;
  border-left: 4px solid #4caf50;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
}
.reply-parent {
  background-color: #333;
  color: #aaa;
  padding: 1rem;
  border-left: 4px solid #777;
  margin-bottom: 1rem;
  border-radius: 6px;
}
.reply-parent .back-branch {
  font-size: 0.85rem;
  color: #4caf50;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 10px;
}
.reply-content {
  margin-top: 0.5rem;
}
.branch-buttons {
  margin-top: 1rem;
}
.branch-card {
  background: #1a1a1a;
  border: 1px solid #444;
  border-left: 4px solid #ffbc41;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.branch-card:hover {
  background: #2c2c2c;
}
.branch-floor {
  font-weight: bold;
  color: #ccc;
  margin-bottom: 0.4rem;
}
.branch-content {
  color: #aaa;
  font-size: 0.95rem;
  white-space: pre-wrap;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
}
.quote-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: #bbb;
  cursor: pointer;
}
#quote-preview {
  display: none;
  background: #222;
  padding: 10px;
  margin-bottom: 10px;
  border-left: 4px solid #555;
  font-size: 0.9rem;
  color: #ccc;
  position: relative;
}
#quote-preview button {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
}

/* 確保引用頁面的 Modal 樣式正確 (沿用全站 Modal 但微調) */
.quote-chain-container ~ .modal {
  backdrop-filter: blur(4px);
  /* 確保 flex 置中生效 */
  justify-content: center; 
  align-items: center;
}



@media screen and (max-width: 768px) {
  .post-card{
    border:0px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0rem;
    border-radius: 0px;
  }
  .sidebar {
    transform: translateX(-100%);
    width: 85%;
    max-width: var(--sidebar-width);
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }

  .toggle-sidebar {
    display: block;
  }

  .main-content {
    padding-left: 0.0rem;
    padding-right: 0.0rem;
    margin-left: 0 !important;
    width: 100% !important;
  }
  .create-post {
    padding-left: 0rem;
    padding-right: 0rem;
    margin-left: 0 !important;
    width: 100% !important;
  }

  .post-container {
    padding: 0.5rem;
    margin: 0rem 0rem 6rem 0rem;
    width: 100%;
    border-radius: 0px;
  }

  .reply-item {
    border-radius: 0px;
  }

  .instagram-container blockquote.instagram-media,
  .twitter-container blockquote.twitter-tweet {
    transform: scale(0.85);            /* ✅ 小螢幕再縮小一點 */
  }
  .pagination {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .pagination a,
  .pagination span {
    flex: 0 0 auto;
  }
  .instagram-container,
.twitter-container,
.youtube-container {
  pointer-events: auto; /* 初始可互動 */
}

  .youtube-container {
    width: 90%;              /* ✅ 手機全寬 */
    padding-bottom: 50.625%; /* ✅ 90% * 0.5625 = 16:9 */
  }

.admin-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.admin-table-wrapper table {
  min-width: 800px; /* 寬度可調整，看你幾欄 */
}
  .responsive-img {
    max-width: 100%;
      max-width: 400px;
  }



  /* 檔案結尾這邊留一行空白 */
}

/* =========================================
   引用預覽區塊優化 (Quote Preview)
   ========================================= */
.quote-preview-box {
  display: none; /* 預設隱藏，由 JS 控制顯示 */
  background: #222;
  border-left: 4px solid #4caf50; /* 主色綠色 */
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 引用作者資訊 */
.quote-preview-box .quoted-author {
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 增加一個引號裝飾 */
.quote-preview-box .quoted-author::before {
  content: '❝'; 
  color: #4caf50;
  font-size: 1.2rem;
  line-height: 1;
}

/* 引用內容：限制高度 + 滾動條 */
.quote-preview-box .quoted-content {
  color: #bbb;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 100px; /* 🔥 關鍵：限制高度，避免長文把編輯器擠不見 */
  overflow-y: auto;  /* 超過高度顯示滾動條 */
  padding-right: 10px;
}

/* 美化滾動條 (Chrome/Safari) */
.quote-preview-box .quoted-content::-webkit-scrollbar {
  width: 4px;
}
.quote-preview-box .quoted-content::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}

/* 優化取消按鈕：更大、更好點 */
.quote-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ccc;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-close-btn:hover {
  background: #ff4444; /* Hover 變紅色 */
  color: white;
  transform: scale(1.1);
}

/* Instagram 容器優化：防止版面跳動 */
.instagram-container {
  width: 100%;
  /* 關鍵：設定最小高度，預留空間給貼文，避免載入時變成一條線 */
  min-height: 550px; 
  
  /* 讓未載入完成前的區塊置中 */
  display: flex;
  border-radius: 8px;
  margin: 10px 0;
}

/* 強制限制 iframe 的最大寬度，讓它在電腦版不會太寬 */
.instagram-container iframe {
  max-width: 540px !important; /* IG 標準寬度 */
  /* 確保 iframe 載入後不會小於容器 */
  min-height: 550px !important; 
}