* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: #0d1117;
  color: #e6e6e6;
  min-height: 100vh;
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #131b26 0%, #0d1117 100%);
  border-bottom: 1px solid #1f2a3a;
  padding: 20px 16px 12px;
  text-align: center;
}

header h1 { font-size: 22px; color: #d4af6a; letter-spacing: 2px; }
.subtitle { font-size: 12px; color: #7a8699; margin-top: 4px; }

/* 阶段进度条 */
.progress {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 6px; margin-top: 14px;
}
.step {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: #5b6675;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid #1f2a3a; background: #131922;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #1f2a3a; font-size: 11px;
}
.step.active { color: #d4af6a; border-color: #d4af6a; }
.step.active .step-num { background: #d4af6a; color: #0d1117; }
.step.done { color: #4caf7d; border-color: #2d4a3a; }
.step.done .step-num { background: #2d4a3a; }

main { max-width: 860px; margin: 0 auto; padding: 16px; }

.card {
  background: #131922;
  border: 1px solid #1f2a3a;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; color: #d4af6a; margin-bottom: 12px; }

input, textarea {
  width: 100%;
  background: #0d1117;
  border: 1px solid #2a3546;
  border-radius: 6px;
  color: #e6e6e6;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
}
input:focus, textarea:focus { outline: none; border-color: #d4af6a; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.right { justify-content: flex-end; }
.hidden { display: none !important; }
.hint { font-size: 12px; color: #7a8699; }

button {
  cursor: pointer; border: none; border-radius: 6px;
  padding: 9px 18px; font-size: 14px; font-family: inherit;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #d4af6a; color: #0d1117; font-weight: 600; }
.btn-secondary { background: #2a3546; color: #e6e6e6; }

.warning {
  background: #3a2d1a; border: 1px solid #d4af6a;
  color: #d4af6a; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
}

/* 直播流 */
.stream {
  height: 420px; overflow-y: auto;
  padding: 12px; background: #0d1117;
  border-radius: 8px; border: 1px solid #1f2a3a;
}
.stream.debating { height: 480px; }

.stage-bar {
  text-align: center; color: #7a8699; font-size: 12px;
  margin: 14px 0; letter-spacing: 1px;
}

.msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.msg-left { justify-content: flex-start; }
.msg-right { justify-content: flex-end; }

.avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1f2a3a; border-radius: 50%; font-size: 20px;
}
.msg-body { max-width: 78%; }
.msg-name { font-size: 12px; color: #7a8699; margin-bottom: 3px; }
.msg-left .msg-name { padding-left: 4px; }
.msg-right .msg-name { text-align: right; padding-right: 4px; }
.msg-text {
  padding: 9px 12px; border-radius: 10px;
  font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.msg-left .msg-text { background: #1a2333; border: 1px solid #26334a; border-top-left-radius: 2px; }
.msg-right .msg-text { background: #23262b; border: 1px solid #33363c; border-top-right-radius: 2px; color: #c9cdd3; }

/* 表决 */
.tally { font-size: 13px; color: #e6e6e6; margin-left: 8px; }
.votes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.vote-card {
  background: #0d1117; border: 1px solid #2a3546;
  border-left-width: 3px; border-radius: 8px; padding: 10px 12px;
}
.vote-card.yes { border-left-color: #4caf7d; }
.vote-card.no { border-left-color: #e05c5c; }
.vote-card.abstain { border-left-color: #7a8699; }
.vote-name { font-size: 13px; color: #b8c0cc; }
.vote-result { font-size: 15px; font-weight: 700; margin: 2px 0; }
.vote-card.yes .vote-result { color: #4caf7d; }
.vote-card.no .vote-result { color: #e05c5c; }
.vote-card.abstain .vote-result { color: #7a8699; }
.vote-reason { font-size: 12px; color: #7a8699; }

/* 决议 */
.resolution {
  background: #0d1117; border: 1px solid #d4af6a33;
  border-radius: 8px; padding: 16px; font-size: 14px;
}
.decision-tag {
  display: inline-block; background: #d4af6a; color: #0d1117;
  font-weight: 700; font-size: 13px;
  padding: 3px 12px; border-radius: 4px; margin-bottom: 10px;
}

/* 历史 */
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 4px; border-bottom: 1px solid #1f2a3a; font-size: 13px;
  flex-wrap: wrap; gap: 4px;
}
.history-item:last-child { border-bottom: none; }

/* 裁决弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-box {
  background: #131922; border: 1px solid #d4af6a;
  border-radius: 12px; padding: 20px;
  width: 100%; max-width: 420px;
}
.modal-box h2 { color: #d4af6a; font-size: 17px; margin-bottom: 8px; }
.decision-row { display: flex; gap: 8px; margin: 14px 0; }
.decision-btn { flex: 1; background: #2a3546; color: #e6e6e6; }
.decision-btn.selected { background: #d4af6a; color: #0d1117; font-weight: 700; }

@media (max-width: 600px) {
  header h1 { font-size: 18px; }
  .step { font-size: 11px; padding: 3px 7px; }
  .stream { height: 360px; }
  .msg-body { max-width: 85%; }
}
