/* ===== 像素复古风 · 全局 ===== */

/* Zpix 最像素 · 中文像素字体（官方开源，个人使用免费） */
@font-face {
  font-family: 'Zpix';
  src: url('/static/fonts/zpix.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #1a1c2c;
  --bg2: #232538;
  --panel: #2a2d42;
  --border: #4a4e69;
  --border-dark: #16182a;
  --text: #e0e6ff;
  --text-dim: #9aa0c3;
  --accent: #f8b739;     /* 像素黄 */
  --accent2: #4fc3f7;    /* 像素蓝 */
  --pink: #f7768e;
  --green: #9ece6a;
  --shadow: #0e0f1a;
}

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

body {
  font-family: "Zpix", "Courier New", "Noto Sans Mono", monospace;
  font-size: 12px;   /* Zpix 原生 12px 网格，整数倍字号像素感最佳 */
  background: var(--bg);
  color: var(--text);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* 像素风点阵背景 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 20% 20%, rgba(248,183,57,.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(79,195,247,.06), transparent 40%),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255,255,255,.015) 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.015) 7px 8px);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  border-bottom: 4px solid var(--border-dark);
  position: relative;
  overflow: hidden;   /* 裁掉天气动画超出部分 */
}
.hero-weather {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  opacity: .5;         /* 半透明背景装饰，不抢标题 */
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; }
.hero::after {
  content: "";
  position: absolute; bottom: -4px; left: 0; right: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 16px, transparent 16px 32px);
  height: 4px;
}
.hero-title {
  font-size: 4em;    /* 48px = 12x4，锐利像素 */
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--shadow);
}
.hero-sub { margin-top: 10px; color: var(--text-dim); font-size: 1.05em; letter-spacing: 2px; }

/* ===== 阶段导航 ===== */
.stage-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(26,28,44,.95);
  border-bottom: 2px solid var(--border-dark);
  box-shadow: 0 4px 0 var(--shadow);
}
.stage-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 10px;
  border: 2px solid var(--border);
  background: var(--panel);
  font-size: .85em;
}
.stage-nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ===== 阶段区块 ===== */
.stages { width: clamp(960px, 88vw, 1920px); margin: 0 auto; padding: 30px 2% 80px; }

.stage-block {
  margin-bottom: 56px;
  background: var(--panel);
  border: 3px solid var(--border-dark);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 24px;
  position: relative;
}
.stage-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}
.stage-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stage-title {
  font-size: 2em;   /* 24px = 12x2，锐利像素 */
  color: var(--accent2);
  text-shadow: 2px 2px 0 var(--shadow);
  letter-spacing: 1px;
}
.stage-subtitle {
  font-size: 1em;   /* 12px，比标题小一号 */
  color: var(--text-dim, #9aa);
  line-height: 1.5;
  overflow-wrap: break-word;
}
.stage-tools { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== 作品网格 ===== */
/* 等高布局：所有作品图片统一高度，宽度按原比例自适应，每行顶部/底部对齐 */
.work-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
}
.work-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .06s steps(2), border-color .06s;
  /* 宽度由图片高度+比例决定：不固定列宽 */
  width: auto;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.work-card:hover { border-color: var(--accent); transform: translate(-2px,-2px); }
/* 识器境(工具/横幅)保持原规则：grid 布局，横图占整行居中 */
.work-grid.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  align-items: center;
}
.work-grid.banner-grid .work-card.tool-card {
  grid-column: 1 / -1;             /* 占满整行 */
  max-width: 566px;                /* 与工具图同宽 */
  margin: 0 auto;                  /* 水平居中 */
  width: 100%;
}
.work-grid.banner-grid .work-card.tool-card img {
  aspect-ratio: var(--ar, 566/228);
  object-fit: cover;
  width: 100%;
  height: auto;
}
.work-grid.banner-grid .work-card img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  height: auto;
  display: block; image-rendering: pixelated;
}
.work-grid.banner-grid .work-card { width: auto; display: block; }
.work-card img {
  height: 190px;                 /* 统一高度 */
  width: auto;                   /* 宽度随比例自适应 */
  max-width: 100%;
  object-fit: contain;           /* 保持完整比例不变形 */
  display: block; image-rendering: pixelated;
}
.work-card .work-title {
  padding: 8px 10px;
  font-size: .85em;
  color: var(--text);
  display: flex; justify-content: space-between; align-items: center;
}
.work-card .work-title .dl-flag { color: var(--green); font-size: .8em; }
.work-card .manage {
  font-size: .75em; color: var(--pink);
  margin-left: 6px; cursor: pointer;
}

