:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #656d76;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-soft: #ddf4ff;
  --ai: #8250df;
  --ai-soft: #fbefff;
  --up: #1a7f37;
  --danger: #cf222e;
  --ok: #1a7f37;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}
.brand {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #58a6ff, #8250df);
  display: inline-block;
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a {
  color: #8b949e;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.tabs a:hover { background: #161b22; color: #e6edf3; text-decoration: none; }
.tabs a.active { background: #21262d; color: #fff; }
.search input {
  background: #161b22;
  border: 1px solid #30363d;
  color: #e6edf3;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  width: 200px;
  outline: none;
}
.search input:focus { border-color: #58a6ff; }

main.wrap { padding-top: 20px; padding-bottom: 40px; }

.notice {
  background: #fff8c5;
  border: 1px solid #d4a72c;
  color: #6b4b00;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
}
.flash.ok { background: #dafbe1; border: 1px solid #4ac26b; color: #116329; }
.flash.err { background: #ffebe9; border: 1px solid #ff8182; color: #82071e; }

.filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flabel {
  color: var(--muted);
  font-size: 12px;
  min-width: 32px;
  font-weight: 500;
}
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
}
.chip:hover { background: #f3f4f6; color: var(--text); text-decoration: none; }
.chip.on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #b6e3ff;
  font-weight: 500;
}

.listmeta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover {
  text-decoration: none;
  border-color: #afb8c1;
  box-shadow: 0 2px 8px rgba(31,35,40,.06);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.repo { font-size: 15px; color: var(--muted); font-weight: 400; }
.repo b { color: var(--accent); font-weight: 600; }
.desc {
  color: #424a53;
  font-size: 13.5px;
  margin: 2px 0 8px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.intro {
  color: #24292f;
  font-size: 13px;
  margin: 0 0 10px;
  line-height: 1.75;
  padding: 10px 12px;
  background: #f6f8fa;
  border-left: 3px solid #d0d7de;
  border-radius: 4px;
}
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}
.metrics .star { color: #9a6700; font-weight: 500; }
.metrics .up { color: var(--up); font-weight: 600; }
.metrics .up7 { color: #2da44e; }
.muted { color: var(--muted); }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #f6f8fa;
  line-height: 1.7;
}
.tag.ai {
  background: var(--ai-soft);
  border-color: #e5ccff;
  color: var(--ai);
  font-weight: 500;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  color: var(--muted);
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 24px 0 0;
  font-size: 13px;
}
.pager a {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px 32px;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.detail-head h1 { font-size: 22px; margin: 0; font-weight: 600; }
.ghlink { margin-left: auto; font-size: 13px; }
.lede {
  font-size: 15px;
  color: #424a53;
  margin: 0 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eaeef2;
}
.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.stat {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 17px; font-weight: 600; }
.stat .v.up { color: var(--up); }

.block { margin-bottom: 24px; }
.block h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #24292f;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}
.block p { margin: 0 0 6px; color: #424a53; font-size: 14px; }
.block.accent {
  background: var(--ai-soft);
  border: 1px solid #efdcff;
  border-radius: 8px;
  padding: 14px 18px;
}
.block.accent h2 { border-left-color: var(--ai); color: var(--ai); }
.effort { font-size: 13px; color: var(--muted); margin-top: 6px; }
.effort b { color: var(--text); }

.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.topic {
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
}

.kv { border-collapse: collapse; font-size: 13px; width: 100%; max-width: 520px; }
.kv td { padding: 6px 0; border-bottom: 1px solid #eaeef2; color: #424a53; }
.kv td:first-child { color: var(--muted); width: 120px; }

.back { margin-top: 28px; font-size: 13px; }

.statusbar {
  display: flex;
  gap: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}
.statusbar .k { color: var(--muted); margin-right: 8px; }
.good { color: var(--ok); }
.bad { color: var(--danger); }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
form.inline { display: flex; gap: 8px; align-items: center; }
.actions button { white-space: nowrap; }

button {
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f6f8fa;
  color: var(--text);
  cursor: pointer;
}
button:hover:not(:disabled) { background: #eaeef2; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); color: #fff; border-color: transparent; }
button.primary:hover { background: #0860ca; }

.settings .block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.field {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.field > span { color: var(--muted); }
.field input[type=text],
.field input[type=password],
.field input[type=email],
.field input[type=number],
.actions input[type=email] {
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  width: 100%;
  max-width: 460px;
  background: #fff;
}
.field input:focus, .actions input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(9,105,218,.1); }
.field.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}
.field.checkbox input {
  width: 15px !important;
  height: 15px;
  max-width: 15px !important;
  margin: 0;
  flex: 0 0 auto;
}
.field.checkbox span { color: var(--text); cursor: pointer; }
.savebar { display: flex; align-items: center; gap: 14px; margin: 18px 0 24px; }

.jobs { width: 100%; border-collapse: collapse; font-size: 13px; }
.jobs th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.jobs td { padding: 8px 10px; border-bottom: 1px solid #eaeef2; }
.jobs td.detail { color: #424a53; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #eaeef2; }
.st.success { background: #dafbe1; color: #116329; }
.st.failed { background: #ffebe9; color: #82071e; }
.st.partial { background: #fff8c5; color: #6b4b00; }
.st.running { background: var(--accent-soft); color: var(--accent); }

.foot {
  border-top: 1px solid var(--border);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 720px) {
  .topbar-in { gap: 10px; flex-wrap: wrap; height: auto; padding: 10px 0; }
  .tabs { order: 3; flex-basis: 100%; }
  .search input { width: 130px; }
  .detail { padding: 20px 16px; }
  .field { grid-template-columns: 1fr; gap: 4px; }
  .search { margin-left: auto; }
}

.trend { background: #f6f8fa; border-radius: 8px; padding: 12px 14px; }
.spark { width: 100%; height: 100px; display: block; }
.trend-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.trend-meta .up { color: var(--up); font-weight: 600; }

/* 收件人多地址标签 */
.field .recipients { max-width: 460px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef4fd;
  border: 1px solid #c8dcf5;
  color: #0969da;
  border-radius: 14px;
  padding: 3px 6px 3px 10px;
  font-size: 12.5px;
  line-height: 1.5;
}
.chip-x {
  border: 0;
  background: transparent;
  color: #6b7a90;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
}
.chip-x:hover { color: #cf222e; }
.recip-add { display: flex; gap: 8px; }
.recip-add input[type=text] { flex: 1; max-width: none; }
.recip-add .ghost {
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: #f6f8fa;
  border-radius: 6px;
  cursor: pointer;
  color: #24292f;
}
.recip-add .ghost:hover { background: #eef1f4; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }


/* 详情页：区块标题右侧按钮 */
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.block-head h2 { margin: 0 !important; }
.refresh-form { margin: 0; }
.ghost-btn {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 12px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  color: #24292f;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ghost-btn:hover { background: #eef1f4; border-color: #afb8c1; }
.ghost-btn:active { background: #e6e9ec; }

/* 操作提示条 */
.notice {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.notice.ok { background: #dafbe1; border: 1px solid #aceebb; color: #1a7f37; }
.notice.err { background: #ffebe9; border: 1px solid #ffcecb; color: #cf222e; }


/* 详情页：更新时间 + 新鲜度按钮 */
.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.updated {
  font-size: 12px;
  color: #8b949e;
  white-space: nowrap;
}
.ghost-btn.is-fresh {
  border-color: #aceebb;
  background: #dafbe1;
  color: #1a7f37;
  cursor: default;
}
.ghost-btn.is-fresh:hover {
  background: #dafbe1;
  border-color: #aceebb;
}


/* 登录页 */
.login-box {
  max-width: 420px;
  margin: 60px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.login-box h1 {
  font-size: 19px;
  margin: 0 0 6px;
}
.login-box > p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.6;
}
.login-box .field { grid-template-columns: 80px 1fr; }
.login-box .savebar { margin-top: 16px; }

