:root { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: #263238; background: #fff8e8; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #fffef8, #fff2cd); }
button { font: inherit; }
.app { width: min(960px, 100%); min-height: 100vh; margin: auto; padding: 28px 20px 40px; }
.hero { text-align: center; margin: 20px 0 30px; }
.hero h1 { margin: 0; font-size: clamp(2.4rem, 8vw, 4.4rem); color: #ff7043; }
.hero p { margin: 8px 0; font-size: 1.15rem; color: #607d8b; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.lesson-card { border: 0; border-radius: 24px; padding: 25px 22px; min-height: 145px; text-align: left; color: #263238; background: white; box-shadow: 0 8px 22px #d9b86642; cursor: pointer; transition: transform .15s; }
.lesson-card:active { transform: scale(.98); }
.lesson-number { display: block; color: #ff7043; font-weight: 800; margin-bottom: 10px; }
.lesson-title { display: block; font-size: 1.45rem; font-weight: 750; line-height: 1.25; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back { border: 0; background: white; box-shadow: 0 4px 12px #d9b86638; border-radius: 16px; padding: 13px 17px; cursor: pointer; }
.course-title { margin: 0; font-size: clamp(1.35rem, 5vw, 2rem); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.tab { min-height: 58px; padding: 10px 5px; border: 3px solid transparent; border-radius: 18px; background: #fff; cursor: pointer; font-weight: 700; }
.tab.active { border-color: #ffb74d; background: #fff3d8; color: #d9562b; }
.study-card { min-height: 460px; border-radius: 30px; background: white; box-shadow: 0 12px 32px #d9b8664d; padding: clamp(24px, 6vw, 48px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.kind { align-self: flex-start; padding: 6px 13px; border-radius: 99px; color: #58727e; background: #edf7fa; font-weight: 700; }
.english { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; gap: .08em .24em; width: 100%; margin: 20px 0; font-size: clamp(2rem, 7vw, 4rem); line-height: 1.35; text-align: center; }
.word-unit { display: inline-block; white-space: nowrap; }
.lookup-word { position: relative; display: inline; border-radius: .22em; padding: 0 .04em; color: inherit; font: inherit; line-height: inherit; cursor: pointer; white-space: nowrap; }
.lookup-word:hover { background: #fff2b5; }
.lookup-word.selected { z-index: 5; background: #ffd76a; box-shadow: 0 4px 12px #b78a2c66; }
.word-bubble { position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); min-width: 130px; max-width: 230px; padding: 12px 15px; border: 2px solid #ffd166; border-radius: 16px; background: #fffdf5; box-shadow: 0 8px 24px #546e7a4d; color: #263238; font-size: 1rem; line-height: 1.35; white-space: normal; text-align: center; }
.word-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: #ffd166; }
.word-bubble b, .word-bubble span { display: block; }
.word-bubble b { margin-bottom: 4px; color: #d9562b; }
.bubble-speak { display: block; margin: 10px auto 0; border: 0; border-radius: 12px; padding: 8px 12px; background: #ff7043; color: white; font-size: .92rem; font-weight: 750; cursor: pointer; white-space: nowrap; }
.bubble-speak:active { transform: scale(.96); }
.word-hint { margin: -8px 0 18px; color: #78909c; font-size: .92rem; }
.speak { border: 0; border-radius: 22px; min-width: 180px; min-height: 76px; padding: 12px 24px; background: #ff7043; color: white; font-weight: 800; font-size: 1.25rem; cursor: pointer; box-shadow: 0 7px 0 #d94d25; }
.speak:active { transform: translateY(5px); box-shadow: 0 2px 0 #d94d25; }
.translation { min-height: 55px; margin: 25px 0 10px; font-size: 1.25rem; }
.translation button { border: 2px solid #80cbc4; border-radius: 15px; background: #e7f8f5; padding: 10px 18px; cursor: pointer; }
.nav { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 22px; }
.nav button { border: 0; border-radius: 16px; min-height: 54px; padding: 10px; background: #e8f4ff; color: #315b79; font-weight: 750; cursor: pointer; }
.nav button:last-child { background: #e9f8e5; color: #39733a; }
.nav button:disabled { opacity: .35; cursor: default; }
.progress { color: #607d8b; font-weight: 700; white-space: nowrap; }
.empty, .error { margin: 80px auto; max-width: 620px; text-align: center; background: white; padding: 35px; border-radius: 24px; }
.error { color: #a33; }
@media (max-width: 520px) { .app { padding: 18px 12px 28px; } .tabs { gap: 6px; } .tab { font-size: .92rem; } .study-card { min-height: 430px; } .nav { gap: 7px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
