/* 全局樣式 */

body {
    font-family: 'Inter', sans-serif;
    font-size: 16px; /* 基礎文字大小 */
    line-height: 1.7; /* 行距 */
    color: #f0f0f0; /* 淺灰文字，適應黑底 */
    background-color: #000000; /* 純黑背景 */
    width: 92%; /* 設置寬度為 92% */
    max-width: 2000px; /* 最大寬度限制 */
    margin: 0 auto; /* 居中 */
    padding: 40px 20px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05); /* 淺色陰影 */
}

a,
a.visited {
	color: inherit;
	text-decoration: none;
}

/* 標題樣式 */
h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700; /* 粗體 */
    color: #4a90e2; /* 淺藍 */
    letter-spacing: 0.05em; /* 字母間距 */
    margin: 1.8em 0 0.6em;
    border-bottom: 1px solid #4a90e2; /* 淺藍底線 */
    padding-bottom: 0.3em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); /* 深色陰影增強對比 */
    transition: color 0.3s ease;
}

h1:hover {
    color: #66aaff; /* 懸停時變亮 */
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 500; /* 中等粗體 */
    color: #d4a017; /* 金色 */
    letter-spacing: 0.03em;
    margin: 1.5em 0 0.5em;
    padding-bottom: 0.2em; /* 添加輕微底部間距，與h1一致 */
    border-bottom: 1px solid rgba(212, 160, 23, 0.3); /* 淺金色底線，增加層次 */
    transition: color 0.3s ease, transform 0.3s ease; /* 添加transform動畫 */
}

h2:hover {
    color: #e6b800; /* 懸停時變亮金色 */
    transform: scale(1.02); /* 輕微放大，與其他元素懸停效果一致 */
}

h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem; /* 比h2小，保持層次 */
    font-weight: 500; /* 中等粗體，與h2一致 */
    color: #cccccc; /* 淺灰，次於金色，降低視覺強度 */
    letter-spacing: 0.02em;
    margin: 1.2em 0 0.4em;
    padding-bottom: 0.1em;
    border-bottom: 1px solid rgba(204, 204, 204, 0.2); /* 淺灰底線，與主題協調 */
    transition: color 0.3s ease, transform 0.3s ease;
}

h3:hover {
    color: #ffffff; /* 懸停時變純白，增強對比 */
    transform: scale(1.02); /* 與h2一致的懸停效果 */
}

h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem; /* 比h3更小 */
    font-weight: 400; /* 較輕的字重，區分層次 */
    color: #999999; /* 更深的淺灰，進一步降低視覺強度 */
    letter-spacing: 0.01em;
    margin: 1em 0 0.3em;
    transition: color 0.3s ease, transform 0.3s ease;
}

h4:hover {
    color: #cccccc; /* 懸停時變亮淺灰 */
    transform: scale(1.02); /* 一致的懸停效果 */
}
/* 粗體字 */
b, strong {
    font-weight: 700;
    color: #4a90e2; /* 淺藍 */
    transition: color 0.3s ease;
}

b:hover, strong:hover {
    color: #66aaff; /* 懸停變亮 */
}

/* 斜體字 */
i, em {
    font-style: italic;
    color: #cccccc; /* 淺灰 */
}

/* 粗體斜體字 */
b i, strong em, i b, em strong {
    font-style: italic;
    font-weight: 700;
    color: #ff6666; /* 淡紅 */
    transition: transform 0.3s ease;
}

b i:hover, strong em:hover, i b:hover, em strong:hover {
    transform: scale(1.05); /* 懸停輕微放大 */
}

/* 段落樣式 */
p {
    margin: 1.2em 0;
}

/* 圖片樣式 */
img {
    max-width: 100%; /* 圖片不超過父容器 */
    width: 92%; /* 圖片寬度與 body 一致（92%） */
    height: auto; /* 保持比例 */
    display: block; /* 確保居中 */
    margin: 1.8em auto; /* 上下間距與居中 */
    border: 1px solid #333333; /* 深灰邊框，適應黑底 */
    border-radius: 4px; /* 圓角 */
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1); /* 淺色陰影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.02); /* 懸停輕微放大 */
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2); /* 增強陰影 */
}

