/* =============================================================================
 * 开放平台 · 自助控制台样式（沿用站点 Cursor 风格 token，叠加 mall.css 组件）
 * ========================================================================== */

.op-wrap {
  padding-top: 26px;
  padding-bottom: 80px;
  min-height: 62vh;
}

.op-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 20px;
  flex-wrap: wrap;
}

.op-head h1 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

.op-bound {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.op-bound .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.op-bound b {
  font-family: var(--font-mono);
  font-weight: 550;
  color: var(--text-strong);
}

/* ---------- 场景引导横幅（近黑高级感，与首页 mallband 同族） ---------- */

.op-scene {
  position: relative;
  overflow: hidden;
  border-radius: var(--of-r-lg);
  padding: 26px 30px;
  margin-bottom: 22px;
  background:
    linear-gradient(100deg, rgba(16, 16, 20, 0.92) 32%, rgba(16, 16, 20, 0.5) 100%),
    url("../img/band-art-dark.webp") right center / cover no-repeat,
    #101014;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.op-scene h2 {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.op-scene p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
  max-width: 760px;
}

.op-scene .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.op-scene .sc {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.op-scene .sc:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ---------- 访客态 / 绑定域名 onboarding ---------- */

.op-gate {
  max-width: 520px;
  margin: 40px auto;
  padding: 40px 38px;
  border: 1px solid var(--border);
  border-radius: var(--of-r-lg);
  background: var(--bg-card);
  text-align: center;
}

.op-gate .brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 20px;
  margin: 0 auto 18px;
}

.op-gate h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
}

.op-gate p {
  margin: 10px 0 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: left;
}

.op-gate .steps {
  text-align: left;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.op-gate .steps li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.op-gate .steps .no {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(3px);
}

.op-bind-input {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.op-bind-input input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: var(--bg-input);
  font-size: 13.5px;
  font-family: var(--font-mono);
  outline: none;
}

.op-bind-input input:focus {
  border-color: var(--accent);
}

.op-err {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--red);
  text-align: left;
}

.op-hint {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.7;
}

/* ---------- 应用列表 ---------- */

.op-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.op-toolbar h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-strong);
  flex: 1;
}

.op-table {
  border: 1px solid var(--border);
  border-radius: var(--of-r-md);
  background: var(--bg-app);
  overflow: hidden;
}

.op-row {
  display: grid;
  grid-template-columns: 1.4fr 1.5fr 1.6fr 0.7fr 1fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.op-row:last-child {
  border-bottom: none;
}

.op-row.head {
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
}

.op-row .name {
  font-weight: 650;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-row .appid {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-row .scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.op-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10.5px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.op-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.op-st .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.op-st.on { color: var(--green); }
.op-st.on .dot { background: var(--green); }
.op-st.off { color: var(--text-muted); }
.op-st.off .dot { background: var(--text-faint); }

.op-row .time {
  font-size: 11.5px;
  color: var(--text-muted);
}

.op-row .acts {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  font-size: 12.5px;
  white-space: nowrap;
}

.op-row .acts a {
  color: var(--accent);
  cursor: pointer;
}

.op-row .acts a:hover {
  text-decoration: underline;
}

.op-row .acts a.danger {
  color: var(--red);
}

.op-empty {
  padding: 64px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.op-empty .icon {
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* ---------- 弹窗内部（复用 mall.css 的 .od-kv / .cardkey，补充以下） ---------- */

.op-form-row {
  margin-bottom: 14px;
}

.op-form-row .lb {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 7px;
}

.op-form-row .lb i {
  color: var(--red);
  font-style: normal;
}

.op-form-row .lb .d {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
}

.op-form-row input[type="text"],
.op-form-row input[type="number"],
.op-form-row textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-input);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.op-form-row textarea {
  min-height: 64px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.op-form-row input:focus,
.op-form-row textarea:focus {
  border-color: var(--accent);
}

.op-form-row .tip {
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.op-scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.op-scope {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.op-scope:hover {
  border-color: var(--border-light);
}

.op-scope.on {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.op-scope .ck {
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  background: var(--bg-input);
}

.op-scope.on .ck {
  background: var(--accent);
  border-color: var(--accent);
}

.op-scope b {
  display: block;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-strong);
}

.op-scope span {
  font-size: 11px;
  color: var(--text-muted);
}

.op-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.op-presets .sc {
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.op-presets .sc:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 单选 pill（门店范围） */
.op-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-primary);
}

.op-radio .o {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-light);
  background: var(--bg-input);
}

.op-radio.on .o {
  border: 4.5px solid var(--accent);
}

.op-store-chips {
  margin-top: 10px;
}

.op-store-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  margin: 0 6px 6px 0;
  border-radius: 7px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
}

.op-store-chips .chip .x {
  cursor: pointer;
  opacity: 0.7;
}

.op-store-chips .chip .x:hover {
  opacity: 1;
  color: var(--red);
}

.op-store-chips input {
  width: 150px;
  padding: 3px 10px;
  border: 1px dashed var(--border-light);
  border-radius: 7px;
  background: var(--bg-input);
  font-size: 12px;
  outline: none;
}

/* 密钥仅展示一次 */
.op-keybox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-panel);
  margin-bottom: 10px;
}

.op-keybox .k {
  flex: none;
  width: 76px;
  font-size: 11px;
  color: var(--text-muted);
}

.op-keybox .v {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12.5px;
  word-break: break-all;
  color: var(--text-strong);
  user-select: text;
}

.op-warn {
  border: 1px solid color-mix(in srgb, var(--red) 34%, transparent);
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12.3px;
  color: var(--red);
  line-height: 1.7;
  margin: 12px 0;
}

.op-okhead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.op-okhead .oc {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.op-okhead strong {
  display: block;
  font-size: 15px;
  color: var(--text-strong);
}

.op-okhead span {
  font-size: 12px;
  color: var(--text-muted);
}

.op-ckrow {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.op-ckrow .ck {
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  background: var(--bg-input);
}

.op-ckrow.on .ck {
  background: var(--accent);
  border-color: var(--accent);
}

/* 密钥版本行 */
.op-keyrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.op-keyrow .ver {
  flex: none;
  width: 30px;
  font-weight: 700;
  color: var(--text-strong);
  font-family: var(--font-mono);
}

.op-keyrow .mask {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-keyrow .meta {
  flex: none;
  font-size: 11px;
  color: var(--text-muted);
}

.op-tag {
  flex: none;
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
}

.op-tag.ok { background: var(--green-soft); color: var(--green); }
.op-tag.warn { background: var(--yellow-soft); color: var(--yellow); }
.op-tag.gray { background: var(--bg-active); color: var(--text-muted); }
.op-tag.err { background: var(--red-soft); color: var(--red); }

/* 详情弹窗小节 */
.op-sec {
  margin-bottom: 18px;
}

.op-sec > h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.op-sec > h4 .rt {
  margin-left: auto;
  font-weight: 500;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.op-sec > h4 .rt:hover {
  text-decoration: underline;
}

/* 统计 mini */
.op-stat3 {
  display: flex;
  gap: 8px;
}

.op-stat {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-card);
  padding: 10px 12px;
}

.op-stat .n {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
}

.op-stat .n.red { color: var(--red); }

.op-stat .l {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.op-gateway-empty {
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--border-light);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

/* 响应式 */
@media (max-width: 860px) {
  .op-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .op-row.head {
    display: none;
  }

  .op-row .acts {
    justify-content: flex-start;
  }

  .op-scope-grid {
    grid-template-columns: 1fr;
  }
}
