cwadayi commited on
Commit
9955982
·
verified ·
1 Parent(s): da47862

Update style.css

Browse files
Files changed (1) hide show
  1. style.css +55 -109
style.css CHANGED
@@ -1,18 +1,10 @@
1
  /* --- Google Font 與全域設定 --- */
2
- @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');
3
 
4
  :root {
5
  --primary-color: #005f73;
6
  --secondary-color: #0a9396;
7
- --highlight-color: #94d2bd;
8
- --accent-color: #ee9b00;
9
- --bg-light: #f8f9fa;
10
- --bg-dark: #343a40;
11
- --text-primary: #212529;
12
- --text-secondary: #6c757d;
13
- --border-color: #dee2e6;
14
- --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.05);
15
- --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.05);
16
  }
17
 
18
  html {
@@ -22,100 +14,31 @@ html {
22
 
23
  body {
24
  font-family: 'Noto Sans TC', sans-serif;
25
- font-weight: 400;
26
- line-height: 1.8;
27
- margin: 0;
28
- padding: 0;
29
- background: var(--bg-light);
30
- color: var(--text-primary);
31
  }
32
 
33
- /* --- 導覽列 --- */
34
- .navbar {
35
- background-color: rgba(255, 255, 255, 0.85);
36
- backdrop-filter: blur(10px);
37
- border-bottom: 1px solid var(--border-color);
38
- padding: 1rem 1.5rem;
39
- position: sticky;
40
- top: 0;
41
- z-index: 1000;
42
- transition: box-shadow 0.3s;
43
- }
44
- /* ... (其他導覽列樣式不變) ... */
45
-
46
-
47
- /* --- Header --- */
48
- header {
49
- background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
50
- color: #fff;
51
- padding: 5rem 2rem;
52
- text-align: center;
53
- }
54
- /* ... (其他 Header 樣式不變) ... */
55
-
56
 
57
- /* --- Main Content & Sections --- */
58
- main { padding: 2rem 1rem; max-width: 1000px; margin: 0 auto; }
59
- section {
60
- background: #fff;
61
- margin-bottom: 2.5rem;
62
- padding: 2rem 2.5rem;
63
- border-radius: 16px;
64
- box-shadow: var(--shadow);
65
- opacity: 0;
66
- transform: translateY(30px);
67
- transition: opacity 0.6s ease-out, transform 0.6s ease-out;
68
- }
69
- section.visible { opacity: 1; transform: translateY(0); }
70
- h2 {
71
- color: var(--primary-color);
72
- text-align: center;
73
- font-size: 2.2rem;
74
- font-weight: 700;
75
- margin-bottom: 2.5rem;
76
- position: relative;
77
- padding-bottom: 1rem;
78
- }
79
- h2::after {
80
- content: '';
81
- position: absolute;
82
- width: 80px;
83
- height: 4px;
84
- bottom: 0;
85
- left: 50%;
86
- transform: translateX(-50%);
87
- background-color: var(--highlight-color);
88
- border-radius: 2px;
89
- }
90
- p, li { font-size: 1.1rem; }
91
-
92
-
93
- /* --- ★★★★★ 新的圖片顯示方式 (已修正) ★★★★★ --- */
94
  .figure-container {
95
  margin: 20px 0;
96
  padding: 0;
97
- position: relative; /* 確保內部元素能相對定位 */
98
- display: block; /* 確保容器獨立占位 */
99
  }
100
 
101
- .figure-image {
102
- width: 100%;
103
- position: relative; /* 這是關鍵,允許 padding-bottom 創建高度 */
104
-
105
- /* padding-bottom inline style 決定,以匹配個別圖片比例 */
106
-
107
- background-size: contain; /* 確保圖片完整顯示在容器內 */
108
- background-repeat: no-repeat;
109
- background-position: center;
110
-
111
  border: 1px solid var(--border-color);
112
  border-radius: 8px;
113
- overflow: hidden; /* 防止背景圖在邊框外溢出 */
114
- transition: transform 0.3s ease;
115
  }
116
-
117
- .figure-image:hover {
118
- transform: scale(1.03);
119
  }
120
 
121
  .figure-container figcaption {
@@ -128,27 +51,50 @@ p, li { font-size: 1.1rem; }
128
  background-color: var(--bg-light);
129
  border-radius: 4px;
130
  }
131
- /* --- ★★★★★ 修正結束 ★★★★★ --- */
132
 
133
-
134
- /* --- Back to Top Button --- */
135
- .back-to-top {
136
  position: fixed;
137
- bottom: 20px;
138
- right: 20px;
139
- /* ... (其他按鈕樣式不變) ... */
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
 
 
 
142
 
143
- /* --- Footer --- */
144
- footer {
145
- text-align: center;
146
- padding: 2rem;
147
- margin-top: 2rem;
148
- background: var(--bg-dark);
149
- color: var(--bg-light);
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
152
  /* --- 其他原有樣式 (保持不變) --- */
153
- /* (為了節省篇幅,此處省略大部分 CSS,請務必使用您 Space 上完整的 `styles.css` 內容,然後僅修改上述 `figure-image` 部分) */
154
- .nav-container{max-width:1100px;margin:0 auto;display:flex;justify-content:space-between;align-items:center}.nav-logo{font-size:1.5rem;font-weight:700;color:var(--primary-color);text-decoration:none}.nav-menu{list-style:none;display:flex;gap:1rem;margin:0;padding:0}.nav-link{color:var(--text-secondary);text-decoration:none;font-weight:500;padding:.5rem 1rem;border-radius:6px;position:relative;transition:color .3s}.nav-link:hover,.nav-link.active{color:var(--primary-color)}.nav-link::after{content:'';position:absolute;width:0;height:3px;bottom:-5px;left:50%;transform:translateX(-50%);background-color:var(--secondary-color);border-radius:2px;transition:width .3s ease-in-out}.nav-link:hover::after,.nav-link.active::after{width:60%}.header-content h1{font-size:3.2rem;font-weight:700;margin-bottom:.5rem}.table-container{border:1px solid var(--border-color);border-radius:8px;overflow:hidden}.interp-item{border-radius:12px}.constraints-levels{gap:1rem}.level-item{padding:1.5rem;border-radius:8px}.case-study{background-color:var(--bg-dark);color:var(--bg-light);border-radius:16px;border:none}.case-study h2{color:#fff}.step{background-color:#495057}.app-card-header{border-top-left-radius:12px;border-top-right-radius:12px}.special-topic-section{background-color:#f7feff;border-left:5px solid var(--secondary-color)}.topic-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:2rem}.topic-item{background-color:#fff;padding:1.5rem;border-radius:12px;box-shadow:var(--shadow);border-top:4px solid var(--highlight-color)}.topic-item h3{font-size:1.5rem;color:var(--primary-color);border-bottom:2px solid var(--border-color);padding-bottom:.5rem;margin-bottom:1rem}.topic-item h4{font-size:1.2rem;color:var(--secondary-color);font-style:italic}.summary-text{text-align:center;font-size:1.2rem;font-weight:500}.back-to-top.visible{opacity:1;visibility:visible;transform:translateY(0)}.back-to-top:hover{background-color:var(--accent-color)}.back-to-top svg{width:24px;height:24px}.quote-box{background-color:#e0f7fa;border-left:5px solid #00796b;margin:20px 0;padding:15px 20px;border-radius:5px;font-style:italic}table{width:100%;border-collapse:collapse;margin-top:20px}th,td{padding:15px;text-align:left;border:1px solid #dee2e6}thead{background-color:#00796b;color:#fff}tbody tr:nth-of-type(even){background-color:#f8f9fa}td.category{background-color:#e0f7fa;font-weight:700;color:#004d40;vertical-align:middle}.interpretation-methods,.case-study-steps{display:grid;grid-template-columns:1fr;gap:30px;margin-top:20px}@media (min-width:768px){.interpretation-methods,.case-study-steps{grid-template-columns:1fr 1fr}}.interp-item{padding:25px;border-radius:8px;background-color:#f8f9fa;border:1px solid #e9ecef}.level-item{padding:20px;border-left:5px solid;border-radius:8px}.level-item:nth-of-type(1){border-color:#ae2012;background-color:#fff1f0}.level-item:nth-of-type(2){border-color:#ee9b00;background-color:#fff9eb}.level-item:nth-of-type(3){border-color:#005f73;background-color:#e0f7fa}.step{background-color:#495057;padding:25px;border-radius:8px}.step h3{color:#94d2bd}.app-grid-expanded{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:25px;margin-top:20px}.app-card{background:#fff;border:1px solid #e9ecef;border-radius:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;transition:transform .3s ease-in-out,box-shadow .3s ease-in-out}.app-card:hover{transform:translateY(-8px);box-shadow:var(--shadow-lg)}.app-card-body ul{flex-grow:1}.example-link{display:inline-block;margin-top:15px;padding:10px 18px;background-color:var(--primary-color);color:white;text-decoration:none;border-radius:5px;font-weight:700;transition:background-color .2s,transform .2s}.example-link:hover{background-color:var(--accent-color);transform:scale(1.05)}.app-card-header h3{margin:0;color:white;font-size:1.4rem}.app-card-body{padding:25px;flex-grow:1;display:flex;flex-direction:column}
 
 
 
1
  /* --- Google Font 與全域設定 --- */
2
+ @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display.swap');
3
 
4
  :root {
5
  --primary-color: #005f73;
6
  --secondary-color: #0a9396;
7
+ /* ... (其他 CSS 變數不變) ... */
 
 
 
 
 
 
 
 
8
  }
9
 
10
  html {
 
14
 
15
  body {
16
  font-family: 'Noto Sans TC', sans-serif;
17
+ /* ... (其他 body 樣式不變) ... */
 
 
 
 
 
18
  }
19
 
20
+ /* ... (導覽列、Header、Main、Section 等主要結構樣式不變) ... */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ /* --- ★★★★★ 修正後的圖片顯示方式 ★★★★★ --- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  .figure-container {
24
  margin: 20px 0;
25
  padding: 0;
 
 
26
  }
27
 
28
+ .figure-container img {
29
+ display: block; /* 關鍵:確保圖片是區塊元素 */
30
+ box-sizing: border-box; /* 關鍵:確保 padding border 不會增加寬度 */
31
+ max-width: 100%; /* 關鍵:最大寬度不超過容器 */
32
+ width: 100%; /* 關鍵:嘗試填滿容器寬度 */
33
+ height: auto; /* 關鍵:保持圖片原始長寬比 */
34
+ margin: 15px auto;
 
 
 
35
  border: 1px solid var(--border-color);
36
  border-radius: 8px;
37
+ cursor: zoom-in; /* 提示使用者可以點擊 */
38
+ transition: box-shadow 0.3s;
39
  }
40
+ .figure-container img:hover {
41
+ box-shadow: var(--shadow-lg);
 
42
  }
43
 
44
  .figure-container figcaption {
 
51
  background-color: var(--bg-light);
52
  border-radius: 4px;
53
  }
 
54
 
55
+ /* --- ★★★★★ 新增:燈箱 (Lightbox) 樣式 ★★★★★ --- */
56
+ .lightbox {
 
57
  position: fixed;
58
+ top: 0;
59
+ left: 0;
60
+ width: 100%;
61
+ height: 100%;
62
+ background-color: rgba(0, 0, 0, 0.85);
63
+ backdrop-filter: blur(5px);
64
+ z-index: 2000;
65
+ display: flex;
66
+ justify-content: center;
67
+ align-items: center;
68
+ padding: 20px;
69
+ box-sizing: border-box;
70
+ cursor: zoom-out;
71
+ animation: fadeIn 0.3s ease;
72
  }
73
 
74
+ .lightbox.closing {
75
+ animation: fadeOut 0.3s ease forwards;
76
+ }
77
 
78
+ .lightbox img {
79
+ max-width: 100%;
80
+ max-height: 100%;
81
+ box-shadow: 0 0 50px rgba(0,0,0,0.5);
82
+ border-radius: 8px;
 
 
83
  }
84
 
85
+ @keyframes fadeIn {
86
+ from { opacity: 0; }
87
+ to { opacity: 1; }
88
+ }
89
+
90
+ @keyframes fadeOut {
91
+ from { opacity: 1; }
92
+ to { opacity: 0; }
93
+ }
94
+
95
+
96
  /* --- 其他原有樣式 (保持不變) --- */
97
+ /* (為了節省篇幅,此處省略大部分 CSS,請用上一輪提供的完整 CSS,然後僅修改上述 `figure-container img` 並新增 `lightbox` 樣式) */
98
+
99
+ /* 沿用舊版確保相容性 */
100
+ .nav-container{max-width:1100px;margin:0 auto;display:flex;justify-content:space-between;align-items:center}.nav-logo{font-size:1.5rem;font-weight:700;color:var(--primary-color);text-decoration:none}.nav-menu{list-style:none;display:flex;gap:1rem;margin:0;padding:0}.nav-link{color:var(--text-secondary);text-decoration:none;font-weight:500;padding:.5rem 1rem;border-radius:6px;position:relative;transition:color .3s}.nav-link:hover,.nav-link.active{color:var(--primary-color)}.nav-link::after{content:'';position:absolute;width:0;height:3px;bottom:-5px;left:50%;transform:translateX(-50%);background-color:var(--secondary-color);border-radius:2px;transition:width .3s ease-in-out}.nav-link:hover::after,.nav-link.active::after{width:60%}.header-content h1{font-size:3.2rem;font-weight:700;margin-bottom:.5rem}.table-container{border:1px solid var(--border-color);border-radius:8px;overflow:hidden}.interp-item{border-radius:12px}.constraints-levels{gap:1rem}.level-item{padding:1.5rem;border-radius:8px}.case-study{background-color:var(--bg-dark);color:var(--bg-light);border-radius:16px;border:none}.case-study h2{color:#fff}.step{background-color:#495057}.app-card-header{border-top-left-radius:12px;border-top-right-radius:12px}.special-topic-section{background-color:#f7feff;border-left:5px solid var(--secondary-color)}.topic-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:2rem}.topic-item{background-color:#fff;padding:1.5rem;border-radius:12px;box-shadow:var(--shadow);border-top:4px solid var(--highlight-color)}.topic-item h3{font-size:1.5rem;color:var(--primary-color);border-bottom:2px solid var(--border-color);padding-bottom:.5rem;margin-bottom:1rem}.topic-item h4{font-size:1.2rem;color:var(--secondary-color);font-style:italic}.summary-text{text-align:center;font-size:1.2rem;font-weight:500}.back-to-top{position:fixed;bottom:20px;right:20px;background-color:var(--primary-color);color:white;width:50px;height:50px;border-radius:50%;display:flex;justify-content:center;align-items:center;text-decoration:none;box-shadow:var(--shadow-lg);opacity:0;visibility:hidden;transform:translateY(20px);transition:opacity .3s,visibility .3s,transform .3s,background-color .3s}.back-to-top.visible{opacity:1;visibility:visible;transform:translateY(0)}.back-to-top:hover{background-color:var(--accent-color)}.back-to-top svg{width:24px;height:24px}.quote-box{background-color:#e0f7fa;border-left:5px solid #00796b;margin:20px 0;padding:15px 20px;border-radius:5px;font-style:italic}table{width:100%;border-collapse:collapse;margin-top:20px}th,td{padding:15px;text-align:left;border:1px solid #dee2e6}thead{background-color:#00796b;color:#fff}tbody tr:nth-of-type(even){background-color:#f8f9fa}td.category{background-color:#e0f7fa;font-weight:700;color:#004d40;vertical-align:middle}.interpretation-methods,.case-study-steps{display:grid;grid-template-columns:1fr;gap:30px;margin-top:20px}@media (min-width:768px){.interpretation-methods,.case-study-steps{grid-template-columns:1fr 1fr}}.interp-item{padding:25px;border-radius:8px;background-color:#f8f9fa;border:1px solid #e9ecef}.level-item{padding:20px;border-left:5px solid;border-radius:8px}.level-item:nth-of-type(1){border-color:#ae2012;background-color:#fff1f0}.level-item:nth-of-type(2){border-color:#ee9b00;background-color:#fff9eb}.level-item:nth-of-type(3){border-color:#005f73;background-color:#e0f7fa}.step{background-color:#495057;padding:25px;border-radius:8px}.step h3{color:#94d2bd}.app-grid-expanded{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:25px;margin-top:20px}.app-card{background:#fff;border:1px solid #e9ecef;border-radius:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;transition:transform .3s ease-in-out,box-shadow .3s ease-in-out}.app-card:hover{transform:translateY(-8px);box-shadow:var(--shadow-lg)}.app-card-body ul{flex-grow:1}.example-link{display:inline-block;margin-top:15px;padding:10px 18px;background-color:var(--primary-color);color:white;text-decoration:none;border-radius:5px;font-weight:700;transition:background-color .2s,transform .2s}.example-link:hover{background-color:var(--accent-color);transform:scale(1.05)}.app-card-header h3{margin:0;color:white;font-size:1.4rem}.app-card-body{padding:25px;flex-grow:1;display:flex;flex-direction:column}