/* 表格樣式 */
table {
    width: 100%; /* 表格填滿父容器 */
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.8em 0;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

th, td {
    border: 1px solid #333333; /* 深灰邊框 */
    padding: 14px;
    text-align: left;
    transition: background-color 0.3s ease;
}

th {
    background-color: #4a90e2; /* 淺藍表頭 */
    color: #ffffff;
    font-weight: 500;
}

tr:nth-child(even) {
    background-color: #1a1a1a; /* 略淺的黑色 */
}

tr:hover {
    background-color: #2a2a2a; /* 懸停更亮 */
}

/* 列表樣式 */
ul, ol {
    margin: 1.2em 0;
    padding-left: 2.5em;
}

ul li {
    list-style-type: square; /* 方形項目符號 */
    color: #cccccc; /* 淺灰 */
}

ol li {
    list-style-type: decimal; /* 數字項目符號 */
    color: #cccccc;
}

li {
    margin-bottom: 0.6em;
    transition: color 0.3s ease;
}

li:hover {
    color: #d4a017; /* 懸停變金色 */
}

/* 代碼塊 */
pre, code {
    font-family: 'Courier New', monospace;
    background-color: #1a1a1a; /* 深黑背景 */
    color: #cccccc; /* 淺灰文字 */
	white-space: pre;            /* 不換行，保留原始格式 */
	overflow-x: auto;            /* 水平滾動 */
	overflow-y: auto;
	max-height: 300px;           /* 垂直也限制 */
	display: block;
    /*padding: 12px;
    border-radius: 4px;
    border: 1px solid #333333;*/
}


/* 頁腳樣式 */
footer {
    margin-top: 3em;
    padding-top: 1em;
    border-top: 1px solid #333333; /* 深灰邊框 */
    font-size: 0.9rem;
    color: #cccccc; /* 淺灰 */
    text-align: center;
}

.largeS {
    display: block;  /* 預設顯示，獨占空間 */
}

.mediumS {
    display: none;  
}

.smallS {
    display: none;  
}

/* 響應式設計 */
@media (max-width: 2000px) {
    body {
        font-size: 16px;
        padding: 35px 18px;
    }
    h1 {
        font-size: 2.3rem;
    }
    h2 {
        font-size: 1.7rem;
    }
    h3 {
        font-size: 1.3rem; /* 縮小h3 */
    }
    h4 {
        font-size: 1.1rem; /* 縮小h4 */
    }
    img {
        width: 92%;
    }
}

@media (max-width: 1200px) {
    body {
        font-size: 16px;
        padding: 30px 15px;
        width: 92%;
    }
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.2rem;
    }
    h4 {
        font-size: 1rem;
    }
    img {
        width: 98%;
    }
    table {
        font-size: 14px;
        overflow-x: auto;
        display: block;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
        padding: 20px 10px;
        width: 92%;
    }
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.4rem;
    }
    h3 {
        font-size: 1.1rem;
    }
    h4 {
        font-size: 0.9rem; /* 手機上更小 */
    }
    img {
        width: 98%;
        margin: 1.2em auto;
        box-shadow: none;
    }
    table {
        font-size: 13px;
    }
    ul, ol {
        padding-left: 1.5em;
    }
	.largeS {
	    display: none; 
	}
	
	.mediumS {
	    display: block;  
	}
	
	.smallS {
	    display: none;  
	}
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
        padding: 15px 8px;
        width: 92%;
    }
    h1 {
        font-size: 1.6rem;
    }
    h2 {
        font-size: 1.3rem;
    }
    h3 {
        font-size: 1rem;
    }
    h4 {
        font-size: 0.85rem; /* 超小螢幕更小 */
    }
    img {
        width: 100%;
        margin: 1em auto;
        border: none;
    }
    table {
        font-size: 12px;
    }
    p {
        margin: 0.8em 0;
    }
    footer {
        font-size: 0.8rem;
    }
	.largeS {
	    display: none; 
	}
	
	.mediumS {
	    display: none;  
	}
	
	.smallS {
	    display: block;  
	}
}

@media print {
    body { 
        background-color: #ffffff;
        box-shadow: none; 
        width: 100%;
        color: #000000;
    }
    img {
        box-shadow: none;
        border: 1px solid #000000;
        width: 100%;
    }
    table { 
        box-shadow: none; 
    }
    h1, h2, h3, h4, b, strong, i, em, b i, strong em { 
        color: #000000 !important; /* 列印時統一黑字 */
    }
    h2, h3, h4 {
        border-bottom: 1px solid #000000; /* 列印時黑底線 */
    }
    th {
        background-color: #ffffff;
        color: #000000;
        border: 1px solid #000000;
    }
    tr:nth-child(even) {
        background-color: #ffffff;
    }
    tr:hover {
        background-color: #ffffff;
    }
}
