body {
    margin: 0;
    background: white;
    color: black;
    font-family: "Times New Roman", Times, serif;
    font-size: 17px;
    line-height: 1.5;
}

.container {
    width: 950px;
    margin: 30px auto;
}

.header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.photo {
    width: 220px;
    margin-right: 30px;
}

.photo img {
    width: 200px;
    height: auto;
}

.info {
    flex: 1;
}

h1 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 34px;
    font-weight: normal;
}

h2 {
    font-size: 26px;
    font-weight: normal;
    margin-top: 40px;
    margin-bottom: 15px;
}

a {
    color: #0000EE;
}

p {
    margin-bottom: 15px;
}

ul {
    padding-left: 25px;
}

.publication {
    display: flex;
    align-items: flex-start;
    gap: 20px;

    margin-bottom: 30px;
}

.pub-image {
    flex-shrink: 0;
}

.pub-image img {
    width: 180px;
    height: 120px;
    object-fit: cover;

    border: 1px solid #ddd;
}

.pub-content {
    flex: 1;

    line-height: 1.5;
}

.photo-section {
    background-color: #ffcc004b;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 0px;
    line-height: 1;
    display: flex;             /* 讓內部的元素左右並排 */
    align-items: center;       /* 讓右邊的文字垂直置中對齊照片，若希望文字靠上對齊，可改成 flex-start */
    gap: 30px;                 /* 設定照片與文字之間的距離 */
    margin-bottom: 0px;       /* 底部留白 */
}
.intro-section {
    background-color: #f0f8ff;
    padding: 10px 30px;
    border-radius: 12px;
    margin-bottom: 0px;
    line-height: 1.3;
}

.intro-section h2 {
    margin-top: 0;
    border-bottom: none;      
}

.publication {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.pub-image img {
    width: 200px;          /* 將圖片從原本的 150 縮小至 120px，可依喜好微調 */
    border-radius: 17px;   /* 產生圓角效果，數值越大越圓 */
    object-fit: cover;     /* 確保圖片在縮放時不變形 */
    background-color: #f0f8ff; /* 背景框顏色 */
    padding: 8px;
}

.pub-content {
    flex: 1;               /* 讓文字區塊填滿剩餘空間 */
}

h2 {
    color: #333;
    border-bottom: 5px solid #ffa600; /* 底線的粗細與顏色，#eaeaea 是淡淡的灰色 */
    padding-bottom: 8px;              /* 文字與底線之間的流白距離 */
    margin-top: 35px;                 /* 與上方區塊的間距 */
    margin-bottom: 20px;              /* 與下方圖片文字的間距 */
}

/* My hobby */
.works-grid {
    column-count: 3;    /* 設定要顯示幾欄 */
    column-gap: 20px;   /* 欄與欄之間的間距 */
}

.work-card {
    break-inside: avoid;
    margin-bottom: 50px;
    border: 2px solid #ccc;     /* 邊框 */
    border-radius: 20px;        /* 卡片外框的圓角 */
    background-color: #ffe986fd;
    
    /* 👇 關鍵在這裡！讓裡面的內容離卡片邊緣「往內縮 16px」 */
    padding: 16px; 
}

/* 確保圖片不會超出卡片寬度 */
.work-card img, .image-gallery img {
    width: 100%;
    height: auto;
    display: block;
}

/* 螢幕變窄時減少欄數 (RWD) */
@media (max-width: 900px) {
    .works-grid {
        column-count: 2;
    }
}
@media (max-width: 600px) {
    .works-grid {
        column-count: 1;
    }
}

/* 圖片處理：圓角 */
.work-card img {
    width: 100%;
    height: auto;
    border-radius: 8px; /* 圖片圓角 */
    display: block;
}

/* 文字與日期排版 */
.work-info {
    margin-top: 12px;
}

.date {
    font-size: 0.85rem;
    color: #ff9d00;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.description {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap; /* 關鍵：如果放不下，自動換到下一行 */
    gap: 10px;
    margin-bottom: 10px;
}

.image-gallery img {
    flex: 1 1 calc(33.33% - 10px); /* 關鍵：設定每張圖佔約 1/3 的寬度 */
    height: 150px; 
    object-fit: cover;
    border-radius: 6px;
    box-sizing: border-box; /* 確保 padding/border 不會影響寬度計算 */
}