/* 鸿德食堂打分工具 — 美团简洁风：白底、黑字、普通五角星 */
:root{
  --bg:#f5f5f5;
  --card:#ffffff;
  --text:#1a1a1a;
  --sub:#8a8a8a;
  --line:#ececec;
  --brand:#ffb300;      /* 星星黄 */
  --active:#1a1a1a;     /* 主按钮黑 */
  --danger:#e64a3b;
  --ok:#12b76a;
  --tabbar-h:58px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  font-size:16px;line-height:1.5;
  padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px));
  -webkit-font-smoothing:antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar{
  position:sticky;top:0;z-index:20;background:#fff;
  padding:calc(env(safe-area-inset-top,0px) + 10px) 16px 10px;
  border-bottom:1px solid var(--line);
}
.topbar-title{font-size:19px;font-weight:700;letter-spacing:.5px}
.topbar-sub{font-size:12px;color:var(--sub);margin-top:2px}

main{padding:12px}

/* ---------- 页面切换 ---------- */
.screen{display:none;animation:none}
.screen.is-active{display:block}

/* ---------- 演示数据提示条（同样保持黑白灰，不破坏简洁风） ---------- */
.demo-banner{
  background:#f0f0f0;border:1px solid #e0e0e0;border-radius:12px;
  padding:11px 14px;margin-bottom:12px;font-size:12.5px;color:#666;line-height:1.7;
}
.demo-banner b{color:#1a1a1a}

/* ---------- 步骤条 ---------- */
.steps{display:flex;gap:8px;margin:2px 0 12px}
.step{
  flex:1;display:flex;align-items:center;gap:6px;justify-content:center;
  background:#fff;border:1px solid var(--line);border-radius:10px;
  padding:8px 4px;font-size:12px;color:var(--sub);
}
.step b{
  display:inline-flex;width:18px;height:18px;border-radius:50%;
  background:#efefef;color:#999;font-size:11px;align-items:center;justify-content:center;
}
.step.is-on{border-color:var(--active);color:var(--text)}
.step.is-on b{background:var(--active);color:#fff}
.step.is-done b{background:var(--ok);color:#fff}

/* ---------- 卡片 ---------- */
.card{
  background:var(--card);border-radius:14px;padding:14px;margin-bottom:12px;
  border:1px solid var(--line);
}
.field{margin-bottom:12px}
.field:last-child{margin-bottom:0}
.field-label{display:block;font-size:13px;color:var(--sub);margin-bottom:6px}

/* ---------- 下拉（大按钮、易点） ---------- */
.picker{
  width:100%;height:50px;padding:0 40px 0 14px;font-size:17px;color:var(--text);
  background:#fafafa url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M2 5l5 5 5-5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 14px center;
  border:1px solid #e0e0e0;border-radius:10px;appearance:none;-webkit-appearance:none;
}
.picker:focus{outline:none;border-color:var(--active)}
.picker:disabled{color:#bbb;background-color:#f4f4f4}

/* ---------- 打分卡 ---------- */
.rate-card{text-align:center}
.rate-dish{font-size:18px;font-weight:700;margin-bottom:4px;word-break:break-all}
.rate-hint{font-size:12px;color:var(--sub);margin-bottom:12px}
.stars{display:flex;justify-content:center;gap:10px;margin:6px 0 4px}
.star{
  font-size:42px;line-height:1;color:#e2e2e2;cursor:pointer;
  transition:color .12s ease,transform .12s ease;user-select:none;
}
.star.on{color:var(--brand)}
.star.press{transform:scale(1.12)}
.score-text{font-size:13px;color:var(--sub);height:20px;margin-bottom:12px}

.quick-comments{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:12px}
.chip{
  font-size:13px;color:#555;background:#f5f5f5;border:1px solid #e8e8e8;
  border-radius:999px;padding:7px 12px;
}
.chip.on{background:#111;color:#fff;border-color:#111}

.comment{
  width:100%;height:46px;padding:0 14px;font-size:16px;background:#fafafa;
  border:1px solid #e0e0e0;border-radius:10px;margin-bottom:12px;
}
.comment:focus{outline:none;border-color:var(--active)}

.btn-primary{
  width:100%;height:52px;border:0;border-radius:12px;background:var(--active);color:#fff;
  font-size:17px;font-weight:600;
}
.btn-primary:disabled{background:#dcdcdc;color:#fff}
.form-msg{font-size:13px;min-height:20px;margin-top:10px}
.form-msg.ok{color:var(--ok)}
.form-msg.err{color:var(--danger)}

/* ---------- 问题反馈（同学只提交，不直接改数据） ---------- */
.fb-link{
  display:block;width:100%;margin-top:10px;padding:10px 0;
  background:none;border:0;color:#8a8a8a;font-size:13px;
  text-decoration:underline;text-underline-offset:3px;
}
.fb-link:active{color:#111}

.sheet-mask{
  position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.42);
  display:flex;align-items:flex-end;justify-content:center;
}
.sheet-mask[hidden]{display:none}
.sheet{
  width:100%;max-width:520px;max-height:88vh;overflow-y:auto;background:#fff;
  border-radius:16px 16px 0 0;padding-bottom:calc(14px + env(safe-area-inset-bottom,0px));
  animation:sheetUp .18s ease-out;
}
@keyframes sheetUp{from{transform:translateY(24px);opacity:.6}to{transform:translateY(0);opacity:1}}
.sheet-head{
  position:sticky;top:0;background:#fff;z-index:1;
  display:flex;align-items:center;justify-content:space-between;
  padding:15px 16px;border-bottom:1px solid var(--line);
}
.sheet-title{font-size:16px;font-weight:700}
.sheet-close{
  width:30px;height:30px;border:0;background:#f2f2f2;border-radius:50%;
  color:#666;font-size:19px;line-height:1;
}
.sheet-body{padding:14px 16px 4px}
.fb-dish{
  background:#fafafa;border:1px solid var(--line);border-radius:10px;
  padding:10px 12px;font-size:14px;color:#444;margin-bottom:14px;word-break:break-all;
}
.fb-kinds{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.fb-kind{
  font-size:13px;color:#555;background:#f5f5f5;border:1px solid #e8e8e8;
  border-radius:999px;padding:8px 13px;
}
.fb-kind.on{background:#111;color:#fff;border-color:#111}
.fb-text{
  width:100%;min-height:82px;padding:11px 13px;font-size:15px;line-height:1.6;
  background:#fafafa;border:1px solid #e0e0e0;border-radius:10px;
  font-family:inherit;resize:vertical;
}
.fb-text:focus{outline:none;border-color:var(--active)}
.fb-count{font-size:12px;color:#bbb;text-align:right;margin:4px 2px 14px}
.fb-tip{font-size:12px;color:#a8a8a8;line-height:1.7;margin-top:12px;text-align:center}

/* ---------- 榜单 ---------- */
.board{background:#fff;border-radius:14px;border:1px solid var(--line);overflow:hidden}
.board-head{
  padding:14px;border-bottom:1px solid var(--line);
  font-size:15px;font-weight:700;display:flex;justify-content:space-between;align-items:baseline;
}
.board-head small{font-size:12px;color:var(--sub);font-weight:400}

.row{display:flex;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid #f6f6f6}
.row:last-child{border-bottom:0}
.rank{
  flex:0 0 26px;height:26px;border-radius:7px;background:#f2f2f2;color:#999;
  font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;
}
.rank.r1{background:#ffd54a;color:#7a5200}
.rank.r2{background:#dfe3e8;color:#5b6470}
.rank.r3{background:#f0c9a8;color:#7a4a1e}
.row-main{flex:1;min-width:0}
.row-name{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-meta{font-size:12px;color:var(--sub);margin-top:3px}
.stars-inline{color:var(--brand);font-size:13px;letter-spacing:1px}
.stars-inline .off{color:#e2e2e2}
.row-score{flex:0 0 auto;text-align:right}
.row-score b{font-size:19px;color:#ff8f00}
.row-score span{display:block;font-size:11px;color:var(--sub)}

.canteen-hero{
  padding:16px;border-bottom:1px solid var(--line);background:#fffbf0;
}
.canteen-hero .t{font-size:17px;font-weight:700}
.canteen-hero .s{font-size:12px;color:var(--sub);margin-top:4px}

.school-hero{
  background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;margin-bottom:12px;
  text-align:center;
}
.school-hero-title{font-size:20px;font-weight:800;letter-spacing:1px}
.school-hero-sub{font-size:12px;color:var(--sub);margin-top:6px}

.empty{padding:38px 16px;text-align:center;color:var(--sub);font-size:14px;line-height:1.8}
.empty b{color:#ff8f00}

/* ---------- 底部 Tab ---------- */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;background:#fff;
  border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom,0px);
  height:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px));
}
.tab{
  flex:1;border:0;background:none;color:#9a9a9a;font-size:11px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
}
.tab .tab-ico{font-size:19px;line-height:1}
.tab.is-active{color:#111;font-weight:700}

/* ---------- Toast ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%) translateY(10px);
  background:rgba(0,0,0,.82);color:#fff;font-size:14px;padding:10px 18px;border-radius:22px;
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:80%;text-align:center;z-index:50;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ---------- 大屏也不难看（电脑上预览用） ---------- */
@media (min-width:640px){
  body{background:#e9e9e9}
  .topbar,main,.tabbar{max-width:520px;margin-left:auto;margin-right:auto}
  main{border-left:1px solid var(--line);border-right:1px solid var(--line);background:var(--bg)}
  .tabbar{border-left:1px solid var(--line);border-right:1px solid var(--line)}
}
