/* DemonMurderCase · 玩家端全局样式
   视觉基准：docs/mock/style.css（4320 设计稿 ÷ 3）
   仅保留设计稿画过的线：左右栏竖线 1.33px、输入下划线、设卡外框。禁止装饰性横线。 */

@font-face { font-family: "CLFN16"; src: url("/assets/fonts/c16xcnr.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "CLFN16"; src: url("/assets/fonts/c16xcnb.woff2") format("woff2"); font-weight: 700; }
@font-face { font-family: "CLFN24"; src: url("/assets/fonts/c24xcn.woff2") format("woff2"); font-weight: 400; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #fff; color: #000; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  font-family: "CLFN16", "Microsoft YaHei", "PingFang SC", monospace;
  font-size: 16px; line-height: 23px;
  -webkit-font-smoothing: none; text-rendering: geometricPrecision;
  min-height: 100vh;
}
a { color: #000; text-decoration: none; }
a:hover { color: #555; }
button { font: inherit; color: inherit; }

/* ============ header（固定黑条：滚动不消失） ============ */
.header {
  height: 67px; display: flex; align-items: center; justify-content: flex-start;
  padding: 0 12px; background: #000;
  position: sticky; top: 0; z-index: 40;
}
.brand {
  font-family: "CLFN16", monospace; font-weight: 700; font-size: 48px; line-height: 1;
  letter-spacing: 0; color: #828282; white-space: nowrap; text-decoration: none;
}
.brand:hover { color: #828282; }
.nav { display: flex; align-items: baseline; gap: 24px; font-size: 26px; color: #828282; white-space: nowrap; margin-left: auto; }
.nav a { color: #828282; text-decoration: none; }
.nav a:hover { color: #a8a8a8; }
.nav a.on { color: #a8a8a8; }
.userbox { display: flex; align-items: baseline; gap: 18px; font-size: 16px; color: #828282; margin-left: 22px; }
.userbox[hidden] { display: none; }
.userbox .who { color: #828282; }
.userbox .quit { color: #828282; cursor: pointer; }
.userbox .quit:hover { color: #a8a8a8; }
.drawer-user { display: none; }

/* 左右栏折叠箭头：仅移动端出现 */
.panel-toggle {
  display: none; align-items: center; justify-content: center;
  position: fixed; top: 8px; right: 10px; width: 24px; height: 40px; z-index: 50;
  background: transparent; color: #828282; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 20px; line-height: 1;
}

/* ============ 三栏布局 ============ */
.layout { display: grid; grid-template-columns: 162px 1fr; align-items: start; }
.layout.side-right { grid-template-columns: 162px 1fr 166px; }
.layout.side-icons { grid-template-columns: 162px 1fr 44px; }
.side {
  min-height: calc(100vh - 67px); padding: 10px 8px 40px 12px;
  border-right: 1.33px solid #000; background: #fff;
}
.side.no-border { border-right: 0; }
.search { display: flex; align-items: baseline; gap: 8px; color: #828282; margin-bottom: 12px; }
.search input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: #000;
  font: inherit; padding: 0; outline: none;
}
.tree { font-size: 16px; }
.group { margin-bottom: 4px; }
.child { margin-left: 12px; }
.child::before { content: "-"; }
.row { display: flex; align-items: center; justify-content: flex-start; gap: 0; cursor: pointer; }
.row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark {
  flex: 0 0 auto; width: 8px; height: 8px; margin-left: auto;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%208%208'%3E%3Cpath%20fill='%23000'%20d='M2%200h4v1H2z%20M0%201h2v1H0z%20M6%201h2v1H6z%20M0%202h1v1H0z%20M7%202h1v1H7z%20M0%203h1v1H0z%20M7%203h1v1H7z%20M0%204h1v1H0z%20M7%204h1v1H7z%20M0%205h1v1H0z%20M7%205h1v1H7z%20M0%206h2v1H0z%20M6%206h2v1H6z%20M2%207h4v1H2z'/%3E%3C/svg%3E") no-repeat center / 8px 8px;
}
.row.on .mark { background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%208%208'%3E%3Cpath%20fill='%23000'%20d='M2%200h4v1H2z%20M1%201h6v1H1z%20M0%202h8v1H0z%20M0%203h8v1H0z%20M0%204h8v1H0z%20M0%205h8v1H0z%20M1%206h6v1H1z%20M2%207h4v1H2z'/%3E%3C/svg%3E"); }
.row:hover { color: #555; }
.row.hidden, .group.hidden { display: none; }

/* ============ main ============ */
.main { padding: 10px 40px 80px 28px; background: #fff; min-height: calc(100vh - 67px); max-width: 760px; }
.h1 { font-family: "CLFN24", monospace; font-size: 24px; line-height: 1.4; color: #000; margin: 0; font-weight: 400; }
.h2 { font-size: 20px; color: #000; margin: 34px 0 6px; font-weight: 400; }
.muted { color: #828282; }
.body-text { color: #000; white-space: pre-wrap; word-break: break-word; }
.link { color: #000; cursor: pointer; text-decoration: none; }
.link:hover { color: #555; }
.actions { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; }
.actions.column { flex-direction: column; gap: 10px; }

/* ============ 右栏 / 图标栏 ============ */
.panel { border-left: 1.33px solid #000; min-height: calc(100vh - 67px); padding: 10px 12px; background: #fff; }
.panel .label { color: #000; margin-top: 18px; }
.panel .ph { color: #9a9a9a; cursor: pointer; }
.panel input, .panel textarea {
  display: block; width: 100%; background: transparent; border: 0; color: #000;
  font: inherit; line-height: 23px; padding: 0; margin: 2px 0 0; outline: none; resize: vertical;
}
.panel input::placeholder, .panel textarea::placeholder { color: #9a9a9a; }
.panel textarea { min-height: 72px; }
.panel select {
  display: block; width: 100%; margin: 2px 0 0; padding: 2px 0;
  background: transparent; border: 0; border-bottom: 1.33px solid #000;
  color: #000; font: inherit; line-height: 23px; outline: none;
  border-radius: 0; -webkit-appearance: none; appearance: none;
}
.panel .photo-thumb { display: block; width: 100%; height: auto; margin-top: 6px; }
.panel .panel-label { color: #9a9a9a; }
.icons {
  border-left: 1.33px solid #000; min-height: calc(100vh - 67px);
  display: flex; flex-direction: column; align-items: center; gap: 28px; padding-top: 0;
}
.icons img.tool { width: 17px; height: auto; cursor: pointer; opacity: 1; }
.icons img.tool:hover { opacity: .6; }
.icons img.tool.on { opacity: 1; }
/* 缩放条：zoom-track.png（42×591 竖长条 + 底端横线）+ zoom-thumb.png（42×4 滑块） */
.icons .zoomtrack { position: relative; width: 42px; height: 591px; cursor: pointer; touch-action: none; flex: 0 0 auto; }
.icons .zoomtrack .zoom-track-img {
  position: absolute; left: 0; top: 0; width: 42px; height: 591px;
  display: block; pointer-events: none; user-select: none;
}
.icons .zoomtrack .zoom-thumb {
  position: absolute; left: 0; top: 0; width: 42px; height: 4px;
  display: block; pointer-events: none; user-select: none;
}

/* ============ 首页（PSD 重做：纹理 + 三三角 + 中文标题 + 箭头） ============ */
.home { min-height: 100vh; background: #000; color: #828282; }
.home .header { position: sticky; }
.home .brand, .home .nav, .home .nav a { color: #828282; }
.home .panel-toggle { color: #828282; }
.home-hero {
  position: relative; overflow: hidden;
  height: calc(810px - 67px);
  background: #000 url("/assets/home/texture.jpg") center center / cover no-repeat;
}
.home-art {
  position: absolute; left: 50%; top: 0; width: 1440px; height: calc(810px - 67px);
  transform: translateX(-50%); transform-origin: top center;
}
.home-art img { position: absolute; display: block; user-select: none; -webkit-user-drag: none; }
.home-tri1 { left: 655.67px; top: 293.33px; width: 15.33px; height: 17.33px; animation: home-spin 18s linear infinite; }
.home-tri2 { left: 714.67px; top: 294.33px; width: 10.67px; height: 16.33px; animation: home-spin 26s linear infinite reverse; }
.home-tri3 { left: 768.33px; top: 297px; width: 14.33px; height: 12.67px; animation: home-spin 34s linear infinite; }
.home-tri1, .home-tri2, .home-tri3 { transform-origin: center center; }
@keyframes home-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.home-title-img { left: 622px; top: 321px; width: 196.67px; height: 33.67px; }
.home-arrow {
  position: absolute; left: 712.33px; top: 674.67px; width: 15.33px; height: 8.33px;
  padding: 0; border: 0; background: none; cursor: pointer;
}
.home-arrow img { position: static; width: 100%; height: 100%; }
.home-arrow:hover { opacity: .7; }
.home-chapters { background: #000; }
.chapter { padding: 86px 12vw 0; }
.chapter.fade { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.chapter.fade.in { opacity: 1; transform: none; }
.chapter .ch-title { font-family: "CLFN24", monospace; font-size: 24px; line-height: 1.4; margin: 0 0 16px; font-weight: 400; color: #828282; }
.chapter .ch-body { color: #828282; white-space: pre-wrap; word-break: break-word; }
.home-footer { padding: 96px 12vw 60px; color: #828282; font-size: 16px; white-space: pre-wrap; }

/* ============ 登录 ============ */
.login { min-height: calc(100vh - 67px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-box { display: flex; flex-direction: column; gap: 32px; width: 360px; max-width: 100%; }
.login-box form { display: flex; flex-direction: column; gap: 32px; }
.login-box form[hidden] { display: none; }
.login-title { font-size: 24px; font-weight: 700; line-height: 23px; }
.login-err { color: #000; }
.login-err[hidden] { display: none; }
.login-row { display: flex; align-items: center; gap: 16px; }
.login-row .k { width: 56px; flex: 0 0 auto; }
.login-row .k.wide { width: 96px; }
.login-row input {
  flex: 1; min-width: 0; border: 0; border-bottom: 1.33px solid #000; background: transparent;
  font: inherit; color: #000; outline: none; padding: 4px 0;
}
.login-actions { display: flex; justify-content: flex-end; }
.login-switch { display: flex; justify-content: flex-end; gap: 22px; }

/* ============ 设定投递 ============ */
.submit-wrap { padding: 18px 40px 80px; }
.submit-head { display: flex; align-items: baseline; gap: 24px; }
.submit-head .h1 { font-size: 24px; }
.submit-head .phase { color: #828282; }
.dossier-holder { position: relative; height: 1440px; margin: 18px 0 24px; }
.dossier-holder .nd-wrap { left: 0; top: 0; }
.submit-note { color: #000; }
.submit-msg { color: #000; margin-top: 12px; }
.form-block { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; color: #000; }
.form-row { display: flex; align-items: center; gap: 14px; }
.form-row .k { width: 70px; }
.form-row input {
  border: 0; border-bottom: 1.33px solid #000; background: transparent;
  font: inherit; color: #000; outline: none; width: 320px; max-width: 100%; padding: 2px 0;
}
.submit-actions { margin-top: 26px; display: flex; gap: 24px; }
.approved { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; align-items: flex-start; }
.approved .row { display: flex; align-items: center; gap: 24px; cursor: pointer; }
.approved .row:hover .name { color: #555; }
.approved .row .name { width: 160px; }
.approved .row .mark {
  width: 8px; height: 8px; margin-left: 0; border-radius: 50%;
  border: 1.33px solid #000; background: none; flex: 0 0 auto;
}
.approved .row.on .mark { background: #000; }
.approved .avatar {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1.33px solid #000; background: #e9e9e9 center / cover no-repeat;
}
.result-text { white-space: pre-wrap; word-break: break-word; color: #000; margin-top: 18px; }
.reason { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 18px; }
.readonly-meta { color: #000; }

/* ============ 补充页（设计稿「设卡补充页」：2430×4320 空白深色卡） ============ */
.sup-list, .sup-pages { display: flex; flex-direction: column; gap: 18px; }
.sup-list { margin: 6px 0 24px; width: 810px; max-width: 100%; }
.sup-actions { display: flex; gap: 24px; align-items: baseline; }
.cover-row { display: flex; gap: 24px; align-items: baseline; margin: 4px 0 22px; }
.sup-add[hidden] { display: none; }
.sup-page { width: 810px; max-width: 100%; display: flex; flex-direction: column; gap: 10px; }
.sup-page .sup-card { position: relative; width: 810px; max-width: 100%; height: 1440px; }
.sup-page .sup-card .nd-wrap { position: absolute; left: 0; top: 0; }
.sup-page .sup-del { align-self: flex-start; color: #828282; }
.sup-page .sup-del:hover { color: #000; }

/* ============ 弹层（放榜完整设卡等） ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(0, 0, 0, .66); overflow: auto; padding: 48px 16px 64px; }
.modal.open { display: block; }
.modal-scroll { width: max-content; max-width: 100%; margin: 0 auto; }
.modal-close {
  position: fixed; right: 18px; top: 82px; z-index: 101; background: none; border: 0; padding: 0;
  color: #fff; cursor: pointer; font: inherit; font-size: 24px; line-height: 1;
}
.modal-close:hover { color: #a8a8a8; }
.modal-body { display: flex; flex-direction: column; gap: 18px; }
.modal-body .reason { color: #fff; }
.modal-body .body-text { color: #fff; }

/* ============ 案件调查（纯文本） ============ */
.case-name { font-family: "CLFN24", monospace; font-size: 24px; line-height: 1.4; color: #000; }
.case-name.placeholder { color: #000; }
.meta { color: #000; margin-top: 6px; }
.sec { margin-top: 26px; color: #000; }
.point-title { margin-top: 40px; font-size: 20px; color: #000; }
.desc { color: #000; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.blank { height: 23px; }
.act { display: inline-block; color: #000; cursor: pointer; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; }
.act:hover { color: #555; }
.out { margin-top: 20px; color: #000; white-space: pre-wrap; word-break: break-word; }
.q { margin-top: 30px; }
.q-text { color: #000; white-space: pre-wrap; }
.q-note { color: #555; white-space: pre-wrap; }
.answer {
  width: 100%; max-width: 760px; min-height: 96px; margin-top: 6px; resize: vertical;
  background: #f2f2f2; border: 0; color: #000;
  font: inherit; line-height: 23px; padding: 8px 10px; outline: none;
}
.answer[readonly] { color: #000; }
.save-time { color: #828282; }

/* ============ 线索整理 ============ */
/* 左树模板父行：可折叠 caret；子项沿用 .child 的 "-" 前缀 */
.template-parent .caret { width: 14px; flex: 0 0 auto; color: #828282; }
.template-children .child { margin-left: 14px; }
.center { position: relative; min-height: calc(100vh - 67px); overflow: hidden; background: #fff; }
.clue-card { position: absolute; left: 40px; top: 30px; }
/* 编辑面板「线索内容」放大到约 18px */
.panel textarea#fBody { font-size: 18px; line-height: 26px; min-height: 160px; }
.panel textarea#fDetail { min-height: 96px; }
/* 删除确认弹层 + 面板错误提示 */
.confirm-box {
  position: relative; margin: 160px auto 0; width: 320px; max-width: calc(100vw - 32px);
  background: #fff; border: 1.333px solid #000; padding: 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.confirm-text { color: #000; }
.confirm-actions { display: flex; gap: 24px; }
.panel-msg { color: #000; margin-top: 12px; }
.panel-msg[hidden] { display: none; }
.clue-empty { position: absolute; left: 40px; top: 30px; visibility: hidden; }

/* ============ 公开资料库 ============ */
/* 画布内部可纵向滚动：公开档案卡含补充页时（810×1440 + 补充页）需要向下查看 */
.canvas {
  position: relative; min-height: calc(100vh - 67px); max-height: calc(100vh - 67px);
  overflow-y: auto; overflow-x: hidden; background: #fff;
  scrollbar-width: none;
}
.canvas::-webkit-scrollbar { display: none; }
.card-item { position: absolute; transform-origin: 0 0; cursor: grab; user-select: none; touch-action: none; width: 810px; }
.card-item.dragging { cursor: grabbing; }
.card-item .nd-wrap { position: absolute; left: 0; top: 0; }
.canvas .draw-layer { position: absolute; left: 0; top: 0; z-index: 500; pointer-events: none; touch-action: none; }
.canvas.pen .draw-layer, .canvas.eraser .draw-layer { pointer-events: auto; cursor: crosshair; }

/* ============ 移动端：≤768px 侧栏抽屉 ============ */
@media (max-width: 768px) {
  .header { height: 56px; padding: 0 10px; }
  .brand { font-size: 32px; letter-spacing: 0; }
  .nav, .userbox { display: none; }
  .panel-toggle { display: flex; }

  .layout, .layout.side-right, .layout.side-icons { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 56px; bottom: 0; width: 230px;
    background: #fff; z-index: 20; padding: 16px 12px 40px; overflow-y: auto;
    border-right: 1.33px solid #000;
    transform: translateX(-100%); transition: transform .18s ease;
    display: flex; flex-direction: column;
  }
  body.side-open .side { transform: translateX(0); }
  .drawer-user { display: flex; gap: 14px; margin-top: auto; padding-top: 26px; font-size: 16px; color: #828282; }
  .drawer-user .quit { cursor: pointer; }
  .main { padding: 14px 16px 70px; }
  .case-name { font-size: 22px; }
  body { overflow-x: hidden; }

  /* 设卡：按屏宽等比缩放（缩放比由 JS 计算，避免 calc 除法兼容问题） */
  .submit-wrap { padding: 14px 16px 70px; }
  .dossier-holder {
    height: calc((100vw - 32px) * 1.777778);
    margin: 12px 0 20px;
  }
  .form-row input { width: 100%; flex: 1; }
  .form-block { max-width: 420px; }

  /* 线索卡：单卡等比缩放（缩放比由 JS 计算） */
  .center { min-height: calc((100vw - 32px) * 0.823457 + 30px); }
  .clue-card { left: 16px; top: 16px; }
  .clue-empty { left: 16px; top: 16px; }

  /* 线索编辑面板：移动端跟在卡片下方 */
  .layout.side-right .panel { border-left: 0; min-height: 0; padding: 18px 16px 60px; }
  .panel { min-height: 0; }

  /* 首页：三角/标题/箭头由 JS 等比缩放居中（高度随缩放变化） */
  .home-hero { height: 358px; }
  .home-art { height: calc(810px - 67px); }
  .chapter { padding: 56px 24px 0; }
  .home-footer { padding: 64px 24px 44px; }

  /* 资料库：隐藏画笔/橡皮，单卡 */
  .layout.side-icons .icons { display: none; }
  .canvas { min-height: calc(100vh - 56px); max-height: calc(100vh - 56px); }
  .card-item { cursor: default; touch-action: pan-y; }
}
