Spaces:
Running

File size: 10,704 Bytes
dd6f9a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d245082
 
dd6f9a1
 
 
 
 
 
 
 
 
 
 
 
 
 
d245082
 
dd6f9a1
 
 
 
 
 
 
 
 
 
 
d245082
dd6f9a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d245082
 
dd6f9a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d245082
dd6f9a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d245082
dd6f9a1
 
 
d245082
dd6f9a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/* ============================================================
   EcoLens — giao diện mobile-first cho học sinh
   Chữ to, màu tươi, thao tác 1 tay trên điện thoại dọc
   ============================================================ */

:root {
  --green: #0e9f6e;
  --green-dark: #057a55;
  --bg: #f0faf4;
  --ink: #14332a;
  --ink-soft: #4b6b5e;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 6px 24px rgba(20, 83, 45, .10);
  --score-colors: #66bb6a, #9ccc65, #ffca28, #ff7043, #e53935;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -10%, #d2f5e3 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ---------- Thanh trên ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 18px 10px;
  max-width: 560px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  font-size: 30px; background: #fff; border-radius: 14px;
  width: 48px; height: 48px; display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: var(--green-dark); }
.brand-sub { font-size: 12.5px; color: var(--ink-soft); }
.stats-link {
  font-size: 24px; text-decoration: none; background: #fff;
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; box-shadow: var(--shadow);
}

/* ---------- Khung chính ---------- */
#app { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; }
.screen { display: flex; flex-direction: column; gap: 14px; animation: fadein .35s ease; }
/* QUAN TRỌNG: display:flex ở trên sẽ đè thuộc tính hidden của HTML,
   nên phải ép màn hình có hidden thật sự biến mất */
.screen[hidden] { display: none !important; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}

/* ---------- Hero + nút chụp ---------- */
.hero { text-align: center; padding: 28px 20px 24px; }
.hero-emoji { font-size: 56px; margin-bottom: 6px; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; line-height: 1.25; }
.hero-sub { color: var(--ink-soft); font-size: 15.5px; margin: 8px 0 20px; }

.btn-capture {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 18px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .2px;
  border-radius: 18px; box-shadow: 0 8px 20px rgba(14, 159, 110, .35);
  transition: transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-capture:active { transform: scale(.97); }
.btn-capture-icon { font-size: 24px; }

.btn-gallery {
  display: block; margin-top: 12px; color: var(--green-dark);
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: underline;
}

/* ---------- 3 bước ---------- */
.steps { display: flex; flex-direction: column; gap: 12px; font-size: 15.5px; }
.step { display: flex; align-items: center; gap: 12px; }
.step-n {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  background: #d9f3e6; color: var(--green-dark);
  font-weight: 800; display: grid; place-items: center;
}

/* ---------- Chú giải 3 thùng ---------- */
.bins-legend h2, .pick-title { font-size: 16px; margin-bottom: 12px; }
.bin-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--bin) 10%, white);
  font-size: 15px;
}
.bin-row b { color: var(--bin); }
.bin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bin); flex: 0 0 14px; }
.bin-eg { color: var(--ink-soft); font-size: 13.5px; margin-left: auto; text-align: right; }

