/*========indx.css========*/
/*--重設空隙--*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-image: url('/image/0-background.jpg'); 
    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; 
}

/*Login*/
.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);
}

/*以上為標題*/

/* login */
#auth-section {
    background-color: #fff;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#welcome-msg {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
}

#post-form-section {
    background-color: #fff;
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-top: 4px solid rgb(21, 192, 183); 
}

#post-form-section h3 {
    margin-bottom: 15px;
    color: #333;
}

input[type="text"], 
textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: #fafafa;
}

input[type="text"]:focus, 
textarea:focus {
    outline: none;
    border-color: rgb(21, 192, 183);
    background-color: #fff;
}

/* 預覽圖 */
#preview-box {
    margin-top: 10px;
    text-align: center;
    background: #f1f1f1;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

#preview-img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 文章列表 */
#posts-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 10px;
}

/* 卡片文章 */
.post {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    transition: transform 0.2s;
    border: 1px solid #eee;
}

.post:hover {
    transform: translateY(-5px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.post a {
    display: block;
    color: inherit;
}

/* 卡片圖片 */
.post img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* 卡片 */
.post-content {
    padding: 20px;
}

.post h2 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-tag {
    display: inline-block;
    background: #e0f2f1;
    color: rgb(21, 192, 183);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.click-hint {
    text-align: right;
    color: #999;
    font-size: 0.8em;
    margin-top: 10px;
}

button {
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.2s;
}

button:hover { opacity: 0.9; }

#btn-login, #btn-submit {
    background-color: #4285f4;
    color: white;
}

#btn-logout {
    background-color: #eee;
    color: #555;
}

/* 隱藏 */
.hidden {
    display: none !important;
}

/* 頁尾 */
.footer {
    background-color: #fff;
    width: 100%;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid #eee;
    color: #666;
}

@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;
    }
}
