/**
 * 默认玩家端的样式。
 *
 * 从原来的 demo/app.css（2679 行）按段落拆出来的：
 *   base   设计令牌 + 基础组件 + 通用状态/弹窗 + 响应式（两端都引）
 *   player 玩家端（反馈中心、对话、资料排版）
 *   admin  管理端（骨架、表格、双栏、资料编辑器、多语言编辑）
 * 拿不准归属的段落一律留在 base：多加载几 KB 比"某端样式悄悄丢了"划算。
 */
/* ================================================================= 13. 玩家端 */

.fb-page {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-bottom: var(--sp-8);
}
.fb-head {
  padding: var(--sp-2) 2px var(--sp-1);
}
.fb-head h1 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}
.fb-head p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--fs-base);
}

.fb-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.fb-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.fb-label .req {
  color: var(--danger-600);
}
.fb-card input,
.fb-card textarea {
  border-radius: var(--r-md);
}

/* 分类：竖排单选。选项本身就是"一句话说明"，比大图标网格更好扫 */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.cat-option {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
  height: auto;
  text-align: left;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-weight: 400;
  white-space: normal;
  cursor: pointer;
}
.cat-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}
.cat-option[aria-checked="true"] {
  border-color: var(--brand-600);
  background: var(--action-primary-soft);
  box-shadow: inset 0 0 0 1px var(--brand-600);
}
.cat-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  position: relative;
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.cat-option[aria-checked="true"] .cat-radio {
  border-color: var(--brand-600);
}
.cat-option[aria-checked="true"] .cat-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-600);
}
.cat-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cat-name {
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-primary);
}
.cat-desc {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  line-height: var(--lh-normal);
}

/* 附件：缩略图 + 虚线添加入口 */
.shots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}
.shot {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-subtle);
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shot.log-file {
  width: auto;
  height: 40px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  background: var(--bg-subtle);
}
.shot-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
}
.shot-x:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: none;
}
.shot.log-file .shot-x {
  position: static;
  margin-left: var(--sp-1);
  background: transparent;
  color: var(--text-tertiary);
}
.shot.log-file .shot-x:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.shot-add {
  height: 84px;
  min-width: 84px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  font-weight: 400;
  flex-direction: column;
  gap: var(--sp-1);
}
.shot-add:hover {
  border-color: var(--brand-600);
  color: var(--brand-600);
  background: var(--action-primary-soft);
}
.shot-add svg {
  width: 16px;
  height: 16px;
}

/*
  提交条：桌面端就是表单的最后一个块（不吸底，吸底会盖住上面的内容）；
  窄屏才吸在底部——那里主 CTA 必须在拇指热区，翻到页尾再点是很痛的事。
*/
.fb-submit {
  margin-top: var(--sp-1);
}
.fb-submit button {
  height: 44px;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
}

@media (max-width: 720px) {
  .fb-submit {
    position: sticky;
    bottom: 0;
    padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: var(--bg-page);
    box-shadow: 0 -10px 18px -14px rgba(16, 24, 40, 0.35);
  }
}

/* 分段导航：胶囊分组，选中的那段自己浮起来 */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: var(--sp-5);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  height: 32px;
  padding: 0 var(--sp-3);
  gap: var(--sp-1);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  flex: none;
}
.tabs button:hover {
  background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
  border-color: transparent;
  color: var(--text-primary);
}
.tabs button[aria-selected="true"] {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.tabs button svg {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}

/* 对话：开发者在左、玩家在右，靠位置区分身份比靠头像可靠 */
.msg {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  align-items: flex-start;
}
.msg .avatar {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
}
.msg.dev .avatar {
  background: var(--action-primary-soft);
  border-color: color-mix(in srgb, var(--brand-600) 30%, transparent);
  color: var(--brand-600);
}
.msg .body {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  border-top-left-radius: var(--r-xs);
  padding: var(--sp-3) var(--sp-3);
  max-width: 88%;
}
.msg:not(.dev) {
  flex-direction: row-reverse;
}
.msg:not(.dev) .body {
  background: var(--action-primary-soft);
  border-color: color-mix(in srgb, var(--brand-600) 18%, transparent);
  border-radius: var(--r-lg);
  border-top-right-radius: var(--r-xs);
}

/*
  管理端是反过来的：坐在屏幕前的是开发者，"我"在右边。
  玩家在左边、开发者在右边——和玩家端一致的是"自己说的话在自己这一侧"。
*/
.thread-admin .msg:not(.dev) {
  flex-direction: row;
}
.thread-admin .msg:not(.dev) .body {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  border-radius: var(--r-lg);
  border-top-left-radius: var(--r-xs);
}
.thread-admin .msg.dev {
  flex-direction: row-reverse;
}
.thread-admin .msg.dev .body {
  background: var(--action-primary-soft);
  border-color: color-mix(in srgb, var(--brand-600) 18%, transparent);
  border-radius: var(--r-lg);
  border-top-right-radius: var(--r-xs);
}
.msg .meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-1);
  font-variant-numeric: tabular-nums;
}
.msg .text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--fs-base);
  line-height: var(--lh-loose);
  color: var(--text-primary);
}
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}
.attachments a,
.attachments span {
  font-size: var(--fs-xs);
  padding: 2px var(--sp-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-tertiary);
}
.attachments a:hover {
  border-color: var(--brand-600);
  color: var(--brand-600);
}

