/* 个人空间 · 复古 QQ 空间风 */
:root {
  --blue: #2f7fd6;
  --blue-d: #1d5fa8;
  --blue-l: #7fc0f5;
  --sky: #eaf6ff;
  --card: #ffffff;
  --line: #d8e9f7;
  --text: #21384f;
  --muted: #7592ad;
  --pink: #ff7ba9;
  --ok: #16a34a;
  --shadow: 0 6px 20px rgba(40, 110, 180, .12);
  --radius: 16px;
  --bg1: #cfeaff; --bg2: #eaf6ff; --bg3: #f6fbff;
  --top1: #4aa3ec; --top2: #2f7fd6; --top3: #1f6bbd;
  --cloud: rgba(255,255,255,.75);
  --deco: rgba(120,190,250,.35);
  --inbg: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 30%, var(--bg3) 100%);
  min-height: 100vh;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  transition: background .25s;
}

/* 背景云朵和星星 */
.bg-deco { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.cloud {
  position: absolute; width: 140px; height: 46px; border-radius: 40px;
  background: var(--cloud); filter: blur(1px);
  box-shadow: 40px 8px 0 -6px var(--cloud), -38px 10px 0 -8px var(--cloud);
}
.cloud.c1 { top: 90px; left: 6%; animation: drift 26s ease-in-out infinite; }
.cloud.c2 { top: 190px; right: 8%; transform: scale(.8); animation: drift 32s ease-in-out infinite reverse; }
.cloud.c3 { top: 420px; left: 42%; transform: scale(.62); opacity: .7; animation: drift 38s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translateX(0); } 50% { transform: translateX(26px); } }
.star { position: absolute; width: 8px; height: 8px; background: #fff; border-radius: 50%; opacity: .8; }
.star.s1 { top: 60px; right: 30%; }
.star.s2 { top: 140px; left: 22%; }
.star.s3 { top: 300px; right: 12%; width: 5px; height: 5px; }
.star.s4 { top: 520px; left: 8%; width: 6px; height: 6px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 56px);
  background: linear-gradient(135deg, var(--top1) 0%, var(--top2) 55%, var(--top3) 100%);
  color: #fff; box-shadow: 0 4px 18px rgba(30,100,170,.3);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.brand-t { font-size: 15.5px; font-weight: 700; letter-spacing: 0; }
@media (max-width: 700px) { .brand-t { font-size: 12.5px; } }
.logo {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.5); font-size: 16px;
}
.tbtn {
  border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: #fff;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.tbtn:hover { background: rgba(255,255,255,.3); }
.hidden { display: none !important; }

/* 主体 */
.wrap { position: relative; z-index: 1; width: min(760px, 100%); margin: 0 auto; padding: 20px 16px 0; flex: 1 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.loading, .empty { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px; }

/* 个人资料 */
.profile { display: flex; align-items: center; gap: 16px; padding: 20px; position: relative; overflow: hidden; }
.profile::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, var(--deco), transparent 70%);
}
.avatar {
  width: 72px; height: 72px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #bfe2ff, #7cbcf0); font-size: 34px; border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(40,110,180,.2);
}
.pinfo h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: .5px; color: var(--text); text-shadow: 0 1px 3px rgba(255,255,255,.7); }
.pinfo p { margin: 0 0 8px; color: var(--text); opacity: .85; font-size: 13px; text-shadow: 0 1px 2px rgba(255,255,255,.65); }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--text); font-weight: 600; }
.stats b { color: var(--blue-d); font-size: 14px; font-weight: 800; }
/* 有封面图时靠文字描边保证清晰 */
html[data-space-theme="midnight"] .pinfo h1,
html[data-space-theme="midnight"] .pinfo p { text-shadow: none; }

