/* 大魔王社区：与主站同一套暗黑高级感配色（CSP 禁止内联样式，全部写在这里） */
:root {
  --bg: #0a0809; --bg-2: #120d0e; --panel: rgba(255, 244, 230, .04); --ink: #f3ece4; --muted: #a69c93; --dim: #6f6660;
  --red: #b3262f; --red-deep: #5c0f15; --gold: #d8b77a; --gold-soft: rgba(216, 183, 122, .55); --line: rgba(216, 183, 122, .16);
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', serif; --sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 var(--sans); -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(50% 420px at 85% 0, rgba(179, 38, 47, .22), transparent 70%); background-repeat: no-repeat; }
a { color: var(--gold); text-underline-offset: 3px; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.top { border-bottom: 1px solid var(--line); background: rgba(10, 8, 9, .85); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; }
.brand img { display: block; height: 28px; width: auto; }
.brand span { padding-left: 10px; border-left: 1px solid var(--line); }
.boards { display: flex; gap: 18px; flex: 1; font-size: 15px; overflow-x: auto; }
.boards a, .me a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.boards a:hover, .me a:hover { color: var(--ink); }
.me { display: flex; align-items: center; gap: 14px; font-size: 14px; white-space: nowrap; }
.me .mod-link { color: var(--gold); }
.main { padding: 36px 20px 80px; min-height: 60vh; }
.foot { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--dim); background: var(--bg-2); }
.foot a { color: var(--muted); }
h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 4vw, 38px); line-height: 1.25; margin: 0 0 14px; }
.kicker { font-size: 12px; letter-spacing: .32em; color: var(--gold); text-transform: uppercase; margin: 0 0 10px; }
.lede { color: var(--muted); margin: 0 0 22px; }
.hero { padding: 18px 0 30px; }
.hero.small { padding-top: 0; }
.sec { font-family: var(--serif); font-size: 20px; margin: 36px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.btn { display: inline-block; padding: 11px 24px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 15px; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, var(--red), var(--red-deep)); box-shadow: 0 8px 30px -10px rgba(179, 38, 47, .7); }
.btn:hover { filter: brightness(1.12); }
.btn-sm { padding: 6px 14px; font-size: 13px; box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.danger { background: #3a0c10; color: #ffb3b3; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
button.link:hover { color: var(--ink); }
form.inline { display: inline; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.board-card { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.board-card:hover { border-color: var(--gold-soft); transform: translateY(-2px); }
.board-card h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 6px; }
.board-card p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.board-card span { font-size: 12px; color: var(--gold); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.row-title { color: var(--ink); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.row-title:hover { color: var(--gold); }
.row-meta { color: var(--dim); font-size: 13px; white-space: nowrap; }
.empty { color: var(--dim); padding: 20px 4px; list-style: none; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; margin-right: 6px; border-radius: 6px; border: 1px solid var(--gold-soft); color: var(--gold); }
.tag.warn { border-color: rgba(179, 38, 47, .6); color: #ff9c9c; }
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 22px; }
.crumb a { color: var(--muted); text-decoration: none; font-size: 14px; }
.op { padding-bottom: 8px; }
.meta { color: var(--dim); font-size: 14px; }
.body { color: #ddd4cb; word-break: break-word; }
.reply { padding: 16px 18px; margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.reply header { font-size: 14px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reply header b { color: var(--ink); }
.reply h3 { font-family: var(--serif); margin: 4px 0 8px; }
.reply.pending { border-style: dashed; opacity: .8; }
.mod-tools { display: inline-flex; gap: 12px; margin-left: auto; font-size: 13px; }
.mod-tools .link { color: #ff9c9c; }
.mod-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.mod-act input { flex: 1; min-width: 160px; }
.post-form { display: grid; gap: 14px; margin-top: 18px; }
.post-form.narrow { max-width: 420px; }
.post-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea, select { width: 100%; padding: 11px 13px; font: inherit; font-size: 15px; color: var(--ink); background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line); border-radius: 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold-soft); }
.post-form .check { display: flex; gap: 10px; align-items: flex-start; color: #d8cfc6; line-height: 1.6; }
.check input { width: auto; margin-top: 5px; accent-color: var(--red); }
.post-form .btn { justify-self: start; }
.hint { color: var(--dim); font-size: 13px; }
.error { color: #ff8a8a; }
.flash { color: var(--gold); }
.rules ol { padding-left: 22px; }
.rules li { margin: 8px 0; }
@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .boards { order: 3; flex: 0 0 100%; padding-bottom: 4px; }
  .me { margin-left: auto; }
  .row { flex-direction: column; gap: 4px; }
  .main { padding: 24px 16px 60px; }
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.gallery a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }
input[type="file"] { padding: 9px; font-size: 14px; color: var(--muted); }
/* 语言切换 */
.lang-switch { position: relative; }
.lang-switch summary { list-style: none; cursor: pointer; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 110px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); display: grid; z-index: 20; }
.lang-menu a { padding: 7px 10px; border-radius: 8px; }
.lang-menu a:hover { background: var(--panel); color: var(--ink); }
.lang-menu a[aria-current] { color: var(--gold); }

/* 回官网：logo 回官网首页，「社区」回社区首页；手机底部标签栏与官网一致（首页/产品/动态/社区） */
.brand a { display: flex; color: inherit; text-decoration: none; }
.brand-sub { padding-left: 10px; border-left: 1px solid var(--line); }
.tabbar { display: none; }
@media (max-width: 720px) {
  .top { padding-top: env(safe-area-inset-top); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(14, 10, 11, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--dim); text-decoration: none; font-size: 11px; line-height: 1.3; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
  .tabbar a[aria-current="page"] { color: var(--gold); }
  .foot { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* 表情（static/emoji.js 生成）：按钮在输入框下方，面板浮在按钮下 */
.emoji { position: relative; justify-self: start; }
.emoji-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 2px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--gold-soft); }
.emoji-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(340px, calc(100vw - 40px)); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.emoji-panel[hidden] { display: none; }
.emoji-panel button { border: 0; background: none; font-size: 22px; line-height: 1.4; padding: 2px 0; border-radius: 8px; cursor: pointer; }
.emoji-panel button:hover { background: rgba(255, 244, 230, .08); }
