/* ===== v10.0 单屏 Shell：顶栏 + 分区屏 + 底部 tabbar =====
   加载于 style.css 之后，覆盖页面级布局；卡片视觉沿用 style.css 的纸墨体系 */

html, body{height:100%; overflow:hidden; overscroll-behavior:none}
body{padding:0; padding-bottom:0}

.app{display:flex; flex-direction:column; height:100vh; height:100dvh;
  max-width:520px; margin:0 auto; background:var(--bg)}

/* 顶栏 */
.topbar{flex:0 0 auto; display:flex; align-items:baseline; gap:8px;
  padding:calc(9px + env(safe-area-inset-top)) 16px 9px;
  border-bottom:1px solid var(--line); background:rgba(245,242,236,.96);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px)}
.topbar .brand{font-size:16px; font-weight:700; letter-spacing:3px}
.topbar .tagline{font-size:10.5px; color:var(--ink2); letter-spacing:1px}
.topbar .tb-mode{margin-left:auto; font-size:11px; color:var(--accent);
  background:var(--accent-soft); border-radius:999px; padding:2px 9px; letter-spacing:.5px}

/* 分区容器 */
.screens{position:relative; flex:1 1 auto; min-height:0}
.screen{position:absolute; inset:0; display:none; overflow-y:auto;
  -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding:12px 14px calc(20px + env(safe-area-inset-bottom))}
.screen.on{display:block}
.screen .card{margin-top:0; margin-bottom:12px}
.screen .card:last-child{margin-bottom:0}
.screen .footer{margin-top:14px}

/* 底部 tabbar */
.tabbar{flex:0 0 auto; display:flex; border-top:1px solid var(--line);
  background:rgba(255,255,255,.97); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  padding-bottom:env(safe-area-inset-bottom)}
.tabbar button{flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:7px 0 7px; background:none; border:none; font-size:10.5px; color:#8d8377;
  letter-spacing:.5px; transition:color .15s}
.tabbar button svg{width:21px; height:21px; stroke:currentColor; fill:none;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round}
.tabbar button.on{color:var(--accent); font-weight:600}
.tabbar button.dis{opacity:.3; pointer-events:none}

