/* 登录 / 品牌选择 / 模块选择 / SOP 列表 页面层样式（复用 app.css 的变量与按钮） */

/* ---------- 登录页 ---------- */
.auth-body { display: flex; min-height: 100vh; }
.auth-main {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 18px 32px;
  display: flex;
  align-items: center;
  width: 100%;
}
.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px 24px 24px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px 20px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.login-app-name { font-size: 20px; font-weight: 800; color: var(--ink); }
.login-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%;
  min-height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.login-error {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fdecea;
  color: #a32d2d;
  font-size: 13.5px;
}
.login-submit { width: 100%; }
.login-foot { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 20px; }

/* ---------- 品牌选择 / 模块选择 / SOP 列表 通用页 ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 16px 14px 32px; }

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font-size: 20px; font-weight: 800; }
.page-title .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* 顶栏右侧按钮组：新增SOP + 切品牌 并排 */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.link-btn:active { background: var(--tag); }

/* ---------- 品牌列表 ---------- */
.brand-list { display: grid; gap: 12px; }
.brand-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.brand-item:active { transform: scale(.985); }
/* 品牌 LOGO（客户 2026-11-10 第 2 条）：44px 圆角方块，白底。
   ★ 文字层在底层、图片层用绝对定位盖上去：
     图片存在 → 完全遮住文字；图片 404 → 背景不画、图层透明 → 露出品牌名首字。
     这就是"缺图兜底"，不需要 onerror 也不需要额外请求。
   ★ 圆角 10px 而不是 50%：客户给的三张原图都是正方（带白底），做成圆的会把
     边角的留白切掉，视觉上像被裁过；圆角方图和原图的构图一致。 */
.brand-logo-wrap {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 19px; font-weight: 800;
  line-height: 1;
}
.brand-logo {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
.brand-item .brand-text { flex: 1; min-width: 0; }
.brand-item .name { font-size: 17px; font-weight: 700; }
.brand-item .meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.brand-item .enter { color: var(--brand); font-size: 14px; font-weight: 700; flex: none; }

/* ---------- 模块选择 ---------- */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.module-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.module-item:active { transform: scale(.98); }
.module-item .icon { font-size: 30px; margin-bottom: 10px; }
.module-item .name { font-size: 15px; font-weight: 700; }
.module-item .desc { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.module-item.disabled { opacity: .5; cursor: not-allowed; }
.module-item.disabled .tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag);
  color: var(--ink-3);
  font-size: 11px;
}
@media (min-width: 720px) {
  .module-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- SOP 列表：筛选区 ---------- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.filter-row { display: flex; gap: 8px; }
.filter-bar input[type="text"], .filter-bar select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.filter-bar input[type="text"] { width: 100%; flex: 1; }
.filter-bar select { flex: 1; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--brand); }

.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn {
  flex: 1;
  min-height: 36px;
  font-size: 14px;
  font-weight: 700;
}
.btn-secondary {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line);
}

/* 新增 SOP 按钮（顶栏，小号） */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: var(--touch);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  box-shadow: var(--shadow);
}
.btn-add:active { background: var(--brand-deep); }
.btn-add .plus { font-size: 18px; line-height: 1; }
/* 小号（顶栏内嵌） */
.btn-add-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-add-sm .plus { font-size: 16px; }

.result-count { font-size: 13px; color: var(--ink-3); margin: 4px 0 12px; }

/* ---------- 新建SOP 两步选择 ---------- */
.step-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 16px 0 10px;
}

/* SOP 类型：紧凑分段按钮 */
.sop-type-seg {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.seg-btn {
  flex: 1;
  min-height: 40px;
  border: 0;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.selected {
  background: var(--brand);
  color: #fff;
}

/* ---------- 基础资料：子项列表 ---------- */
.base-list { display: grid; gap: 10px; }
.base-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.base-item:active { transform: scale(.985); }
.base-icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.base-body { flex: 1; min-width: 0; }
.base-name { font-size: 15px; font-weight: 700; }
.base-desc { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.base-enter { color: var(--brand); font-size: 16px; flex: none; }

/* ---------- 分类管理 ---------- */
.cat-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.cat-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cat-icon { font-size: 24px; }
.cat-panel-title { flex: 1; min-width: 0; }
.cat-name { font-size: 16px; font-weight: 700; }
.cat-desc { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tag);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  font-size: 13px;
}
.cat-del {
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.cat-del:active { color: var(--brand); }
.cat-empty { font-size: 13px; color: var(--ink-3); }
.cat-add-row { display: flex; gap: 8px; }
.cat-input {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}
.cat-input:focus { border-color: var(--brand); }
