@charset "utf-8";

/* 1. 基本設定與背景 (Lesson 05 & 08) */
body {
    background: #fbf9cc linear-gradient(to bottom, #fbf9cc, #ffffff) no-repeat;
    background-attachment: fixed;
    color: #333;
    font-family: "Microsoft JhengHei", sans-serif;
    margin: 0;
}

/* 2. 標題與 LOGO 風格 (Lesson 09) */
header {
    text-align: center; /* 確保 header 內所有元素預設居中 */
    margin-bottom: 20px;
}

header h1 {
    display: block; 
    width: 350px;
    margin: 40px auto 10px auto; 
    padding: 30px;
    background-image: linear-gradient(to bottom, #6fbb9a, #4a9d79);
    color: #fff;
    border-radius: 50%;
    border: 5px solid #95dbbd;
    font-family: 'Limelight', cursive;
    text-shadow: 1px 1px 2px #307657;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

header p {
    margin: 0 auto; 
    color: #555;
    font-size: 1.1em;
    letter-spacing: 2px; 
}

/* 使用虛擬元素在標語前後加上裝飾 (Lesson 07 語法) */
header p em::before {
    content: "“ ";
    color: #6fbb9a;
    font-weight: bold;
}

header p em::after {
    content: " ”";
    color: #6fbb9a;
    font-weight: bold;
}

/* 3. 導覽列按鈕化 (Lesson 10) */
.menu {
    text-align: center;
    padding: 0;
}
.menu li {
    display: inline-block;
    list-style-type: none;
    margin: 0 10px;
}
.menu a {
    display: block;
    width: 120px;
    padding: 10px;
    background: #6fbb9a;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}
/* 虛擬類別 pseudo-class (Lesson 07) */
.menu a:hover {
    background: #90ddbb;
    transition: 0.3s;
}

/* 4. 主內容區塊設定 (Box Model - Lesson 06 & 10) */
#contents {
    width: 800px;
    margin: 40px auto;
    padding: 40px;
    background-color: #fff;
    border: 1px solid #f6bb9e;
    box-sizing: border-box; /* 包含邊距的寬度計算 */
}

/* 5. 標題樣式覆寫 (Lesson 06) */
.h {
    padding: 10px;
    border-left: 10px solid #d0e35b;
    border-bottom: 1px dotted #94c8b1;
    color: #6fbb9a;
}
.h-sub {
    padding: 10px;
    background-color: #fbf9cc;
    color: #ff705b;
    border-radius: 10px;
}

/* 6. 文繞圖與清除浮動 (Lesson 10) */
.imgL {
    float: left;
    margin-right: 20px;
    border-radius: 15px;
}
.clearfix::after { /* 虛擬元素 pseudo-element */
    content: "";
    display: block;
    clear: both;
}
.clear {
    clear: both;
}

/* 7. 進階選擇器應用 (Lesson 07) */
/* 相鄰選擇器：設定 section 之間的間距 */
section + section {
    margin-top: 50px;
}

/* 屬性選擇器：針對外部連結加入圖示（模擬） */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
}