/* Preserve the original desktop layout; touch layout applies only below 901px. */
@media(max-width:900px){
html{scroll-padding-top:80px}body{padding-bottom:calc(86px + env(safe-area-inset-bottom));font-size:15px;-webkit-text-size-adjust:100%}
.sidebar,.mobile-menu,.mobile-scrim,.aside,.breadcrumb,.top-date,.eyebrow,.search kbd,.page-footer{display:none!important}
.app{margin-left:0}.main{max-width:700px;padding:24px 18px}.topbar{position:sticky;top:0;z-index:25;height:calc(60px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 20px 0;background:#f0f2ebf5;backdrop-filter:blur(16px);border-bottom:1px solid #dfe5d8}
.phone-brand{font-size:20px;letter-spacing:-.5px;font-weight:650}.sync{font-size:11px;padding:12px 0 12px 8px;min-height:44px}.sync.needs-attention{color:#ad654c}.sync.needs-attention i{background:#ad654c}
.intro{margin-bottom:20px;gap:10px}.intro h1{font-size:25px;letter-spacing:0;margin-bottom:7px}.intro p{font-size:12px;max-width:none}.intro .btn{font-size:12px;min-height:44px;padding:10px 13px}.btn{min-height:44px;font-size:13px;border-radius:10px;padding:11px 14px}
.summary{grid-template-columns:repeat(3,1fr);padding:18px 0 15px;row-gap:14px;border-radius:14px;margin-bottom:23px}.stat{padding:0 17px}.stat:nth-child(3){border:0}.stat:last-child{grid-column:1/-1;padding:12px 18px 0;display:grid;grid-template-columns:1fr auto;align-items:center;border-top:1px solid var(--line);margin:0 15px}.stat:last-child .stat-label{grid-column:1}.stat:last-child .progress-label{grid-column:2;gap:12px;margin:0;font-size:11px}.stat:last-child .track{grid-column:1/-1;width:100%;margin-top:10px}.stat-val{font-size:27px;margin-top:7px}.stat-val small{display:none}.stat-label{font-size:11px}.stat-label svg{display:none}
.content-grid{display:block}.study-head{margin-bottom:10px;gap:4px}.tabs{gap:20px}.tab{font-size:13px;min-height:44px;padding:10px 0 12px}.tab svg{display:none}.round-button{font-size:11px;min-height:44px;padding:6px 0 6px 8px}.round-button svg{width:15px;height:15px}
.toolbar{padding:4px 10px;border-radius:10px;gap:8px;min-height:49px;margin-bottom:10px}.search input{font-size:16px;padding:8px 0;min-height:40px}.search svg{width:18px;height:18px}.toolbar select{font-size:12px;min-height:40px;max-width:130px}.phone-filters{display:flex;align-items:center;justify-content:space-between;padding:2px 0 10px;font-size:12px;color:#809075}.phone-filters select{font-size:14px;color:#456446;background:var(--pale);border:0;padding:8px 10px;border-radius:8px;min-height:44px}
.resume{font-size:11px;min-height:46px;padding:8px 10px;border-radius:9px;gap:7px;margin-bottom:20px}.resume button{font-size:11px;min-height:32px;padding:5px 0}.resume span{min-width:0;overflow-wrap:anywhere}.resume svg{display:none}
.list-label{font-size:10px;padding-left:4px;padding-right:0}.list-label span:last-child{margin-right:0}.group-title{font-size:13px;margin:20px 0 10px}.group-title span{font-size:9px}.word-row{position:relative;padding:12px 10px 10px 14px;gap:5px 8px;display:grid;grid-template-columns:minmax(0,1fr) 44px;border-radius:12px;min-height:116px;margin-bottom:9px;scroll-margin-top:80px}.row-number,.row-reveal{display:none}.word-face{grid-row:1;grid-column:1;min-height:46px;width:100%}.flip-inner{min-height:46px}.face-front{font-size:24px}.face-back{font-size:14px;line-height:1.55}.face-back small{font-size:11px}.detail-trigger{grid-column:2;grid-row:1;border:0;min-width:44px;min-height:44px;padding:0;align-items:center;justify-content:center;background:#f5f7ef;border-radius:9px;color:#759163}.detail-trigger svg{width:20px;height:20px}.mark-buttons:not(.flash-actions):not(.drawer-marks){grid-column:1/-1;grid-row:2;display:flex;gap:8px}.mark{height:40px;min-width:44px;flex:1;font-size:18px;border-radius:8px}.word-row .mark:after{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;font-size:11px;margin-left:5px}.word-row .mark{display:flex;align-items:center;justify-content:center}.word-row .mark.known:after{content:'认识'}.word-row .mark.unknown:after{content:'不认识'}.word-row .mark.fuzzy:after{content:'模糊'}.mark:hover{transform:none}.mini-status{grid-column:1/-1;grid-row:3;font-size:11px;margin:5px 0 0}.row-footer{font-size:10px;gap:12px;line-height:1.7;margin:18px 2px}
.bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:30;border-top:1px solid #dee5d6;background:#f8faf4f5;backdrop-filter:blur(20px);padding:7px 20px calc(7px + env(safe-area-inset-bottom));justify-content:space-around;gap:12px}.bottom-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:52px;flex:1;max-width:160px;border-radius:11px;color:#93a08b;font-size:11px}.bottom-nav button.active{background:#e3ecd9;color:#45694c;font-weight:600}.bottom-nav svg{width:22px;height:22px}
.toast{bottom:calc(88px + env(safe-area-inset-bottom));left:50%;font-size:13px;padding:13px 16px;width:max-content;max-width:calc(100vw - 28px);line-height:1.7}.toast button{margin-left:12px;min-height:32px}.storage-warning{position:sticky;top:60px;background:#fff0dd;border-bottom:1px solid #e7c98e;color:#8c572a;padding:10px 18px;z-index:26;font-size:12px}.storage-warning:not([hidden]){position:fixed;top:calc(60px + env(safe-area-inset-top));left:0;right:0}
.drawer{width:100%;max-width:600px;padding:calc(18px + env(safe-area-inset-top)) 23px calc(28px + env(safe-area-inset-bottom));overscroll-behavior:contain}.drawer-top{margin-bottom:22px;position:sticky;top:calc(-18px - env(safe-area-inset-top));background:#fbfcf8f5;z-index:1;padding:8px 0}.close{min-width:44px;min-height:44px;font-size:24px}.drawer h2{font-size:38px;overflow-wrap:anywhere}.phonetic{font-size:14px}.phonetic button{min-height:44px;min-width:44px;align-items:center;justify-content:center}.detail-stats{gap:7px}.detail-stats span{flex:1;padding:11px 6px;text-align:center;font-size:11px}.detail-section h4{font-size:13px;align-items:center;min-height:28px;margin-bottom:9px}.add-related{min-height:36px;font-size:12px}.definition{font-size:18px}.mnemonic,.translation{font-size:14px}.chip{font-size:16px;min-height:44px}.related-note{font-size:12px}.drawer-marks .mark{min-height:48px;font-size:13px}
.modal{width:600px;max-width:100%;max-height:92dvh;top:auto;bottom:0;left:50%;transform:translate(-50%,100%);padding:20px 22px calc(24px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;overscroll-behavior:contain}.modal.open{transform:translate(-50%,0)}.modal h2{font-size:23px;margin:0}.modal p{font-size:13px;line-height:1.85;margin:13px 0}.modal-header{gap:12px}.modal-actions{flex-wrap:wrap;margin-top:22px;gap:8px}.modal-actions .btn{flex:1}.modal textarea,.field input,.field select,.import-table td input{font-size:16px;min-height:46px}.modal textarea{min-height:145px}.field{font-size:13px}.form-grid{gap:16px}.import-table{table-layout:fixed}.import-table th:first-child{width:46px}.import-table td{padding:10px 4px;overflow-wrap:anywhere}.import-table td input{width:100%;max-width:100%}.steps{gap:5px}.steps span{font-size:10px;padding:7px}.settings-section{padding:18px 0;border-bottom:1px solid var(--line)}.settings-section h3{font-size:15px;font-weight:600;margin:0 0 10px}.settings-buttons{display:flex;gap:10px;margin:14px 0}.settings-buttons .btn{flex:1}.text-button{color:var(--green);min-height:44px;font-size:13px;text-decoration:underline}.status-pill{font-weight:400;font-size:11px;background:#e8eedf;color:#62834d;padding:5px 8px;border-radius:6px;margin-left:8px}
.flash-top{font-size:12px;line-height:1.6}.flash-card{height:clamp(260px,40dvh,390px)}.flash-inner{display:block;width:100%}.flash-word{font-size:clamp(30px,8vw,43px);overflow-wrap:anywhere;max-width:100%}.flash-hint{font-size:11px;letter-spacing:0}.flash-meaning{font-size:21px;margin:9px;line-height:1.6}.flash-ipa{font-size:14px}.flash-actions{gap:8px;margin:16px 0 8px}.flash-actions .mark{min-height:50px;font-size:12px;padding:10px 4px}.flash-bottom{gap:6px;flex-wrap:wrap}.flash-bottom button{min-height:44px;font-size:12px}.session-note{font-size:11px;text-align:center}.flash-container{padding:0}.card-mode .summary{display:none}
@media(min-width:701px){.bottom-nav{left:50%;transform:translateX(-50%);max-width:700px;border-radius:16px 16px 0 0}.topbar{padding-left:max(24px,calc((100vw - 664px)/2));padding-right:max(24px,calc((100vw - 664px)/2))}.main{padding-top:30px}.word-row{min-height:112px}.modal{bottom:25px;border-radius:22px;max-height:90dvh}.drawer{border-left:1px solid var(--line)}}
@media(max-width:360px){.main{padding:20px 12px}.phone-brand{font-size:18px}.topbar{padding-left:14px;padding-right:14px}.intro h1{font-size:23px}.intro p{font-size:11px}.tabs{gap:14px}.stat{padding:0 13px}.modal{padding-left:16px;padding-right:16px}.face-front{font-size:23px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

}
/* Shared settings use the original centered desktop dialog. */
.settings-section{padding:18px 0;border-bottom:1px solid var(--line)}
.settings-section h3{font-size:15px;font-weight:600;margin:0 0 10px}
.settings-buttons{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.settings-buttons .btn{flex:1}
.text-button{color:var(--green);min-height:36px;text-decoration:underline}
.status-pill{font-size:11px;background:#e8eedf;color:#62834d;padding:5px 8px;border-radius:6px;margin-left:8px}
#cloudError:not(:empty){padding:12px;background:#fff0dd;border-radius:8px;color:#8c572a}
.login-steps{padding:12px 0}.login-steps summary{cursor:pointer;color:var(--green);padding:8px 0}
@media(min-width:901px){
.phone-brand,.phone-filters,.bottom-nav,.phone-only{display:none!important}
.storage-warning:not([hidden]){position:sticky;top:0;padding:12px 24px;background:#fff0dd;color:#8c572a;z-index:35}
.settings-section .field{font-size:12px}.settings-section input{font-size:14px}
.sidebar{overflow-y:auto}.sync.needs-attention{color:#ad654c}
}
@media(max-width:900px){.desktop-only{display:none!important}}
