Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -328,57 +328,141 @@ def run_mia_demo(sample_index, data_type):
|
|
| 328 |
|
| 329 |
|
| 330 |
# ========================================
|
| 331 |
-
# 4. Build Interface
|
| 332 |
# ========================================
|
| 333 |
|
| 334 |
CSS = """
|
|
|
|
|
|
|
| 335 |
.gradio-container {
|
| 336 |
max-width: 1200px !important;
|
| 337 |
margin: auto !important;
|
| 338 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif !important;
|
| 339 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
.tab-nav button {
|
| 341 |
-
font-size:
|
| 342 |
-
padding:
|
| 343 |
font-weight: 500 !important;
|
|
|
|
| 344 |
border-radius: 8px 8px 0 0 !important;
|
| 345 |
-
transition: all 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
}
|
| 347 |
.tab-nav button.selected {
|
| 348 |
font-weight: 700 !important;
|
| 349 |
-
color: #
|
| 350 |
-
border-bottom: 3px solid #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
}
|
|
|
|
|
|
|
| 352 |
.prose h1 {
|
| 353 |
-
font-size:
|
| 354 |
-
color: #
|
| 355 |
letter-spacing: -0.02em !important;
|
|
|
|
|
|
|
|
|
|
| 356 |
}
|
| 357 |
.prose h2 {
|
| 358 |
-
font-size: 1.
|
| 359 |
-
color: #
|
| 360 |
margin-top: 1.5em !important;
|
| 361 |
-
padding-bottom: 0.
|
| 362 |
-
border-bottom:
|
|
|
|
| 363 |
}
|
| 364 |
.prose h3 {
|
| 365 |
-
font-size: 1.
|
| 366 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
}
|
| 368 |
-
.prose table { font-size: 0.88rem !important; }
|
| 369 |
.prose th {
|
| 370 |
-
background: #
|
|
|
|
| 371 |
font-weight: 600 !important;
|
| 372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
}
|
| 374 |
-
.prose
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 375 |
.prose blockquote {
|
| 376 |
-
border-left: 4px solid #
|
| 377 |
-
background: #
|
| 378 |
-
padding:
|
| 379 |
-
border-radius: 0
|
| 380 |
-
font-size: 0.
|
|
|
|
|
|
|
|
|
|
| 381 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
footer { display: none !important; }
|
| 383 |
"""
|
| 384 |
|
|
|
|
| 328 |
|
| 329 |
|
| 330 |
# ========================================
|
| 331 |
+
# 4. Build Interface (CSS 精装修版)
|
| 332 |
# ========================================
|
| 333 |
|
| 334 |
CSS = """
|
| 335 |
+
/* 全局背景与字体 */
|
| 336 |
+
body { background-color: #f0f4f8 !important; }
|
| 337 |
.gradio-container {
|
| 338 |
max-width: 1200px !important;
|
| 339 |
margin: auto !important;
|
| 340 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif !important;
|
| 341 |
}
|
| 342 |
+
|
| 343 |
+
/* Tab 导航高级感 */
|
| 344 |
+
.tab-nav {
|
| 345 |
+
border-bottom: 2px solid #e1e8f0 !important;
|
| 346 |
+
background-color: transparent !important;
|
| 347 |
+
margin-bottom: 20px !important;
|
| 348 |
+
}
|
| 349 |
.tab-nav button {
|
| 350 |
+
font-size: 15px !important;
|
| 351 |
+
padding: 14px 24px !important;
|
| 352 |
font-weight: 500 !important;
|
| 353 |
+
color: #64748b !important;
|
| 354 |
border-radius: 8px 8px 0 0 !important;
|
| 355 |
+
transition: all 0.3s ease !important;
|
| 356 |
+
background: transparent !important;
|
| 357 |
+
border: none !important;
|
| 358 |
+
}
|
| 359 |
+
.tab-nav button:hover {
|
| 360 |
+
color: #3b82f6 !important;
|
| 361 |
+
background: rgba(59, 130, 246, 0.05) !important;
|
| 362 |
}
|
| 363 |
.tab-nav button.selected {
|
| 364 |
font-weight: 700 !important;
|
| 365 |
+
color: #2563eb !important;
|
| 366 |
+
border-bottom: 3px solid #2563eb !important;
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
/* 内容区域卡片化布局 */
|
| 370 |
+
.tabitem {
|
| 371 |
+
background: #ffffff !important;
|
| 372 |
+
border-radius: 12px !important;
|
| 373 |
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
|
| 374 |
+
padding: 30px !important;
|
| 375 |
+
border: 1px solid #e2e8f0 !important;
|
| 376 |
}
|
| 377 |
+
|
| 378 |
+
/* 标题排版优化 */
|
| 379 |
.prose h1 {
|
| 380 |
+
font-size: 2.2rem !important;
|
| 381 |
+
color: #0f172a !important;
|
| 382 |
letter-spacing: -0.02em !important;
|
| 383 |
+
font-weight: 800 !important;
|
| 384 |
+
text-align: center !important;
|
| 385 |
+
margin-bottom: 0.5em !important;
|
| 386 |
}
|
| 387 |
.prose h2 {
|
| 388 |
+
font-size: 1.4rem !important;
|
| 389 |
+
color: #1e293b !important;
|
| 390 |
margin-top: 1.5em !important;
|
| 391 |
+
padding-bottom: 0.4em !important;
|
| 392 |
+
border-bottom: 2px solid #f1f5f9 !important;
|
| 393 |
+
font-weight: 700 !important;
|
| 394 |
}
|
| 395 |
.prose h3 {
|
| 396 |
+
font-size: 1.15rem !important;
|
| 397 |
+
color: #334155 !important;
|
| 398 |
+
font-weight: 600 !important;
|
| 399 |
+
margin-top: 1.2em !important;
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
/* 🚀 表格终极美化 (带圆角、阴影和斑马纹) */
|
| 403 |
+
.prose table {
|
| 404 |
+
width: 100% !important;
|
| 405 |
+
border-collapse: separate !important;
|
| 406 |
+
border-spacing: 0 !important;
|
| 407 |
+
margin: 1.5em 0 !important;
|
| 408 |
+
border-radius: 10px !important;
|
| 409 |
+
overflow: hidden !important;
|
| 410 |
+
box-shadow: 0 0 0 1px #e2e8f0, 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
|
| 411 |
+
font-size: 0.95rem !important;
|
| 412 |
}
|
|
|
|
| 413 |
.prose th {
|
| 414 |
+
background: #f8fafc !important;
|
| 415 |
+
color: #475569 !important;
|
| 416 |
font-weight: 600 !important;
|
| 417 |
+
text-transform: uppercase !important;
|
| 418 |
+
font-size: 0.85rem !important;
|
| 419 |
+
letter-spacing: 0.05em !important;
|
| 420 |
+
padding: 14px 16px !important;
|
| 421 |
+
border-bottom: 2px solid #e2e8f0 !important;
|
| 422 |
+
text-align: left !important;
|
| 423 |
}
|
| 424 |
+
.prose tr:nth-child(even) td {
|
| 425 |
+
background: #f8fafc !important;
|
| 426 |
+
}
|
| 427 |
+
.prose td {
|
| 428 |
+
padding: 12px 16px !important;
|
| 429 |
+
color: #334155 !important;
|
| 430 |
+
border-bottom: 1px solid #e2e8f0 !important;
|
| 431 |
+
transition: background-color 0.2s ease !important;
|
| 432 |
+
}
|
| 433 |
+
.prose tr:last-child td {
|
| 434 |
+
border-bottom: none !important;
|
| 435 |
+
}
|
| 436 |
+
.prose tr:hover td {
|
| 437 |
+
background-color: #f1f5f9 !important;
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
/* 引用块美化 (高亮重点说明) */
|
| 441 |
.prose blockquote {
|
| 442 |
+
border-left: 4px solid #3b82f6 !important;
|
| 443 |
+
background: linear-gradient(to right, #eff6ff, #ffffff) !important;
|
| 444 |
+
padding: 16px 20px !important;
|
| 445 |
+
border-radius: 0 8px 8px 0 !important;
|
| 446 |
+
font-size: 0.95rem !important;
|
| 447 |
+
color: #1e40af !important;
|
| 448 |
+
margin: 1.5em 0 !important;
|
| 449 |
+
box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
|
| 450 |
}
|
| 451 |
+
|
| 452 |
+
/* 按钮高级感特效 */
|
| 453 |
+
button.primary {
|
| 454 |
+
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
|
| 455 |
+
border: none !important;
|
| 456 |
+
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
|
| 457 |
+
font-weight: 600 !important;
|
| 458 |
+
transition: all 0.3s ease !important;
|
| 459 |
+
}
|
| 460 |
+
button.primary:hover {
|
| 461 |
+
transform: translateY(-2px) !important;
|
| 462 |
+
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
/* 隐藏无关页脚标志 */
|
| 466 |
footer { display: none !important; }
|
| 467 |
"""
|
| 468 |
|