/* ================= 色彩系统（设计规范 §2） ================= */
:root{
  --bg:#0f0f14;            /* 主背景 */
  --card:#1a1a24;          /* 卡片背景 */
  --card2:#252532;         /* 次级背景：输入框/hover/分割 */
  --card3:#2f2f3e;         /* 更浅的 hover 态 */
  --primary:#7c3aed;       /* 主色 */
  --primary-soft:rgba(124,58,237,.16);
  --accent1:#6366f1;
  --accent2:#a855f7;
  --grad:linear-gradient(135deg,#6366f1 0%,#a855f7 100%);
  --text:#e8e8f0;          /* 主文字 */
  --text2:#9ca3af;         /* 次级文字 */
  --disabled:#4b5563;      /* 禁用文字 */
  --success:#10b981;
  --danger:#ef4444;
  --warn:#f59e0b;
  --info:#3b82f6;
  --radius:8px;
  --ease:cubic-bezier(.4,0,.2,1);
  --easeIn:ease-out;
  --easeIo:ease-in-out;
  --dur:250ms;
  --nav-h:60px;
  --safe-top:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{overscroll-behavior-y:none;
  background:var(--bg);
  color:var(--text);
  font-family:"Noto Sans SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
  font-size:16px;line-height:1.6;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
img{display:block;max-width:100%}
svg{display:block}
::selection{background:var(--primary);color:#fff}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#333342;border-radius:6px}
::-webkit-scrollbar-track{background:transparent}

/* ================= 通用组件 ================= */
.container{max-width:1240px;margin:0 auto;padding:0 20px}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  font-weight:700;font-size:14px;line-height:1;
  padding:11px 20px;border-radius:var(--radius);
  transition:transform 150ms var(--easeIn),background-color 200ms,box-shadow 200ms,color 200ms;
  user-select:none;white-space:nowrap;
}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--grad);color:#fff;box-shadow:0 6px 20px rgba(124,58,237,.35)}
.btn-primary:hover{filter:brightness(1.08);box-shadow:0 8px 26px rgba(124,58,237,.5)}
.btn-ghost{background:var(--card2);color:var(--text);border:1px solid #333342}
.btn-ghost:hover{background:var(--card3);border-color:#4b5563}
.btn-soft{background:var(--primary-soft);color:var(--accent2)}
.btn-soft:hover{background:rgba(124,58,237,.26)}
.btn-lg{padding:14px 26px;font-size:16px}
.btn-block{width:100%;justify-content:center}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none}

.chip{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12px;font-weight:500;color:var(--text2);
  background:var(--card2);border:1px solid #2c2c3a;
  padding:4px 10px;border-radius:999px;line-height:1.4;
}
.chip.primary{color:#c4b5fd;background:var(--primary-soft);border-color:rgba(124,58,237,.4)}
.chip.warn{color:#fbbf24;background:rgba(245,158,11,.14);border-color:rgba(245,158,11,.35)}
.chip.success{color:#34d399;background:rgba(16,185,129,.13);border-color:rgba(16,185,129,.35)}
.chip.info{color:#93c5fd;background:rgba(59,130,246,.13);border-color:rgba(59,130,246,.35)}
.chip.danger{color:#f87171;background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.35)}

.tag{font-size:12px;color:var(--text2);font-weight:500}
.card{background:var(--card);border:1px solid #24242f;border-radius:var(--radius)}
.card-hover{transition:transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease),border-color var(--dur) var(--ease)}
.card-hover:hover{transform:translateY(-4px);box-shadow:0 10px 30px rgba(0,0,0,.5);border-color:#3b3b4d}

.avatar{flex:0 0 auto;border-radius:50%;overflow:hidden;background:var(--card3);display:flex;align-items:center;justify-content:center}
.avatar img{width:100%;height:100%;object-fit:cover}
.dot-red{width:8px;height:8px;border-radius:50%;background:var(--danger);position:relative}
.dot-red::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid var(--danger);animation:pulse 2s infinite}
@keyframes pulse{0%{transform:scale(.7);opacity:1}70%{transform:scale(1.6);opacity:0}100%{opacity:0}}

.page-title{font-size:22px;font-weight:900;margin:6px 0 18px}
.page-title .grad{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.sec-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.sec-title h2{font-size:20px;font-weight:700;display:flex;align-items:center;gap:10px}
.sec-title h2::before{content:"";width:4px;height:18px;border-radius:2px;background:var(--grad)}
.sec-title .more{font-size:13px;color:var(--text2);display:inline-flex;align-items:center;gap:4px;transition:color 200ms}
.sec-title .more:hover{color:var(--accent2)}

/* ================= 顶部导航 ================= */
.topnav{
  position:fixed;top:0;left:0;right:0;height:calc(var(--nav-h) + var(--safe-top));padding-top:var(--safe-top);box-sizing:border-box;z-index:100;
  background:rgba(15,15,20,.86);backdrop-filter:blur(12px);
  border-bottom:1px solid #23232e;
}
.topnav .container{height:100%;display:flex;align-items:center;gap:26px}
.logo{display:flex;align-items:center;gap:10px;font-weight:900;font-size:18px;letter-spacing:.5px;flex:0 0 auto}
.logo svg{width:26px;height:26px}
.logo .grad{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.nav-links{display:flex;align-items:center;gap:4px;flex:0 0 auto}
.nav-links a{padding:8px 14px;font-size:14px;font-weight:500;color:var(--text2);border-radius:6px;transition:color 200ms,background 200ms}
.nav-links a:hover{color:var(--text);background:var(--card2)}
.nav-links a.active{color:#fff;background:var(--primary-soft)}
.search-box{flex:1;display:flex;align-items:center;gap:8px;background:var(--card2);border:1px solid #2c2c3a;border-radius:999px;padding:8px 14px;max-width:340px;transition:border-color 200ms,background 200ms}
.search-box:focus-within{border-color:var(--primary);background:var(--card)}
.search-box input{flex:1;background:none;border:none;outline:none;color:var(--text);font-size:14px;font-family:inherit}
.search-box input::placeholder{color:var(--disabled)}
.search-box svg{width:16px;height:16px;color:var(--text2);flex:0 0 auto}
.topnav-right{display:flex;align-items:center;gap:14px;flex:0 0 auto;margin-left:auto}
.bell{position:relative;width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--text2);transition:background 200ms,color 200ms}
.bell:hover{background:var(--card2);color:var(--text)}
.bell svg{width:20px;height:20px}
.bell .dot-red{position:absolute;top:8px;right:8px}
.nav-user{display:flex;align-items:center;gap:9px;padding:5px 8px;border-radius:999px;transition:background 200ms}
.nav-user:hover{background:var(--card2)}
.nav-user .avatar{width:32px;height:32px}
.nav-user .nu-name{font-size:13px;font-weight:600;line-height:1.1}
.nav-user .nu-lv{font-size:11px;color:var(--accent2)}
.hamburger{display:none;width:38px;height:38px;align-items:center;justify-content:center;color:var(--text2);border-radius:8px;transition:background 200ms}
.hamburger:hover{background:var(--card2)}

/* ================= 移动端抽屉菜单 ================= */
.drawer{position:fixed;top:0;left:0;bottom:0;width:270px;z-index:200;background:var(--card);border-right:1px solid #2c2c3a;transform:translateX(-100%);transition:transform 300ms var(--ease);display:flex;flex-direction:column;padding:18px}
.drawer.open{transform:translateX(0)}
.drawer-mask{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:190;opacity:0;pointer-events:none;transition:opacity 250ms}
.drawer-mask.open{opacity:1;pointer-events:auto}
.drawer .d-links{display:flex;flex-direction:column;gap:2px;margin-top:16px}
.drawer .d-links a{padding:12px 12px;font-size:15px;color:var(--text2);border-radius:8px;display:flex;align-items:center;gap:10px}
.drawer .d-links a:hover,.drawer .d-links a.active{background:var(--card2);color:#fff}
.drawer .d-links svg{width:18px;height:18px}

/* ================= Hero 轮播 ================= */
.hero-wrap{position:relative;border-radius:var(--radius);overflow:hidden;margin-top:calc(var(--nav-h) + 24px);height:320px;border:1px solid #24242f}
.hero-slide{position:absolute;inset:0;opacity:0;transition:opacity 500ms var(--easeIo);pointer-events:none}
.hero-slide.active{opacity:1;pointer-events:auto}
.hero-slide img{width:100%;height:100%;object-fit:cover;transform:scale(.98);transition:transform 500ms var(--easeIo)}
.hero-slide.active img{transform:scale(1)}
.hero-slide .shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,10,16,.92) 0%,rgba(10,10,16,.55) 45%,rgba(10,10,16,.15) 100%)}
.hero-slide .cap{position:absolute;left:40px;bottom:34px;max-width:560px}
.hero-slide .chip{margin-bottom:12px}
.hero-slide h1{font-size:30px;font-weight:900;line-height:1.25;margin-bottom:10px;color:#fff;text-shadow:0 2px 18px rgba(0,0,0,.5)}
.hero-slide p{font-size:15px;color:rgba(232,232,240,.86);line-height:1.6;max-width:480px}
.hero-slide .hero-actions{display:flex;gap:12px;margin-top:20px}
.hero-dots{position:absolute;bottom:18px;right:24px;display:flex;gap:8px;z-index:5}
.hero-dots .dot{width:8px;height:8px;border-radius:999px;background:rgba(255,255,255,.32);transition:all 300ms;cursor:pointer}
.hero-dots .dot.active{width:24px;background:#fff}
.hero-arrow{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:50%;background:rgba(10,10,16,.5);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;color:#fff;z-index:5;transition:background 200ms;border:1px solid rgba(255,255,255,.1)}
.hero-arrow:hover{background:rgba(124,58,237,.6)}
.hero-arrow.prev{left:16px}.hero-arrow.next{right:16px}
.hero-arrow svg{width:18px;height:18px}

/* ================= 首页布局 ================= */
.home-grid{display:grid;grid-template-columns:1fr 320px;gap:24px;padding:28px 0 60px}
.main-col{min-width:0}
.side-col{display:flex;flex-direction:column;gap:18px}

.board-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.board-card{padding:18px;display:flex;flex-direction:column;gap:12px;cursor:pointer}
.board-card .b-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;background:var(--grad);box-shadow:0 6px 16px rgba(124,58,237,.3)}
.board-card .b-icon svg{width:22px;height:22px}
.board-card h3{font-size:15px;font-weight:700}
.board-card .b-desc{font-size:12.5px;color:var(--text2);line-height:1.5;flex:1}
.board-card .b-meta{font-size:12px;color:var(--disabled);display:flex;align-items:center;gap:10px}

.post-list{display:flex;flex-direction:column;gap:12px}
.post-card{display:flex;gap:16px;padding:16px;align-items:center;cursor:pointer}
.post-card .p-main{flex:1;min-width:0}
.post-card .p-title{font-size:16px;font-weight:700;margin-bottom:8px;display:flex;align-items:center;gap:8px}
.post-card .p-title .ess{flex:0 0 auto}
.post-card .p-excerpt{font-size:13.5px;color:var(--text2);line-height:1.55;margin-bottom:10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.post-card .p-meta{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--disabled)}
.post-card .p-meta .author{display:flex;align-items:center;gap:6px;color:var(--text2);font-weight:500}
.post-card .p-meta .author .avatar{width:20px;height:20px}
.post-card .p-stat{display:flex;align-items:center;gap:14px;font-size:12px;color:var(--disabled);margin-left:auto;flex:0 0 auto}
.post-card .p-stat span{display:inline-flex;align-items:center;gap:5px}
.post-card .p-stat svg{width:15px;height:15px}
.post-card .p-cover{width:172px;height:104px;border-radius:6px;object-fit:cover;flex:0 0 auto;background:var(--card3)}
.post-card .p-cover.flat{display:none}

.side-card{padding:18px}
.side-card .sc-title{font-size:15px;font-weight:700;margin-bottom:14px;display:flex;align-items:center;gap:8px}
.side-card .sc-title svg{width:18px;height:18px;color:var(--accent2)}
.rank-list{display:flex;flex-direction:column;gap:12px}
.rank-item{display:flex;align-items:center;gap:10px}
.rank-item .r-idx{width:20px;height:20px;border-radius:6px;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;color:var(--text2);background:var(--card2);flex:0 0 auto}
.rank-item:nth-child(1) .r-idx{background:linear-gradient(135deg,#f59e0b,#ef4444);color:#fff}
.rank-item:nth-child(2) .r-idx{background:linear-gradient(135deg,#9ca3af,#6366f1);color:#fff}
.rank-item:nth-child(3) .r-idx{background:linear-gradient(135deg,#b45309,#f59e0b);color:#fff}
.rank-item .avatar{width:30px;height:30px}
.rank-item .r-info{flex:1;min-width:0}
.rank-item .r-info .r-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-item .r-info .r-score{font-size:11.5px;color:var(--disabled)}
.rank-item .r-follow{font-size:12px;color:var(--accent2);cursor:pointer;font-weight:600}
.rank-item .r-follow.done{color:var(--disabled)}
.tag-cloud{display:flex;flex-wrap:wrap;gap:8px}
.tag-cloud .tag-item{font-size:12.5px;color:var(--text2);background:var(--card2);padding:6px 12px;border-radius:999px;cursor:pointer;transition:all 200ms}
.tag-cloud .tag-item:hover{background:var(--primary-soft);color:#c4b5fd}
.notice-item{display:flex;gap:10px;padding:10px 0;border-bottom:1px dashed #262631;font-size:13px}
.notice-item:last-child{border-bottom:none}
.notice-item .n-dot{flex:0 0 auto;margin-top:7px}
.notice-item a{flex:1;color:var(--text2);line-height:1.5;transition:color 200ms}
.notice-item a:hover{color:var(--text)}

.stagger{opacity:0;transform:translateY(20px);animation:riseIn 400ms var(--ease) forwards}
@keyframes riseIn{to{opacity:1;transform:translateY(0)}}

/* ================= 版块列表页 ================= */
.filter-tabs{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:22px}
.filter-tabs .ft{font-size:14px;font-weight:500;color:var(--text2);padding:8px 18px;border-radius:999px;background:var(--card);border:1px solid #2c2c3a;cursor:pointer;transition:all 200ms}
.filter-tabs .ft:hover{color:var(--text);border-color:#4b5563}
.filter-tabs .ft.active{background:var(--grad);color:#fff;border-color:transparent;box-shadow:0 6px 18px rgba(124,58,237,.35)}
.board-big-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.board-big-card{display:flex;gap:16px;padding:20px;cursor:pointer}
.board-big-card .bb-icon{width:54px;height:54px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;flex:0 0 auto;background:var(--grad);box-shadow:0 8px 20px rgba(124,58,237,.35)}
.board-big-card .bb-icon svg{width:26px;height:26px}
.board-big-card .bb-main{flex:1;min-width:0}
.board-big-card h3{font-size:17px;font-weight:700;margin-bottom:6px;display:flex;align-items:center;gap:8px}
.board-big-card p{font-size:13px;color:var(--text2);line-height:1.55;margin-bottom:12px}
.board-big-card .bb-meta{display:flex;align-items:center;gap:16px;font-size:12px;color:var(--disabled)}
.board-big-card .bb-meta .post-ct{color:var(--text2)}
.board-big-card .bb-latest{font-size:12px;color:var(--disabled);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}

/* ================= 版块详情页 ================= */
.board-banner{position:relative;border-radius:var(--radius);overflow:hidden;height:170px;margin:calc(var(--nav-h) + 24px) 0 20px;display:flex;align-items:flex-end;border:1px solid #24242f}
.board-banner .bb-shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(20,14,40,.95),rgba(20,14,40,.55) 60%,rgba(10,10,16,.25))}
.board-banner .bb-inner{position:relative;padding:24px 28px;display:flex;align-items:center;gap:16px;width:100%}
.board-banner .bb-icon{width:54px;height:54px;border-radius:12px;background:var(--grad);display:flex;align-items:center;justify-content:center;color:#fff;box-shadow:0 8px 20px rgba(124,58,237,.4);flex:0 0 auto}
.board-banner .bb-icon svg{width:26px;height:26px}
.board-banner h1{font-size:24px;font-weight:900}
.board-banner .bb-desc{font-size:14px;color:var(--text2)}
.board-banner .bb-meta{display:flex;gap:18px;margin-top:8px;font-size:13px;color:var(--text2)}
.board-banner .btn{margin-left:auto}
.toolbar{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.toolbar .sort-chips{display:flex;gap:8px;flex:1}
.toolbar .sort-chips .chip{cursor:pointer;transition:all 200ms}
.toolbar .sort-chips .chip.active{color:#fff;background:var(--primary-soft);border-color:var(--primary)}
.toolbar .count{font-size:13px;color:var(--disabled)}

/* ================= 帖子详情页 ================= */
.post-detail{max-width:860px;margin:calc(var(--nav-h) + 24px) auto 60px;padding:0 20px}
.pd-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.pd-title{font-size:28px;font-weight:900;line-height:1.3;margin-bottom:16px}
.pd-author{display:flex;align-items:center;gap:14px;padding:16px;margin-bottom:20px}
.pd-author .avatar{width:48px;height:48px}
.pd-author .a-name{font-weight:700;font-size:15px}
.pd-author .a-lv{font-size:12px;color:var(--accent2);margin-bottom:2px}
.pd-author .a-meta{font-size:12px;color:var(--disabled)}
.pd-author .btn{margin-left:auto}
.rich-text{font-size:16px;line-height:1.7;color:#d5d5e0}
.rich-text p{margin-bottom:16px}
.rich-text .pd-cover{width:100%;max-height:420px;object-fit:cover;border-radius:8px;margin:8px 0 20px}
.rich-text .pd-quote{border-left:3px solid var(--primary);background:var(--card);padding:14px 18px;border-radius:0 8px 8px 0;margin:16px 0;color:var(--text2);font-size:14px}
.rich-text ul,.rich-text ol{padding-left:22px;margin:14px 0}
.rich-text li{margin-bottom:8px}
.pd-actions{display:flex;align-items:center;gap:10px;margin:24px 0;padding:14px 0;border-top:1px solid #262631;border-bottom:1px solid #262631}
.pd-action{display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border-radius:999px;background:var(--card2);font-size:13.5px;font-weight:600;color:var(--text2);transition:all 200ms}
.pd-action:hover{background:var(--card3);color:var(--text)}
.pd-action svg{width:16px;height:16px}
.pd-action.liked{color:#fff;background:var(--primary);animation:pop 300ms cubic-bezier(.2,1.5,.6,1)}
@keyframes pop{0%{transform:scale(1)}50%{transform:scale(1.3)}100%{transform:scale(1)}}
.pd-action.faved{color:var(--warn)}
.pd-tags{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:30px}
.reply-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.reply-head h2{font-size:18px;font-weight:700}
.reply-list{display:flex;flex-direction:column}
.reply-item{display:flex;gap:14px;padding:18px 0;border-bottom:1px solid #24242f}
.reply-item .avatar{width:38px;height:38px}
.reply-item .r-main{flex:1;min-width:0}
.reply-item .r-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.reply-item .r-name{font-size:14px;font-weight:600}
.reply-item .r-lv{font-size:11px;color:var(--accent2)}
.reply-item .r-time{font-size:11.5px;color:var(--disabled);margin-left:auto}
.reply-item .r-body{font-size:14.5px;color:#d5d5e0;line-height:1.65;margin-bottom:8px}
.reply-item .r-actions{display:flex;gap:16px;font-size:12px;color:var(--disabled)}
.reply-item .r-actions span{display:inline-flex;align-items:center;gap:5px;cursor:pointer;transition:color 200ms}
.reply-item .r-actions span:hover{color:var(--text)}
.reply-item .r-actions .r-likes.liked{color:var(--primary)}
.reply-input{display:flex;gap:12px;margin-top:24px;align-items:flex-start}
.reply-input .avatar{width:40px;height:40px}
.reply-input .ri-box{flex:1;display:flex;flex-direction:column;gap:10px}
.reply-input textarea{width:100%;min-height:96px;background:var(--card2);border:1px solid #2c2c3a;border-radius:8px;color:var(--text);font-family:inherit;font-size:14px;padding:14px;resize:vertical;transition:border-color 200ms;line-height:1.6}
.reply-input textarea:focus{outline:none;border-color:var(--primary)}
.reply-input .ri-row{display:flex;justify-content:flex-end}

/* ================= 发帖页 ================= */
.create-wrap{max-width:1100px;margin:calc(var(--nav-h) + 24px) auto 60px;padding:0 20px}
.create-head{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.create-head h1{font-size:24px;font-weight:900}
.create-layout{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.create-panel{display:flex;flex-direction:column;gap:16px}
.field label{display:block;font-size:13.5px;font-weight:600;color:var(--text2);margin-bottom:8px}
.field label .req{color:var(--danger)}
.select-input{position:relative}
.select-input select,.select-input input[type=text],.field input[type=text],.field textarea,.preview-input input[type=text]{
  width:100%;background:var(--card2);border:1px solid #2c2c3a;border-radius:8px;color:var(--text);font-family:inherit;font-size:14px;padding:12px 14px;transition:border-color 200ms,background 200ms;line-height:1.5}
.select-input select:focus,.field input:focus,.field textarea:focus,.preview-input input:focus{outline:none;border-color:var(--primary);background:var(--card)}
.select-input select{appearance:none;-webkit-appearance:none;cursor:pointer}
.select-input svg{position:absolute;right:14px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--text2);pointer-events:none}
.editor-toolbar{display:flex;gap:4px;padding:8px;background:var(--card);border:1px solid #2c2c3a;border-radius:8px 8px 0 0;flex-wrap:wrap}
.editor-toolbar .et{width:34px;height:34px;display:flex;align-items:center;justify-content:center;color:var(--text2);border-radius:6px;transition:all 150ms;background:none}
.editor-toolbar .et:hover{background:var(--card3);color:var(--text)}
.editor-toolbar .et.active{background:var(--primary-soft);color:var(--accent2)}
.editor-toolbar .et svg{width:17px;height:17px}
.editor-area{background:var(--card2);border:1px solid #2c2c3a;border-top:none;border-radius:0 0 8px 8px;min-height:280px;padding:16px;color:var(--text);font-family:inherit;font-size:15px;line-height:1.7;outline:none;transition:border-color 200ms}
.editor-area:focus{border-color:var(--primary)}
.create-submit-row{display:flex;align-items:center;gap:12px;margin-top:6px}
.create-submit-row .tip{font-size:12px;color:var(--disabled)}
.preview-panel{position:sticky;top:calc(var(--nav-h) + 20px);align-self:start}
.preview-panel .preview-box{background:var(--card);border:1px solid #24242f;border-radius:8px;overflow:hidden}
.preview-panel .pv-cover{width:100%;height:170px;object-fit:cover;display:block}
.preview-panel .pv-body{padding:20px}
.preview-panel .pv-title{font-size:20px;font-weight:800;margin-bottom:10px}
.preview-panel .pv-author{display:flex;align-items:center;gap:10px;font-size:12.5px;color:var(--disabled);margin-bottom:16px}
.preview-panel .pv-author .avatar{width:26px;height:26px}
.preview-panel .pv-content{font-size:14.5px;color:#cfcfdc;line-height:1.7}
.preview-panel .pv-content p{margin-bottom:10px}

/* ================= 搜索页 ================= */
.search-wrap{max-width:980px;margin:calc(var(--nav-h) + 24px) auto 60px;padding:0 20px}
.search-result-bar{display:flex;align-items:baseline;gap:10px;margin-bottom:20px;flex-wrap:wrap}
.search-result-bar b{font-size:22px;font-weight:900}
.search-result-bar span{font-size:13.5px;color:var(--text2)}
.sr-item{display:flex;gap:16px;padding:18px;margin-bottom:14px;cursor:pointer}
.sr-item .sr-main{flex:1;min-width:0}
.sr-item .sr-title{font-size:16.5px;font-weight:700;margin-bottom:8px}
.sr-item .sr-title .hl{color:var(--accent2);font-weight:900}
.sr-item .sr-sum{font-size:13.5px;color:var(--text2);line-height:1.55;margin-bottom:10px}
.sr-item .sr-meta{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--disabled)}
.sr-item .sr-cover{width:200px;height:112px;object-fit:cover;border-radius:6px;flex:0 0 auto;background:var(--card3)}

/* ================= 个人中心 ================= */
.profile-wrap{max-width:860px;margin:calc(var(--nav-h) + 24px) auto 60px;padding:0 20px}
.profile-hero{position:relative;border-radius:12px;overflow:hidden;padding:36px;margin-bottom:20px;border:1px solid #24242f}
.profile-hero .ph-bg{position:absolute;inset:0;background:linear-gradient(135deg,rgba(99,102,241,.28),rgba(168,85,247,.22) 60%,rgba(15,15,20,0));pointer-events:none}
.profile-hero .ph-inner{position:relative;display:flex;align-items:center;gap:22px;flex-wrap:wrap}
.profile-hero .avatar{width:88px;height:88px;border:3px solid var(--grad);box-shadow:0 0 0 4px var(--card)}
.profile-hero .ph-name{font-size:24px;font-weight:900;display:flex;align-items:center;gap:12px}
.profile-hero .lv-badge{font-size:12px;font-weight:700;color:#fff;background:var(--grad);padding:4px 12px;border-radius:999px}
.profile-hero .ph-tag{font-size:13.5px;color:var(--text2);margin-top:4px}
.profile-hero .ph-stats{display:flex;gap:34px;margin-top:14px}
.profile-hero .ph-stats .ps b{font-size:20px;font-weight:900;display:block}
.profile-hero .ph-stats .ps span{font-size:12.5px;color:var(--text2)}
.profile-hero .ph-actions{margin-left:auto;display:flex;gap:10px}
.profile-tabs{display:flex;gap:8px;margin-bottom:20px;border-bottom:1px solid #262631;padding-bottom:12px}
.profile-tabs .pt{font-size:14.5px;font-weight:600;color:var(--text2);padding:8px 18px;border-radius:8px;cursor:pointer;transition:all 200ms;position:relative}
.profile-tabs .pt:hover{color:var(--text)}
.profile-tabs .pt.active{color:#fff;background:var(--primary-soft)}
.profile-list{display:flex;flex-direction:column;gap:12px}
.profile-post{display:flex;gap:16px;padding:16px;cursor:pointer}
.profile-post .pp-main{flex:1;min-width:0}
.profile-post .pp-title{font-size:16px;font-weight:700;margin-bottom:8px}
.profile-post .pp-meta{display:flex;gap:16px;font-size:12px;color:var(--disabled)}

/* ================= 游戏库 ================= */
.games-wrap{max-width:1240px;margin:calc(var(--nav-h) + 24px) auto 60px;padding:0 20px}
.game-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.game-card{cursor:pointer;overflow:hidden}
.game-card .g-cover{position:relative;aspect-ratio:16/9;overflow:hidden}
.game-card .g-cover img{width:100%;height:100%;object-fit:cover;transition:transform 400ms var(--ease)}
.game-card:hover .g-cover img{transform:scale(1.06)}
.game-card .g-cover .g-type{position:absolute;top:10px;left:10px}
.game-card .g-body{padding:14px}
.game-card .g-name{font-size:15px;font-weight:700;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between}
.game-card .g-name .score{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--warn);font-weight:700}
.game-card .g-name .score svg{width:14px;height:14px;fill:currentColor}
.game-card .g-desc{font-size:12.5px;color:var(--text2);line-height:1.5;margin-bottom:10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.game-card .g-meta{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--disabled)}

/* ================= 游戏详情 ================= */
.game-detail{max-width:1060px;margin:calc(var(--nav-h) + 24px) auto 60px;padding:0 20px}
.game-hero{position:relative;border-radius:12px;overflow:hidden;height:360px;margin-bottom:20px;border:1px solid #24242f}
.game-hero img{width:100%;height:100%;object-fit:cover}
.game-hero .gh-shade{position:absolute;inset:0;background:linear-gradient(0deg,rgba(10,10,16,.95) 0%,rgba(10,10,16,.4) 55%,rgba(10,10,16,.1) 100%)}
.game-hero .gh-inner{position:absolute;left:0;right:0;bottom:0;padding:28px;display:flex;align-items:flex-end;gap:20px;flex-wrap:wrap}
.game-hero .gh-name{font-size:30px;font-weight:900;text-shadow:0 2px 16px rgba(0,0,0,.5)}
.game-hero .gh-meta{display:flex;gap:18px;margin-top:10px;font-size:14px;color:var(--text2);flex-wrap:wrap}
.game-hero .gh-score{display:flex;align-items:center;gap:6px;font-size:20px;font-weight:900;color:var(--warn)}
.game-hero .gh-score svg{width:20px;height:20px;fill:currentColor}
.game-hero .gh-actions{margin-left:auto;display:flex;gap:10px}
.game-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:24px}
.game-stat{padding:16px;text-align:center}
.game-stat b{font-size:22px;font-weight:900;display:block;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.game-stat span{font-size:12.5px;color:var(--text2)}
.game-sec{margin-bottom:28px}
.game-sec h2{font-size:18px;font-weight:700;margin-bottom:14px;display:flex;align-items:center;gap:10px}
.game-sec h2::before{content:"";width:4px;height:16px;border-radius:2px;background:var(--grad)}
.shots{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.shots img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:8px;cursor:pointer;transition:transform 300ms var(--ease)}
.shots img:hover{transform:scale(1.02)}
.related-posts{display:flex;flex-direction:column;gap:12px}
.related-post{display:flex;gap:14px;padding:14px;cursor:pointer}
.related-post .rp-cover{width:130px;height:78px;object-fit:cover;border-radius:6px;flex:0 0 auto;background:var(--card3)}
.related-post .rp-main{flex:1;min-width:0}
.related-post .rp-title{font-size:15px;font-weight:700;margin-bottom:6px}
.related-post .rp-meta{font-size:12px;color:var(--disabled)}

/* ================= 私信页 ================= */
.msg-wrap{max-width:1080px;margin:calc(var(--nav-h) + 24px) auto 60px;height:calc(100vh - var(--nav-h) - 80px);min-height:520px;display:grid;grid-template-columns:280px 1fr;border:1px solid #24242f;border-radius:12px;overflow:hidden;background:var(--card)}
.msg-list{display:flex;flex-direction:column;border-right:1px solid #24242f;overflow-y:auto;background:var(--card)}
.msg-list .ml-head{padding:18px;border-bottom:1px solid #24242f;font-size:16px;font-weight:700;display:flex;align-items:center;justify-content:space-between}
.msg-item{display:flex;gap:12px;padding:14px 16px;cursor:pointer;transition:background 200ms;border-bottom:1px solid #1f1f29}
.msg-item:hover{background:var(--card2)}
.msg-item.active{background:var(--card2)}
.msg-item .avatar{width:42px;height:42px}
.msg-item .mi-main{flex:1;min-width:0}
.msg-item .mi-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.msg-item .mi-name{font-size:14px;font-weight:600}
.msg-item .mi-time{font-size:11px;color:var(--disabled)}
.msg-item .mi-prev{font-size:12.5px;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-item .unread-dot{width:8px;height:8px;border-radius:50%;background:var(--danger);flex:0 0 auto;margin-top:14px;position:relative}
.msg-item .unread-dot::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid var(--danger);animation:pulse 2s infinite}
.msg-chat{display:flex;flex-direction:column;min-width:0}
.msg-chat .mc-head{padding:14px 20px;border-bottom:1px solid #24242f;display:flex;align-items:center;gap:12px;font-size:15px;font-weight:600}
.msg-chat .mc-head .avatar{width:34px;height:34px}
.msg-body{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:12px;background:#12121a}
.msg-bubble{max-width:70%;display:flex;flex-direction:column;gap:4px}
.msg-bubble .mb-time{font-size:10.5px;color:var(--disabled);padding:0 4px}
.msg-bubble.mine{align-self:flex-end;align-items:flex-end}
.msg-bubble.other{align-self:flex-start;align-items:flex-start}
.msg-bubble .mb-body{padding:11px 15px;font-size:14px;line-height:1.55;border-radius:12px}
.msg-bubble.mine .mb-body{background:var(--grad);color:#fff;border-bottom-right-radius:4px}
.msg-bubble.other .mb-body{background:var(--card2);color:var(--text);border-bottom-left-radius:4px}
.msg-input{display:flex;gap:12px;padding:14px 20px;border-top:1px solid #24242f;align-items:flex-end}
.msg-input textarea{flex:1;min-height:44px;max-height:120px;background:var(--card2);border:1px solid #2c2c3a;border-radius:10px;color:var(--text);font-family:inherit;font-size:14px;padding:11px 14px;resize:none;transition:border-color 200ms;line-height:1.5}
.msg-input textarea:focus{outline:none;border-color:var(--primary)}

/* ================= 登录注册 ================= */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:calc(var(--nav-h) + 20px) 20px 60px}
.auth-card{width:420px;max-width:100%;padding:36px;border-radius:16px;background:rgba(26,26,36,.72);backdrop-filter:blur(18px);border:1px solid #2c2c3a;box-shadow:0 24px 60px rgba(0,0,0,.5)}
.auth-card .auth-logo{display:flex;align-items:center;justify-content:center;gap:10px;font-size:20px;font-weight:900;margin-bottom:6px}
.auth-card .auth-sub{text-align:center;font-size:13px;color:var(--text2);margin-bottom:24px}
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;background:var(--card2);border-radius:8px;padding:4px;margin-bottom:24px}
.auth-tabs .at{text-align:center;padding:10px;font-size:14px;font-weight:600;color:var(--text2);border-radius:6px;cursor:pointer;transition:all 200ms}
.auth-tabs .at.active{background:var(--grad);color:#fff}
.auth-field{margin-bottom:16px}
.auth-field label{display:block;font-size:13.5px;font-weight:600;color:var(--text2);margin-bottom:7px}
.auth-field input{width:100%;background:var(--card);border:1px solid #2c2c3a;border-radius:8px;color:var(--text);font-family:inherit;font-size:14px;padding:12px 14px;transition:border-color 200ms}
.auth-field input:focus{outline:none;border-color:var(--primary)}
.auth-row{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--text2);margin-bottom:20px}
.auth-row label{display:flex;align-items:center;gap:7px;cursor:pointer}
.auth-row input{accent-color:var(--primary)}
.auth-row a:hover{color:var(--accent2)}
.auth-card .btn-block{margin-top:6px}
.auth-foot{text-align:center;font-size:12.5px;color:var(--disabled);margin-top:20px}
.auth-foot a{color:var(--accent2)}

/* ================= Toast ================= */
.toast-wrap{position:fixed;top:calc(var(--nav-h) + 14px);left:50%;transform:translateX(-50%);z-index:300;display:flex;flex-direction:column;gap:10px;align-items:center;pointer-events:none}
.toast{display:flex;align-items:center;gap:10px;background:var(--card);border:1px solid #333342;border-radius:10px;padding:12px 20px;font-size:14px;font-weight:600;box-shadow:0 12px 30px rgba(0,0,0,.5);animation:toastIn 300ms var(--ease),toastOut 300ms var(--ease) 2s forwards;pointer-events:auto}
.toast svg{width:18px;height:18px;flex:0 0 auto}
.toast.success{color:#34d399}.toast.success svg{color:var(--success)}
.toast.error{color:#f87171}.toast.error svg{color:var(--danger)}
.toast.info{color:#93c5fd}.toast.info svg{color:var(--info)}
@keyframes toastIn{from{opacity:0;transform:translateY(-14px)}to{opacity:1;transform:translateY(0)}}
@keyframes toastOut{to{opacity:0;transform:translateY(-14px)}}

/* 空态 */
.empty-state{text-align:center;padding:60px 20px;color:var(--text2)}
.empty-state svg{width:52px;height:52px;margin:0 auto 16px;color:var(--card3)}
.empty-state p{font-size:14px}

/* 移动端底部导航栏 */
.mobile-tabbar{display:none;position:fixed;bottom:0;left:0;right:0;z-index:150;background:rgba(15,15,20,.95);backdrop-filter:blur(12px);border-top:1px solid #2c2c3a;padding-bottom:env(safe-area-inset-bottom,0px)}
.mobile-tabbar .mt-inner{display:flex;justify-content:space-around;align-items:center;height:56px}
.mobile-tabbar a{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10.5px;color:var(--text2);flex:1;padding:6px 0;transition:color 200ms}
.mobile-tabbar a svg{width:22px;height:22px}
.mobile-tabbar a.active{color:#fff}
.mobile-tabbar a.active svg{color:var(--primary)}

/* ================= 响应式 ================= */
@media (max-width:1023px){
  .board-big-grid{grid-template-columns:1fr}
  .game-grid{grid-template-columns:repeat(3,1fr)}
  .create-layout{grid-template-columns:1fr}
  .preview-panel{position:static}
  .game-stats{grid-template-columns:repeat(2,1fr)}
  .shots{grid-template-columns:repeat(2,1fr)}
  .msg-wrap{grid-template-columns:1fr}
  .msg-list{display:none}
  .msg-list.show-list{display:flex;position:fixed;inset:0;z-index:150;background:var(--card)}
  .board-grid{grid-template-columns:repeat(3,1fr)}
  .home-grid{grid-template-columns:1fr}
  .side-col{display:none}
  .search-box{max-width:220px}
}
@media (max-width:767px){
  .nav-links{display:none}
  .hamburger{display:flex}
  .nav-user .nu-info{display:none}
  .search-box{max-width:42%;margin:0 4px;padding:6px 10px}
  .search-box input{font-size:12px}
  .topnav .container{gap:6px}
  .topnav{padding-top:max(env(safe-area-inset-top),20px) !important;height:calc(var(--nav-h) + max(env(safe-area-inset-top),20px)) !important;}
  .hero-wrap{margin-top:calc(var(--nav-h) + max(env(safe-area-inset-top),20px) + 14px) !important;}
  .search-wrap,.post-detail,.profile-wrap,.create-wrap,.games-wrap,.game-detail,.msg-wrap{margin-top:calc(var(--nav-h) + max(env(safe-area-inset-top),20px) + 14px) !important;}
  .topnav-right .bell{display:flex}
  .topnav-right .nav-user{display:none}
  .msg-input{padding-bottom:calc(14px + max(env(safe-area-inset-bottom),0px));padding-left:14px;padding-right:14px}
  .hero-wrap{height:200px;margin-top:calc(var(--nav-h) + var(--safe-top) + 14px)}
  .hero-slide .cap{left:20px;bottom:44px;max-width:88%}
  .hero-slide h1{font-size:21px}
  .hero-slide p{font-size:13px;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}
  .hero-slide .hero-actions{margin-top:12px}
  .hero-slide .hero-actions .btn{padding:9px 14px;font-size:13px}
  .hero-dots{bottom:12px;right:14px}
  .hero-arrow{display:none}
  .board-grid{grid-template-columns:repeat(2,1fr);gap:12px}
  .post-card{flex-direction:column;align-items:flex-start;gap:12px}
  .post-card .p-cover{width:100%;height:150px}
  .post-card .p-stat{margin-left:0}
  .home-grid{padding:20px 0 50px}
  .container{padding:0 14px}
  .game-grid{grid-template-columns:repeat(2,1fr)}
  .board-big-card{flex-direction:column;padding:16px}
  .profile-hero{padding:24px}
  .profile-hero .ph-actions{margin-left:0;margin-top:10px}
  .game-hero{height:240px}
  .game-hero .gh-actions{margin-left:0;margin-top:12px;width:100%}
  .game-hero .gh-actions .btn{flex:1;justify-content:center}
  .pd-title{font-size:22px}
  .create-head h1{font-size:20px}
  .hero-slide .hero-actions .btn-ghost{display:none}
  .hero-slide .hero-actions .btn-primary{display:inline-flex;padding:10px 16px;font-size:13px}
  .msg-wrap{min-height:calc(100vh - var(--nav-h) - 40px);height:calc(100vh - var(--nav-h) - 40px)}
  .game-hero .gh-name{font-size:24px}
  .mobile-tabbar{display:block}
  body{padding-bottom:calc(56px + env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
  .stagger{opacity:1;transform:none}
  .hero-slide img,.hero-slide.active img{transform:none}
}
