Spaces:
Runtime error
Runtime error
File size: 5,975 Bytes
1ec883c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
/* style.css */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0; /* 將 body 的 margin 設為 0,讓內容可以更貼近邊緣 */
padding: 20px; /* 內邊距留點空間 */
background-color: #f4f7f6;
color: #333;
line-height: 1.6;
display: flex; /* 讓 body 成為 flex 容器 */
flex-direction: column; /* 內容垂直排列 */
min-height: 100vh; /* 讓 body 至少佔滿整個視窗高度 */
align-items: center; /* 讓 h1 居中 */
}
.highlight {
background-color: #fc9c9cd5;
color: #000000;
font-weight: bold;
padding: 2px 4px;
border-radius: 4px;
}
.yellow-highlight {
background-color: #ffeb3b85; /* 半透明黃色 */
color: #000000;
font-weight: bold;
padding: 2px 4px;
border-radius: 4px;
}
.red-highlight {
background-color: #fc9c9cd5;
color: #000000;
font-weight: bold;
padding: 2px 4px;
border-radius: 4px;
}
h1 {
color: #2c3e50;
text-align: center;
margin-bottom: 30px; /* 增加標題下方的間距 */
font-size: 2.5em; /* 讓標題更大一點 */
}
h2 { /* 針對檢測結果的 h2 */
color: #2c3e50;
text-align: center;
margin-top: 0; /* 移除頂部 margin,讓它更靠近 panel 頂部 */
margin-bottom: 20px;
font-size: 1.8em;
}
/* --- 主容器 Flexbox 佈局 --- */
.main-container {
display: flex; /* 啟用 Flexbox */
flex-direction: row; /* 預設就是 row,讓子元素水平排列 */
gap: 30px; /* 左右兩個 panel 之間的間距 */
width: 100%; /* 佔滿可用寬度 */
max-width: 1200px; /* 設定最大寬度,避免在寬螢幕上過於分散 */
justify-content: center; /* 內容居中 */
flex-wrap: wrap; /* 當螢幕太小時,允許換行 */
}
.panel {
background-color: #ffffff;
padding: 30px; /* 增加內邊距 */
border-radius: 8px;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* 更明顯的陰影 */
flex: 1; /* 讓兩個 panel 平均分配空間 */
min-width: 380px; /* 設定每個 panel 的最小寬度,避免縮得太小 */
box-sizing: border-box; /* 確保 padding 和 border 不會增加元素總寬度 */
display: flex; /* 讓 panel 內部內容也是 flex 容器 */
flex-direction: column; /* 內部內容垂直排列 */
}
#input_area {
/* 特定於 input_area 的樣式,如果需要 */
align-items: center; /* 讓輸入框和按鈕在 input_area 中居中 */
}
textarea {
width: 100%; /* 佔滿 panel 寬度 */
height: 250px; /* 增加高度 */
padding: 15px;
margin-bottom: 25px; /* 增加與按鈕的間距 */
border: 1px solid #ddd;
border-radius: 5px;
font-size: 1.1rem; /* 稍微放大字體 */
box-sizing: border-box;
resize: vertical;
outline: none; /* 移除 focus 時的藍色邊框 */
transition: border-color 0.3s ease;
}
textarea:focus {
border-color: #4CAF50; /* focus 時邊框變色 */
}
.button-group {
display: flex;
gap: 20px; /* 按鈕間距 */
justify-content: center; /* 按鈕在 group 內部居中 */
width: 100%; /* 佔滿寬度 */
}
button {
padding: 12px 30px; /* 稍微增加按鈕大小 */
font-size: 1.1rem;
cursor: pointer;
border: none;
border-radius: 5px;
transition: background-color 0.3s ease, transform 0.2s ease; /* 增加 transform 過渡效果 */
font-weight: bold; /* 字體加粗 */
}
button[type="submit"] {
background-color: #4CAF50;
color: white;
}
button[type="submit"]:hover {
background-color: #45a049;
transform: translateY(-2px); /* 懸停時向上輕微移動 */
}
button[type="reset"] {
background-color: #f44336;
color: white;
}
button[type="reset"]:hover {
background-color: #da190b;
transform: translateY(-2px);
}
#output_area p {
font-size: 1.15rem; /* 稍微放大結果文字 */
margin-bottom: 12px;
}
#output_area strong {
color: #555;
font-weight: bold;
}
#is_scam, #confidence_score {
font-weight: bold; /* 結果狀態字體加粗 */
}
#suspicious_phrases {
background-color: #fffafa; /* 給可疑詞句區塊一個淺色背景 */
border: 1px dashed #e0baba; /* 虛線邊框 */
padding: 15px;
border-radius: 5px;
margin-top: 15px;
min-height: 80px; /* 確保高度,避免內容少時高度變化 */
}
#suspicious_phrases ul {
list-style-type: '🚨 '; /* 使用表情符號作為列表標記 */
padding-left: 20px;
margin: 0; /* 移除預設 margin */
}
#suspicious_phrases li {
margin-bottom: 8px;
color: #c0392b;
font-weight: 500;
}
#suspicious_phrases p {
font-style: italic;
color: #666;
margin: 0; /* 移除預設 margin */
}
label[for="modeSelect"] {
display: block;
margin-bottom: 8px;
font-weight: bold;
color: #495057;
font-size: 15px;
}
#modeSelect {
width: 100%;
padding: 10px;
font-size: 15px;
border-radius: 6px;
border: 1px solid #adb5bd;
background-color: #ffffff;
margin-bottom: 20px;
transition: 0.2s;
}
#modeSelect:focus {
border-color: #74c0fc;
box-shadow: 0 0 0 0.1rem rgba(116, 192, 252, 0.25);
outline: none;
}
/* --- 響應式設計:當螢幕較小時,垂直排列 --- */
@media (max-width: 768px) {
.main-container {
flex-direction: column; /* 小螢幕時改為垂直堆疊 */
gap: 20px; /* 垂直間距 */
padding: 0 15px; /* 左右邊距 */
}
.panel {
flex: none; /* 取消 flex 比例,讓他們各自佔據 100% 寬度 */
width: 100%;
max-width: none; /* 移除最大寬度限制 */
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.5em;
}
textarea {
height: 200px;
}
} |