* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  background: #0f1419;
  color: #e7e9ea;
  line-height: 1.5;
}
a { color: #1d9bf0; text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  background: #16181c;
  border-bottom: 1px solid #2f3336;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
header h1 { margin: 0; font-size: 18px; }
nav a { margin-right: 16px; color: #e7e9ea; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.card {
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #2f3336; text-align: left; }
th { color: #71767b; font-weight: 600; }
.up { color: #f4212e; }
.down { color: #00ba7c; }
.ok { color: #00ba7c; }
.bad { color: #f4212e; }
.muted { color: #71767b; }
.hl-md {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  color: #c8cdd2;
  max-height: 480px;
  overflow: auto;
}
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.alert-error { background: #3d1719; border: 1px solid #f4212e; }
.alert-info { background: #0d2847; border: 1px solid #1d9bf0; }
.alert-warn { background: #3d2e0a; border: 1px solid #ffd400; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select, button {
  background: #202327;
  color: #e7e9ea;
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 8px 12px;
}
button {
  cursor: pointer;
  background: #1d9bf0;
  border-color: #1d9bf0;
  color: #fff;
  font-weight: 600;
}
button.secondary { background: #202327; color: #e7e9ea; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.metric { background: #202327; border-radius: 8px; padding: 12px; }
.metric .label { font-size: 12px; color: #71767b; }
.metric .value { font-size: 20px; font-weight: 700; margin-top: 4px; }
#chart { height: 360px; }
.workshop {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .workshop { grid-template-columns: 1fr; }
}
.workshop-list ul { list-style: none; padding: 0; margin: 0 0 16px; }
.workshop-list li { padding: 8px 10px; border-radius: 8px; margin-bottom: 4px; }
.workshop-list li.active { background: #202327; border: 1px solid #1d9bf0; }
.workshop-list a { color: #e7e9ea; }
.tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: #ffd400;
}
.tag.bad { color: #f4212e; }
.code-editor {
  width: 100%;
  min-height: 480px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  background: #0b0d10;
  color: #d7dde3;
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}
.code-editor.readonly {
  margin: 12px 0 0;
  display: block;
}
button.danger { background: #b91c1c; border-color: #b91c1c; }
.guide-box {
  margin-top: 12px;
  border: 1px solid #2f3336;
  border-radius: 8px;
  padding: 12px 16px;
  background: #12161a;
}
.guide-box summary { cursor: pointer; color: #e7e9ea; }
.guide-content { margin-top: 12px; font-size: 14px; }
.guide-content h4 { margin: 16px 0 8px; font-size: 14px; }
.guide-content ul { margin: 8px 0; padding-left: 20px; }
.guide-table { margin: 8px 0; font-size: 13px; }
.guide-code { min-height: 200px; font-size: 12px; }
.sync-panel {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid #2f3336;
  border-radius: 8px;
  background: #12161a;
}
.sync-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.progress-track {
  height: 10px;
  background: #202327;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1d9bf0, #00ba7c);
  transition: width 0.4s ease;
}
.sync-items {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 180px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.sync-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #202327;
}
.sync-item .sync-state { color: #71767b; text-transform: uppercase; font-size: 11px; }
.sync-item.sync-running { border: 1px solid #1d9bf0; }
.sync-item.sync-ok .sync-state { color: #00ba7c; }
.sync-item.sync-failed .sync-state,
.sync-item.sync-timeout .sync-state { color: #f4212e; }

