@font-face {
  font-family: 'TypeLand';
  src: url('../webfont/TypeLand.woff') format('woff'); 
  font-display: swap;
}

/* 全局樣式 */
* {
  margin: 0;
  padding: 0;    
  text-decoration:none;
  List-style: none;
  box-sizing: border-box;    
  font-family: 'TypeLand';
}

/* 全域變數 */
:root {
  --back_color_01: #F8F8F8;
  --back_color_02: #FFF2D6;
  --oil_color_effect: palevioletred;
  --oil_color_black:rgb(34, 34, 34);
  --oil_paper_color: #FFF2D6;
  --slider_width_cover:80vw;
  --slider_width_inside:79vw;
  --secttion_hight:900px;

  --global--size: clamp(2rem, 4vw, 5rem);
  --anim--hover-time: 400ms;
  --anim--hover-ease: cubic-bezier(0.25, 1, 0.5, 1);
  --border-width: clamp(1px, 0.0625em, 4px);

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(10px);
  --glass-shadow:
    inset 0 0.125em 0.125em rgba(0, 0, 0, 0.05),
    inset 0 -0.125em 0.125em rgba(255, 255, 255, 0.5),
    0 0.25em 0.125em -0.125em rgba(0, 0, 0, 0.2),
    0 0 0.1em 0.25em inset rgba(255, 255, 255, 0.2);

  --modal-dark-bg: rgba(30, 30, 30, 0.95);
  
  /* ✅ RWD 變數 */
  --card-width-desktop: 260px;
  --card-width-tablet: 200px;
  --card-width-mobile: 150px;
  --topbar-height: 80px;
}

html{
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  overflow-x: hidden !important;
  overflow-y: visible; /* ✅ 讓 body 可以正常滾動 */
  background-color: var(--oil_color_black);
  margin: 0;
  padding: 0;

  background-color: var(--oil_color_black);
  position: relative;
  /* text-align: center; */
  /* padding: 80px 0 20px; */
  background-image: url('/static/img/www.webp');
  background-repeat: repeat;
  background-attachment: fixed;   
  background-size: 350px 350px;
  background-position: top left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* 主要內容區域，給頂部導航欄留出空間 */
main {
  margin-top: var(--topbar-height);
  overflow-x: hidden !important;
  padding-left: 1rem;
  padding-right: 1rem;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==================================================================== */
/* ====================== 響應式圖片牆區域 ========================== */
/* ==================================================================== */

/* 主圖片牆區域 - 響應式瀑布流布局 */
.postwall {
  width:100%;
  /* columns: 200px; */
}
/* 卡片pool - 響應式 */
.post-card {
  /* top: 310px; */
  width: var(--card-width-desktop);
  border-radius: 10px;
  overflow: hidden;
  /* background: transparent; */
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  contain: layout style paint;
  will-change: transform, left, top;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;         
  /* 讓卡片吃滿欄寬 */
  width: 100%;                   
  /* 關鍵：不要固定 260px，交給欄寬決定 */
  position: relative;            
  /* 給 info-bar 定位用 */
  box-shadow: none;              
  /* 需要陰影再加 */
  /* 移除 height: fit-content */
  height: auto; /* 改为自动高度 */

  line-height: 0; /* 移除图片下方的空白间隙 */
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
/* 單獨卡片 */
.image-wrapper {
  position: relative;
  /* width: var(--card-width-desktop); */
  height: auto;
  line-height: 0; /* 移除圖片下方的空白間隙 */
}

/* 圖片樣式 - 響應式 */
.image-wrapper img {
  margin: 0 0 1rem;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;

}

/* hover 時才顯示下方 info-bar */
.post-card .info-bar {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 0.2rem 0.3rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  text-align: right;
  font-size: clamp(1rem, 2vw, 1.1rem);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover .info-bar {
  opacity: 1;
}

.info-bar .like-count {
  cursor: pointer;
  color: #e74c3c;
  font-size: clamp(1rem, 2vw, 1.2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.heart {
  font-size: clamp(1.4rem, 3vw, 1.6rem);
  line-height: 1;
}

.post-card .username {
  text-align: left;
  color: white;
}

/* ==================================================================== */
/* =========================== 響應式導航欄 ============================ */
/* ==================================================================== */

/* 頂部導航欄 - 響應式 */
.btn-container {
  position: fixed;  /* 固定定位 */
  top: 0;           /* 貼齊頂部-1 */
  left: 0;          /* 貼齊左側 */
  right: 0;         /* 貼齊右側 */
  z-index: 1200;    /* 確保在最上層 */
  
  width: auto;
  max-width: 460px; /* 最大寬度 */
  height: 80px;     /* 固定高度 */
  margin: 0 auto;   /* 水平置中 */
  padding: 10px;    /* 左右內距 0 8px; */

  background: transparent; /* 半透明背景 */
  backdrop-filter: blur(5px);        /* 毛玻璃效果 */
  border-radius: 15px;      /* 只圓角下方 */
  display: flex;
  justify-content: space-around;
  align-items: center;
  border: var(--oil_color_black) dashed .3px; 
}

/* 固定搜尋框寬度 */
.btn-container .search-input {
  width: 200px;
  max-width: 200px;
}

.btn-container input#searchInput {
  flex: 1;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: none;
  font-size: clamp(0.9rem, 2vw, 1rem);
  background-color: rgba(255, 255, 255, 0.7);
  min-width: 120px;
}

/* 右側按鈕區 - 響應式 */
.top-buttons {
  display: flex;
  align-items: center;
  gap: clamp(0.3rem, 1vw, 0.5rem);
}

.bar_btn {
  width: 60px;
  height: 60px;
  
  background:rgba(14, 14, 14, 0.3);    
  border-radius: 15px;    
  border: var(--oil_paper_color) groove 0.01rem;
  text-shadow: 0em 0.3em 0.05em rgba(0, 0, 0, 0.3);
  line-height:60PX;  
  letter-spacing: 0.1em;

  text-align: center;
}

.btn-container .bar_btn a {
  text-decoration: none;
  color: var(--oil_paper_color);
}

.btn-container .bar_btn:hover a {
  color: rgb(248, 248, 248);
  text-shadow: RED -2px 0, cyan 2px 0;
  transform: scale(1.1);
  animation: 1s;
}

.btn-container .bar_btn:hover {
  background-color: rgba(255, 242, 214, 0.1);
}

/* =================[LOGO]========================== */
#logo-link {
  position: relative;          /* ✅ 關鍵：讓 a 的 inset:0 參考這個容器 */
  width: 60px;
  height: 60px;
  background: rgba(14,14,14,0.3);
  border-radius: 15px;
  border: var(--oil_paper_color) groove 0.01rem;
  /* line-height: 60px;  建議移除，避免干擾置中 */
  letter-spacing: 0.1em;
  text-align: center;
}

#logo-link a {
  position: absolute;
  inset: 0;
  display: flex;               /* ✅ 用 a 來置中 img */
  align-items: center;
  justify-content: center;
}

#logo-link img {
  display: block;
  max-width: 90%;
  height: auto;
  /* transition: filter 0.1s ease; */
}

#logo-link:hover img {
  filter: drop-shadow(-2px 0 red) drop-shadow(2px 0 cyan);
  animation: 1s;
}

#logo-link:hover {
  background-color: rgba(255, 242, 214, 0.1);
  }