.empty { color: var(--text-dim); font-style: italic; padding: 16px; }

/* ===== 按钮 / 输入 ===== */
.btn {
  font-family: inherit;
  background: var(--accent); color: #111;
  border: 3px solid var(--border-dark);
  padding: 8px 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
}
.btn:hover { background: var(--accent2); color: #0a0a14; }
.btn-danger { background: var(--pink); color: #111; }
.btn-download {
  display: inline-block; text-decoration: none;
  background: var(--green); color: #111;
  border: 3px solid var(--border-dark);
  padding: 10px 16px; font-weight: bold;
  box-shadow: 3px 3px 0 var(--shadow);
}
.input {
  font-family: inherit;
  background: var(--bg2);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 8px 10px; width: 100%;
  margin: 4px 0;
}
textarea.input { resize: vertical; min-height: 60px; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input { flex: 1; }
.hint { color: var(--text-dim); font-size: .8em; }

.file-label {
  display: block;
  background: var(--bg2);
  border: 2px dashed var(--border);
  padding: 10px; text-align: center;
  color: var(--text-dim); cursor: pointer;
  margin: 6px 0; font-size: .85em;
}
.file-label:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,11,20,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--panel);
  border: 4px solid var(--border-dark);
  box-shadow: 8px 8px 0 rgba(0,0,0,.6);
  max-width: 640px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 20px; position: relative;
}
.modal-box.modal-admin { max-width: 460px; }
.modal-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.4em; cursor: pointer;
  z-index: 20; /* 确保在左右栏之上可点击 */
}
.modal-close:hover { color: var(--pink); }
.modal-box img.modal-img {
  width: 100%; image-rendering: pixelated;
  border: 3px solid var(--border-dark);
  background: #0e0f1a;
}
.modal-info { margin-top: 14px; }
.modal-info h3 { color: var(--accent2); margin-bottom: 6px; }

/* ===== 作品弹窗：左图右信息/评论（小红书式） ===== */
.modal-box.modal-work {
  max-width: 980px; width: 95vw;
  padding: 0; overflow: hidden;
}
.work-modal-body {
  display: flex;
  height: 82vh; max-height: 640px;
}
.work-modal-left {
  flex: 1 1 55%; min-width: 0;
  background: #0e0f1a;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 14px 14px 10px;
  overflow-y: auto;
}
.work-modal-left img.modal-img {
  width: 100%; max-height: 100%; object-fit: contain;
  image-rendering: pixelated;
  border: 3px solid var(--border-dark);
  background: #0e0f1a;
  flex: 1 1 auto; min-height: 0;
}
.work-modal-right {
  flex: 1 1 45%; min-width: 0;
  display: flex; flex-direction: column;
  border-left: 3px solid var(--border-dark);
  background: var(--panel);
}
.modal-head {
  padding: 12px 14px 6px;
  flex-shrink: 0;
  width: 100%;
  position: relative;
  border-top: 3px solid var(--border-dark);
  margin-top: 10px;
  background: var(--bg2);
}
.modal-head h3 { color: var(--accent2); margin-bottom: 6px; padding-right: 30px; }
.modal-head p { color: var(--text-dim); font-size: .88em; margin-bottom: 10px; white-space: pre-wrap; }
.modal-head .modal-actions { margin-top: 4px; }
.modal-head .btn-edit { margin-top: 8px; }

