:root {
  --bg: #11140f;
  --panel: #1b2118;
  --card: #222a1e;
  --ink: #e8eadf;
  --muted: #9aa38c;
  --line: #343e2e;
  --accent: #d4a017;
  --accent-2: #c45c26;
  --ok: #7dba5b;
  --danger: #d45c4a;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(17,20,15,.92); backdrop-filter: blur(8px); z-index: 5;
}
.brand { color: var(--ink); font-weight: 700; letter-spacing: .04em; font-size: 18px; }
.top nav { display: flex; gap: 16px; font-size: 14px; }
.top nav a { color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0 0 24px; }
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px;
}
.toolbar input, .toolbar select, textarea, input[type=text], input[type=password], input[type=url] {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font: inherit;
}
.toolbar input { min-width: 220px; flex: 1; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 168px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; color: inherit; }
.card-top {
  display: flex; align-items: center; gap: 12px;
}
.card h2 { margin: 0; font-size: 18px; }
.card-icon, .detail-icon {
  flex: 0 0 44px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--accent); background: #181e16;
}
.card-icon svg, .detail-icon svg { width: 28px; height: 28px; display: block; }
.card:hover .card-icon { border-color: var(--accent); }
.detail-title { display: flex; align-items: flex-start; gap: 14px; }
.detail-icon { width: 52px; height: 52px; flex-basis: 52px; border-radius: 14px; }
.detail-icon svg { width: 32px; height: 32px; }
.order-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; }
.order-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px;
}
.order-row .card-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 9px; }
.order-row .card-icon svg { width: 22px; height: 22px; }
.order-row .name { flex: 1; font-weight: 600; }
.order-row .btn { padding: 3px 8px; font-size: 12px; }
.card .desc { color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.badge { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.detail-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.detail-head h1 { margin: 0 0 6px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit;
}
.actions .btn {
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #1a1404; border-color: var(--accent); font-weight: 650; }
.btn.danger { border-color: var(--danger); color: #f2c2ba; }
.plain-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 22px; margin: 0 0 16px; font-size: 16px; line-height: 1.75;
}
.plain-box p { margin: 0; }
.diagram {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px; margin: 0 0 16px; overflow: hidden;
}
.diagram img { display: block; width: 100%; height: auto; border-radius: 10px; }
.photo-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 0 10px; color: var(--muted); font-size: 13px;
}
.photo-head strong { color: var(--ink); font-size: 15px; }
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 0 0 22px;
}
.photo-slot {
  position: relative; aspect-ratio: 4 / 3; border: 2px dashed var(--line);
  border-radius: 12px; background: var(--panel); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer; overflow: hidden; text-align: center;
  padding: 12px; font-size: 13px; line-height: 1.4;
}
.photo-slot:hover { border-color: var(--accent); color: var(--ink); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot.has-img { border-style: solid; }
.photo-slot.has-img span, .photo-slot.has-img .hint { display: none; }
.photo-slot input { display: none; }
.photo-slot .hint { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) {
  .photo-grid { grid-template-columns: 1fr; }
}
.readme {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px;
  line-height: 1.7; overflow-x: auto;
}
.readme h1, .readme h2, .readme h3 { margin-top: 1.4em; }
.readme pre, .readme code { font-family: var(--mono); }
.readme pre { background: #0d100c; padding: 12px; border-radius: 8px; overflow: auto; }
.readme img, .readme video { max-width: 100%; border-radius: 8px; }
.readme iframe { max-width: 100%; border: 0; border-radius: 8px; }
.readme a { word-break: break-all; }
.source { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.err, .empty { color: var(--muted); padding: 24px 0; }
.editor-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 62vh; }
textarea.md {
  width: 100%; min-height: 62vh; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.55;
}
.preview { min-height: 62vh; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.status { font-size: 13px; color: var(--muted); min-height: 1.4em; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--danger); }
@media (max-width: 860px) {
  .editor-wrap { grid-template-columns: 1fr; }
  textarea.md, .preview { min-height: 42vh; }
}