/* ==================================================================== */
/* ======================== 響應式 Modal ============================ */
/* ==================================================================== */

/* Modal 基本樣式 - 響應式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1400;
  backdrop-filter: blur(5px);
  padding: 20px;
}

.modal.hidden {
  display: none;
}

/* IG風格 Modal 內容容器 - 響應式 */
.modal-content {
  display: flex;
  height: min(90vh, 800px);
  width: min(90vw, 1200px);
  background: #262626;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

/* 左側圖片區域 - 響應式 */
.modal-image-section {
  flex: 2;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.modal-image-section img {
  transition: opacity 0.3s ease, transform 0.3s ease;
  width: auto;            /* 關鍵：不要固定寬高 */
  height: auto;           /* 關鍵：不要固定寬高 */
  max-width: 100%;        /* 最多不超過容器 */
  max-height: 100%;       /* 最多不超過容器 */
  object-fit: contain;    /* 保持比例且完整顯示 */
  border-radius: 0;
}

/* 右側內容區域 - 響應式 */
.modal-content-section {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: #262626;
  border-left: 1px solid #363636;
}

/* 關閉按鈕 - 響應式 */
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: clamp(20px, 4vw, 24px);
  color: white;
  cursor: pointer;
  z-index: 1001;
  width: clamp(28px, 6vw, 32px);
  height: clamp(28px, 6vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  color: var(--oil_color_effect);
  font-weight: normal;
}

/* Modal 頭部區域 - 響應式 */
.modal-header {
  padding: clamp(12px, 3vw, 16px);
  border-bottom: 1px solid #363636;
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 8px);
  background: #262626;
  min-height: clamp(32px, 8vw, 36px);
}

.modal-header img {
  width: clamp(36px, 8vw, 42px);
  height: clamp(36px, 8vw, 42px);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #555;
  background-color: #fff;
}

.modal-header .user-info {
  flex: 1;
}

.modal-header .username {
  font-weight: 600;
  font-size: clamp(14px, 3vw, 18px);
  color: white;
  letter-spacing: .1rem;
}

/* 內容區域 - 響應式 */
.modal-post-info {
  padding: clamp(10px, 3vw, 12px) clamp(12px, 3vw, 16px);
  border-bottom: 1px solid #363636;
}

.post-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(8px, 2vw, 12px);
}

.post-info-content {
  flex: 1;
}

.modal-post-info h3 {
  font-size: clamp(18px, 4vw, 24px);
  margin-bottom: clamp(4px, 1vw, 6px);
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.modal-post-info p {
  font-size: clamp(14px, 3vw, 18px);
  color: #a8a8a8;
  line-height: 1.4;
  word-wrap: break-word;
}

/* 編輯按鈕 - 響應式 */
.edit-post-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f5f5f5;
  padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px);
  border-radius: 6px;
  font-size: clamp(10px, 2vw, 12px);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 500;
}

.edit-post-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
/* =======================[ 標 籤 區 域 ]======================= */
/* ============================================================ */
/* 標籤區域 - 響應式 */
.modal-tags {
  margin-top: clamp(8px, 2vw, 12px);
  padding-top: clamp(6px, 2vw, 8px);
  color: #8e8e8e;
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: 0.03rem;
}

.modal-tags-title {
  font-size: clamp(10px, 2vw, 12px);
  color: #8e8e8e;
  margin-bottom: clamp(4px, 1vw, 6px);
 
}

.modal-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(4px, 1vw, 6px);
}

.tag-item {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
  padding: clamp(3px, 1vw, 4px) clamp(6px, 2vw, 8px);
  border-radius: 12px;
  font-size: clamp(9px, 2vw, 11px);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
  letter-spacing: 0.02rem;
}

.tag-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.tag-item::before {
  content: "#";
  color: #8e8e8e;
  margin-right: 2px;
}
/* =================[ 互 動 按 鈕 區 域 ]======================= */
/* ============================================================ */
/* 互動按鈕區域 - 響應式 */
.modal-actions {
  padding: clamp(6px, 2vw, 8px) clamp(12px, 3vw, 16px);
  border-bottom: 1px solid #363636;
  background: #262626;
  letter-spacing: .1rem;
}

.like-button {
  background: none;
  border: none;
  color: #ed4956;
  font-size: clamp(12px, 3vw, 14px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 6px);
  padding: 0;
  transition: opacity 0.2s ease;
}

.like-button:hover {
  opacity: 0.7;
}

.like-button .like-count {
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 600;
  color: white;
  letter-spacing: .05rem;
}

#modal-like-icon {
  font-size: clamp(14px, 3vw, 16px);
  transition: transform 0.2s ease;
}
/* =======================[ M o d a l ]======================= */
/* ============================================================ */
/* 留言列表區域 - 響應式 */
.modal-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: clamp(6px, 2vw, 8px) 0;
  background: #262626;
}

/* 留言項目 - 響應式 */
.comment-item {
  padding: clamp(4px, 1vw, 6px) clamp(12px, 3vw, 16px);
  display: flex;
  gap: clamp(6px, 2vw, 8px);
  flex-direction: row;
  align-items: flex-start;
  transition: background-color 0.2s ease;
  min-height: clamp(20px, 5vw, 25px);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  direction: ltr;
}

.comment-item:hover {
  background-color: rgba(255,255,255,0.03);
}

.comment-avatar {
  width: clamp(35px, 8vw, 45px);
  height: clamp(35px, 8vw, 45px);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #555;
}

.comment-content {
  display: block;
  flex: 1;
  min-width: 0;
  letter-spacing: .1rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  direction: ltr;
}

.comment-username {
  font-weight: 600;
  font-size: clamp(12px, 3vw, 14px);
  margin-bottom: clamp(2px, 1vw, 4px);
  color: white;
}

.comment-text {
  font-size: clamp(12px, 3vw, 14px);
  line-height: 1.4;
  color: #f5f5f5;
  word-wrap: break-word;
  margin-bottom: clamp(1px, 0.5vw, 2px);
}

.comment-time {
  font-size: clamp(10px, 2vw, 12px);
  color: #8e8e8e;
}

