/* ============ 冒险岛浅色暖调主题 ============ */
:root {
  --primary: #E8943A;          /* 枫叶金橙 */
  --primary-light: #F5B461;
  --primary-dark: #C47324;
  --secondary: #D4629A;        /* 粉紫 */
  --secondary-light: #E88BB8;
  --accent: #22C55E;           /* 翠绿 */
  --bg: #FDF6EF;               /* 暖米色底 */
  --bg-base: #F5EDE4;
  --card: #FFFFFF;
  --card-hover: #FFF3E8;
  --text: #3D2415;             /* 深棕主文字 */
  --text-secondary: #6B5544;
  --muted: #9B8E82;
  --border: #E8DED0;
  --danger: #DC2626;
  --danger-dark: #B91C1C;
  --ok: #16A34A;
  --gold: #D4AF37;

  --font-pixel: 'Press Start 2P', 'MuzaiPixelFlat', cursive;
  --font-sans: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
}

@font-face {
  font-family: 'MuzaiPixelFlat';
  src: url('fonts/MuzaiPixelFlat.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background-image: url('news-bg.webp');
  background-attachment: fixed;
  background-size: auto;
  background-position: center top;
  background-repeat: no-repeat;
  background-color: #e9f0f5;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

.view { min-height: 100vh; }

/* 让页脚在内容不足时固定在页面最下方 */
#app-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-view main { flex: 1 0 auto; }

.pixel-font { font-family: var(--font-pixel); }

.glow-text {
  text-shadow: 0 0 10px rgba(232, 148, 58, 0.5), 0 0 40px rgba(232, 148, 58, 0.25);
}

/* ============ 枫叶飘落装饰 ============ */
.leaves {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.falling-leaf {
  position: absolute;
  top: -12vh;
  width: var(--leaf-size, 18px);
  height: var(--leaf-size, 18px);
  background: linear-gradient(135deg, #F5B461 0%, #E8943A 55%, #C47324 100%);
  border-radius: 0 50% 0 50%;
  opacity: 0;
  animation: falling-leaf linear infinite;
  animation-duration: var(--leaf-duration, 10s);
  animation-delay: var(--leaf-delay, 0s);
  filter: drop-shadow(0 1px 2px rgba(61, 36, 21, 0.2));
}

@keyframes falling-leaf {
  0%   { transform: translateY(-12vh) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.85; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(112vh) rotate(720deg); opacity: 0; }
}

/* ============ 冒险岛木框窗口 ============ */
.ms-window {
  position: relative;
  background: linear-gradient(180deg, #FFF8F0 0%, #FDF3E8 100%);
  border: 2px solid var(--primary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(61, 36, 21, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ms-window::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 1px solid rgba(232, 148, 58, 0.25);
  pointer-events: none;
  z-index: 1;
}

/* ============ 登录页 ============ */
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card { width: 100%; max-width: 400px; }

.login-logo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px; }
.login-logo-img { width: 84px; height: auto; display: block; }
.login-logo-maple { width: 44px; height: auto; display: block; }

.logo-fixed {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 64px;
  height: auto;
  z-index: 100;
  pointer-events: none;
  opacity: 0.95;
}

/* ============ 卡片 ============ */
.card {
  background: linear-gradient(145deg, rgba(255,255,255,0.97) 0%, rgba(253,246,239,0.92) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(61, 36, 21, 0.06), 0 1px 4px rgba(61, 36, 21, 0.04);
}

.gradient-border {
  position: relative;
  background: var(--card);
  border-radius: 16px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary), transparent 50%, var(--secondary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

h1.site-name {
  margin: 0 0 6px;
  font-size: 19px;
  text-align: center;
  color: var(--primary-dark);
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.subtitle { margin: 0 0 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ============ 表单 ============ */
form { display: flex; flex-direction: column; gap: 16px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

input, select {
  padding: 11px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFDF9;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 148, 58, 0.15);
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
  background: #FFFDF9;
  color: var(--text);
  outline: none;
}

textarea:focus { border-color: var(--primary); }

/* ============ 冒险岛按钮 ============ */
button {
  position: relative;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #3A2200;
  border: 2px solid var(--primary-dark);
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 200, 0.4);
  transition: all 0.15s;
}

button:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(232, 148, 58, 0.5);
}

button:active { transform: scale(0.97); }

button:disabled { background: #D8CCC0; border-color: #C4B5A0; color: #8A7C6C; cursor: not-allowed; box-shadow: none; text-shadow: none; }

button.ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  padding: 7px 14px;
  font-size: 14px;
  text-shadow: none;
}

button.ghost:hover { background: var(--primary-dark); color: #fff; box-shadow: none; }

button.reject {
  color: #FFF5E6;
  border-color: var(--danger-dark);
  background: linear-gradient(180deg, #EF4444 0%, var(--danger) 50%, var(--danger-dark) 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

button.reject:hover { border-color: #EF4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }

/* 交易大厅「余额支付」：绿色的花钱按钮，和旁边默认样式的「购买 / 去支付」一眼分得开——
   它不跳支付页，是直接扣站内余额成交。padding 交给 .ex-actions .claim-btn（0-2-0）统一管。 */
button.balance-pay-btn {
  color: #F3FFF8;
  border-color: #1A7A4E;
  background: linear-gradient(180deg, #34B27B 0%, #22935F 50%, #1A7A4E 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

button.balance-pay-btn:hover { border-color: #34B27B; box-shadow: 0 0 12px rgba(52, 178, 123, 0.45); }

.error { color: var(--danger); font-size: 14px; margin: 0; min-height: 1em; }
.ok { color: var(--ok); font-size: 14px; margin: 0; min-height: 1em; }

/* ============ 头部（冒险岛官网风格） ============ */
.site-header-wrapper {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50px;
}

.site-header-hero {
  position: relative;
  height: 200px;
  max-width: 1400px;
  margin: 0 auto;
}

.site-header-chars {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 120px;
  width: auto;
  object-fit: contain;
  object-position: bottom;
  image-rendering: pixelated;
}

.site-header-brand {
  position: absolute;
  left: 0;
  top: 60%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
}

.site-header-logo {
  width: 90px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.site-header-brand-text h1 {
  margin: 0;
  font-size: 22px;
  color: #fff;
  line-height: 1.3;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.25);
}

.site-header-brand-text p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* 深棕色导航标签栏 */
.site-nav-bar {
  background: linear-gradient(180deg, #3D302A 0%, #2A211C 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 40;
}

.site-nav-container {
  display: flex;
  align-items: center;
  padding: 0 max(1vw, 32px);
  min-height: 68px;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #D4C4A8;
  background: transparent;
  border: none;
  border-radius: 0;
  text-shadow: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tabs button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.tabs button.active {
  color: #fff;
  background: linear-gradient(180deg, #F5B461 0%, #E8943A 100%);
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(232, 148, 58, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 纸娃娃是独立页面（/paperdoll），不是站内页签，所以这个按钮放在 .tabs 外面单独一个。
   放 .tabs 里面会被 src/app.js 那个 switchTab 绑定，data-tab 对不上会 loaders[undefined] 报错。
   版式故意抄 .tabs button，让它看着还是导航条里的一员。 */
.nav-jump {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 10px 20px;
  margin-right: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #D4C4A8;
  background: transparent;
  border: 1px solid rgba(212, 196, 168, 0.35);
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-jump:hover {
  color: #fff;
  border-color: #F5B461;
  background: rgba(245, 180, 97, 0.12);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.user-box span { color: #E8DDC8; font-weight: 600; }

.user-box .ghost {
  color: #FFD966;
  border: 1px solid #E8943A;
  background: transparent;
  text-shadow: none;
}

.user-box .ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* 导航栏图标按钮（爱心/用户名/退出） */
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(232, 148, 58, 0.55);
  background: transparent;
  color: #E8DDC8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-icon-btn svg { display: block; }
.nav-icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-icon-btn.heart { color: #FF7B9C; }
.nav-icon-btn.heart:hover { color: #FFAEC3; }
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(232, 148, 58, 0.55);
  background: transparent;
  color: #E8DDC8;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
}
.nav-user-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-user-btn svg { color: #FFD966; }

/* 为彭于晏点杯恰啡（.card.coffee-card 提高优先级，压过 .tab .card 的 460px 限宽） */
.tab .card.coffee-card { max-width: none; margin: 0 0 24px; }
.coffee-text p { margin: 0 0 10px; line-height: 1.85; color: var(--text); }
.coffee-support { display: flex; gap: 28px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.coffee-left { flex: 1 1 260px; min-width: 240px; }
.coffee-amount-title { font-weight: 700; margin: 0 0 10px; color: var(--primary-dark); }
.coffee-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.coffee-chip { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: #FDF8F0; color: var(--text); cursor: pointer; font-weight: 600; }
.coffee-chip:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--card-hover); }
.coffee-custom { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.coffee-custom input { max-width: 240px; }
.coffee-paytypes { display: flex; gap: 10px; margin: 14px 0; }
.coffee-paytype { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: #FDF8F0; font-size: 14px; color: var(--text-secondary); }
.coffee-paytype input { accent-color: var(--primary); margin: 0; }
.coffee-paytype:has(input:checked) { border-color: var(--primary); background: var(--card-hover); color: var(--primary-dark); font-weight: 600; }
#coffee-pay-btn { width: 100%; max-width: 260px; }
.coffee-note { font-size: 12px; margin-top: 12px; }
.coffee-sponsors-box { flex: 1 1 280px; min-width: 260px; }
.coffee-sponsor-title { margin: 0 0 6px; font-size: 16px; }
#coffee-sponsor-summary { font-size: 13px; margin: 0 0 8px; }
.coffee-sponsor-table { max-height: 320px; overflow-y: auto; }
.coffee-sponsor-table th, .coffee-sponsor-table td { font-size: 13px; }

/* CDK 交易在线支付：卡片里的说明与支付状态行 */
.cdk-pay-note { font-size: 12px; margin: 10px 0 4px; }
#cdk-pay-status { font-size: 13px; margin: 0 0 10px; }

/* 余额卡片（「我的」页 + 管理面板共用）
   .tab .card{max-width:460px} 是 0-2-0，这里必须用 0-3-0 的 .tab .card.balance-card 才压得住 */
.tab .card.balance-card { max-width: none; }
.balance-filter {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; user-select: none; white-space: nowrap;
}
/* 必须带属性选择器：后面的 .role-search input{flex:1} 同分且更靠后，会把这个复选框拉宽 */
.balance-filter input[type="checkbox"] { flex: none; width: 15px; height: 15px; margin: 0; cursor: pointer; }
.balance-summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px;
  margin: 14px 0 16px; padding: 14px 18px;
  border: 1px dashed var(--border); border-radius: 12px; background: #FDF8F0;
}
.balance-total { display: flex; align-items: baseline; gap: 10px; }
.balance-total-label { font-size: 13px; color: var(--text-secondary); }
.balance-total-value { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.balance-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--text-secondary); }
.balance-meta b { color: var(--text); }
.balance-table { max-height: 320px; overflow-y: auto; }
#balance-mgmt-card { margin-top: 18px; }
#balance-mgmt-card .role-search { margin-top: 12px; }

/* ============ 主内容 ============ */
main { width: 100%; padding: 24px 28px 48px; max-width: 1380px; margin: 0 auto; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.tab .card-grid .card { max-width: none; margin: 0; }

/* 求购卡片横向铺开。两处渲染的是同一个 requestCard()（5 列表格：卖家/价格/状态/CDK码/操作），
   但列宽要的不一样，所以分开写：
   - 交易大厅的公开求购列表：480px 起，不改。
   - 个人中心的「我的求购」：要「横向排数个」，480px 在主内容（最大 1380px，减掉两侧 28px padding
     ≈ 1324px 可用）下最多只排得出 2 列，所以降到 380px —— 1324px 上正好 3 列（每列约 428px，
     那个 5 列表格仍然放得下）。窄屏 auto-fit 会自动退到 1 列，不用写媒体查询。
   **容器上不能直接挂 .card-grid**：它是 340px，且 `.tab .card-grid .card` 只压 max-width，
   而这里连 margin-bottom 一起归零才不会在网格行距之外多出一道缝。 */
#requests-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 20px; align-items: start; }
#requests-body .request-card { max-width: none; margin-bottom: 0; }
#my-requests-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
#my-requests-body .request-card { max-width: none; margin-bottom: 0; }
/* emptyDiv 生成的 <p class="empty"> 也占一格，不铺满的话「你还没有发布过求购」会缩在左半边 */
#requests-body .empty,
#my-requests-body .empty { grid-column: 1 / -1; }

#tab-messages .card { max-width: none; }
.msg-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) {
  .msg-grid { grid-template-columns: 1fr; }
}

.tab h2 {
  margin: 0 0 16px;
  font-size: 19px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab h2::before {
  content: '';
  width: 6px;
  height: 20px;
  border-radius: 9999px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary-dark));
  display: inline-block;
}

.tab .card { max-width: 460px; }

/* ============ 表格 ============ */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  margin-bottom: 28px;
  box-shadow: 0 2px 10px rgba(61, 36, 21, 0.05);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}

th {
  background: linear-gradient(180deg, #FFF3E8, #FDF6EF);
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: #FFFDF9; }

td .claim-btn { padding: 6px 14px; font-size: 13px; }

.mask { color: var(--muted); letter-spacing: 1px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.load-more-wrap { text-align: center; padding: 12px 0; }

.switch { text-align: center; margin: 14px 0 0; }
.switch span { color: var(--primary-dark); cursor: pointer; font-size: 14px; }
.switch span:hover { text-decoration: underline; }

td button + button { margin-left: 8px; }

.item-icon { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin-right: 6px; }

/* ============ 物品自动补全 ============ */
.ac-wrap { position: relative; display: flex; flex-direction: column; }
.ac-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(61, 36, 21, 0.12);
  display: none;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.ac-item:hover { background: var(--card-hover); }

/* ============ OCR 图片识别 ============ */
.ocr-card { margin-bottom: 20px; }
.ocr-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: #FFFDF9;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.ocr-drop:hover { border-color: var(--primary); }
.ocr-drop p { margin: 4px 0; }
.ocr-entry { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ocr-entry input { flex: 1; min-width: 120px; }
.ocr-entry input.incomplete { border-color: var(--danger); }
.ocr-hint { font-size: 13px; color: var(--danger); }
.ocr-hint.ok { color: var(--ok); }
.ocr-raw { white-space: pre-wrap; background: #FDF6EF; padding: 12px; border-radius: 8px; font-size: 13px; }

/* ============ 许愿 ============ */
.wish-card { margin-top: 20px; }
.wish-add { display: flex; gap: 8px; margin-bottom: 10px; }
.wish-add input { flex: 1; }

.role-search { display: flex; gap: 8px; margin-bottom: 14px; }
.role-search input { flex: 1; }
.wish-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.wish-row span { flex: 1; }
.wish-hint { margin: 8px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wish-pick { padding: 4px 10px; font-size: 13px; }

/* ============ 留言本 / 直播间 ============ */
.msg-announce { margin-bottom: 20px; }
.live-rooms { margin: 12px 0; }
.live-room { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.live-name { font-weight: 600; }
.live-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #F0EDE6; color: var(--muted); }
.live-badge.on { background: #E74C3C; color: #fff; animation: pulse 1.2s infinite; }
.live-jump { font-size: 13px; padding: 4px 10px; border-radius: 6px; background: var(--primary); color: #fff; text-decoration: none; }
.live-jump.on { background: #E74C3C; }
.live-jump:hover { opacity: 0.9; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.msg-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.msg-body { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ============ 摇摇乐 ============ */
.lucky-intro { margin: 0 0 16px; }

.lucky-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.tab .lucky-draw-card,
.tab .lucky-add-card {
  max-width: none;
  margin: 0;
}
@media (max-width: 900px) {
  .lucky-top { grid-template-columns: minmax(0, 1fr); }
}

.lucky-stage {
  background: #FDF8F0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-height: 120px;
  margin-bottom: 16px;
  position: relative;
}

.lucky-pool {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.lucky-pool.is-empty { display: block; }

.lucky-pool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-align: center;
}

.lucky-pool-card .item-icon { width: 40px; height: 40px; margin-right: 0; }
.lucky-pool-card .lucky-name { font-size: 14px; word-break: break-all; line-height: 1.3; }
.lucky-pool-card .lucky-contributor { font-size: 11px; color: var(--muted); }

/* ---- CSGO 式抽奖转盘（绝对定位覆盖层：不参与布局，避免撑爆网格） ---- */
.lucky-reel {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFDF7 0%, #F6EDDD 100%);
}
.lucky-reel::before,
.lucky-reel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 70px;
  z-index: 3;
  pointer-events: none;
}
.lucky-reel::before { left: 0; background: linear-gradient(90deg, #FDF8F0 0%, rgba(253, 248, 240, 0) 100%); }
.lucky-reel::after { right: 0; background: linear-gradient(270deg, #FDF8F0 0%, rgba(253, 248, 240, 0) 100%); }

.lucky-reel-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #E8943A, #B86A10);
  z-index: 4;
  box-shadow: 0 0 10px rgba(232, 148, 58, 0.8);
}
.lucky-reel-pointer::before,
.lucky-reel-pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
}
.lucky-reel-pointer::before { top: -2px; border-bottom: none; border-top-color: #B86A10; }
.lucky-reel-pointer::after { bottom: -2px; border-top: none; border-bottom-color: #B86A10; }

.lucky-reel-track {
  display: flex;
  gap: 10px;
  align-items: stretch;
  height: 100%;
  padding: 14px 0;
  will-change: transform;
}

.lucky-reel-card {
  flex: 0 0 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  overflow: hidden;
}
.lucky-reel-card .item-icon { width: 42px; height: 42px; margin: 0; }
.lucky-reel-card .lucky-name {
  font-size: 12px;
  line-height: 1.25;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lucky-reel-card .lucky-badge { margin-top: auto; }
.lucky-reel-card.tier-grand { border-color: var(--gold); background: #FFFBEC; }
.lucky-reel-card.tier-thanks { border-color: #B0BEC5; background: #F7F9FA; }

.lucky-reel-card.lucky-reel-winner {
  border-color: var(--gold);
  background: #FFF8E1;
  animation: reelWinnerGlow 0.5s ease-in-out infinite alternate;
  z-index: 2;
}
@keyframes reelWinnerGlow {
  from { box-shadow: 0 0 6px rgba(230, 195, 77, 0.5); transform: scale(1.02); }
  to { box-shadow: 0 0 22px rgba(230, 195, 77, 0.95); transform: scale(1.08); }
}

@media (max-width: 600px) {
  .lucky-reel-card { flex-basis: 96px; }
}

.lucky-draw-btn {
  width: 100%;
  max-width: 320px;
  font-size: 18px;
  font-weight: 700;
  padding: 16px;
  letter-spacing: 4px;
  display: block;
  margin: 0 auto;
}

.lucky-result {
  margin: 16px 0;
  padding: 18px;
  border: 2px solid var(--ok);
  background: #F0FAF0;
  border-radius: 12px;
  text-align: center;
  animation: resultPop 0.5s ease;
}
@keyframes resultPop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
.lucky-result .lucky-win-title { font-size: 18px; font-weight: 700; color: var(--ok); margin-bottom: 8px; }
.lucky-result .lucky-win-cdk { font-size: 20px; letter-spacing: 2px; font-weight: 700; color: var(--text); }
.lucky-result .lucky-win-cdk-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.lucky-thanks-info { margin: 0 0 14px; text-align: center; }
.lucky-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 16px; }

.lucky-pool-card.tier-grand {
  border-color: var(--gold);
  background: linear-gradient(180deg, #FFF8E1, #FFFDF6);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
}

.lucky-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  line-height: 1.5;
}
.lucky-badge.grand { background: linear-gradient(135deg, #E6C34D, #F5DD7A); color: #6B4A00; }
.lucky-badge.normal { background: #F0EDE6; color: var(--text-secondary); }
.lucky-badge.thanks { background: #DBEAFE; color: #1D4ED8; }
.lucky-badge.legendary {
  background: linear-gradient(90deg, #FF9D3C, #FFE93C, #5EFF7B, #3CD6FF, #B45EFF, #FF5EC4, #FF9D3C);
  background-size: 200% auto;
  color: #4A2600;
  font-weight: 700;
  animation: medalRainbow 3s linear infinite;
}
/* 传说中的物品：红色炫彩边框（奖池卡片 / 弹窗卡片）/ 转盘卡片 / 抽奖结果 */
.lucky-pool-card.tier-legendary,
.lucky-pool-modal-card.tier-legendary {
  position: relative;
  border-color: rgba(255, 59, 59, 0.55);
  background: linear-gradient(180deg, #FFF3F3, #FFFAF7);
  box-shadow: 0 0 12px rgba(255, 59, 59, 0.3);
}
.lucky-pool-card.tier-legendary::before,
.lucky-pool-modal-card.tier-legendary::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(90deg, #FF3B3B, #FF7B3C, #FFD63C, #FF3BC8, #B43CFF, #FF3B3B);
  background-size: 200% auto;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: medalRainbow 3s linear infinite;
}
.lucky-reel-card.tier-legendary { border-color: #FF3B3B; background: #FFF3F3; }
.lucky-result.result-legendary { border-color: rgba(255, 59, 59, 0.55); background: #FFF3F3; }
.lucky-result.result-legendary .lucky-win-title {
  background: linear-gradient(90deg, #FF9D3C, #B45EFF, #3CD6FF, #FF9D3C);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: medalRainbow 3s linear infinite;
}

.lucky-return-btn {
  color: var(--text-secondary);
  border-color: #C4B5A0;
  background: linear-gradient(180deg, #F0E8DC 0%, #E2D6C4 50%, #D4C5B0 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.lucky-return-btn:hover { border-color: #B0A090; box-shadow: 0 0 8px rgba(100, 80, 60, 0.15); }

.lucky-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.lucky-result.result-grand { border-color: var(--gold); background: #FFF8E1; }
.lucky-result.result-grand .lucky-win-title { color: #B8860B; }
.lucky-result.result-thanks { border-color: #B0BEC5; background: #F5F7F8; }
.lucky-result.result-thanks .lucky-win-title { color: var(--muted); }

/* ============ 求购卡片 ============ */
.request-card { margin-bottom: 18px; }
.request-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.request-head strong { font-size: 16px; }
.request-head .muted { flex: 1 1 auto; }
.muted { color: var(--muted); font-size: 13px; }
.request-card table { margin-top: 4px; }

/* ============ 徽章 ============ */
.ms-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
}

/* ============ 像素分隔线 ============ */
.ms-pixel-divider {
  height: 3px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--primary) 0px,
    var(--primary) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.5;
}

/* ============ 底部图片滚动 ============ */
.footer-image-scroll {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

.footer-image-scroll-track {
  display: flex;
  width: max-content;
  animation: footer-img-scroll 40s linear infinite;
}

.footer-image-scroll-img {
  height: 60px;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}

@keyframes footer-img-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============ 页脚 ============ */
.site-footer {
  background: linear-gradient(180deg, #FFF3E8 0%, #FDF6EF 100%);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.site-footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { width: 34px; height: auto; display: block; }
.footer-name { display: block; font-size: 13px; color: var(--primary-dark); line-height: 1.5; }
.footer-sub { display: block; font-size: 12px; color: var(--muted); }

.footer-note { margin: 0; font-size: 13px; color: var(--text-secondary); max-width: 640px; line-height: 1.7; }

.footer-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.footer-made { display: inline-flex; align-items: center; gap: 4px; }

/* ============ 交易大厅 ============ */
.ex-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.ex-header h2 { margin: 0; }
.ex-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 次要按钮：与主按钮同尺寸但描边样式，「发布」始终是这一行里最重的那个 */
.ex-ghost-btn { background: #fff !important; color: var(--primary-dark) !important; border: 1px solid var(--primary) !important; }
.tab .ex-publish-card { max-width: none; margin-bottom: 20px; }
.ex-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ex-form-grid .ex-full { grid-column: 1 / -1; }
.ex-equip-attrs { margin: 8px 0; }
.ex-equip-attrs h3 { font-size: 15px; margin: 0 0 12px; }
.ex-equip-attrs h3 small { color: var(--muted); font-weight: 400; }
.ex-attr-group { background: #FDF8F0; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.ex-attr-group-title { font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ex-attr-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.ex-attr-item label { flex: 1; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.ex-attr-item label input[type="checkbox"] { width: 16px; height: 16px; }
.ex-attr-input { width: 90px; text-align: center; }
.ex-attr-input:disabled { background: #EFE7DA; color: var(--muted); cursor: not-allowed; }

.ex-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.ex-filter select, .ex-filter input { flex: 1; min-width: 140px; }
.ex-filter #ex-search, .ex-filter #ex-player { flex: 1.5; }

.ex-table { font-size: 14px; }
.ex-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.ex-badge.sell { background: #F5ECE8; color: #7D2E2E; }
.ex-badge.buy { background: #E3F2FD; color: #1565C0; }
.ex-badge.active { background: #E8F5E9; color: #2E7D32; }
.ex-badge.pending { background: #FFF3E0; color: #E65100; }
.ex-badge.completed { background: #E3F2FD; color: #1565C0; }
.ex-badge.removed { background: #FFEBEE; color: #C62828; }
.ex-sort-btn { border: none; background: none; padding: 0; font-weight: 700; color: inherit; text-shadow: none; font-size: 14px; cursor: pointer; }
.ex-sort-btn:hover { box-shadow: none; color: var(--primary-dark); }
.ex-currency-icon { width: 18px; height: 18px; vertical-align: middle; margin-left: 3px; }
.ex-item-name { cursor: pointer; }
.ex-copy-btn { padding: 2px 8px; font-size: 12px; }
.ex-contact { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ex-equip-cell .equip-attributes div { line-height: 1.5; }
.ex-contact-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.ex-actions { white-space: nowrap; }
.ex-actions .claim-btn { padding: 4px 10px; font-size: 12px; margin: 2px 2px 2px 0; }
.ex-offers { margin-top: 6px; }
.ex-offer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; }
.ex-offer .claim-btn { padding: 2px 8px; font-size: 11px; }
.ex-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ex-pagination > div { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-page-btn { padding: 6px 12px; font-size: 13px; }
.ex-page-btn.active { background: var(--primary-dark); color: #fff; }

.ex-picker { position: relative; }
.ex-picker input { width: 100%; }
.ex-online-list { z-index: 60; }
.ex-item-preview { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ex-item-preview .item-icon { width: 22px; height: 22px; }
.lucky-win-item { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; font-weight: 700; margin: 8px 0; }
.lucky-win-item .item-icon { width: 32px; height: 32px; }

@media (max-width: 640px) {
  .ex-form-grid { grid-template-columns: 1fr; }
}

/* ============ 物品悬浮窗（与 old.artale.cn/market.php 完全一致） ============ */
.itemframe {
  display: none;
  position: absolute;
  z-index: 1000;
  width: 280px;
  background-color: rgba(34, 34, 34, 0.6);
  color: #fff;
  border: 1px solid #555;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  font-size: 12px;
  padding: 8px;
  text-align: left;
}

.itemname {
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  color: #ffcc00;
  padding: 5px 0;
  border-bottom: 1px dashed #555;
  margin-bottom: 8px;
  letter-spacing: 1.5px;
}

.icon { float: left; margin-right: 15px; }

.rinfo { display: flex; flex-direction: column; }

.reqinfo { color: #fff; display: block; margin-bottom: 2px; letter-spacing: 1.5px; }

.reqjob { clear: both; padding-top: 5px; border-top: 1px dashed #555; margin-top: 8px; }

.reqtm { display: flex; justify-content: space-between; letter-spacing: 1.5px; }

.reqtm span { color: #ff6666; letter-spacing: 1.5px; }

.iinfo { margin-top: 8px; border-top: 1px dashed #555; padding-top: 5px; color: #fff; }

.wiki-bot { word-spacing: 2px; color: #fff; letter-spacing: 1.5px; }

.tuc { word-spacing: 2px; color: #fff; letter-spacing: 1.5px; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .site-header-hero { height: 150px; }
  .site-header-chars { height: 82px; }
  .site-header-logo { width: 58px; }
  .site-header-brand { top: 55%; gap: 8px; padding-left: 4px; }
  .site-header-brand-text h1 { font-size: 15px; }
  .site-header-brand-text p { font-size: 11px; }
  .site-nav-container { flex-direction: column; align-items: stretch; padding: 8px 16px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { flex-shrink: 0; padding: 8px 16px; font-size: 13px; }
  .nav-jump { flex-shrink: 0; align-self: flex-start; padding: 8px 16px; margin: 8px 0 0; font-size: 13px; }
  .user-box { margin-left: 0; padding: 8px 0; justify-content: space-between; }
  main { padding: 16px; }
  .card { padding: 20px; }
  .card-grid { grid-template-columns: 1fr; }
  #requests-body { grid-template-columns: 1fr; }
  .site-footer-inner { padding: 0 16px; }
}

/* ============ BOSS 计时器 ============ */
.boss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.boss-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 14px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.boss-card.disabled { opacity: 0.55; }
.boss-card img { width: 40px; height: 40px; object-fit: contain; margin-bottom: 8px; }
.boss-card-name { font-weight: 700; margin-bottom: 4px; }
.boss-admin { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.boss-admin input[type="number"] { width: 90px; padding: 5px 8px; border: 1px solid #ddd; border-radius: 6px; }
.boss-admin input[type="text"] { width: 150px; padding: 5px 8px; border: 1px solid #ddd; border-radius: 6px; }
.boss-kill-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.boss-kill-form label { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.boss-kill-form button { align-self: flex-end; }
.boss-countdown { font-family: ui-monospace, monospace; font-weight: 700; }
.boss-banner { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #C62828; color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,0.25); max-width: 90%; }
.boss-type { margin-left: 6px; }
#tab-boss .card { max-width: none; }


/* ---- 奖池一览弹窗 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 10, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-panel {
  background: #FFFDF7;
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(40, 25, 10, 0.35);
  width: 100%;
  max-width: 860px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: resultPop 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 18px; }
.lucky-pool-modal-body {
  overflow-y: auto;
  padding: 16px 18px;
}
.lucky-pool-modal-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 10px 0 10px;
  color: var(--text);
}
.lucky-pool-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.lucky-pool-modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.lucky-pool-modal-card .item-icon { width: 40px; height: 40px; margin: 0; }
.lucky-pool-modal-card .lucky-name {
  font-size: 12px;
  line-height: 1.25;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lucky-pool-modal-card.tier-grand { border-color: var(--gold); background: #FFFBEC; }
.lucky-pool-modal-card.tier-thanks { border-color: #B0BEC5; background: #F7F9FA; }
/* 管理列表里的谢谢参与奖品（只有管理员看得到，用来撤销降级） */
.lucky-pool-card.tier-thanks { border-color: #B0BEC5; background: #F7F9FA; opacity: .82; }
.lucky-pool-modal-empty { color: var(--muted); font-size: 13px; padding: 6px 0 10px; }
.lucky-view-pool-btn { display: block; margin: 10px auto 0; }

/* ---- 命中率计算器 ---- */
.acc-required { font-size: 20px; font-weight: 700; margin: 10px 0; }
.acc-verdict { font-size: 17px; font-weight: 700; padding: 12px; border-radius: 10px; margin-top: 6px; }
.acc-verdict.acc-hit { background: #F0FAF0; color: var(--ok); border: 2px solid var(--ok); }
.acc-verdict.acc-miss { background: #FDECEC; color: var(--danger); border: 2px solid var(--danger); }
#acc-result { margin-top: 14px; }
#acc-result:empty { display: none; }

/* ---- 实时经验记录器（屏幕识别） ---- */
.explive-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 20px; align-items: start; margin-bottom: 14px; }
@media (max-width: 900px) { .explive-top { grid-template-columns: minmax(0, 1fr); } }
.explive-preview-wrap { position: relative; aspect-ratio: 16 / 9; background: #241a12; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.explive-video { display: block; width: 100%; height: 100%; object-fit: contain; }
.explive-overlay { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.explive-rect { position: absolute; border: 2px solid var(--primary); background: rgba(232, 148, 58, 0.15); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25); pointer-events: none; }
.explive-rect-level { border-color: var(--accent); background: rgba(34, 197, 94, 0.15); box-shadow: none; }
#explive-select-modal .explive-rect { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); }
.explive-rect-label { position: absolute; transform: translateY(-105%); background: var(--primary-dark); color: #fff; font-size: 12px; line-height: 1; padding: 4px 9px; border-radius: 6px; cursor: move; user-select: none; white-space: nowrap; z-index: 5; }
.explive-rect-label.inside { transform: translateY(4px); }
#explive-overlay { pointer-events: none; }
.explive-cal-tabs { display: flex; gap: 8px; }
.explive-cal-tabs button { padding: 8px 16px; }
.explive-cal-tabs button.active { box-shadow: 0 0 0 3px rgba(232, 148, 58, 0.35); }
.explive-resolution-hint { font-size: 12px; color: var(--danger-dark); background: #FFF7F7; border: 1px solid var(--danger); border-radius: 8px; padding: 6px 10px; margin: 6px 0 0; }
.explive-resolution-hint.ok { color: #2E7D32; background: #F4FBF4; border-color: #A5D6A7; }
#explive-select-modal .modal-header { flex-wrap: wrap; row-gap: 8px; }
.explive-preview-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: #B8A99A; font-size: 13px; }
.explive-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; }
.explive-controls .boss-kill-form { margin-bottom: 0; }
.explive-controls .explive-note-label { flex: 1 1 100%; }
#explive-status:empty, #explive-last-ocr:empty { display: none; }
#explive-last-ocr { font-size: 12px; word-break: break-all; }
.explive-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
@media (max-width: 520px) { .explive-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.explive-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 10px; text-align: center; }
.explive-stat-num { font-size: 17px; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.explive-stat-label { font-size: 12px; color: var(--text-secondary); }
.explive-chart { width: 100%; margin-top: 6px; }

/* 记录器地图图鉴（智能补全） */
.explive-map-info { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding: 12px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 10px; }
.explive-map-thumb { width: 190px; max-width: 42vw; height: 120px; object-fit: contain; background: #241a12; border-radius: 8px; flex-shrink: 0; }
.explive-map-thumb.hidden { display: none; }
.explive-map-detail { flex: 1; min-width: 0; }
.explive-map-title { margin: 0 0 8px; font-weight: 700; color: var(--primary-dark); word-break: break-all; }
.explive-map-monsters { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; }
.explive-map-monster summary { cursor: pointer; font-size: 13px; color: var(--text); padding: 4px 6px; border-radius: 6px; background: #F5EDE0; list-style-position: inside; }
.explive-map-monster summary:hover { background: #EFE3CE; }
.explive-map-drops { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 2px 2px 10px; }
.explive-map-drop { font-size: 12px; padding: 2px 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); }

/* 截图经验计算器（实时记录器关闭后的替代功能） */
.expshot-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.expshot-card-head h2 { margin: 0; }
.expshot-paste-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; background: #FFFDF9; margin-bottom: 4px; transition: border-color 0.15s; }
.expshot-paste-zone:hover { border-color: var(--primary); }
.expshot-paste-zone.dragover { border-color: var(--primary); background: #FDF8F0; }
.expshot-paste-zone p { margin: 4px 0; color: var(--text-secondary); }
.expshot-thumb { max-width: 100%; max-height: 140px; border-radius: 8px; border: 1px solid var(--border); background: #241a12; }
.expshot-thumb.hidden { display: none; }
#expshot-status:empty, #expshot-error:empty, #expshot-warn:empty { display: none; }
#expshot-warn { color: #B26A00; }

/* 截图经验计算器数据共享 + 可视数据 */
.expshot-share { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.expshot-share h3 { margin: 0 0 6px; }
.expshot-share-form { display: flex; flex-direction: column; gap: 8px; }
.expshot-share-public { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; width: fit-content; }
.expshot-share-picker { position: relative; }
#expshot-share-user { width: 100%; }
.expshot-share-user-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14); max-height: 220px; overflow: auto; }
.expshot-share-user-list.hidden { display: none; }
.expshot-share-user-item { padding: 7px 12px; font-size: 13px; cursor: pointer; }
.expshot-share-user-item:hover { background: #F1F6EC; }
.expshot-share-viewers { display: flex; flex-wrap: wrap; gap: 6px; }
.expshot-share-viewers:empty { display: none; }
.expshot-share-viewer { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 9999px; font-size: 12px; background: #FFFDF9; }
.expshot-share-viewer button { padding: 0 6px; border: none; background: none; cursor: pointer; font-size: 14px; line-height: 1.2; color: var(--text-secondary); }
.expshot-share-viewer button:hover { color: #A82D1D; }
#expshot-share-msg:empty { display: none; }
.expshot-visible-mine td { background: #FDF8F0; }

/* 记录器安全性说明（可折叠） */
.exp-note { margin: 10px 0 4px; padding: 10px 14px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.exp-note summary { cursor: pointer; font-weight: 700; color: var(--primary-dark); user-select: none; line-height: 1.5; }
.exp-note-body { margin-top: 8px; color: var(--text-secondary); line-height: 1.7; }
.exp-note-body p { margin: 6px 0; }
.exp-note-body ol, .exp-note-body ul { margin: 6px 0; padding-left: 20px; }
.exp-note-body strong { color: var(--text); }

/* 图鉴管理（顶级管理员） */
.gamedb-rows { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 300px; overflow-y: auto; }
.gamedb-row { text-align: left; padding: 7px 10px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.gamedb-row:hover { background: #F5EDE0; }
.gamedb-row-flex { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.gamedb-row-flex span { min-width: 0; word-break: break-all; }
.gamedb-mini { padding: 4px 12px; font-size: 12px; flex-shrink: 0; }
.gamedb-sub { margin: 14px 0 8px; font-size: 15px; }
.gamedb-add-label { margin: 10px 0 6px; }
#gamedb-add-rel-q { width: 100%; }

/* ---- 掉落查询（登录可用）：怪物 → 掉落物 / 物品 → 掉落来源 ---- */
.drops-result { display: flex; align-items: center; gap: 8px; }
.drops-result.active { border-color: var(--accent); background: #F1FBF4; }
.drops-result-text { flex: 1 1 auto; text-align: left; min-width: 0; }
.drops-uid { flex: none; font-size: 11px; color: var(--muted); font-family: Consolas, monospace; }
/* 图标是 maplestory.io 的外链：像素图要 pixelated 放大；加载失败时 img 会被 JS 整个摘掉 */
.drops-icon { width: 28px; height: 28px; object-fit: contain; flex: none; image-rendering: pixelated; }
.drops-icon-empty { display: inline-block; line-height: 26px; text-align: center; color: var(--muted); background: #FDF8F0; border: 1px dashed var(--border); border-radius: 6px; }
.drops-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.drops-head-icon { width: 52px; height: 52px; }
.drops-head-name { font-size: 15px; font-weight: 600; }
.drops-head-meta { font-size: 12px; color: var(--muted); }
.drops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 6px; margin: 8px 0; max-height: 400px; overflow-y: auto; }
.drops-cell { display: flex; align-items: center; gap: 7px; text-align: left; padding: 6px 8px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.drops-cell:hover { background: #F5EDE0; border-color: var(--accent); }
.drops-cell-text { display: flex; flex-direction: column; min-width: 0; }
.drops-cell-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drops-cell-sub { font-size: 11px; color: var(--muted); }
.drops-maps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.drops-map { font-size: 12px; padding: 3px 9px; background: #FDF8F0; border: 1px solid var(--border); border-radius: 999px; }

/* ---- 图鉴管理：卡片等高 + 全字段编辑表 ---- */
/* .card-grid 默认 align-items: start，每张卡只按自己的内容高，同一行里参差不齐。
   图鉴管理这四张卡内容长度差很多（掉落关联/地图关联/怪物管理/物品管理），
   改成 stretch 后同一行的卡片就一样高了。只作用于图鉴管理页签，不动其它页面。 */
#tab-gamedb .card-grid { align-items: stretch; }
/* 全字段编辑要放 60+ 个输入框，占满整行 */
#tab-gamedb .gamedb-edit-card { grid-column: 1 / -1; }
.edit-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px 14px; margin: 10px 0; max-height: 540px; overflow-y: auto; padding-right: 4px; }
.edit-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.edit-field-name { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--text); word-break: break-all; }
.edit-field-type { flex: none; font-size: 10px; color: var(--muted); font-family: Consolas, monospace; }
.edit-field-wide { grid-column: 1 / -1; }
.edit-field-wide textarea { min-height: 64px; }
.edit-input { width: 100%; box-sizing: border-box; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); font-family: inherit; }
.edit-input:disabled { background: #F5F0E8; color: var(--muted); cursor: not-allowed; }
/* 改动过的字段高亮，保存前一眼能看出改了哪几个 */
.edit-input.edit-dirty { border-color: var(--accent); background: #F1FBF4; }
.edit-readonly .edit-field-name { color: var(--muted); }
.edit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.edit-dirty-count { font-size: 12px; color: var(--muted); }
.edit-dirty-count.dirty { color: var(--accent); font-weight: 600; }
.edit-logs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.edit-logs .muted { font-size: 12px; }

/* 练级会话记录（记录器右侧）+ 排行榜（全宽） */
.tab .explive-sessions-card { max-width: none; margin-bottom: 24px; }
.explive-sessions-card h3, .explive-rank-card h3 { margin: 0 0 8px; }
.explive-sessions-card .table-wrap { max-height: 420px; overflow-y: auto; }
.tab .explive-rank-card { max-width: none; margin-bottom: 24px; }
.explive-rank-card .table-wrap { max-height: 420px; overflow-y: auto; }

/* 可视数据 + 升级地图参考（全宽，与下方卡片留 24px 下边距） */
.tab .card.expshot-visible-card { max-width: none; margin: 0 0 24px; }
.tab .card.expshot-mapref-card { max-width: none; margin: 0 0 24px; }

/* 经验区选区大窗口弹窗 */
.explive-modal-panel { width: auto; max-width: 97vw; max-height: 96vh; overflow-y: auto; }
.explive-modal-video-wrap { position: relative; width: 900px; max-width: 92vw; height: 506px; flex-shrink: 0; background: #241a12; border-radius: 10px; overflow: hidden; margin: 0 auto; }
.explive-cal-preview { width: 320px; max-width: 100%; min-height: 36px; display: block; margin: 6px auto 0; background: #241a12; border: 1px solid var(--border); border-radius: 8px; }
.explive-cal-preview-pair { display: flex; gap: 14px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-top: 4px; }
.explive-cal-preview-pair figure { margin: 0; }
.explive-cal-preview-pair figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.explive-cal-preview-pair .explive-cal-preview { margin: 6px auto 0; }

/* 工具箱：命中卡与实时记录卡全宽 */
.acc-form label { min-width: 150px; }
#tab-accuracy .acc-card { max-width: none; margin-bottom: 24px; }
#tab-accuracy #exp-live-card { max-width: none; width: 100%; margin-bottom: 24px; }
#tab-accuracy #exp-shot-card { max-width: none; width: 100%; margin-bottom: 24px; }

#tab-accuracy .boss-big-card { max-width: none; margin: 0; }
.boss-big-card h3 { margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.boss-big-card h3:first-of-type { margin-top: 18px; }

/* ---- 百佬汇（100 级以上角色展示） ---- */
.baiyh-card { margin-bottom: 24px; }
.baiyh-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.baiyh-char { background: #FFFDF9; border: 2px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.baiyh-img { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #FFFDF7, #F3EADA); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.baiyh-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.baiyh-name { font-size: 16px; font-weight: 700; }
.baiyh-exprow { display: flex; align-items: center; gap: 8px; width: 100%; }
.baiyh-lv { font-weight: 700; white-space: nowrap; color: var(--primary-dark); }
.baiyh-bar { flex: 1; height: 14px; border-radius: 999px; background: #4A4A4A; overflow: hidden; border: 1px solid #333; }
.baiyh-bar-fill { height: 100%; background: #EEFF00; border-radius: 999px; transition: width 0.6s ease; }
.baiyh-pct { font-size: 12px; white-space: nowrap; color: var(--text-secondary); min-width: 40px; text-align: right; }
.baiyh-meta { font-size: 12px; line-height: 1.5; }
.baiyh-admin-edit { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.baiyh-admin-edit input { width: 78px; padding: 6px 8px; font-size: 13px; }
#baiyh-admin h3 { margin: 16px 0 10px; }
#tab-home .dkp-top .dkp-me-card { margin: 0; }

/* ============ 交易大厅（CDK + 非CDK 上下满宽双卡片） ============ */
.trade-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.tab .trade-card { max-width: none; margin: 0; }
.tab .trade-card .ex-publish-card { margin-bottom: 20px; }

/* ============ DKP系统 ============ */
.dkp-top {
  display: grid;
  grid-template-columns: minmax(0, 340px) repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}
.tab .dkp-top .card { max-width: none; margin: 0; }
@media (max-width: 1100px) {
  .dkp-top { grid-template-columns: minmax(0, 1fr); }
}

.dkp-balance-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dkp-balance { font-size: 36px; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.dkp-draws-badge { font-size: 12px; padding: 3px 10px; border-radius: 9999px; background: var(--card-hover); border: 1px solid var(--border); color: var(--text-secondary); }
.dkp-exchange-draw { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 4px; }
.dkp-exchange-draw p { margin: 0 0 10px; }
.dkp-exchange-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dkp-exchange-row label { display: flex; flex-direction: column; gap: 6px; width: 140px; margin-bottom: 0; }
.dkp-exchange-row button { white-space: nowrap; }

.dkp-announce-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.dkp-announce-item:last-child { border-bottom: none; }
.dkp-announce-item p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }

.dkp-clown-item { padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--danger); border-radius: 8px; background: #FFF7F7; margin-bottom: 10px; }
.dkp-clown-item:last-child { margin-bottom: 0; }
.dkp-clown-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.dkp-clown-head strong { color: var(--danger-dark); }
.dkp-clown-item p { margin: 0; font-size: 13px; color: var(--text-secondary); word-break: break-word; }

.tab .dkp-prize-card { max-width: none; margin-bottom: 24px; }
.dkp-prize-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 14px 0 6px; }
.dkp-prize-form label { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.dkp-prize-form .dkp-prize-desc { min-width: 220px; flex: 1; }
.dkp-prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.dkp-prize-item { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.dkp-prize-item .item-icon { width: 32px; height: 32px; }
.dkp-prize-name { font-weight: 600; color: var(--text); }
.dkp-prize-cost { font-weight: 700; color: var(--primary-dark); }
.dkp-prize-item .claim-btn { margin-top: 4px; }
.dkp-prize-item .claim-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dkp-prize-removed { opacity: 0.6; }
.dkp-badge-removed { position: absolute; top: 10px; right: 10px; font-size: 12px; color: var(--danger); border: 1px solid var(--danger); border-radius: 9999px; padding: 1px 8px; }
.dkp-prize-item .claim-btn.reject { margin-top: 0; }

.tab .dkp-admin-card { max-width: none; margin-bottom: 24px; }
.dkp-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.dkp-admin-block { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.dkp-admin-block h3 { margin: 0 0 10px; font-size: 15px; }
.dkp-admin-block label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.dkp-admin-block textarea { margin-bottom: 10px; }
.dkp-admin-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.dkp-admin-item-row:last-child { border-bottom: none; }
.dkp-admin-item-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dkp-admin-item-row .claim-btn { padding: 3px 10px; font-size: 12px; flex-shrink: 0; }

.dkp-points-plus { color: var(--ok); font-weight: 600; }
.dkp-points-minus { color: var(--danger); font-weight: 600; }
.explive-note-preview { margin: 4px 0 0; font-size: 12px; color: var(--primary-dark); word-break: break-all; }
.explive-note-preview:empty { display: none; }

/* ============ 勋章系统：角色名下方炫彩勋章名 ============ */
.medal-user { display: inline-flex; flex-direction: column; align-items: flex-start; vertical-align: baseline; }
.medal-line { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; margin-top: 1px; }
.medal-item { display: inline-flex; align-items: center; gap: 3px; }
.medal-icon { width: 14px; height: 14px; object-fit: contain; flex: none; }
.medal-name-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  background: linear-gradient(90deg, #FF5E5E, #FF9D3C, #FFE93C, #5EFF7B, #3CD6FF, #7A5EFF, #FF5EC4, #FF5E5E);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: medalRainbow 4s linear infinite;
}
@keyframes medalRainbow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
/* 导航栏用户按钮内勋章行更紧凑 */
.nav-user-btn .medal-name-text { font-size: 10px; }
.nav-user-btn .medal-icon { width: 11px; height: 11px; }
.nav-user-btn .medal-line { gap: 2px 6px; }
@media (prefers-reduced-motion: reduce) {
  .medal-name-text,
  .lucky-badge.legendary,
  .lucky-pool-card.tier-legendary::before,
  .lucky-pool-modal-card.tier-legendary::before,
  .lucky-result.result-legendary .lucky-win-title { animation: none; }
}

/* 用户权限管理表格：列多（职业/等级/家族/权限/勋章/密码/删除），窄窗口下靠横向滚动
   留在卡片内，不能让最后一列被挤出卡片外 */
.role-table-scroll { overflow-x: auto; }
.role-table { width: 100%; }
/* 比全局 th,td 的内边距更紧凑，尽量在常规桌面宽度下不用滚动就能看全 */
.role-table th, .role-table td { padding: 10px 8px; white-space: nowrap; }

/* 角色信息弹窗（未填写时强制弹出，关不掉；也可从顶栏主动打开修改） */
.profile-modal-panel { max-width: 460px; width: 92vw; padding: 22px; }
.profile-modal-panel .modal-header { padding: 0 0 12px; }
/* 醒目提示：红框红底，语气加强 */
.profile-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--danger-dark);
  background: #FFF7F7;
  border: 2px solid var(--danger);
  border-radius: 10px;
}
.profile-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
#profile-save { width: 100%; }

/* 授勋弹窗（权限管理卡，勋章名可自定义） */
.medal-modal-panel { max-width: 520px; width: 92vw; }
.medal-modal-section { margin: 10px 0; }
.medal-modal-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.medal-modal-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; align-items: center; }
.medal-chip {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background: #FFFDF9;
  color: var(--text-secondary);
  text-shadow: none;
  cursor: pointer;
  transition: all 0.15s;
}
.medal-chip:hover { border-color: var(--primary); color: var(--primary-dark); box-shadow: none; }
.medal-chip.active {
  border-color: var(--primary-dark);
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  color: #fff;
}
.medal-custom-row { display: flex; gap: 8px; }
.medal-custom-row input { flex: 1; min-width: 0; }
.medal-custom-row button { flex: none; }
@media (max-width: 480px) { .medal-custom-row { flex-direction: column; } }
.medal-tags { color: #8A6D1A; font-size: 12px; line-height: 1.5; margin-bottom: 4px; word-break: break-all; }

/* ============ 攻略分享 ============ */
#tab-guides h2 { margin-top: 24px; }
#tab-guides .card { max-width: none; margin: 0; }
#tab-guides .guide-card { margin: 0 0 18px; }
#tab-guides .guide-pending-card { margin: 0 0 16px; }
.guide-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.guide-publish-card { flex: 1 1 480px; }
.guide-admin-card { flex: 0 1 340px; }
.guide-publish-card textarea { resize: vertical; }
.guide-admin-block h3 { margin: 14px 0 6px; font-size: 14px; }
.guide-admin-block h3:first-child { margin-top: 0; }

.guide-card { max-width: none; margin-bottom: 14px; }
.guide-card.guide-featured {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.18), 0 1px 4px rgba(212, 175, 55, 0.12);
}
.guide-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; cursor: pointer; user-select: none; }
.guide-card-title { margin: 0; font-size: 17px; line-height: 1.4; word-break: break-all; }
/* 折叠/展开：默认只显示标题，点击标题展开正文；同时只展开一张 */
.guide-card-extra { display: none; }
.guide-card.guide-expanded .guide-card-extra { display: block; }
.guide-fold-arrow { flex: none; margin-left: auto; font-size: 13px; color: var(--text-secondary); transition: transform 0.15s ease; }
.guide-card.guide-expanded .guide-fold-arrow { transform: rotate(90deg); }
.guide-featured-badge {
  flex: none;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9999px;
  color: #7A5A00;
  background: linear-gradient(180deg, #FFE9A8 0%, #FFD45E 100%);
  border: 1px solid var(--gold);
  white-space: nowrap;
}
.guide-card-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 10px;
}
.guide-card-meta { font-size: 12px; margin-bottom: 6px; }
.guide-card-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; font-size: 12px; color: var(--text-secondary); }
.guide-stat { color: var(--primary-dark); }
.guide-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* #标签 图标徽标：物品/怪物/NPC/地图 */
.mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  margin: 1px 2px;
  padding: 1px 8px 1px 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background: #FFFDF9;
  color: var(--primary-dark);
  white-space: nowrap;
}
.mention-chip img { width: 22px; height: 22px; object-fit: contain; flex: none; image-rendering: pixelated; }
.mention-chip.mention-item { border-color: #BBD8F5; background: #F3F9FF; color: #1D5FA8; }
.mention-chip.mention-monster { border-color: #F5C1BB; background: #FFF4F2; color: #A82D1D; }
.mention-chip.mention-npc { border-color: #C8ECC6; background: #F4FCF3; color: #1D7A28; }
.mention-chip.mention-map { border-color: #E3C8F0; background: #FAF3FF; color: #6B2DA8; }

/* 评论 / 打赏面板 */
.guide-comments-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.guide-tip-records { font-size: 12px; line-height: 1.8; margin-bottom: 8px; }
.guide-comment { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.guide-comment:last-child { border-bottom: none; }
.guide-comment-head { font-size: 12px; margin-bottom: 2px; }
.guide-comment p { margin: 0; font-size: 13px; line-height: 1.7; word-break: break-all; }
.guide-comment-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.guide-comment-form textarea { flex: 1; min-width: 0; resize: vertical; }
.guide-comment-form button { flex: none; }
.guide-comment-form-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.guide-comment-pending { display: inline-flex; align-items: flex-start; gap: 6px; }
.guide-comment-pending img { max-width: 180px; max-height: 120px; border-radius: 6px; border: 1px solid var(--border); display: block; }
.guide-comment-pending-remove { padding: 0 8px; line-height: 1.4; }
.guide-comment-img { display: block; max-width: 240px; max-height: 200px; margin-top: 6px; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; }
.guide-comment-img-placeholder { display: inline-block; margin-top: 6px; padding: 4px 10px; border: 1px dashed var(--border); border-radius: 6px; font-size: 13px; }
.guide-comment-reward-btn { margin-left: 6px; font-size: 11px; padding: 1px 6px; cursor: pointer; }
.guide-reward-row { margin-bottom: 8px; }

.guide-more { text-align: center; margin-top: 4px; }
.guide-more button { min-width: 160px; }

/* 发布框 # 联想列表 */
.guide-mention-list {
  display: none;
  position: relative;
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFDF9;
  box-shadow: 0 4px 14px rgba(61, 36, 21, 0.12);
}
.guide-mention-group {
  padding: 5px 12px 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  position: sticky;
  top: 0;
}
.guide-mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.guide-mention-item:hover { background: var(--card-hover); }
.guide-mention-item img { width: 24px; height: 24px; object-fit: contain; flex: none; image-rendering: pixelated; }

/* ============ 交流中心：板块切换 / 富文本编辑器 / 附件（style v52）============ */
.community-board-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.community-board-btn {
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 9999px;
  border: 2px solid var(--border);
  background: #FFFDF9;
  color: var(--text-secondary);
}
.community-board-btn.active {
  border-color: var(--primary-dark);
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
  color: #3A2200;
}

/* 编辑器工具栏（覆盖全局 button 的 12px padding，用小号图标按钮） */
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 6px 0;
  padding: 6px;
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: var(--bg);
}
.rich-toolbar button,
.rich-attach-bar button {
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1.5;
  min-width: 0;
  border-width: 1.5px;
  border-radius: 6px;
}
.rich-toolbar select,
.rich-toolbar input[type="color"] {
  height: 30px;
  padding: 0 4px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #FFFDF9;
  color: var(--text);
}
.rich-toolbar input[type="color"] { width: 36px; padding: 2px; cursor: pointer; }

/* contenteditable 编辑区 */
.rich-editor {
  min-height: 180px;
  max-height: 460px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 0 0 10px 10px;
  background: #FFFFFF;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  outline: none;
  word-break: break-all;
}
.rich-editor:focus { border-color: var(--primary); box-shadow: 0 0 8px rgba(232, 148, 58, 0.35); }
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.rich-editor table { border-collapse: collapse; margin: 6px 0; min-width: 60%; }
.rich-editor td, .rich-editor th {
  border: 1px solid #C9BBA8;
  padding: 4px 8px;
  min-width: 32px;
}
.rich-editor th { background: var(--bg); }
.rich-editor img { max-width: 100%; border-radius: 6px; }
.rich-editor blockquote {
  margin: 6px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--primary-light);
  background: var(--bg);
  color: var(--text-secondary);
}
.rich-editor pre {
  margin: 6px 0;
  padding: 8px 10px;
  background: #F4EFE7;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
}
.rich-editor ul, .rich-editor ol { margin: 6px 0; padding-left: 26px; }

/* 附件待发区（发布框内） */
.rich-attach-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 2px;
}
.rich-attach-bar .muted { font-size: 12px; }
.rich-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0;
}
.rich-attach-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFDF9;
  font-size: 13px;
}
.rich-attach-chip.rich-attach-removed { opacity: 0.55; }
.rich-attach-chip.rich-attach-removed .rich-attach-name { text-decoration: line-through; }
.rich-attach-name { font-weight: 600; word-break: break-all; min-width: 0; }
.rich-attach-size { color: var(--muted); font-size: 12px; flex: none; }
.rich-attach-hint { color: var(--primary-dark); font-size: 12px; flex: none; }
.rich-attach-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  flex: none;
}
.rich-attach-cost input {
  width: 74px;
  padding: 3px 6px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
}
.rich-attach-remove, .rich-attach-restore {
  padding: 2px 10px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 6px;
  margin-left: auto;
}
.rich-attach-restore { background: linear-gradient(180deg, #B7E4B0 0%, #6FBF66 100%); border-color: #4E9B45; }

/* 帖子内附件下载区 */
.guide-attach-list {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #FFFCF7;
}
.guide-attach-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.guide-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.guide-attach-dl { padding: 3px 12px; font-size: 12px; line-height: 1.6; border-radius: 6px; margin-left: auto; }

/* 富文本帖渲染（覆盖纯文本帖的 pre-wrap；元素样式与编辑器内一致） */
.guide-rich { white-space: normal; }
.guide-rich table { border-collapse: collapse; margin: 6px 0; max-width: 100%; display: block; overflow-x: auto; }
.guide-rich td, .guide-rich th { border: 1px solid #C9BBA8; padding: 4px 8px; }
.guide-rich th { background: var(--bg); }
.guide-rich img { max-width: 100%; height: auto; border-radius: 6px; cursor: zoom-in; }
.guide-rich .bili-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin: 8px 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.guide-rich .bili-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.guide-rich blockquote {
  margin: 6px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--primary-light);
  background: var(--bg);
  color: var(--text-secondary);
}
.guide-rich pre {
  margin: 6px 0;
  padding: 8px 10px;
  background: #F4EFE7;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
}
.guide-rich ul, .guide-rich ol { margin: 6px 0; padding-left: 26px; }
.guide-rich a { color: var(--primary-dark); }

/* ============ v53：#标签悬停提示框（复用 #itemTooltip 深色框；NPC/地图大图、怪物掉落） ============ */
.mention-hover-loading { padding: 6px 2px; color: #ccc; text-align: center; }
.mention-hover-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #555;
  margin-bottom: 6px;
}
.mention-hover-head img { width: 40px; height: 40px; object-fit: contain; flex: none; image-rendering: pixelated; }
.mention-hover-head.mention-map-img { display: block; }
.mention-hover-head.mention-map-img img { width: 100%; max-width: 248px; height: auto; margin-bottom: 4px; }
.mention-hover-name { font-weight: 700; font-size: 13px; color: #ffcc00; word-break: break-all; }
.mention-hover-tag { font-size: 11px; color: #bbb; }
.mention-hover-line { color: #eee; margin: 3px 0; word-break: break-all; }
.mention-hover-sec { margin: 6px 0 3px; font-weight: 700; color: #d9d9d9; font-size: 12px; }
.mention-hover-maps { display: flex; flex-wrap: wrap; gap: 4px; }
.mention-hover-maps span {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-drop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
}
.mention-hover-empty { color: #999; font-size: 11px; }
.mention-drop-item { display: flex; align-items: center; gap: 4px; min-width: 0; color: #fff; }
.mention-drop-item img { width: 20px; height: 20px; object-fit: contain; flex: none; image-rendering: pixelated; }
.mention-drop-item span {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ v53：刷怪位移交板块 ============ */
.spot-type-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 4px 0 10px; }
.spot-type-option { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.spot-type-option input { accent-color: var(--primary); width: auto; }
.spot-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-bottom: 10px;
}
@media (max-width: 640px) { .spot-form-grid { grid-template-columns: 1fr; } }
.spot-form-grid label { position: relative; }
#spot-map-results, #battle-map-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 240px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(61, 36, 21, 0.15);
}
.spot-map-item { padding: 7px 12px; font-size: 13px; cursor: pointer; }
.spot-map-item:hover { background: var(--card-hover); }
.spot-map-none { color: var(--muted); cursor: default; }
.spot-map-none:hover { background: none; }
.spot-map-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--primary-dark); }
.spot-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(253, 246, 239, 0.92) 100%);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(61, 36, 21, 0.05);
}
.spot-card.spot-provide { border-left-color: #E8943A; }
.spot-card.spot-seek { border-left-color: #5B9BD5; }
.spot-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.spot-badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  color: #FFFFFF;
}
.spot-badge-provide { background: #E8943A; }
.spot-badge-seek { background: #5B9BD5; }
.spot-card-map { font-size: 16px; font-weight: 700; color: var(--text); word-break: break-all; }
.spot-card-time { margin-left: auto; font-size: 12px; color: var(--muted); flex: none; }
.spot-card-info { font-size: 14px; color: var(--text); line-height: 1.7; }
.spot-card-remark {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(232, 148, 58, 0.08);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}
.spot-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.spot-card-meta { font-size: 13px; color: var(--text-secondary); }
.spot-del-btn { margin-left: auto; padding: 3px 12px; font-size: 12px; line-height: 1.6; border-radius: 6px; }

/* ============ v53：网站综合办公告列表 ============ */
.office-post-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(253, 246, 239, 0.92) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(61, 36, 21, 0.05);
}
.office-post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.office-post-meta { font-size: 13px; color: var(--text-secondary); }
.office-post-body { font-size: 14px; line-height: 1.8; word-break: break-all; }
.office-post-body.guide-rich { white-space: normal; }
.office-del-btn { margin-left: auto; padding: 3px 12px; font-size: 12px; line-height: 1.6; border-radius: 6px; }

/* ============ v55：首页 + 成员福利 + 工具箱内嵌TAB ============ */
.subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.subtabs button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s;
}
.subtabs button:hover { border-color: var(--primary); color: var(--primary-dark); }
.subtabs button.active {
  /* 原来是「白字 + 主色渐变」，对比度只有 2.41:1（AA 要求 4.5），
     实机上就是「一片糊」。改成浅底 + 深棕字（5.5:1），是站点 notice-bar 已在用的同一套色。 */
  background: linear-gradient(135deg, #FFF1DD, #FBE3C4);
  color: #8A5A16;
  border-color: #E9C79A;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(61, 36, 21, 0.12);
}
.toolbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.toolbox-bar .subtabs { margin: 0; }
.toolbox-bar #boss-notify-toggle { margin-left: auto; white-space: nowrap; }
.tab .dkp-me-card { max-width: none; margin: 0 0 20px; }
.tab .baiyh-card { max-width: none; margin: 0 0 24px; }
@media (max-width: 720px) {
  .subtabs button { padding: 7px 16px; font-size: 13px; }
}

/* ============ 女神400速解（工具箱第 4 个 TAB） ============
   四组平台状态 + 大号答案。按钮用 .goddess-opts button 自带的选中态（.active），
   不借用 .subtabs 的胶囊样式 —— 那套是给页签用的，选中态颜色更重，会跟答案区的绿色打架。

   卡片受 .tab .card { max-width: 460px } 约束是窄的（那条选择器更具体，比 .goddess-card 高一级，
   所以下面这条要写足三级才压得住）。窄卡片放不下 5 列查表，所以查表做成「向右弹出」：
   宽屏点开时贴在卡片右侧，窄屏（<=1100px）退回卡片内的内联块并允许横向滚动。 */
.tab .card.goddess-card { position: relative; max-width: 460px; }
.goddess-output {
  margin: 16px 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}
.goddess-input {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.goddess-answer {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 10px;
  text-indent: 10px; /* 抵消 letter-spacing 在末尾多出来的那一格，视觉上才是居中的 */
}
.goddess-answer.ok { color: var(--ok); }
.goddess-answer.error { color: var(--danger); letter-spacing: 0; text-indent: 0; font-size: 16px; font-weight: 400; }
.goddess-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.goddess-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.goddess-group-label { font-weight: 700; white-space: nowrap; }
.goddess-opts { display: flex; gap: 8px; }
.goddess-opts button { padding: 6px 16px; min-width: 46px; font-size: 15px; }
.goddess-opts button.active {
  /* 原来是白字压主色，对比度 2.41:1（AA 要 4.5）—— 实机上「看不清」，
     与站点主按钮同一套做法：浅橙底 + 深棕字（5.5:1）。 */
  background: linear-gradient(135deg, #FFF1DD, #FBE3C4);
  color: #8A5A16;
  border-color: #E9C79A;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(61, 36, 21, 0.12);
}
.goddess-btn-row { margin: 16px 0 4px; }
.goddess-table-details { margin: 14px 0; }
.goddess-table-details summary { cursor: pointer; font-weight: 700; }
/* 去掉原生三角，自己画一个：展开时上下翻转，一眼能看出点得动 */
.goddess-table-details summary { list-style: none; }
.goddess-table-details summary::-webkit-details-marker { display: none; }
.goddess-table-details summary::after {
  content: '\25BC';
  margin-left: 8px;
  font-size: 11px;
  color: var(--primary-dark);
  display: inline-block;
  transition: transform 0.15s;
}
.goddess-table-details[open] summary::after { transform: rotate(180deg); }
.goddess-table-details > p.muted { margin: 8px 0; }
.goddess-table th, .goddess-table td { text-align: center; }
.goddess-table td.goddess-table-answer { font-weight: 700; color: var(--ok); }

/* 向右弹出的查表面板：绝对定位，所以不占卡片高度、不推挤下面的按钮，
   而是贴在「查表法」这一行的右侧。position 的参照物是 .goddess-card。 */
@media (min-width: 1101px) {
  .goddess-table-details[open] > .goddess-table-panel {
    position: absolute;
    left: calc(100% + 20px);
    top: 0;
    z-index: 5;
    width: 420px;
    max-width: calc(100vw - 520px);
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(253,246,239,0.96) 100%);
    box-shadow: 0 12px 32px rgba(61, 36, 21, 0.16);
  }
  /* 指向「查表法」那行的小箭头 */
  .goddess-table-details[open] > .goddess-table-panel::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 16px;
    width: 12px;
    height: 12px;
    background: #fffdfa;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
  }
  .goddess-table-details[open] > .goddess-table-panel .table-wrap { overflow: visible; }
  .goddess-table-details[open] > .goddess-table-panel .goddess-table { width: 100%; }
}

@media (max-width: 1100px) {
  /* 窄屏放不下侧栏：退回卡片内联块，横向不够就让表格自己滚 */
  .goddess-table-panel { margin-top: 10px; }
  .goddess-table-panel .table-wrap { overflow-x: auto; }
  .goddess-table-panel .goddess-table { min-width: 380px; }
}

@media (max-width: 720px) {
  .goddess-answer { font-size: 30px; letter-spacing: 8px; text-indent: 8px; }
  .goddess-group { min-width: 0; flex: 1 1 100%; justify-content: space-between; }
}

/* ============ 三转专题 ============
   左侧目录吸顶 + 右侧正文；正文是服务端数据里的 HTML，所以样式只能靠类名（.tj-*）。
   刻意没有「已读 / 完成」与进度条 —— 产品要求去掉。 */
.tab .card.tj-hero, .tab .card.tj-nav { max-width: none; }
.tj-hero h2 { font-size: 24px; margin: 6px 0 8px; }
.tj-toolbar { display: flex; gap: 10px; margin-top: 16px; }
.tj-toolbar input {
  flex: 1; min-width: 0; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
.tj-toolbar button { flex-shrink: 0; }
.tj-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .tj-layout { grid-template-columns: 1fr; } }
.tj-nav { position: sticky; top: 16px; }
@media (max-width: 1000px) { .tj-nav { position: static; } }
.tj-nav-title { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.tj-nav-links { display: flex; flex-direction: column; gap: 4px; }
.tj-nav-links a {
  display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 13.5px;
}
.tj-nav-links a span { font-size: 11px; color: var(--muted); }
.tj-nav-links a:hover { background: rgba(232, 148, 58, 0.12); }
.tj-nav-links a.active { background: rgba(232, 148, 58, 0.16); font-weight: 600; }

.tj-body { display: flex; flex-direction: column; gap: 18px; }
.tj-step { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.tj-chapter { font-size: 11px; letter-spacing: 1px; color: #8A5A16; text-transform: uppercase; }
.tj-step-head { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; }
.tj-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: rgba(232, 148, 58, 0.16); color: var(--primary-dark); font-size: 12px; font-weight: 700;
}
.tj-step-head h3 { margin: 0; font-size: 18px; }

/* 正文里的元素（来自内容数据） */
.tj-content { line-height: 1.9; font-size: 14.5px; }
.tj-content p { margin: 10px 0; }
.tj-content b, .tj-content strong { color: var(--text); }
.tj-content img { max-width: 100%; height: auto; vertical-align: middle; }
.tj-content figure { margin: 14px 0; }
.tj-content figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tj-content ul, .tj-content ol { padding-left: 22px; margin: 10px 0; }
.tj-content li { margin: 4px 0; }
.tj-content h4 { font-size: 15px; margin: 16px 0 8px; }
/* 实体卡片（NPC / 怪物 / 地图 / 物品）：图标 + 名称 + 说明 */
.tj-content .guide-entity {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; margin: 6px 0;
  background: rgba(255, 255, 255, 0.7); text-decoration: none; color: var(--text);
}
.tj-content .guide-entity-art { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tj-content .guide-entity-art img { max-width: 40px; max-height: 40px; }
.tj-content .guide-entity-text { display: flex; flex-direction: column; min-width: 0; }
.tj-content .guide-entity-text strong { font-size: 14px; }
.tj-content .guide-entity-text small { font-size: 11.5px; color: var(--muted); }
.tj-content .guide-entity-badge {
  font-size: 10px; color: var(--primary-dark); background: rgba(232, 148, 58, 0.16);
  border-radius: 4px; padding: 1px 6px; align-self: flex-start; margin-bottom: 2px;
}
.tj-content .guide-entity-arrow { margin-left: auto; color: var(--muted); font-size: 12px; }
.tj-content .guide-entities { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tj-content .guide-entity--npc { border-left: 3px solid #6c8ebf; }
.tj-content .guide-entity--monster { border-left: 3px solid #b35b48; }
.tj-content .guide-entity--map { border-left: 3px solid #2d8069; }
.tj-content .guide-entity--item { border-left: 3px solid var(--primary); }
.tj-content .guide-entity--material { border-left-style: dashed; }
/* 职业/NPC 选择块 */
.tj-content .guide-jobs, .tj-content .guide-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 10px 0; }
.tj-content .guide-jobs a, .tj-content .guide-map-grid a { text-decoration: none; }
/* 提示条 */
.tj-content .guide-note, .tj-content .guide-warning {
  border-left: 3px solid var(--primary); background: rgba(232, 148, 58, 0.08);
  padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 13.5px;
}
.tj-content .guide-warning { border-left-color: var(--danger); background: rgba(220, 38, 38, 0.06); }
/* 排查清单 */
.tj-content .guide-checklist { list-style: none; padding: 0; }
.tj-content .guide-checklist li { border-bottom: 1px solid var(--border); padding: 10px 0; }
.tj-content .guide-checklist b { color: var(--primary-dark); }

/* 答题速查：题组 */
.tj-quiz-group { margin: 18px 0 0; }
.tj-quiz-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tj-quiz-head h4 { margin: 0; font-size: 15px; }
.tj-quiz-head span { font-size: 12px; color: var(--muted); }
.tj-quiz-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); width: 100%; }
.tj-quiz-rows { list-style: none; padding: 0; margin: 8px 0 0; }
.tj-quiz-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px;
  align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.tj-quiz-num { font-size: 12px; color: var(--muted); padding-top: 2px; }
.tj-quiz-q { font-size: 14.5px; }
.tj-quiz-a { text-align: right; }
.tj-quiz-a small { display: block; font-size: 11px; color: var(--muted); }
.tj-quiz-a strong { font-size: 14.5px; color: var(--ok); }
.tj-quiz-note {
  grid-column: 2 / -1; font-size: 12px;
  /* 原来是 #a15c2a 压在浅橙底上，只有 2.14:1（AA 要 4.5）—— 太浅了，看不清 */
  color: #8A5A16;
  background: #FFF6E5;
  border: 1px solid #F0D5B4;
  border-radius: 6px; padding: 6px 10px; margin-top: 6px;
}
@media (max-width: 720px) {
  .tj-quiz-row { grid-template-columns: 22px minmax(0, 1fr); }
  .tj-quiz-a { grid-column: 2; text-align: left; margin-top: 4px; }
  .tj-quiz-a small { display: inline; margin-right: 6px; }
}
#tj-loading { padding: 20px 0; }

/* 三转专题：步骤末尾的「相关素材」缩略图（卡片被去掉后，图集中到这里） */
.tj-assets { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.tj-assets-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tj-asset { display: inline-flex; margin: 0 8px 8px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.tj-asset img { display: block; max-width: 72px; max-height: 72px; width: auto; height: auto; }
/* ============ v56：快速记录BOSS刷新 浮动卡片（右侧居中，可拖动） ============ */
.boss-quick-card {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  width: min(300px, calc(100vw - 24px));
  max-width: none;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(61, 36, 21, 0.25);
}
.boss-quick-card .boss-quick-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.boss-quick-card .boss-quick-head h2 { margin: 0; font-size: 16px; pointer-events: none; }
.boss-quick-card .boss-quick-head .boss-quick-grip {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 1;
  pointer-events: none;
}
.boss-quick-card .boss-quick-head:active { cursor: grabbing; }
.boss-quick-card > p.muted { font-size: 12.5px; line-height: 1.7; margin: 0 0 10px; }
.boss-quick-card .boss-kill-form { gap: 10px; }
.boss-quick-card .boss-kill-form label { min-width: 0; flex: 1 1 100%; }
.boss-quick-card .boss-kill-form button { width: 100%; }
.boss-quick-card .boss-kill-form select,
.boss-quick-card .boss-kill-form input { width: 100%; }

/* ============ 样式化弹窗（toast + confirm/prompt 模态框） ============ */
.mx-toast-box {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  max-width: min(88vw, 420px);
}
.mx-toast {
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  padding: 10px 16px 10px 20px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
  word-break: break-all;
  box-shadow: 0 8px 28px rgba(61, 36, 21, 0.16);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.mx-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gold);
}
.mx-toast.is-in { opacity: 1; transform: translateY(0); }
.mx-toast.is-out { opacity: 0; transform: translateY(-10px); }
.mx-toast-success { background: #F4FBF6; border-color: #CDEBD6; }
.mx-toast-success::before { background: var(--ok); }
.mx-toast-error { background: #FFF7F6; border-color: #F3C9C9; }
.mx-toast-error::before { background: var(--danger); }
.mx-toast-copy {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 12px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.mx-toast-copy:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.mx-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 12001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(61, 36, 21, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.mx-modal-layer.is-open { opacity: 1; pointer-events: auto; }
.mx-modal {
  width: min(92vw, 400px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(61, 36, 21, 0.28);
  padding: 20px 22px;
  transform: scale(0.94) translateY(8px);
  transition: transform 0.18s ease;
}
.mx-modal-layer.is-open .mx-modal { transform: scale(1) translateY(0); }
.mx-modal.is-closing { transform: scale(0.94) translateY(8px); }
.mx-modal-msg {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
  max-height: 50vh;
  overflow-y: auto;
}
.mx-modal-input {
  margin-top: 14px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
}
.mx-modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 148, 58, 0.18);
}
.mx-modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.mx-modal-btn {
  padding: 8px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.mx-modal-btn:hover { background: var(--card-hover); color: var(--text); }
.mx-modal-btn:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.mx-modal-btn-ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.mx-modal-btn-ok:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.mx-modal-danger .mx-modal-btn-ok { background: var(--danger); border-color: var(--danger); }
.mx-modal-danger .mx-modal-btn-ok:hover { background: var(--danger-dark); border-color: var(--danger-dark); color: #fff; }

@media (max-width: 640px) {
  .mx-toast-box {
    top: 10px;
    right: 10px;
    left: 10px;
    align-items: stretch;
    max-width: none;
  }
}

/* ============ 交流中心：战斗爽 ============ */
.battle-settle-row { display: flex; gap: 8px; align-items: center; }
.battle-settle-row select { flex: none; }
.battle-settle-row input { flex: 1; min-width: 0; }
.battle-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(253, 246, 239, 0.92) 100%);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-color: var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(61, 36, 21, 0.05);
}
.battle-card.battle-locked { border-left-color: var(--muted); }
.battle-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; cursor: pointer; }
.battle-badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  color: #FFFFFF;
  background: var(--accent);
}
.battle-card-map { font-size: 16px; font-weight: 700; color: var(--text); word-break: break-all; }
.battle-locked-badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  color: #FFFFFF;
  background: var(--muted);
}
.battle-fold-arrow { flex: none; margin-left: auto; font-size: 13px; color: var(--text-secondary); transition: transform 0.15s ease; }
.battle-card.battle-expanded .battle-fold-arrow { transform: rotate(90deg); }
.battle-card-extra { display: none; }
.battle-card.battle-expanded .battle-card-extra { display: block; margin-top: 8px; }
.battle-card-info { font-size: 14px; color: var(--text); line-height: 1.7; }
.battle-card-rule { color: var(--primary-dark); font-weight: 600; }
.battle-reply-locked-tip { margin: 8px 0 0; }

/* ============ v59：小游戏大厅（你画我猜 / 连连看） ============ */
/* 注意：.tab .card 有 460px 限宽（见文件上部），游戏区卡片一律用 .tab .card.mg-card 提高优先级压过它 */
.tab .card.mg-card { max-width: none; margin: 0 0 24px; }
.mg-panel { display: block; }

.mg-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.mg-balance { font-size: 14px; color: var(--text-secondary); }
.mg-balance b { font-size: 18px; color: var(--primary-dark); margin-left: 4px; }
.mg-stake-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.mg-stake-label input { width: 90px; }
.mg-bar .ghost {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
}
.mg-bar .ghost:hover { border-color: var(--primary); color: var(--primary-dark); }
.mg-timer { font-size: 15px; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.mg-round { font-size: 14px; font-weight: 700; color: var(--text); }
.mg-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}
.mg-row .mg-grow { flex: 1; min-width: 0; word-break: break-all; }
.mg-row button { padding: 6px 14px; font-size: 13px; }

/* ---- 房间列表 ---- */
.mg-room-stake { color: var(--primary-dark); font-weight: 700; }
.mg-room-full { color: var(--muted); font-size: 13px; }

/* ---- 你画我猜：对局布局 ---- */
.mg-draw-stage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mg-draw-left { min-width: 0; }
.mg-draw-right { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.mg-word {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 10px;
  min-height: 22px;
  letter-spacing: 1px;
}
.mg-canvas-wrap { position: relative; line-height: 0; }
#mg-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  background: #FFFFFF;
  border: 2px solid var(--border);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
  display: block;
}
#mg-canvas.mg-readonly { cursor: default; }
.mg-canvas-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mg-color {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}
.mg-color.active { border-color: var(--primary-dark); box-shadow: 0 0 0 2px var(--primary-light); }
/* 橡皮擦：与色块同尺寸的方块，选中态和 .mg-color.active 保持一致 */
.mg-eraser {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.mg-eraser.active { border-color: var(--primary-dark); box-shadow: 0 0 0 2px var(--primary-light); color: var(--primary-dark); font-weight: 700; }
#mg-canvas.mg-erasing { cursor: cell; }
.mg-size-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.mg-size-label input { width: 90px; }
.mg-canvas-tools .ghost { background: #fff; border: 1px solid var(--border); color: var(--text-secondary); padding: 6px 14px; }

/* 参考图：贴在画布右上角的小浮窗，只发给画手（服务端裁剪，非画手拿不到 URL） */
.mg-ref {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 150px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  line-height: 0;
}
.mg-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--primary-light);
}
.mg-ref-toggle {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--primary-dark);
  cursor: pointer;
}
.mg-ref img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  padding: 6px;
  box-sizing: border-box;
  cursor: zoom-in;
}
.mg-ref.mg-ref-big { width: 300px; }
.mg-ref.mg-ref-big img { max-height: 300px; cursor: zoom-out; }
.mg-ref.mg-ref-collapsed img { display: none; }

.mg-players { display: flex; flex-direction: column; gap: 6px; }
.mg-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}
.mg-player.mg-me { border-color: var(--primary); background: var(--card-hover); }
.mg-player.mg-drawer { box-shadow: inset 3px 0 0 var(--primary); }
.mg-player-score { margin-left: auto; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.mg-player-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--primary-light); color: #fff; }
.mg-player-off { opacity: 0.5; }

.mg-chat {
  height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.7;
}
.mg-chat-line { word-break: break-all; }
.mg-chat-correct { color: var(--ok); font-weight: 700; }
.mg-chat-sys { color: var(--muted); font-style: italic; }
.mg-guess-bar { display: flex; gap: 8px; }
.mg-guess-bar input { flex: 1; min-width: 0; }
.mg-guess-bar button { flex: none; }

/* ---- 连连看 ---- */
.mg-link-progress { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.mg-link-side { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mg-link-name { width: 120px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-pbar { flex: 1; height: 10px; border-radius: 999px; background: var(--bg-base); overflow: hidden; }
.mg-pbar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary-light), var(--primary-dark)); transition: width 0.25s ease; }
.mg-link-num { width: 56px; flex: none; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.mg-link-grid {
  display: grid;
  gap: 4px;
  margin: 0 auto;
  max-width: 100%;
  user-select: none;
}
.mg-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(145deg, #FFFFFF, #F7EFE6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  overflow: hidden;
}
.mg-tile img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.mg-tile:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(61, 36, 21, 0.14); }
.mg-tile.mg-sel { border-color: var(--primary-dark); box-shadow: 0 0 0 2px var(--primary); background: var(--card-hover); }
.mg-tile.mg-gone { visibility: hidden; pointer-events: none; }
.mg-tile.mg-hint { animation: mgShake 0.3s ease; }
@keyframes mgShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ---- 图库管理 ---- */
.mg-image-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mg-image-item { position: relative; width: 76px; height: 76px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 4px; }
.mg-image-item img { width: 100%; height: 100%; object-fit: contain; }
.mg-image-del {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
}

/* ---- 结算 ---- */
.mg-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  margin-bottom: 8px;
}
.mg-result-row.mg-win { border-color: var(--primary); background: var(--card-hover); }
.mg-result-row.mg-me { box-shadow: inset 3px 0 0 var(--primary); }
.mg-result-rank { flex: none; width: 42px; font-weight: 700; color: var(--primary-dark); }
.mg-result-delta { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.mg-delta-up { color: var(--ok); }
.mg-delta-down { color: var(--danger); }
.mg-delta-flat { color: var(--muted); }

@media (max-width: 900px) {
  .mg-draw-stage { grid-template-columns: minmax(0, 1fr); }
  .mg-link-name { width: 80px; }
}

/* ============ v60：你画我猜「分阶段提示」+ 题库分类 ============ */
/* 基础 .mg-word 带 letter-spacing:1px（为「？？？」留白），提示语变长后要收回来 */
.mg-word.mg-hint-stage2,
.mg-word.mg-hint-drawer { letter-spacing: 0; font-size: 14px; }

/* 第二阶段：分类解锁 —— 换个色并加一点呼吸感，让玩家一眼看到新线索 */
.mg-word.mg-hint-stage2 { color: var(--ok); }

/* 题库分类输入行（复用 .mg-stake-label 外壳，只调输入框宽度） */
.mg-stake-label #mg-prompt-category { width: 130px; }
.mg-stake-label #mg-hint-seconds { width: 78px; }

/* 题库列表里的分类标签 */
.mg-cat-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--primary-dark);
  background: var(--primary-light, rgba(255, 193, 7, 0.18));
  border: 1px solid var(--border);
  vertical-align: middle;
}
.mg-cat-tag.mg-cat-none { color: var(--muted); background: transparent; }

@media (max-width: 900px) {
  .mg-stake-label #mg-prompt-category { width: 108px; }
}

/* ============ v61：麻将（每番 1 分 · 直接转账） ============ */
/* 牌面用 public/mahjong.png 整幅牌谱做 sprite：background-size 把牌谱放大到「一张牌＝一个格子」，
   background-position 由 mgMjTileFaceStyle() 按量出来的网格算，这里只管尺寸和状态。
   宽高比要跟素材里的牌卡一致（125:171），否则图会被拉扁、圆角变成椭圆。 */
.mj-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 46.5px;
  border-radius: 6px;
  background-color: #F5F5F7;
  background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(120, 100, 70, 0.18);
  user-select: none;
  flex: none;
}

.mj-tile.mj-small { width: 22px; height: 30px; }
.mj-tile.mj-big { width: 44px; height: 60px; }
/* 中央那张「谁打出什么」——整桌最大的一张，尺寸只要装得进 .mj-center-info 就别动它 */
.mj-tile.mj-huge { width: 112px; height: 153px; }

/* 别人的手牌：只给背面（张数就是信息量）—— 素材里没有牌背，仍旧用渐变画 */
.mj-tile.mj-back {
  background-image: linear-gradient(160deg, #E9D9BE 0%, #D8C29C 100%);
}
.mj-tile.mj-back::after {
  content: "";
  width: 12px;
  height: 18px;
  border: 1px solid rgba(120, 96, 60, 0.45);
  border-radius: 3px;
}

/* 牌自己不带 border（边框画在素材里），所以选中/高亮一律改用 box-shadow 描边 */
.mj-tile.mj-clickable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.mj-tile.mj-clickable:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--primary), 0 4px 10px rgba(200, 140, 40, 0.35); }
.mj-tile.mj-sel { transform: translateY(-10px); box-shadow: 0 0 0 2px var(--primary-dark), 0 6px 14px rgba(200, 140, 40, 0.4); }
.mj-tile.mj-locked { opacity: 0.4; cursor: not-allowed; }
.mj-tile.mj-new { box-shadow: 0 0 0 2px var(--primary), 0 1px 2px rgba(120, 100, 70, 0.18); }
.mj-tile.mj-last { box-shadow: 0 0 0 2px var(--primary-dark), 0 1px 2px rgba(120, 100, 70, 0.18); }

/* ---- 牌桌：我永远在下方，下家在右、对家在上、上家在左（逆时针） ---- */
.mj-table {
  display: grid;
  /* 上家占满整行：原来它被挤在中间那列里，牌排不下只能多折行，白白撑高半张桌子。
     让它横着铺开，手牌/牌河各留一行就够；左右两家等分剩下的宽度，中央吃固定宽不参与伸缩。
     position: relative 是给碰杠胡的特效当定位父级用的（见 .mj-fx） */
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "top  top    top"
    "left center right"
    "self self   self";
  gap: 8px;
  margin: 8px 0 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(160deg, #FBF3E6 0%, #F3E7D4 100%);
}
.mj-seat-top { grid-area: top; }
.mj-seat-left { grid-area: left; }
.mj-seat-right { grid-area: right; }
.mj-seat-self { grid-area: self; }
.mj-center { grid-area: center; display: flex; align-items: center; justify-content: center; min-width: 0; }
.mj-seat {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  min-width: 0;
  font-size: 13px;
}
.mj-seat.mj-out { opacity: 0.62; }
.mj-seat.mj-me { background: rgba(255, 255, 255, 0.9); }
/* 轮到他出牌的那家整框转蓝，跟一桌暖米色拉开。
   必须压在 .mj-me 后面：自己也是这四格之一，写在前面会被 .mj-me 的白底盖掉，
   轮到自己出牌时就只剩个蓝边、底色还是白的 */
.mj-seat.mj-turn { border-color: #1E6FBF; background: #E3F0FD; box-shadow: 0 0 0 3px rgba(30, 111, 191, 0.22); }
/* ---- 牌桌内的每一块都是定高的：牌数、牌河长度、名字长短都不许改变牌桌尺寸 ---- */
.mj-seat {
  /* 座位里所有牌共用一组尺寸，改这一个值整桌一起缩放（宽高比对齐素材的 125:171）。
     牌河、别家手牌背面、别家副露都吃它 —— 它管的是「牌面」本身，不是座位框。
     行高由牌高推出来，不用手写第二个数字，省得改了一个忘了另一个 */
  --mj-seat-tile: 26px;
  --mj-seat-row: calc(var(--mj-seat-tile) * 171 / 125 + 2px); /* 牌高 + 2px 间隙 */
}
.mj-seat-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
  height: 22px;
  font-weight: 700;
  white-space: nowrap;
}
.mj-seat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mj-seat-tags { font-size: 12px; font-weight: 400; flex: none; }
.mj-seat-hand { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; height: calc(var(--mj-seat-row) * 2); overflow: hidden; align-content: flex-start; }
.mj-seat .mj-tile { width: var(--mj-seat-tile); height: calc(var(--mj-seat-tile) * 171 / 125); }
/* 牌背里的那个小方框按比例走，不然牌面放大后它会显得又小又偏 */
.mj-seat .mj-tile.mj-back::after { width: 40%; height: 40%; }

.mj-melds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mj-meld { display: inline-flex; gap: 2px; padding: 2px; border-radius: 6px; background: rgba(255, 255, 255, 0.75); }
.mj-river { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; }
/* 副露最多 4 组、牌河多到二十几张，留两排；再多就在自己那块里滚，不往外撑座位 */
.mj-seat .mj-melds { height: calc(var(--mj-seat-row) * 2); overflow-y: auto; align-content: flex-start; }
.mj-seat .mj-river { height: calc(var(--mj-seat-row) * 2); overflow-y: auto; align-content: flex-start; }
/* 上家那格现在是整行宽，牌横着排得开，副露/牌河各留一行就够，省下的高度归左右两家 */
.mj-seat-top .mj-melds,
.mj-seat-top .mj-river { height: var(--mj-seat-row); }

/* 中央窗口：只管「这一手是谁打出什么」，定宽定高 —— 出牌前后一格不差 */
.mj-center-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 152px;
  height: 206px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}
.mj-center-last { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 153px; justify-content: center; }
.mj-center-who { font-size: 15px; font-weight: 700; }

/* 事件流水：牌桌下面单独一条定高横条，内部滚动，不参与牌桌高度计算。
   碰杠胡的画面提示交给 .mj-fx 了，这条只当历史查，所以压扁一点省纵向空间 */
.mj-log-bar {
  height: 46px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.6;
  overflow-y: auto;
}

/* ---- 自己的区域 ---- */
.mj-self-area {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}
/* 自己这块也是定高的：手牌从 14 张打到 1 张、牌河从空到堆满，下面的操作条都不带挪位的 */
#mg-mahjong-melds { height: 52px; overflow-y: auto; }
.mj-hand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; height: 78px; overflow: hidden; align-items: flex-start; }
/* 自己的手牌盯着看的最久，单独放大一档（48px ≈ 别家牌面的 1.8 倍、原来默认尺寸的 1.4 倍）。
   margin-top 那 10px 是给 .mj-tile.mj-sel 的 translateY(-10px) 留的位，去掉就会被裁掉 */
.mj-hand .mj-tile { width: 48px; height: 65.7px; margin-top: 10px; }
/* 自己打出的牌 / 副露虽然带 mj-small，但也属于「打出的牌面」，用 id 盖回标准大小 */
#mg-mahjong-melds .mj-tile,
#mg-mahjong-river .mj-tile { width: 34px; height: 46.5px; }
#mg-mahjong-river { height: 52px; overflow-y: auto; align-content: flex-start; }

/* ---- 操作条 ---- */
.mj-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; min-height: 38px; }
.mj-actions button { padding: 8px 18px; font-size: 14px; }
.mj-actions .mj-btn-hu {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
  color: #4A2E12;
  border: none;
  font-weight: 700;
}
.mj-action-hint { font-size: 13px; }

/* ---- 定缺 ---- */
.mj-que { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--primary); border-radius: 14px; background: #FFFAF0; }
.mj-que .mj-actions { margin-top: 8px; }

/* ---- 碰 / 杠 / 胡 的画面特效 ----
   盖满整张牌桌的一层，只在事件发生的那一秒多里出现。
   pointer-events: none 是为了让它下面那层能点的界面照常能点（否则动画期间点不了牌）。
   中间那张牌本来就是全场最花的一块，字直接压上去会跟牌面花纹糊在一起，
   所以整层垫一道由中心向外淡出的白罩：字读得清，四周的牌还看得见 */
.mj-fx {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  /* 中心留得白一点给字当底，边上淡开，别把整桌的牌都糊没了。
     自己那排手牌在 .mj-table 外面，照不到，所以这一秒多里照样能看牌 */
  background: radial-gradient(ellipse at center, rgba(255, 253, 248, 0.84) 0%, rgba(255, 253, 248, 0.6) 48%, rgba(255, 253, 248, 0.24) 100%);
  animation: mj-fx-pop 1.5s ease-out forwards;
}
.mj-fx b {
  font-size: 72px;
  line-height: 1.1;
  /* 字间距会在最后一个字后面也留一份，视觉重心会偏左，用 text-indent 拉回来 */
  letter-spacing: 6px;
  text-indent: 6px;
  /* 描边用 text-shadow 叠出来，比 -webkit-text-stroke 在各家的表现稳 */
  color: #C0392B;
  text-shadow: 0 0 6px #FFFDF8, 0 0 16px rgba(192, 57, 43, 0.6), 0 6px 20px rgba(120, 60, 20, 0.45);
}
.mj-fx span {
  font-size: 14px;
  font-weight: 700;
  color: #7A5A2E;
  background: rgba(255, 250, 240, 0.95);
  border: 1px solid rgba(200, 160, 100, 0.6);
  padding: 1px 12px;
  border-radius: 999px;
}
.mj-fx-gang b { color: #1E6FBF; text-shadow: 0 0 6px #FFFDF8, 0 0 16px rgba(30, 111, 191, 0.6), 0 6px 20px rgba(20, 60, 120, 0.45); }
.mj-fx-hu b,
.mj-fx-zimo b { color: #B8860B; font-size: 84px; text-shadow: 0 0 6px #FFFDF8, 0 0 20px rgba(184, 134, 11, 0.65), 0 6px 20px rgba(120, 80, 0, 0.45); }

@keyframes mj-fx-pop {
  0%   { opacity: 0; transform: scale(0.4); }
  18%  { opacity: 1; transform: scale(1.18); }
  32%  { transform: scale(1); }
  72%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

/* 做出动作的那家座位同时闪一圈，不然中间那个大字不说清是谁碰的 */
.mj-seat.mj-claim { animation: mj-claim-flash 1.5s ease-out; }
@keyframes mj-claim-flash {
  0%   { box-shadow: 0 0 0 0 rgba(245, 180, 97, 0.95), 0 0 24px 8px rgba(245, 180, 97, 0.75); border-color: var(--primary); }
  70%  { box-shadow: 0 0 0 18px rgba(245, 180, 97, 0), 0 0 10px 0 rgba(245, 180, 97, 0); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 18px rgba(245, 180, 97, 0), 0 0 0 0 rgba(245, 180, 97, 0); }
}

@media (max-width: 900px) {
  .mj-tile { width: 28px; height: 38px; }
  .mj-table { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "left" "center" "right" "self"; padding: 10px; gap: 8px; }
  .mj-center-info { max-width: none; }
  /* 手机上牌桌是单列的、座位框变全宽，牌面收一档换取纵向空间；手牌因为能横向滚，只小幅收 */
  .mj-seat { --mj-seat-tile: 24px; }
  .mj-tile.mj-huge { width: 84px; height: 115px; }
  .mj-hand .mj-tile { width: 40px; height: 54.7px; }
  .mj-hand { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .mj-actions button { padding: 8px 14px; font-size: 13px; }
  .mj-stake-label #mg-mahjong-rules { width: 100%; }
}

/* 笔记本那种不高的小屏再收一档：所有座位尺寸都从 --mj-seat-tile 派生，改这一个值整桌一起缩。
   宁可牌小一点，也别让人看不到自己的手牌和按钮 */
@media (max-height: 1000px) {
  .mj-seat { --mj-seat-tile: 22px; }
  .mj-tile.mj-huge { width: 92px; height: 126px; }
  .mj-center-info { height: 186px; }
  .mj-center-last { min-height: 126px; }
  .mj-fx b { font-size: 60px; }
  .mj-fx span { font-size: 13px; }
  /* 这两条和基样式是同一个道理：.mj-fx-hu b 比 .mj-fx b 更具体，
     不在媒体查询里单独写一遍的话，上面那条根本盖不住它 */
  .mj-fx-hu b,
  .mj-fx-zimo b { font-size: 68px; }
  .mj-hand .mj-tile { width: 42px; height: 57.4px; }
  .mj-hand { height: 70px; }
  .mj-log-bar { height: 40px; }
}
/* 选中态要比 hover 抬得更高：否则鼠标停在选中的牌上时它会「掉」下来 */
.mj-tile.mj-clickable.mj-sel:hover { transform: translateY(-10px); }

/* ============ 成员福利：ROLL点活动 ============ */
/* 今日奖品大卡与排行榜要通栏，覆盖 .tab .card 默认的 max-width:460px */
.tab .card.roll-hero-card,
.tab .card.roll-admin-card,
.tab .card.roll-signups-card { max-width: none; }

.roll-admin-dates { display: flex; gap: 16px; flex-wrap: wrap; }
.roll-admin-dates label { flex: 1 1 180px; }
.roll-admin-btns { display: flex; gap: 12px; align-items: center; }

.roll-daily-block { display: flex; flex-direction: column; gap: 10px; }
.roll-daily-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: #6b6b6b; }
.roll-daily-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.roll-daily-row .roll-daily-day { flex: 0 0 150px; }
.roll-daily-row .roll-daily-text { flex: 1 1 200px; }
.roll-daily-row .roll-daily-link { flex: 1 1 180px; }

/* 今日奖品 */
.roll-today-wrap {
  margin: 18px 0;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff6ec 0%, #ffe9d2 100%);
  border: 1px solid #f6d9b8;
}
.roll-phase {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 10px;
  background: #efe6dc;
  color: #6b6b6b;
}
.roll-phase-running { background: #e4f6e6; color: #1f7a3a; }
.roll-phase-upcoming { background: #e6eefb; color: #2b5aa8; }
.roll-phase-ended { background: #fbe6e6; color: #a83232; }
.roll-today-label { font-size: 13px; color: #8a7a68; margin-bottom: 6px; }
.roll-today { font-size: 26px; font-weight: 700; color: #7a4a12; line-height: 1.4; word-break: break-word; }
.roll-today-link { margin-top: 10px; font-size: 14px; }
.roll-today-link a { color: #c2591c; text-decoration: underline; }

/* 我的状态 */
.roll-me { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 14px 0; font-size: 14px; color: #4a4a4a; }
.roll-me-item { padding: 3px 12px; border-radius: 999px; background: #f6f1ea; }

/* 骰子 */
.roll-dice-wrap { text-align: center; margin: 18px 0; }
.roll-dice {
  display: inline-block;
  min-width: 168px;
  padding: 10px 20px;
  border-radius: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 60px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #c2591c;
  background: #fffaf4;
  border: 2px dashed #e9c9a6;
  transition: transform .15s ease, color .15s ease;
}
/* 滚动中：数字快速跳动，给一点晃动感，但别晃到看不清 */
.roll-dice.roll-dice-live { border-style: solid; border-color: #e8a55e; animation: roll-shake .18s infinite; }
@keyframes roll-shake {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.roll-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.roll-mine-rolls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.roll-mine-rolls .roll-roll-chip {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 13px;
  background: #f2f6f2;
  color: #33663f;
}
.roll-board-me { background: #fff6ec; font-weight: 600; }
.roll-signups-card .table-wrap { margin-bottom: 16px; }

/* 活动说明：活动信息卡里的一段富文本。正文样式主体沿用 .guide-rich，
   这里只管它和日期行、今日奖品之间的分隔与间距。 */
.roll-desc {
  margin: 14px 0 18px;
  padding: 12px 16px;
  border-left: 3px solid #e8a55e;
  background: #fffaf4;
  border-radius: 0 10px 10px 0;
}
.roll-desc h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #a8621f;
}
.roll-desc-body { line-height: 1.75; word-break: break-word; }
.roll-desc-body > *:first-child { margin-top: 0; }
.roll-desc-body > *:last-child { margin-bottom: 0; }
/* 编辑器与表单其它输入框等高对齐 */
#roll-content.rich-editor { min-height: 220px; }

/* 余额管理里点「明细」展开的那一行。整行一个 td（colSpan 由 app.js 按表头数算），
   里面再套一张小表 —— 底色压暗一点，好跟上面的用户行分开 */
.balance-detail-row > td {
  background: #f7f8fa;
  border-top: 1px dashed #d8dde5;
  padding: 12px 14px 14px;
}
.balance-detail-head { margin: 0 0 10px; }
.balance-detail-table { width: auto; min-width: 60%; }
.balance-detail-table th { padding: 6px 8px; font-size: 13px; }
.balance-detail-table td { padding: 6px 8px; font-size: 13px; }

/* 「我的出售」里点「明细」展开的那一行：跟余额管理那套同一副样子，
   只是类名分开起 —— 两张表在页面上隔得很远，共用一个类名以后改一处会误伤另一处 */
.sell-detail-row > td {
  background: #f7f8fa;
  border-top: 1px dashed #d8dde5;
  padding: 12px 14px 14px;
}

/* 发布表单一行的多个 CDK 码。ex-form-grid 是两列网格，textarea 必须独占一整行，
   否则会被压成半栏宽、一行只看得见六七个字符 */
.ex-form-grid textarea {
  width: 100%;
  min-height: 96px;
  padding: 8px 10px;
  border: 1px solid #cdd4dd;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}
/* 已经填了几个码，跟着输入框走，不是 label 的标题 */
#cdk-code-count { display: block; margin-top: 4px; font-size: 12px; }

/* ==================== 小游戏大厅：俯视角射击 ====================
   画布固定 960×540 内部分辨率，用 CSS 等比缩到容器宽度。
   鼠标坐标在 fps.js 里按 getBoundingClientRect 的比例换算回去，
   所以这里只要保证「等比」即可（绝不同时钉死 width 和 height，那会把圆压成椭圆）。 */
.mg-fps-stage {
  position: relative;
  margin: 12px 0;
  /* 画面本身是深色的，兜底背景也调成深色，加载瞬间不会闪一下白 */
  background: #1b2430;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}
#mg-fps-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  /* 拖拽瞄准时不要选中页面文字，否则按住鼠标会把界面刷蓝 */
  user-select: none;
  touch-action: none;
}

/* 击杀播报 / 换弹提示 / 血条以前是叠在画布上的绝对定位元素（.mg-fps-feed / .mg-fps-note /
   .mg-fps-hpwrap），现在全部由 fps.js 的 drawHud 画进 canvas 里了，样式随之删除。
   注意 .mg-fps-stage 必须保留 position: relative 之外的 overflow: hidden —— 画布仍然在它里面。 */

/* 房间列表里的一行 —— 沿用 roll 那套 .mg-fps-roomrow 的排布 */
.mg-fps-roomrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fbfcfd;
}
.mg-fps-roominfo { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.mg-fps-roominfo .muted { font-size: 12px; }
.mg-fps-roomrow button { flex: 0 0 auto; }

/* 等待房里的玩家标签 */
.mg-fps-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.mg-fps-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1f5;
  border: 1px solid #dde2e9;
  font-size: 13px;
  color: var(--text-secondary);
}
.mg-fps-chip.host { background: #fff4d6; border-color: #f0d48a; color: #8a6100; }

/* 结算表 */
.mg-fps-result-table { margin: 10px 0; }
.mg-fps-result-row {
  padding: 8px 12px;
  border-bottom: 1px solid #eceff3;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.mg-fps-result-row.me { background: #eef6ff; }
.mg-fps-result-row.win { font-weight: 700; color: var(--primary-dark); }

/* 窄屏不再需要单独的 HUD 断点：HUD 画在 canvas 里，画布缩它就跟着缩 */

/* ============ v80：我的角色 + 百佬汇动画卡片 ============ */

/* ---- 我的角色（个人中心） ---- */

/* 全宽 + 上下留白。两条都得写：
   ① max-width —— `.tab .card{max-width:460px}` 是 0-2-0，必须用 0-3-0 的 `.tab .card.my-characters-card`
      才压得住（同 balance-card/coffee-card 的先例）。角色卡里有 3 行「缩略图 + 名字 + 一串按钮」，
      460px 会把按钮挤到第二行去。
   ② 上边距 —— 它下面紧跟着 `<h2>我发布的（免费）</h2>`，而 `.tab h2` 的 margin 是 `0 0 16px`（上边距 0）；
      上面那张余额卡的 margin 也是 0。上下都不给就会跟两张卡都贴在一起，所以这里上下都要 24px。 */
.tab .card.my-characters-card { max-width: none; margin: 24px 0; }

.mychar-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.mychar {
  display: flex; align-items: center; gap: 12px;
  background: #FFFDF7; border: 2px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.mychar-pic {
  width: 64px; height: 64px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FFFDF7, #F3EADA); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
/* 原始像素不放大：小图（人物 45×69 上下）居中摆着就好，放大会糊 */
.mychar-pic img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.mychar-info { flex: 1; min-width: 0; }
.mychar-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mychar-sub { font-size: 12px; color: var(--text-secondary); }
.mychar-chip {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 400; border: 1px solid var(--border); background: #F3EADA;
}
.mychar-chip.on { background: #E4F6E9; border-color: #9CCFAE; color: #2C6B43; }
.mychar-chip.wait { background: #FBF3DC; border-color: #DCC58A; color: #7A5B12; }
.mychar-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* 窄屏：按钮排到下面一行，别把名字挤没了 */
@media (max-width: 720px) {
  .mychar { flex-wrap: wrap; }
  .mychar-info { flex-basis: calc(100% - 76px); }
  .mychar-btns { width: 100%; justify-content: flex-start; }
}

/* ---- 换装弹窗：iframe 撑满面板剩下的高度 ----
   **必须给面板一个写死的高度**。.modal-panel 只有 max-height、没有 height，外层是
   align-items:center 的 flex，所以面板高度是「由内容决定」的；而 iframe 是个替换元素，
   没给高度时按默认的 300×150 算 —— 结果整个换装编辑器只有 150px 高（实测过）。
   calc(100vh - 40px) 正好抵掉 .modal-overlay 上下各 20px 的 padding，任何屏幕都不溢出。 */
.dressup-panel { max-width: 1100px; height: calc(100vh - 40px); max-height: calc(100vh - 40px); }
.dressup-frame-wrap { flex: 1; min-height: 0; display: flex; }
#dressup-frame { flex: 1; width: 100%; border: 0; border-radius: 0 0 12px 12px; background: #12141a; }
/* 换装面板底部那行说明 */
.dressup-panel > p { margin: 0; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; }

/* ---- 百佬汇：玩家角色卡（动画） ----
   .baiyh-img 保持 150×150 不改尺寸 —— 卡片是 auto-fill 网格，同行会被拉等高，
   单独给动画卡加高只会让同行的超管卡留一块空白。人物在框里 contain 居中即可。 */
/* width/height 由 JS 按「只缩不放」算好写进内联样式（见 baiyhCard）。
   background-position-x 就是切帧，七格一张图横向排开：0% / 16.7% / ... / 100%。 */
.baiyh-sprite { background-repeat: no-repeat; background-position: 0 50%; }
.baiyh-job { font-size: 12px; color: var(--text-secondary); }
