:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #21252e;
  --line: #2c313c;
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --accent: #ff7a45;
  --accent-2: #36d6a0;
  --warn: #ffcf5c;
  --bad: #ff6b6b;
  --radius: 14px;
  --maxw: 980px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.accent { color: var(--accent); }

/* nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #14171d, #0f1115);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  font-size: 26px; color: var(--accent);
  background: var(--panel); width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; border: 1px solid var(--line);
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 12.5px; color: var(--muted); }
.nav-links a { margin-left: 18px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

main { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 60px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 34px;
}
h2 { margin: 0 0 6px; font-size: 19px; }

/* dropzone */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 30px; text-align: center; cursor: pointer;
  transition: .15s; background: var(--panel-2);
}
.dropzone.drag { border-color: var(--accent); background: #2a2018; }
.dz-icon { font-size: 30px; color: var(--accent); }
.link { color: var(--accent); }
.meta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.meta-row label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 130px; }
input, select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 10px 18px; font-size: 14.5px; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 600; }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.msg { margin-top: 10px; font-size: 13px; min-height: 18px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--accent-2); }

/* gallery */
.gallery-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: .15s; position: relative;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile .ext { font-size: 11px; color: var(--muted); }
.tile .fname { font-weight: 600; margin: 4px 0; word-break: break-all; }
.tile .by { font-size: 12px; color: var(--muted); }
.tile .dim { font-size: 12px; color: var(--muted); margin-top: 6px; }
.score-badge {
  position: absolute; top: 12px; right: 12px; font-weight: 700; font-size: 14px;
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
}
.score-ok { background: rgba(54,214,160,.15); color: var(--accent-2); }
.score-mid { background: rgba(255,207,92,.15); color: var(--warn); }
.score-bad { background: rgba(255,107,107,.15); color: var(--bad); }
.tile .cmt { font-size: 12px; color: var(--muted); margin-top: 8px; }
.empty { text-align: center; padding: 40px; }

/* report */
.report { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.report-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.score-big {
  font-size: 34px; font-weight: 800; width: 70px; height: 70px; border-radius: 14px;
  display: grid; place-items: center; flex: none;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); }
.chip.good { color: var(--accent-2); border-color: rgba(54,214,160,.4); }
.chip.bad { color: var(--bad); border-color: rgba(255,107,107,.4); }
.chip.warn { color: var(--warn); border-color: rgba(255,207,92,.4); }

.bars { display: grid; gap: 10px; margin: 12px 0; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { background: var(--panel-2); border-radius: 6px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent-2); border-radius: 6px; }
.bar-fill.over { background: var(--warn); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; margin: 12px 0; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 600; }
.warn-list { margin: 8px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal.hidden { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-width: 720px; width: 100%; max-height: 88vh; overflow: auto; padding: 24px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* comments */
.comments { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.comment { border-bottom: 1px solid var(--line); padding: 9px 0; }
.comment .ca { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.comment .cb { font-size: 14px; margin-top: 2px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form input { flex: 1; }
.foot { text-align: center; padding: 22px; border-top: 1px solid var(--line); margin-top: 30px; }

/* 后端离线提示横幅 */
.banner {
  background: rgba(255,207,92,.12);
  border: 1px solid rgba(255,207,92,.4);
  color: var(--warn);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 13.5px;
  line-height: 1.6;
}
.banner code {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12.5px;
}

/* 内置模型实例库 */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.shape-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 6px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
  user-select: none;
}
.shape-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.shape-tile.sel {
  border-color: var(--accent);
  background: rgba(255,122,69,.10);
}
.shape-emoji { font-size: 28px; line-height: 1.2; }
.shape-name { font-size: 13px; margin-top: 6px; font-weight: 600; }
.shape-tag { margin-top: 2px; }

/* 社区统计条 */
.stats-strip {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px 0;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.stat {
  flex: 1; min-width: 120px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px;
}
.stat b { font-size: 22px; color: var(--accent); }
.stat span { font-size: 12.5px; color: var(--muted); }

/* 榜单分段控件 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button {
  background: var(--panel-2); color: var(--muted); border: none; padding: 7px 14px;
  font-size: 13px; cursor: pointer;
}
.seg button.on { background: var(--accent); color: #1a1206; font-weight: 600; }

/* 榜单列表 */
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board-item {
  display: flex; align-items: center; gap: 14px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.board-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.board-item .rank { font-size: 18px; font-weight: 800; color: var(--muted); width: 26px; text-align: center; }
.board-item .bi-main { flex: 1; min-width: 0; }
.board-item .bi-name { font-weight: 600; word-break: break-all; }
.board-item .bi-score { display: flex; align-items: center; gap: 8px; }
.board-item .bi-score b { font-size: 18px; color: var(--warn); }

/* 评分面板 */
.rating-panel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.rating-summary { display: flex; gap: 16px; align-items: center; }
.rating-avg {
  font-size: 30px; font-weight: 800; width: 64px; height: 64px; border-radius: 14px;
  display: grid; place-items: center; flex: none; background: var(--panel-2);
}
.rating-meta { flex: 1; min-width: 0; }
.dist { display: grid; gap: 5px; margin-top: 6px; }
.dist-row { display: grid; grid-template-columns: 30px 1fr 28px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dist-track { background: var(--panel-2); border-radius: 6px; height: 8px; overflow: hidden; }
.dist-fill { height: 100%; background: var(--warn); border-radius: 6px; }
.rating-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.stars { display: flex; gap: 4px; font-size: 26px; }
.star { color: var(--line); cursor: pointer; transition: color .1s; line-height: 1; }
.star.on { color: var(--warn); }
.stars:hover .star { color: var(--line); }
.star:hover, .star:hover ~ .star { color: var(--warn); }
.rating-form textarea {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; outline: none; min-height: 64px;
  resize: vertical; font-family: inherit;
}
.rating-form textarea:focus { border-color: var(--accent); }
.rating-form .btn.primary { align-self: flex-start; }
/* 评分数据条 + 文字分析 */
.rating-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rating-chips .chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted);
}
.rating-chips .chip b { color: var(--text); font-size: 13.5px; }
.rating-analysis {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); line-height: 1.6;
}
.rating-analysis b { color: var(--accent); }