/* 留言輸入區域 - 響應式 */
.modal-comment-form {
  padding: clamp(10px, 3vw, 12px) clamp(12px, 3vw, 16px);
  border-top: 1px solid #363636;
  display: flex;
  gap: clamp(8px, 2vw, 10px);
  align-items: center;
  background: #262626;
  min-height: clamp(36px, 9vw, 44px);
}

.comment-input {
  flex: 1;
  background: none;
height: 60px;
  color: white;
  font-size: clamp(11px, 3vw, 13px);
  outline: none;
  font-family: inherit;
  padding: clamp(4px, 1vw, 6px) 0;

  border: 1px solid rgba(255, 255, 255, 0.2); /* ✅ 新增：输入框边框 */
  /* border-radius: 8px; */
  padding: 8px 12px; /* ✅ 调整内边距 */
}

.comment-input:focus {
  border-color: #0095f6; /* ✅ 新增：聚焦时蓝色边框 */
  outline: none;
}

.comment-input::placeholder {
  color: #8e8e8e;
}

.comment-submit-btn {
  background-color: var(--oil_color_effect);
  color: white;
  padding: 0.5rem 1.2rem;
  font-size: clamp(11px, 3vw, 13px);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 10px);
  text-shadow: 0em 0.2em 0.05em rgba(0, 0, 0, 0.2);
  transition: color 0.4s ease;
}

.comment-submit-btn:hover:not(:disabled) {
  opacity: 0.7;
}

.comment-submit-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  color: #8e8e8e;
}

/* ==============[ 會 員 設 定 - 個 性 化 頭 像 ]=============== */
/* ============================================================ */
/* 會員下拉選單  */
.user-menu {
  position: relative;
}

/* 個人化使用者頭像按鈕 */
.btn-container .user-avatar-btn {
  /* width: clamp(50px, 8vw, 60px);
  height: clamp(50px, 8vw, 60px); */
  width:   60px;
  height:  60px;
  border-radius: 15px;
  border: 1px solid var(--oil_paper_color);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background-color: rgba(14, 14, 14, 0.3); /* ✅ fallback背景 */
  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.5); /* 内缩1px边框效果 */
}

/* 新增一個偽元素來建立徑向模糊遮罩 */
.btn-container  .user-avatar-btn::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 2px;
  right: 2px;
  bottom: 3px;
  border-radius: 12px; /* 比父元素小1px */
  background: radial-gradient(
    circle at center,
    transparent 30%,
    rgba(0, 0, 0, 0.1) 60%,
    rgba(0, 0, 0, 0.3) 90%,
    rgba(0, 0, 0, 0.5) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* 選單圖示覆蓋層 - 預設隱藏 */
.btn-container .user-avatar-btn::before {
  content: "☰";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  /* color: var(--oil_paper_color); */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: bold;
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: 15px;
  backdrop-filter: blur(2px);

  color: rgb(248, 248, 248); /* ✅ 改为和其他按钮一样的颜色 */
  text-shadow: RED -2px 0, cyan 2px 0; /* ✅ 新增：红青色文字阴影 */
  transform: scale(1.1); /* ✅ 新增：1.1倍缩放效果 */
}

.user-avatar-btn:hover::before {
  opacity: 1;
}

/* 當沒有頭像時顯示預設圖示 */
.user-avatar-btn.no-avatar {
  background-image: none;
  background-color: rgba(14, 14, 14, 0.5);
}

.user-avatar-btn.no-avatar:hover::after {
  display: none; /* hover时隐藏，显示::before的图标 */
}

/* 移除原有的bar_btn樣式覆蓋 /* 重置所有样式 */
.user-menu .bar_btn {
  all: unset; 
}

.user-avatar-btn.no-avatar:hover::before {
  color: rgb(248, 248, 248);
  text-shadow: RED -2px 0, cyan 2px 0;
  transform: scale(1.1);
}

.user-avatar-btn.no-avatar::after {
  content: "☰";
  color: var(--oil_paper_color);
  font-size: clamp(16px, 4vw, 20px);
  font-weight: bold;
  z-index: 2; /* ✅ 确保显示在最上层 */
}
/* =================[ 下 拉 選 單 ]============================ */
/* ============================================================ */
.floating-sort {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  /* background: rgba(0, 0, 0, 0.7); */
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
   /* 新增陰影提升可視性 */
  /* box-shadow: 0 2px 5px rgba(0,0,0,0.2); */
}

.floating-sort > button {
  padding: clamp(0.4rem, 2vw, 0.5rem) clamp(0.8rem, 3vw, 1rem);
  background-color: red;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: clamp(12px, 3vw, 14px);
}


.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  white-space: nowrap;
  width: clamp(100px, 20vw, 120px);
  margin: 10px auto;
  padding: clamp(8px, 2vw, 10px);
  
  background: transparent; /* 半透明背景 *//* ✅ 增加不透明度 */
  backdrop-filter: blur(5px); /* ✅ 增强模糊效果 */
  border-radius: 15px;
  border: var(--oil_color_black) dashed 0.3px;
 
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3); /* ✅ 增强阴影 */
  z-index: 1500; /* ✅ 提高 z-index，确保在所有元素之上 */
}

