diff --git a/src/vitals/web/app.py b/src/vitals/web/app.py index 2c08488..90fe33a 100644 --- a/src/vitals/web/app.py +++ b/src/vitals/web/app.py @@ -5513,8 +5513,26 @@ def get_sleep_page_html() -> str: .delete-btn:hover { background: #fef2f2; } + /* 移动端适配 */ @media (max-width: 768px) { - .nav { flex-wrap: wrap; gap: 10px; } + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 18px 14px; margin-bottom: 16px; } + header h1 { font-size: 1.4rem; } + .grid { grid-template-columns: 1fr 1fr; gap: 10px; } + .card { padding: 12px; } + .card .value { font-size: 1.4rem; } + .fab { bottom: 84px; right: 16px; width: 52px; height: 52px; } + .modal-content { margin: 5% auto; width: 95%; padding: 16px; } + table, thead, tbody, th, td, tr { display: block; } + thead { display: none; } + tr { background: white; margin-bottom: 12px; padding: 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); } + td { padding: 6px 0; border: none; display: flex; justify-content: space-between; } + td:before { content: attr(data-label); font-weight: 600; color: #666; } + } + @media (max-width: 480px) { + .grid { grid-template-columns: 1fr; } } @@ -5796,6 +5814,45 @@ def get_sleep_page_html() -> str: document.getElementById('addSleepForm').addEventListener('submit', submitSleepForm); loadSleepData(); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + + @@ -5972,8 +6029,26 @@ def get_weight_page_html() -> str: .delete-btn:hover { background: #fef2f2; } + /* 移动端适配 */ @media (max-width: 768px) { - .nav { flex-wrap: wrap; gap: 10px; } + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 18px 14px; margin-bottom: 16px; } + header h1 { font-size: 1.4rem; } + .grid { grid-template-columns: 1fr 1fr; gap: 10px; } + .card { padding: 12px; } + .card .value { font-size: 1.4rem; } + .fab { bottom: 84px; right: 16px; width: 52px; height: 52px; } + .modal-content { margin: 5% auto; width: 95%; padding: 16px; } + table, thead, tbody, th, td, tr { display: block; } + thead { display: none; } + tr { background: white; margin-bottom: 12px; padding: 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); } + td { padding: 6px 0; border: none; display: flex; justify-content: space-between; } + td:before { content: attr(data-label); font-weight: 600; color: #666; } + } + @media (max-width: 480px) { + .grid { grid-template-columns: 1fr; } } @@ -6219,6 +6294,45 @@ def get_weight_page_html() -> str: document.getElementById('addWeightForm').addEventListener('submit', submitWeightForm); loadWeightData(); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + + @@ -6548,6 +6662,21 @@ def get_reading_page_html() -> str: padding: 10px 0; border-bottom: 1px solid #E2E8F0; } .history-item:last-child { border-bottom: none; } + /* 移动端适配 */ + @media (max-width: 768px) { + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 20px 16px; margin-bottom: 20px; } + header h1 { font-size: 1.5rem; } + .section { padding: 16px; } + .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } + .book-cover { height: 140px; } + .modal-content { padding: 20px; } + } + @media (max-width: 400px) { + .book-grid { grid-template-columns: 1fr; } + } @@ -7021,6 +7150,45 @@ def get_reading_page_html() -> str: // 页面加载 document.addEventListener('DOMContentLoaded', loadStats); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + +