/* tu.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Noto Sans CJK TC', 'Microsoft YaHei', 'PingFang TC', system-ui, sans-serif;
    background: #f0f2f5;
    padding: 14px;
    color: #1e2a3a;
}

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

a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.back-link {
    display: inline-block;
    margin-top: 12px;
    color: #ffd966;
    text-decoration: none;
    font-size: 0.75rem;
}

.container {
    max-width: 1210px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2a3a 100%);
    color: white;
    padding: 28px 24px;
    border-radius: 20px 20px 0 0;
}

.header h1 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.header p {
    opacity: 0.85;
    font-size: 0.7rem;
}

/* 導航欄 */
.nav-bar {
    background: white;
    padding: 8px 16px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nav-links {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.nav-links a {
    color: #2c3e50;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 30px;
    transition: 0.2s;
}

.nav-links a:hover {
    background: #e9ecef;
    text-decoration: none;
}

.nav-links a.active {
    background: #2c3e50;
    color: white;
}

.page-info {
    font-size: 0.85rem;
    color: #5a6e7c;
    background: #f0f2f5;
    padding: 6px 14px;
    border-radius: 30px;
}

/* 圖片網格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.image-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.2s;
    border: 1px solid #e9edf2;
}

.image-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.image-wrapper {
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 300px;
    position: relative;
}

.image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: 0.2s;
}

.image-wrapper img:hover {
    opacity: 0.95;
}

.image-caption {
    padding: 16px 20px;
    border-top: 1px solid #eef2f6;
    background: #fefefe;
}

.image-title {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e466e;
    margin-bottom: 8px;
}

.image-desc {
    text-align: center;
    font-size: 0.8rem;
    color: #5a6e7c;
    line-height: 1.5;
}


/* 分頁控件 */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px 0 30px;
    flex-wrap: wrap;
}

.page-btn {
    background: white;
    color: #2c3e50;
    border: 1px solid #cfdde6;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.page-btn:hover {
    background: #e9ecef;
}

.page-btn.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info-text {
    font-size: 0.8rem;
    color: #5a6e7c;
    background: #f0f2f5;
    padding: 6px 14px;
    border-radius: 30px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.75rem;
    color: #7f8c8d;
    clear: both;
}

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

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .image-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .nav-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-links {
        justify-content: center;
    }
    .pagination-bar {
        margin: 20px 0 20px;
    }
    footer {
        margin-top: 20px;
    }
}

/* 水印樣式已在 JS 中動態添加，此處保留靜態備份 */
.image-wrapper {
    position: relative;
}
.image-wrapper::after {
    content: "© 潘傳振 禁止商用";
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 16px;
    pointer-events: none;
    z-index: 2;
    font-family: inherit;
    white-space: nowrap;
}