:root {
  --bg: #11111b;
  --bg-soft: #181825;
  --card: rgba(24, 24, 37, 0.82);
  --border: #313244;
  --border-soft: #45475a;
  --text: #cdd6f4;
  --muted: #7f849c;
  --faint: #585b70;
  --accent: #89b4fa;
  --accent-2: #cba6f7;
  --green: #a6e3a1;
  --red: #f38ba8;
  --yellow: #f9e2af;
  --radius: 14px;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(137, 180, 250, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(203, 166, 247, 0.06), transparent);
  color: var(--text);
  font: 15px/1.65 system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  margin: 0;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 4px;
  padding: 10px 22px;
  background: rgba(17, 17, 27, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.nav .brand { font-weight: 700; letter-spacing: 0.02em; margin-right: 14px; color: var(--text); white-space: nowrap; }
.nav .brand b { color: var(--accent); }
.nav a.nav-link, .nav button.nav-link {
  color: var(--muted); font-size: 13.5px; padding: 6px 11px; border-radius: 8px;
  background: none; border: none; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.nav a.nav-link:hover, .nav button.nav-link:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav a.nav-link.active { color: var(--accent); background: rgba(137, 180, 250, 0.1); }
.nav .spacer { flex: 1; }
.nav .who { color: var(--muted); font-size: 12.5px; padding: 0 8px; white-space: nowrap; }
.nav .who b { color: var(--accent-2); }
.lang-btn { font-size: 12px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-family: inherit; }
.lang-btn:hover { color: var(--text); border-color: var(--border-soft); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 28px 20px 80px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); padding: 22px;
}
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card h3 { margin: 18px 0 8px; font-size: 14.5px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--border-soft);
  border-radius: 9px; padding: 8px 15px; font: inherit; font-size: 13.5px; cursor: pointer;
  transition: 0.15s; text-decoration: none;
}
.btn:hover { background: #313244; text-decoration: none; }
.btn.primary { background: rgba(137, 180, 250, 0.16); border-color: var(--accent); color: var(--accent); }
.btn.primary:hover { background: rgba(137, 180, 250, 0.28); }
.btn.danger { border-color: var(--red); color: var(--red); background: rgba(243, 139, 168, 0.08); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 9px;
  color: var(--text); font: inherit; padding: 9px 12px; outline: none; transition: border 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
label.field { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
label.field:first-child { margin-top: 0; }

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12.5px; }
.err { color: var(--red); font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }
.ok { color: var(--green); font-size: 13px; margin: 8px 0 0; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--border-soft); color: var(--muted); margin-right: 6px; }
.pill.cat { color: var(--accent); border-color: rgba(137, 180, 250, 0.4); }
.pill.hidden-tag { opacity: 0.55; border-style: dashed; }

.hero { text-align: center; padding: 46px 20px 34px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: 0.02em; }
.hero h1 b { color: var(--accent); }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; }

.proj-card { display: block; color: var(--text); transition: transform 0.15s, border 0.15s; }
.proj-card:hover { transform: translateY(-2px); border-color: var(--border-soft); text-decoration: none; }
.proj-card .t { font-size: 15.5px; font-weight: 650; margin-bottom: 4px; }
.proj-card .d { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.proj-card .meta { margin-top: 10px; font-size: 12px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; }

.selector { display: grid; gap: 14px; }
.tag-group-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.tag-group-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tag-group-title .dot.sensitive { background: var(--red); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  font-size: 12.5px; padding: 4px 11px; border-radius: 99px; cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted);
  transition: 0.12s; user-select: none; font-family: inherit;
}
.tag-chip:hover { border-color: var(--border-soft); color: var(--text); }
.tag-chip.on { background: rgba(243, 139, 168, 0.12); border-color: var(--red); color: var(--red); }
.tag-chip.sensitive:not(.on) { border-style: dashed; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-size: 13.5px; padding: 9px 14px; cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadein 0.2s; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; } }

.ver-item { border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; margin-bottom: 12px; background: rgba(17, 17, 27, 0.4); }
.ver-item .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ver-item .v { font-weight: 650; font-size: 14.5px; }
.ver-item .stats { color: var(--faint); font-size: 12.5px; }
.changelog { color: var(--muted); font-size: 13px; margin-top: 8px; white-space: pre-wrap; border-left: 2px solid var(--border-soft); padding-left: 12px; }

.cmt { border-bottom: 1px solid var(--border); padding: 13px 0; }
.cmt:last-child { border-bottom: none; }
.cmt .who { font-size: 13px; }
.cmt .who b { color: var(--accent-2); }
.cmt .time { color: var(--faint); font-size: 11.5px; margin-left: 8px; }
.cmt .body { margin: 5px 0; font-size: 13.5px; white-space: pre-wrap; }
.cmt .acts { font-size: 12px; }

.rating { display: flex; align-items: center; gap: 10px; }
.rating .bar { width: 130px; height: 7px; border-radius: 99px; overflow: hidden; display: flex; background: var(--red); }
.rating .bar .up { background: var(--green); height: 100%; }
.rating .num { font-size: 12.5px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--bg-soft); border: 1px solid var(--accent); color: var(--text);
  border-radius: 10px; padding: 10px 20px; font-size: 13.5px; z-index: 99;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.mod-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mod-item:last-child { border-bottom: none; }
