Files
ziwei-power/static/style.css

314 lines
6.5 KiB
CSS

:root {
--primary: #4A6CF7;
--primary-light: #EEF1FE;
--danger: #EF4444;
--danger-light: #FEF2F2;
--bg: #F5F7FB;
--card: #FFFFFF;
--text: #1F2937;
--text-muted: #9CA3AF;
--border: #E5E7EB;
--radius: 12px;
--shadow: 0 1px 3px rgba(0,0,0,0.06);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
background: var(--bg);
color: var(--text);
max-width: 480px;
margin: 0 auto;
padding: 16px;
min-height: 100vh;
}
/* ── Header ── */
header {
text-align: center;
padding: 20px 0 12px;
}
.header-top {
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
header h1 { font-size: 22px; font-weight: 700; color: var(--primary); }
header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.user-bar {
position: absolute;
right: 0;
display: flex;
align-items: center;
gap: 8px;
}
.user-name {
font-size: 12px;
color: var(--text-muted);
font-weight: 500;
}
.btn-logout {
font-size: 11px;
color: var(--danger);
text-decoration: none;
padding: 2px 8px;
border: 1px solid var(--danger);
border-radius: 4px;
transition: all .2s;
}
.btn-logout:hover {
background: var(--danger);
color: #FFF;
}
/* ── Tabs ── */
.tabs {
display: flex;
background: var(--card);
border-radius: var(--radius);
padding: 4px;
margin-bottom: 16px;
box-shadow: var(--shadow);
}
.tab {
flex: 1;
padding: 10px 0;
border: none;
background: transparent;
font-size: 14px;
cursor: pointer;
border-radius: 10px;
color: var(--text-muted);
transition: all .2s;
}
.tab.active {
background: var(--primary);
color: #FFF;
font-weight: 600;
}
/* ── Tab content ── */
.tab-content { display: none; }
.tab-content.active { display: block; }
/* ── Date row ── */
.date-row {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
font-size: 14px;
font-weight: 600;
}
.date-row input[type="date"] {
flex: 1;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: 8px;
font-size: 14px;
font-family: inherit;
}
/* ── Card ── */
.card {
background: var(--card);
border-radius: var(--radius);
padding: 16px;
margin-bottom: 12px;
box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; margin-bottom: 2px; }
.card-desc { font-size: 12px; 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: 8px 10px;
border: 1px solid var(--border);
border-radius: 8px;
font-size: 13px;
font-family: inherit;
resize: vertical;
}
.item-row textarea { min-height: 40px; }
.item-row .idx {
font-size: 12px;
color: var(--text-muted);
min-width: 20px;
padding-top: 10px;
}
.btn-del {
background: none;
border: none;
color: var(--danger);
font-size: 18px;
cursor: pointer;
padding: 6px 4px;
line-height: 1;
}
.btn-del:hover { opacity: 0.7; }
/* 责善改过 双输入 */
.mistake-group {
display: flex;
flex-direction: column;
gap: 4px;
flex: 1;
}
.mistake-group .label-hint {
font-size: 11px;
color: var(--text-muted);
padding-left: 2px;
}
/* ── Study items ── */
.study-row {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}
.study-row input[type="text"] {
flex: 1;
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: 8px;
font-size: 13px;
font-family: inherit;
}
.study-row input[type="checkbox"] {
width: 18px; height: 18px;
accent-color: var(--primary);
flex-shrink: 0;
}
/* ── Buttons ── */
.btn-add {
display: block;
width: 100%;
padding: 8px;
margin-top: 8px;
border: 1px dashed var(--primary);
background: var(--primary-light);
color: var(--primary);
font-size: 13px;
border-radius: 8px;
cursor: pointer;
transition: all .2s;
}
.btn-add:hover { background: #DDE3FD; }
.btn-save {
display: block;
width: 100%;
padding: 14px;
margin-top: 8px;
border: none;
background: var(--primary);
color: #FFF;
font-size: 16px;
font-weight: 600;
border-radius: var(--radius);
cursor: pointer;
transition: all .2s;
}
.btn-save:hover { opacity: 0.9; transform: translateY(-1px); }
/* ── Week nav ── */
.week-nav {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
padding: 16px 0;
}
.btn-nav {
padding: 8px 16px;
border: 1px solid var(--border);
background: var(--card);
border-radius: 8px;
font-size: 13px;
cursor: pointer;
}
#week-label {
font-size: 14px;
font-weight: 600;
min-width: 140px;
text-align: center;
}
/* ── Score ── */
.score-display { text-align: center; padding: 20px 0 8px; }
.score-num { font-size: 56px; font-weight: 800; color: var(--primary); }
.score-unit { font-size: 20px; color: var(--text-muted); margin-left: 4px; }
.score-text { text-align: center; font-size: 14px; margin-bottom: 16px; }
/* ── Details ── */
.details-list { margin-top: 8px; }
.details-list .detail-row {
padding: 10px 16px;
background: var(--card);
border-radius: 8px;
margin-bottom: 6px;
font-size: 13px;
box-shadow: var(--shadow);
}
/* ── History ── */
#history-list { margin-top: 4px; }
.history-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
background: var(--card);
border-radius: var(--radius);
margin-bottom: 8px;
box-shadow: var(--shadow);
}
.history-row .info { flex: 1; }
.history-row .info .date { font-weight: 600; font-size: 14px; color: var(--primary); }
.history-row .info .preview { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.history-row .btn-del-history {
background: var(--danger-light);
border: none;
color: var(--danger);
padding: 6px 12px;
border-radius: 6px;
font-size: 12px;
cursor: pointer;
flex-shrink: 0;
margin-left: 12px;
}
.history-row .btn-del-history:hover { opacity: 0.8; }
/* ── Toast ── */
.toast {
position: fixed;
top: 16px;
left: 50%;
transform: translateX(-50%);
padding: 12px 24px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
z-index: 999;
opacity: 0;
pointer-events: none;
transition: opacity .3s;
white-space: nowrap;
}
.toast.show { opacity: 1; pointer-events: auto; }
.toast.success { background: #10B981; color: #FFF; }
.toast.error { background: var(--danger); color: #FFF; }
.toast.info { background: var(--primary); color: #FFF; }