/* ============================================================
   三科共用布局：侧边栏 + 顶栏 + 仪表盘式首页
   与语文页布局保持一致；只使用 sh- 前缀，避免干扰各科原有样式
   ============================================================ */
.sh-shell{display:flex;min-height:100vh}

/* ---------- 侧边栏 ---------- */
.sh-sidebar{
  width:238px;flex:none;background:#fff;border-right:1px solid #e8ebf2;
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;z-index:30;
}
.sh-brand{display:flex;align-items:center;gap:11px;padding:26px 22px 30px}
.sh-brand-mark{
  width:40px;height:40px;border-radius:12px;flex:none;
  background:linear-gradient(135deg,#6d6de8,#4a49bd);color:#fff;
  display:grid;place-items:center;font-size:20px;font-weight:700;
  box-shadow:0 6px 14px rgba(91,91,214,.35);
}
.sh-shell[data-subject="math"] .sh-brand-mark{background:linear-gradient(135deg,#6f8bff,#3f5bd8);box-shadow:0 6px 14px rgba(79,110,247,.35)}
.sh-shell[data-subject="english"] .sh-brand-mark{background:linear-gradient(135deg,#7b6ce8,#4b48c4);box-shadow:0 6px 14px rgba(91,91,214,.35)}
.sh-brand-title{font-size:17px;font-weight:700;letter-spacing:.5px}
.sh-brand-sub{font-size:11px;color:#8790a6;margin-top:2px;letter-spacing:1px}

.sh-nav{display:flex;flex-direction:column;gap:5px;padding:0 12px;flex:1;overflow-y:auto}
.sh-nav-item{
  display:flex;align-items:center;gap:12px;width:100%;padding:12px 13px;border-radius:11px;
  color:#64708a;font-size:14px;font-weight:500;transition:.18s;text-align:left;
  border:none;background:none;font-family:inherit;cursor:pointer;
}
.sh-nav-item:hover{background:#f6f7fc;color:#5b5bd6}
.sh-nav-item.active{background:#eef0ff;color:#5b5bd6;font-weight:600}
.sh-shell[data-subject="math"] .sh-nav-item:hover,
.sh-shell[data-subject="math"] .sh-nav-item.active{color:#4f6ef7}
.sh-shell[data-subject="math"] .sh-nav-item.active{background:#eef2ff}
.sh-shell[data-subject="english"] .sh-nav-item:hover,
.sh-shell[data-subject="english"] .sh-nav-item.active{color:#5b5bd6}
.sh-nav-icon{width:22px;height:22px;display:grid;place-items:center;flex:none}
.sh-nav-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sh-nav-badge{
  margin-left:auto;background:#e04848;color:#fff;font-size:11px;font-weight:700;
  min-width:20px;height:20px;border-radius:10px;display:grid;place-items:center;padding:0 5px;
}
.sh-nav-badge.zero{background:#d8dce8}
.sh-nav-badge.ai{background:#5b5bd6}
.sh-side-foot{padding:14px}
.sh-tip-card{background:linear-gradient(150deg,#f0f1ff,#f8f8ff);border:1px solid #e6e8ff;border-radius:14px;padding:15px}
.sh-tip-icon{font-size:20px}
.sh-tip-title{font-size:13px;font-weight:700;margin-top:8px}
.sh-tip-desc{font-size:11px;color:#8790a6;margin-top:4px;line-height:1.5}

/* ---------- 主区域 / 顶栏 ---------- */
.sh-main{flex:1;min-width:0}
.sh-topbar{
  height:68px;background:rgba(255,255,255,.9);backdrop-filter:blur(8px);border-bottom:1px solid #e8ebf2;
  display:flex;align-items:center;padding:0 30px;gap:14px;position:sticky;top:0;z-index:20;
}
.sh-topbar-title{font-size:16px;font-weight:700}
.sh-topbar-right{margin-left:auto;display:flex;align-items:center;gap:16px}
.sh-date-chip{font-size:12px;color:#8790a6;background:#f4f5fa;padding:7px 13px;border-radius:20px;white-space:nowrap}
.sh-avatar{
  width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#ffd08a,#f4a259);
  color:#fff;display:grid;place-items:center;font-weight:700;font-size:14px;flex:none;
}
.sh-menu-btn{display:none;width:34px;height:34px;border-radius:9px;place-items:center;background:#f4f5fa}
.sh-menu-btn svg{width:20px;height:20px;fill:none;stroke:#64708a;stroke-width:1.8;stroke-linecap:round}
.sh-content{padding:28px 30px 50px;max-width:1240px;margin:0 auto}
/* 原有页面里的 .container 只留作兼容，宽度交给 sh-content */
.sh-content .container{max-width:none;margin:0;padding:0}
.sh-content .app{max-width:none;margin:0;padding:0}

/* ---------- 首页：欢迎横幅 ---------- */
.sh-welcome{
  position:relative;overflow:hidden;border-radius:20px;padding:30px 36px;margin-bottom:22px;
  background:linear-gradient(120deg,#5b5bd6 0%,#7069e0 55%,#8b7ee8 100%);color:#fff;
  display:flex;align-items:center;justify-content:space-between;min-height:198px;
}
.sh-shell[data-subject="math"] .sh-welcome{background:linear-gradient(120deg,#4f6ef7 0%,#6b78ea 55%,#8b7ee8 100%)}
.sh-eyebrow{font-size:11px;letter-spacing:3px;opacity:.7;font-weight:600}
.sh-welcome-text h1{font-size:27px;font-weight:800;margin:10px 0 8px}
.sh-welcome-text .wave{font-size:23px}
.sh-welcome-text p{font-size:13px;opacity:.85;line-height:1.6}
.sh-welcome-actions{display:flex;gap:10px;margin-top:18px;flex-wrap:wrap}
.sh-welcome-art{position:relative;width:230px;height:170px;flex:none}
.sh-art-circle{position:absolute;border-radius:50%;background:rgba(255,255,255,.09)}
.sh-art-circle.c1{width:180px;height:180px;right:-10px;top:-25px}
.sh-art-circle.c2{width:120px;height:120px;right:80px;bottom:-40px}
.sh-art-card{
  position:absolute;right:38px;top:24px;width:104px;height:128px;background:#fff;border-radius:12px;
  transform:rotate(9deg);box-shadow:0 14px 30px rgba(40,30,110,.25);padding:12px;
}
.sh-art-char{font-size:44px;color:#5b5bd6;font-weight:800;text-align:center;line-height:1.15}
.sh-shell[data-subject="math"] .sh-art-char{color:#4f6ef7}
.sh-art-lines{margin-top:8px;display:flex;flex-direction:column;gap:7px}
.sh-art-lines i{height:5px;border-radius:3px;background:#e8e9f8;display:block}
.sh-art-lines i:nth-child(2){width:80%}
.sh-art-lines i:nth-child(3){width:60%}
.sh-art-pencil{position:absolute;right:10px;bottom:14px;font-size:34px;transform:rotate(-18deg)}

/* ---------- 首页：入口提示条 ---------- */
.sh-entry{
  display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:14px;
  background:linear-gradient(120deg,#f7f9ff,#fbf9ff);border:1px solid #e9ecfb;margin-bottom:20px;
}
.sh-entry-mark{
  width:40px;height:40px;border-radius:11px;flex:none;display:grid;place-items:center;
  background:#eef0ff;color:#5b5bd6;font-size:15px;font-weight:800;
}
.sh-shell[data-subject="math"] .sh-entry-mark{background:#eef2ff;color:#4f6ef7}
.sh-entry-copy{flex:1;min-width:0}
.sh-entry-copy strong{font-size:14px;font-weight:700}
.sh-entry-copy p{font-size:12px;color:#8790a6;margin-top:4px;line-height:1.6}
.sh-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:10px 18px;border-radius:10px;font-size:13px;font-weight:600;white-space:nowrap;
  border:1px solid transparent;cursor:pointer;font-family:inherit;transition:.18s;
}
.sh-btn-primary{background:#5b5bd6;color:#fff;box-shadow:0 4px 12px rgba(91,91,214,.24)}
.sh-btn-primary:hover{background:#4a49bd;transform:translateY(-1px)}
.sh-shell[data-subject="math"] .sh-btn-primary{background:#4f6ef7;box-shadow:0 4px 12px rgba(79,110,247,.24)}
.sh-shell[data-subject="math"] .sh-btn-primary:hover{background:#3a55d9}
.sh-btn-light{background:#fff;color:#5b5bd6;border-color:rgba(255,255,255,.5)}
.sh-btn-light:hover{background:rgba(255,255,255,.16);color:#fff}
.sh-btn-outline{background:#fff;color:#5b5bd6;border-color:#dfe2f2}
.sh-btn-outline:hover{border-color:#5b5bd6}
.sh-link{color:#5b5bd6;font-size:13px;font-weight:600;background:none;border:none;cursor:pointer;font-family:inherit}
.sh-link:hover{text-decoration:underline}

/* ---------- 首页：统计与卡片区 ---------- */
.sh-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.sh-stat-card{
  background:#fff;border:1px solid #e8ebf2;border-radius:16px;padding:18px;
  display:flex;gap:14px;align-items:center;box-shadow:0 4px 24px rgba(29,36,66,.06);
}
.sh-stat-icon{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;flex:none;font-size:22px;background:#eef0ff;color:#5b5bd6}
.sh-stat-icon.green{background:#e8f7ee;color:#16a34a}
.sh-stat-icon.red{background:#fdecec;color:#e04848}
.sh-stat-icon.amber{background:#fff5e4;color:#e79b21}
.sh-stat-label{font-size:12px;color:#8790a6}
.sh-stat-value{font-size:24px;font-weight:800;margin-top:3px}
.sh-stat-value small{font-size:12px;font-weight:500;color:#8790a6;margin-left:3px}
/* 英语页由 EngAI.renderHome 写入 .eh-stat，在这里统一外观 */
.sh-stat-grid .eh-stat{
  background:#fff;border:1px solid #e8ebf2;border-radius:16px;padding:18px 22px;
  display:flex;flex-direction:column;justify-content:center;align-items:flex-start;
  box-shadow:0 4px 24px rgba(29,36,66,.06);text-align:left;margin:0;
}
.sh-stat-grid .eh-stat b{font-size:24px;line-height:1.2;color:#5b5bd6}
.sh-stat-grid .eh-stat span{font-size:12px;color:#8790a6;margin-top:4px}
.sh-stat-grid .eh-stat.warn b{color:#e79b21}
.sh-stat-grid .eh-stat.bad b{color:#e04848}

.sh-feature-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.sh-feature-grid .mode-card,
.sh-feature-grid .big-btn{
  width:100%;min-height:170px;padding:22px;text-align:left;border:1px solid #e8ebf2;
  border-radius:16px;background:#fff;box-shadow:0 4px 24px rgba(29,36,66,.06);
  display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;
  cursor:pointer;transition:.18s;position:relative;overflow:hidden;
}
.sh-feature-grid .mode-card:hover,
.sh-feature-grid .big-btn:hover{transform:translateY(-2px);border-color:#b9baf0;box-shadow:0 10px 28px rgba(29,36,66,.1)}
.sh-feature-grid .mode-card.daily{background:linear-gradient(135deg,#ffffff 58%,#fff9e6 100%)}
.sh-feature-grid .mode-card.oral{background:linear-gradient(135deg,#ffffff 58%,#eef3ff 100%)}
.sh-feature-grid .mode-card.steps{background:linear-gradient(135deg,#ffffff 58%,#fff1ec 100%)}
.sh-feature-grid .mode-card .icon,
.sh-feature-grid .big-btn .icon{font-size:34px;margin-bottom:12px;line-height:1}
.sh-feature-grid .mode-card h3,
.sh-feature-grid .big-btn .t{font-size:17px;font-weight:700;margin:0}
.sh-feature-grid .mode-card p,
.sh-feature-grid .big-btn .d{font-size:12.5px;line-height:1.7;color:#8790a6;margin-top:9px;display:block}
.sh-feature-grid .big-btn .badge{top:12px;right:12px}
.sh-panel{
  background:#fff;border:1px solid #e8ebf2;border-radius:16px;padding:22px;
  box-shadow:0 4px 24px rgba(29,36,66,.06);margin-bottom:20px;
}
.sh-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.sh-panel-head h2{font-size:16px;font-weight:700}
.sh-panel-head p{font-size:12px;color:#8790a6;margin-top:4px}

/* ---------- 响应式 ---------- */
@media(max-width:1024px){
  .sh-stat-grid{grid-template-columns:repeat(2,1fr)}
  .sh-feature-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:760px){
  .sh-sidebar{position:fixed;left:-260px;transition:left .25s;box-shadow:8px 0 30px rgba(0,0,0,.12)}
  .sh-sidebar.open{left:0}
  .sh-menu-btn{display:grid}
  .sh-topbar{padding:0 16px}
  .sh-content{padding:20px 16px 40px}
  .sh-date-chip{display:none}
  .sh-welcome{padding:24px 20px;min-height:0}
  .sh-welcome-art{display:none}
  .sh-welcome-text h1{font-size:22px}
  .sh-welcome-actions .sh-btn{flex:1}
  .sh-entry{align-items:flex-start;flex-wrap:wrap}
  .sh-entry .sh-btn{width:100%}
  .sh-stat-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .sh-stat-card,.sh-stat-grid .eh-stat{padding:13px;gap:10px}
  .sh-stat-icon{width:38px;height:38px;font-size:18px}
  .sh-feature-grid{grid-template-columns:1fr}
  .sh-feature-grid .mode-card,.sh-feature-grid .big-btn{min-height:0}
}