/* 导航 */
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.tab {
  border: 1px solid var(--line); background: var(--inbg); color: var(--muted);
  padding: 11px 6px; border-radius: 12px; font-size: 13px; font-family: inherit; cursor: pointer;
  transition: all .16s; font-weight: 600;
}
.tab:hover { border-color: var(--blue-l); color: var(--blue); }
.tab.on { background: linear-gradient(135deg, #4aa3ec, #2f7fd6); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(47,127,214,.3); }

/* 发布框 */
.compose .cmp-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; }
.compose .cmp-name { margin: -4px 2px 10px; font-size: 12.5px; color: var(--muted); }
.compose .cmp-name b { color: var(--text); }
.compose textarea {
  width: 100%; min-height: 86px; resize: vertical; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #f8fcff; font-size: 13px; line-height: 1.7;
  font-family: inherit; color: var(--text); outline: none;
}
.compose textarea:focus, .compose input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,127,214,.12); }
.compose input, .row input, .g-replybox input, .cmt-form input {
  width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: #f8fcff; font-size: 13px; font-family: inherit; color: var(--text); outline: none;
}
.cmp-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cmp-foot .pick { margin-right: auto; }
/* 添加按钮 + 展开菜单 */
.addwrap { position: relative; margin-right: auto; }
.addmenu {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 25;
  display: grid; grid-template-columns: repeat(2, minmax(104px, 1fr)); gap: 6px;
  padding: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 30px rgba(20,60,110,.18);
}
.additem {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--inbg); color: var(--text);
  font-size: 12.5px; font-family: inherit; cursor: pointer; text-align: left;
}
.additem:hover { border-color: var(--blue-l); color: var(--blue); background: var(--sky); }
.imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumb { font-size: 11px; color: var(--muted); background: var(--sky); border: 1px dashed var(--blue-l); padding: 4px 8px; border-radius: 8px; }
.thumbimg { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--blue-l); color: var(--blue); font-size: 12.5px; cursor: pointer; background: #f2faff;
}
.pick:hover { background: #e6f4ff; }
.pick.big { justify-content: center; margin-top: 10px; width: 100%; padding: 16px; font-size: 13px; }
.btn {
  border: 1px solid var(--line); background: var(--inbg); color: var(--text); padding: 9px 16px; border-radius: 999px;
  font-size: 13px; cursor: pointer; font-family: inherit; transition: all .15s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn:hover { border-color: var(--blue-l); color: var(--blue); }
.btn.primary { background: linear-gradient(135deg, #4aa3ec, #2f7fd6); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(47,127,214,.28); }
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.small { padding: 7px 13px; font-size: 12px; }

/* 说说 */
.post .post-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.post-head b { color: var(--blue); font-size: 13px; }
.post-head time { margin-left: auto; }
.post-text { margin: 10px 0; font-size: 14px; line-height: 1.8; word-break: break-word; }
.pimgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pimgs img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.post-foot { display: flex; gap: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.like, .cmt-toggle { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 0; }
.like:hover, .cmt-toggle:hover { color: var(--blue); }
.like.on { color: var(--pink); font-weight: 700; }
.bulk {
  border: 1px dashed var(--blue-l); background: #eef7ff; color: var(--blue-d);
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 11px;
  cursor: pointer; font-family: inherit; margin-left: auto;
}
.bulk:hover { background: #e0f0ff; }
.cmts { margin-top: 10px; display: none; background: #f7fbff; border-radius: 12px; padding: 10px 12px; }
.cmts.on { display: block; }
/* 评论列表限高约 10 条，超出用右侧滑块上下翻 */
.cmt-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.cmt-list::-webkit-scrollbar { width: 6px; }
.cmt-list::-webkit-scrollbar-track { background: transparent; }
.cmt-list::-webkit-scrollbar-thumb { background: rgba(47,127,214,.32); border-radius: 3px; }
.cmt-list::-webkit-scrollbar-thumb:hover { background: rgba(47,127,214,.52); }
.cmt-empty { font-size: 12px; color: var(--muted); padding: 2px 0 6px; }
.cmt-tools { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.admintools { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 8px 12px; }
.cmt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 12.5px; margin-bottom: 8px; }
.cmt b { color: var(--blue); }
.cmt span { color: var(--text); word-break: break-word; }
.cmt time { margin-left: auto; color: var(--muted); font-size: 11px; }
.cmt .delc { border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.cmt-form { display: flex; gap: 6px; margin-top: 6px; }
.cmt-form .cmt-name { width: 90px; flex: 0 0 auto; }
.cmt-form .cmt-text { flex: 1 1 auto; }
.delp { border: 0; background: none; color: #e26b6b; font-size: 11.5px; cursor: pointer; margin-left: 8px; }

/* 留言板 */
.guest .g-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.g-head b { color: var(--blue); }
.g-head time { margin-left: auto; }
.g-text { margin: 10px 0 0; font-size: 13.5px; line-height: 1.8; word-break: break-word; }
.g-reply { margin-top: 8px; padding: 8px 10px; background: #f1f9ff; border-left: 3px solid var(--blue-l); border-radius: 0 8px 8px 0; font-size: 12.5px; }
.g-replybox { display: flex; gap: 6px; margin-top: 10px; }
.ava { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e6f4ff; }
.ava.sm { width: 26px; height: 26px; font-size: 14px; }

/* 相册 */
.algrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.alcard { position: relative; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; }
.alcard img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.nocover { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--blue-l); background: #eef8ff; }
.alinfo { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; font-size: 12.5px; }
.alinfo b { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alinfo span { color: var(--muted); font-size: 11.5px; }
.aldel { position: absolute; right: 8px; top: 8px; border: 0; background: rgba(0,0,0,.45); color: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11px; cursor: pointer; }
.albumhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.albumhead .muted { font-size: 12px; }
.albumhead .pick { margin-left: auto; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pcell { position: relative; }
.pcell img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.pdel { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 13px; cursor: pointer; line-height: 1; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }

/* 小工具 */
.tool { display: flex; align-items: center; gap: 12px; }
.fico {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #dff1ff, #b9ddff); color: var(--blue-d); font-size: 11px; font-weight: 800;
}
.tinfo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tinfo b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tinfo span { font-size: 11.5px; color: var(--muted); }

/* 大图 */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(8,20,32,.94); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 8px; }
.vclose, .vprev, .vnext { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; border-radius: 50%; font-size: 22px; line-height: 1; }
.vclose { right: 18px; top: 18px; width: 40px; height: 40px; }
.vprev, .vnext { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; }
.vprev { left: 14px; }
.vnext { right: 14px; }
.vcount { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: 13px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10,30,50,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { width: min(420px, 100%); background: var(--card); border-radius: 18px; padding: 20px; box-shadow: 0 24px 60px rgba(10,40,70,.3); }
.modal-box h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.modal-box input { width: 100%; margin-top: 10px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; font-family: inherit; outline: none; }
.modal-box textarea { width: 100%; margin-top: 10px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--inbg); color: var(--text); font-size: 13px; font-family: inherit; outline: none; resize: vertical; }
.macts { display: flex; gap: 8px; margin-top: 14px; }
.macts .btn { flex: 1; justify-content: center; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(20,40,60,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 70;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.foot { text-align: center; color: var(--muted); font-size: 11.5px; padding: 10px 0 4px; }
.icp { position: relative; z-index: 2; flex: 0 0 auto; text-align: center; font-size: 11.5px; padding: 18px 16px 22px; }
.icp a { color: var(--muted); text-decoration: none; transition: color .2s; }
.icp a:hover { color: var(--text, #fff); text-decoration: underline; }

@media (max-width: 600px) {
  .wrap { padding: 14px 12px 0; }
  .profile { padding: 16px; }
  .avatar { width: 60px; height: 60px; font-size: 28px; }
  .pinfo h1 { font-size: 18px; }
  .tabs { gap: 5px; }
  .tab { padding: 9px 2px; font-size: 11px; }
  .pgrid, .pimgs { grid-template-columns: repeat(3, 1fr); }
  .algrid { grid-template-columns: repeat(2, 1fr); }
  .cmt-form { flex-wrap: wrap; }
  .cmt-form .cmt-name { width: 100%; }
  .tool { flex-wrap: wrap; }
  .tool .btn, .tool .delp { margin-left: auto; }
  .searchbar { flex-wrap: wrap; }
  .mrow2 { flex-direction: column; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 新增：搜索 / 封面 / 踩一踩 / 可见性 / 音乐 / 日志 / 统计 ===== */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input {
  flex: 1; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--inbg); font-size: 13px; font-family: inherit; color: var(--text); outline: none;
}
.searchbar input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,127,214,.12); }

.profile.has-cover { background-size: cover; background-position: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.stepbtn {
  border: 1px dashed var(--blue-l); background: #f2faff; color: var(--blue-d); font-weight: 600;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.stepbtn:hover { background: #e6f4ff; }
.stepbtn:active { transform: scale(.97); }

.vis {
  padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--inbg); font-size: 12px; font-family: inherit; color: var(--text); outline: none;
}
.vis-tag { font-size: 10.5px; color: var(--blue); background: #eaf4ff; border-radius: 999px; padding: 2px 8px; }

.locked { text-align: center; color: var(--muted); font-size: 13px; }
.locked b { display: block; color: var(--text); margin-bottom: 8px; }
.locked .btn { margin: 10px auto 0; }
.locked time { display: block; margin-top: 8px; font-size: 11px; }
.lq { font-size: 12px; color: var(--text); background: var(--sky); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px auto 0; max-width: 380px; text-align: left; }
.alcard.locked .nocover { font-size: 24px; }

.music {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--inbg); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px 6px 6px; box-shadow: 0 8px 24px rgba(30,90,150,.18);
}
.music button {
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, #4aa3ec, #2f7fd6); color: #fff; cursor: pointer; font-size: 12px;
}
.music span { font-size: 11.5px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logrow { position: relative; cursor: pointer; }
.logrow b { font-size: 15px; }
.logrow p { margin: 8px 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.logrow time { font-size: 11px; color: var(--muted); }
.logdetail h2 { margin: 12px 0 6px; font-size: 18px; }
.logdetail time { font-size: 11.5px; color: var(--muted); }
.logdetail .lbody { margin-top: 14px; font-size: 14px; line-height: 1.9; word-break: break-word; }
.logdetail .acts { display: flex; gap: 8px; margin-top: 16px; }

.sres { padding: 8px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); line-height: 1.7; }
.sres:last-child { border-bottom: 0; }
.trow { cursor: pointer; }

.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.statgrid div { background: #f4faff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.statgrid b { display: block; font-size: 18px; color: var(--blue); }
.statgrid span { font-size: 11px; color: var(--muted); }
.mlabel { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.mrow2 { display: flex; gap: 10px; }
.mrow2 > div { flex: 1; min-width: 0; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ===== 空间皮肤 ===== */
html[data-space-theme="pink"] {
  --blue: #e05a95; --blue-d: #b8447a; --blue-l: #ffb8d5; --sky: #fff2f8;
  --card: #fffbfd; --line: #f7d8e6; --text: #4a2740; --muted: #a87b93;
  --shadow: 0 6px 20px rgba(200,90,150,.14);
  --bg1: #ffe3ef; --bg2: #fff0f7; --bg3: #fffafd;
  --top1: #ff9ec4; --top2: #e05a95; --top3: #c2437c;
  --cloud: rgba(255,255,255,.7); --deco: rgba(255,170,205,.42);
  --inbg: #ffffff;
}
html[data-space-theme="forest"] {
  --blue: #2f9e63; --blue-d: #1f7a4a; --blue-l: #8fd3ab; --sky: #eefaf2;
  --card: #fbfefc; --line: #d4eddf; --text: #1e3b2b; --muted: #6b937d;
  --shadow: 0 6px 20px rgba(45,140,90,.14);
  --bg1: #dff5e7; --bg2: #eefaf2; --bg3: #f9fdfb;
  --top1: #59c08a; --top2: #2f9e63; --top3: #1f7a4a;
  --cloud: rgba(255,255,255,.7); --deco: rgba(120,210,160,.38);
  --inbg: #ffffff;
}
html[data-space-theme="sunset"] {
  --blue: #e8702f; --blue-d: #bf551d; --blue-l: #ffc49b; --sky: #fff5ec;
  --card: #fffdfb; --line: #f6ddc7; --text: #4a2e1b; --muted: #a87f5f;
  --shadow: 0 6px 20px rgba(220,120,50,.15);
  --bg1: #ffe2cb; --bg2: #fff3e8; --bg3: #fffcf8;
  --top1: #ffb36b; --top2: #f07a3c; --top3: #c85f28;
  --cloud: rgba(255,255,255,.66); --deco: rgba(255,180,120,.4);
  --inbg: #ffffff;
}
html[data-space-theme="dark"] {
  --blue: #6aa8ff; --blue-d: #3f7fe0; --blue-l: #3a5a8c; --sky: #1a2233;
  --card: rgba(28,34,48,.94); --line: #2e3a52; --text: #e6edf9; --muted: #8d9cb5;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --bg1: #0e1522; --bg2: #121a28; --bg3: #0f1623;
  --top1: #243352; --top2: #1a2438; --top3: #131a2a;
  --cloud: rgba(120,150,200,.10); --deco: rgba(90,140,220,.16);
  --inbg: #1a2233;
}
html[data-space-theme="dark"] input,
html[data-space-theme="dark"] textarea,
html[data-space-theme="dark"] select { background: #1a2233; color: #e6edf9; border-color: #2e3a52; }
html[data-space-theme="dark"] input::placeholder,
html[data-space-theme="dark"] textarea::placeholder { color: #7e8ca4; }
html[data-space-theme="dark"] .nocover { background: #1a2233; }
html[data-space-theme="dark"] .statgrid div { background: #1a2233; }
html[data-space-theme="dark"] .vis-tag { background: #22314a; }
html[data-space-theme="dark"] .pick:hover { background: #22314a; }

.skinwrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.skincard {
  border: 2px solid var(--line); border-radius: 14px; padding: 10px 8px 9px;
  text-align: center; cursor: pointer; background: var(--inbg); transition: all .15s;
}
.skincard:hover { transform: translateY(-1px); }
.skincard.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,127,214,.16); }
.skincard i { display: block; height: 26px; border-radius: 8px; margin-bottom: 8px; }
.skincard b { font-size: 12px; font-weight: 700; }
.skincard span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* 说说里的小头像 */
.ava { overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* 说说里的链接 / 附件 / 音乐 / 地点 */
.post-text a, .lbody a, .g-text a { color: var(--blue); text-decoration: underline; word-break: break-all; }
.patt, .plink {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; margin-right: 8px;
  padding: 8px 12px; border-radius: 10px; background: var(--sky); border: 1px solid var(--line);
  color: var(--text); font-size: 12.5px; text-decoration: none; word-break: break-all;
}
.patt i { font-style: normal; color: var(--muted); font-size: 11px; }
.patt:hover, .plink:hover { border-color: var(--blue-l); color: var(--blue); }
.pmusic {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px;
  border-radius: 12px; background: var(--sky); border: 1px solid var(--line); flex-wrap: wrap;
}
.pmusic span { font-size: 12.5px; }
.pmusic audio { height: 32px; flex: 1; min-width: 180px; max-width: 360px; }
.pplace { margin-top: 8px; font-size: 12px; color: var(--muted); }
.extras { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; background: var(--sky); border: 1px solid var(--line); font-size: 12px;
}
.chip i { font-style: normal; cursor: pointer; color: var(--muted); }
.chip i:hover { color: #c33; }

/* ===== 顶栏搜索 / 管理弹窗 ===== */
.topsearch { display: flex; gap: 6px; flex: 1; max-width: 340px; margin: 0 14px; }
.topsearch input {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.18);
  color: #fff; font-size: 12.5px; font-family: inherit; outline: none;
}
.topsearch input::placeholder { color: rgba(255,255,255,.72); }
.topsearch input:focus { background: rgba(255,255,255,.3); }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.mtabs { display: flex; gap: 6px; margin: 10px 0 4px; }
.mtab {
  flex: 1; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--inbg); color: var(--muted); font-size: 12.5px; font-family: inherit; cursor: pointer; font-weight: 600;
}
.mtab.on { border-color: var(--blue); color: var(--blue); background: var(--sky); }
.modal-box.wide { width: min(780px, 100%); max-height: 88vh; overflow: auto; }

/* 图片裁剪层 */
.cropmask {
  position: fixed; inset: 0; z-index: 66; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(10,30,50,.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cropbox {
  max-width: 96vw; padding: 18px; background: var(--card); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(10,40,70,.3); animation: popIn .24s cubic-bezier(.2,.9,.3,1.2);
}
.cropbox h3 { margin: 0 0 6px; font-size: 16px; }
.cropbox p.muted { margin: 0 0 10px; font-size: 12.5px; }
.cropstage {
  position: relative; overflow: hidden; margin: 0 auto; border-radius: 12px;
  background: #0b1020; touch-action: none; cursor: grab; user-select: none;
}
.cropstage.dragging { cursor: grabbing; }
.cropstage canvas { display: block; width: 100%; height: 100%; }
.cropzoom { display: flex; align-items: center; gap: 10px; margin: 12px 2px 2px; font-size: 12.5px; color: var(--muted); }
.cropzoom input[type=range] { flex: 1; accent-color: #7b6cf6; }

.card.sub { background: var(--sky); border-style: dashed; padding: 12px; }
.urow { display: flex; align-items: center; gap: 8px; padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.urow:last-child { border-bottom: 0; }
.umain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.umain time { font-size: 11px; color: var(--muted); }
.uacts { display: flex; gap: 5px; flex-shrink: 0; }
.utag { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; }
.utag.adm { background: #ffe9d6; color: #b25c16; }
.utag.usr { background: #e6f3ff; color: #1d63b0; }
.utag.off { background: #f0f0f3; color: #8a8a96; }
.btn.danger { color: #c33; border-color: #f0c8c8; }
.btn.danger:hover { background: #fff2f2; }

.lvlwrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lvl { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--inbg); }
.lvl b { font-size: 12.5px; }
.lvl ul { margin: 6px 0 0; padding-left: 16px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.lvl.visitor { border-color: #dbe6f2; }
.lvl.user { border-color: #cfe2f8; }
.lvl.admin { border-color: #f3cfa8; background: #fff9f2; }

.permrow { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.sw { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; background: #d9e3ee; border-radius: 999px; transition: .18s; }
.sw i:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; }
.sw input:checked + i { background: var(--blue); }
.sw input:checked + i:before { transform: translateX(18px); }

.loglist { max-height: 44vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; margin-top: 8px; }
.lrow { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.lrow:last-child { border-bottom: 0; }
.lrow .lt { color: var(--muted); flex: 0 0 auto; }
.lrow .la { color: var(--blue); font-weight: 600; flex: 0 0 auto; }
.lrow .ld { color: var(--text); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topsearch { order: 3; max-width: none; margin: 0; flex-basis: 100%; }
  .lvlwrap { grid-template-columns: 1fr; }
  .urow { flex-wrap: wrap; }
}

/* ============================================================
   设计系统 v2：五套皮肤 + 动效
   ============================================================ */
:root { --glow1: rgba(124,108,246,.26); --glow2: rgba(74,163,236,.22); }

html[data-space-theme="aurora"] {
  --blue:#5b6bf0; --blue-d:#4149c9; --blue-l:#a9b4ff; --sky:#eef1ff;
  --card:rgba(255,255,255,.88); --line:#e3e7fb; --text:#20264d; --muted:#737aa6;
  --shadow:0 12px 34px rgba(90,100,220,.16);
  --bg1:#e6e9ff; --bg2:#eef2ff; --bg3:#f8faff;
  --top1:#7b6cf6; --top2:#5a7cf0; --top3:#3f5fd0;
  --cloud:rgba(255,255,255,.62);
  --deco:rgba(140,150,255,.34);
  --inbg:rgba(255,255,255,.92);
  --glow1:rgba(124,108,246,.28); --glow2:rgba(74,163,236,.24);
}
html[data-space-theme="rose"] {
  --blue:#e0608e; --blue-d:#bf4570; --blue-l:#ffc0d5; --sky:#fff0f6;
  --card:rgba(255,255,255,.9); --line:#f7dfe8; --text:#47263a; --muted:#a87b90;
  --shadow:0 12px 34px rgba(220,110,150,.18);
  --bg1:#ffe4ee; --bg2:#fff1f6; --bg3:#fffafc;
  --top1:#ffb3c9; --top2:#e0608e; --top3:#c2477a;
  --cloud:rgba(255,255,255,.66);
  --deco:rgba(255,170,200,.4);
  --inbg:rgba(255,255,255,.93);
  --glow1:rgba(255,150,190,.3); --glow2:rgba(255,205,220,.28);
}
html[data-space-theme="mint"] {
  --blue:#2fa87a; --blue-d:#1e825c; --blue-l:#9ee5c5; --sky:#eefaf4;
  --card:rgba(255,255,255,.9); --line:#d9f0e4; --text:#1e3b2f; --muted:#6b9682;
  --shadow:0 12px 34px rgba(45,150,110,.16);
  --bg1:#e3f7ec; --bg2:#effbf5; --bg3:#f9fdfb;
  --top1:#8fe3c0; --top2:#2fa87a; --top3:#1e825c;
  --cloud:rgba(255,255,255,.62);
  --deco:rgba(130,220,180,.38);
  --inbg:rgba(255,255,255,.93);
  --glow1:rgba(120,220,180,.26); --glow2:rgba(90,190,220,.22);
}
html[data-space-theme="cream"] {
  --blue:#d9822b; --blue-d:#b5661b; --blue-l:#f5c998; --sky:#fff6e8;
  --card:rgba(255,255,255,.92); --line:#f5e2c8; --text:#4a3320; --muted:#a0835f;
  --shadow:0 12px 34px rgba(210,150,70,.16);
  --bg1:#ffeccf; --bg2:#fff6e8; --bg3:#fffcf6;
  --top1:#ffd9a0; --top2:#e79a4c; --top3:#c47a2c;
  --cloud:rgba(255,255,255,.6);
  --deco:rgba(255,190,130,.36);
  --inbg:rgba(255,255,255,.94);
  --glow1:rgba(255,200,140,.3); --glow2:rgba(255,170,190,.22);
}
html[data-space-theme="midnight"] {
  --blue:#6ee7ff; --blue-d:#3fb6d6; --blue-l:#2c6b85; --sky:#141b2e;
  --card:rgba(22,29,48,.9); --line:#26314a; --text:#e6ecfb; --muted:#8b98b8;
  --shadow:0 14px 40px rgba(0,0,0,.45);
  --bg1:#0b1020; --bg2:#0f1628; --bg3:#0b1120;
  --top1:#3a4f7a; --top2:#1b2540; --top3:#12172b;
  --cloud:rgba(110,231,255,.08);
  --deco:rgba(110,231,255,.16);
  --inbg:#141b2e;
  --glow1:rgba(110,231,255,.2); --glow2:rgba(124,92,255,.2);
}
html[data-space-theme="midnight"] input,
html[data-space-theme="midnight"] textarea,
html[data-space-theme="midnight"] select { background:#141b2e !important; color:#e6ecfb !important; border-color:#26314a !important; }
html[data-space-theme="midnight"] input::placeholder,
html[data-space-theme="midnight"] textarea::placeholder { color:#7c8aa8; }
html[data-space-theme="midnight"] .nocover,
html[data-space-theme="midnight"] .statgrid div { background:#141b2e; }
html[data-space-theme="midnight"] .vis-tag { background:#1d2a44; }
html[data-space-theme="midnight"] .utag.usr { background:#16304d; color:#8fd0ff; }
html[data-space-theme="midnight"] .utag.adm { background:#3a2a18; color:#ffc48a; }
html[data-space-theme="midnight"] .btn.danger { color:#ff8899; border-color:#4a2a33; }
html[data-space-theme="midnight"] .lvl.admin { background:#221a12; border-color:#4a3a22; }

/* 背景光晕 */
.bg-deco::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(38% 32% at 12% 6%, var(--glow1), transparent 70%),
    radial-gradient(42% 36% at 88% 16%, var(--glow2), transparent 72%),
    radial-gradient(30% 26% at 55% 92%, var(--glow1), transparent 75%);
  filter: blur(6px);
}

/* 顶栏流光 */
.topbar { background-size: 180% 180% !important; animation: topFlow 14s ease infinite; }
@keyframes topFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.topbar .tbtn { transition: transform .16s, background .16s, box-shadow .16s; }
.topbar .tbtn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }

/* 卡片入场与悬浮 */
.card { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .2s, box-shadow .2s, border-color .2s; }
.post, .alcard, .tool, .guest, .logrow { animation: cardIn .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.post:hover, .alcard:hover, .tool:hover, .logrow:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(30,90,150,.18); }
html[data-space-theme="midnight"] .post:hover,
html[data-space-theme="midnight"] .alcard:hover,
html[data-space-theme="midnight"] .tool:hover { box-shadow: 0 16px 44px rgba(0,0,0,.55); }

/* 按钮 / 标签 */
.btn, .pick, .tab { transition: transform .16s, box-shadow .16s, border-color .16s, background .16s, color .16s; }
.btn:hover, .pick:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--top1), var(--top2)); border-color: transparent; color: #fff; }
.btn.primary:hover { box-shadow: 0 10px 24px rgba(60,110,200,.28); }
.tab.on { background: linear-gradient(135deg, var(--top1), var(--top2)) !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 8px 20px rgba(60,110,200,.24); }
.like { transition: transform .12s; }
.like:active { transform: scale(1.18); }
.stepbtn:active { transform: scale(.94); }

/* 图片 */
.pimgs img, .pcell img { transition: transform .25s, filter .25s; }
.pimgs img:hover, .pcell img:hover { transform: scale(1.03); filter: brightness(1.04); }

/* 弹窗入场 */
.modal-box { animation: popIn .26s cubic-bezier(.2,.9,.3,1.2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }

/* 管理独立页 */
.adminpage { position: fixed; inset: 0; z-index: 40; background: linear-gradient(180deg, var(--bg1), var(--bg2) 40%, var(--bg3)); overflow: auto; }
.adm-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; color: #fff;
  background: linear-gradient(135deg, var(--top1), var(--top2) 55%, var(--top3));
  box-shadow: 0 6px 20px rgba(20,60,120,.25);
}
.adm-title { font-size: 16px; letter-spacing: 1px; }
.adm-tabs { margin-left: auto; display: flex; gap: 6px; }
.atab {
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.14); color: #fff;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: background .16s, transform .16s;
}
.atab:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.atab.on { background: #fff; color: var(--blue-d); border-color: #fff; font-weight: 700; }
.adm-body { max-width: 900px; margin: 0 auto; padding: 18px 16px 40px; }
.no-scroll { overflow: hidden; }

/* 音乐面板 */
.mctl { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.mctl .btn { flex: 1; justify-content: center; }
.mlist { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; background: var(--inbg); }
.mrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.mrow:last-child { border-bottom: 0; }
.mrow.on { color: var(--blue); font-weight: 700; }
.murl { flex: 1; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.madd { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.madd input { flex: 1; min-width: 120px; }

/* 视频 / 链接预览卡片 */
.pvideo { width: 100%; max-height: 420px; border-radius: 12px; margin-top: 8px; background: #000; display: block; }
.lcard {
  display: flex; gap: 10px; margin-top: 8px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--sky); text-decoration: none; color: var(--text);
  overflow: hidden; transition: transform .18s, border-color .18s;
}
.lcard img { width: 88px; height: 72px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.lcard div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lcard b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard span {
  font-size: 11.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.lcard i { font-style: normal; font-size: 11px; color: var(--blue); }
.lcard:hover { border-color: var(--blue-l); transform: translateY(-1px); }

/* ===== 页面壁纸 / 顶栏壁纸 ===== */
.pagewall {
  position: fixed; inset: 0; z-index: 0; display: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.pagewall.on { display: block; }
.pagewall::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.72));
}
html[data-space-theme="midnight"] .pagewall::after { background: linear-gradient(180deg, rgba(8,12,24,.55), rgba(8,12,24,.72)); }
.topbar.has-wall { background-size: cover !important; background-position: center !important; animation: none !important; }

/* ===== 登录欢迎轮播横幅 ===== */
.welcome {
  position: relative; z-index: 2; overflow: hidden; height: 32px; line-height: 32px;
  background: linear-gradient(90deg, rgba(74,163,236,.92), rgba(47,127,214,.9));
  color: #fff; font-size: 12.5px; letter-spacing: .3px;
  padding: 0 16px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.18);
}
.welcome #wMarquee {
  display: inline-block; white-space: nowrap; will-change: transform;
  animation: wLoop 120s linear infinite;
}
@keyframes wLoop {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== 个人简历全屏页 ===== */
.resumepage { position: fixed; inset: 0; z-index: 45; background: #0a192f; }
.resumepage iframe { width: 100%; height: 100%; border: 0; display: block; }
.resume-back {
  position: fixed; left: 14px; top: 14px; z-index: 46;
  background: rgba(10,25,47,.75) !important; border-color: rgba(255,255,255,.35) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* 音乐面板自动播放开关 */
.mauto { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }
.mrow .btn.small { flex-shrink: 0; }

/* ===== 模块布局 ===== */
.board { display: grid; grid-template-columns: repeat(24, 1fr); gap: 14px; align-items: start; }
.board > .module { min-width: 0; position: relative; grid-column: span 24; margin-bottom: 0; }
.board > .module.tall { overflow: auto; }
.board > .tabs { margin: 0; }
.board > .foot { margin: 0; padding-top: 6px; }
html[data-space-theme] .board > .module { transition: height .08s linear; }

@media (max-width: 700px) {
  .board { display: flex; flex-direction: column; }
  .board > .module { width: 100%; height: auto !important; grid-column: auto !important; }
}
