/* ===================================================================
   移动端界面层 · 只在 html.view-mobile 下生效
   PC 端样式完全不受影响；此处重绘手机上的外壳、节奏与控件尺寸。
   =================================================================== */
/* 外壳元素共用：PC 端只保留“手机版”切换按钮，其余移动端部件隐藏。 */
.mb-back[hidden],.mb-switch[hidden],.mb-title[hidden]{display:none!important}
html.view-desktop .mb-mark,
html.view-desktop .mb-back,
html.view-desktop .mb-title{display:none}
html.view-desktop header #sync{margin-left:auto}
html.view-desktop .mb-switch{
 min-height:0;padding:4px 11px;font-size:11px;border-radius:99px;
 border-color:#e7e4f5;color:#8b90ab;background:#fff;
}
html.view-desktop .mb-switch:hover{color:#5b4cf0;border-color:#c9c3f2}

html.view-mobile{
 --mb-r:20px;          /* 卡片圆角 */
 --mb-tap:44px;        /* 最小可点高度 */
 --mb-pad:14px;        /* 页面左右留白 */
 --mb-bar:74px;        /* 底部标签栏预留高度 */
 --mb-shell:560px;     /* 宽屏预览手机版时的最大列宽 */
 --mb-glass:linear-gradient(180deg,#fffffff5,#fffffcd9);
 -webkit-text-size-adjust:100%;
 text-size-adjust:100%;
}
html.view-mobile body{
 margin:0;
 font-size:15px;
 padding:0 0 calc(var(--mb-bar) + env(safe-area-inset-bottom));
 background:
  radial-gradient(680px 300px at 108% -6%,#ffe2d0 0,transparent 60%),
  radial-gradient(560px 280px at -22% 4%,#d9ecff 0,transparent 58%),
  radial-gradient(520px 420px at 50% 112%,#efe7ff 0,transparent 62%),
  #f8f6ff;
 background-attachment:fixed;
 overscroll-behavior-y:contain;
}
html.view-mobile .main{margin:0 auto;max-width:var(--mb-shell)}
html.view-mobile #app{max-width:none;padding:12px var(--mb-pad) 34px}

/* ---------- 顶部应用栏 ---------- */
html.view-mobile .sidebar{display:contents}
html.view-mobile .sidebar .brand,
html.view-mobile .sidebar .nav-label,
html.view-mobile .sidebar .nav-rule,
html.view-mobile .sidebar .side-bottom{display:none}
html.view-mobile header{
 position:sticky;top:0;z-index:45;
 display:flex;align-items:center;gap:9px;
 min-height:54px;padding:7px max(11px,env(safe-area-inset-right)) 7px max(11px,env(safe-area-inset-left));
 background:var(--mb-glass);
 -webkit-backdrop-filter:blur(16px) saturate(1.35);
 backdrop-filter:blur(16px) saturate(1.35);
 border-bottom:1px solid #eae5fa;
 box-shadow:0 8px 22px #2b21600a;
}
html.view-mobile #breadcrumbs{display:none}
html.view-mobile .mb-mark{
 display:grid;place-items:center;flex:0 0 32px;height:32px;
 border-radius:12px;font-size:17px;color:#fff;
 background:linear-gradient(135deg,#6a5cff,#9b5cff 55%,#ff7a59);
 box-shadow:0 6px 14px #6a5cff40;
}
html.view-mobile .mb-back{
 flex:0 0 32px;height:32px;min-height:0;padding:0;
 border-radius:12px;border-color:#e7e4f5;background:#fff;
 font-size:21px;line-height:1;color:#5b4cf0;
}
html.view-mobile .mb-back[hidden]{display:none}
html.view-mobile .mb-title{
 flex:1;min-width:0;font-size:16.5px;font-weight:700;letter-spacing:-.3px;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
html.view-mobile #sync{
 flex:0 0 auto;max-width:92px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
 font-size:10px;line-height:1.5;color:#54806a;
 padding:4px 9px 4px 16px;border-radius:99px;background:#eef7f1;position:relative;
}
html.view-mobile #sync::before{
 content:'';position:absolute;left:7px;top:50%;margin-top:-3px;
 width:6px;height:6px;border-radius:50%;background:#1fbf8f;
}
html.view-mobile #sync.error{color:#a14f38;background:#fdf0ea;max-width:128px}
html.view-mobile #sync.error::before{background:#ff7a59}
html.view-mobile .mb-switch{
 flex:0 0 auto;min-height:30px;padding:5px 10px;font-size:11px;
 border-radius:99px;border-color:#e2ddf7;background:#fff;color:#6a5cff;
}

/* ---------- 底部标签栏 ---------- */
html.view-mobile .sidebar nav{
 position:fixed;bottom:0;z-index:60;
 left:50%;right:auto;transform:translateX(-50%);width:min(var(--mb-shell),100%);
 display:flex;gap:4px;margin:0;
 padding:7px max(10px,env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-right));
 background:var(--mb-glass);
 -webkit-backdrop-filter:blur(18px) saturate(1.4);
 backdrop-filter:blur(18px) saturate(1.4);
 border-top:1px solid #e9e4fa;
 box-shadow:0 -8px 26px #2b216012;
}
html.view-mobile .sidebar nav a{
 flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
 padding:5px 2px 4px;border-radius:14px;background:none;color:#8b8fa8;
 font-size:11px;font-weight:500;transition:color .18s,transform .18s;
}
html.view-mobile .sidebar nav a .tab-icon{
 display:grid;place-items:center;width:34px;height:26px;border-radius:9px;
 font-size:15px;line-height:1;transition:background .2s,color .2s,box-shadow .2s;
}
html.view-mobile .sidebar nav a.active{
 background:none;color:#5b4cf0;font-weight:700;box-shadow:none;transform:none;
}
html.view-mobile .sidebar nav a.active .tab-icon{
 color:#fff;background:linear-gradient(135deg,#6a5cff,#9a6bff);
 box-shadow:0 6px 14px #6a5cff4d;
}
html.view-mobile .sidebar nav a:hover{background:none;transform:none}
html.view-mobile body.pdf-focus{padding-bottom:0}

/* ---------- 标题区 ---------- */
html.view-mobile .hero{
 display:block;margin:4px 0 16px;padding:0 2px;
}
html.view-mobile .hero .eyebrow{font-size:9.5px;letter-spacing:1.6px}
html.view-mobile .hero h1{
 font-size:25px;line-height:1.28;letter-spacing:-.8px;margin:7px 0 6px;
}
html.view-mobile .hero p{font-size:12.5px;line-height:1.6;margin:0}
html.view-mobile .hero .countdown{
 display:inline-block;margin-top:12px;font-size:12px;padding:7px 13px;
}
html.view-mobile .hero .btn,
html.view-mobile .hero button{margin-top:12px}
html.view-mobile .hero .row{margin-top:12px;gap:8px;flex-wrap:wrap}
html.view-mobile h2{font-size:17px}
html.view-mobile h3{font-size:14.5px}
html.view-mobile .muted{font-size:11.5px}
html.view-mobile .footer-note{font-size:11px;line-height:1.6;margin-top:18px}
html.view-mobile .date-badge{display:block;margin-top:10px;font-size:11.5px}

/* ---------- 卡片与分节 ---------- */
html.view-mobile .card{
 border-radius:var(--mb-r);padding:16px 15px;margin-bottom:0;
 box-shadow:0 8px 22px #2b21600d;
}
html.view-mobile #app>section,
html.view-mobile #app>div{margin-bottom:14px}
html.view-mobile .section-title{
 display:block;margin:20px 0 11px;
}
html.view-mobile .section-title h2{margin-bottom:9px}
html.view-mobile .section-title .row{
 display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-start;
}
html.view-mobile .section-title .row input[type=date]{flex:1 1 128px;min-width:0}
html.view-mobile .group-heading{font-size:14px;margin:22px 0 10px}
html.view-mobile .hint,
html.view-mobile .preview{font-size:12px;border-radius:14px}

/* ---------- 打卡条 ---------- */
html.view-mobile .vibe{
 display:grid;grid-template-columns:auto 1fr;gap:11px 13px;
 margin:0 0 14px;padding:15px 15px 13px;border-radius:var(--mb-r);
}
html.view-mobile .vibe .flame{font-size:30px}
html.view-mobile .vibe>div:nth-child(2){gap:9px!important;flex-direction:column;align-items:flex-start!important}
html.view-mobile .vibe .streak strong{font-size:19px;line-height:1.3}
html.view-mobile .vibe .streak small{font-size:11px;line-height:1.5}
html.view-mobile .vibe .quote{
 grid-column:1/-1;font-size:12.5px;line-height:1.6;padding-left:12px;border-left-width:3px;
}
html.view-mobile .vibe .quote small{font-size:10.5px}
html.view-mobile .vibe .week{grid-column:1/-1;display:flex;justify-content:space-between;gap:5px}
html.view-mobile .vibe .week span{flex:1;height:30px;width:auto;border-radius:10px;font-size:11.5px}

/* ---------- 数字看板 ---------- */
html.view-mobile .stats{
 display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:14px 0 4px;
}
html.view-mobile .stats>div{padding:11px 12px;border-radius:14px}
html.view-mobile .stats strong{font-size:21px}
html.view-mobile .stats span{font-size:10.5px}
html.view-mobile .stats>div:nth-child(3):last-child{grid-column:1/-1}
html.view-mobile .expect-grid{
 grid-template-columns:1fr 1fr;gap:9px;margin:0 0 14px;
}
html.view-mobile .expect{padding:12px 13px;border-radius:16px}
html.view-mobile .expect-label{font-size:10px;letter-spacing:0}
html.view-mobile .expect strong{font-size:21px;margin:5px 0 1px}
html.view-mobile .expect small{font-size:10.5px;line-height:1.45;display:block}
html.view-mobile .reality-grid{grid-template-columns:1fr 1fr;gap:9px;margin:0 0 14px}
html.view-mobile .reality-box{padding:11px 12px;border-radius:15px}
html.view-mobile .reality-box strong{font-size:18px}
html.view-mobile .reality-box small{font-size:10px;display:block;line-height:1.45}
html.view-mobile .progress-label{font-size:10.5px}
html.view-mobile progress{height:8px}

/* ---------- 控件尺寸：避免误触与 iOS 自动缩放 ---------- */
html.view-mobile button,
html.view-mobile .btn{
 min-height:40px;padding:9px 14px;border-radius:13px;font-size:13px;
}
html.view-mobile button.small,
html.view-mobile .btn.small{min-height:36px;padding:7px 11px;font-size:12px}
html.view-mobile button.ghost{min-height:36px}
html.view-mobile input,
html.view-mobile select,
html.view-mobile textarea{
 font-size:16px;border-radius:13px;padding:10px 12px;min-height:var(--mb-tap);
}
html.view-mobile input[type=checkbox]{width:22px;height:22px;min-height:0}
html.view-mobile textarea{min-height:84px;line-height:1.6}
html.view-mobile label.field{font-size:11.5px;margin-bottom:13px}
html.view-mobile .form-grid{grid-template-columns:1fr;gap:11px}
html.view-mobile .row{gap:9px;flex-wrap:wrap}

/* ---------- 任务清单 ---------- */
html.view-mobile .task{
 display:grid;grid-template-columns:24px 1fr;gap:4px 11px;align-items:start;
 padding:13px 11px;margin:9px 0;border-radius:16px;
 background:#fcfbff;border:1px solid #efecfb;
}
html.view-mobile .task:last-child{border-bottom:1px solid #efecfb}
html.view-mobile .task.done{background:#f3fbf7;border-color:#dcf2e8}
html.view-mobile .task input[type=checkbox]{margin-top:2px}
html.view-mobile .task .grow{min-width:0}
html.view-mobile .task-title{font-size:14.5px;line-height:1.5;font-weight:600}
html.view-mobile .task-meta{gap:5px;margin-top:7px}
html.view-mobile .task-meta .time{font-size:10.5px}
html.view-mobile .chip-kind,
html.view-mobile .chip-mod,
html.view-mobile .chip-q{font-size:9.5px;padding:3px 7px}
html.view-mobile .task-right{
 grid-column:2/-1;width:100%;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-start;
 margin-top:10px;padding-top:10px;border-top:1px dashed #e7e2fa;
}
html.view-mobile .task-right .score-input{width:62px;min-height:38px;padding:7px 6px}
html.view-mobile .task-right small{font-size:10.5px}
html.view-mobile .task-right button{min-height:36px;padding:7px 10px;font-size:12px}
html.view-mobile .task .btn.small{min-height:36px}
html.view-mobile .day-goal{
 flex-wrap:wrap;gap:8px;font-size:12.5px;padding:11px 13px;border-radius:14px;
}
html.view-mobile .day-goal span{flex:1 1 100%}
html.view-mobile .stat-strip{gap:12px;font-size:11px}

/* ---------- 资料 / 日程列表 ---------- */
html.view-mobile .list-row{
 display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;
 padding:12px 10px;border-radius:15px;border-bottom:1px solid var(--line);
}
html.view-mobile .list-row .file-icon{width:34px;height:38px;font-size:17px}
html.view-mobile .list-row .name{
 flex:1 1 calc(100% - 52px);min-width:0;font-size:14px;line-height:1.45;
}
html.view-mobile .list-row .name small{font-size:10.5px;margin-top:3px}
html.view-mobile .list-row>small,
html.view-mobile .list-row>span:not(.file-icon):not(.name){font-size:10.5px}
html.view-mobile .list-row>button,
html.view-mobile .list-row>.btn{min-height:36px;padding:7px 12px;font-size:12px}
html.view-mobile .list-row .folder-click{text-align:left;font-weight:600}
html.view-mobile .mod-row{padding:13px 0}
html.view-mobile .mod-top{gap:8px}
html.view-mobile .mod-name{font-size:13.5px}
html.view-mobile .mod-count{font-size:11px}
html.view-mobile .mod-foot{gap:9px;font-size:10.5px}
html.view-mobile .mod-grid{grid-template-columns:1fr;gap:11px}
html.view-mobile .mod-card{padding:13px 15px}

/* ---------- 表格：横向滚动 + 首列吸附 ---------- */
html.view-mobile .acc-table{
 display:block;overflow-x:auto;white-space:nowrap;font-size:11px;
 -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
}
html.view-mobile .acc-table th,
html.view-mobile .acc-table td{padding:8px 7px}
html.view-mobile .acc-table th:first-child,
html.view-mobile .acc-table td:first-child{
 position:sticky;left:0;z-index:1;background:#fff;
 box-shadow:1px 0 0 var(--line);min-width:84px;
}
html.view-mobile .week-table td{min-width:66px}
html.view-mobile .week-table .cell-rate{font-size:12px}
html.view-mobile .week-table .cell-sub{font-size:9px;white-space:normal;line-height:1.35}

/* ---------- 准确率折线图 ---------- */
html.view-mobile .trend{margin:10px -4px 4px}
/* 图表按 viewBox 等比缩放，所以字号和线宽要按比例放大才看得清 */
html.view-mobile .trend .tick{font-size:21px}
html.view-mobile .trend .series{stroke-width:4.5}
html.view-mobile .trend .target-line{stroke-width:3.5;stroke-dasharray:9 7}
html.view-mobile .trend .dot{stroke-width:2.5}
html.view-mobile .trend .grid,
html.view-mobile .trend .axis{stroke-width:1.6}
html.view-mobile .trend-filters{
 justify-content:flex-start;width:100%;margin-top:8px;gap:6px;
}
html.view-mobile .trend-filters button{min-height:34px;padding:6px 10px;font-size:11.5px}
html.view-mobile .trend-legend{gap:6px}
html.view-mobile .legend-chip{font-size:11px;padding:7px 11px;min-height:34px}
html.view-mobile #trendCard>.row{display:block}

/* ---------- 弹窗：底部抽屉 ---------- */
html.view-mobile dialog{
 width:min(var(--mb-shell),100%);max-width:100%;margin:0 auto;top:auto;bottom:0;left:0;right:0;
 border:0;border-radius:22px 22px 0 0;padding:10px 16px calc(20px + env(safe-area-inset-bottom));
 max-height:90vh;max-height:90dvh;box-shadow:0 -14px 44px #2b216033;
 animation:mb-sheet .26s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes mb-sheet{from{transform:translateY(14%);opacity:.6}to{transform:none;opacity:1}}
html.view-mobile dialog::backdrop{background:#182b2259;-webkit-backdrop-filter:blur(3px)}
html.view-mobile dialog::before{
 content:'';display:block;width:40px;height:4px;border-radius:99px;
 background:#e2ddf2;margin:2px auto 14px;
}
html.view-mobile dialog h2{font-size:17px;margin-bottom:14px}
html.view-mobile .dialog-actions{
 position:sticky;bottom:0;gap:9px;margin-top:18px;padding:11px 0 2px;
 background:linear-gradient(180deg,#ffffffd9,#fff 35%);
}
html.view-mobile .dialog-actions button{flex:1;min-height:46px;font-size:14px}
html.view-mobile .pick-list{max-height:52vh;border-radius:14px}
html.view-mobile .pick-folder-row,
html.view-mobile .pick-file-row{font-size:12.5px;min-height:46px;padding-right:10px}
html.view-mobile .pick-disclosure{min-height:34px;min-width:30px}
html.view-mobile .journal-history{font-size:12px}

/* ---------- 提示条 ---------- */
html.view-mobile #toast{
 left:50%;right:auto;transform:translateX(-50%);
 width:min(calc(var(--mb-shell) - 28px),calc(100% - 28px));max-width:none;
 bottom:calc(var(--mb-bar) + 12px + env(safe-area-inset-bottom));
 font-size:12.5px;padding:11px 14px;text-align:center;
}

/* ---------- 大专题 / 小专题卡片 ---------- */
html.view-mobile .grid2,
html.view-mobile .grid3,
html.view-mobile .home-bottom,
html.view-mobile .library-grid{grid-template-columns:1fr;gap:12px}
html.view-mobile .library-tree{display:none}
html.view-mobile .subject-card{min-height:0;padding:20px 18px}
html.view-mobile .subject-card h2{font-size:22px}
html.view-mobile .subject-card p{max-width:100%;font-size:11.5px}
html.view-mobile .subject-card .letter,
html.view-mobile .subject-card.gold .letter{font-size:72px;right:16px;top:8px}
html.view-mobile .topic-card{padding:16px 15px}
html.view-mobile .topic-card .muted{min-height:0}
html.view-mobile .topic-card .topic-emoji{font-size:24px;right:13px;top:11px}

/* ---------- 学习区：上下排列，不再左右分栏 ---------- */
html.view-mobile .desk,
html.view-mobile .desk.dual{grid-template-columns:1fr;gap:12px}
html.view-mobile .desk.dual .card{padding:14px 13px}
html.view-mobile .desk.dual h3{font-size:14.5px}
html.view-mobile .pane select{margin:8px 0 12px}
html.view-mobile .pane .stage,
html.view-mobile .desk.dual .stage{
 height:46vh;height:46dvh;min-height:210px;border-radius:14px;
}
html.view-mobile .pane .controls{gap:7px;font-size:11.5px;margin:11px 0}
html.view-mobile .pane .controls input{width:70px}
html.view-mobile .pane .controls button{min-height:38px}
html.view-mobile .pane .controls small{flex:1 1 100%;font-size:10.5px}
html.view-mobile .large-file-info{padding:18px 12px}
html.view-mobile .large-file-info strong{font-size:16px}
html.view-mobile .large-file-info p{font-size:11.5px}
html.view-mobile .large-file-info button{width:100%}

/* ---------- PDF 阅读 ---------- */
html.view-mobile .pdf-tools{gap:6px;margin:2px 0 9px}
html.view-mobile .pdf-tools button{min-height:36px;padding:7px 10px;font-size:12px}
html.view-mobile .pdf-tools small{flex:1 1 100%;font-size:10px}
html.view-mobile .pane .stage.pdf-stage,
html.view-mobile .desk.dual .stage.pdf-stage{
 height:calc(100vh - 300px);height:calc(100dvh - 300px);min-height:340px;
}
html.view-mobile body.pdf-focus .pane .stage.pdf-stage{
 height:calc(100vh - 86px);height:calc(100dvh - 86px);
}
html.view-mobile body.pdf-focus #app{padding:8px 8px 14px}

/* ---------- 网盘与资料库 ---------- */
html.view-mobile .trail{
 gap:6px;margin-bottom:14px;font-size:11.5px;
 overflow-x:auto;white-space:nowrap;flex-wrap:nowrap;padding-bottom:2px;
}
html.view-mobile .trail button{min-height:32px;padding:4px 2px;font-size:11.5px}
html.view-mobile .import-bar{
 display:block;padding:14px;border-radius:16px;
}
html.view-mobile .import-bar strong{font-size:14px}
html.view-mobile .import-bar .muted{margin-top:4px}
html.view-mobile .import-bar .row{margin-top:12px;gap:8px}
html.view-mobile .import-bar select{flex:1 1 100%}
html.view-mobile .import-bar .row button{flex:1 1 100%}
html.view-mobile .job-message{font-size:12px;border-radius:14px}
html.view-mobile details summary{min-height:38px;padding:8px 0;font-size:12px}

/* ---------- 登录页（无 JS 判定，按宽度适配） ---------- */
@media (max-width:820px){
 .login{padding:24px 20px;border-radius:22px}
 .login h1{font-size:22px}
 .login input{font-size:16px;min-height:44px}
 .login button{min-height:46px;font-size:15px}
}