/* 评论区 */
.comments-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.comments-header {
  padding: 12px 16px;
  color: var(--accent2); font-weight: bold;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0; font-size: .95em;
}
.comments-header .cmt-count { color: var(--text-dim); font-weight: normal; margin-left: 4px; }
.comments-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 8px 16px;
}
.cmt-empty { color: var(--text-dim); text-align: center; padding: 30px 0; font-size: .85em; }
.cmt-item {
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.cmt-top { display: flex; align-items: flex-start; gap: 8px; }
.cmt-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--accent2); color: #111; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  font-size: .85em; border: 2px solid var(--border-dark);
  image-rendering: pixelated;
}
.cmt-body { flex: 1 1 auto; min-width: 0; }
.cmt-name { color: var(--accent); font-size: .82em; font-weight: bold; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmt-role { font-size: .72em; color: var(--pink); border: 1px solid var(--pink); padding: 0 4px; font-weight: normal; }
.cmt-text { color: var(--text); font-size: .9em; margin: 4px 0; word-break: break-word; }
.cmt-meta { display: flex; align-items: center; gap: 10px; font-size: .75em; color: var(--text-dim); }
.cmt-time { }
.cmt-like {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: .8em; padding: 2px 4px; display: inline-flex; align-items: center; gap: 4px;
}
.cmt-like.liked { color: var(--pink); }
.cmt-like:hover { color: var(--pink); }
.cmt-del {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: .8em; padding: 2px 4px;
}
.cmt-del:hover { color: var(--pink); }

/* 发评论区 */
.comments-input {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 2px solid var(--border);
  background: var(--bg2);
}
.comments-input textarea.input {
  width: 100%; resize: none;
  background: var(--panel); color: var(--text);
  border: 2px solid var(--border); font-family: inherit;
  padding: 8px; font-size: .9em;
}
.comments-input textarea.input:focus { outline: none; border-color: var(--accent); }
.cmt-input-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.cmt-hint { color: var(--text-dim); font-size: .78em; }
.btn-cmt {
  background: var(--accent2); color: #111; border: 2px solid var(--border-dark);
  padding: 6px 16px; cursor: pointer; font-size: .85em; font-family: inherit;
}
.btn-cmt:disabled { opacity: .5; cursor: not-allowed; }
.btn-cmt:not(:disabled):hover { filter: brightness(1.1); }

/* ===== 评论头像 + 楼中楼回复 ===== */
.cmt-item .cmt-avatar-img, .cmt-avatar-img {
  width: 30px; height: 30px; flex-shrink: 0; object-fit: cover;
  border: 2px solid var(--border-dark); image-rendering: pixelated;
  background: #1b1d2a;
}
.cmt-meta .cmt-reply {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: .8em; padding: 2px 4px;
}
.cmt-meta .cmt-reply:hover { color: var(--accent); }
.cmt-replies {
  margin: 8px 0 0 38px; padding-left: 10px;
  border-left: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.cmt-reply-item { padding: 6px 0; }
.cmt-reply-item .cmt-top { gap: 6px; }
.cmt-reply-item .cmt-avatar, .cmt-reply-item .cmt-avatar-img { width: 22px; height: 22px; font-size: .72em; }
.cmt-reply-item .cmt-name { font-size: .78em; }
.cmt-reply-item .cmt-text { font-size: .85em; }
.cmt-reply-item .cmt-meta { font-size: .7em; }

/* 回复提示条 */
.cmt-reply-hint {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent-fade, #20233a); border: 1px solid var(--accent);
  padding: 4px 8px; margin-bottom: 6px; font-size: .8em; color: var(--accent2);
}
.cmt-reply-cancel { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1em; }
.cmt-reply-cancel:hover { color: var(--pink); }

/* ===== 个人中心弹窗 ===== */
.modal-box.modal-profile {
  max-width: 460px;
}
.profile-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.profile-tab {
  background: var(--panel); color: var(--text-dim); border: 2px solid var(--border);
  padding: 6px 14px; cursor: pointer; font-size: .9em; position: relative;
}
.profile-tab.active { color: var(--accent2); border-color: var(--accent2); font-weight: bold; }
.msg-badge {
  position: absolute; top: -4px; right: -4px; min-width: 14px; height: 14px;
  background: var(--pink); color: #111; font-size: .65em;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 3px;
  /* 像素方块风格：无圆角 + 硬阴影 */
  border-radius: 0;
  border: 2px solid var(--border-dark);
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
  text-indent: 2px;
}
/* 修复：HTML hidden 属性不能被 display 覆盖（同会员框修复） */
.msg-badge[hidden] { display: none; }

/* 顶栏会员名未读方块红点 */
.profile-btn { position: relative; }
.badge-square {
  position: absolute; top: -3px; right: -3px;
  width: 10px; height: 10px;
  background: var(--pink);
  border: 2px solid var(--border-dark);
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
  border-radius: 0;
}
.badge-square[hidden] { display: none; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-avatar {
  width: 72px; height: 72px; flex-shrink: 0;
  background: var(--accent2); color: #111; font-weight: bold; font-size: 2em;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--border-dark); image-rendering: pixelated;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.profile-id .p-username { color: var(--accent2); font-size: 1.3em; font-weight: bold; }
.profile-id .p-role { color: var(--text-dim); font-size: .85em; margin-top: 2px; }
.profile-info { margin-bottom: 16px; }
.prow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-bottom: 1px dashed var(--border);
}
.prow .plabel { color: var(--text-dim); font-size: .88em; }
.prow .pval { color: var(--text); font-size: .9em; }
/* 修改头像 */
.avatar-edit { border-top: 2px solid var(--border); padding-top: 12px; }
.avatar-edit-title { color: var(--accent2); font-weight: bold; font-size: .9em; margin-bottom: 8px; }
.preset-avatars { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.preset-avatar {
  width: 46px; height: 46px; cursor: pointer; border: 3px solid var(--border);
  background: #1b1d2a; image-rendering: pixelated; padding: 0;
}
.preset-avatar:hover { border-color: var(--accent); }
.preset-avatar.sel { border-color: var(--pink); }
.preset-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.upload-avatar { display: inline-block; }
/* 消息列表 */
.msg-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.msg-empty { color: var(--text-dim); text-align: center; padding: 30px 0; font-size: .85em; }
.msg-item {
  padding: 10px; border: 1px solid var(--border); background: var(--bg2);
}
.msg-item .msg-type { color: var(--accent); font-size: .78em; }
.msg-item .msg-row { color: var(--text); font-size: .9em; margin: 4px 0; }
.msg-item .msg-row b { color: var(--accent2); }
.msg-item .msg-meta { color: var(--text-dim); font-size: .75em; }
.msg-item a.msg-link { color: var(--accent2); text-decoration: none; }
.msg-item a.msg-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .work-modal-body { flex-direction: column; height: auto; max-height: 90vh; overflow-y: auto; }
  .work-modal-left { padding: 10px; flex: none; }
  .work-modal-right { border-left: none; border-top: 3px solid var(--border-dark); max-height: 45vh; }
}

/* ===== 多文件下载区 + 编辑文件列表 ===== */
.download-area { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.download-area .btn-download { display: inline-block; text-align: center; }
.modal-head .download-area { margin-top: 6px; }
.efile-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.efile-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border: 1px solid var(--border); padding: 5px 8px;
}
.efile-row .ef-name { color: var(--text); font-size: .85em; word-break: break-all; padding-right: 8px; }
.efile-row .ef-rm {
  background: none; border: none; color: var(--pink); cursor: pointer;
  font-size: .8em; flex-shrink: 0;
}
.efile-row .ef-rm:hover { text-decoration: underline; }
.efile-row .ef-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.efile-row .ef-rn {
  background: none; border: none; color: var(--accent2); cursor: pointer;
  font-size: .8em; flex-shrink: 0;
}
.efile-row .ef-rn:hover { text-decoration: underline; }
.modal-info p { color: var(--text-dim); font-size: .9em; margin-bottom: 12px; white-space: pre-wrap; }
.modal-actions { margin-top: 8px; }
.no-file { color: var(--text-dim); font-size: .85em; }

.admin-sec { margin: 16px 0; padding-top: 12px; border-top: 2px solid var(--border); }
.admin-sec h4 { color: var(--accent); margin-bottom: 8px; font-size: .95em; }

/* ===== 浮动按钮 ===== */
.fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  width: 56px; height: 56px;
  background: var(--accent); color: #111;
  border: 4px solid var(--border-dark);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 1.8em; cursor: pointer;
}

/* ===== 底部 ===== */
footer {
  text-align: center; padding: 30px 20px;
  color: var(--text-dim); font-size: .8em;
  border-top: 3px solid var(--border-dark);
}

@media (max-width: 600px) {
  .hero-title { font-size: 2.5em; }  /* 30px，移动端 */
  .work-card img { height: 130px; }  /* 移动端图片等高缩小 */
}

/* ===== v2 顶部栏 / 登录注册 ===== */
.topbar { background: var(--bg2); border-bottom: 3px solid var(--border-dark); padding: 10px 16px; }
.topbar-inner { width: clamp(960px, 88vw, 1920px); margin: 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.brand { color: var(--accent); text-decoration: none; font-weight: bold; font-size: 1.1em; letter-spacing: 1px; }
.auth-area { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth-btn {
  font-family: inherit; background: var(--panel); color: var(--text);
  border: 2px solid var(--border); padding: 6px 14px; cursor: pointer; font-size: .9em;
  text-decoration: none;
}
.auth-btn:hover { border-color: var(--accent); color: var(--accent); }
.auth-btn.accent { background: var(--accent); color: #111; border-color: var(--border-dark); font-weight: bold; }
.auth-user { color: var(--text-dim); font-size: .9em; margin-right: 4px; }

/* 登录/注册弹窗 tab */
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-tab {
  font-family: inherit; background: var(--bg2); color: var(--text-dim);
  border: 2px solid var(--border); padding: 6px 16px; cursor: pointer;
}
.auth-tab.active { background: var(--accent); color: #111; border-color: var(--border-dark); font-weight: bold; }

/* ===== v3 会员中心卡片 ===== */
.member-card {
  max-width: 1080px; margin: 20px auto 0; padding: 20px 24px;
  background: var(--panel); border: 3px solid var(--border-dark);
  box-shadow: 6px 6px 0 var(--shadow);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.member-card[hidden] { display: none; }  /* 覆盖 flex，确保 hidden 真正隐藏 */
.member-info { flex: 1; min-width: 220px; }
.member-level { font-size: 1.8em; color: var(--accent); text-shadow: 2px 2px 0 var(--shadow); margin-bottom: 6px; }
.member-level .level-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
  margin-right: 6px;
  image-rendering: pixelated;
}
.member-meta { display: flex; gap: 18px; color: var(--text-dim); font-size: .95em; align-items: center; }
.member-pts b { color: var(--accent2); font-size: 1.2em; }
.member-next { color: var(--text-dim); }
.member-bar { height: 14px; background: var(--bg2); border: 2px solid var(--border); margin-top: 10px; position: relative; }
.member-bar-fill { height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, var(--accent2) 10px 20px); width: 0; transition: width .4s steps(6); }
.member-next-detail { color: var(--text-dim); font-size: .8em; margin-top: 6px; }
.btn-sign { flex-shrink: 0; font-size: 1em; padding: 12px 18px; }
.btn-sign:disabled { background: var(--border); color: var(--text-dim); cursor: not-allowed; }
.sign-msg { flex-basis: 100%; color: var(--green); font-size: .9em; margin-top: 4px; }

/* ===== v3.1 编辑作品 / 上传预览 ===== */
.btn-edit {
  display: block; width: 100%; text-align: center; margin-top: 12px;
  font-family: inherit; background: var(--accent2); color: #111;
  border: 3px solid var(--border-dark); padding: 10px 14px; font-weight: bold;
  cursor: pointer; box-shadow: 3px 3px 0 var(--shadow);
}
.btn-edit:hover { background: var(--accent); }
.file-preview {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 2px solid var(--border);
  padding: 8px 10px; margin: 4px 0 8px; min-height: 40px;
}
.file-preview img {
  width: 48px; height: 34px; object-fit: cover; image-rendering: pixelated;
  border: 2px solid var(--border-dark); display: none;
}
.file-name { color: var(--green); font-size: .8em; word-break: break-all; }
.chk { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: .85em; cursor: pointer; margin: 8px 0; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ========== 修炼功法展区（用户上传） ========== */
/* 境界标题下的展区按钮行 */
.stage-exhibit-row {
  display: flex;
  justify-content: center;    /* 版块顶部居中 */
  margin: 0 0 18px;           /* 与下方头部留白 */
  width: 100%;
}
.btn-exhibit {
  background: #2d3d5e;
  color: #ffd86f;
  border: 2px solid #ffd86f;
  box-shadow: 3px 3px 0 #1a2233;
  font-size: 1.1em;
  padding: 10px 26px;
}
.btn-exhibit:hover {
  background: #3b4f7a;
}

/* 宽版弹窗容器（展区） */
.modal-gallery .modal-box-wide {
  max-width: 920px;
  width: 94%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.gm-title { text-align: center; color: #ffd86f; margin-bottom: 2px; }
.gm-sub { text-align: center; color: var(--dim, #9aa4b2); font-size: .9em; margin: 0 0 12px; }
.gm-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.gm-count { color: var(--dim, #9aa4b2); font-size: .95em; }
.gm-count b { color: #ffd86f; }
.gm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding: 4px 2px;
}

/* 用户作品卡片 */
.uw-card {
  background: #1c2536;
  border: 2px solid #3a4a6a;
  box-shadow: 3px 3px 0 #0f1520;
  cursor: pointer;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .08s, box-shadow .08s;
}
.uw-card:hover {
  transform: translate(-1px,-1px);
  box-shadow: 5px 5px 0 #0f1520;
  border-color: #ffd86f;
}
.uw-card > img {
  height: 190px;              /* 与官方作品等高，作品整齐 */
  width: auto;                /* 宽度按比例自适应 */
  max-width: 100%;
  object-fit: contain;        /* 完整显示不变形 */
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
  background: #10141f;
}
.uw-card-body { padding: 8px 10px; }
.uw-card-title {
  font-weight: 700; font-size: 1em; color: #e8edf5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uw-card-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px;
  color: var(--dim, #9aa4b2); font-size: .85em;
}
.uw-avatar {
  width: 22px; height: 22px; border-radius: 0;
  background: #2d3d5e; overflow: hidden;
  image-rendering: pixelated; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.uw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uw-avatar-letter {
  color: #ffd86f; font-weight: 700; font-size: 12px;
  line-height: 1;
}
.uw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uw-card-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 二级用户作品弹窗：作者信息 */
.modal-work-uw .modal-box { max-width: 900px; }

.uw-author {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0; color: #ffd86f; font-weight: 600;
}
.uw-author .uw-avatar { width: 32px; height: 32px; }
.uw-actions { margin-top: 8px; }

/* 上传弹窗 */
#uploadModal .form { display: flex; flex-direction: column; gap: 12px; }


/* 8-bit 像素爱心点赞（右上角，爱心上 / 数字下，无重叠） */
.uw-heart-row {
  display: flex; justify-content: flex-end;   /* 右上角（靠右） */
  margin-bottom: 4px;
}
.uw-heart {
  background: none; border: none; cursor: pointer; padding: 0;
  display: inline-flex; flex-direction: column; align-items: center;
  --hc: #6b7688;   /* 默认灰色 */
}
.uw-heart.on { --hc: #ff2d4a; }   /* 已赞红色 */
.uw-heart.self { opacity: .45; cursor: not-allowed; }
.heart-svg {
  display: block;
  image-rendering: pixelated;
}
.heart-svg rect {
  fill: var(--hc);   /* 默认灰 #6b7688，.on 时红 (由 .uw-heart --hc 控制) */
}
.ph-count {
  font-family: "Zpix", monospace;   /* 像素字体 */
  font-size: 12px; color: #cfd6e0; font-weight: 700;
  line-height: 1.4; margin-top: 4px;
  white-space: nowrap;
}

/* 识器境：特殊版块标题顶部居中 */
.stage-title-center {
  text-align: center;
  width: 100%;
}

/* 突破境界 */
.btn-break {
  background: #2d3d5e; color: #ffd86f; border: 2px solid #ffd86f;
  box-shadow: 2px 2px 0 #1a2233; margin-top: 8px; font-size: .95em;
}
.btn-break:hover { background: #3b4f7a; }
.br-cond { display: flex; flex-direction: column; gap: 10px; }
.br-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #1c2536; border: 2px solid #3a4a6a; padding: 10px 14px;
}
.br-label { font-weight: 700; color: #e8edf5; }
.br-prog { color: var(--dim, #9aa4b2); }
.br-prog b { color: #ffd86f; }
.br-state.ok { color: #4ade80; font-weight: 700; }
.br-state.bad { color: #888; font-weight: 700; }

/* 突破雷电动画 */
#breakFx {
  position: fixed; inset: 0; z-index: 99999;
  pointer-events: none;
}
#breakFx canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* 顶部突破成功提示 */
.brk-tip {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-30px);
  background: #2d3d5e; color: #ffd86f; border: 2px solid #ffd86f;
  padding: 10px 22px; font-size: 1.1em; z-index: 100000;
  box-shadow: 4px 4px 0 #1a2233; opacity: 0; transition: all .3s;
  white-space: nowrap;
}
.brk-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }
