:root {
  --pri: #ff7a45; --pri-d: #e8602a; --acc: #6c5ce7; --acc-d: #5a4bd1;
  --ok: #00b578; --gold: #ffb300; --red: #ff4d4f;
  --bg: #f4f6ff; --card: #ffffff; --ink: #2b2d42; --sub: #7a7f9a; --line: #e8eaf6;
  --r: 18px; --shadow: 0 4px 16px rgba(108, 92, 231, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; }
a { color: var(--acc); text-decoration: none; }
img { max-width: 100%; }

/* 顶部导航 */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(135deg, #6c5ce7 0%, #8e7bff 55%, #ff9a62 100%); box-shadow: 0 2px 12px rgba(108,92,231,.35); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: 1px; cursor: pointer; text-shadow: 0 2px 6px rgba(0,0,0,.18); }
.logo .e { margin-right: 6px; }
.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav a { color: rgba(255,255,255,.92); padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: .15s; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.25); color: #fff; }
.userbox { color: #fff; display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.userbox .uname { font-weight: 700; }
.btn-mini { background: rgba(255,255,255,.25); color: #fff; border: none; padding: 6px 13px; border-radius: 999px; font-size: .85rem; cursor: pointer; font-weight: 600; }
.btn-mini:hover { background: rgba(255,255,255,.4); }

/* 布局 */
.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 16px 60px; }
.hero { background: linear-gradient(135deg, #fff5ec, #f0eaff); border-radius: var(--r); padding: 26px 24px; margin-bottom: 18px; border: 2px dashed #ffd9c0; }
.hero h1 { font-size: 1.5rem; color: var(--pri-d); margin-bottom: 8px; }
.hero p { color: var(--sub); font-size: .95rem; }
.hero .stats { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.hero .stat { background: #fff; border-radius: 12px; padding: 8px 14px; font-size: .85rem; color: var(--sub); box-shadow: var(--shadow); }
.hero .stat b { color: var(--acc); font-size: 1.05rem; margin-right: 4px; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.tabs button { border: none; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .9rem; color: var(--sub); font-weight: 600; }
.tabs button.on { background: var(--acc); color: #fff; }
select, input[type=text], input[type=password], textarea {
  border: 2px solid var(--line); border-radius: 12px; padding: 9px 13px; font-size: .95rem; background: #fff; color: var(--ink); font-family: inherit; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--acc); }
.search { flex: 1; min-width: 160px; }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: .18s; border: 2px solid transparent; position: relative; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); border-color: #ffd9c0; }
.cover { aspect-ratio: 16/9; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .ph { font-size: 3rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.cover .wait { color: #fff; font-size: .95rem; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin-badge { position: absolute; top: 10px; left: 10px; background: var(--gold); color: #fff; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 2; }
.card-body { padding: 13px 15px 15px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 1.05rem; font-weight: 800; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-intro { font-size: .85rem; color: var(--sub); line-height: 1.5; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
/* 作者行：突出名字 + 称号位 */
.card-author { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.a-name { font-size: 1.02rem; font-weight: 800; color: #2b2d42; letter-spacing: .5px; }
.a-title { display: inline-block; font-size: .72rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #f2a900, #ffb300); border-radius: 999px; padding: 2.5px 10px; box-shadow: 0 1px 5px rgba(242, 169, 0, .45); white-space: nowrap; }
.a-title.empty { background: #fff; border: 1.5px dashed #c8cbdd; color: #b0b4c8; box-shadow: none; }
.a-class { font-size: .75rem; color: #8a8fa8; margin-left: auto; white-space: nowrap; }
.author { font-size: .82rem; color: var(--acc); font-weight: 600; background: #f0eaff; padding: 3px 10px; border-radius: 999px; }
.stats { display: flex; gap: 9px; font-size: .82rem; color: var(--sub); }
.stats span b { color: var(--ink); }

/* 按钮 */
.btn { border: none; border-radius: 999px; padding: 10px 22px; font-size: .95rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: .15s; }
.btn-pri { background: linear-gradient(135deg, var(--acc), #a78bfa); color: #fff; box-shadow: 0 4px 12px rgba(108,92,231,.35); }
.btn-pri:hover { transform: translateY(-1px); }
.btn-orange { background: linear-gradient(135deg, var(--pri), #ffa76c); color: #fff; box-shadow: 0 4px 12px rgba(255,122,69,.35); }
.btn-ghost { background: #fff; color: var(--acc); border: 2px solid var(--acc); }
.btn-danger { background: #fff1f0; color: var(--red); border: 2px solid #ffccc7; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
.form-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 26px; max-width: 460px; margin: 30px auto; }
.form-card.wide { max-width: 760px; }
.form-card h2 { font-size: 1.25rem; margin-bottom: 18px; color: var(--ink); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .88rem; font-weight: 700; color: var(--sub); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { font-size: .78rem; color: #b0b4c8; margin-top: 4px; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill { border: 2px solid var(--line); border-radius: 12px; padding: 9px 16px; cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--sub); background: #fff; }
.radio-pill.on { border-color: var(--acc); color: var(--acc); background: #f0eaff; }

/* 通用面板 */
.panel { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.panel h3 { font-size: 1.05rem; margin-bottom: 14px; color: var(--ink); }

/* 留言 */
.cmt { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.cmt:last-child { border-bottom: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.1rem; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.cmt-name { font-weight: 700; font-size: .9rem; }
.cmt-class { font-size: .75rem; color: var(--acc); background: #f0eaff; border-radius: 999px; padding: 2px 8px; }
.cmt-time { font-size: .75rem; color: #b0b4c8; }
.cmt-text { font-size: .93rem; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.cmt-del { margin-left: auto; background: none; border: none; color: #c0c4d8; cursor: pointer; font-size: .8rem; }
.cmt-del:hover { color: var(--red); }

/* 帖子 */
.post { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.post-head { display: flex; gap: 12px; margin-bottom: 10px; align-items: center; }
.post-content { font-size: .97rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; }
.at { color: var(--acc); font-weight: 700; background: #f0eaff; border-radius: 6px; padding: 0 4px; }
.work-chip { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #fff3e8, #ffe9d6); border: 1.5px solid #ffd9c0; color: var(--pri-d); font-size: .85rem; font-weight: 700; border-radius: 999px; padding: 6px 14px; cursor: pointer; margin-bottom: 8px; }
.reply { padding: 10px 0 10px 14px; border-left: 3px solid var(--line); margin: 8px 0; }
.reply .cmt-text { font-size: .9rem; }
.replies-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }

/* 作品页 */
.work-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.work-title { font-size: 1.45rem; font-weight: 800; flex: 1; min-width: 200px; }
.play-box { background: #1a1b2e; border-radius: var(--r); overflow: hidden; aspect-ratio: 16/9; position: relative; box-shadow: var(--shadow); }
.play-box iframe { width: 100%; height: 100%; border: none; display: block; }
.play-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: linear-gradient(135deg, #2b2d42, #4a4370); cursor: pointer; }
.play-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.play-btn { position: relative; z-index: 2; font-size: 1.2rem; padding: 14px 40px; }
.action-row { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 9px 18px; font-size: .92rem; font-weight: 700; color: var(--sub); cursor: pointer; transition: .15s; }
.act:hover { border-color: var(--acc); color: var(--acc); }
.act.on { background: #f0eaff; border-color: var(--acc); color: var(--acc); }
.act.gold.on { background: #fff8e1; border-color: var(--gold); color: #c78500; }
.act.orange.on { background: #fff1ec; border-color: var(--pri); color: var(--pri-d); }

/* 全屏游玩 */
.fs-wrap { position: fixed; inset: 0; z-index: 150; background: #000; display: none; }
.fs-wrap.on { display: block; }
.fs-wrap iframe { width: 100%; height: 100%; border: none; display: block; background: #000; }
.fs-exit { position: fixed; top: 14px; left: 14px; z-index: 160; height: 46px; padding: 0 20px 0 14px; border-radius: 999px; border: none; background: rgba(30,30,50,.55); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,.4); transition: .15s; font-family: inherit; }
.fs-exit:hover { background: rgba(232,96,42,.9); }
.fs-exit .arr { font-size: 1.2rem; line-height: 1; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(30,30,60,.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: var(--r); padding: 24px; max-width: 480px; width: 100%; max-height: 92vh; overflow: auto; }
.modal h3 { margin-bottom: 16px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* toast */
#toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast-item { background: rgba(43,45,66,.92); color: #fff; border-radius: 999px; padding: 10px 22px; font-size: .9rem; font-weight: 600; animation: pop .2s; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.toast-item.err { background: rgba(255,77,79,.95); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } }

/* 表格（管理端） */
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--sub); font-size: .8rem; white-space: nowrap; }
.thumb { width: 84px; height: 48px; object-fit: cover; border-radius: 8px; background: linear-gradient(135deg, #667eea, #764ba2); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; }

/* 管理端 tabs */
.mtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.mtabs button { border: none; background: #fff; border-radius: 12px; padding: 9px 18px; cursor: pointer; font-weight: 700; color: var(--sub); box-shadow: var(--shadow); font-size: .9rem; }
.mtabs button.on { background: var(--acc); color: #fff; }

.tag { display: inline-block; font-size: .75rem; border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.tag-ok { background: #e6f7ef; color: var(--ok); }
.tag-wait { background: #fff8e1; color: #c78500; }
.tag-fail { background: #fff1f0; color: var(--red); }
.tag-off { background: #f0f0f5; color: #999; }

.empty { text-align: center; color: #b0b4c8; padding: 50px 0; font-size: .95rem; }
.empty .e { font-size: 2.6rem; display: block; margin-bottom: 10px; }

/* ===== 称号徽章分档（1-10 级，越高越炫酷） ===== */
.a-title.tl-b { background: linear-gradient(135deg, #9aa0b5, #b6bccd); box-shadow: 0 1px 4px rgba(120,125,145,.35); }
.a-title.tl-g { background: linear-gradient(135deg, #00a86b, #2ed573); box-shadow: 0 1px 5px rgba(0,181,120,.45); }
.a-title.tl-bl { background: linear-gradient(135deg, #0984e3, #38b6ff); box-shadow: 0 1px 6px rgba(9,132,227,.5); }
.a-title.tl-p { background: linear-gradient(135deg, #8e44ad, #c471ed); box-shadow: 0 2px 8px rgba(142,68,173,.55); }
.a-title.tl-gold { background: linear-gradient(135deg, #e8a000, #ffd54f); box-shadow: 0 0 9px rgba(255,193,7,.65); border: 1px solid rgba(255,255,255,.5); }
.a-title.tl-rainbow { background: linear-gradient(90deg, #ff4d4f, #ff9a62, #ffd54f, #2ed573, #38b6ff, #c471ed, #ff4d4f); background-size: 300% 100%; animation: tlRainbow 3s linear infinite; box-shadow: 0 0 10px rgba(199,113,237,.6); border: 1px solid rgba(255,255,255,.6); }
.a-title.tl-lock { background: #f0f0f5; color: #b0b4c8; box-shadow: none; }
@keyframes tlRainbow { to { background-position: 300% 0; } }

/* ===== VIP ===== */
.vip-badge { display: inline-block; font-size: .68rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #e8a000, #ffd54f); border-radius: 999px; padding: 2px 7px; margin-right: 4px; box-shadow: 0 0 6px rgba(255,193,7,.6); vertical-align: 1px; }
.vip-name { background: linear-gradient(90deg, #ff4d4f, #ff9a62, #e8a000, #2ed573, #38b6ff, #c471ed); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; font-weight: 800; animation: tlRainbow 4s linear infinite; }
/* VIP 留言/回复高亮气泡 */
.cmt.vip { background: linear-gradient(135deg, #fffdf3, #fff3dd); border: 1.5px solid #ffd54f; border-radius: 14px; padding: 10px 12px; }
.reply.vip { background: linear-gradient(135deg, #fffdf3, #fff3dd); border: 1.5px solid #ffd54f; border-radius: 12px; padding: 10px 12px; border-left: 3px solid #ffd54f; }

/* ===== 等级进度条 ===== */
.lv-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lv-num { font-size: 1.2rem; font-weight: 800; color: var(--acc); background: #f0eaff; border-radius: 10px; padding: 4px 12px; }
.lv-num.lv-max { background: linear-gradient(135deg, #8e44ad, #c471ed); color: #fff; }
.lv-bar { flex: 1; min-width: 140px; height: 14px; background: #eceefb; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(43,45,66,.12); }
.lv-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6c5ce7, #a78bfa, #ff9a62); background-size: 200% 100%; animation: tlRainbow 3s linear infinite; transition: width .4s; }
.lv-xp { font-size: .82rem; color: var(--sub); font-weight: 700; white-space: nowrap; }

/* ===== 称号墙 ===== */
.tw-cat { border: 2px solid var(--line); border-radius: 14px; padding: 13px 15px; margin-bottom: 12px; background: #fbfbff; }
.tw-cat.on { border-color: var(--acc); background: #f6f4ff; box-shadow: 0 0 0 3px rgba(108,92,231,.12); }
.tw-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tw-emoji { font-size: 1.15rem; }
.tw-desc { font-size: .78rem; color: var(--sub); }
.tw-cur { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.tw-lv { font-size: .78rem; color: var(--sub); font-weight: 700; }
.tw-next { font-size: .76rem; color: #b0b4c8; margin-left: auto; }
.tw-btns { margin-top: 9px; display: flex; gap: 8px; }

@media (max-width: 600px) {
  .wrap { padding: 12px 12px 50px; }
  .hero { padding: 18px 16px; }
  .hero h1 { font-size: 1.2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-title { font-size: .95rem; }
  .work-title { font-size: 1.15rem; }
}
