* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --pink: #ff8fb5; --deep: #ef5f95; --purple: #8a63d2;
  --ink: #503a5c; --bg: #fff6fa;
}
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); overflow-x: hidden;
  transition: background .4s;
}

/* ===== 动态背景层（img标签，加载更可靠） ===== */
.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0; transition: opacity .6s;
  pointer-events: none; overflow: hidden;
}
.bg-layer img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: filter .4s;
}
.bg-layer.active { opacity: 1; }
.bg-mask {
  position: fixed; inset: 0; z-index: 0;
  background: rgba(255,246,250,.45);
  pointer-events: none; transition: background .4s;
}

#sakura { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,246,250,.88); backdrop-filter: blur(10px); border-bottom: 2px solid #ffd6e6; }
.bar-inner { display: flex; align-items: center; gap: 14px; height: 64px; }
.logo { font-size: 20px; font-weight: 800; color: var(--deep); text-decoration: none; white-space: nowrap; transition: .2s; }
.logo:hover { transform: scale(1.05); }
nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 500; transition: .2s; }
nav a:hover { background: #ffe3ee; color: var(--deep); transform: translateY(-1px); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; padding: 0; font-size: 18px; background: linear-gradient(135deg, #ffd6e6, #e9dcff); color: var(--ink); box-shadow: 0 2px 8px rgba(180,120,160,.2); transition: .25s; flex-shrink: 0; }
.icon-btn:hover { transform: rotate(15deg) scale(1.1); }

/* Banner */
.hero { position: relative; z-index: 2; margin: 18px auto 0; max-width: 1280px; padding: 0 24px; }
.hero img { width: 100%; height: 300px; object-fit: cover; border-radius: 24px; display: block; box-shadow: 0 12px 32px rgba(239,95,149,.25); background: #ffe9f2; }
.hero-title { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); background: #fff; border-radius: 18px; padding: 12px 36px; text-align: center; box-shadow: 0 8px 24px rgba(239,95,149,.22); white-space: nowrap; }
.hero-title h1 { color: var(--deep); font-size: 24px; }
.hero-title p { font-size: 13px; color: #9b7fa8; margin-top: 2px; }

/* ===== 大搜索栏（置于顶部，放大） ===== */
.big-search-wrap { margin-top: 56px; }
.big-search {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 3px solid #ffc9dd; border-radius: 999px;
  padding: 6px 8px 6px 24px;
  box-shadow: 0 8px 28px rgba(239,95,149,.18);
  transition: .25s;
}
.big-search:focus-within { border-color: var(--deep); box-shadow: 0 8px 32px rgba(239,95,149,.3); }
.bs-icon { font-size: 22px; flex-shrink: 0; }
.big-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 17px; padding: 12px 8px; color: var(--ink);
}
.big-search input::placeholder { color: #c5aec9; }
.big-search button {
  padding: 14px 36px; font-size: 17px; font-weight: 700;
  border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, var(--pink), var(--deep));
  box-shadow: 0 4px 14px rgba(239,95,149,.35);
}
.big-search button:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 20px rgba(239,95,149,.45); }
.hot-tags {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 0 8px; flex-wrap: wrap;
}
.hot-tags span { font-size: 13px; color: #9b7fa8; font-weight: 600; }
.hot-tags a {
  font-size: 13px; color: var(--deep); text-decoration: none;
  background: #ffe3ee; padding: 4px 14px; border-radius: 999px;
  transition: .2s; font-weight: 500;
}
.hot-tags a:hover { background: var(--deep); color: #fff; transform: translateY(-1px); }

/* ===== 状态栏（时钟/好感度/统计） ===== */
.status-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 28px;
}
.status-card {
  background: #fff; border-radius: 16px; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 4px 16px rgba(180,120,160,.12);
  border: 2px solid #ffe3ee;
}
.sc-icon { font-size: 32px; flex-shrink: 0; }
.sc-time { font-size: 24px; font-weight: 800; color: var(--deep); font-family: "Courier New", monospace; letter-spacing: 1px; }
.sc-date { font-size: 12px; color: #9b7fa8; margin-top: 2px; }
.sc-label { font-size: 13px; color: #8a7398; font-weight: 600; margin-bottom: 6px; }
.sc-sub { font-size: 12px; color: #9b7fa8; margin-top: 4px; }
.sc-sub b { color: var(--deep); font-size: 14px; }
.favor-bar {
  width: 100%; height: 10px; background: #ffe3ee; border-radius: 999px; overflow: hidden;
}
.favor-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--deep));
  transition: width .5s ease;
}

/* 布局 */
main.layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; margin-top: 36px; }
.articles { display: flex; flex-direction: column; gap: 18px; }
.post { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 20px rgba(180,120,160,.12); cursor: pointer; transition: .25s; border: 2px solid transparent; }
.post:hover { transform: translateY(-4px); border-color: #ffc9dd; box-shadow: 0 14px 30px rgba(239,95,149,.2); }
.post img { width: 100%; height: 240px; object-fit: cover; display: block; background: #ffe9f2; }
.post-body { padding: 16px 20px 18px; }
.post h3 { font-size: 19px; color: #3c2a48; }
.pin { margin-right: 4px; }
.excerpt { font-size: 13.5px; color: #8a7398; line-height: 1.7; margin-top: 8px; }
.meta { margin-top: 10px; font-size: 12.5px; color: #b39cbd; display: flex; gap: 12px; align-items: center; }
.tag { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; padding: 2px 12px; border-radius: 999px; font-size: 12px; }
.empty-tip { text-align: center; color: #b39cbd; padding: 40px 0; }

/* 卡片 */
.card { background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 6px 20px rgba(180,120,160,.12); }
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.profile { text-align: center; }
.avatar { width: 110px; height: 110px; border-radius: 50%; border: 4px solid #ffd6e6; box-shadow: 0 6px 16px rgba(239,95,149,.25); object-fit: cover; background: #ffe9f2; }
.profile h3 { margin-top: 10px; color: #3c2a48; }
.motto { font-size: 13px; color: #8a7398; margin-top: 8px; line-height: 1.7; font-style: italic; }
.stats { display: flex; justify-content: space-around; margin-top: 14px; border-top: 1px dashed #f3d3e2; padding-top: 12px; }
.stats b { display: block; font-size: 20px; color: var(--deep); }
.stats span { font-size: 12px; color: #b39cbd; }
.card h4 { color: #3c2a48; font-size: 16px; margin-bottom: 10px; }
button { cursor: pointer; border: 0; border-radius: 999px; padding: 8px 18px; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--pink), var(--deep)); transition: .2s; }
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.wide { width: 100%; }
.sec-btn { background: linear-gradient(135deg, #a78bfa, #7c6bd2); }
.btn-row { display: flex; gap: 8px; }
.btn-row button { flex: 1; }
#hitokoto { font-size: 14px; line-height: 1.8; color: #5c4a6b; min-height: 52px; }
.from { font-size: 12px; color: #b39cbd; margin: 6px 0 10px; text-align: right; }
#randImg { width: 100%; border-radius: 12px; display: block; margin-bottom: 10px; height: 170px; object-fit: cover; background: #ffe9f2; }
#dailyWaifu { width: 100%; border-radius: 12px; display: block; height: 200px; object-fit: cover; background: #ffe9f2; margin-bottom: 8px; }
.waifu-name { text-align: center; font-size: 14px; color: var(--deep); font-weight: 600; margin-bottom: 10px; }
.latest ul { list-style: none; }
.latest li { padding: 8px 0; border-bottom: 1px dashed #f3d3e2; font-size: 13.5px; cursor: pointer; color: #5c4a6b; }
.latest li:hover { color: var(--deep); }

/* 工具箱 */
.sec-title { margin: 58px 0 20px; font-size: 24px; color: #3c2a48; position: relative; padding-left: 14px; display: flex; align-items: center; gap: 10px; }
.sec-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 6px; border-radius: 6px; background: linear-gradient(180deg, var(--pink), var(--purple)); }

/* ===== 二次元风格图标徽章 ===== */
.acg-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #ffb3d1, #c4a0ff);
  box-shadow: 0 3px 12px rgba(239,95,149,.4), inset 0 1px 2px rgba(255,255,255,.5);
  font-size: 18px; transform: rotate(-6deg);
  transition: transform .3s, box-shadow .3s;
  flex-shrink: 0; border: 2px solid #fff;
}
.acg-badge:hover { transform: rotate(6deg) scale(1.12); box-shadow: 0 5px 18px rgba(239,95,149,.55); }
.sec-title .acg-badge { width: 40px; height: 40px; font-size: 20px; }
.card h4 .acg-badge { width: 28px; height: 28px; font-size: 14px; margin-right: 6px; }
.acg-badge-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(135deg, #ffe3ee, #e9dcff);
  font-size: 13px; margin-right: 4px; vertical-align: middle;
}
/* 导航栏图标 */
nav a .acg-badge { width: 22px; height: 22px; font-size: 12px; margin-right: 4px; transform: none; box-shadow: none; background: transparent; border: none; }
nav a:hover .acg-badge { transform: scale(1.2); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tool h4 { margin-bottom: 14px; }
.tool-desc { font-size: 13px; color: #8a7398; margin: -6px 0 12px; }
.lucky { font-size: 14px; line-height: 1.8; color: #5c4a6b; background: #fff4d9; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; min-height: 48px; }

/* 抽卡 */
.gacha-stage { height: 260px; border-radius: 14px; background: linear-gradient(135deg, #ffe3ee, #e9dcff); display: flex; align-items: center; justify-content: center; perspective: 900px; overflow: hidden; position: relative; }
.cardback { width: 150px; height: 200px; border-radius: 14px; background: linear-gradient(160deg, var(--purple), var(--pink)); color: #fff; font-size: 64px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(138,99,210,.4); transition: transform .55s; border: 4px solid rgba(255,255,255,.6); font-weight: 800; }
.gacha-stage.flipping .cardback { transform: rotateY(90deg); }
.gacha-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; transform: rotateY(90deg); transition: transform .55s; }
.gacha-stage.flipping .gacha-face { transform: rotateY(0); }
.gacha-face img { width: 150px; height: 200px; object-fit: cover; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 8px 24px rgba(0,0,0,.15); background: #ffe9f2; }
.wname { margin-top: 10px; font-weight: 700; font-size: 15px; }
.rSSR { color: #e8930c; text-shadow: 0 0 8px rgba(232,147,12,.4); } .rSR { color: #9b59b6; } .rR { color: #3f8fd2; }
.gacha-btns { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.g-btn2 { background: linear-gradient(135deg, #f6a623, #ef5f95); }
#gachaInfo { font-size: 12px; color: #b39cbd; text-align: center; margin-top: 10px; }
.gacha-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; justify-content: center; }
.gmini { width: 86px; text-align: center; font-size: 11px; color: #8a7398; }
.gmini img { width: 86px; height: 114px; object-fit: cover; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.12); display: block; background: #ffe9f2; }
.gmini .wn { display: block; margin-top: 3px; }
.gmini.rarity-SSR { animation: ssrGlow 1.5s ease-in-out infinite; border-radius: 10px; }
@keyframes ssrGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(232,147,12,0); } 50% { box-shadow: 0 0 16px 4px rgba(232,147,12,.5); } }

/* 弹幕 */
.dm-box { position: relative; height: 260px; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #1c1530, #3c2050); box-shadow: inset 0 0 40px rgba(0,0,0,.4); }
.dm { position: absolute; left: 100%; white-space: nowrap; font-size: 16px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.5); animation: dmfly linear forwards; }
@keyframes dmfly { from { left: 100%; } to { left: -50%; } }
.dm-input { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.dm-input input { flex: 1; min-width: 200px; border: 2px solid #ffc9dd; border-radius: 999px; padding: 10px 16px; font-size: 14px; outline: 0; }
#dmToggle { background: linear-gradient(135deg, #8a63d2, #5d8fd2); }

/* 追番表 */
.bangumi-bar { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 10px; }
.bg-source { font-size: 13px; color: #8a7398; }
.bg-source .live { color: #4caf50; font-weight: 600; }
.bg-refresh { padding: 6px 16px; font-size: 13px; background: linear-gradient(135deg, #8a63d2, #5d8fd2); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day { background: #fff; border-radius: 14px; padding: 12px 10px; box-shadow: 0 4px 14px rgba(180,120,160,.1); border-top: 4px solid #eee3ee; }
.day.today { border-top-color: var(--deep); background: #fff0f6; }
.day h5 { font-size: 14px; color: #3c2a48; text-align: center; margin-bottom: 8px; }
.bangumi-card {
  display: flex; gap: 8px; padding: 8px 6px; border-bottom: 1px dashed #f3e3ee;
  text-decoration: none; transition: .2s; border-radius: 8px; position: relative; cursor: pointer;
}
.bangumi-card:last-child { border-bottom: 0; }
.bangumi-card:hover { background: #fff5fa; transform: translateX(2px); }
.bangumi-card img { width: 42px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.1); background: #ffe9f2; }
.bangumi-card .bg-info { flex: 1; min-width: 0; }
.bangumi-card .bg-title { font-size: 12px; font-weight: 600; color: #3c2a48; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bangumi-card .bg-meta { font-size: 11px; color: #b39cbd; margin-top: 3px; }
.bangumi-card .bg-ep { font-size: 10px; color: var(--deep); background: #ffe3ee; padding: 1px 6px; border-radius: 4px; display: inline-block; margin-top: 2px; }
.bangumi-card .bg-time { font-size: 10px; color: #9b7fa8; }
.fav-star {
  position: absolute; top: 4px; right: 4px; font-size: 16px; cursor: pointer;
  z-index: 2; background: rgba(255,255,255,.85); border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  transition: .2s; line-height: 1;
}
.fav-star:hover { transform: scale(1.2); }
.fav-star.active { color: #ffb800; }
.cd-title { margin: 28px 0 12px; font-size: 16px; color: #3c2a48; }
.cds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cd { background: linear-gradient(135deg, #fff, #ffeef6); border-radius: 14px; padding: 14px; text-align: center; box-shadow: 0 4px 14px rgba(180,120,160,.1); }
.cd .t { font-size: 13.5px; color: #5c4a6b; margin-bottom: 8px; min-height: 38px; }
.cd .n { font-size: 22px; font-weight: 800; color: var(--deep); }
.cd .u { font-size: 11px; color: #b39cbd; margin-left: 2px; }
.cd small { display: block; margin-top: 8px; font-size: 11px; color: #c5aec9; }

/* ===== 番剧收藏夹 ===== */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.fav-item {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(180,120,160,.12); transition: .25s;
  border: 2px solid #ffe3ee; position: relative;
}
.fav-item:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(239,95,149,.2); }
.fav-item img { width: 100%; height: 120px; object-fit: cover; display: block; background: #ffe9f2; }
.fav-item-body { padding: 10px 12px; }
.fav-item-title { font-size: 13px; font-weight: 600; color: #3c2a48; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.fav-item-meta { font-size: 11px; color: #9b7fa8; display: flex; justify-content: space-between; align-items: center; }
.fav-remove { cursor: pointer; color: #ff6b6b; font-size: 12px; }
.fav-remove:hover { text-decoration: underline; }

/* B站 */
.bili-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bili-box input { flex: 1; min-width: 200px; border: 2px solid #ffc9dd; border-radius: 999px; padding: 10px 16px; font-size: 14px; outline: 0; }
.bili-links { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.bili-links a { font-size: 13px; color: var(--purple); text-decoration: none; background: #f1eaff; padding: 6px 14px; border-radius: 999px; transition: .2s; }
.bili-links a:hover { background: #e2d4ff; transform: translateY(-1px); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(40,20,50,.55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 20px; max-width: 760px; width: 100%; max-height: 82vh; overflow: auto; padding: 28px 30px; position: relative; }
.modal img { width: 100%; border-radius: 14px; margin: 14px 0; max-height: 400px; object-fit: cover; }
.modal h2 { color: #3c2a48; padding-right: 36px; }
.modal .meta { margin: 8px 0 4px; }
.modal p { font-size: 15px; line-height: 1.9; color: #5c4a6b; margin: 12px 0; }
.modal-close { position: absolute; top: 14px; right: 16px; background: #ffe3ee; color: var(--deep); width: 34px; height: 34px; padding: 0; font-size: 15px; }

/* 画廊 */
.gallery-sub { text-align: center; color: #8a7398; font-size: 14px; margin: -10px 0 22px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-item { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: 0 6px 18px rgba(180,120,160,.15); transition: .25s; background: #ffe9f2; aspect-ratio: 3 / 4; }
.gallery-item:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 30px rgba(239,95,149,.28); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .g-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(60,20,60,.75)); opacity: 0; transition: .25s; display: flex; align-items: flex-end; padding: 14px; }
.gallery-item:hover .g-overlay { opacity: 1; }
.gallery-item .g-title { color: #fff; font-size: 14px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* 壁纸库 */
.wallpaper-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.wallpaper-item { position: relative; border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: 0 4px 14px rgba(180,120,160,.15); transition: .25s; background: #ffe9f2; aspect-ratio: 16 / 10; }
.wallpaper-item:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 24px rgba(239,95,149,.3); }
.wallpaper-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wallpaper-item .wp-overlay { position: absolute; inset: 0; background: rgba(239,95,149,.7); opacity: 0; transition: .25s; display: flex; align-items: center; justify-content: center; }
.wallpaper-item:hover .wp-overlay { opacity: 1; }
.wallpaper-item .wp-text { color: #fff; font-size: 13px; font-weight: 700; text-align: center; }

/* ===== 二次元音乐盒 ===== */
.music-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.music-item {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 4px 14px rgba(180,120,160,.12);
  border: 2px solid #ffe3ee; text-decoration: none; transition: .25s;
}
.music-item:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(239,95,149,.2); border-color: #ffc9dd; }
.music-cover {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
}
.music-info { flex: 1; min-width: 0; }
.music-title { font-size: 14px; font-weight: 700; color: #3c2a48; margin-bottom: 3px; }
.music-anime { font-size: 12px; color: #9b7fa8; }
.music-play { font-size: 20px; flex-shrink: 0; }

/* ===== 二次元表情包墙 ===== */
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.emoji-item {
  border-radius: 12px; overflow: hidden; cursor: pointer;
  box-shadow: 0 4px 12px rgba(180,120,160,.12); transition: .25s;
  background: #fff; aspect-ratio: 1; border: 2px solid #ffe3ee;
}
.emoji-item:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 20px rgba(239,95,149,.25); z-index: 2; }
.emoji-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 画廊灯箱 */
.lightbox-mask { position: fixed; inset: 0; background: rgba(20,10,30,.92); z-index: 150; display: none; align-items: center; justify-content: center; padding: 40px; }
.lightbox-mask.show { display: flex; }
.lb-content { max-width: 90vw; max-height: 85vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-content img { max-width: 100%; max-height: 68vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); display: block; }
.lb-caption { color: #fff; font-size: 16px; font-weight: 600; text-align: center; }
.lb-setbg { background: linear-gradient(135deg, var(--pink), var(--purple)); padding: 8px 24px; font-size: 14px; }
.lb-close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; padding: 0; backdrop-filter: blur(6px); }
.lb-close:hover { background: rgba(255,255,255,.3); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 32px; padding: 0; line-height: 1; backdrop-filter: blur(6px); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.3); }

/* 主题切换按钮 */
.theme-btn { width: 38px; height: 38px; border-radius: 50%; padding: 0; font-size: 18px; background: linear-gradient(135deg, #ffd6e6, #e9dcff); color: var(--ink); box-shadow: 0 2px 8px rgba(180,120,160,.2); flex-shrink: 0; }
.theme-btn:hover { transform: rotate(20deg) scale(1.1); }

/* ===== 背景设置面板 ===== */
.bg-panel {
  position: fixed; top: 80px; right: 20px; z-index: 120;
  width: 280px; background: #fff; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(138,99,210,.25);
  border: 2px solid #ffd6e6; overflow: hidden;
  transform: translateX(320px); opacity: 0; transition: .35s cubic-bezier(.4,0,.2,1);
}
.bg-panel.show { transform: translateX(0); opacity: 1; }
.bg-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; font-weight: 700; font-size: 15px;
}
.bg-panel-close { background: rgba(255,255,255,.25); color: #fff; width: 28px; height: 28px; padding: 0; font-size: 13px; border-radius: 50%; }
.bg-panel-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.bg-panel-row { display: flex; flex-direction: column; gap: 6px; }
.bg-panel-row label { font-size: 13px; color: #8a7398; font-weight: 600; }
.bg-panel-row select {
  border: 2px solid #ffc9dd; border-radius: 10px; padding: 8px 12px;
  font-size: 13px; outline: 0; background: #fff6fa; color: var(--ink);
}
.bg-panel-row input[type="range"] { width: 100%; accent-color: var(--deep); }
.bg-panel-row span { font-size: 12px; color: #b39cbd; text-align: right; }
.bg-tip { font-size: 11px; color: #b39cbd; text-align: center; line-height: 1.5; }

/* ===== 看板娘（可拖拽 + 隐藏） ===== */
.waifu-box {
  position: fixed; right: 20px; bottom: 80px; z-index: 80;
  cursor: pointer; transition: transform .3s, opacity .3s;
  user-select: none; touch-action: none;
}
.waifu-box:hover { transform: translateY(-6px) scale(1.05); }
.waifu-box.dragging { transition: none; cursor: grabbing; transform: scale(1.05); }
.waifu-box.hidden { opacity: 0; pointer-events: none; transform: translateX(120%); }
.waifu-img { width: 120px; height: 160px; object-fit: cover; border-radius: 16px; border: 3px solid #fff; box-shadow: 0 8px 24px rgba(239,95,149,.35); display: block; background: #ffe9f2; }
.waifu-bubble {
  position: absolute; bottom: 100%; right: 0; margin-bottom: 10px;
  background: #fff; border-radius: 14px; padding: 10px 16px;
  font-size: 13px; color: var(--ink); max-width: 220px;
  box-shadow: 0 4px 16px rgba(180,120,160,.2); line-height: 1.6;
  opacity: 0; transform: translateY(8px); transition: .3s;
  pointer-events: none; white-space: normal;
}
.waifu-bubble::after { content: ""; position: absolute; bottom: -6px; right: 30px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); }
.waifu-box:hover .waifu-bubble, .waifu-box.show-bubble .waifu-bubble { opacity: 1; transform: translateY(0); }
.waifu-controls {
  position: absolute; top: -8px; left: -8px; display: flex; gap: 6px;
  opacity: 0; transition: .25s; z-index: 81;
}
/* 修复：移动端也能看到控制按钮 */
.waifu-box:hover .waifu-controls,
.waifu-box:active .waifu-controls { opacity: 1; }
@media (hover: none) {
  .waifu-controls { opacity: 1; top: -14px; }
}
.waifu-drag, .waifu-hide {
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  font-size: 14px; background: #fff; color: var(--deep);
  box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: grab;
}
.waifu-drag:active { cursor: grabbing; }
.waifu-hide { background: #ffe3ee; }
.waifu-show {
  position: fixed; right: 20px; bottom: 80px; z-index: 79;
  width: 52px; height: 52px; border-radius: 50%; padding: 0;
  font-size: 24px; background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 20px rgba(138,99,210,.4);
  opacity: 0; pointer-events: none; transform: scale(.5); transition: .3s;
}
.waifu-show.show { opacity: 1; pointer-events: auto; transform: scale(1); }
.waifu-show:hover { transform: scale(1.15) rotate(15deg); }

/* 鼠标跟随特效 */
.cursor-sparkle { position: fixed; pointer-events: none; z-index: 9999; font-size: 14px; animation: sparkleFade .8s ease-out forwards; }
@keyframes sparkleFade { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-120%) scale(.3) rotate(180deg); } }

/* 滚动渐入动画 */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* 夜间模式 */
body.dark { --bg: #1a1225; --ink: #e0d0e8; --pink: #ff8fb5; --deep: #ef5f95; --purple: #a78bfa; }
body.dark { background: var(--bg); color: var(--ink); }
body.dark .bg-mask { background: rgba(26,18,37,.55); }
body.dark .topbar { background: rgba(30,20,45,.88); border-bottom-color: #3d2a50; }
body.dark .logo { color: var(--pink); }
body.dark nav a { color: #c0b0d0; }
body.dark nav a:hover { background: #3d2a50; color: var(--pink); }
body.dark .big-search { background: #2a1e3a; border-color: #4d3a60; }
body.dark .big-search input { color: #e0d0e8; }
body.dark .hot-tags a { background: #3d2a50; color: var(--pink); }
body.dark .status-card, body.dark .card, body.dark .post, body.dark .day, body.dark .modal, body.dark .fav-item, body.dark .music-item { background: #2a1e3a; }
body.dark .status-card { border-color: #3d2a50; }
body.dark .post h3, body.dark .card h4, body.dark .sec-title, body.dark .modal h2, body.dark .day h5, body.dark .music-title { color: #f0e0f8; }
body.dark .excerpt, body.dark .motto, body.dark #hitokoto, body.dark .tool-desc, body.dark .modal p { color: #b0a0c0; }
body.dark .meta, body.dark .from, body.dark .latest li, body.dark .bg-source, body.dark .sc-date, body.dark .sc-label, body.dark .sc-sub, body.dark .music-anime { color: #9080a0; }
body.dark .hero-title { background: #2a1e3a; }
body.dark .hero-title p { color: #a090b0; }
body.dark .gacha-stage { background: linear-gradient(135deg, #3d2a50, #2a1e3a); }
body.dark .waifu-bubble { background: #2a1e3a; color: #e0d0e8; }
body.dark .waifu-bubble::after { background: #2a1e3a; }
body.dark .gallery-item .g-title { color: #fff; }
body.dark .bangumi-card .bg-title { color: #f0e0f8; }
body.dark .bangumi-card:hover { background: #3d2a50; }
body.dark footer { background: linear-gradient(180deg, transparent, #2a1e3a); color: #807090; }
body.dark .lucky { background: #3d3020; color: #e0d0c0; }
body.dark .empty-tip { color: #807090; }
body.dark .modal-mask, body.dark .lightbox-mask { background: rgba(10,5,20,.85); }
body.dark .bg-panel { background: #2a1e3a; border-color: #4d3a60; }
body.dark .bg-panel-row label { color: #b0a0c0; }
body.dark .bg-panel-row select { background: #3d2a50; color: #e0d0e8; border-color: #4d3a60; }
body.dark .waifu-name { color: var(--pink); }
body.dark .fav-item { border-color: #3d2a50; }
body.dark .fav-item-title { color: #f0e0f8; }
body.dark .music-item { border-color: #3d2a50; }
body.dark .emoji-item { background: #2a1e3a; border-color: #3d2a50; }
body.dark .fav-star { background: rgba(42,30,58,.85); }

/* 杂项 */
#toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 80px); background: rgba(60,42,72,.92); color: #fff; padding: 12px 26px; border-radius: 999px; font-size: 14px; z-index: 200; opacity: 0; transition: .3s; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toTop { position: fixed; right: 26px; bottom: 26px; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; font-size: 20px; z-index: 90; display: none; box-shadow: 0 8px 20px rgba(138,99,210,.4); padding: 0; }
footer { margin-top: 70px; padding: 30px 0 42px; text-align: center; color: #b39cbd; font-size: 13px; background: linear-gradient(180deg, transparent, #ffe3ee); position: relative; z-index: 2; }
.foot-sub { font-size: 11px; margin-top: 6px; color: #c5aec9; }

@media (min-width: 1600px) {
  .wrap { max-width: 1400px; }
  .hero { max-width: 1400px; }
  main.layout { grid-template-columns: 1fr 380px; }
}

@media (max-width: 1100px) {
  .wallpaper-grid { grid-template-columns: repeat(4, 1fr); }
  .emoji-grid { grid-template-columns: repeat(5, 1fr); }
  .status-bar { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  main.layout { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
  .cds { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .wallpaper-grid { grid-template-columns: repeat(3, 1fr); }
  .emoji-grid { grid-template-columns: repeat(4, 1fr); }
  nav { display: none; }
  .big-search { padding: 4px 6px 4px 18px; }
  .big-search input { font-size: 15px; padding: 10px 6px; }
  .big-search button { padding: 12px 24px; font-size: 15px; }
}
@media (max-width: 560px) {
  .week { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .wallpaper-grid { grid-template-columns: repeat(2, 1fr); }
  .emoji-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-title { white-space: normal; width: 86%; padding: 10px 16px; bottom: -40px; }
  .hero-title h1 { font-size: 18px; }
  main.layout { margin-top: 36px; }
  .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 24px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .bg-panel { width: calc(100vw - 40px); right: 20px; }
  .waifu-img { width: 90px; height: 120px; }
  .big-search { flex-wrap: wrap; border-radius: 20px; padding: 12px; }
  .big-search input { width: 100%; order: 2; }
  .bs-icon { order: 1; }
  .big-search button { order: 3; width: 100%; }
}

/* ===== 今日二次元 · 每日看板 ===== */
.sec-sub { font-size: 14px; color: #a08bb0; font-weight: 400; margin-left: 8px; }
.daily-board { display: grid; grid-template-columns: 1fr 1.2fr 1.5fr 1fr; gap: 16px; }
.daily-card { background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-radius: 16px; padding: 18px; box-shadow: 0 4px 16px rgba(138,99,210,.1); border: 1px solid rgba(255,255,255,.6); }
.daily-card h4 { margin: 0 0 12px; font-size: 15px; color: #5c4a6b; display: flex; align-items: center; }
.daily-date { text-align: center; background: linear-gradient(135deg, #ffe3ee, #e9dcff); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.daily-day { font-size: 48px; font-weight: 800; color: var(--pink); line-height: 1; }
.daily-month { font-size: 16px; color: #8a7398; margin-top: 4px; }
.daily-week { font-size: 14px; color: #a08bb0; margin-top: 2px; }
.daily-festival { font-size: 13px; color: var(--purple); margin-top: 10px; background: rgba(255,255,255,.6); padding: 4px 10px; border-radius: 10px; }
.almanac-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; font-size: 13px; color: #5c4a6b; line-height: 1.5; }
.almanac-tag { flex-shrink: 0; width: 36px; text-align: center; padding: 2px 0; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; }
.almanac-tag.good { background: linear-gradient(135deg, #7ed957, #5bc03e); }
.almanac-tag.bad { background: linear-gradient(135deg, #ff7b7b, #e85555); }
.almanac-tag.lucky { background: linear-gradient(135deg, #ffb3d1, #c4a0ff); width: 52px; }
.daily-update-list { font-size: 13px; color: #5c4a6b; }
.daily-update-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #eee; }
.daily-update-item:last-child { border-bottom: none; }
.daily-update-item .ep-time { color: var(--pink); font-weight: 600; font-size: 12px; flex-shrink: 0; }
.daily-update-item .ep-title { flex: 1; }
.daily-update-item .ep-badge { background: #ffe3ee; color: var(--pink); font-size: 11px; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.daily-char { text-align: center; }
.daily-char img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(239,95,149,.3); margin-bottom: 8px; }
.daily-char-name { font-weight: 700; font-size: 14px; color: #3c2a48; }
.daily-char-desc { font-size: 12px; color: #8a7398; margin-top: 4px; line-height: 1.4; }

/* ===== 二次元每日资讯 ===== */
.news-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.news-source { font-size: 13px; color: #8a7398; }
.news-source .live { color: #ff5577; font-weight: 600; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.news-card { background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 14px rgba(138,99,210,.1); border: 1px solid rgba(255,255,255,.6); transition: transform .3s, box-shadow .3s; cursor: pointer; }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(138,99,210,.2); }
.news-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.news-card-body { padding: 12px 14px; }
.news-card-source { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; font-weight: 600; }
.news-card-source.bilibili { background: #ffe3ee; color: #ff6b9d; }
.news-card-source.weibo { background: #fff0e3; color: #ff8c42; }
.news-card-source.zhihu { background: #e3f0ff; color: #4a9eff; }
.news-card-source.douban { background: #e8ffe3; color: #5bc03e; }
.news-card-source.nga { background: #f0e3ff; color: #9b59ff; }
.news-card-source.acg { background: #ffe3f5; color: #e84393; }
.news-card-title { font-size: 14px; font-weight: 600; color: #3c2a48; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-summary { font-size: 12px; color: #8a7398; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-time { font-size: 11px; color: #b0a0c0; margin-top: 8px; }

/* ===== 二次元梗百科 ===== */
.meme-card { background: linear-gradient(135deg, rgba(255,227,238,.9), rgba(233,220,255,.9)); backdrop-filter: blur(10px); border-radius: 18px; padding: 24px; box-shadow: 0 6px 20px rgba(138,99,210,.15); border: 1px solid rgba(255,255,255,.6); }
.meme-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.meme-tag { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 20px; font-weight: 600; }
.meme-date { font-size: 12px; color: #8a7398; }
.meme-title { font-size: 22px; color: #3c2a48; margin: 0 0 8px; }
.meme-origin { font-size: 13px; color: var(--purple); margin-bottom: 12px; }
.meme-desc { font-size: 14px; color: #5c4a6b; line-height: 1.8; margin-bottom: 14px; }
.meme-usage { background: rgba(255,255,255,.6); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #5c4a6b; line-height: 1.6; margin-bottom: 16px; }
.meme-usage b { color: var(--pink); }

/* ===== 二次元头像库 ===== */
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
.avatar-item { aspect-ratio: 1; border-radius: 50%; overflow: hidden; cursor: pointer; transition: transform .3s, box-shadow .3s; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(138,99,210,.15); }
.avatar-item:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 6px 18px rgba(239,95,149,.35); }
.avatar-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .daily-board { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 720px) {
  .daily-board { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .sec-sub { display: block; margin-left: 0; margin-top: 4px; }
  .up-header { flex-direction: column; text-align: center; }
  .up-follow-btn { margin-top: 12px; }
  .up-video-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== B站UP主推荐 ===== */
.up-card { background: linear-gradient(135deg, rgba(255,227,238,.92), rgba(233,220,255,.92)); backdrop-filter: blur(10px); border-radius: 20px; padding: 24px; box-shadow: 0 6px 24px rgba(138,99,210,.15); border: 1px solid rgba(255,255,255,.6); }
.up-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.up-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 4px 14px rgba(239,95,149,.35); flex-shrink: 0; }
.up-info { flex: 1; min-width: 0; }
.up-name { font-size: 22px; color: #3c2a48; margin: 0 0 6px; font-weight: 800; }
.up-desc { font-size: 13px; color: #6b5a7a; margin: 0 0 8px; line-height: 1.5; }
.up-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.up-tag { font-size: 11px; padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,.7); color: var(--purple); font-weight: 600; }
.up-follow-btn { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #ff6b9d, #c4a0ff); color: #fff; padding: 10px 24px; border-radius: 24px; text-decoration: none; font-weight: 700; font-size: 14px; box-shadow: 0 4px 14px rgba(239,95,149,.4); transition: transform .3s, box-shadow .3s; flex-shrink: 0; }
.up-follow-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 20px rgba(239,95,149,.55); }
.follow-icon { font-size: 18px; font-weight: 800; }
.up-videos { background: rgba(255,255,255,.6); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.up-videos-title { font-size: 15px; color: #5c4a6b; margin: 0 0 14px; font-weight: 700; }
.up-video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.up-video-item { text-decoration: none; color: inherit; transition: transform .3s; display: block; }
.up-video-item:hover { transform: translateY(-3px); }
.up-video-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: linear-gradient(135deg, #ffe3ee, #e9dcff); }
.up-video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); color: #fff; font-size: 28px; opacity: 0; transition: opacity .3s; }
.up-video-item:hover .up-video-play { opacity: 1; }
.up-video-title { font-size: 13px; font-weight: 600; color: #3c2a48; margin-top: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.up-video-views { font-size: 11px; color: #8a7398; margin-top: 2px; }
.up-footer { text-align: center; }
.up-space-link { display: inline-block; color: var(--purple); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 20px; border-radius: 20px; background: rgba(255,255,255,.6); transition: background .3s; }
.up-space-link:hover { background: rgba(255,255,255,.9); }
@media (max-width: 1100px) {
  .up-video-grid { grid-template-columns: repeat(2, 1fr); }
}
