diff --git a/frontend/index.html b/frontend/index.html index 2b76ecb..b844264 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -17,7 +17,7 @@ padding: 20px; } .container { - max-width: 1200px; + max-width: 1400px; margin: 0 auto; } header { @@ -26,13 +26,16 @@ margin-bottom: 30px; } header h1 { - font-size: 2em; + font-size: 2.5em; margin-bottom: 10px; } + header p { + opacity: 0.9; + } .stats { display: grid; - grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); - gap: 15px; + grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); + gap: 20px; margin-bottom: 30px; } .stat-card { @@ -44,12 +47,15 @@ } .stat-card h3 { color: #667eea; - font-size: 1.6em; + font-size: 1.8em; + margin-bottom: 5px; } .stat-card p { color: #666; - font-size: 0.8em; + font-size: 0.9em; } + + /* Tab 切换 */ .tabs { display: flex; gap: 10px; @@ -57,22 +63,31 @@ flex-wrap: wrap; } .tab-btn { - padding: 10px 20px; + padding: 12px 24px; background: white; border: none; border-radius: 8px; cursor: pointer; - font-size: 0.95em; + font-size: 1em; font-weight: 500; color: #666; transition: all 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); -webkit-tap-highlight-color: transparent; + touch-action: manipulation; + } + .tab-btn:hover { + background: #f8f9fa; + transform: translateY(-2px); + } + .tab-btn:active { + transform: scale(0.98); } .tab-btn.active { background: linear-gradient(135deg, #667eea, #764ba2); color: white; } + .section-box { background: white; border-radius: 10px; @@ -85,184 +100,436 @@ margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #667eea; - font-size: 1.4em; } - .diary-editor { - width: 100%; + + /* 日历组件 */ + .calendar-wrapper { + display: flex; + gap: 20px; + flex-wrap: wrap; } - .diary-editor textarea { - width: 100%; - min-height: 200px; + .calendar { + flex: 0 0 300px; + background: #f8f9fa; padding: 15px; - border: 2px solid #e0e7ff; border-radius: 8px; - font-size: 1em; - font-family: inherit; - resize: vertical; + } + .calendar-header { + display: flex; + justify-content: space-between; + align-items: center; margin-bottom: 15px; } - .diary-editor textarea:focus { - outline: none; - border-color: #667eea; - } - .form-group { - margin-bottom: 15px; - } - .form-group label { - display: block; - font-weight: 600; - color: #555; - margin-bottom: 8px; - font-size: 0.95em; - } - .form-group input, .form-group select { - width: 100%; - padding: 10px; - border: 2px solid #e0e7ff; - border-radius: 6px; - font-size: 0.95em; - } - .form-group input:focus, .form-group select:focus { - outline: none; - border-color: #667eea; - } - .btn { - padding: 12px 24px; - background: linear-gradient(135deg, #667eea, #764ba2); + .calendar-header button { + background: #667eea; color: white; border: none; - border-radius: 8px; + padding: 8px 12px; + border-radius: 5px; cursor: pointer; - font-size: 1em; - font-weight: 600; - transition: all 0.3s; - -webkit-tap-highlight-color: transparent; - } - .btn:hover { - transform: translateY(-2px); - box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4); - } - .btn:active { - transform: scale(0.98); - } - .btn-secondary { - background: #f1f5f9; - color: #666; - } - .task-link-item { + min-width: 44px; + min-height: 44px; display: flex; align-items: center; - gap: 10px; - padding: 10px; - background: #f8f9fa; - border-radius: 6px; - margin-bottom: 8px; + justify-content: center; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; } - .task-link-item input[type="checkbox"] { - width: 20px; - height: 20px; + .calendar-header button:hover { + background: #5568d3; } - .task-link-item .task-info { - flex: 1; + .calendar-header button:active { + background: #4857c0; + transform: scale(0.95); } - .task-link-item .task-title { - font-weight: 600; - color: #333; + .calendar-grid { + display: grid; + grid-template-columns: repeat(7, 1fr); + gap: 2px; } - .task-link-item .task-status { - font-size: 0.8em; - padding: 3px 8px; - border-radius: 12px; + .calendar-day-header { + text-align: center; + font-size: 0.75em; + color: #666; + padding: 5px; + } + .calendar-day { + aspect-ratio: 1; + display: flex; + align-items: center; + justify-content: center; + font-size: 0.85em; + border-radius: 5px; + cursor: pointer; + transition: all 0.2s; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; + min-width: 36px; + min-height: 36px; + } + .calendar-day:hover { + background: #e0e7ff; + } + .calendar-day:active { + background: #c7d2fe; + transform: scale(0.95); + } + .calendar-day.selected { background: #667eea; color: white; } - .diary-item { - padding: 20px; + .calendar-day.today { + border: 2px solid #667eea; + font-weight: bold; + } + .calendar-day.has-data { + position: relative; + } + .calendar-day.has-data::after { + content: ''; + position: absolute; + bottom: 2px; + width: 6px; + height: 6px; + background: #10b981; + border-radius: 50%; + } + .calendar-day.empty { + cursor: default; + } + + /* 内容区域 */ + .content-area { + flex: 1; + min-width: 0; + } + + .task-item, .diary-item { + padding: 15px; border-left: 4px solid #667eea; background: #f8f9fa; - margin-bottom: 20px; - border-radius: 8px; + margin-bottom: 15px; + border-radius: 5px; + cursor: pointer; + transition: all 0.2s; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; } + .task-item:hover, .diary-item:hover { + transform: translateX(5px); + box-shadow: 0 2px 8px rgba(0,0,0,0.1); + } + .task-item:active, .diary-item:active { + transform: scale(0.98); + background: #eef1f5; + } + .task-item.status-pending { border-left-color: #6b7280; } + .task-item.status-in_progress { border-left-color: #3b82f6; } + .task-item.status-blocked { border-left-color: #f59e0b; } + .task-item.status-completed { border-left-color: #10b981; } + .task-item.status-cancelled { border-left-color: #ef4444; opacity: 0.6; } + + .task-item .header, .diary-item .header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + } + .task-item .title, .diary-item .title { + font-weight: bold; + color: #333; + font-size: 1.1em; + } + .task-item .status { + padding: 4px 12px; + border-radius: 20px; + font-size: 0.85em; + color: white; + } + .status-pending .status { background: #6b7280; } + .status-in_progress .status { background: #3b82f6; } + .status-blocked .status { background: #f59e0b; } + .status-completed .status { background: #10b981; } + .status-cancelled .status { background: #ef4444; } + + .task-item .priority { + font-size: 0.8em; + color: #666; + margin-bottom: 8px; + } + .task-item .progress-bar { + height: 8px; + background: #e5e7eb; + border-radius: 4px; + overflow: hidden; + margin: 10px 0; + } + .task-item .progress-fill { + height: 100%; + background: linear-gradient(90deg, #667eea, #764ba2); + transition: width 0.3s; + } + .task-item .progress-text { + font-size: 0.85em; + color: #666; + text-align: right; + } + .diary-item .date { color: #667eea; font-weight: bold; - font-size: 1.1em; margin-bottom: 10px; } .diary-item .section { - margin: 15px 0; + margin: 10px 0; } .diary-item .section-title { - font-weight: 600; + font-weight: bold; color: #555; - margin-bottom: 8px; - display: flex; - align-items: center; - gap: 8px; } .diary-item .section-content { color: #666; - line-height: 1.6; + margin-left: 20px; white-space: pre-wrap; } - .linked-tasks, .linked-experiences { + + /* 任务详情 */ + .task-detail { + background: #f8f9fa; + padding: 20px; + border-radius: 8px; + margin-top: 20px; + } + .task-detail h3 { + color: #333; + margin-bottom: 15px; + } + .task-detail .meta { + display: flex; + gap: 20px; + margin-bottom: 15px; + flex-wrap: wrap; + } + .task-detail .meta-item { + background: white; + padding: 8px 15px; + border-radius: 5px; + font-size: 0.9em; + } + .task-detail .description { + margin-bottom: 15px; + white-space: pre-wrap; + color: #666; + } + .task-detail .progress-notes { + background: #fffbeb; + padding: 15px; + border-radius: 5px; margin-top: 15px; - padding-top: 15px; - border-top: 1px solid #e0e7ff; } - .tag { - display: inline-block; - padding: 4px 12px; - background: #e0e7ff; - color: #667eea; - border-radius: 12px; + .task-detail .progress-notes h4 { + color: #92400e; + margin-bottom: 10px; + } + .task-detail .progress-notes .note { font-size: 0.85em; - margin-right: 8px; - margin-bottom: 8px; + color: #666; + padding: 8px 0; + border-bottom: 1px solid #f3e5d5; } + .experience-item { padding: 15px; border-left: 4px solid #f59e0b; background: #fffbeb; margin-bottom: 15px; - border-radius: 6px; + border-radius: 5px; + } + .experience-item .header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; } .experience-item .title { - font-weight: 600; + font-weight: bold; color: #333; - margin-bottom: 10px; + font-size: 1.1em; } .experience-item .category { - display: inline-block; background: #f59e0b; color: white; - padding: 3px 10px; - border-radius: 12px; - font-size: 0.8em; - margin-bottom: 10px; + padding: 4px 12px; + border-radius: 20px; + font-size: 0.85em; } + .experience-item .problem, .experience-item .solution, .experience-item .lesson { + margin: 10px 0; + } + .experience-item .problem-title { + font-weight: bold; + color: #dc2626; + margin-bottom: 5px; + } + .experience-item .solution-title { + font-weight: bold; + color: #059669; + margin-bottom: 5px; + } + .experience-item .lesson { + padding: 10px; + background: #fef3c7; + border-radius: 5px; + } + .experience-item .lesson-title { + font-weight: bold; + color: #92400e; + margin-bottom: 5px; + } + .loading { text-align: center; padding: 40px; color: white; + font-size: 1.2em; + } + .error { + background: #fee; + color: #c00; + padding: 20px; + border-radius: 10px; + margin-bottom: 20px; } .empty-state { text-align: center; padding: 40px; - color: #999; + color: #666; } + + .grid-2 { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); + gap: 30px; + } + + /* 移动端优化 */ @media (max-width: 768px) { - body { padding: 10px; } - header h1 { font-size: 1.6em; } - .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; } - .stat-card { padding: 10px; } - .stat-card h3 { font-size: 1.3em; } - .tabs { gap: 8px; } - .tab-btn { padding: 10px 16px; font-size: 0.9em; flex: 1; text-align: center; } - .section-box { padding: 15px; } + body { + padding: 10px; + } + header h1 { + font-size: 1.8em; + } + header p { + font-size: 0.9em; + } + .stats { + grid-template-columns: repeat(3, 1fr); + gap: 10px; + margin-bottom: 20px; + } + .stat-card { + padding: 10px; + } + .stat-card h3 { + font-size: 1.4em; + } + .stat-card p { + font-size: 0.75em; + } + .tabs { + gap: 8px; + margin-bottom: 15px; + } + .tab-btn { + padding: 10px 16px; + font-size: 0.9em; + flex: 1; + text-align: center; + } + .section-box { + padding: 15px; + margin-bottom: 20px; + } + .section-box h2 { + font-size: 1.3em; + margin-bottom: 15px; + } + .calendar-wrapper { + flex-direction: column; + gap: 15px; + } + .calendar { + flex: none; + width: 100%; + padding: 10px; + } + .calendar-header span { + font-size: 0.9em; + } + .calendar-header button { + padding: 3px 8px; + font-size: 0.9em; + } + .calendar-day { + font-size: 0.75em; + aspect-ratio: 1; + } + .calendar-day-header { + font-size: 0.65em; + } + .content-area { + width: 100%; + } + .task-item, .diary-item { + padding: 12px; + margin-bottom: 12px; + } + .task-item .title, .diary-item .title { + font-size: 1em; + } + .task-item .status { + font-size: 0.75em; + padding: 3px 10px; + } + .task-item .priority { + font-size: 0.75em; + } + .task-detail .meta { + flex-direction: column; + gap: 8px; + } + .task-detail .meta-item { + font-size: 0.85em; + } + .experience-item .title { + font-size: 1em; + } + .experience-item .category { + font-size: 0.75em; + } } + + /* 超小屏幕(< 400px) */ @media (max-width: 400px) { - .stats { grid-template-columns: repeat(2, 1fr); } + .stats { + grid-template-columns: repeat(2, 1fr); + } + .stat-card h3 { + font-size: 1.2em; + } + .stat-card p { + font-size: 0.7em; + } + header h1 { + font-size: 1.5em; + } + .tabs { + flex-direction: column; + } + .tab-btn { + width: 100%; + } } @@ -270,7 +537,7 @@

⚡ 码神的日记系统

-

日记为中心 · 关联任务和经验

+

记录每天的进步与成长

@@ -281,279 +548,373 @@