/* ============================================
   STAR · 开发者控制台（dev.html）
   复用 css/style.css 的设计令牌，只补充开发页布局。
   纯文本状态，无 Emoji；桌面双列，移动端单列。
   ============================================ */

.dev-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(47, 107, 168, 0.10), transparent 62%),
    var(--bg-base);
  color: var(--text-ink);
}

/* ---------- 顶栏 ---------- */
.dev-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--divider);
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.dev-back {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--divider-strong);
  border-radius: 8px;
  color: var(--text-body);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .2s var(--ease-smooth), color .2s var(--ease-smooth);
}

.dev-back:hover {
  border-color: var(--blue-accent);
  color: var(--blue-deep);
}

.dev-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dev-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.dev-brand strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .02em;
}

.dev-brand span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dev-topbar-note {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ---------- 布局 ---------- */
.dev-wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 32px) 72px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "env send"
    "maker cache"
    "blank blank";
  gap: 18px;
  align-items: start;
}

.dev-panel[data-panel="env"] { grid-area: env; }
.dev-panel[data-panel="send"] { grid-area: send; }
.dev-panel[data-panel="maker"] { grid-area: maker; }
.dev-panel[data-panel="cache"] { grid-area: cache; }
.dev-panel[data-panel="blank"] { grid-area: blank; }

.dev-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.dev-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.dev-panel-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.dev-tag {
  flex: none;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.dev-desc {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---------- 按钮 ---------- */
.dev-btn {
  padding: 10px 16px;
  border: 1px solid var(--divider-strong);
  border-radius: 8px;
  background: var(--white-pure);
  color: var(--text-body);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s var(--ease-smooth), border-color .18s var(--ease-smooth), color .18s var(--ease-smooth), background .18s var(--ease-smooth);
}

.dev-btn:hover {
  border-color: var(--blue-accent);
  color: var(--blue-deep);
  transform: translateY(-1px);
}

.dev-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.dev-btn-primary {
  border-color: var(--blue-deep);
  background: var(--blue-deep);
  color: #FFFFFF;
}

.dev-btn-primary:hover {
  border-color: var(--blue-accent);
  background: var(--blue-accent);
  color: #FFFFFF;
}

.dev-btn-ghost {
  padding: 7px 11px;
  font-size: 10.5px;
}

.dev-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.dev-hint {
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- 环境检测 ---------- */
.dev-env-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--divider);
}

.dev-env-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}

.dev-env-label {
  display: block;
  font-weight: 700;
}

.dev-env-detail {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.dev-env-state {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
}

.dev-env-state.pass { color: #067647; }
.dev-env-state.fail { color: #B42318; }

.dev-empty {
  padding: 12px 0;
  color: var(--text-faint);
  font-size: 11px;
}

/* ---------- 卡片制作 ---------- */
.dev-drop {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px;
  border: 1px dashed var(--divider-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: border-color .2s var(--ease-smooth), background .2s var(--ease-smooth);
}

.dev-drop:hover,
.dev-drop:focus-within {
  border-color: var(--blue-accent);
  background: rgba(255, 255, 255, 0.72);
}

.dev-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.dev-drop-title {
  font-size: 12.5px;
  font-weight: 700;
}

.dev-drop-note {
  color: var(--text-faint);
  font-size: 10.5px;
}

.dev-preview {
  margin: 14px 0 0;
  border: 1px solid var(--divider);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-panel);
}

.dev-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #100F0C;
}

.dev-preview figcaption {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
  word-break: break-all;
}

.dev-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.dev-field label {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
}

.dev-field input,
.dev-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--divider-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
}

.dev-field textarea {
  min-height: 76px;
  resize: vertical;
}

.dev-field input:focus,
.dev-field textarea:focus {
  border-color: var(--blue-accent);
  outline: 2px solid rgba(47, 107, 168, 0.20);
}

/* ---------- 发送状态 ---------- */
.dev-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--divider-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-body);
  font-size: 12px;
  font-weight: 700;
}

.dev-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.dev-status[data-state="ok"] {
  border-color: rgba(6, 118, 71, 0.32);
  color: #067647;
}