.dropdown.hidden {
  display: none !important;
}

.dropdown_btn {
  width: clamp(90px, 18vw, 100px);
  height: clamp(35px, 7vw, 40px);
  background: rgba(14, 14, 14, 0.5);
  border-radius: 15px;
  border: var(--oil_paper_color) groove 0.01rem;
  text-shadow: 0em 0.3em 0.05em rgba(0, 0, 0, 0.3);
  line-height: clamp(35px, 7vw, 40px);
  letter-spacing: 0.1em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
}

.dropdown_btn a {
  text-decoration: none;
  color: var(--oil_paper_color);
}

.dropdown_btn a:hover {
  color: rgb(248, 248, 248);
  text-shadow: RED -2px 0, cyan 2px 0;
  transform: scale(1.1);
  animation: 1s;
}

/* ========================[ 最 新 上 傳 ] ======================== */
/* ==================================================================== */

.sort-dropdown {
  text-align: center;
  margin-top: 0.3rem;
  background: rgba(0, 0, 0, 0.7);
  /* ✅ 增加不透明度 */
  /* border: 1px solid #ccc; */
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* ✅ 增强阴影 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: clamp(120px, 25vw, 140px);
  z-index: 1350; /* ✅ 设置合适的 z-index */
  position: absolute;
  left: 0;
  top: 100%;
}

.sort-dropdown.hidden {
  display: none !important;
}

.sort-dropdown > div {
  padding: clamp(0.4rem, 2vw, 0.5rem) clamp(0.8rem, 3vw, 1rem);
  cursor: pointer;
  font-size: clamp(12px, 3vw, 14px);
}

.sort-dropdown > div:hover {
  background-color:var(--oil_color_effect);
  /* color: rgba(0, 0, 0, 0.7);; */
}

/* ======================== 編輯功能 RWD ============================ */
/* ==================================================================== */