.mod-item .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-size: 15px; flex: none; }
.mod-item .nm { font-size: 13.5px; font-weight: 600; }
.mod-item .dt { font-size: 11.5px; color: var(--faint); }
.mod-item .sz { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.empty { text-align: center; color: var(--faint); padding: 40px 0; font-size: 13.5px; }

@media (max-width: 720px) {
  .nav { padding: 9px 12px; overflow-x: auto; }
  .wrap { padding: 18px 12px 60px; }
  .hero h1 { font-size: 24px; }
}

.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover;
  background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--accent);
  font-weight: 700; flex: none; user-select: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.md { width: 38px; height: 38px; font-size: 15px; }
.avatar.xl { width: 104px; height: 104px; font-size: 40px; }
.avatar-fallback { background: linear-gradient(135deg, rgba(137,180,250,0.25), rgba(203,166,247,0.25)); }

.nav-user { position: relative; }
.nav-avatar {
  background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%;
  display: inline-grid; place-items: center;
}
.nav-avatar .avatar { border-color: var(--accent); }
.nav-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; display: none;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav-user.open .nav-menu { display: block; }
.nav-menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.nav-menu-id { display: flex; flex-direction: column; min-width: 0; }
.nav-menu-id b { font-size: 13.5px; }
.nav-menu-id span { font-size: 11.5px; color: var(--muted); }
.nav-menu a, .nav-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 13px; padding: 9px 10px; border-radius: 8px; font-family: inherit;
}
.nav-menu a:hover, .nav-menu button:hover { background: var(--bg-soft); text-decoration: none; }
.nav-menu button.danger { color: var(--red); margin-top: 2px; }

.nav-badge {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #11111b; font-size: 10.5px; font-weight: 700;
  border-radius: 9px; margin-left: 5px; vertical-align: 2px;
}

.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.msg-side { padding: 16px; position: sticky; top: 76px; }
.msg-side-head h2 { font-size: 17px; }
.convo-list { margin-top: 10px; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.conv-item {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s;
}
.conv-item:hover { background: var(--bg-soft); }
.conv-item.active { background: rgba(137, 180, 250, 0.12); border-color: rgba(137, 180, 250, 0.35); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.conv-time { color: var(--faint); font-size: 11px; white-space: nowrap; }
.conv-last { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-item.unread .conv-last { color: var(--text); font-weight: 600; }
.conv-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--red); color: #11111b; font-size: 10.5px; font-weight: 700; border-radius: 9px; flex: none;
}

.msg-main { min-height: 60vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.msg-main > .empty { margin: auto 0; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-head .spacer { flex: 1; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; max-height: 56vh; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.bubble-row.mine { align-self: flex-end; align-items: flex-end; }
.bubble {
  background: var(--bg-soft); border: 1px solid var(--border); padding: 9px 13px;
  border-radius: 14px 14px 14px 4px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.bubble-row.mine .bubble {
  background: linear-gradient(135deg, rgba(137,180,250,0.28), rgba(137,180,250,0.16));
  border-color: rgba(137,180,250,0.4); border-radius: 14px 14px 4px 14px;
}
.bubble-time { font-size: 10.5px; color: var(--faint); margin-top: 4px; }
.chat-input { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input textarea {
  flex: 1; resize: none; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 13.5px;
}
.chat-input textarea:focus { outline: none; border-color: var(--accent); }

.profile-cover { position: relative; overflow: hidden; padding: 0; }
.cover-glow { position: absolute; inset: 0 0 auto; height: 130px; background: linear-gradient(135deg, rgba(137,180,250,0.22), rgba(203,166,247,0.14) 60%, transparent); pointer-events: none; }
.cover-main { position: relative; display: flex; gap: 22px; align-items: flex-end; padding: 34px 26px 20px; flex-wrap: wrap; }
.cover-avatar { position: relative; }
.cover-avatar .avatar.xl { border: 3px solid var(--bg-soft); box-shadow: var(--shadow); }
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #11111b; border: 3px solid var(--bg-soft); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.avatar-edit:hover { filter: brightness(1.1); }
.cover-info { flex: 1; min-width: 200px; }
.cover-info h1 { font-size: 24px; letter-spacing: 0.01em; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.level { color: var(--accent); border-color: rgba(137,180,250,0.4); background: rgba(137,180,250,0.1); }
.pill.admin { color: var(--yellow); border-color: rgba(249,226,175,0.4); background: rgba(249,226,175,0.08); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 4px 26px 24px; }
.stat-card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 12px; text-align: center;
}
.stat-card b { display: block; font-size: 21px; color: var(--text); }
.stat-card span { font-size: 11.5px; color: var(--muted); }

.tl-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; box-shadow: 0 0 10px rgba(137,180,250,0.6); }
.tl-body .v { font-weight: 600; font-size: 14px; }
.tl-body .stats { font-size: 12px; color: var(--muted); margin-top: 3px; }

@media (max-width: 860px) {
  .msg-layout { grid-template-columns: 1fr; }
  .msg-side { position: static; }
  .convo-list { max-height: 40vh; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .cover-main { flex-direction: column; align-items: flex-start; }
}

/* CIAOWAWA?! */