.dev-status[data-state="ok"]::before { background: #067647; }

.dev-status[data-state="error"] {
  border-color: rgba(180, 35, 24, 0.32);
  color: #B42318;
}

.dev-status[data-state="error"]::before { background: #B42318; }

.dev-status[data-state="busy"] {
  border-color: rgba(181, 71, 8, 0.32);
  color: #B54708;
}

.dev-status[data-state="busy"]::before {
  background: #B54708;
  animation: dev-pulse 1s var(--ease-smooth) infinite;
}

@keyframes dev-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* ---------- 缓存列表 ---------- */
.dev-cache-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.dev-cache-head strong {
  font-size: 12px;
  letter-spacing: .01em;
}

.dev-cache-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--divider);
}

.dev-cache-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}

.dev-cache-list strong {
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.dev-cache-list code {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  word-break: break-all;
}

.dev-note {
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.7;
}

/* ---------- 空白档案卡 ---------- */
.bc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 22px;
  align-items: start;
  margin-top: 6px;
}

.bc-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bc-field-row .dev-field {
  margin-top: 12px;
}

.bc-file {
  flex: 1;
  min-width: 0;
  margin-top: 2px;
}

.bc-preview-wrap {
  min-width: 0;
}

.bc-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid #D8D2C4;
  border-radius: 12px;
  background: linear-gradient(180deg, #FBFAF6, #F2EFE7);
  color: #141821;
  box-shadow: 0 14px 34px -22px rgba(16, 24, 40, 0.35);
}

.bc-side {
  min-width: 0;
}

.bc-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  aspect-ratio: 1;
  border: 1px solid rgba(20, 24, 33, 0.12);
  border-radius: 12px;
  background: #E4E0D5;
  overflow: hidden;
}

.bc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#bcPreviewMono {
  color: #22527F;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 46px;
  line-height: 1;
}

.bc-id {
  display: inline-block;
  max-width: 118px;
  margin-top: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #22527F;
  color: #FFFFFF;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: .05em;
  word-break: break-all;
}

.bc-side-lines {
  margin-top: 14px;
}

.bc-side-lines span {
  display: block;
  height: 5px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(20, 24, 33, 0.10);
}

.bc-side-lines span:nth-child(2) { width: 82%; }
.bc-side-lines span:nth-child(3) { width: 60%; }

.bc-main {
  min-width: 0;
}

.bc-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #22527F;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: .08em;
}

.bc-mark {
  color: #9AA1AB;
}

.bc-name {
  margin: 8px 0 2px;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 26px;
  line-height: 1.22;
  letter-spacing: -.01em;
  word-break: break-word;
}

.bc-name-en {
  color: #6C7480;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  word-break: break-word;
}

.bc-lead {
  margin: 10px 0;
  color: #333A44;
  font-size: 11px;
  line-height: 1.65;
  word-break: break-word;
}

.bc-works {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.bc-works img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(20, 24, 33, 0.10);
  border-radius: 6px;
  object-fit: cover;
}

.bc-works-empty {
  grid-column: 1 / -1;
  padding: 14px 10px;
  border: 1px dashed rgba(20, 24, 33, 0.18);
  border-radius: 6px;
  color: #9AA1AB;
  font-size: 9.5px;
  text-align: center;
}

.bc-content {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(20, 24, 33, 0.12);
  color: #333A44;
  font-size: 10.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 156px;
  overflow: hidden;
}

.bc-pair {
  margin-top: 16px;
  border-top: 1px solid var(--divider);
  padding-top: 12px;
}

.bc-pair summary {
  color: var(--text-body);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.bc-pair summary::-webkit-details-marker { display: none; }

.bc-pair summary::before {
  content: '＋';
  display: inline-block;
  width: 16px;
  color: var(--blue-deep);
  font-weight: 700;
}

.bc-pair[open] summary::before { content: '－'; }

.bc-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.bc-pair-col {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.38);
}

.bc-pair-col h4 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 10.5px;
  letter-spacing: .06em;
}

.bc-pair-col textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 58px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--divider-strong);
  border-radius: 7px;
  background: #12110E;
  color: #E6DFCC;
  font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  resize: vertical;
}

.bc-pair-col .dev-btn {
  width: 100%;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .dev-wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "env"
      "maker"
      "send"
      "cache"
      "blank";
  }

  .dev-topbar-note {
    display: none;
  }

  .bc-layout {
    grid-template-columns: 1fr;
  }

  .bc-pair-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .dev-topbar {
    gap: 10px;
    padding: 10px 14px;
  }

  .dev-back {
    padding: 7px 10px;
    font-size: 11px;
  }

  .dev-brand span {
    display: none;
  }

  .dev-panel {
    padding: 17px;
  }

  .dev-preview img {
    max-height: 220px;
  }
}
