/* 产品管理系统 - 面板样式（GitHub 风格浅色主题） */
:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #0969da;
  --developing: #0969da;
  --deployed: #1a7f37;
  --paused: #9a6700;
  --archived: #6e7781;
  --planned: #8250df;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.3; }
code {
  background: #eff2f5;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  word-break: break-all;
}
.muted { color: var(--muted); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- 顶栏 ---- */
.topbar {
  background: #24292f;
  color: #fff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner { display: flex; align-items: center; gap: 20px; }
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: #f78166; margin-right: 2px; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input {
  width: 100%;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #57606a;
  background: #24292f;
  color: #fff;
  font-size: 13px;
}
.search input::placeholder { color: #8b949e; }
.search input:focus { outline: none; border-color: var(--accent); background: #fff; color: var(--text); }

/* ---- 列表页 ---- */
.page-head { margin: 24px 0 16px; }
.page-head h1 { font-size: 20px; }
.count {
  display: inline-block;
  background: #eff2f5;
  color: var(--muted);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  vertical-align: 2px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  color: var(--text);
  font-size: 13px;
  background: var(--card);
}
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip b { font-weight: 600; color: var(--muted); margin-left: 2px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active b { color: #d5e4f7; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(31, 35, 40, 0.12);
  transform: translateY(-2px);
}
.card-cover {
  height: 160px;
  background: #eef1f4;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  cursor: zoom-in;
}
.cover-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a8b2bd;
  font-size: 13px;
  letter-spacing: 2px;
}
.card-body { padding: 14px 16px 6px; flex: 1; }
.card-title-row { display: flex; align-items: center; gap: 8px; }
.card-title-row h3 { font-size: 16px; margin: 0; }
.card-brief {
  margin: 6px 0 10px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 20px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: #ddf4ff;
  color: #0969da;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.card-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid #eaeef2;
  font-size: 12.5px;
  color: var(--text);
}
.card-foot .time { margin-left: auto; }

/* ---- 状态徽章 ---- */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-developing { color: var(--developing); background: #ddf4ff; border-color: #b6e3ff; }
.badge-deployed { color: var(--deployed); background: #dafbe1; border-color: #aceebb; }
.badge-paused { color: var(--paused); background: #fff8c5; border-color: #d4a72c66; }
.badge-archived { color: var(--archived); background: #eff2f5; border-color: #d0d7de; }
.badge-planned { color: var(--planned); background: #fbefff; border-color: #e5d5fd; }

/* ---- 详情页 ---- */
.detail-head { margin: 24px 0 8px; }
.back { font-size: 13px; }
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.detail-title-row h1 { font-size: 24px; margin: 0; }
.version {
  background: #eff2f5;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.detail-brief { font-size: 15px; margin: 8px 0 4px; }
.meta-line { font-size: 13px; margin-top: 2px; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  margin: 20px 0 40px;
}
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
}
.section { margin-bottom: 28px; }
.section h2 {
  font-size: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.shot-item { margin: 0; }
.shot-item img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
  cursor: zoom-in;
  background: #fff;
}
.shot-item figcaption {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Markdown 渲染 ---- */
.markdown { font-size: 14.5px; }
.markdown h1, .markdown h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown h1 { font-size: 20px; }
.markdown h2 { font-size: 17px; }
.markdown h3 { font-size: 15px; }
.markdown pre {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-x: auto;
}
.markdown pre code { background: none; padding: 0; }
.markdown blockquote {
  margin: 8px 0;
  padding: 2px 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.markdown table { border-collapse: collapse; margin: 10px 0; }
.markdown th, .markdown td {
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 13.5px;
}
.markdown th { background: #f6f8fa; }
.markdown img { max-width: 100%; }

/* ---- 侧栏 ---- */
.side-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.side-card h3 { font-size: 14px; margin-bottom: 10px; }
.side-card dl { margin: 0; }
.side-card dt { font-size: 12px; color: var(--muted); margin-top: 10px; }
.side-card dt:first-child { margin-top: 0; }
.side-card dd { margin: 3px 0 0; word-break: break-all; }
.docs-note p { margin: 0 0 10px; font-size: 13px; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}
.btn:hover { text-decoration: none; background: #0860ca; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  padding: 8px 0 8px 14px;
  border-left: 2px solid var(--border);
  position: relative;
  font-size: 13px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.tl-head { display: flex; justify-content: space-between; gap: 8px; }

/* ---- 空状态 / 灯箱 / 页脚 ---- */
.empty {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 60px 20px;
  margin: 30px 0 50px;
}
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 30px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.footer {
  color: var(--muted);
  font-size: 12.5px;
  padding: 20px 20px 30px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ---- 顶栏导航与用户区 ---- */
.topnav { display: flex; gap: 16px; }
.topnav a { color: #c9d1d9; font-size: 13.5px; }
.topnav a:hover { color: #fff; text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.username { color: #fff; font-size: 13.5px; font-weight: 600; }
.linklike {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 13px; padding: 0;
}
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: #cf222e; }

/* ---- 认证页 ---- */
.auth-wrap { display: flex; justify-content: center; padding: 60px 0 40px; }
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; width: 400px; max-width: 100%;
}
.auth-card.wide { width: 520px; }
.auth-card h1 { font-size: 20px; margin-bottom: 18px; }
.auth-card label { display: block; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.auth-card input[type="text"], .auth-card input[type="password"],
.auth-card input[type="email"], .auth-card input[type="url"] {
  display: block; width: 100%; margin-top: 5px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-tip { font-size: 13px; margin: 14px 0 16px; }
.auth-card .btn-block { width: 100%; margin-top: 6px; }
.notice { border-radius: 6px; padding: 9px 12px; font-size: 13px; margin: 0 0 14px; }
.notice.ok { background: #dafbe1; color: #116329; border: 1px solid #aceebb; }
.notice.err { background: #ffebe9; color: #a40e26; border: 1px solid #ffcecb; }
.captcha-row { display: flex; gap: 10px; align-items: center; margin-top: 5px; }
.captcha-row input { flex: 1; margin-top: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; letter-spacing: 2px; }
.captcha-img { border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: #f6f8fa; }
.resend-form { margin-top: 14px; text-align: center; }

/* ---- 徽章扩展与下载按钮 ---- */
.badge-source { background: #f0e8ff; color: #6639ba; border: 1px solid #ddcffa; cursor: pointer; }
.badge a.badge-source:hover, a.badge-source:hover { text-decoration: none; filter: brightness(0.96); }
.btn-dl { margin-left: auto; font-size: 13px; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

/* ---- 分类 ---- */
.chips-label { font-size: 13px; color: var(--muted); align-self: center; margin-right: 2px; }
.tag-cat { background: #eceef1; color: #57606a; }
.cat-form { margin-bottom: 12px; }
.cat-form label { font-size: 12px; color: var(--muted); }
.cat-row { display: flex; gap: 8px; align-items: center; }
.cat-row select, .cat-row input[type="text"] {
  flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.cat-manage { max-width: 720px; }
.cat-manage h3 { margin: 18px 0 10px; font-size: 14px; }
.cat-table { width: 100%; border-collapse: collapse; }
.cat-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid #eaeef2; font-size: 13.5px; vertical-align: middle; }
.cat-ops { display: flex; gap: 18px; justify-content: flex-end; }
.cat-ops input[type="text"] { width: 140px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.empty-inline { padding: 24px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: 13.5px; }

/* ---- API 令牌页 ---- */
.token-manage { max-width: 860px; }
.token-table td { vertical-align: middle; }
.token-table tr.revoked td { opacity: 0.5; }
.token-table tr.just-created td { background: #f0fbf4; }
.token-code { font-size: 12px; user-select: all; }
