* { box-sizing: border-box; }

body {
  margin: 0;
  background: #d6d1c4;
  color: #111;
  font: 12px/1.7 "Noto Serif CJK SC", "Songti SC", SimSun, serif;
}

a { color: #0000cc; }
a:visited { color: #551a8b; }
a:hover { color: #cc0000; }

.wrap { width: 920px; max-width: 100%; margin: 10px auto; }

.content {
  padding: 14px 18px 22px;
  background: #fff;
  border: 1px solid #8a8578;
}

h1, h2, h3 {
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", Arial, sans-serif;
}

h1 {
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid #2b3a55;
  font-size: 20px;
}

h2 {
  margin: 20px 0 8px;
  padding-left: 7px;
  border-left: 4px solid #2b3a55;
  font-size: 15px;
}

h3 { margin: 14px 0 6px; font-size: 13px; }
p { margin: 8px 0; }

.hint { color: #555; }

/* Old-style tab strip: one active tab merges with the page below. */
.adminbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  border-bottom: 2px solid #2b3a55;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px;
}

.tab {
  padding: 3px 12px;
  border: 1px solid #777;
  border-bottom: 0;
  background: #d4d0c8;
  color: #111;
  font: 12px/1.6 Arial, sans-serif;
  text-decoration: none;
}

.tab:hover { background: #e5e1d8; color: #111; }

.tab.active {
  margin-bottom: -2px;
  border-color: #2b3a55;
  border-bottom: 2px solid #fff;
  background: #fff;
  font-weight: bold;
}

.session {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.session .who {
  color: #555;
  font: 11px/1.5 Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 6px 12px;
  background: #2b3a55;
  color: #fff;
  font: 12px/1.6 Arial, sans-serif;
}

.topbar a { color: #fff; }
.topbar .brand { font-weight: bold; text-decoration: none; }
.topbar .nav { margin-left: 4px; }
.topbar .who { margin-left: auto; color: #ddd; }
.topbar form { margin: 0; }

a.button {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #2b3a55;
  background: #d4d0c8;
  color: #111;
  font: 12px/1.6 Arial, sans-serif;
  text-decoration: none;
}

a.button:hover { background: #e5e1d8; color: #111; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
}

.actions form { margin: 0; }

td.actions { display: table-cell; white-space: nowrap; }
td.actions form { display: inline-block; margin: 0 4px 2px 0; }
td.actions button { padding: 2px 8px; }
td.actions a { margin-right: 4px; }

.search { margin: 8px 0; }
.search input { width: 240px; }
.clear { margin-left: 8px; }

input, select, textarea {
  padding: 2px 4px;
  border: 1px solid #777;
  background: #fff;
  color: #111;
  font: 12px/1.5 Arial, sans-serif;
}

textarea { vertical-align: top; }

button {
  padding: 3px 12px;
  border: 1px solid #555;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: #444;
  border-bottom-color: #444;
  background: #d4d0c8;
  color: #111;
  font: 12px/1.4 Arial, sans-serif;
  cursor: pointer;
}

button:hover { background: #dedad2; }

button:active {
  border-top-color: #777;
  border-left-color: #777;
  border-right-color: #fff;
  border-bottom-color: #fff;
  background: #c7c2b8;
}

button.danger { color: #a00000; }
button.danger:hover { background: #e6cfcf; }

.inline-form { display: inline-flex; align-items: center; gap: 6px; }

table { width: 100%; border-collapse: collapse; }

.list { margin: 8px 0 14px; }
.list th, .list td { padding: 3px 6px; border: 1px solid #999; text-align: left; vertical-align: top; }
.list th { background: #d4d0c8; font-weight: bold; }
.list tr:nth-child(even) td { background: #f7f5ef; }

.meta { width: auto; min-width: 60%; margin: 8px 0 12px; }
.meta th, .meta td { padding: 3px 8px; border: 1px solid #aaa; text-align: left; }
.meta th { width: 105px; background: #eee9df; font-weight: bold; }

.cover {
  float: right;
  width: 150px;
  margin: 0 0 10px 14px;
  border: 1px solid #999;
}

.desc {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #bbb;
  background: #faf9f4;
  white-space: pre-wrap;
}

.error {
  margin: 8px 0;
  padding: 4px 8px;
  border: 1px solid #b00;
  background: #fee;
  color: #900;
}

.form p { margin: 6px 0; }
.form label { display: inline-block; width: 100px; }
.form input, .form select { width: 300px; }
.form textarea { width: 480px; max-width: 100%; }
.form input[type="file"] { width: auto; max-width: 100%; }
.form progress { width: 480px; max-width: 100%; height: 16px; }
button:disabled { color: #777; cursor: default; }

.note {
  margin: 8px 0;
  padding: 4px 8px;
  border: 1px solid #6a8;
  background: #efe;
}

.account {
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 1px solid #bbb;
  background: #faf9f4;
}

.account > p { margin: 0 0 6px; }

.danger { color: #a00000; }

/* 任务状态：术语与配色沿用 Fedora Copr 的 build state。
   pending/running 为蓝色/橙色，成功为绿色，失败为红色，取消为灰色。 */
.state { white-space: nowrap; }
.state::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  margin-right: 2px;
  font-family: "DejaVu Sans", Arial, sans-serif;
  text-align: center;
}

.state-pending { color: #55b; }
.state-running { color: #c84; }
.state-succeeded, .state-skipped { color: #272; }
.state-failed { color: #c44; }
.state-canceled { color: #666; }

.state-pending::before, .state-running::before {
  content: "⟳";
  animation: state-spin 1.4s linear infinite;
}
.state-succeeded::before, .state-skipped::before { content: "✓"; }
.state-failed::before { content: "✗"; }
.state-canceled::before { content: "✕"; }

@keyframes state-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .state-pending::before, .state-running::before { animation: none; }
}

code { padding: 0 3px; background: #eee9df; font-family: Consolas, monospace; }
#api-key { word-break: break-all; }

@media (max-width: 700px) {
  .wrap { margin: 0; }
  .content { padding: 12px; }
  .adminbar { align-items: stretch; }
  .session { padding-bottom: 0; }
  .form input, .form select, .form textarea { width: 100%; }
  .form label { display: block; width: auto; }
  .cover { float: none; display: block; margin: 0 0 10px; }
  .list { display: block; overflow-x: auto; }
}