/* ---------- Camera trong trang ---------- */
.camera-card { padding: 12px; }
#cam-video {
  width: 100%; max-height: 62vh; object-fit: cover;
  border-radius: 14px; background: #0b1512; display: block;
}
.cam-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px 8px;
}
.shutter {
  width: 74px; height: 74px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 6px solid var(--green);
  box-shadow: 0 4px 16px rgba(14, 159, 110, .35);
  transition: transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.shutter:active { transform: scale(.88); background: #d9f3e6; }
.cam-close {
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: #eef4f0; color: var(--ink); font-size: 18px; font-weight: 700;
}
.cam-gallery { font-size: 30px; cursor: pointer; width: 48px; text-align: center; }
.cam-hint { text-align: center; font-size: 13.5px; color: var(--ink-soft); padding: 4px 0 8px; }

/* ---------- Màn hình phân tích ---------- */
.loading-card { position: relative; overflow: hidden; text-align: center; padding: 14px; }
.preview { width: 100%; border-radius: 14px; max-height: 55vh; object-fit: cover; }
.scan-line {
  position: absolute; left: 6%; right: 6%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #2ee6a8, transparent);
  animation: scan 1.6s ease-in-out infinite; top: 20px;
  box-shadow: 0 0 14px #2ee6a8;
}
@keyframes scan { 0%,100% { top: 8%; } 50% { top: 82%; } }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 6px; }
.loading-row p { font-size: 16.5px; font-weight: 600; color: var(--ink-soft); }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid #d9f3e6; border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kết quả ---------- */
.mock-badge {
  background: #fff7e0; color: #8a6100; border: 1px solid #ffe08a;
  border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600;
}
.result-photo-card { padding: 12px; }
.result-img { width: 100%; border-radius: 14px; display: block; }
.result-time { text-align: right; font-size: 12px; color: var(--ink-soft); padding: 6px 4px 0; }

.det-card {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: #fff; margin-top: 2px;
}
.det-head {
  padding: 18px 20px; color: #fff;
  background: linear-gradient(135deg, var(--bin), color-mix(in srgb, var(--bin) 70%, black));
}
.det-obj { font-size: 14px; opacity: .9; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.det-title { font-size: 24px; font-weight: 800; line-height: 1.25; margin-top: 2px; }
.det-conf {
  display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,.22); border-radius: 999px; padding: 4px 12px;
}
.det-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.det-guide { font-size: 16.5px; font-weight: 600; }
.det-fact { font-size: 14px; color: var(--ink-soft); background: #f2f8f4; border-radius: 12px; padding: 10px 14px; }

/* Thanh điểm ô nhiễm 1–5 */
.score-wrap { display: flex; flex-direction: column; gap: 6px; }
.score-label { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); display: flex; justify-content: space-between; }
.score-bar { display: flex; gap: 5px; }
.score-seg { flex: 1; height: 12px; border-radius: 6px; background: #e6efe9; }
.score-seg.on-1 { background: #66bb6a; } .score-seg.on-2 { background: #9ccc65; }
.score-seg.on-3 { background: #ffca28; } .score-seg.on-4 { background: #ff7043; }
.score-seg.on-5 { background: #e53935; }
.score-text { font-weight: 800; }

.btn-again { margin-top: 6px; }

/* ---------- Không nhận ra / lỗi ---------- */
.empty-card { text-align: center; padding: 28px 20px; }
.empty-card h2 { font-size: 22px; margin: 6px 0; }
.empty-card p { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 18px; }
.pick-bin {
  border-left: 6px solid var(--bin);
  background: color-mix(in srgb, var(--bin) 8%, white);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: 14.5px;
}
.pick-bin b { color: var(--bin); }

/* ---------- Chân trang ---------- */
.footer {
  text-align: center; font-size: 12.5px; color: var(--ink-soft);
  padding: 10px 0 max(16px, env(safe-area-inset-bottom));
}

/* ---------- Trang thống kê ---------- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-tile { text-align: center; padding: 18px 10px; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--green-dark); }
.stat-cap { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.chart-card h2 { font-size: 16px; margin-bottom: 10px; }
.chart-box { position: relative; width: 100%; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green-dark); font-weight: 700; text-decoration: none; font-size: 15px;
}

/* Màn hình rộng (máy tính): giữ khung điện thoại ở giữa */
@media (min-width: 640px) {
  body { background: linear-gradient(160deg, #e8f7ee, #d3ecf5); }
  #app, .topbar { max-width: 480px; }
}

/* ---------- Băng trạng thái tải AI (bản chạy trong trình duyệt) ---------- */
.ai-status {
  background: #fff7e0; color: #8a6100; border: 1px solid #ffe08a;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 13.5px; font-weight: 600; text-align: center;
}
.ai-status.ok { background: #e5f7ee; color: #0b7a4b; border-color: #a7e3c6; }

/* Chú giải nhỏ + bảng cho trang thống kê */
.bins-mini-legend { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:10px; }
.bins-mini-legend span { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--ink-soft); }
.bins-mini-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.table-view { margin-top:12px; font-size:13.5px; }
.table-view summary { cursor:pointer; color:var(--green-dark); font-weight:700; }
.table-view table { width:100%; border-collapse:collapse; margin-top:8px; }
.table-view td, .table-view th { padding:6px 8px; border-bottom:1px solid #e6efe9; text-align:left; }
.table-view td:last-child, .table-view th:last-child { text-align:right; }