first commit

This commit is contained in:
M1ngdaXie
2026-03-27 00:19:20 -07:00
commit c3f84acaef
5 changed files with 31573 additions and 0 deletions

683
style.css Normal file
View File

@@ -0,0 +1,683 @@
@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700;900&family=ZCOOL+KuaiLe&display=swap");
/* Fallback: if Google Fonts unavailable (offline/firewall), system CJK fonts cover all characters */
:root {
--bg: #faf5ec;
--text: #1a1008;
--text2: #6b4f2a;
--accent: #c13b0a;
--accent2: #e07b20;
--green: #2a7a52;
--green-lt: #e8f5ee;
--red: #b52020;
--red-lt: #ffebee;
--gold: #c8941a;
--card: #ffffff;
--paper-alt: #f2ead8;
--radius: 14px;
--fs-base: 16px;
--fs-char: clamp(1.9rem, 7.5vw, 2.8rem);
--fs-opt: clamp(1.3rem, 5.5vw, 1.8rem);
--shadow-sm: 0 2px 8px rgba(26, 16, 8, 0.08);
--shadow-md: 0 4px 20px rgba(26, 16, 8, 0.12);
}
.big-font {
--fs-base: 20px;
--fs-char: clamp(2.2rem, 9vw, 3.4rem);
--fs-opt: clamp(1.6rem, 7vw, 2.2rem);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
body {
font-family:
"Noto Serif SC", "PingFang SC", "Songti SC", "SimSun",
"Source Han Serif CN", serif;
background: var(--bg);
color: var(--text);
font-size: var(--fs-base);
min-height: 100dvh;
overflow-x: hidden;
}
.header {
background: #c13b0a;
color: #fff;
padding: 10px 14px;
display: flex;
align-items: center;
gap: 8px;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 14px rgba(193, 59, 10, 0.4);
}
.header-title {
font-family: "ZCOOL KuaiLe", cursive;
font-size: clamp(1rem, 4vw, 1.3rem);
letter-spacing: 2px;
flex: 1;
text-align: center;
}
.header-right {
display: flex;
gap: 6px;
align-items: center;
flex-shrink: 0;
}
.icon-btn {
background: rgba(255, 255, 255, 0.18);
border: none;
color: #fff;
min-width: 44px;
min-height: 44px;
border-radius: 50%;
font-size: 1.05rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
flex-shrink: 0;
}
.icon-btn:active {
background: rgba(255, 255, 255, 0.38);
}
.icon-btn.active {
background: rgba(255, 255, 255, 0.45);
}
.back-btn {
font-size: 1.3rem;
text-decoration: none;
}
.info-bar {
display: flex;
align-items: center;
justify-content: center;
gap: 0;
background: var(--card);
border-bottom: 1px solid #e8d8c0;
padding: 7px 20px;
}
.info-item {
font-family: "ZCOOL KuaiLe", cursive;
font-size: 1rem;
color: var(--text2);
}
.info-item span {
color: var(--accent);
font-size: 1.1rem;
}
.info-divider {
width: 1px;
height: 16px;
background: #e0d0b8;
margin: 0 16px;
}
.info-wb {
cursor: pointer;
color: var(--accent2);
transition: opacity 0.15s;
}
.info-wb:active {
opacity: 0.6;
}
.wb-badge {
background: #fff;
color: var(--red);
border: 1.5px solid var(--red);
border-radius: 10px;
padding: 1px 6px;
font-size: 0.8rem;
font-weight: 900;
font-family: "Noto Serif SC", serif;
margin-left: 4px;
vertical-align: middle;
display: inline-block;
text-align: center;
}
.wb-badge.empty {
background: transparent;
border-color: #c8b89a;
color: #c8b89a;
}
.wb-body {
max-height: 52vh;
overflow-y: auto;
padding: 10px 16px;
}
.wb-item {
padding: 12px 0;
border-bottom: 1px solid #f0e4d0;
}
.wb-item:last-child {
border-bottom: none;
}
.wb-word {
font-size: 1.4rem;
font-weight: 900;
letter-spacing: 3px;
color: var(--text);
}
.wb-pinyin {
font-size: 0.78rem;
color: var(--text2);
margin: 2px 0 6px;
}
.wb-explain {
font-size: 0.85rem;
color: #5d4e37;
line-height: 1.6;
background: #fff8f0;
border-radius: 6px;
padding: 8px 10px;
border-left: 3px solid var(--accent2);
}
.wb-meta {
font-size: 0.75rem;
color: var(--red);
margin-top: 6px;
font-family: "Noto Serif SC", serif;
}
.wb-empty {
text-align: center;
padding: 32px 16px;
color: var(--text2);
font-size: 1rem;
}
.wb-actions {
display: flex;
gap: 10px;
padding: 12px 16px;
border-top: 1px solid #f0e4d0;
}
.wb-actions .action-btn {
flex: 1;
padding: 12px 0;
text-align: center;
}
.wn-item {
display: flex;
gap: 14px;
align-items: flex-start;
padding: 12px 0;
border-bottom: 1px solid #f0e4d0;
}
.wn-item:last-child {
border-bottom: none;
}
.wn-icon {
font-size: 1.6rem;
flex-shrink: 0;
margin-top: 2px;
}
.wn-desc {
font-size: 0.85rem;
color: var(--text2);
margin-top: 3px;
line-height: 1.6;
}
.diff-control {
display: flex;
background: var(--paper-alt);
border-bottom: 1px solid #ddd0b8;
padding: 8px 16px;
gap: 8px;
justify-content: center;
}
.diff-btn {
flex: 1;
max-width: 110px;
border: none;
background: transparent;
color: var(--text2);
padding: 7px 0;
border-radius: 20px;
font-size: 0.9rem;
font-family: "Noto Serif SC", serif;
cursor: pointer;
transition: all 0.2s;
font-weight: 700;
min-height: 38px;
}
.diff-btn.active {
background: var(--accent);
color: #fff;
box-shadow: 0 2px 8px rgba(193, 59, 10, 0.3);
}
.game-area {
padding: 16px;
max-width: 480px;
margin: 0 auto;
}
.progress-bar {
display: flex;
gap: 4px;
margin-bottom: 20px;
height: 6px;
}
.progress-dot {
flex: 1;
border-radius: 3px;
height: 6px;
background: #e0d0b8;
transition: background 0.3s;
}
.progress-dot.done {
background: var(--green);
}
.progress-dot.current {
background: var(--accent);
box-shadow: 0 0 8px rgba(193, 59, 10, 0.45);
}
.progress-dot.skip {
background: var(--red);
opacity: 0.55;
}
.idiom-display {
display: flex;
justify-content: center;
gap: clamp(6px, 2.5vw, 14px);
margin-bottom: 28px;
position: relative;
}
.char-box {
width: clamp(58px, 17vw, 80px);
height: clamp(58px, 17vw, 80px);
background: var(--card);
border: 2.5px solid #e0d0b8;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fs-char);
font-weight: 900;
color: var(--text);
box-shadow: var(--shadow-sm);
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
position: relative;
background-image:
linear-gradient(rgba(160, 130, 90, 0.07) 1px, transparent 1px),
linear-gradient(90deg, rgba(160, 130, 90, 0.07) 1px, transparent 1px);
background-size: 50% 50%;
}
.char-box.blank {
border-color: var(--accent);
border-style: dashed;
background-color: #fff5ee;
background-image:
linear-gradient(rgba(193, 59, 10, 0.05) 1px, transparent 1px),
linear-gradient(90deg, rgba(193, 59, 10, 0.05) 1px, transparent 1px);
background-size: 50% 50%;
animation: blankPulse 2.5s ease-in-out infinite;
cursor: pointer;
}
.char-box.blank.selected {
border-style: solid;
border-width: 3px;
background-color: #ffeedd;
transform: scale(1.1);
box-shadow: 0 0 0 4px rgba(193, 59, 10, 0.18);
animation: none;
}
.char-box.blank.selected::after {
content: "";
position: absolute;
bottom: -9px;
left: 50%;
transform: translateX(-50%);
border: 5px solid transparent;
border-top-color: var(--accent);
}
.char-box.filled {
border-color: var(--accent2);
border-style: solid;
background: linear-gradient(135deg, #fff5ee, #ffe8d0);
color: var(--accent);
animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.char-box.correct {
border-color: var(--green);
background: linear-gradient(135deg, #e8f5ee, #d4eddf);
color: var(--green);
animation: correctPop 0.4s ease;
}
.char-box.wrong {
border-color: var(--red);
background: var(--red-lt);
color: var(--red);
animation: shake 0.4s ease;
}
.char-box .pinyin-hint {
position: absolute;
top: -20px;
font-size: 0.65rem;
color: var(--text2);
font-weight: 400;
white-space: nowrap;
}
.options-grid {
display: grid;
grid-template-columns: repeat(4, clamp(52px, 13vw, 68px));
gap: clamp(6px, 2vw, 10px);
margin-bottom: 16px;
justify-content: center;
}
.option-btn {
aspect-ratio: 1;
width: 100%;
border: 2px solid #e0d0b8;
background: var(--card);
border-radius: 10px;
font-size: var(--fs-opt);
font-family: "Noto Serif SC", serif;
font-weight: 700;
color: var(--text);
cursor: pointer;
transition: all 0.15s;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-sm);
}
.option-btn:active {
transform: scale(0.88);
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
.option-btn.used {
opacity: 0.28;
pointer-events: none;
background: #f5f0e8;
}
.option-btn.disabled {
opacity: 0.15;
pointer-events: none;
}
.action-bar {
display: flex;
gap: 10px;
justify-content: center;
margin-bottom: 16px;
flex-wrap: wrap;
}
.action-btn {
border: none;
padding: 12px 28px;
border-radius: 24px;
font-size: 0.95rem;
font-family: "Noto Serif SC", serif;
cursor: pointer;
transition: all 0.2s;
min-height: 48px;
}
.action-btn.primary {
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
box-shadow: 0 2px 10px rgba(193, 59, 10, 0.3);
flex: 1;
max-width: 280px;
}
.action-btn.primary:active {
transform: scale(0.97);
}
.action-btn.secondary {
background: var(--card);
color: var(--text2);
border: 1.5px solid #e0d0b8;
}
.action-btn.secondary:active {
transform: scale(0.95);
}
.result-card {
background: var(--card);
border-radius: var(--radius);
padding: 20px;
margin-top: 12px;
box-shadow: var(--shadow-md);
animation: slideUp 0.4s ease;
border-top: 4px solid var(--green);
}
.result-card.wrong-result {
border-top-color: var(--red);
}
.result-card h3 {
font-size: 1.15rem;
margin-bottom: 8px;
font-family: "ZCOOL KuaiLe", cursive;
}
.result-card .idiom-word {
font-size: clamp(1.6rem, 6vw, 2.2rem);
font-weight: 900;
color: var(--text);
margin-bottom: 4px;
letter-spacing: 4px;
}
.result-card .idiom-pinyin {
font-size: 0.85rem;
color: var(--text2);
margin-bottom: 12px;
letter-spacing: 1px;
}
.result-card .idiom-explain {
font-size: 0.95rem;
line-height: 1.8;
color: #5d4e37;
padding: 12px 12px 12px 16px;
background: #fff8f0;
border-radius: 8px;
border-left: 3px solid var(--accent2);
}
.combo-toast {
position: fixed;
top: 72px;
left: 50%;
transform: translateX(-50%) translateY(-8px);
background: var(--gold);
color: #fff;
border-radius: 24px;
padding: 7px 20px;
font-family: "ZCOOL KuaiLe", cursive;
font-size: 1.05rem;
box-shadow: var(--shadow-md);
opacity: 0;
pointer-events: none;
z-index: 150;
transition:
opacity 0.25s,
transform 0.25s;
white-space: nowrap;
}
.combo-toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
display: none;
align-items: center;
justify-content: center;
z-index: 200;
padding: 20px;
}
.modal-overlay.show {
display: flex;
}
.modal {
background: var(--card);
border-radius: 20px;
overflow: hidden;
max-width: 360px;
width: 100%;
animation: slideUp 0.3s ease;
box-shadow: 0 8px 32px rgba(26, 16, 8, 0.2);
}
.modal-header {
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
padding: 22px 24px 18px;
text-align: center;
}
.modal-header .streak-display {
font-size: 3.5rem;
font-weight: 900;
font-family: "ZCOOL KuaiLe", cursive;
line-height: 1;
}
.modal-header .streak-label {
font-size: 0.9rem;
opacity: 0.92;
margin-top: 4px;
}
.modal-body {
padding: 18px 20px 20px;
}
.modal .calendar {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 4px;
margin-bottom: 14px;
}
.modal .cal-day {
width: 100%;
aspect-ratio: 1;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.72rem;
background: var(--paper-alt);
color: var(--text2);
}
.modal .cal-day.checked {
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
font-weight: 700;
}
.modal .cal-day.today {
outline: 2px solid var(--accent);
outline-offset: 1px;
}
.daily-goal {
background: var(--paper-alt);
border-radius: 10px;
padding: 10px 14px;
margin-bottom: 14px;
}
.daily-goal-label {
font-size: 0.82rem;
color: var(--text2);
margin-bottom: 7px;
}
.daily-goal-bar {
height: 8px;
background: #ddd0b8;
border-radius: 4px;
overflow: hidden;
}
.daily-goal-fill {
height: 100%;
background: linear-gradient(90deg, var(--green), #4caf50);
border-radius: 4px;
transition: width 0.5s ease;
}
.close-modal {
display: block;
width: 100%;
border: none;
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
padding: 14px;
font-size: 1rem;
font-family: "Noto Serif SC", serif;
cursor: pointer;
min-height: 50px;
}
@keyframes popIn {
0% {
transform: scale(0.8);
opacity: 0.5;
}
100% {
transform: scale(1);
opacity: 1;
}
}
@keyframes correctPop {
0% {
transform: scale(1);
}
50% {
transform: scale(1.18);
}
100% {
transform: scale(1);
}
}
@keyframes shake {
0%,
100% {
transform: translateX(0);
}
25% {
transform: translateX(-7px);
}
75% {
transform: translateX(7px);
}
}
@keyframes slideUp {
0% {
transform: translateY(20px);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
@keyframes blankPulse {
0%,
100% {
box-shadow: 0 0 0 0 rgba(193, 59, 10, 0.08);
}
50% {
box-shadow: 0 0 0 6px rgba(193, 59, 10, 0.13);
}
}
@keyframes comboIn {
0% {
transform: scale(0.5);
opacity: 0;
}
100% {
transform: scale(1);
opacity: 1;
}
}
@media (max-width: 380px) {
.header-title {
font-size: 0.95rem;
letter-spacing: 1px;
}
.icon-btn {
min-width: 40px;
min-height: 40px;
}
}
@media (min-width: 600px) {
.game-area {
padding: 24px 32px;
}
.char-box {
width: 88px;
height: 88px;
}
.options-grid {
gap: 16px;
}
}