@@ -3,63 +3,156 @@ body {
33 padding : 20px ;
44 max-width : 480px ;
55 margin : 0 auto;
6+ background-color : # f5f5f5 ;
67}
78
89# calculator {
9- margin-top : 20px ;
10+ background-color : white;
11+ padding : 20px ;
12+ border-radius : 10px ;
13+ box-shadow : 0 2px 10px rgba (0 , 0 , 0 , 0.1 );
1014}
1115
1216h1 {
1317 text-align : center;
1418 font-size : 24px ;
15- margin-bottom : 20px ;
19+ margin-bottom : 30px ;
20+ color : # 333 ;
1621}
1722
1823.input-group {
19- margin-bottom : 20 px ;
24+ margin-bottom : 25 px ;
2025}
2126
2227.input-group label {
2328 display : block;
24- margin-bottom : 5 px ;
29+ margin-bottom : 10 px ;
2530 font-weight : bold;
31+ color : # 555 ;
32+ font-size : 16px ;
2633}
2734
28- .range -input {
35+ .button -input {
2936 display : flex;
3037 align-items : center;
38+ justify-content : center;
39+ gap : 8px ;
40+ background-color : # f8f9fa ;
41+ padding : 10px ;
42+ border-radius : 8px ;
43+ border : 2px solid # e9ecef ;
44+ }
45+
46+ .button-input button {
47+ background-color : # 007BFF ;
48+ color : white;
49+ border : none;
50+ border-radius : 6px ;
51+ padding : 8px 12px ;
52+ cursor : pointer;
53+ font-size : 16px ;
54+ font-weight : bold;
55+ transition : background-color 0.2s ;
56+ min-width : 40px ;
57+ }
58+
59+ .button-input button : hover {
60+ background-color : # 0056b3 ;
3161}
3262
33- .range-input input [type = "range" ] {
63+ .button-input button : active {
64+ background-color : # 004085 ;
65+ transform : scale (0.95 );
66+ }
67+
68+ .button-input input [type = "number" ] {
3469 flex : 1 ;
35- margin-right : 10px ;
70+ text-align : center;
71+ padding : 10px ;
72+ font-size : 18px ;
73+ font-weight : bold;
74+ border : 2px solid # dee2e6 ;
75+ border-radius : 6px ;
76+ background-color : white;
77+ color : # 333 ;
78+ max-width : 80px ;
3679}
3780
38- .range-input input [type = "number" ] {
39- width : 60px ;
40- padding : 5px ;
41- font-size : 16px ;
81+ .button-input input [type = "number" ]: focus {
82+ outline : none;
83+ border-color : # 007BFF ;
4284}
4385
44- button {
86+ . reset-btn {
4587 display : block;
4688 width : 100% ;
47- padding : 10 px ;
89+ padding : 12 px ;
4890 font-size : 16px ;
49- background-color : # 007BFF ;
91+ background-color : # 28a745 ;
5092 color : # fff ;
5193 border : none;
52- border-radius : 5 px ;
94+ border-radius : 8 px ;
5395 cursor : pointer;
54- margin-bottom : 20px ;
96+ margin-bottom : 25px ;
97+ transition : background-color 0.2s ;
98+ }
99+
100+ .reset-btn : hover {
101+ background-color : # 218838 ;
102+ }
103+
104+ .reset-btn : active {
105+ background-color : # 1e7e34 ;
106+ transform : scale (0.98 );
55107}
56108
57109# results {
58- background-color : # f0f0f0 ;
59- padding : 10px ;
60- border-radius : 5px ;
110+ background-color : # e8f4fd ;
111+ padding : 20px ;
112+ border-radius : 8px ;
113+ border-left : 5px solid # 007BFF ;
61114}
62115
63116# results p {
64- margin : 5px 0 ;
117+ margin : 8px 0 ;
118+ font-size : 16px ;
119+ font-weight : 500 ;
120+ color : # 333 ;
121+ }
122+
123+ # results span {
124+ font-weight : bold;
125+ color : # 007BFF ;
126+ font-size : 18px ;
127+ }
128+
129+ /* 響應式設計 */
130+ @media (max-width : 480px ) {
131+ body {
132+ padding : 10px ;
133+ }
134+
135+ # calculator {
136+ padding : 15px ;
137+ }
138+
139+ h1 {
140+ font-size : 20px ;
141+ }
142+
143+ .button-input {
144+ gap : 5px ;
145+ padding : 8px ;
146+ }
147+
148+ .button-input button {
149+ padding : 6px 8px ;
150+ font-size : 14px ;
151+ min-width : 35px ;
152+ }
153+
154+ .button-input input [type = "number" ] {
155+ font-size : 16px ;
156+ padding : 8px ;
157+ }
65158}
0 commit comments