/* ===== 全局設定 ===== */
* { 
	box-sizing: border-box; 
	margin: 0; 
	padding: 0; 
}

body {
    font-family: 'Noto Sans TC', 'Segoe UI', sans-serif;
    background: #fdf6f0;
    color: #333;
    line-height: 1.6;
}

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

ul { 
	list-style: none; 
}

/* ===== Header ===== */
header {
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    align-content: center;
}

header h1 {
    font-size: 1.8rem;
    color: #7c5e3c;
    width: 30%;
}

header .user-nav {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 0.9rem;
	color: #555;
	white-space: nowrap;
}

.user-name {
	font-weight: 600;
	color: #7c5e3c;
	padding-right: 10px;
	border-right: 1px solid #e6e6e6;
}

.user-nav a {
	padding: 6px 10px;
	border-radius: 6px;
	transition: background 0.25s, color 0.25s;
}

.user-nav a:hover {
	background: #f3e6db;
	color: #7c5e3c;
}

.user-nav a.logout {
	color: #a86f4c;
	font-weight: 500;
}

.user-nav a.logout:hover {
	background: #fbeee5;
	color: #7c5e3c;
}

header {
	gap: 20px;
}

header .user-info {
	margin-top: 0;
}

header a.login-btn {
    color: #7c5e3c;
    border: 1px solid #7c5e3c;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

header a.login-btn:hover {
    background: #7c5e3c;
    color: #fff;
}

/* ===== 搜尋欄 ===== */
.search-container {
    width: 40%;
    text-align: center;
    margin: 20px 0;
}

#searchInput {
    width: 100%;
    max-width: 400px;
    padding: 10px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#searchInput:focus {
    border-color: #a86f4c;
    box-shadow: 0 4px 12px rgba(168,111,76,0.2);
}

/* ===== 主內容 ===== */
main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.project-card h2 {
    font-size: 1.2rem;
    color: #a86f4c;
    margin-bottom: 10px;
}

.project-card p {
    font-size: 0.9rem;
    color: #555;
    flex-grow: 1;
}

.project-card a.btn {
    margin-top: 15px;
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    background: #a86f4c;
    color: #fff;
    font-weight: bold;
    text-align: center;
    transition: background 0.3s;
}

.project-card a.btn:hover {
    background: #7c5e3c;
}

table {
	margin: 20px 0px;
	width: 100%;
	height: auto;
}

table, th, td {
	text-align: center;
	border: 1px solid green;
}

th{
	height: 30px;
}

img{
	margin: 10px;
	width: 90%;
}

table ul li{
	margin: 20px 0px;
}

iframe{
	width: 100%;
	height: 500px;
}

.file-list {
	margin: 20px 0px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 16px;
}

.file-item {
	text-decoration: none;
	color: #333;
	text-align: center;
	padding: 12px;
	border-radius: 12px;
	background: #eeeeee;
	transition: .2s;
}

.file-item:hover {
	background: #eef3ff;
	transform: translateY(-2px);
}

.file-item img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	margin-bottom: 8px;
}

.filename {
	font-size: 13px;
	word-break: break-all;
}

.hidden{
	display: none;
}

.slideshow {
    width: 400px;           /* 寬度，可調整 */
    aspect-ratio: 9 / 16;   /* 直式長方形 */
    max-height: 700px;      /* 最大高度限制 */
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    margin: auto;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .8s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* 保持圖片比例，自動裁切 */
}

/* 文字區 */
.caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
    color: #fff;
}

.caption h3 {
    margin: 0;
    font-size: 18px;
}

.caption p {
    margin: 4px 0 0;
    font-size: 14px;
    opacity: .9;
}

/* ===== 統計欄 ===== */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    font-size: 0.9rem;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-icon { margin-right: 6px; font-size: 1.1rem; }

/* ===== 高亮關鍵字 ===== */
.highlight {
    background-color: #fff2cc;
    border-radius: 3px;
    padding: 0 2px;
}

/* ===== Footer ===== */
footer {
    margin-top: 60px;
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

/* ===== RWD ===== */
@media (max-width: 600px) {
    header h1 { 
    	font-size: 1.4rem; 
    }
    
    .project-card h2 { 
    	font-size: 1rem; 
    }
    
    .stat-item { 
    	flex: 1 1 45%; 
    }
    
	.user-nav {
		flex-wrap: wrap;
		justify-content: flex-end;
		font-size: 0.85rem;
	}

	.user-name {
		border-right: none;
		padding-right: 0;
		width: 100%;
		text-align: right;
		color: #888;
	}
	
	iframe{
		height: 300px;
	}
}
