:root { --primary: #4A6CF7; --primary-light: #EEF1FE; --primary-dark: #3B5DE7; --success: #10B981; --success-light: #ECFDF5; --danger: #EF4444; --danger-light: #FEF2F2; --warning: #F59E0B; --warning-light: #FFFBEB; --bg: #F5F7FB; --card: #FFFFFF; --text: #1F2937; --text-muted: #9CA3AF; --text-dim: #6B7280; --border: #E5E7EB; --radius: 10px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(74,108,247,0.05); --shadow-hover: 0 2px 6px rgba(0,0,0,0.04), 0 6px 18px rgba(74,108,247,0.08); --sidebar-w: 280px; } * { margin:0; padding:0; box-sizing:border-box; } html, body { height: 100%; overflow: hidden; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; } /* ═══════════════════════════════════════════ Layout ═══════════════════════════════════════════ */ .app-layout { display: flex; height: 100vh; overflow: hidden; } /* ═══════════════════════════════════════════ Sidebar ═══════════════════════════════════════════ */ .sidebar { width: var(--sidebar-w); min-width: var(--sidebar-w); height: 100vh; background: var(--card); border-right: 0.5px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; flex-shrink: 0; } /* ── User ── */ .sidebar-user { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; } .user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; flex-shrink: 0; } .user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; } .user-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; } .user-tag { font-size: 11px; color: var(--text-muted); font-weight: 400; } .btn-logout-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-muted); text-decoration: none; transition: all 0.2s; flex-shrink: 0; } .btn-logout-icon:hover { background: var(--danger-light); color: var(--danger); } /* ── Stats ── */ .sidebar-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 20px 20px; } .stat-item { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; } .stat-num { font-size: 20px; font-weight: 700; color: var(--primary); line-height: 1.2; } .stat-label { font-size: 11px; color: var(--text-muted); font-weight: 400; } /* ═══════════════════════════════════════════ Calendar Widget ═══════════════════════════════════════════ */ .calendar-widget { padding: 0 16px 12px; } .cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; } .cal-nav { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 6px; transition: all 0.2s; } .cal-nav:hover { background: var(--bg); color: var(--primary); } .cal-month-label { font-size: 13px; font-weight: 600; color: var(--text); } .cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; padding: 0 2px; } .cal-weekdays span { padding: 4px 0; } .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; } .cal-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; border-radius: 6px; color: var(--text-dim); cursor: pointer; transition: all 0.15s; position: relative; border: 1.5px solid transparent; } .cal-cell:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); } .cal-cell.other-month { color: var(--border); cursor: default; } .cal-cell.other-month:hover { background: transparent; border-color: transparent; color: var(--border); } .cal-cell.today { font-weight: 700; color: var(--primary); border-color: var(--primary); background: var(--primary-light); } .cal-cell.selected { font-weight: 600; color: var(--primary-dark); border-color: var(--primary-dark); background: #DDE3FD; } .cal-cell.selected.today { font-weight: 700; color: #FFF; border-color: var(--primary-dark); background: var(--primary); } .cal-cell::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--border); } /* 达标 — 绿色 */ .cal-cell.pass::after { background: var(--success); } /* 未达标 — 黄色 */ .cal-cell.fail::after { background: var(--warning); } .cal-cell.other-month::after { display: none; } .cal-cell.today.pass::after, .cal-cell.today.fail::after { bottom: 2px; } .cal-legend { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; font-size: 10px; color: var(--text-muted); } .legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; } .legend-dot.pass { background: var(--success); } .legend-dot.fail { background: var(--warning); } .legend-dot.empty { background: var(--border); } /* ═══════════════════════════════════════════ Sidebar Nav ═══════════════════════════════════════════ */ .sidebar-nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; } .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-dim); cursor: pointer; text-decoration: none; transition: all 0.15s; } .nav-item:hover { background: var(--bg); color: var(--text); } .nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; } .nav-item .icon-sm { flex-shrink: 0; width: 16px; height: 16px; } /* ── Sidebar Footer ── */ .sidebar-footer { padding: 12px 20px; border-top: 0.5px solid var(--border); } .btn-new-day { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border: none; background: var(--primary); color: #FFF; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; font-family: inherit; box-shadow: 0 2px 8px rgba(74,108,247,0.20); } .btn-new-day:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(74,108,247,0.30); } /* ═══════════════════════════════════════════ Main Content ═══════════════════════════════════════════ */ .main-content { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; padding: 28px 40px 40px; } /* ── Panels ── */ .panel { display: none; } .panel.active { display: block; } .panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; } .panel-header h2 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; } .check-date-input { padding: 8px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; color: var(--text); background: var(--card); transition: border-color 0.2s; } .check-date-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.10); } /* ═══════════════════════════════════════════ Daily Grid — 三栏 ═══════════════════════════════════════════ */ .daily-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; } /* 立志 — 左上 */ .card-morning { grid-column: 1; grid-row: 1; } /* 改过 — 左下 */ .card-evening { grid-column: 1; grid-row: 2; } /* 勤学 — 右列跨2行 */ .card-study { grid-column: 2; grid-row: 1 / 3; } /* ── Cards ── */ .card { background: var(--card); border-radius: var(--radius); padding: 18px 18px 14px; box-shadow: var(--shadow); border: 0.5px solid var(--border); transition: box-shadow 0.2s; display: flex; flex-direction: column; } .card:hover { box-shadow: var(--shadow-hover); } .card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; } .card-head h3 { font-size: 14px; font-weight: 600; color: var(--text); } .icon-h2 { width: 16px; height: 16px; flex-shrink: 0; color: var(--primary); } .card-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; } /* ═══════════════════════════════════════════ Dynamic Items ═══════════════════════════════════════════ */ .item-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; } .item-row input[type="text"], .item-row textarea { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; color: var(--text); background: var(--bg); resize: vertical; transition: border-color 0.2s, background 0.2s; } .item-row input[type="text"]:focus, .item-row textarea:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px rgba(74,108,247,0.08); } .item-row textarea { min-height: 38px; } .item-row .idx { font-size: 12px; color: var(--text-muted); min-width: 20px; padding-top: 10px; font-weight: 600; text-align: right; } .btn-del { background: none; border: none; color: var(--danger); cursor: pointer; padding: 6px 2px; line-height: 1; border-radius: 6px; transition: background 0.2s; display: inline-flex; align-items: center; } .btn-del:hover { background: var(--danger-light); } .btn-del .icon-sm { width: 16px; height: 16px; } /* 责善改过 横排双输入 */ .evening-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 10px 10px; margin-bottom: 10px; background: var(--bg); transition: border-color 0.2s; } .evening-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.06); } .evening-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .evening-header .idx { font-size: 12px; color: var(--text-muted); font-weight: 600; } .mistake-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; } .mistake-row .col { display: flex; flex-direction: column; gap: 4px; } .mistake-row .col label { font-size: 11px; color: var(--text-muted); font-weight: 500; padding-left: 2px; } .mistake-row input[type="text"] { width: 100%; } /* 勤学预设项目 */ .preset-item { padding: 6px 0; } .preset-check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; } .preset-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; } .preset-name { font-size: 13px; color: var(--text-dim); transition: color 0.2s; line-height: 1.4; } .preset-check input:checked + .preset-name { color: var(--text); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--primary); text-decoration-thickness: 2px; } .preset-note { display: none; width: 100%; margin-top: 6px; margin-left: 24px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit; color: var(--text); background: var(--bg); resize: none; min-height: 28px; transition: border-color 0.2s; box-sizing: border-box; } .preset-note:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 2px rgba(74,108,247,0.06); } .preset-item.active .preset-note { display: block; } /* Buttons */ .btn-add { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 9px; margin-top: auto; border: 1.5px dashed var(--primary); background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 500; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; font-family: inherit; } .btn-add:hover { background: #DDE3FD; border-color: var(--primary-dark); } .btn-save { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 14px; border: none; background: var(--primary); color: #FFF; font-size: 15px; font-weight: 600; border-radius: var(--radius); cursor: pointer; transition: all 0.2s; font-family: inherit; letter-spacing: 0.3px; box-shadow: 0 2px 8px rgba(74,108,247,0.25); } .btn-save:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(74,108,247,0.35); } .btn-save:active { transform: translateY(0); } /* ═══════════════════════════════════════════ Weekly Panel ═══════════════════════════════════════════ */ .week-nav { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 8px 0 20px; } .btn-nav { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border: 1.5px solid var(--border); background: var(--card); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text); transition: all 0.2s; font-family: inherit; } .btn-nav:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); } #week-label { font-size: 14px; font-weight: 600; min-width: 200px; text-align: center; color: var(--text); } .weekly-overview { display: flex; align-items: center; gap: 40px; padding: 20px 0; justify-content: center; } .score-circle { position: relative; width: 140px; height: 140px; flex-shrink: 0; } .score-svg { width: 140px; height: 140px; } .score-svg circle { transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1); } .score-inner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: baseline; justify-content: center; } .score-num { font-size: 40px; font-weight: 800; color: var(--primary); line-height: 1; } .score-unit { font-size: 15px; color: var(--text-muted); margin-left: 2px; font-weight: 500; } .score-meta { display: flex; flex-direction: column; gap: 8px; } .score-text { font-size: 15px; font-weight: 600; color: var(--text); } .score-stats { font-size: 13px; color: var(--text-muted); line-height: 1.6; } .week-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 24px; } .day-cell { background: var(--card); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; box-shadow: var(--shadow); transition: box-shadow 0.2s; border-top: 3px solid transparent; } .day-cell:hover { box-shadow: var(--shadow-hover); } .day-cell.pass { border-top-color: var(--success); } .day-cell.fail { border-top-color: var(--warning); } .day-cell.empty { border-top-color: var(--border); opacity: 0.5; } .day-cell .day-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; } .day-cell .day-date { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; } .day-cell .day-score { font-size: 18px; font-weight: 700; } .day-cell.pass .day-score { color: var(--success); } .day-cell.fail .day-score { color: var(--warning); } .day-cell.empty .day-score { color: var(--text-muted); } .day-cell .day-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; margin-top: 4px; } .day-cell.pass .day-badge { background: var(--success-light); color: var(--success); } .day-cell.fail .day-badge { background: var(--warning-light); color: #D97706; } .day-cell.empty .day-badge { background: var(--bg); color: var(--text-muted); } /* ═══════════════════════════════════════════ History Panel ═══════════════════════════════════════════ */ .history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; } .history-card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); transition: box-shadow 0.2s; display: flex; align-items: center; justify-content: space-between; border: 0.5px solid var(--border); } .history-card:hover { box-shadow: var(--shadow-hover); } .history-card .info { flex: 1; min-width: 0; } .history-card .info .date { font-weight: 600; font-size: 14px; color: var(--primary); } .history-card .info .preview { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; display: flex; gap: 12px; flex-wrap: wrap; } .history-card .info .preview span { display: inline-flex; align-items: center; gap: 3px; } .history-card .btn-del-history { display: inline-flex; align-items: center; gap: 4px; background: var(--danger-light); border: none; color: var(--danger); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; flex-shrink: 0; margin-left: 14px; transition: all 0.2s; font-family: inherit; } .history-card .btn-del-history:hover { background: var(--danger); color: #FFF; } /* Empty state */ .empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: 14px; } .empty-state .empty-icon { margin-bottom: 10px; opacity: 0.4; } .empty-state .empty-icon svg { width: 44px; height: 44px; } /* ═══════════════════════════════════════════ Toast ═══════════════════════════════════════════ */ .toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); padding: 12px 28px; border-radius: var(--radius); font-size: 14px; font-weight: 600; z-index: 9999; opacity: 0; pointer-events: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap; box-shadow: 0 4px 20px rgba(0,0,0,0.12); } .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; } .toast.success { background: var(--success); color: #FFF; } .toast.error { background: var(--danger); color: #FFF; } .toast.info { background: var(--primary); color: #FFF; } /* ═══════════════════════════════════════════ SVG icons helpers ═══════════════════════════════════════════ */ .icon-sm { width: 14px; height: 14px; vertical-align: middle; flex-shrink: 0; } .icon-nav { width: 14px; height: 14px; vertical-align: middle; flex-shrink: 0; } .icon-xs { width: 12px; height: 12px; vertical-align: middle; flex-shrink: 0; } /* ═══════════════════════════════════════════ Responsive ═══════════════════════════════════════════ */ @media (max-width: 900px) { .sidebar { width: 240px; min-width: 240px; } :root { --sidebar-w: 240px; } .main-content { padding: 20px 24px; } .daily-grid { grid-template-columns: 1fr; } .card-morning, .card-evening, .card-study { grid-column: 1; grid-row: auto; } .weekly-overview { flex-direction: column; gap: 16px; text-align: center; } .week-days-grid { grid-template-columns: repeat(4, 1fr); } .history-grid { grid-template-columns: 1fr; } .mistake-row { grid-template-columns: 1fr; } } @media (max-width: 640px) { .app-layout { flex-direction: column; } .sidebar { width: 100%; min-width: 100%; max-height: 50vh; height: auto; border-right: none; border-bottom: 0.5px solid var(--border); } .main-content { height: auto; overflow: visible; padding: 16px; } }