/* 伽优美 · 设计中心（/design 总入口）
   与 start.css 同源视觉：玫红 #E03060、大图标、大按钮。
   本文件只补「总入口宫格」与「权限面板」两块的样式。 */

/* ===== 首屏标语 ===== */
.hero { text-align: center; padding: 26px 0 30px; }
.hero h2 { font-size: 28px; font-weight: 700; letter-spacing: 1px; }
.hero p { color: var(--muted); font-size: 15px; margin-top: 8px; }

/* ===== 总入口宫格 ===== */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  max-width: 900px;
  margin: 0 auto;
}

.design-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 26px 30px;
  text-align: center;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  position: relative;
  overflow: hidden;
}
.design-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--brand); opacity: 0; transition: opacity .16s ease;
}
.design-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(224, 48, 96, .14);
  border-color: var(--brand);
}
.design-card:hover::before { opacity: 1; }

.design-card .d-icon {
  width: 78px; height: 78px; margin: 0 auto 18px;
  border-radius: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 38px; background: var(--brand-soft); color: var(--brand);
}
.design-card .d-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.design-card .d-desc {
  font-size: 13px; color: var(--muted); line-height: 1.7; min-height: 44px;
}
.design-card .d-go {
  display: inline-block; margin-top: 16px; padding: 8px 22px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 600;
}

/* 权限卡：视觉上区别于业务卡（描边式，强调「仅董事长」） */
.design-card.admin {
  border-style: dashed;
  border-color: #d1a5b5;
  background: linear-gradient(180deg, #fff 0%, var(--brand-soft) 130%);
}
.design-card.admin .d-icon { background: #fff; }
.design-card.admin .d-go {
  background: #fff; color: var(--brand); border: 1px solid var(--brand);
}

/* 未授权：置灰不可点 */
.design-card.locked {
  opacity: .5; cursor: not-allowed; filter: grayscale(.6);
}
.design-card.locked:hover { transform: none; box-shadow: none; border-color: var(--line); }
.design-card.locked::before { display: none; }
.design-card .d-lock {
  position: absolute; top: 14px; right: 16px; font-size: 17px; opacity: .65;
}

.design-foot {
  max-width: 900px; margin: 34px auto 0; text-align: center;
  font-size: 13px; color: var(--muted); line-height: 1.9;
}

/* ===== 权限面板 ===== */
.perm-wrap { max-width: 1080px; margin: 0 auto; }
.perm-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.perm-head h2 { font-size: 24px; font-weight: 700; }
.perm-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }

.perm-table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.perm-table th, .perm-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  font-size: 14px; text-align: left; vertical-align: middle;
}
.perm-table th { background: #fafbfc; font-weight: 600; color: #374151; font-size: 13px; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table .p-name { font-weight: 600; }
.perm-table .p-sub { font-size: 12px; color: var(--muted); }

.perm-cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sw {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: #fff; user-select: none;
}
.sw.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sw.on::before { content: "✓"; font-weight: 700; }
.sw.off::before { content: "—"; color: var(--muted); }
.sw.limb { border-style: dashed; }
.sw.deny { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.sw.deny::before { content: "✕"; font-weight: 700; }

.perm-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.perm-note {
  margin-top: 18px; padding: 14px 18px; border-radius: 12px;
  background: var(--warn-soft); color: #92400e; font-size: 13px; line-height: 1.8;
}
.perm-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .design-grid { grid-template-columns: 1fr; }
  .perm-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ===== 自绘确认弹层（铁律：禁用原生 confirm/prompt/alert） =====
   design.html 是独立页面，没有 start.html 里预置的 #confirm-modal，
   故在此自带一套 .ask-mask / .ask-box。 */
.ask-mask {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 18, 25, .62); padding: 20px;
  animation: askIn .16s ease;
}
@keyframes askIn { from { opacity: 0; } to { opacity: 1; } }
.ask-box {
  width: min(420px, 94vw); background: #fff; border-radius: 16px;
  padding: 24px 24px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  animation: askPop .18s ease;
}
@keyframes askPop {
  from { transform: translateY(10px) scale(.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.ask-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.ask-body { font-size: 14px; color: #374151; line-height: 1.8; margin-bottom: 20px; }
.ask-foot { display: flex; gap: 10px; }
.ask-foot .mini-btn {
  flex: 1; padding: 10px 0; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font-size: 14px; font-family: inherit;
}
.ask-foot .mini-btn:hover { background: #f6f7f9; }
.ask-foot .mini-btn.play {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.ask-foot .mini-btn.play:hover { filter: brightness(1.08); }
.ask-foot .mini-btn.danger {
  background: #fff; color: var(--bad); border-color: #fca5a5;
}
.ask-foot .mini-btn.danger:hover { background: var(--bad); color: #fff; }
/* 删除确认弹层里的风险提示块（v4.16 董事长指令十六「权限页要有删除键」） */
.ask-warn {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca;
  color: #991b1b; font-size: 13px; line-height: 1.75;
}

/* 权限表内删除键（行内小按钮，非弹层） */
.perm-table .mini-btn.danger {
  padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid #fca5a5; background: #fff; color: var(--bad);
  font-size: 13px; font-family: inherit;
}
.perm-table .mini-btn.danger:hover { background: var(--bad); color: #fff; }
/* 删除列窄一点，别挤占授权开关 */
.perm-table th:last-child, .perm-table td:last-child { width: 1%; white-space: nowrap; }

/* 权限表内角色下拉 */
.role-sel {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-family: inherit; cursor: pointer;
}
.role-sel:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

/* ===== 管理后台紧凑小面板（v4.17 指令十七「不要弹出来大屏幕」）=====
   不再整页替换，改为居中小窗：max-width 780px、内部滚动、关闭即回宫格。 */
.perm-modal { position: fixed; inset: 0; z-index: 1100; }
.pm-mask {
  position: absolute; inset: 0; background: rgba(15, 18, 25, .55);
  animation: askIn .16s ease;
}
.pm-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(780px, 94vw); max-height: 84vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: askPop .18s ease;
}
.pm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.pm-title { font-size: 17px; font-weight: 700; }
.pm-tools { display: flex; gap: 10px; align-items: center; }
.pm-tools .mini-btn.play {
  padding: 7px 16px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--brand); background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 600; font-family: inherit;
}
.pm-tools .mini-btn.play:hover { filter: brightness(1.08); }
.pm-x {
  width: 30px; height: 30px; border-radius: 8px; border: none; cursor: pointer;
  background: transparent; font-size: 15px; color: var(--muted); font-family: inherit;
}
.pm-x:hover { background: #f3f4f6; color: #111; }
.pm-body { padding: 6px 20px 12px; overflow: auto; }
.pm-foot {
  padding: 10px 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.6;
}
.pm-body .perm-table th, .pm-body .perm-table td { padding: 10px 12px; }

/* ===== 增加人员：自绘表单字段（禁用原生输入框口径） ===== */
.ask-row { margin-bottom: 12px; }
.ask-lab { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.ask-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.ask-input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
select.ask-input { cursor: pointer; }
.ask-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer; padding: 4px 0; user-select: none;
}
.ask-check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
