#oj-api-key-manager[hidden] { display: none !important; }
body.oj-key-open { overflow: hidden !important; }
#oj-api-key-manager, #oj-api-key-manager * { box-sizing: border-box; }
#oj-api-key-manager {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  color: #eef1f5;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.oj-key-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 9, .72);
  backdrop-filter: blur(12px);
}
.oj-key-dialog {
  width: min(1040px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: #15181e;
  box-shadow: 0 24px 90px rgba(0,0,0,.5);
}
.oj-key-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.oj-key-header h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.oj-key-header p { margin: 6px 0 0; color: #8e96a4; font-size: 13px; }
.oj-key-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px;
  background: transparent;
  color: #b9c0cb;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.oj-key-icon-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.oj-key-body { min-height: 260px; overflow: auto; padding: 20px 24px 24px; }
.oj-key-auth-state { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.oj-key-auth-state[hidden] { display: none !important; }
.oj-key-auth-state h3 { margin: 14px 0 8px; color: #f3f5f8; font-size: 18px; }
.oj-key-auth-state p { max-width: 460px; margin: 0; color: #9aa4b3; font-size: 13px; line-height: 1.8; }
.oj-key-auth-state small { margin-top: 12px; color: #727d8d; font-size: 12px; }
.oj-key-auth-state > button {
  min-width: 142px;
  height: 42px;
  margin-top: 20px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: #d4a83d;
  color: #16130a;
  font: 600 14px/1 inherit;
  cursor: pointer;
}
.oj-key-auth-state > button:hover { filter: brightness(1.06); }
.oj-key-auth-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212,168,61,.3);
  border-radius: 16px;
  background: rgba(212,168,61,.08);
  color: #e4c261;
}
.oj-key-auth-error h3 { color: #ffb1b1; }
.oj-key-auth-error > button { background: #313843; color: #eef1f5; }
.oj-key-auth-checking { gap: 14px; color: #9aa4b3; }
.oj-key-auth-checking p { color: #9aa4b3; }
.oj-key-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,.14);
  border-top-color: #d4a83d;
  border-radius: 50%;
  animation: oj-key-spin .8s linear infinite;
}
@keyframes oj-key-spin { to { transform: rotate(360deg); } }
.oj-key-create { padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.025); }
.oj-key-create label { display: block; margin-bottom: 8px; color: #aab2c0; font-size: 12px; }
.oj-key-create-row { display: flex; gap: 10px; }
.oj-key-create input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 9px;
  outline: none;
  background: #0f1217;
  color: #f4f6fa;
  font: inherit;
}
.oj-key-create input:focus { border-color: #d4a83d; box-shadow: 0 0 0 3px rgba(212,168,61,.12); }
.oj-key-create button, .oj-key-footer button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: #d4a83d;
  color: #16130a;
  font: 600 13px/1 inherit;
  cursor: pointer;
}
.oj-key-create button:disabled { opacity: .55; cursor: wait; }
.oj-key-message { display: none; margin: 12px 0; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.oj-key-message.is-visible { display: block; }
.oj-key-message.is-info { color: #b8c2d2; background: rgba(100,130,180,.13); }
.oj-key-message.is-success { color: #74d99a; background: rgba(35,160,90,.12); }
.oj-key-message.is-error { color: #ff9b9b; background: rgba(220,60,60,.12); }
.oj-key-created { margin-top: 14px; padding: 13px 14px; border: 1px solid rgba(212,168,61,.3); border-radius: 10px; background: rgba(212,168,61,.08); }
.oj-key-created-head { margin-bottom: 9px; color: #e7c96f; font-size: 13px; font-weight: 600; }
.oj-key-created-row { display: flex; align-items: center; gap: 9px; }
.oj-key-created code { flex: 1; overflow-wrap: anywhere; color: #f3e7bc; font-size: 12px; }
.oj-key-created button, .oj-key-mini-btn {
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  color: #c8d0dc;
  font: 12px/1 inherit;
  cursor: pointer;
}
.oj-key-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; }
.oj-key-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13px; }
.oj-key-table th { padding: 12px 14px; background: rgba(255,255,255,.035); color: #8f98a7; font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
.oj-key-table td { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); color: #d3d9e2; vertical-align: middle; }
.oj-key-table th:nth-child(2), .oj-key-table td:nth-child(2) { min-width: 260px; }
.oj-key-table th:last-child, .oj-key-table td:last-child { width: 74px; }
.oj-key-value { display: flex; align-items: center; gap: 8px; }
.oj-key-value code { color: #b9c7dc; font-size: 12px; white-space: nowrap; }
.oj-key-status { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.oj-key-status.is-active { color: #75da9c; background: rgba(40,170,95,.13); }
.oj-key-status.is-disabled { color: #aab2bf; background: rgba(140,150,165,.13); }
.oj-key-danger-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255,105,105,.28);
  border-radius: 7px;
  background: rgba(220,60,60,.07);
  color: #ff9c9c;
  font: 12px/1 inherit;
  cursor: pointer;
}
.oj-key-danger-btn:hover { background: rgba(220,60,60,.14); }
.oj-key-empty { padding: 64px 16px !important; color: #7e8795 !important; text-align: center; }
.oj-key-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid rgba(255,255,255,.09); color: #8e96a4; font-size: 12px; }
.oj-key-footer code { color: #c4ccd8; }
.oj-key-footer button { height: 32px; background: #2a303a; color: #e6eaf0; }
html[data-theme="light"] #oj-api-key-manager { color: #1b2230; }
html[data-theme="light"] .oj-key-backdrop { background: rgba(15,23,38,.38); }
html[data-theme="light"] .oj-key-dialog { border-color: rgba(20,30,45,.14); background: #fff; box-shadow: 0 24px 80px rgba(20,30,45,.22); }
html[data-theme="light"] .oj-key-header, html[data-theme="light"] .oj-key-footer { border-color: rgba(20,30,45,.1); }
html[data-theme="light"] .oj-key-header p, html[data-theme="light"] .oj-key-footer, html[data-theme="light"] .oj-key-empty { color: #667085 !important; }
html[data-theme="light"] .oj-key-auth-state h3 { color: #1b2230; }
html[data-theme="light"] .oj-key-auth-state p, html[data-theme="light"] .oj-key-auth-checking { color: #667085; }
html[data-theme="light"] .oj-key-auth-state small { color: #8b95a5; }
html[data-theme="light"] .oj-key-auth-icon { border-color: rgba(154,113,15,.25); background: #fff8e7; color: #8a640d; }
html[data-theme="light"] .oj-key-auth-error h3 { color: #b42318; }
html[data-theme="light"] .oj-key-spinner { border-color: rgba(20,30,45,.14); border-top-color: #b88619; }
html[data-theme="light"] .oj-key-create { border-color: rgba(20,30,45,.11); background: #f7f8fa; }
html[data-theme="light"] .oj-key-create label, html[data-theme="light"] .oj-key-table th { color: #667085; }
html[data-theme="light"] .oj-key-create input { border-color: rgba(20,30,45,.16); background: #fff; color: #18202d; }
html[data-theme="light"] .oj-key-table-wrap { border-color: rgba(20,30,45,.1); }
html[data-theme="light"] .oj-key-table th { background: #f7f8fa; }
html[data-theme="light"] .oj-key-table td { border-color: rgba(20,30,45,.08); color: #344054; }
html[data-theme="light"] .oj-key-value code { color: #475467; }
html[data-theme="light"] .oj-key-icon-btn, html[data-theme="light"] .oj-key-mini-btn { border-color: rgba(20,30,45,.15); color: #475467; }
html[data-theme="light"] .oj-key-created { background: #fff8e7; }
html[data-theme="light"] .oj-key-created-head, html[data-theme="light"] .oj-key-created code { color: #7a5b0c; }
html[data-theme="light"] .oj-key-footer button { background: #eef1f6; color: #263247; }
/* Hide the copied upstream key manager if another page path opens it. */
[data-slot="miyao-tanchuang"], .kaifangapi-qianru[data-slot="miyao-tanchuang"] { display: none !important; }
@media (max-width: 700px) {
  .oj-key-backdrop { padding: 12px; }
  .oj-key-dialog { max-height: calc(100vh - 24px); border-radius: 14px; }
  .oj-key-header, .oj-key-body, .oj-key-footer { padding-left: 16px; padding-right: 16px; }
  .oj-key-create-row { flex-direction: column; }
  .oj-key-create button { width: 100%; }
}
