/* v1.71 新版界面（照丰亦在 v0 做的样稿）：米白底、墨绿主色、米黄点缀、宋体标题、圆角卡片、细边框不加阴影。
   放在每页最后加载，把旧的怀旧风（旧信纸、楷体、食研社橙）统一换成新样子；各页自己的布局和功能不动。 */
:root{
  --background:#f5efe3; --foreground:#1f1d18; --card:#fffdf8; --muted:#ede5d4; --muted-fg:#5f584b;
  --primary:#2f4a2e; --primary-fg:#f3eedd; --secondary:#e4eadf; --accent:#c99a3c; --accent-fg:#2b2a24;
  --border:#d9cdb6; --destructive:#a5452f; --husk:#8a6a3f; --millet-soft:#f3e6c7; --wx:#07c160;
  --tbh:58px; --hdh:48px;
  /* 旧页面用的颜色名，全部映射到新配色 */
  --paper:#f5efe3 !important; --ink:#1f1d18 !important; --soft:#5f584b !important; --line:#d9cdb6 !important;
  --leaf:#2f4a2e !important; --leaf-2:#3d5c3b !important; --leaf-soft:#e4eadf !important;
  --red:#2f4a2e !important; --sy:#2f4a2e !important; --sy-soft:#e4eadf !important; --red-soft:#f3e6c7 !important;
  --millet:#8a6a3f !important; --millet-soft:#f3e6c7 !important; --husk:#8a6a3f !important; --warn:#a5452f !important;
  --kai:"Songti SC","STSong","Noto Serif CJK SC","Source Han Serif SC","SimSun",serif !important;
  --serif:"Songti SC","STSong","Noto Serif CJK SC","Source Han Serif SC","SimSun",serif !important;
}
html, body{ margin:0; background:#f5efe3 !important; background-image:none !important; color:#1f1d18; }
body{ font-family:-apple-system,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif; }
h1, h2, .h1, .sec-t{ font-family:var(--serif); color:var(--primary); letter-spacing:.03em; }

/* 卡片：白底细边，不要旧信纸的投影 */
.card{ background:#fffdf8 !important; border:1px solid #d9cdb6 !important; border-radius:16px !important; box-shadow:none !important; }
/* 按钮：墨绿实心，圆角 12 */
.btn{ background:#2f4a2e !important; color:#f3eedd !important; border:0 !important; border-radius:12px !important; box-shadow:none !important;
  font-family:inherit !important; letter-spacing:.08em !important; font-weight:600 !important; }
.btn.ghost{ background:#fffdf8 !important; color:#2f4a2e !important; border:1.5px solid #2f4a2e !important; }
input, textarea, select{ border-color:#d9cdb6 !important; border-radius:12px !important; }
input:focus, textarea:focus, select:focus{ border-color:#2f4a2e !important; outline:none; }
.stamp{ border-color:#8a6a3f !important; color:#8a6a3f !important; transform:none !important; }
.badge{ background:#c99a3c !important; color:#2b2a24 !important; }
a{ -webkit-tap-highlight-color:transparent; }

/* ---------- 公共外壳（shell.js 加上去的）：顶部标题栏 + 底部五个标签 ---------- */
.ui-hd{ position:fixed; top:0; left:0; right:0; z-index:40; height:calc(var(--hdh) + env(safe-area-inset-top,0)); padding-top:env(safe-area-inset-top,0);
  background:rgba(245,239,227,.96); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; }
.ui-hd h1{ margin:0; font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif !important; color:#1f1d18 !important; font-size:17px; font-weight:600; letter-spacing:0;
  max-width:62%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ui-back{ position:absolute; left:4px; bottom:4px; width:40px; height:40px; border:0; background:none; color:#1f1d18; display:flex; align-items:center; justify-content:center; }
.ui-back svg{ width:26px; height:26px; }
.ui-tb{ position:fixed; left:0; right:0; bottom:0; z-index:40; background:#fffdf8; border-top:1px solid #d9cdb6; padding-bottom:max(env(safe-area-inset-bottom,0px),4px); }
.ui-tb nav{ max-width:520px; margin:0 auto; display:flex; height:var(--tbh); }
.ui-tb a{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-size:13px; color:#5f584b; text-decoration:none; }
.ui-tb a.on{ color:#2f4a2e; font-weight:600; }
.ui-tb svg{ width:24px; height:24px; }
.lu{ fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* 有外壳时：页面让出顶部标题栏和底部标签栏的位置；旧的页头页脚收起来 */
body.ui-shell{ padding-top:calc(var(--hdh) + env(safe-area-inset-top,0)) !important; }
body.ui-shell.ui-has-tb{ padding-bottom:calc(var(--tbh) + env(safe-area-inset-bottom,0) + 8px) !important; }
body.ui-shell .brand, body.ui-shell .foot{ display:none !important; }
body.ui-shell .wrap{ padding-top:10px !important; }
/* 各页自己的底部条，挪到标签栏上面 */
body.ui-has-tb .cbar, body.ui-has-tb .bar, body.ui-has-tb .ask{ bottom:calc(var(--tbh) + env(safe-area-inset-bottom,0) + 4px) !important; }
body.ui-has-tb .fab{ bottom:calc(var(--tbh) + 90px + env(safe-area-inset-bottom,0)) !important; }
/* 健康记录自己的“今天/记录/检查/我的”：从底部挪到标题栏下面，变成分段按钮（和课堂页一样） */
body.ui-shell .tabs{ position:fixed !important; top:calc(var(--hdh) + env(safe-area-inset-top,0)) !important; bottom:auto !important; left:0; right:0; z-index:30 !important;
  background:#f5efe3 !important; border:0 !important; backdrop-filter:none !important; padding:4px 16px 8px !important; }
body.ui-shell.ui-jilu .wrap{ padding-top:64px !important; }

/* ---------- 新版组件（首页、我的等新页面用） ---------- */
.u-wrap, .u-wrap *, .u-card{ box-sizing:border-box; }
.u-wrap{ max-width:520px; margin:0 auto; padding:8px 16px 24px; }
.u-sec{ padding-top:20px; }
.u-sec-h{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:12px; }
.u-sec-h h2{ margin:0; font-family:var(--serif); font-size:18px; font-weight:700; color:#2f4a2e; letter-spacing:.04em; }
.u-sec-h p{ margin:2px 0 0; font-size:15px; color:#5f584b; }
.u-more{ display:flex; align-items:center; font-size:15px; color:#2f4a2e; text-decoration:none; }
.u-more svg{ width:16px; height:16px; }
.u-card{ background:#fffdf8; border:1px solid #d9cdb6; border-radius:16px; }
.u-ic{ display:flex; flex-shrink:0; align-items:center; justify-content:center; border-radius:50%; font-family:var(--serif); font-weight:700;
  width:48px; height:48px; font-size:20px; background:#e4eadf; color:#2f4a2e; }
.u-ic.m{ background:#f3e6c7; color:#8a6a3f; }
.u-ic.s{ width:36px; height:36px; font-size:16px; }
.u-tip{ margin:0; border-radius:12px; background:#f3e6c7; padding:10px 14px; font-size:15px; line-height:1.7; color:#8a6a3f; }
.u-list{ background:#fffdf8; border:1px solid #d9cdb6; border-radius:16px; overflow:hidden; }
.u-row{ box-sizing:border-box; display:flex; width:100%; align-items:center; gap:12px; padding:14px 16px; border:0; background:none; text-align:left; text-decoration:none; color:#1f1d18; font:inherit; }
.u-row + .u-row{ border-top:1px solid #e9dfcb; }
.u-row:active{ background:#ede5d4; }
.u-row > svg{ width:20px; height:20px; flex-shrink:0; color:#2f4a2e; }
.u-row .t{ display:flex; min-width:0; flex:1; flex-direction:column; }
.u-row .t b{ font-size:17px; font-weight:500; }
.u-row .t small{ font-size:15px; color:#5f584b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.u-row .t small.hot{ color:#a5452f; font-weight:600; }
.u-row .chev{ width:20px; height:20px; color:rgba(95,88,75,.6); flex-shrink:0; }
.u-pill{ display:inline-flex; align-items:center; justify-content:center; border-radius:999px; padding:10px 20px; font-size:16px; text-decoration:none; border:0; font:inherit; }
.u-btn{ display:flex; width:100%; height:48px; align-items:center; justify-content:center; gap:8px; border:0; border-radius:12px; font:inherit; font-size:17px; font-weight:600;
  letter-spacing:.06em; background:#2f4a2e; color:#f3eedd; text-decoration:none; }
.u-btn:disabled{ opacity:.5; }
.u-btn.wx{ background:#07c160; color:#fff; }
.u-btn.line{ background:#fffdf8; color:#2f4a2e; border:1.5px solid #2f4a2e; }
.u-price{ color:#a5452f; } .u-price small{ font-size:14px; } .u-price b{ font-size:20px; }
.u-foot{ padding:32px 24px; text-align:center; font-size:13px; line-height:1.7; color:#5f584b; }
.u-foot p{ margin:0; } .u-foot .b{ font-family:var(--serif); font-size:14px; color:#2f4a2e; }

/* ---------- 旧页面细节，统一成新样子 ---------- */
/* 健康记录的“今天/记录/检查/我的”：分段按钮 */
body.ui-shell .tabs{ display:flex; }
body.ui-shell .tabs button{ min-height:40px !important; font-size:16px !important; font-weight:500 !important; border-radius:9px !important; color:#5f584b !important; background:none !important; }
body.ui-shell .tabs button.on{ background:#fffdf8 !important; color:#2f4a2e !important; font-weight:600 !important; box-shadow:0 1px 3px rgba(0,0,0,.06); }
body.ui-shell #tabs{ background:#f5efe3 !important; }
body.ui-shell #tabs::before{ content:""; position:absolute; inset:4px 16px 8px; border-radius:12px; background:#ede5d4; z-index:-1; }
/* 以前的赤陶色主卡、活动卡、底部按钮：换成墨绿 / 米黄 */
.go-row.primary, #ev-near{ background:#2f4a2e !important; border-color:#2f4a2e !important; box-shadow:none !important; }
.today{ background:#f3e6c7 !important; border:1px solid #d9cdb6 !important; box-shadow:none !important; }
.today::before, #ev-near::before{ display:none !important; }
.today, .today b, .today span, .today-r{ color:#1f1d18 !important; }
.today-l small, .today-l2 small{ color:#8a6a3f !important; }
#bar .btn, .bar .btn{ background:#2f4a2e !important; border:0 !important; box-shadow:none !important; color:#f3eedd !important; }
.bar, .cbar, .ask{ background:#fffdf8 !important; border-top:1px solid #d9cdb6 !important; box-shadow:none !important; }
/* 集章、视频页自己的小页头 */
body.ui-shell .top{ display:none !important; }
/* 和标题栏重复的大标题收起来（shell.js 打标记） */
body.ui-shell .ui-dup{ display:none !important; }

/* v1.74 分步视频提示（shell.js 渲染 [data-guide]） */
.ui-gtip{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin:10px 0; padding:8px 8px 8px 14px; border-radius:12px; background:#e4eadf; }
.ui-gtip a{ display:flex; align-items:center; gap:8px; font-size:15px; font-weight:600; color:#2f4a2e; text-decoration:none; }
.ui-gtip a svg{ width:20px; height:20px; }
.ui-gtip button{ width:32px; height:32px; border:0; background:none; font-size:22px; line-height:1; color:#5f584b; }

/* v1.75 弱提示、二次确认、断网提示 */
.ui-toast{ position:fixed; left:50%; top:38%; z-index:90; transform:translate(-50%,-50%); max-width:78%; padding:12px 18px; border-radius:12px;
  background:rgba(31,29,24,.88); color:#fff; font-size:15px; line-height:1.5; text-align:center; opacity:0; pointer-events:none; transition:opacity .2s; }
.ui-toast.on{ opacity:1; }
.ui-dlg{ position:fixed; inset:0; z-index:95; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(31,29,24,.45); opacity:0; transition:opacity .2s; }
.ui-dlg.on{ opacity:1; }
.ui-dlg .in{ width:100%; max-width:340px; box-sizing:border-box; border-radius:16px; background:#fffdf8; padding:22px 20px 16px; }
.ui-dlg h3{ margin:0 0 8px; font-size:18px; font-weight:600; color:#1f1d18; text-align:center; font-family:inherit; }
.ui-dlg p{ margin:0 0 18px; font-size:15px; line-height:1.6; color:#5f584b; text-align:center; }
.ui-dlg .bt{ display:flex; gap:10px; } .ui-dlg .bt button{ flex:1; height:46px; border-radius:12px; font:inherit; font-size:16px; font-weight:600; }
.ui-dlg .x{ border:1px solid #d9cdb6; background:#fffdf8; color:#1f1d18; }
.ui-dlg .ok{ border:0; background:#2f4a2e; color:#f3eedd; } .ui-dlg .ok.danger{ background:#b0412c; color:#fff; }
.ui-offline{ position:fixed; left:0; right:0; bottom:calc(var(--tbh,0px) + env(safe-area-inset-bottom,0px) + 4px); z-index:45; padding:8px 16px; background:#b0412c; color:#fff; font-size:14px; text-align:center; }