/* 进度板 */
.progress-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}
.progress-item:last-child {
  border-bottom: 0;
}
.mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 3px var(--bg-surface);
}
.progress-item .mark {
  margin-top: 6px;
}
.mark.done {
  background: var(--success-600);
}
.mark.doing {
  background: var(--warning-600);
  animation: pulse-dot 1.8s var(--ease-standard) infinite;
}
.mark.todo {
  background: var(--border-strong);
}

/* 状态页：缺参数 / 应用不存在 / 连不上 */
.fb-error {
  max-width: 560px;
  margin: 8vh auto 0;
  padding-bottom: 0;
}
.fb-error-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: center;
}
.fb-error-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-xl);
  background: var(--action-primary-soft);
  color: var(--brand-600);
  border: 1px solid color-mix(in srgb, var(--brand-600) 30%, transparent);
}
.fb-error-card h1 {
  font-size: var(--fs-xl);
  letter-spacing: -0.015em;
}
.fb-error-detail {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--fs-base);
  line-height: var(--lh-loose);
  max-width: 42em;
}
.fb-error-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
  margin-top: var(--sp-1);
  align-items: center;
}
.fb-error-snippet {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  overflow-x: auto;
  text-align: left;
}

/* 槽位里的图标必须锁尺寸：SVG 在 flex 里会按默认 300×150 撑开 */
.shot svg,
.shot-add svg {
  width: 15px;
  height: 15px;
  flex: none;
}

/* 资料分享 */
.res-item {
  text-align: left;
  width: 100%;
  height: auto;
  justify-content: flex-start;
  align-items: stretch;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  color: var(--text-primary);
  font-weight: 400;
  white-space: normal;
}
.res-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
}
.res-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.res-title {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
}

/* 置顶徽标：和状态徽标同尺寸，但用中性色——置顶不是"状态"，是排序 */
.badge.pin {
  color: var(--brand-700);
  background: var(--action-primary-soft);
  border-color: color-mix(in srgb, var(--brand-600) 22%, transparent);
}
.badge.pin::before {
  content: "★";
  font-size: 10px;
}

/* 进度描述里的换行是作者排的版：一段一条，不要折成一行 */
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.res-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.res-excerpt {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  line-height: var(--lh-normal);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.res-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
/* 正文是 Markdown 渲染出来的节点：这里只管排版，不再靠 pre-wrap 保换行
   （单个换行在渲染时已经变成 <br>，靠 white-space 反而会让源码里的空行多出空档） */
.res-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  line-height: var(--lh-loose);
  font-size: var(--fs-md);
  color: var(--text-primary);
}
.res-text > * {
  margin: 0;
}
.res-text h1,
.res-text h2 {
  font-size: 1.3em;
  line-height: 1.4;
  font-weight: 650;
  padding-top: var(--sp-1);
}
.res-text h3 {
  font-size: 1.12em;
  line-height: 1.45;
  font-weight: 640;
}
.res-text ul,
.res-text ol {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 1.35em;
}
.res-text li::marker {
  color: var(--text-tertiary);
}
.res-text blockquote {
  border-left: 3px solid var(--border-strong);
  padding: 2px 0 2px var(--sp-3);
  color: var(--text-secondary);
}
.res-text pre {
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  padding: var(--sp-3);
  overflow: auto;
  font-size: var(--fs-sm);
}
.res-text code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-subtle);
  border-radius: 4px;
  padding: 1px 4px;
}
.res-text pre code {
  background: none;
  padding: 0;
}
.res-text a {
  color: var(--action-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.res-text hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
}
.res-fig {
  margin: 0;
}
.res-fig img {
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  display: block;
}
.res-fig figcaption {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}
.res-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  text-decoration: none;
  color: var(--text-primary);
  font-size: var(--fs-sm);
}
/* 文件名那一侧要能吃掉剩余宽度，否则长名字被压成"素…"；
   图标必须锁死尺寸——它是 SVG，跟着 flex 拉伸会变成一张 400px 的大图 */
.res-file svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.res-file > .row {
  flex: 1 1 auto;
  min-width: 0;
}
.res-file .truncate {
  flex: 1 1 auto;
  min-width: 0;
}
.res-file:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}
.res-file:hover {
  border-color: var(--brand-600);
  color: var(--brand-600);
}
.res-missing {
  padding: var(--sp-3);
  border: 1px dashed var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  background: var(--bg-subtle);
}


/* 可点的昵称徽标：看起来像徽标，点下去能改名 */
.btn-badge {
  cursor: pointer;
  font: inherit;
}
.btn-badge:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* 支持 / 反对：两个并排的小按钮，选中那侧高亮 */
.reacts {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.react:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.react.on {
  background: var(--action-primary-soft);
  border-color: color-mix(in srgb, var(--brand-600) 30%, transparent);
  color: var(--brand-700);
}
