/*========index.css========*/
/*--重設空隙--*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-image: url('/image_2bcb1e9e.png'); 
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    text-decoration: none; 
    color: inherit;
}

header {
    background-color: #000; 
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

header h1 a { 
    color: #ffffff; 
    font-weight: bold;      
}

.nav-links {
    display: flex; 
    list-style: none;
    gap: 20px;
}

.nav-links li a { 
    color: #fff; 
}

.nav-links li a.nav-login-btn {
    background-color: rgb(0, 0, 0);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: bold;
    border: 2px solid rgb(255, 255, 255);
}

.nav-links li a:hover {
    color: rgb(95, 162, 200);
}

/*以上為標題*/

.container-welcome {
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px;
}

.container-welcome h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.container-welcome p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.post-btn {
    display: inline-block;
    background-color: rgb(95, 162, 200);
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: bold;
}

.hero-btn:hover {
    background-color: rgb(18, 160, 150);
    transform: translateY(-2px);
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;

}

.announcement-board{
    background-color: rgba(255, 255, 255, 0.5);
        border-radius: 12px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.sidebar-card, .post-card {
        margin-top: 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);

}

.about-card .avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #fff;
}

.footer {
    background-color: rgba(255, 255, 255, 0.8);
    width: 100%;
    padding: 10px 0;
    text-align: center;
    color: #333;
}

.container-from{
    background-color: rgba(255, 255, 255, 0.8);
    text-align: center;
}
input:focus {
    outline: none; 
    border-color:#ffffff; 
}

@media screen and (max-width: 768px) {
    header {
        padding: 0 10px;
    }
    header h1 {
        font-size: 1.2rem;
    }
    .nav-links {
        gap: 10px; 
    }
    .nav-links li a {
        font-size: 0.9rem;
    }
    .nav-links li a.nav-login-btn {
        padding: 5px 12px; 
    }
    .main-container {
        grid-template-columns: 1fr;
    }
    .container-welcome h1 {
        font-size: 2rem;
    }
}
.color-a, .color-d{
    color: red;
}
.color-b, .color-e{
    color: green;
}
.color-c, .color-f{
    color: yellow;
}
.hidden-entrance{
    position: fixed;
    right: 0;
    bottom: 0;
    width: 5px;
    height: 5px;
    background: transparent;
    cursor: default;
    z-index: 9999;
}
.left-entrance{
     position: fixed;
    left: 0;
    bottom: 0;
    width: 5px;
    height: 5px;
    background: transparent;
    cursor: default;
    z-index: 9999;
}

/* 側邊欄基礎設定 */
.sidenav {
  height: 100%;
  width: 0;           /* 預設隱藏 */
  position: fixed;    /* 固定在螢幕上 */
  z-index: 1000;      /* 確保在最上層 */
  top: 0;
  left: 0;
  background-color: #111;
  overflow-x: hidden; /* 隱藏溢出的文字 */
  transition: 0.5s;   /* 動畫速度 */
  padding-top: 60px;
}

/* 目錄連結樣式 */
.sidenav a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 22px;
  color: #818181;
  display: block;
  white-space: nowrap; /* 防止寬度縮小時文字換行 */
  transition: 0.3s;
}

/* 滑鼠移上去的顏色 */
.sidenav a:hover {
  color: #f1f1f1;
}

/* 關閉按鈕定位 */
.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

.container-wrapper {
    display: flex;       /* 啟動彈性佈局，讓子元素橫向排列 */
    align-items: center; /* (選填) 讓兩個容器垂直居中對齊 */
}

.box-right {
    /* 這個容器會自動排在 box-left 的右邊 */
    margin-left: 20px;   /* (選填) 如果你想要兩個容器之間有一點間距 */
}

.upload-section { background: #f9f9f9; padding: 20px; border-radius: 10px; }
.form-group { margin-bottom: 15px; }
input[type="text"], textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; }
.submit-btn { background: #007bff; color: white; border: none; padding: 10px 20px; cursor: pointer; border-radius: 5px; }
#preview-container img, #preview-container video { max-width: 100%; margin-top: 10px; border-radius: 5px; }

#article-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article-card {
    background: white;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 5px solid #007bff; /* 側邊裝飾線 */
    border-radius: 4px;
}

.article-card h3 {
    margin-top: 0;
    color: #333;
}

.article-card p {
    color: #666;
    line-height: 1.6;
}

/* --- 文章模塊專屬樣式 (Namespace: .post-module) --- */

/* 1. 外層總容器：只負責間距，不干擾全局排版 */
#display-area {
    display: flex;
    flex-direction: column;
    gap: 20px; /* 文章與文章之間的距離 */
    padding: 10px;
}

/* 2. 文章卡片主體 */
.article-card {
    background: rgba(255, 255, 255, 0.9); /* 半透明白色，能透出你的背景 */
    backdrop-filter: blur(5px);           /* 磨砂玻璃效果 */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease;
}

.article-card:hover {
    transform: translateY(-3px); /* 滑過時輕微浮起 */
}

/* 3. 標題與內文 */
.article-card h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.25rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.article-card p {
    color: #444;
    line-height: 1.6;
    margin: 10px 0;
    word-wrap: break-word; /* 防止長文字爆框 */
}

/* 4. 多媒體容器 (圖片/影片) */
.media-content {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden; /* 確保圖片圓角 */
    background: #000; /* 影片黑邊背景 */
}

.media-content img, 
.media-content video {
    width: 100%;       /* 強制寬度填滿卡片 */
    max-height: 450px; /* 限制高度，避免長圖刷不到底 */
    object-fit: contain; /* 確保圖片不被裁切 */
    display: block;
}

/* 5. 檔案下載連結樣式 */
.file-link {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    color: #007bff;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}

.file-link:hover {
    background: #e2e6ea;
}

/* 6. 底部時間標記 */
.article-card .meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 15px;
    text-align: right;
}

.publish-container h3 {
    color: white;
}
div#posts-display-container h3 {
    color: white !important;
}
