/* 岚峰启点 v1.0 - 导航页样式
   v1.7.28（批 4 之 4-D）三处口径，改这个文件前先读一遍：
   ① 断点只有 480 / 640 / 900 三档（方案 §2.0「存量并档」），桌面档写成 min-width: 901px；
   ② 底部三件套（学习/计划/我的）是 6 个首页共有的一份外观，六个仓里逐字同款；
   ③ 全页只留**一条** sticky —— 顶部那条身份条。
      老版本这里有两个 sticky 都钉 top:0（页头 z-index 101 压身份条 z-index 100），
      滚起来身份条被页头盖住，页面上完全看不出来（"点不着"那类怪事就是这么来的）。 */

/* ===== CSS 变量 ===== */
:root {
    --touch-min: 44px;   /* ≤900 档的触控目标（方案第 13 条） */
    --bb-h: 58px;        /* 底栏高度：底栏本体与 body 让位共用这一个数，不许各写各的 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 有底栏的页必须带这个 class（三个主界面页都是无条件的）。
   让位那一行承重：少了它，页尾内容被 fixed 底栏压住，滚到底也翻不出来。
   不用 `body:has(.bottom-bar)`：:has() 要较新的浏览器，家长手机上有旧安卓。 */
body.has-bottom-bar {
    padding-bottom: calc(var(--bb-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

.container {
    max-width: 700px;
    width: 90%;
    padding: 40px 20px;
}

/* ===== 全局返回导航的容器（批 13 · 72 方案 §4）=====
   网关四族页面共用同一条白带 `.gw-backstrip`；这一份给 **style.css 这一族**
   （计划 / 我的 / 设置 / 收藏本六页）。guide.css 里还有一份**逐字相同**的
   `.gw-backstrip` —— 两个文件不会被同一族页面同时用到，但 jingdang 那几页
   两个都加载（两份一模一样，谁在后面都行）。两处唯一的差别在“怎么顶到窗口边”：
   这一族靠 body 竖排（下面 `body.has-appbar`），那一族靠负外边距。
   ⚠️ 白带里装的是四仓逐字节相同的 `.backbar`（文件末尾那一块），所以**不要**再写
      `.gw-backstrip a { ... }` 这种后代选择器 —— 特异性(0,1,1)会盖掉
      `.backbar-btn`(0,1,0) 的 13.5px/400/#2f46c8，网关就跟另外三个应用长得不一样了。
      （批 13 之前这里住的是 `.gw-appbar`，它那条 `.gw-appbar a` 正是这种写法，
        连同 `.gw-appbar` 本尊一起退役，见 favfolders.css 文件头那条注释。） */
.gw-backstrip {
    position: sticky; top: 0; z-index: 210;
    width: 100%;
    display: flex; align-items: center;
    min-height: 54px; padding: 0 6px; box-sizing: border-box;
    background: #fff; border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ⚠️ ★ 第 5 轮 r5（2026-10-12）：用白带的页，`<body>` **必须**同时带 `has-appbar`。
   来路：本文件上方的 body 是 `display:flex; align-items:center; justify-content:
   center`（那是为了把 .container 居中）。顶上白带一加，就成了**那一行 flex 里的
   第二个格子**：白带被挤成“跟字一样宽”（闸门量出来 102px，不是窗口宽 390），
   内容也被它挤到旁边去 —— 屏幕上看着就是“顶上那条返回短了一截、下面内容也窄了”。
   `has-appbar` 把这几页的 body 换成**竖排**：白带独占一整行（width: 100%），
   内容照旧在下一行居中。
   （不用 `body:has(.gw-backstrip)` —— 与 style.css 文件头同一条规矩：:has() 要较新
    的浏览器，家长手机上有旧安卓。写成显式 class：哪一页漏了，闸门那条“宽 == 窗口宽”
    当场就红。） */
body.has-appbar {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
/* 顶上有这条白带了 ⇒ .container 那 40px 头上留白就太多（那条是给渐变页头留的） */
body.has-appbar .container { padding-top: 16px; }
/* 设置页的 .settings-container 在模板里写着 `margin: 40px auto` —— 同理收一收。
   （模板里那条的 <style> 在 <head>，但比的是特异性：这里多一层 `body.has-appbar`。） */
body.has-appbar .settings-container { margin-top: 16px; }

/* ===== 全局返回导航（《72-全局返回导航方案》§3.2）=====
   ⚠️ 这一块在四个应用里**逐字相同**（tools/check_backnav.py 会比对）。
      改之前先看方案 §3.2：13.5px/400、触摸 ≥44px、行内不换行、文字最多 6em 后省略。
   ⚠️ 这是**导航**，不是动作：取消 / 关闭 / 停止识别 / 上一步 / 重来 一律不套这套类。 */
.backbar { display:flex; align-items:center; gap:8px; margin:0; padding:0; }
.backbar-btn { display:inline-flex; align-items:center; gap:4px;
  min-height:44px; padding:0 10px; border-radius:8px;
  font:400 13.5px/1 "Microsoft YaHei","PingFang SC",sans-serif;
  color:#2f46c8; text-decoration:none; white-space:nowrap; }
.backbar-btn:hover,
.backbar-btn:focus-visible { background:#eef1fb; color:#1f2f9e; outline:none; }
.backbar-btn[aria-disabled="true"] { color:#b9bfd4; pointer-events:none; }
.backbar-ico { font-size:14px; line-height:1; }
.backbar-label { min-width:0; max-width:6em; overflow:hidden; text-overflow:ellipsis; }

/* 页头：老的 sticky / z-index / 负外边距整套删掉（见文件头 ③）。
   背景本来就和 body 同一个渐变，那条"全宽色带"只是给 sticky 用的。 */
header.nav-header {
    text-align: center;
    margin-bottom: 26px;
}

header h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
}

/* ===== 身份条（学习页顶部；全页唯一 sticky） ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255,255,255,0.14);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.user-info {
    color: rgba(255,255,255,0.95);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-info .phone { font-weight: 600; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin { background: rgba(255,255,255,0.3); color: #fff; }
.badge-class { background: rgba(255,255,255,0.25); color: #fff; }

.top-bar a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 8px;
    transition: background 0.2s;
}

.top-bar a:hover { background: rgba(255,255,255,0.2); }

/* ★ 1114：管理员年级预览 —— 身份条最右一组：下拉 + 「预览：四年级 ×」+ 管理后台。 */
.top-bar-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-grade-switch {
    min-height: 32px;
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 8px;
    background: rgba(255,255,255,0.94);
    color: #33364a;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.admin-grade-preview {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 10px;
    border-radius: 999px;
    background: #fff3cd;
    color: #7a5a12;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.admin-grade-reset {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(122,90,18,0.14);
    color: #7a5a12;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.admin-grade-reset:hover { background: rgba(122,90,18,0.24); }

.class-switch { position: relative; display: inline-block; }

.profile-switch {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 200;
    min-width: 120px;
    overflow: hidden;
    margin-top: 4px;
}

.profile-switch a { color: #333 !important; padding: 8px 16px !important; white-space: nowrap; }
.profile-switch a:hover { background: #f0f0f0 !important; }
.profile-switch.show { display: block !important; }

/* ===== 底部三件套（37 页表第 0 条：📚 学习 · 🗓 计划 · 👤 我的） =====
   六个首页（网关 3 + 三个子应用首页）同一份：三颗、顺序、emoji、文字都一样。
   ⚠️ 子应用那三页是各自仓里的模板（不共享文件），改这里请一起改那三处，
      四把"底栏对表"闸门会逐字核。 */
.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    min-height: var(--bb-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #e7e7f2;
    box-shadow: 0 -2px 14px rgba(48, 44, 92, 0.1);
}

.bottom-bar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--touch-min);
    color: #8b90a6;
    text-decoration: none;
    font-size: 0.72rem;
}

.bottom-bar a .i { font-size: 1.3rem; line-height: 1.1; }
.bottom-bar a .t { font-weight: 600; }
.bottom-bar a.on { color: #667eea; }

/* ★ 1024 第 01②（用户原话「底下的 自主+1000词 按钮在手机和pad端都要突出点」）：
   首页底栏中间那颗做成**实心主色 CTA**，左右两颗仍是灰色导航项 —— 手机与 pad
   同一套（不写断点）。高度压在底栏里（上下各留 5px），不把底栏撑高；
   `flex: 1.35` 让它比旁边两颗略宽，视觉重心落在它身上。
   ⚠️ 只加在 templates/_bottom_bar.html 的**首页分支**那一颗上；
      三个子应用首页的底栏是各自仓里的模板（对表闸门只核 emoji/文字/顺序/href），
      这一颗是网关首页独有的「自主+1000词」，不跨仓。 */
.bottom-bar a.bb-cta {
    flex: 1.35 1 0;
    align-self: center;
    min-height: calc(var(--bb-h) - 10px);
    margin: 5px 6px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 0.78rem;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.38);
}
.bottom-bar a.bb-cta .i { font-size: 1.45rem; }
.bottom-bar a.bb-cta .t { font-weight: 800; }
.bottom-bar a.bb-cta:active { transform: translateY(1px); }

/* ===== 登录提示条（未登录时的学习页） ===== */
.login-prompt {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.14);
    border-radius: 12px;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.92);
    font-size: 0.9rem;
}

.login-prompt a { color: #fff; font-weight: 600; margin: 0 4px; }

/* ===== 通用按钮（页内主/次动作，≥44px 触摸目标） ===== */
.tap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--touch-min);
    padding: 0 18px;
    border-radius: 12px;
    border: 2px solid #dcdcf0;
    background: #f7f7fd;
    color: #4a4f63;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.tap-btn.primary {
    border-color: transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* ===== 助手卡列表 ===== */
.assistant-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.assistant-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 5px solid var(--card-color);
    position: relative;
    overflow: hidden;
}

.assistant-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.assistant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.assistant-card:hover::after { opacity: 0.03; }

.card-icon {
    font-size: 2.8rem;
    margin-right: 22px;
    flex-shrink: 0;
    width: 60px;
    text-align: center;
}

.card-info { flex: 1; }
.card-info h2 { font-size: 1.25rem; margin-bottom: 4px; color: #222; }
.card-info p { font-size: 0.9rem; color: #666; line-height: 1.4; }

.card-arrow {
    font-size: 1.5rem;
    color: #aaa;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s;
}

.assistant-card:hover .card-arrow { transform: translateX(4px); color: #666; }

/* ★ 1018 第二轮（2026-10-18）：文迹卡的「即将上线」角标（卡片右上角）。
   `.assistant-card` 本身是 position:relative + overflow:hidden，这里只定位这一颗。 */
.card-soon {
    position: absolute; top: 10px; right: 12px;
    background: #e8f7ef; color: #0f7a4d;
    border: 1px solid #bfe8d2; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; padding: 2px 8px;
    z-index: 1;
}

.assistant-card.locked { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

@media (max-width: 480px) {
    .card-soon { top: 8px; right: 10px; font-size: 0.68rem; }
}

/* ===== 白色内容卡（计划页 / 我的页共用） ===== */
.panel-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.panel-card h2 {
    font-size: 1.02rem;
    color: #333;
    margin-bottom: 10px;
}

.panel-card p {
    font-size: 0.9rem;
    color: #61667c;
    line-height: 1.6;
}

.panel-card .num { font-weight: 700; color: #333; }

footer {
    margin-top: 50px;
    text-align: center;
}

.hint {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 6px;
}

.hint code {
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ===== 两档布局（第 13 条：900 是布局界；>900 起两栏） =====
   ≤900：单栏；>900：主列 + 侧栏。侧栏在手机上 display:none ——
   侧栏里的数字与主列是**同一份**（同一个 JS 结果写两处），不是两套数据。 */
.page-cols { display: block; }
.page-main { min-width: 0; }
.page-side { display: none; }

@media (min-width: 901px) {
    .container { max-width: 980px; width: 92%; }
    .page-cols {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 22px;
        align-items: start;
    }
    .page-side {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

/* ===== 响应式：只许 900 / 640 / 480 三档 ===== */
@media (max-width: 900px) {
    .container { padding: 24px 16px; }
    header.nav-header { margin-bottom: 20px; }
    header h1 { font-size: 2rem; }
    .assistant-card { padding: 20px 20px; }
    /* ≤900 档补触控目标（第 13 条）：身份条里那几颗链接在手机上也要 44px */
    .top-bar a {
        min-height: var(--touch-min);
        display: inline-flex;
        align-items: center;
    }
    .admin-grade-switch { min-height: var(--touch-min); }
    .admin-grade-reset { width: 44px; height: 44px; }
}

@media (max-width: 640px) {
    .container { padding: 16px 12px; }
    header h1 { font-size: 1.6rem; }
    .subtitle { font-size: 0.9rem; }
    .assistant-card { padding: 16px 14px; border-radius: 12px; }
    .card-icon { font-size: 2rem; margin-right: 12px; width: 44px; }
    .card-info h2 { font-size: 1.05rem; }
    .card-info p { font-size: 0.8rem; }
    footer { margin-top: 32px; }
}

@media (max-width: 480px) {
    .container { padding: 12px 8px; }
    header h1 { font-size: 1.4rem; }
    .assistant-card { padding: 14px 12px; }
    .card-icon { font-size: 1.6rem; margin-right: 8px; width: 36px; }
    .card-arrow { font-size: 1.2rem; margin-left: 4px; }
    .top-bar { flex-direction: column; align-items: flex-start; }
    /* ★ 第 5 轮 01（2026-10-12）：这条**只推管理后台那颗**。
       原写法 `.top-bar > div:last-child` 的本意是「右上角那颗靠右」，可**非管理员
       时管理后台那颗整个不渲染**，`.user-info` 自己就成了最后一个 div、被这条一起
       推到右边 —— 用户原话「手机端 头像/姓名/班级 没有左对齐」。390px 实量：
       名字那一行左边线 188.8，比 `.today-card` 边缘缩进 **161.3px**（.top-bar
       外框本身是贴齐的：27.5 == .today-card 27.5）。模板里那颗 div 现在带
       `top-bar-admin` 类名，选择器改成点名它：同一次实量，改完这一行落在 41.5
       （= .top-bar 外框 + 自己那 14px 内边距），与卡片里的字同一列。
       ⚠️ `.user-info` 那半**不用再写**：`.top-bar` 已是 column + flex-start，
       它本来就贴左边 —— 再给 width:100% 只是把盒子撑开，位置一个像素都不动。 */
    .top-bar > .top-bar-admin { align-self: flex-end; }
}

/* ★ 1018 第二轮（2026-10-18）：原首页「自主主题」横幅 `.theme-entry` 整块删除 ——
   入口下移到了底栏中间（`_bottom_bar.html` 首页分支的「🎯 自主+1000词」）。
   同一页不留两个入口；样式也不留死代码。
   身份条那颗「🗓 计划」直接复用上面的 `.top-bar a`，不新增规则。 */

/* ==========================================================================
   ★ 1113 P1（2026-11-13）：门户左列改版
   --------------------------------------------------------------------------
   · 桌面 / pad（≥641px）：左栏 220px 五张表 + 右栏内容；
   · 手机（≤640px）：左栏变**横向 tab**（默认英语），内容在下面。
   旧的 `.assistant-grid` / 助手卡样式保留（/plan、/feedback、/me 等页可能
   仍用 `.page-cols`；首页不再画那些卡，但样式不删，别处不受影响）。
   ========================================================================== */
.container.portal-container { max-width: 700px; }
@media (min-width: 641px) {
    .container.portal-container { max-width: 900px; width: 94%; }
}
@media (min-width: 901px) {
    .container.portal-container { max-width: 980px; width: 92%; }
}

@media (min-width: 641px) {
    .page-cols.portal-cols {
        display: grid;
        /* ★ 1114（用户原话「桌面左栏 220 改成 147」）：桌面 / pad 左栏 147px。 */
        grid-template-columns: 147px minmax(0, 1fr);
        gap: 22px;
        align-items: start;
    }
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e6e8f4;
    border-radius: 16px;
    position: sticky;
    top: 12px;
}
.portal-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #4a4f6a;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.portal-tab:hover { background: #f2f4ff; }
.portal-tab.is-active { background: #eef1ff; color: #2f46c8; }
/* ★ 2026-11-14：「自定义主题 / 自定义快捷入口」字长，147px 左栏里缩小一号；
   活动态不再挂 26px 箭头（否则 7 个字必然折行）。英语/语文/数学的箭头不变。 */
.portal-tab[data-portal-tab="theme"],
.portal-tab[data-portal-tab="custom"] {
    font-size: 0.82rem;
    padding: 0 6px;
    gap: 5px;
}
.portal-tab[data-portal-tab="theme"].is-active::after,
.portal-tab[data-portal-tab="custom"].is-active::after {
    display: none;
}
/* ★ 1114：活动科右侧一颗蓝色右箭头（只在桌面 / pad 左列显示）。 */
.portal-tab.is-active::after {
    content: "→";
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2f46c8;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(47, 70, 200, .35);
}

.portal-pane { display: none; }
.portal-pane.is-active { display: block; }

.portal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.portal-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #33364a;
}
.portal-head-acts {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.portal-btn {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #c9cff0;
    border-radius: 999px;
    background: #fff;
    color: #2f46c8;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.portal-btn:hover { background: #f4f6ff; }
.portal-btn.primary { background: #2f46c8; border-color: #2f46c8; color: #fff; }
.portal-btn.primary:hover { background: #263bb0; }

.portal-list {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e6e8f4;
    border-radius: 16px;
    overflow: hidden;
}
.portal-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 16px;
    border-bottom: 1px solid #eef0f8;
    color: #33364a;
    text-decoration: none;
}
.portal-list > .portal-entry:last-child,
.portal-custom-row:last-child .portal-entry { border-bottom: 0; }
/* ★ 1114：「＋ 添加主题」成为列表最后一条之后，原来「最后一条入口」变成
   倒数第二条 —— 把它的下边框收掉，否则会和按钮的上边框叠成两条线。 */
.portal-list > .portal-entry:nth-last-child(2),
.portal-custom-row:nth-last-child(2) { border-bottom: 0; }
.portal-entry:hover { background: #f8f9ff; }
/* ★ 1114：每页入口列表最后一条「＋ 添加主题」（动作按钮，不是 entry 链接）。 */
.portal-add-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 10px;
    padding: 10px 16px;
    border: 1px dashed #c9cff0;
    border-radius: 14px;
    background: #fff;
    color: #2f46c8;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}
.portal-add-theme:hover { background: #f4f6ff; }
/* 在白色入口卡里 = 最后一行，去掉外面的虚线框与间距。 */
.portal-list .portal-add-theme {
    margin-top: 0;
    border: 0;
    border-top: 1px solid #eef0f8;
    border-radius: 0;
    background: #fbfcff;
}
.portal-list .portal-add-theme:hover { background: #f2f5ff; }
.pe-icon {
    width: 32px;
    flex-shrink: 0;
    font-size: 1.35rem;
    text-align: center;
}
.pe-text { flex: 1; min-width: 0; }
.pe-text b { display: block; font-size: 0.98rem; }
.pe-text i {
    display: block;
    margin-top: 2px;
    color: #7a7f96;
    font-size: 0.78rem;
    font-style: normal;
    line-height: 1.45;
}
/* ★ 1114（用户原话「后面的箭头更显眼」）：蓝字 800、1.15rem、24px 浅蓝圆角底。 */
.pe-arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #eef1ff;
    color: #2f46c8;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1;
}

.portal-custom-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eef0f8;
}
.portal-custom-row .portal-entry { flex: 1; border-bottom: 0; }
.portal-row-tools {
    /* ★ 2026-11-14：默认收起；点「编辑」给 pane 加 .is-editing 才展开 ↑/↓/✕。 */
    display: none;
    gap: 4px;
    padding-right: 10px;
}
#portal-pane-custom.is-editing .portal-row-tools { display: flex; }
.portal-row-tools button {
    /* ★ 1113 P2：行内 ↑/↓/✕ 的触控高度 ≥44px（手机手指点得准） */
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #e0e3f2;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font: inherit;
    cursor: pointer;
}
.portal-row-tools button:hover { background: #f4f5fb; }

.portal-noscript {
    margin: 0 0 14px;
    padding: 12px 16px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #8d6e00;
    font-size: 0.88rem;
    line-height: 1.6;
}

.portal-empty,
.portal-login {
    padding: 18px;
    border: 1px dashed #d8dcef;
    border-radius: 14px;
    background: #fff;
    color: #7a7f96;
    font-size: 0.9rem;
    line-height: 1.6;
}
.portal-login a { color: #2f46c8; font-weight: 600; }

.portal-themes { margin-top: 18px; }
.portal-themes h3 {
    margin: 0 0 10px;
    color: #4a4f6a;
    font-size: 0.95rem;
}
.portal-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.portal-theme {
    display: block;
    padding: 14px;
    border: 1px solid #e6e8f4;
    border-radius: 14px;
    background: #fff;
    color: #33364a;
    text-decoration: none;
}
.portal-theme:hover { border-color: #b9c2ef; background: #f8f9ff; }
.portal-theme b { display: block; font-size: 0.95rem; }
.portal-theme i {
    display: block;
    margin-top: 4px;
    color: #7a7f96;
    font-size: 0.78rem;
    font-style: normal;
}

/* 添加弹层里的勾选清单 */
.portal-add-groups {
    max-height: 56vh;
    overflow: auto;
    margin-top: 6px;
    text-align: left;
}
.portal-add-groups h4 {
    margin: 12px 0 6px;
    color: #7a7f96;
    font-size: 0.85rem;
}
.portal-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    border-radius: 8px;
    color: #33364a;
    font-size: 0.9rem;
    cursor: pointer;
}
.portal-add-row:hover { background: #f6f7fd; }
.portal-add-row input { width: 18px; height: 18px; flex-shrink: 0; }

/* 「☑ 同时放到本页」那一行（theme.css 的 .theme-field 里横排） */
.portal-also {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.portal-also input { width: 18px; height: 18px; }
.portal-also span { font-size: 0.85rem; color: #4a4f6a; }

@media (max-width: 640px) {
    .page-cols.portal-cols { display: block; }
    .portal-nav {
        position: static;
        flex-direction: row;
        gap: 6px;
        margin-bottom: 14px;
        border-radius: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .portal-tab {
        width: auto;
        flex: 0 0 auto;
        padding: 0 12px;
        white-space: nowrap;
    }
    /* ★ 1114：手机横向 tab 不画右箭头（宽度不够，箭头会被挤出屏幕）。 */
    .portal-tab.is-active::after { display: none; }
    .portal-head-acts { margin-left: 0; width: 100%; }
    .portal-head-acts .portal-btn { flex: 1 1 auto; }
}

/* ★ 1113：一页 3 步门户引导（取代旧 6 应用 × 2 页自动弹）。
   ★ 1114：右上角「？」与其 .portal-helpbar / .portal-help 整套撤掉；
   引导只剩「首次自动弹」与 `/?guide=1` 两条入口。 */
.portal-guide-mask {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(24, 27, 48, 0.55);
}
.portal-guide-mask[hidden] { display: none; }
.portal-guide {
    width: min(720px, 100%);
    max-height: 92vh;
    overflow: auto;
    padding: 20px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(20, 24, 60, 0.3);
}
.pg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pg-head h3 { margin: 0; color: #33364a; font-size: 1.2rem; }
.pg-x {
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #f2f4fb;
    color: #555;
    font: inherit;
    cursor: pointer;
}
.pg-body {
    display: grid;
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    gap: 12px;
}
.pg-step {
    display: flex;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e6e8f4;
    border-radius: 14px;
    background: #fbfcff;
}
.pg-num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #2f46c8;
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 28px;
}
.pg-copy { min-width: 0; }
.pg-copy h4 { margin: 2px 0 6px; color: #33364a; font-size: 0.95rem; }
.pg-copy p { margin: 0 0 8px; color: #6b7088; font-size: 0.82rem; line-height: 1.55; }
/* ★ 1113 P2：手机（≤640）是横向 tab + 上下堆叠，引导文案按断点切换，
   不再写「左边 / 右边」。 */
.pg-when-narrow { display: none; }
.pg-step-entries { grid-column: 2; }
.pg-step-common { grid-column: 1 / -1; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-chip {
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef1ff;
    color: #3d4690;
    font-size: 0.78rem;
    white-space: nowrap;
}
.pg-subject {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 0 0 8px;
    font-size: 0.78rem;
}
.pg-subject b {
    flex: 0 0 38px;
    color: #33364a;
}
.pg-subject span {
    padding: 3px 8px;
    border-radius: 7px;
    background: #f0f2fa;
    color: #555b7a;
    white-space: nowrap;
}
.pg-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
@media (max-width: 640px) {
    .portal-guide { padding: 16px 14px; }
    .pg-body { display: block; }
    .pg-step { margin-bottom: 10px; }
    .pg-step-common { margin-bottom: 0; }
    .pg-when-wide { display: none; }
    .pg-when-narrow { display: inline; }
}

/* ★ 1113 审查 P1-1：>900px 门户是三列（左表 / 主列 / 今天侧栏），
   别让 .page-side 掉到第二行最左。641–900 时 .page-side 本来 display:none，
   两列布局不变。 */
@media (min-width: 901px) {
    .page-cols.portal-cols {
        /* ★ 1114：左栏 220 → 147（主列 / 今天侧栏不变）。 */
        grid-template-columns: 147px minmax(0, 1fr) 320px;
    }
    /* ★ 2026-11-14：本周没排计划 ⇒ 不画「📊 今天」侧栏，第三列也撤掉。 */
    .page-cols.portal-cols.no-side {
        grid-template-columns: 147px minmax(0, 1fr);
    }
}