/* 空态 */
.empty{text-align:center; padding:64px 24px; color:var(--ink2)}
.empty .e-dot{width:40px; height:40px; margin:0 auto 16px; border:1.5px dashed #cfc4b2; border-radius:50%}
.empty .e-t{font-size:15px; color:var(--ink); letter-spacing:1px; margin-bottom:6px}
.empty .e-d{font-size:12.5px; line-height:1.85; margin-bottom:18px}
.ghost{background:#fff; border:1px solid var(--line); color:var(--ink);
  border-radius:10px; padding:8px 18px; font-size:13px}
.ghost:active{background:#f6f1e7}

/* 表单紧凑：时间 + 性别两列 */
.row2{display:flex; gap:10px}
.row2 > .fld{flex:1; min-width:0}
.row2 > .fld .seg{margin:0}
.row2 > .fld input[type=time]{padding:9px 10px}
.form-tight label{margin:12px 0 5px}

/* 排盘页底部快捷操作 */
.quick-row{display:flex; gap:10px; margin-top:10px}
.quick-row .ghost{flex:1; padding:10px 0; text-align:center}

/* 档案抽屉 */
.sheet-mask{position:fixed; inset:0; background:rgba(30,25,18,.38); z-index:40}
.sheet{position:fixed; left:0; right:0; bottom:0; z-index:41; background:var(--bg);
  border-radius:18px 18px 0 0; max-height:84vh; display:flex; flex-direction:column;
  box-shadow:0 -8px 30px rgba(0,0,0,.18); padding-bottom:env(safe-area-inset-bottom);
  animation:sheetUp .22s ease-out}
.sheet.hidden{display:none}
.sheet-mask.hidden{display:none}
@keyframes sheetUp{from{transform:translateY(26px); opacity:.5} to{transform:none; opacity:1}}
.sheet-hd{display:flex; align-items:center; justify-content:space-between; padding:14px 16px 6px}
.sheet-hd b{font-size:15px; letter-spacing:1px}
.sheet-hd button{background:none; border:none; color:var(--ink2); font-size:13px; padding:4px}
.sheet-bd{overflow-y:auto; -webkit-overflow-scrolling:touch; padding:2px 14px 20px}
.sheet-bd .card{margin-top:6px}

/* 导出舞台（离屏渲染，不进可见布局） */
#export-stage{position:fixed; left:-9999px; top:0; width:400px; background:var(--bg)}
#export-stage .ex-wrap{padding:14px 14px 8px; background:var(--bg)}
#export-stage .card{margin-bottom:12px}
.img-foot{text-align:center; font-size:11px; color:var(--ink2); line-height:1.8; padding:14px 0 6px}

/* loading 覆盖层（保留 .hidden 语义） */
#loading{position:fixed; inset:0; z-index:50; background:rgba(245,242,236,.92);
  display:flex; align-items:center; justify-content:center; padding:0; letter-spacing:2px}
#loading.hidden{display:none}

/* 返回顶部按钮：避开 tabbar */
#toTop{bottom:calc(72px + env(safe-area-inset-bottom)); z-index:20}

/* 结果区分享行在单屏内压缩 */
.screen .share-row{margin-bottom:10px}
.screen .share-row .share-btn{padding:7px 0; font-size:12.5px}

/* 流年行窄屏适配：十神占满中段，标签换行到第二行 */
.ly-row{flex-wrap:wrap; row-gap:3px}
.ly-ss{flex:1 1 auto; min-width:110px}
.ly-row .ly-dy, .ly-row .ly-dong{margin-left:52px}
.ly-row .ly-dong + .ly-dy{margin-left:6px}

/* ===== v10.1：命盘内子分区（命盘 / 大运 / 流年 / 解读） ===== */
#scr-chart{padding:0}
#scr-chart.on{display:flex; flex-direction:column}
.subtabs{flex:0 0 auto; display:flex; gap:4px; padding:7px 12px;
  border-bottom:1px solid var(--line); background:rgba(250,247,241,.98)}
.subtabs button{flex:1; min-width:0; padding:7px 0; border:1px solid transparent;
  border-radius:9px; background:none; color:var(--ink2); font-size:12.5px;
  letter-spacing:1px; transition:background .16s, color .16s}
.subtabs button.on{background:linear-gradient(180deg,#a8452d,#8f331e); color:#fff;
  font-weight:600; box-shadow:0 1px 5px rgba(154,59,38,.26)}
.subtabs button.dis{opacity:.3; pointer-events:none}
.subpanes{position:relative; flex:1 1 auto; min-height:0}
#scr-chart .pane{position:absolute; inset:0; display:none; overflow-y:auto;
  -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding:12px 14px calc(20px + env(safe-area-inset-bottom))}
#scr-chart .pane.on{display:block}

/* ===== 「我」页 ===== */
.me-row{display:flex; align-items:center; justify-content:space-between; width:100%;
  padding:11px 2px; background:none; border:none; border-bottom:1px solid var(--line);
  font-size:14px; color:var(--ink); text-align:left}
.me-row:last-child{border-bottom:none}
.me-row:active{background:#faf7f1}
.me-row.static{color:var(--ink2); font-size:13px; padding:9px 2px}
.me-val{font-size:12.5px; color:var(--ink2); letter-spacing:.5px}
.me-note{font-size:11.5px; color:var(--ink2); line-height:1.85; margin-top:10px}
.me-about{font-size:11.5px; color:var(--ink2); line-height:1.9; margin-top:8px}
.me-about b{color:var(--ink)}
.ghost.danger{display:block; width:100%; margin-top:12px;
  color:#9a3b26; border-color:#e2cfc7; background:#fdf7f5}

/* ===== 「对话」页（筹备中占位） ===== */
.chat-hero{text-align:center; padding:32px 20px 26px}
.chat-ico{width:52px; height:52px; margin:0 auto 14px; border-radius:16px;
  background:var(--accent-soft); display:flex; align-items:center; justify-content:center}
.chat-ico svg{width:26px; height:26px; stroke:var(--accent); fill:none;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round}
.chat-t{font-size:16px; letter-spacing:2px; margin-bottom:8px}
.chat-d{font-size:12.5px; line-height:1.9; color:var(--ink2)}
.chat-badge{display:inline-block; margin-top:14px; font-size:11px; color:var(--ink2);
  background:#f1ece2; border-radius:999px; padding:3px 12px; letter-spacing:1px}
.qa-item{padding:10px 0; border-bottom:1px solid var(--line)}
.qa-item:last-of-type{border-bottom:none}
.qa-item b{display:block; font-size:13.5px; font-weight:500; margin-bottom:3px}
.qa-item span{font-size:11.5px; color:var(--ink2)}

/* ===== v11.1 解读报告：分项 tab 条 + 独立滚动分项面板 ===== */
#scr-chart #pane-report.on{display:flex; flex-direction:column; overflow:hidden; padding:0}

/* 横向滑动 tab 条（6 项超出屏宽时可左右拖） */
.rptabs{flex:0 0 auto; display:flex; gap:6px; overflow-x:auto; overflow-y:hidden;
  padding:8px 12px; border-bottom:1px solid var(--line); background:rgba(250,247,241,.98);
  -webkit-overflow-scrolling:touch; scrollbar-width:none; overscroll-behavior-x:contain}
.rptabs::-webkit-scrollbar{display:none}
.rptabs button{flex:0 0 auto; padding:6px 14px; border-radius:999px;
  border:1px solid var(--line); background:#fff; color:var(--ink2);
  font-size:12.5px; letter-spacing:.6px; white-space:nowrap;
  transition:background .16s, color .16s, border-color .16s}
.rptabs button.on{background:linear-gradient(180deg,#a8452d,#8f331e); color:#fff;
  border-color:transparent; font-weight:600; box-shadow:0 1px 5px rgba(154,59,38,.26)}
.rptabs button:active{background:var(--accent-soft); color:var(--accent)}

/* 分项容器：每项独立滚动 */
.rppanes{position:relative; flex:1 1 auto; min-height:0}
#scr-chart .rp-pane{position:absolute; inset:0; display:none; overflow-y:auto;
  -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding:12px 14px calc(20px + env(safe-area-inset-bottom))}
#scr-chart .rp-pane.on{display:block}
.rp-pane .card:last-child{margin-bottom:0}

/* 导出长图里的分项标题（App 内由 tab 承担，不占位） */
#export-stage .ex-rp-tt{font-size:12px; color:#8a8073; letter-spacing:2.5px;
  margin:14px 0 8px; padding-bottom:6px; border-bottom:1px solid #e8e1d5}

.hp-who{display:block; font-size:11.5px; color:var(--accent); letter-spacing:1px; margin:2px 0 3px}
.jianpi p + .hp-who{margin-top:10px}
.rp-more{background:#faf8f4}

/* 档案条：整条点击进入命盘，「⋯」展开操作区 */
.arch-chip{position:relative; padding-right:34px}
.arch-more{position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:26px; height:26px; display:flex; align-items:center; justify-content:center;
  color:var(--ink2); font-size:17px; line-height:1; border-radius:7px}
.arch-more:active{background:#efe9dd}
