/* scafup-h5 unified personal center shell */
:root {
  --ink: #1f2937;
  --muted: #64748b;
  --blue: #2f80ed;
  --line: #e5eef8;
  --bg: #f3f6fa;
  --card: #fff;
  --nav-w: 220px;
  --top-h: 56px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  min-height: var(--top-h);
  padding: 10px 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand-block { display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 1.1rem; margin: 0; }
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: #e8f1ff; color: #1d4f91;
}
.pill.muted { background: #eef2f7; color: var(--muted); }
.pill.ok { background: #e6f7ef; color: #0a7; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { font-size: 13px; color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions a, .top-actions button {
  appearance: none; border: 0; border-radius: 8px; padding: 6px 12px;
  font: inherit; cursor: pointer; text-decoration: none; color: #fff;
  background: var(--blue); font-size: 13px;
}
.top-actions .secondary {
  background: #fff; color: var(--blue); border: 1px solid #c9dcf7;
}
.top-actions .danger { background: #dc2626; }
.embed-only { display: none !important; }
body.embed .embed-only { display: inline-flex !important; }
body.embed .embed-hide { display: none !important; }

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.sidenav {
  width: var(--nav-w);
  flex-shrink: 0;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  overflow-y: auto;
}
.sidenav a {
  display: block; text-decoration: none; color: inherit;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid transparent;
}
.sidenav a:hover { background: #fff; border-color: var(--line); }
.sidenav a.active {
  background: #e8f1ff; border-color: #b7d2f7; color: #1d4f91; font-weight: 650;
}
.sidenav .label { font-size: 14px; }
.sidenav .desc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.content-wrap {
  flex: 1; min-width: 0; background: var(--bg);
  display: flex; flex-direction: column;
}
#contentFrame {
  flex: 1; width: 100%; border: 0; background: var(--bg);
  min-height: calc(100vh - var(--top-h) - 8px);
}
.foot-note {
  margin: 0; padding: 8px 16px 14px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.foot-note a { color: var(--blue); }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidenav {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .sidenav a {
    flex: 0 0 auto;
    margin-bottom: 0;
    white-space: nowrap;
    max-width: 160px;
  }
  .sidenav .desc { display: none; }
  #contentFrame { min-height: 70vh; }
  .who { max-width: 160px; }
}

/* phone: avoid nested fixed desktop widths / double scroll traps */
@media (max-width: 720px) {
  .content-wrap { min-height: 0; }
  #contentFrame {
    min-height: calc(100dvh - var(--top-h) - 56px);
    height: calc(100dvh - var(--top-h) - 56px);
  }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .sidenav a { max-width: none; padding: 10px 14px; }
}