/* Doujinshi3D · 公共（变量 / 背景 / 底部提示 / file:// 提示 / 致命错误） */
:root {
  --ink: #1a1a1a;
  --bg-top: #4a453d;
  --bg-bottom: #1a1813;
  --paper: #fffcf5;
  --fg: #e8e2d6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background-color: #14120f;
  background-image: radial-gradient(circle at 50% 22%, var(--bg-top) 0%, var(--bg-bottom) 72%);
  background-attachment: fixed;
  color: var(--fg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html { height: 100%; }

body.player, body.tools { height: 100%; overflow: hidden; }

/* ------------------------------------------------------------ 3D 舞台 */
#stage3d {
  position: fixed; inset: 0;
  touch-action: none;
  cursor: grab;
}
body.dragging #stage3d { cursor: grabbing; }
body.orbiting #stage3d { cursor: move; }
body.panning #stage3d { cursor: move; }
.r3d-canvas { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------ 底部提示 */
#hint {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(24, 22, 20, .72);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  font-family: "Consolas", "Microsoft YaHei", monospace; font-size: 12px;
  color: rgba(232, 226, 214, .62);
  z-index: 60; pointer-events: none;
  white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden;
}
#hint b { color: var(--fg); font-weight: 400; }
#hint .sep { opacity: .3; }
#hint .only-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  #hint .only-mouse { display: none; }
  #hint .only-touch { display: inline; }
}

/* ------------------------------------------------------------ file:// 提示 */
#filetip {
  position: fixed; inset: 0; z-index: 500; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  background: rgba(12, 11, 9, .93); backdrop-filter: blur(6px);
  padding: 40px; text-align: center; line-height: 1.8;
}
#filetip.on { display: flex; }
#filetip b { font-size: 16px; letter-spacing: .06em; }
#filetip span { font-size: 13px; opacity: .72; max-width: 480px; }
#filetip code {
  font-family: Consolas, monospace; background: rgba(255, 255, 255, .1);
  padding: 1px 6px; border-radius: 4px; color: var(--fg);
}

/* ------------------------------------------------------------ 致命错误 */
.fatal {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 40px;
  text-align: center; color: #f6b0a6; background: #17140f; z-index: 900;
}
.fatal b { font-size: 16px; }
.fatal span { font-size: 13px; opacity: .8; max-width: 560px; line-height: 1.7; }