.edit-post-form {
  margin-top: clamp(8px, 2vw, 12px);
  padding: clamp(8px, 3vw, 12px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);

  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.edit-input,
.edit-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: clamp(6px, 2vw, 8px) clamp(8px, 3vw, 12px);
  border-radius: 6px;
  font-size: clamp(11px, 3vw, 13px);
  margin-bottom: clamp(6px, 2vw, 8px);
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.edit-textarea {
  resize: vertical;
  min-height: clamp(50px, 12vw, 60px);
}

.edit-input:focus,
.edit-textarea:focus {
  outline: none;
  border-color: #0095f6;
  background: rgba(255, 255, 255, 0.15);
}

.edit-actions {
  display: flex;
  gap: clamp(6px, 2vw, 8px);
  justify-content: flex-end;
  margin-top: clamp(8px, 3vw, 12px);
}

.save-edit-btn,
.cancel-edit-btn {
  padding: clamp(6px, 2vw, 8px) clamp(12px, 3vw, 16px);
  border-radius: 6px;
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.save-edit-btn {
  background: #0095f6;
  color: white;
  border: none;
}

.save-edit-btn:hover {
  background: #1877f2;
}

.cancel-edit-btn {
  background: transparent;
  color: #8e8e8e;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-edit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

/* ==================================================================== */
/* ======================== 留言編輯功能 RWD ======================== */
/* ==================================================================== */

.comment-actions {
  display: none;
  margin-top: 4px;
  gap: 8px;
  align-items: center;
  flex-direction: row; /* ✅ 新增 */
}

.comment-item:hover .comment-actions {
  display: flex;
}

.comment-action-btn {
  background: none;
  border: none;
  color: #8e8e8e;
  font-size: clamp(9px, 2vw, 11px);
  cursor: pointer;
  padding: clamp(1px, 0.5vw, 2px) clamp(4px, 1vw, 6px);
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap; /* ✅ 新增：防止文字换行 */
}

.comment-action-btn:hover {
  background-color: rgba(255,255,255,0.1);
  color: #f5f5f5;
}

.comment-action-btn.edit-btn:hover {
  color: #0095f6;
}

.comment-action-btn.delete-btn:hover {
  color: #ed4956;
}

.comment-edit-input {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid #555;
  color: white;
  font-size: clamp(10px, 2vw, 12px);
  padding: clamp(3px, 1vw, 4px) clamp(6px, 2vw, 8px);
  border-radius: 4px;
  font-family: inherit;
  margin-top: clamp(3px, 1vw, 4px);
}

.comment-edit-input:focus {
  outline: none;
  border-color: #0095f6;
}

.comment-edit-actions {
  display: flex;
  gap: clamp(4px, 1vw, 6px);
  margin-top: clamp(3px, 1vw, 4px);
}

.comment-edit-actions button {
  font-size: clamp(8px, 2vw, 10px);
  padding: clamp(2px, 1vw, 3px) clamp(6px, 2vw, 8px);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.save-edit-btn {
  background-color: #0095f6;
  color: white;
}

.cancel-edit-btn {
  background-color: transparent;
  color: #8e8e8e;
  border: 1px solid #555;
}

.save-edit-btn:hover {
  background-color: #1877f2;
}

.cancel-edit-btn:hover {
  background-color: rgba(255,255,255,0.1);
}

/* ==================================================================== */
/* ======================== 滾動條樣式 RWD ========================== */
/* ==================================================================== */
/* ✅ 自定義滾動條，讓它更美觀 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--oil_color_effect);
  border-radius: 4px;
  opacity: 0.7;
}
.modal-comments-list::-webkit-scrollbar {
  width: clamp(3px, 1vw, 4px);
}

.modal-comments-list::-webkit-scrollbar-track {
  background: transparent;
}

.modal-comments-list::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: clamp(1px, 0.5vw, 2px);
}

.modal-comments-list::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ==================================================================== */
/* ======================== 動畫效果 ============================== */
/* ==================================================================== */

.modal {
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.comment-item {
  animation: commentSlideIn 0.3s ease-out;
}

@keyframes commentSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================================================================== */
/* ======================== [RWD] ============================== */
/* ==================================================================== */

/* 大型桌面 (1440px+) */
@media (min-width: 1440px) {

}

/* 平板橫向 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {

}

/* 平板直向 (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {  
  .floating-sort {
    top: 70px;
    right: 10px;
    padding: 6px 10px;
  }
}

/* 手機 (320px - 480px) */
@media (max-width: 480px) {
  .btn-container .search-input {
    width: 120px; /* 從 200px 縮減為 120px */
    max-width: 120px;
    min-width: 100px; /* 設定最小寬度避免過度壓縮 */
  }
  
  .btn-container input#searchInput {
    flex: none; /* 移除 flex: 1，使用固定寬度 */
    margin: 0 0.5rem; /* 減少左右邊距 */
    padding: 0.4rem 0.8rem; /* 減少內邊距 */
    font-size: 0.85rem; /* 稍微減小字體 */
  }
  
  /* 確保按鈕容器有足夠的彈性 */
  .btn-container {
    padding: 8px; /* 減少內邊距 */
    max-width: 100%; /* 確保不超出螢幕 */
  }
  
  /* 確保 logo 和其他按鈕尺寸一致 */
  /* #logo-link,
  .bar_btn,
  .user-avatar-btn {
    width: 50px !important;
    height: 50px !important;
    flex-shrink: 0;
  }
   */
  /* 調整右側按鈕群組間距 */
  /* .top-buttons {
    gap: 0.25rem;
  } */
  
  .post-card .info-bar {
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
  }
  
  /* Modal 針對小屏幕優化 */
  .modal {
    padding: 0;
  }
  
  .modal-content {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .modal-image-section {
    max-height: 50vh;
  }
  
  .modal-header,
  .modal-post-info,
  .modal-actions,
  .modal-comment-form {
    padding: 6px 10px;
  }
  
  .comment-item {
    padding: 3px 10px;
    min-height: 28px;
  }
  
  .modal-header img,
  .comment-avatar {
    width: 30px !important;
    height: 30px !important;
  }
  
  .close-btn {
    top: 5px;
    right: 10px;
    font-size: 20px;
    width: 24px;
    height: 24px;
  }
  
  /* 下拉選單針對小屏幕優化 */
  .dropdown {
    width: 90px;
    padding: 6px;
  }
  
  .dropdown_btn {
    width: 80px;
    height: 32px;
    line-height: 32px;
    font-size: 0.6rem;
    margin: 2px 0;
  }
  
  /* 懸浮按鈕針對小屏幕優化 */
  .floating-sort {
    top: 60px;
    right: 5px;
    padding: 4px 8px;
  }
  
  .floating-sort > button {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }
  
  .sort-dropdown {
    min-width: 100px;
  }
  
  .sort-dropdown > div {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }
  
  /* 編輯功能針對小屏幕優化 */
  .post-info-header {
    flex-direction: column;
    gap: 6px;
  }
  
  .edit-post-btn {
    align-self: flex-start;
    font-size: 0.6rem;
    padding: 3px 8px;

    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f5f5f5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
  }
  
  .edit-actions {
    flex-direction: column;
    gap: 4px;
  }
  
  .save-edit-btn,
  .cancel-edit-btn {
    width: 100%;
    padding: 6px 12px;
    font-size: 0.7rem;
  }
  
  /* 標籤針對小屏幕優化 */
  .tag-item {
    font-size: 0.6rem;
    padding: 2px 5px;
  }
  
  /* 留言操作針對小屏幕優化 */
  .comment-action-btn {
    font-size: 0.6rem;
    padding: 1px 3px;
  }
}

/* 超小屏幕 (max-width: 320px) */
@media (max-width: 320px) {
  .btn-container .search-input {
    width: 100px;
    max-width: 100px;
    min-width: 80px;
  }
  
  .btn-container input#searchInput {
    margin: 0 0.3rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  
  /* #logo-link,
  .bar_btn,
  .user-avatar-btn {
    width: 45px !important;
    height: 45px !important;
  } */

  .floating-sort {
    top: 55px;
    right: 3px;
    padding: 3px 6px;
  }
  
  .dropdown {
    width: 70px;
  }
  
  .dropdown_btn {
    width: 60px;
    height: 28px;
    line-height: 28px;
    font-size: 0.5rem;
  }
}
/* ====================================================================== */
/* =========================== 全螢幕視覺最佳化 =========================== */
.modal:fullscreen,
.modal-content:fullscreen,
.modal-image-section:fullscreen {
  background: #000;
}

#modal-img:fullscreen {
  /* object-fit: contain;
  width: 100vw;
  height: 100vh;
  background: #000; */
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
}

/* 當非原生全螢幕時，用 .emulated-fullscreen 模擬 */
.emulated-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  z-index: 2000 !important;
}

.emulated-fullscreen #modal-img {
  /* width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: #000 !important; */
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  background: #000 !important;
}

/* 指標提示 */
#modal-img {
  cursor: zoom-in;
}
/* :is(.modal:fullscreen, .emulated-fullscreen) #modal-img {
  cursor: zoom-out;
} */

/* static/css/postwall.css：加在 .emulated-fullscreen 區塊之後 */
.emulated-fullscreen .modal-content-section { 
  display: none !important; 
}
.emulated-fullscreen .modal-image-section {
   flex: 1 1 auto; 
   max-width: 100vw; 
   max-height: 100vh; 
  }




/* ==================================================================== */
/* ======================= 橫屏模式優化 ============================= */
/* ==================================================================== */

/* 手機橫屏 */
@media (max-width: 768px) and (orientation: landscape) {
  .modal-content {
    flex-direction: row;
    height: 95vh;
    width: 98vw;
  }
  
  .modal-image-section {
    flex: 2;
    max-height: none;
  }
  
  .modal-content-section {
    flex: 1;
    min-width: 250px;
    border-left: 1px solid #363636;
    border-top: none;
  }

  .floating-sort {
    top: 55px;
  }
}

/* ======================= 打印樣式 ================================ */
/* ==================================================================== */

@media print {
  .btn-container,
  .floating-sort,
  .modal {
    display: none !important;
  }
  
  .post-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  main {
    margin-top: 0;
  }
}

/* ======================= 高對比度模式 ============================= */
/* ==================================================================== */

@media (prefers-contrast: high) {
  .modal-content {
    border: 2px solid white;
  }
  
  .comment-item:hover {
    background-color: rgba(255,255,255,0.1);
  }
  
  .tag-item {
    border: 2px solid rgba(255, 255, 255, 0.4);
  }
  
  .edit-input,
  .edit-textarea,
  .comment-edit-input {
    border: 2px solid rgba(255, 255, 255, 0.4);
  }
}

/* ======================= 減少動畫模式 ============================= */
/* ==================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .modal {
    animation: none;
  }
  
  .comment-item {
    animation: none;
  }
}

/* ======================= 深色模式偏好 ============================= */
/* ==================================================================== */

@media (prefers-color-scheme: dark) {
  /* 已經是深色主題，保持現有樣式 */
}

/* ======================= 觸控設備優化 ============================= */
/* ==================================================================== */

@media (hover: none) and (pointer: coarse) {
  /* 觸控設備：增大點擊目標 */
  .post-card .info-bar {
    opacity: 1; /* 始終顯示，不需要 hover */
  }
  
  .comment-actions {
    display: flex; /* 始終顯示操作按鈕 */
  }
  
  .comment-action-btn,
  .edit-post-btn,
  .save-edit-btn,
  .cancel-edit-btn {
    min-height: 44px; /* 確保觸控目標足夠大 */
    min-width: 44px;
  }
  
  .like-button,
  .comment-submit-btn {
    min-height: 44px;
    padding: 8px 12px;
  }
  
  .tag-item {
    min-height: 32px;
    padding: 6px 10px;
  }
}
/* =========================== SVG 愛 心 ============================= */
/* SVG愛心 */
.heart-svg {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s ease;
  margin-right: 0.3rem;
}

.heart-svg.liked {
  fill: #ed4956;
  transform: scale(1.1);
}

.heart-svg:not(.liked) {
  fill: none;
  stroke: #8e8e8e;
  stroke-width: 2;
}

/* 添加动画效果 */
.heart-svg.liked {
  animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1.1); }
}
/* ======================== 鍵盤快捷鍵視覺提示 ======================== */
/* Modal 底部快捷鍵提示 */
.keyboard-hints {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  /* opacity: 0.8; */
  pointer-events: none;
  z-index: 1002;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: .7;
}

/* 快捷鍵按鈕樣式 */
.keyboard-key {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  margin: 0 2px;
  font-family: monospace;
  font-size: 10px;
  font-weight: bold;
  /* opacity: .7; */
}

/* 響應式隱藏（小屏幕不顯示） */
@media (max-width: 768px) {
  .keyboard-hints {
    display: none;
  }
}

/* 當 Modal 開啟時顯示提示 */
.modal:not(.hidden) .keyboard-hints {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 0.8;
    transform: translateX(-50%) translateY(0);
  }
}

/* ======================== 圖片切換動畫 ======================== */

/* Modal 圖片切換動畫 */
.modal-image-section img {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-image-section img.loading {
  opacity: 0.5;
  transform: scale(0.98);
}

/* 新載入圖片的淡入動畫 */
.post-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.post-card.new-card {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================== 預載入指示器 ======================== */

/* 圖片預載入時的微妙指示 */
.post-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  opacity: 0;
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.post-card.preloading::after {
  opacity: 1;
  transform: translateX(100%);
}


/* ======================== 性能優化 ======================== */

/* 減少重繪和回流 */
.post-card img {
  will-change: transform;
}

.modal-image-section img {
  will-change: opacity, transform;
}

/* GPU 加速 */
.loading-indicator,
.spinner,
.post-card {
  transform: translateZ(0);
}

/* ======================== 滾動性能優化 ======================== */

/* 平滑滾動 */
/* html {
  scroll-behavior: smooth;
} */

/* 滾動條樣式 */
body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

body::-webkit-scrollbar-thumb {
  background: var(--oil_color_effect);
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: #c73650;
}

/* ======================== 載入狀態指示 ======================== */

/* 頁面頂部載入條 */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--oil_color_effect), #ff6b9d);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 9999;
}

