:root {
  --bg: #f6f5f2;
  --panel: #ffffff;
  --ink: #1c1d21;
  --mute: #6f727a;
  --line: #e3e1dc;
  --brand: #9d6311;
  --brand-soft: #f6ecdc;
  --ok: #1f7a4d;
  --warn: #a8620d;
  --bad: #b23b3b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(28, 29, 33, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 12% -10%, #fbf3e6 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #eef3f1 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--mute); font-size: 13px; }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #f3efe7, #f7f6f3 60%); }
.login-card { width: 340px; background: var(--panel); border-radius: 20px; padding: 34px 30px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .5px; }
.login-card input { width: 100%; margin: 16px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.login-card button { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; }
.error { color: var(--bad); font-size: 13px; min-height: 20px; margin: 8px 0 0; }

/* shell */
.app { display: flex; flex-direction: column; min-height: 100%; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px;
  padding: 12px 26px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 6px 24px rgba(28, 29, 33, .04);
}
.brand { font-weight: 700; letter-spacing: .4px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tabs { display: flex; gap: 2px; flex: 0 0 auto; background: #f3f0ea; padding: 3px; border-radius: 12px; width: fit-content; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--mute); transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(28, 29, 33, .12); }
.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); }
.pill.busy { background: #fdecec; color: var(--bad); }
main { padding: 26px 26px 64px; max-width: 1280px; width: 100%; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.panel-head .muted { margin: 3px 0 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.end { justify-content: flex-end; }

button.primary {
  background: var(--ink); color: #fff; border: 0; border-radius: 10px; padding: 9px 16px;
  cursor: pointer; font-weight: 600; box-shadow: 0 2px 8px rgba(28, 29, 33, .16);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28, 29, 33, .2); }
button.ghost {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  cursor: pointer; color: var(--ink); transition: border-color .12s, box-shadow .12s, background .12s;
}
button.ghost:hover { border-color: #cfc9be; box-shadow: 0 4px 12px rgba(28, 29, 33, .07); }
button.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; }
a.link { color: var(--brand); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.card, .push, .form-card { transition: box-shadow .16s ease; }
.card:hover, .push:hover { box-shadow: 0 14px 36px rgba(28, 29, 33, .1); }

/* hot：四个平台同屏，每列独立滚动 */
.hot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.hot-col {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: calc(100vh - 210px);
  min-height: 320px;
}
.hot-col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfbf7, #fff);
}
.hot-col-name { font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.hot-col-count { color: var(--mute); font-size: 12px; }
.hot-items { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.hot-item {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 8px 8px;
  border-radius: 9px;
  cursor: pointer;
  line-height: 1.45;
}
.hot-item:hover { background: #faf7f1; }
.hot-rank {
  flex: 0 0 20px;
  text-align: center;
  color: var(--mute);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  line-height: 18px;
}
.hot-rank.top { background: #fbeee0; color: var(--brand); font-weight: 700; }
.hot-title { flex: 1; font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hot-heat { flex: 0 0 auto; color: #a9a49b; font-size: 11px; font-variant-numeric: tabular-nums; }
.hot-empty { padding: 18px 10px; color: var(--mute); font-size: 13px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(24, 22, 18, .38); display: grid; place-items: center; padding: 24px; backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(24, 22, 18, .28);
  padding: 26px 28px 30px;
}
.modal-close {
  position: absolute; top: 12px; right: 14px;
  border: 0; background: transparent; font-size: 24px; line-height: 1;
  color: var(--mute); cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { background: #f3f0ea; color: var(--ink); }
.modal-tag {
  display: inline-block; font-size: 12px; color: var(--brand);
  background: var(--brand-soft); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.modal-title { margin: 0 0 6px; font-size: 21px; line-height: 1.45; letter-spacing: -.2px; }
.modal .actions { display: flex; gap: 8px; margin: 18px 0 2px; flex-wrap: wrap; }
.modal .actions button.primary:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }
/* cards / forms */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card .meta { color: var(--mute); font-size: 13px; word-break: break-all; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 20px; background: #f2f0eb; color: var(--mute); }
.tag.on { background: var(--brand-soft); color: var(--brand); }
.tag.off { background: #f7eaea; color: var(--bad); }
.card .row { justify-content: space-between; }
.form-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-top: 18px; }
.form-card h3 { margin: 0 0 16px; }
label { display: block; font-size: 13px; color: var(--mute); margin-bottom: 12px; }
label input, label select, label textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; font-size: 14px; color: var(--ink);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
/* pushes */
.pushes { display: flex; flex-direction: column; gap: 12px; }
.push { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.push .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.push .topic { font-weight: 600; }
.push .targets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.target { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: #f4f2ee; }
.target.ok { background: #e9f5ee; color: var(--ok); }
.target.bad { background: #fbebeb; color: var(--bad); }
.target.run { background: var(--brand-soft); color: var(--brand); }
.state { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #f2f0eb; }
.state.done { background: #e9f5ee; color: var(--ok); }
.state.partial, .state.running { background: var(--brand-soft); color: var(--brand); }
.state.failed { background: #fbebeb; color: var(--bad); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }


@media (max-width: 1280px) {
  .hot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hot-col { max-height: 52vh; }
}
@media (max-width: 760px) {
  .hot-grid { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tabs { overflow: auto; }
  main { padding: 18px 14px 48px; }
  .topbar { padding: 12px 14px; gap: 12px; }
  .modal-card { padding: 22px 18px 24px; }
}
