/* ============ 应用骨架：深林导航 + 顶栏 + 内容 ============ */

.shell { display: flex; min-height: 100vh; background: var(--paper); }

/* —— 左侧深林导航 —— */
.rail {
  width: 248px; flex: 0 0 248px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(63,141,108,.16), transparent 60%),
    linear-gradient(168deg, var(--rail) 0%, var(--rail-2) 100%);
  color: var(--ink-invert);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.rail-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--rail-line);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, #2F9E7D, #0D6B55 65%, #0A5542);
  display: grid; place-items: center; color: #EAF4EF;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 14px -6px rgba(0,0,0,.5);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .04em; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: rgba(244,241,231,.55); letter-spacing: .05em; margin-top: 1px; }

.rail-scope {
  margin: 12px 12px 4px; padding: 8px 10px;
  border: 1px solid var(--rail-line);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
}
.rail-scope .rs-label { font-size: 10px; color: rgba(244,241,231,.5); letter-spacing: .14em; }
.rail-scope .rs-name { font-size: 12.5px; font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.rail-scope .rs-badge { margin-left: auto; font-size: 9.5px; background: rgba(47,159,125,.35); color: #DDF3E8; padding: 1px 6px; border-radius: var(--r-full); font-weight: 600; }

.rail-nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.rail-group-label {
  font-size: 10.5px; color: rgba(244,241,231,.42); letter-spacing: .16em;
  padding: 14px 10px 6px; display: flex; align-items: center; gap: 6px; text-transform: uppercase;
}
.rail-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: none; color: rgba(244,241,231,.78);
  padding: 8px 10px; border-radius: var(--r-md);
  font-size: 13.5px; cursor: pointer; text-align: left; margin: 1px 0;
  transition: background var(--fast) var(--ease), color var(--fast);
  position: relative;
}
.rail-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .85; }
.rail-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.rail-item.active { background: rgba(47,159,125,.22); color: #EAF7F0; font-weight: 600; }
.rail-item.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  background: #6FCFA8; border-radius: 0 3px 3px 0;
}
.rail-item .ri-tag {
  margin-left: auto; font-size: 9.5px; padding: 0 6px; border-radius: var(--r-full);
  background: rgba(255,255,255,.1); color: rgba(244,241,231,.6); letter-spacing: .05em;
}
.rail-item .ri-tag.on { background: rgba(255,199,87,.18); color: #FFD988; }
.rail-item.disabled { opacity: .48; cursor: not-allowed; }
.rail-item.disabled:hover { background: none; color: rgba(244,241,231,.78); }

.rail-foot {
  border-top: 1px solid var(--rail-line);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.rail-hint { font-size: 10.5px; color: rgba(244,241,231,.5); line-height: 1.55; }
.rail-hint b { color: #9FDEC2; font-weight: 600; }

/* —— 主区 —— */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: rgba(245,243,236,.86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.breadcrumb { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; min-width: 0; }
.breadcrumb .crumb-cur { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search {
  flex: 1; max-width: 300px; margin: 0 6px 0 auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full);
  padding: 6px 8px 6px 12px; color: var(--ink-3);
  transition: border-color var(--fast);
}
.topbar-search:focus-within { border-color: var(--brand-bright); box-shadow: 0 0 0 3px rgba(47,143,116,.12); }
.topbar-search input { border: 0; outline: 0; background: none; flex: 1; font-size: 12.5px; }
.topbar-search .ts-hint { font-size: 10.5px; background: var(--paper-2); padding: 1px 7px; border-radius: var(--r-full); color: var(--ink-3); }
.topbar-act { position: relative; }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  transition: all var(--fast);
}
.icon-btn:hover { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--paper); }
.top-user {
  display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 5px;
  border-radius: var(--r-full); border: 1px solid transparent; cursor: pointer;
}
.top-user:hover { background: var(--surface); border-color: var(--line-2); }
.top-user .tu-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.top-user .tu-role { font-size: 10.5px; color: var(--ink-3); }
.top-user svg { width: 14px; height: 14px; color: var(--ink-3); }

/* —— 内容 —— */
.content { padding: 26px clamp(16px, 2.4vw, 48px) 60px; width: 100%; max-width: none; }
.pagehead { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; margin-bottom: 20px; }
.pagehead .ph-left { min-width: 0; }
.kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .22em; color: var(--brand);
  display: flex; align-items: center; gap: 8px; text-transform: uppercase; margin-bottom: 6px;
}
.kicker::before { content: ""; width: 18px; height: 2px; background: var(--brand-bright); border-radius: 2px; }
.pagehead h1 { font-size: 24px; letter-spacing: .01em; line-height: 1.25; }
.pagehead .ph-desc { color: var(--ink-2); font-size: 13px; margin-top: 6px; max-width: 640px; }
.ph-actions { display: flex; align-items: center; gap: 10px; }

.body-grid { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 22px; align-items: start; }
.body-grid .bg-main { min-width: 0; }
.body-grid .bg-side { position: sticky; top: 78px; }

@media (max-width: 1180px) {
  .rail { width: 76px; flex-basis: 76px; }
  .rail .rail-brand { justify-content: center; }
  .rail .brand-text, .rail-scope, .rail-item span, .ri-tag, .rail-group-label span, .rail-foot { display: none; }
  .rail-group-label { justify-content: center; padding: 8px 0; }
  .rail-group-label::after { content: "—"; }
  .rail-item { justify-content: center; }
  .body-grid { grid-template-columns: minmax(0,1fr); }
  .body-grid .bg-side { position: static; }
}

/* 侧栏“需授权”角标内的锁图标自适应 */
.rail-item .ri-tag svg { width: 10px; height: 10px; vertical-align: -1px; }
