/* 术数选号 · 页面样式（简洁国风） */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  background: #f5f0e6;
  color: #2b2b2b;
  line-height: 1.7;
}
header {
  background: linear-gradient(135deg, #7b1f1f, #a03028);
  color: #f3e9d2;
  text-align: center;
  padding: 28px 16px 22px;
}
header h1 { margin: 0; font-size: 30px; letter-spacing: 10px; }
.subtitle { margin: 8px 0 0; font-size: 13px; opacity: 0.85; }
main { max-width: 920px; margin: 0 auto; padding: 18px 14px 40px; }

.card {
  background: #fffdf7;
  border: 1px solid #ddd2b8;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(90, 60, 20, 0.08);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 19px;
  color: #7b1f1f;
  border-bottom: 2px solid #c9a54a;
  padding-bottom: 6px;
}
.hidden { display: none; }

fieldset {
  border: 1px solid #ddd2b8;
  border-radius: 6px;
  margin: 12px 0;
  padding: 10px 14px 12px;
}
legend { color: #7b1f1f; font-weight: bold; padding: 0 6px; }
.row { margin: 8px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.row > label:first-child { min-width: 88px; font-weight: bold; }
.row.center { justify-content: center; margin-top: 16px; }
.inline { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; }
.hint { font-size: 12px; color: #8a7d5f; }
.warn { color: #a03028; }
.good { color: #2f6b34; }

input[type="number"], input[type="text"], input[type="datetime-local"] {
  border: 1px solid #c9bd9c;
  border-radius: 4px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  width: 150px;
}
.num3 { width: 76px; }
.stroke-item input.need-fill { border-color: #a03028; background: #fdf0ee; }

button {
  border: 1px solid #c9a54a;
  background: #f3e9d2;
  color: #5c4318;
  border-radius: 4px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: #eadfc4; }
button.primary {
  background: #7b1f1f;
  color: #f3e9d2;
  border-color: #5c1414;
  font-size: 17px;
  letter-spacing: 6px;
  padding: 10px 42px;
}
button.primary:hover { background: #8f2626; }

.modules { display: flex; flex-wrap: wrap; gap: 8px; }
.mod { padding: 4px 12px; border-radius: 12px; font-size: 13px; }
.mod.present { background: #e6efe0; color: #2f6b34; border: 1px solid #a8c49b; }
.mod.absent { background: #f6e3e0; color: #a03028; border: 1px solid #d8a49d; }

.notice {
  background: #f3e9d2;
  border-left: 4px solid #c9a54a;
  padding: 8px 12px;
  margin: 8px 0;
}
.notice.refuse { background: #f6e3e0; border-left-color: #a03028; color: #a03028; font-size: 18px; font-weight: bold; }
.notice.blocked { background: #f6e3e0; border-left-color: #a03028; }

.balls-label { margin: 10px 0 4px; font-weight: bold; color: #7b1f1f; }
.balls { display: flex; flex-wrap: wrap; gap: 10px; }
.ball-wrap { position: relative; }
.ball-wrap > summary { list-style: none; cursor: pointer; }
.ball-wrap > summary::-webkit-details-marker { display: none; }
.ball {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: bold; color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
}
.ball.main { background: radial-gradient(circle at 32% 30%, #e06055, #a01818); }
.ball.special { background: radial-gradient(circle at 32% 30%, #5588dd, #1a3f9e); }
.ball-wrap[open] .ball { outline: 3px solid #c9a54a; }
.trace {
  position: absolute; z-index: 5; top: 52px; left: 0;
  min-width: 300px; max-width: 420px;
  background: #fffdf7; border: 1px solid #c9a54a; border-radius: 6px;
  padding: 10px 12px; font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.trace-line { margin: 2px 0; }
.trace-step { margin: 1px 0 1px 14px; color: #6b5c3e; font-size: 12px; }

.step { margin-bottom: 18px; }
.step h3 { color: #7b1f1f; margin: 12px 0 6px; font-size: 16px; }
.step p { margin: 4px 0; }
.collapsible { margin: 6px 0; }
.collapsible > summary { cursor: pointer; color: #5c4318; font-weight: bold; }

/* ---------- 多注产出（v1.4）---------- */
.ticket-card { border-top: 1px dashed #c9bd9c; margin-top: 14px; padding-top: 6px; }
.ticket-card:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.ticket-card h3 { color: #7b1f1f; margin: 8px 0 4px; font-size: 16px; }
.detail-json {
  background: #faf5e8;
  border: 1px solid #e0d5b5;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.disclaimer {
  text-align: center;
  color: #8a7d5f;
  font-size: 13px;
  border-top: 1px dashed #c9bd9c;
  padding-top: 14px;
}

/* ---------- 项目文档抽屉（editor.md 只读查看）---------- */
#doc-drawer-toggle {
  /* 悬浮竖排按钮。absolute 跟随文档流（长截图中只出现一次），Chrome（含 Android）实测正常；
     夸克浏览器渲染加速会导致系统长截图异常（fixed 时断裂、absolute 时不自动滚动），
     属浏览器侧问题，不做适配（见设计方案 §12） */
  position: absolute; right: 0; top: 120px; z-index: 40;
  writing-mode: vertical-rl; letter-spacing: 4px;
  padding: 14px 7px; font-size: 14px; cursor: pointer;
  color: #fff; background: #7b1f1f;
  border: 1px solid #c9a54a; border-right: none; border-radius: 6px 0 0 6px;
  box-shadow: -2px 2px 6px rgba(0,0,0,0.25);
}
#doc-drawer-mask {
  position: fixed; inset: 0; z-index: 48;
  background: rgba(0,0,0,0.35);
  display: none; /* 长截图兼容：常态下不保留任何悬浮层 */
}
#doc-drawer-mask.open { display: block; }
#doc-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: 600px; max-width: 94vw;
  /* 长截图兼容（v1.4.1）：关闭时 display:none 拆除合成层——
     常驻的 fixed+transform 全高图层会干扰 MIUI 等系统长截图的滚动拼接（画面断裂） */
  display: none; flex-direction: column;
  background: #fffdf7; border-left: 2px solid #c9a54a;
  box-shadow: -4px 0 16px rgba(0,0,0,0.2);
  transform: translateX(105%);
}
#doc-drawer.open { display: flex; transform: translateX(0); animation: drawer-in .25s ease; }
@keyframes drawer-in { from { transform: translateX(105%); } to { transform: translateX(0); } }
#doc-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #e0d5b5;
  color: #7b1f1f; font-weight: bold; font-size: 16px;
}
#doc-drawer-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: #7b1f1f;
}
#doc-list { list-style: none; margin: 0; padding: 12px 16px; overflow-y: auto; }
#doc-list li { margin: 6px 0; }
#doc-list a {
  display: block; padding: 11px 14px; text-decoration: none;
  color: #5c4318; background: #faf5e8;
  border: 1px solid #e0d5b5; border-radius: 6px;
}
#doc-list a:hover { border-color: #c9a54a; background: #f5edd8; }
#doc-view-wrap { display: none; flex-direction: column; flex: 1; min-height: 0; }
#doc-view-wrap.show { display: flex; }
#doc-view-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-bottom: 1px solid #e0d5b5;
}
#doc-back {
  cursor: pointer; padding: 4px 10px;
  color: #5c4318; background: #faf5e8;
  border: 1px solid #c9a54a; border-radius: 4px;
}
#doc-view-title { font-weight: bold; color: #7b1f1f; }
#doc-view { flex: 1; overflow-y: auto; padding: 12px 18px; }
#doc-view .editormd-html-preview { width: 100%; padding: 0; font-size: 14px; }
