/* ============================================================
 * 原创设计系统「账房」· 三端覆盖层 v2（mobile-design-system-app.css）
 * 覆盖旧版：变量桥接 + mobile-v1 五视图 + workspace 移动视口
 * + shell 五导航 + 专项首页/视图升级组件对齐。
 * ============================================================ */

/* ---------------- A. 变量桥接（仅移动视口） ---------------- */
@media (max-width: 900px) {
  :root, .app, body {
    --deep: var(--ms-brand-deep);
    --accent: var(--ms-brand);
    --soft: var(--ms-brand-soft);
    --bg: var(--ms-paper);
    --ink: var(--ms-ink);
    --muted: var(--ms-ink-2);
    --line: var(--ms-line);
    --r: 14px;
  }
  :root {
    --accent-light: var(--ms-brand-soft);
    --panel: var(--ms-surface);
    --border: var(--ms-line);
    --text: var(--ms-ink);
  }
}

/* ---------------- B. mobile-v1 组件 ---------------- */
/* B1 顶栏：账皮墨绿 */
.app .top {
  background: linear-gradient(165deg, var(--ms-brand-mid), var(--ms-brand-deep) 70%);
  color: #f0ece1;
  border-bottom: 1px solid rgba(240, 236, 225, .14);
}
.app .top .brand { background: rgba(240, 236, 225, .12); border: 1px solid rgba(240, 236, 225, .28); border-radius: 8px; color: #f0ece1; }
.app .top .orgSelect {
  background: rgba(240, 236, 225, .1); border: 1px solid rgba(240, 236, 225, .26);
  color: #f0ece1; border-radius: var(--ms-r-pill); font-size: var(--ms-f12); padding: 6px 10px;
}
.app .top .orgSelect option { color: var(--ms-ink); }
.app .top .badge { background: rgba(192, 57, 43, .85); border: 1px solid rgba(240,236,225,.3); color: #fff; border-radius: var(--ms-r-pill); font-size: var(--ms-f11); }

/* B2 底部五导航：案头+朱印点 */
.app .bottom {
  background: rgba(253, 252, 249, .95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--ms-line);
  box-shadow: 0 -1px 0 rgba(29, 38, 32, .03);
}
.app .bottom button { color: var(--ms-ink-3); position: relative; border-radius: 0; }
.app .bottom button .ico { font-size: 19px; line-height: 1.2; }
.app .bottom button.active { color: var(--ms-brand); font-weight: 700; }
.app .bottom button.active::before {
  content: '◆'; font-size: 8px; line-height: 1; color: var(--ms-seal);
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
}
.app .bottom button .badge-dot { background: var(--ms-seal); color: #fff; font-size: 10px; font-weight: 700; border-radius: var(--ms-r-pill); padding: 1px 5px; }

/* B3 标题与正文墨色 */
.content .eyebrow { color: var(--ms-ink-3); font-weight: 700; letter-spacing: 1.6px; font-size: var(--ms-f11); }
.content h1 { font-size: 23px; line-height: 1.25; letter-spacing: .3px; }
.content .meta { color: var(--ms-ink-2); font-size: var(--ms-f13); }

/* B4 账册卡：上缘栏线（墨线/朱线）+上圆下直 */
.content .panel, .content .list, .content .ws, .content .profile,
.content .searchbar, .content .metric {
  background: var(--ms-surface);
  border: 1px solid var(--ms-line);
  border-top: var(--ms-rule) solid var(--ms-brand);
  border-radius: var(--ms-r-page);
  box-shadow: var(--ms-sh-1);
}
.content .hero {
  background: linear-gradient(165deg, var(--ms-brand-mid), var(--ms-brand-deep) 75%);
  color: #f0ece1; border: 0; border-radius: var(--ms-r-page);
  box-shadow: var(--ms-sh-2);
}
.content .hero .lbl, .content .hero .foot { color: rgba(240, 236, 225, .78); }
.content .metric { border-top-color: var(--ms-line); }
.content .status { border-radius: var(--ms-r-page); border: 1px solid var(--ms-line); background: var(--ms-surface); }

/* B5 按钮：盖章按压 */
.content .btn {
  min-height: var(--ms-touch); border-radius: var(--ms-r-btn); font-weight: 600;
  border: 1px solid var(--ms-line); background: var(--ms-surface); color: var(--ms-ink);
  box-shadow: var(--ms-sh-1); transition: transform .05s ease, box-shadow .1s ease;
}
.content .btn:active { transform: translateY(1px) scale(.99); box-shadow: inset 0 1px 2px rgba(29,38,32,.12); }
.content .btn.primary {
  background: var(--ms-brand); border-color: var(--ms-brand); color: #f3efe6;
  box-shadow: 0 2px 6px rgba(11, 59, 46, .3);
}
.content .btn.primary:active { background: var(--ms-brand-deep); }

/* B6 标签（印色） */
.content .tag { border-radius: 4px; font-size: var(--ms-f11); font-weight: 700; padding: 2px 7px; }
.content .tag.paid { color: var(--ms-ok); background: var(--ms-ok-soft); border: 1px solid #bfdccb; }
.content .tag.overdue { color: var(--ms-seal); background: var(--ms-seal-soft); border: 1px solid var(--ms-seal-line); }

/* B7 列表行：宣纸格线（虚线=账册行线） */
.content .row { border-bottom: 1px dashed var(--ms-line); }
.content .row:last-child { border-bottom: 0; }
.content .row:active { background: var(--ms-brand-soft); }
.content .searchbar input {
  border-radius: var(--ms-r-btn); border: 1px solid var(--ms-line); min-height: var(--ms-touch); background: var(--ms-surface);
}
.content .searchbar input:focus { border-color: var(--ms-brand); outline: 2px solid var(--ms-brand-soft); }
.content button:focus-visible, .content input:focus-visible, .content select:focus-visible { outline: 3px solid var(--ms-brand); outline-offset: 2px; }

/* B8 工作台卡（workspaces 视图） */
.content .grid { gap: 10px; }
.content .ws {
  background: var(--ms-surface); border: 1px solid var(--ms-line);
  border-top: var(--ms-rule) solid var(--ms-brand);
  border-radius: var(--ms-r-page); box-shadow: var(--ms-sh-1); padding: 13px; text-align: left;
}
.content .ws:active { background: var(--ms-brand-soft); }
.content .ws .ico { width: 34px; height: 34px; border-radius: 8px; background: var(--ms-brand-soft); color: var(--ms-brand); display: grid; place-items: center; font-size: 16px; }
.content .ws small { color: var(--ms-ink-2); }

/* B9 我的/AI 视图 */
.content .me22-link { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: var(--ms-r-btn); box-shadow: var(--ms-sh-1); }
.content .me22-link:active { background: var(--ms-brand-soft); }
.content .me22-logout { color: var(--ms-seal); }
.content .ai-entry h1 { color: var(--ms-brand-deep); }
.content .ai-quick .btn { border-color: var(--ms-brand-line); color: var(--ms-brand); background: var(--ms-brand-soft); box-shadow: none; }
.content .amount { color: var(--ms-brand-deep); font-variant-numeric: tabular-nums; }

/* ---------------- C. workspace.html 移动视口 ---------------- */
@media (max-width: 900px) {
  .main-head {
    background: linear-gradient(165deg, var(--ms-brand-mid), var(--ms-brand-deep) 70%);
    color: #f0ece1;
  }
  .main-head h2 { color: #f0ece1; }
  .main-head .user .btn, .main-head .nav-toggle { color: #f0ece1; border-color: rgba(240, 236, 225, .3); background: rgba(240, 236, 225, .1); }
  .main-head .nav-toggle { border-radius: var(--ms-r-btn); }
  .main-body .card { border-radius: var(--ms-r-page); border: 1px solid var(--ms-line); border-top: var(--ms-rule) solid var(--ms-brand); box-shadow: var(--ms-sh-1); }
  .main-body .btn { border-radius: var(--ms-r-btn); }
  .main-body .btn-primary { background: var(--ms-brand); border-color: var(--ms-brand); color: #f3efe6; }
  .main-body .kpi { border-radius: var(--ms-r-page); border: 1px solid var(--ms-line); box-shadow: var(--ms-sh-1); }
  .main-body .kpi .value { color: var(--ms-brand-deep); font-variant-numeric: tabular-nums; }
  .sidebar { background: #0a241c; }
  .sidebar .nav-item.active { background: var(--ms-brand); color: #f0ece1; border-radius: var(--ms-r-btn); }
  .sidebar .nav-item { border-radius: var(--ms-r-btn); }
}

/* ---------------- D. shell 五导航 ---------------- */
@media (max-width: 900px) {
.mws-nav {
  background: rgba(253, 252, 249, .95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--ms-line);
  padding: 4px 4px calc(6px + env(safe-area-inset-bottom));
}
.mws-nav a, .mws-nav button {
  min-height: 48px; border-radius: var(--ms-r-btn);
  color: var(--ms-ink-3); background: transparent; border: 0; font-weight: 600; position: relative;
}
.mws-nav a[aria-current="page"], .mws-nav a.active { color: var(--ms-brand); background: var(--ms-brand-soft); font-weight: 700; }
.mws-nav a[aria-current="page"]::before {
  content: '◆'; font-size: 8px; color: var(--ms-seal); position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
}
.mws-nav button[aria-expanded="true"] { background: var(--ms-brand-soft); color: var(--ms-brand); }
.mws-panel { border-radius: var(--ms-r-page); border: 1px solid var(--ms-line); border-top: var(--ms-rule) solid var(--ms-brand); box-shadow: var(--ms-sh-2); }
.mws-panel .mws-content a { border: 1px solid var(--ms-line); border-radius: var(--ms-r-btn); background: var(--ms-surface); box-shadow: var(--ms-sh-1); }
.mws-panel .mws-content a:active { background: var(--ms-brand-soft); }
}

/* ---------------- E. 专项首页/视图升级组件对齐「账房」 ---------------- */
/* 专项首页（mobile-specialist-home） */
.msh-home .msh-head {
  background: linear-gradient(165deg, var(--ms-brand-mid), var(--ms-brand-deep) 72%);
  color: #f0ece1; border-radius: 0 0 var(--ms-r-page) var(--ms-r-page);
  border-bottom: 2px solid var(--ms-seal);
}
.msh-home .msh-head p { color: rgba(240, 236, 225, .8); }
.msh-home .msh-org { background: rgba(240, 236, 225, .12); border: 1px solid rgba(240, 236, 225, .28); color: #f0ece1; }
.msh-home .msh-cell {
  background: var(--ms-surface); border: 1px solid var(--ms-line);
  border-top: var(--ms-rule) solid var(--ms-brand);
  border-radius: var(--ms-r-page); box-shadow: var(--ms-sh-1);
}
.msh-home .msh-cell:active { background: var(--ms-brand-soft); }
.msh-home .msh-q {
  background: var(--ms-brand-soft); border: 1px solid var(--ms-brand-line);
  border-radius: var(--ms-r-btn); color: var(--ms-brand-deep);
}
.msh-home .msh-q:active { transform: translateY(1px); filter: brightness(.97); }
.msh-home .msh-summary { background: var(--ms-surface); border: 1px solid var(--ms-line); border-top: var(--ms-rule) solid var(--ms-seal); border-radius: var(--ms-r-page); box-shadow: var(--ms-sh-1); }
.msh-home .msh-sum-go, .msh-home .msh-more summary { color: var(--ms-brand); }
.msh-home .msh-tier-vip { color: var(--ms-amber); background: var(--ms-amber-soft); border: 1px solid #e2cfa4; }
.msh-home .msh-tier-pro { color: var(--ms-info); background: var(--ms-info-soft); border: 1px solid #c4d2dd; }

/* mobile-v1 首页专项（mobile-home-specialist） */
.mhs .mhs-head h1 { color: var(--ms-brand-deep); }
.mhs .mhs-head p { color: var(--ms-ink-2); }
.mhs .mhs-sw.on { color: #f3efe6; background: var(--ms-brand); border-color: var(--ms-brand); }
.mhs .mhs-sw { color: var(--ms-ink-2); background: var(--ms-surface); border: 1px solid var(--ms-line); }
.mhs .mhs-quick .mhs-q {
  background: var(--ms-brand-soft); border: 1px solid var(--ms-brand-line);
  color: var(--ms-brand-deep); border-radius: var(--ms-r-btn);
}
.mhs .mhs-g { background: var(--ms-surface); border: 1px solid var(--ms-line); border-top: var(--ms-rule) solid var(--ms-brand); border-radius: var(--ms-r-page); color: var(--ms-ink); }
.mhs .mhs-g:active { background: var(--ms-brand-soft); }
.mhs .mhs-guide { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: var(--ms-r-btn); color: var(--ms-ink-2); }
.mhs .mhs-all { color: var(--ms-brand); }

/* 视图升级（mobile-views-upgrade） */
.mvu .mvu-sum {
  background: linear-gradient(165deg, var(--ms-brand-mid), var(--ms-brand-deep) 75%);
  color: #f0ece1; border-radius: var(--ms-r-page); border-bottom: 2px solid var(--ms-seal);
}
.mvu .mvu-ws {
  background: var(--ms-surface); border: 1px solid var(--ms-line);
  border-top: var(--ms-rule) solid var(--ms-brand);
  border-radius: var(--ms-r-page); box-shadow: var(--ms-sh-1);
}
.mvu .mvu-ws:active { background: var(--ms-brand-soft); }
.mvu .mvu-ws .ic { background: var(--ms-brand-soft); border-radius: 8px; }
.mvu .mvu-ws .go { color: var(--ms-brand); }
.mvu .mvu-ws.off { opacity: .66; box-shadow: none; background: transparent; }
.mvu .mvu-ws.off .ic { background: #efede6; }
.mvu .mvu-ws.off .go { color: var(--ms-ink-3); }
.mvu .mvu-note { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: var(--ms-r-btn); color: var(--ms-ink-2); }
.mvu .mvu-list { background: var(--ms-surface); border: 1px solid var(--ms-line); border-top: var(--ms-rule) solid var(--ms-seal); border-radius: var(--ms-r-page); overflow: hidden; }
.mvu .mvu-sec { color: var(--ms-ink-2); }

/* review51: full-surface labels and mobile wrapping. */
.v4-full,.mvu-ws small{display:block;font-size:12px;font-weight:400}
.mhs,.mvu,#msh-home{overflow-wrap:anywhere;min-width:0}
.mvu-catalog>summary{min-height:44px;padding:12px;cursor:pointer}
.mhs a:focus-visible,.mvu a:focus-visible,#msh-home a:focus-visible{outline:3px solid var(--ms-brand,#0e6b54);outline-offset:2px}

.v4-unsupported{opacity:.65;cursor:default}.v4-unsupported small{display:block;font-size:12px}
