/* 通用组件 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 22px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; transition: transform .1s; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(18,161,80,.28); }
.btn.block { display: flex; width: 100%; margin-top: 14px; }
.link { color: var(--green-d); font-size: 13px; }
.muted { color: var(--ink-3); font-size: 12px; }
.hint { color: var(--ink-3); font-size: 12px; text-align: center; margin: 8px 0; }
.en { font-family: var(--title); color: var(--green); font-size: 12px; letter-spacing: .5px; }
.badge { flex: none; padding: 2px 10px; border-radius: 10px; background: var(--green-l); color: var(--green-d); font-size: 12px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 18px; background: #fff; border: 1.5px solid var(--mint); color: var(--green-d); font-size: 13px; text-align: left; line-height: 1.4; }
.chip.alt { background: var(--green); border-color: var(--green); color: #fff; }
.chips.small { margin-top: 10px; } .chips.small .chip { font-size: 12.5px; padding: 6px 12px; }
.seg { display: inline-flex; padding: 4px; border-radius: 22px; background: #EFE9DC; gap: 2px; }
.seg button { padding: 7px 16px; border-radius: 18px; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--green-d); font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.block { padding: 0 16px; margin-top: 22px; }
.block-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; }
.block-h h2 { font-size: 20px; } .block-h a { font-size: 13px; color: var(--ink-3); }
.nav-title { transition: opacity .2s; } .navbar.clear .nav-title { opacity: 0; }
.foot { text-align: center; color: var(--ink-3); font-size: 12px; margin: 26px 0 8px; }

/* 首页 */
.hero { position: relative; height: 380px; overflow: hidden; border-radius: 0 0 32px 32px; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(251,248,241,0) 30%, rgba(251,248,241,.55) 100%); }
.hero-text { position: absolute; z-index: 2; left: 20px; top: 104px; width: 62%; }
.hero-hi { font-weight: 700; color: var(--green-d); }
.hero h1 { font-size: 36px; line-height: 1.2; margin: 4px 0 18px; color: var(--ink); text-shadow: 0 2px 0 #fff; }
.hero-ask { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 16px; border-radius: 23px; background: #fff; box-shadow: var(--shadow); font-size: 13px; color: var(--ink-3); width: 112%; position: relative; z-index: 3; }
.hero-ask span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-ask i { width: 36px; height: 36px; border-radius: 50%; background: var(--green); flex: none; position: relative; }
.hero-ask i::after { content: ""; position: absolute; left: 11px; top: 13px; width: 9px; height: 9px; border-top: 2.5px solid #fff; border-right: 2.5px solid #fff; transform: rotate(45deg); }
.hero-girl { position: absolute; z-index: 2; right: -18px; bottom: -40px; height: 330px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.18)); animation: bob 3s ease-in-out infinite; }
.entries { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; margin-top: -26px; position: relative; z-index: 3; }
.entry { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 12px 10px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.entry img { grid-row: span 2; width: 42px; height: 42px; object-fit: contain; }
.entry b { font-family: var(--title); font-weight: 400; font-size: 15.5px; line-height: 1.2; white-space: nowrap; } .entry span { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.entry.e1 { background: linear-gradient(135deg, #E3F4E9, #fff 70%); } .entry.e2 { background: linear-gradient(135deg, #FFF4D2, #fff 70%); }
.entry.e3 { background: linear-gradient(135deg, #FDE4DD, #fff 70%); } .entry.e4 { background: linear-gradient(135deg, #DFE9F8, #fff 70%); }
.challenge { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.ch-sw { width: 76px; height: 76px; border-radius: 22px 22px 22px 6px; flex: none; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.ch-sw i { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 10px; color: rgba(0,0,0,.5); }
.challenge div { flex: 1; } .challenge b { font-size: 16px; } .challenge p { font-size: 12px; color: var(--ink-3); }
.ch-best { font-size: 12px; color: var(--green-d); font-weight: 700; }
.go { padding: 8px 14px; border-radius: 16px; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.lesson-today { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.lesson-today img { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; flex: none; }
.lesson-today div { flex: 1; } .lesson-today b { display: block; font-size: 16px; } .lesson-today p { font-size: 12px; color: var(--ink-3); }
.tubes-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; }
.tubes-scroll::-webkit-scrollbar { display: none; }
.tube-card { flex: none; width: 58px; text-align: center; font-size: 12px; color: var(--ink-2); }
.tube-card i { display: block; width: 46px; height: 46px; margin: 0 auto 4px; border-radius: 50% 50% 50% 12%; box-shadow: inset -4px -5px 0 rgba(0,0,0,.12), inset 4px 4px 0 rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.08); }
.brand { margin: 24px 16px 0; border-radius: 22px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.brand img { width: 100%; height: 170px; object-fit: cover; }
.brand-text { padding: 14px 16px 18px; } .brand-text h2 { font-size: 22px; margin: 2px 0 6px; } .brand-text p:not(.en) { font-size: 13px; color: var(--ink-2); }
.brand-text a { display: inline-block; margin-top: 10px; color: var(--green-d); font-weight: 700; font-size: 14px; border-bottom: 2px solid var(--mint); }

/* 聊天 */
.view:has(.chat) { padding-bottom: 0; } .view:has(.chat) > .page { min-height: 100%; display: flex; flex-direction: column; } .page > .chat { flex: 1; }
.chat { min-height: 100%; display: flex; flex-direction: column; background: url(../assets/scene/chatbg.webp) 0 0/300px repeat; }
.chat-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: rgba(251,248,241,.94); border-bottom: 1px solid var(--line); }
.chat-bar img { width: 36px; height: 36px; border-radius: 50%; background: var(--green-l); object-fit: cover; }
.chat-bar div { flex: 1; line-height: 1.25; } .chat-bar b { font-size: 14px; display: block; } .chat-bar span { font-size: 11px; color: var(--ink-3); }
.switch { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); margin-right: 8px; }
.switch i { width: 30px; height: 18px; border-radius: 9px; background: #D9D2C3; position: relative; transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { color: var(--green-d); } .switch.on i { background: var(--green); } .switch.on i::after { left: 14px; }
.msgs { flex: 1; padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; align-items: flex-start; animation: pageIn .3s both; }
.msg.me { justify-content: flex-end; }
.msg .av { width: 38px; height: 38px; border-radius: 50%; background: var(--green-l); flex: none; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.bw { max-width: 84%; min-width: 0; }
.bubble { padding: 10px 14px; border-radius: 4px 18px 18px 18px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.05); font-size: 14.5px; line-height: 1.7; word-break: break-word; }
.bubble b { color: var(--green-d); }
.msg.me .bubble { border-radius: 18px 4px 18px 18px; background: var(--green); color: #fff; max-width: 80%; }
.bubble.err { background: #FFF1EE; color: #9E3A28; }
.bubble .up { width: 160px; border-radius: 10px; margin-bottom: 6px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .4; } }
.mixing { display: block; margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: var(--green-l); color: var(--green-d); font-size: 12.5px; font-weight: 700; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.msg-tools { display: flex; gap: 8px; margin-top: 6px; }
.speak, .retry { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 14px; background: rgba(255,255,255,.9); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.speak i { width: 16px; height: 12px; background: linear-gradient(90deg, var(--green) 2px, transparent 2px 5px, var(--green) 5px 7px, transparent 7px 10px, var(--green) 10px 12px, transparent 12px); clip-path: polygon(0 35%, 15% 35%, 15% 65%, 0 65%, 0 35%, 30% 15%, 45% 15%, 45% 85%, 30% 85%, 30% 15%, 60% 0, 75% 0, 75% 100%, 60% 100%, 60% 0); }
.speak.loading { opacity: .6; } .speak.playing { background: var(--green); color: #fff; border-color: var(--green); }
.speak.playing i { background: #fff; animation: pulse .8s infinite; }
.composer { position: sticky; bottom: 0; z-index: 5; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: rgba(251,248,241,.97); border-top: 1px solid var(--line); }
.comp-row { display: flex; align-items: flex-end; gap: 8px; }
.comp-img { width: 40px; height: 40px; flex: none; } .comp-img img { width: 100%; height: 100%; object-fit: contain; }
.composer textarea { flex: 1; min-height: 40px; max-height: 110px; resize: none; padding: 9px 14px; border-radius: 20px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 15px; line-height: 1.4; outline: none; }
.composer textarea:focus { border-color: var(--green); }
.comp-send { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--green); position: relative; }
.comp-send::after { content: ""; position: absolute; left: 13px; top: 11px; border-left: 16px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.comp-send.stop { background: var(--ink); } .comp-send.stop::after { left: 13px; top: 13px; border: 0; width: 14px; height: 14px; background: #fff; border-radius: 3px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 6px; border-radius: 12px; background: #fff; font-size: 12px; color: var(--ink-3); }
.attach[hidden] { display: none; } .attach img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; } .attach span { flex: 1; }
.attach button { color: var(--red); font-size: 12px; padding: 4px 8px; }
