:root{
  --bg:#f3f7fc;
  --card:#fff;
  --text:#0f1f33;
  --muted:#64748b;
  --line:#e3eaf3;
  --primary:#2f6df6;
  --primary2:#1d4ed8;
  --accent:#2f6df6;
  --soft:#eef5ff;
  --dark:#0f172a;
  --danger:#dc2626;
  --ok:#16a34a;
  --shadow:0 22px 60px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif;background:linear-gradient(135deg,#eff6ff 0,#f8fbff 45%,#f4f7fb 100%);color:var(--text)}
a{text-decoration:none;color:inherit}button,input,textarea,select{font-family:inherit}.app{min-height:100vh}
.topbar{height:78px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50}
.top-inner{width:min(1500px,94vw);height:78px;margin:auto;display:grid;grid-template-columns:56px 260px minmax(320px,1fr) auto;align-items:center;gap:22px}
.menu-toggle{width:48px;height:48px;border-radius:16px;border:1px solid #dbe6f4;background:#fff;color:#0f172a;font-size:25px;font-weight:900;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 22px rgba(15,23,42,.06);cursor:pointer}
.menu-toggle:hover{background:#f8fafc}.brand{display:flex;align-items:center;gap:12px;font-size:26px;line-height:1.08;font-weight:1000;white-space:nowrap}.brand-logo{width:42px;height:42px;border-radius:50%;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:1000;box-shadow:0 12px 30px rgba(47,109,246,.25)}
.search-box{height:46px;display:flex;align-items:center;gap:10px;background:#f3f6fb;border:1px solid #e3eaf3;border-radius:999px;padding-left:20px;overflow:hidden}.search-box input{border:0;outline:0;background:transparent;width:100%;font-size:15px}.search-box button{height:46px;border:0;padding:0 26px;background:var(--primary);color:#fff;border-radius:999px;font-weight:900;cursor:pointer}.search-box button:hover,.nav .create:hover,.btn:hover{background:var(--primary2)}
.nav{display:flex;align-items:center;gap:18px;white-space:nowrap;font-weight:850}.nav a{color:#25364d}.nav .create{background:var(--primary);color:#fff;padding:11px 18px;border-radius:999px;box-shadow:0 12px 28px rgba(47,109,246,.18)}
.leftbar{position:fixed;left:0;top:78px;bottom:0;width:92px;background:rgba(255,255,255,.88);border-right:1px solid var(--line);z-index:40;display:flex;flex-direction:column;align-items:center;padding-top:18px;transition:transform .22s ease}.side-link{width:68px;min-height:68px;border-radius:17px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#1e293b;font-size:15px;font-weight:900;margin:5px 0}.side-link b{font-size:24px;line-height:1}.side-link:hover,.side-link.active{background:#eef5ff;color:#0f172a}
.main{margin-left:92px;transition:margin-left .22s ease}body.sidebar-closed .leftbar{transform:translateX(-100%)}body.sidebar-closed .main{margin-left:0}.container{width:min(1360px,92vw);margin:26px auto 48px}.notice{background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a;border-radius:18px;padding:14px 18px;margin-bottom:22px;font-weight:900}
.card{background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow)}.btn,button{border:0;background:var(--primary);color:#fff;padding:12px 18px;border-radius:14px;font-size:15px;font-weight:900;cursor:pointer}.btn.ghost,button.ghost{background:#e8eef6;color:#0f1f33}.btn.danger,button.danger{background:#ef4444}.btn.small,button.small{padding:8px 11px;border-radius:10px;font-size:13px}
input,textarea,select{width:100%;border:1px solid #ced8e6;border-radius:14px;padding:13px 15px;font-size:15px;background:#fff;outline:none}input:focus,textarea:focus,select:focus{border-color:#93b4ff;box-shadow:0 0 0 4px rgba(47,109,246,.09)}label{font-weight:900;color:#24364e}.form{display:grid;gap:15px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:15px}.error{background:#fef2f2;color:#dc2626;border:1px solid #fecaca;padding:12px 14px;border-radius:14px;margin-bottom:16px;font-weight:800}.muted{color:var(--muted)}
.footer{width:min(1360px,92vw);margin:30px auto;color:#64748b;display:flex;justify-content:space-between;gap:16px}table{width:100%;border-collapse:collapse;font-size:14px}th,td{padding:12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{background:#f8fafc}
.home-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:24px}.hero-card{padding:48px 52px;margin-bottom:24px}.hero-label{color:var(--primary);font-weight:1000;letter-spacing:.14em;font-size:15px;margin-bottom:14px}.hero-card h1{margin:0 0 18px;font-size:50px;line-height:1.12;letter-spacing:-1px}.hero-card p{margin:0;font-size:18px;line-height:1.9;color:#334155}.hero-actions{display:flex;gap:14px;margin-top:28px;flex-wrap:wrap}.post-panel,.page-card{padding:30px}.panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.panel-title h2{margin:0;font-size:28px}.panel-title a{color:#64748b;font-weight:900}.post-item{display:block;padding:18px 0;border-bottom:1px solid #edf2f7}.post-item:last-child{border-bottom:0}.tag{display:inline-flex;background:#e6efff;color:#1e40af;border-radius:999px;padding:5px 11px;font-size:13px;font-weight:1000;margin-bottom:8px}.post-item h3{margin:0 0 8px;font-size:22px}.post-meta{color:#64748b;font-size:14px;font-weight:900;margin-bottom:10px}.post-item p{margin:0;color:#334155;line-height:1.8}.side-card{padding:26px;margin-bottom:22px}.side-card h2{margin:0 0 18px;font-size:25px}.stat-box{background:#f8fbff;border:1px solid #e5edf7;border-radius:18px;padding:18px;margin-bottom:12px}.stat-box strong{display:block;font-size:34px;margin-bottom:4px}.feature-list{margin:0;padding-left:22px;color:#334155;line-height:2;font-size:16px}.quick-actions{display:grid;gap:12px}
.auth{width:min(620px,92vw);margin:60px auto;padding:44px}.auth h1,.page-card h1{font-size:44px;margin:0 0 24px}.resource-grid{display:grid;grid-template-columns:1.25fr .85fr;gap:24px}.resource-item,.comment,.message{background:#f8fbff;border:1px solid #e5edf7;border-radius:18px;padding:18px;margin:14px 0}.resource-actions{display:flex;gap:10px;flex-wrap:wrap}.admin-grid{display:grid;grid-template-columns:1fr;gap:22px}.admin-actions{display:flex;gap:8px;flex-wrap:wrap}.message-layout{display:grid;grid-template-columns:300px 1fr;gap:22px}.user-list a{display:block;padding:12px 14px;border-radius:14px;margin-bottom:8px;background:#f8fbff;border:1px solid #e5edf7}.bubble{max-width:72%;padding:12px 14px;border-radius:16px;margin:10px 0;background:#f1f5f9}.bubble.me{margin-left:auto;background:#dbeafe}
@media(max-width:1050px){.top-inner{grid-template-columns:56px 1fr}.search-box,.nav{grid-column:1/-1}.topbar{height:auto}.top-inner{height:auto;padding:12px 0}.leftbar{top:150px}.home-layout,.resource-grid,.message-layout{grid-template-columns:1fr}.hero-card h1{font-size:38px}.hero-card{padding:34px}}@media(max-width:760px){.main{margin-left:0}.leftbar{transform:translateX(-100%)}body.sidebar-open .leftbar{transform:translateX(0)}.container{width:94vw}.form-row{grid-template-columns:1fr}}


.msg-nav{position:relative}
.msg-dot,.side-dot,.unread-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:12px;
  font-weight:900;
  line-height:1;
}
.msg-dot{
  position:absolute;
  top:-9px;
  right:-14px;
}
.side-link{position:relative}
.side-dot{
  position:absolute;
  top:12px;
  right:10px;
}
.message-user-link{
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.message-user-link.active{
  border-color:#2563eb;
  background:#eff6ff;
}