.loading-bar.active {
  animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

/* ======================== 骨架屏效果 ======================== */

.skeleton-card {
  width: 260px;
  height: 200px;
  background: linear-gradient(90deg, #262626 25%, #363636 50%, #262626 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 10px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ======================== 無限滾動載入指示器 ======================== */

.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  margin: 20px 0;
  transition: opacity 0.3s ease;
}

.loading-indicator.hidden {
  display: none;
}

/* 載入動畫 */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

/* 旋轉動畫 */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--oil_color_effect);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 載入文字 */
.loading-text {
  color: #a8a8a8;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 沒有更多內容指示器 */
.no-more-indicator {
  text-align: center;
  padding: 20px;
  color: #8e8e8e;
  font-size: 16px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* 錯誤指示器 */
.error-indicator {
  text-align: center;
  padding: 20px;
  color: #ed4956;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.retry-btn {
  background: var(--oil_color_effect);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.retry-btn:hover {
  background: #c73650;
}


/* ======================== 響應式設計 ======================== */

/* 平板 */
@media (max-width: 768px) {
  /* console
  .loading-indicator {
    padding: 30px 15px;
  }
  
  .spinner {
    width: 35px;
    height: 35px;
    border-width: 3px;
  }
  
  .loading-text {
    font-size: 13px;
  }
  
  .no-more-indicator {
    font-size: 14px;
    padding: 15px;
  } */
}