/* =========================================================
   云栖空间 · 首页视觉（扁平改版 · 方案 A 靛紫）
   作用域：仅首页（.hp-home 容器内）。首页专属令牌不污染全站主题。
   设计语言：扁平、单一强调色、细边框、大留白、清晰层级（无渐变/无阴影/无毛玻璃）。
   ========================================================= */

.hp-home{
  /* —— 首页设计令牌：复用全站主题变量，跟随个人中心「外观主题」 —— */
  --hp-brand:var(--brand);
  --hp-brand-deep:var(--brand-deep);
  --hp-brand-soft:var(--brand-tint);
  --hp-brand-line:var(--brand-line);
  --hp-bg:var(--page);
  --hp-card:var(--card);
  --hp-ink:var(--text);
  --hp-ink2:var(--text2);
  --hp-ink3:var(--text3);
  --hp-line:var(--border);
  --hp-radius:18px;
  --hp-radius-md:12px;
  --hp-shadow:0 1px 2px rgba(20,30,60,.05);
}

/* ---------- 主视觉 Hero ---------- */
.hp-hero{
  position:relative;
  background:var(--hp-card);
  border:1px solid var(--hp-line);
  border-radius:var(--hp-radius);
  padding:clamp(28px,4vw,52px) clamp(22px,3.4vw,48px);
  margin-bottom:clamp(24px,3vw,36px);
}
.hp-hero-bg{ display:none; }
.hp-hero-inner{
  position:relative; z-index:1;
  display:flex; align-items:center; gap:clamp(28px,4vw,56px);
}
.hp-hero-text{ flex:1 1 auto; min-width:0; }
.hp-kicker{
  display:inline-block; font-size:13px; font-weight:500;
  padding:5px 13px; border-radius:999px; margin-bottom:16px;
  background:var(--hp-brand-soft); color:var(--hp-brand);
}
.hp-hero h1#heroHi{
  font-size:clamp(24px,3.4vw,36px); font-weight:700; line-height:1.2;
  color:var(--hp-ink); margin:0 0 14px; letter-spacing:-.01em;
}
.hp-sub{ font-size:clamp(14px,1.4vw,15px); line-height:1.7; color:var(--hp-ink2); margin:0 0 24px; max-width:540px; }
.hp-cta{ display:flex; gap:12px; flex-wrap:wrap; }
.hp-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:46px; padding:0 24px; border-radius:var(--hp-radius-md); font-size:15px; font-weight:500;
  text-decoration:none; cursor:pointer; transition:background .16s, border-color .16s, transform .12s;
}
.hp-btn.primary{ background:var(--hp-brand); color:#fff; border:1px solid var(--hp-brand); }
.hp-btn.primary:hover{ background:var(--hp-brand-deep); border-color:var(--hp-brand-deep); }
.hp-btn.ghost{ background:transparent; border:1px solid var(--hp-line); color:var(--hp-ink); }
.hp-btn.ghost:hover{ border-color:var(--hp-brand); color:var(--hp-brand); }


/* Hero 右侧问候卡（扁平：浅底 + 细边框，非毛玻璃） */
.hp-card{
  flex:0 0 auto; width:clamp(260px,30%,330px);
  background:var(--hp-bg); border:1px solid var(--hp-line);
  border-radius:16px; padding:22px;
}
.hp-welcome{ display:flex; align-items:center; gap:13px; margin-bottom:18px; }
.hp-w-avatar{
  width:46px; height:46px; border-radius:50%; flex:0 0 auto; overflow:hidden;
  background:var(--hp-brand); display:flex; align-items:center; justify-content:center;
  font-size:18px; font-weight:500; color:#fff;
}
.hp-w-name{ font-size:16px; font-weight:600; color:var(--hp-ink); line-height:1.3; }
.hp-w-sub{ font-size:12px; color:var(--hp-ink2); }
.hp-mini{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px 12px; }
.hp-mini-i b{ display:block; font-size:18px; font-weight:700; color:var(--hp-ink); line-height:1.2; }
.hp-mini-i span{ font-size:12px; color:var(--hp-ink2); }
.hp-mi-store{ grid-column:1 / -1; display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding-bottom:12px; border-bottom:1px solid var(--hp-line); }
.hp-mi-store b{ font-size:20px; font-weight:700; color:var(--hp-ink); white-space:nowrap; line-height:1.2; }
.hp-mi-store span{ font-size:12px; color:var(--hp-ink2); flex:0 0 auto; }

/* ---------- 功能模块网格 ---------- */
.hp-modules{
  display:grid; grid-template-columns:repeat(4,1fr); gap:18px;
  margin-bottom:clamp(28px,3.4vw,44px);
}
.hp-mod{
  display:flex; flex-direction:column; text-decoration:none; color:var(--hp-ink);
  background:var(--hp-card); border:1px solid var(--hp-line); border-radius:var(--hp-radius);
  padding:22px; transition:transform .18s, border-color .18s, box-shadow .18s;
}
.hp-mod:hover{ transform:translateY(-4px); border-color:var(--hp-brand); box-shadow:var(--hp-shadow); }
.hp-mod-ico{
  width:48px; height:48px; border-radius:12px; margin-bottom:16px;
  background:var(--hp-brand-soft); color:var(--hp-brand);
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.hp-mod-ico svg{ width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.hp-mod-t{ font-size:16px; font-weight:600; margin-bottom:6px; }
.hp-mod-d{ font-size:13px; line-height:1.6; color:var(--hp-ink2); flex:1 1 auto; }
.hp-mod-go{ margin-top:16px; font-size:13px; font-weight:500; color:var(--hp-brand); display:inline-flex; align-items:center; gap:4px; }

/* ---------- 内容展示区（两栏） ---------- */
.hp-content{ display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:clamp(28px,3.4vw,44px); align-items:stretch; }
.hp-panel{
  background:var(--hp-card); border:1px solid var(--hp-line); border-radius:var(--hp-radius);
  padding:22px;
  display:flex; flex-direction:column; /* 两栏等高：纵向 flex，左栏列表可均分吃掉剩余高度 */
}
.hp-panel-head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.hp-ph-ico{
  width:36px; height:36px; border-radius:10px; flex:0 0 auto;
  background:var(--hp-brand-soft); color:var(--hp-brand);
  display:flex; align-items:center; justify-content:center;
}
.hp-ph-ico svg{ width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.hp-panel-head h2{ font-size:17px; font-weight:600; color:var(--hp-ink); margin:0; letter-spacing:-.01em; }
.hp-more{ margin-left:auto; font-size:13px; font-weight:500; color:var(--hp-brand); text-decoration:none; }
.hp-more:hover{ text-decoration:underline; }
.hp-refresh{
  margin-left:10px; font-size:13px; font-weight:500; color:var(--hp-brand);
  background:var(--hp-brand-soft); border:1px solid transparent; border-radius:999px;
  padding:6px 13px; cursor:pointer; display:inline-flex; align-items:center; gap:5px;
  transition:background .16s;
}
.hp-refresh:hover{ background:var(--hp-brand-soft); }
.hp-refresh:active{ transform:scale(.97); }
.hp-refresh svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.8; }

/* 最近动态列表（复用 JS 注入的 .df / .m-frow 结构） */
.hp-feed{ display:flex; flex-direction:column; }
.hp-feed .df{ display:flex; align-items:center; gap:10px; padding:12px 2px; border-bottom:1px solid var(--hp-line); text-decoration:none; color:var(--hp-ink); font-size:14px; transition:color .15s; }
.hp-feed .df:last-child{ border-bottom:none; }
.hp-feed .df:hover{ color:var(--hp-brand); }
.hp-feed .df .dot{ flex:0 0 auto; width:7px; height:7px; border-radius:50%; background:var(--hp-brand); }
.hp-feed .df .df-t{ flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hp-feed .df .df-m{ flex:0 0 auto; font-size:12px; color:var(--hp-ink3); }

/* 最近动态下方：待办事项子区（真实数据 d.todo） */
.hp-todowrap{ margin-top:22px; padding-top:20px; border-top:1px solid var(--hp-line); }
/* 桌面两栏严格等高：左栏 7 行动态均分剩余高度（行距 49→约38px），待办随之贴面板底部；
   不会因右栏卡片高度变化而出现底部空白。移动端 .m-home 走自己的 11px 行距，不受影响。 */
@media (min-width:861px){
  .hp-content > .hp-panel:first-child .hp-feed{ flex:1 1 auto; }
  .hp-content > .hp-panel:first-child .hp-feed .df{ flex:1 1 0; padding:6px 2px; }
  /* 右栏音乐区吃满剩余高度，使 align-content:center 生效：窄桌面下多余高度均分为上下留白 */
  .hp-content > .hp-panel:last-child .home-music{ flex:1 1 auto; }
}
.hp-sub-head{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.hp-sub-ico{
  width:30px; height:30px; border-radius:9px; flex:0 0 auto;
  background:var(--hp-brand-soft); color:var(--hp-brand);
  display:flex; align-items:center; justify-content:center;
}
.hp-sub-ico svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.hp-sub-head h3{ font-size:15px; font-weight:600; color:var(--hp-ink); margin:0; letter-spacing:-.01em; }
.hp-todo{ display:flex; flex-direction:column; gap:8px; }
.hp-todo-i{
  display:flex; align-items:center; gap:10px; padding:11px 13px;
  background:var(--hp-brand-soft); border:1px solid var(--hp-line); border-radius:11px;
  text-decoration:none; color:var(--hp-ink); font-size:13.5px;
  transition:transform .14s, box-shadow .14s;
}
.hp-todo-i:hover{ transform:translateX(2px); box-shadow:var(--hp-shadow); }
.hp-todo-dot{ flex:0 0 auto; width:7px; height:7px; border-radius:50%; background:var(--hp-brand); }
.hp-todo-t{ flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hp-todo-go{ flex:0 0 auto; font-size:12px; font-weight:500; color:var(--hp-brand); }
.hp-todo-empty, .hp-todo-done{ font-size:13px; color:var(--hp-ink3); padding:10px 2px; }
.hp-todo-done{ color:var(--hp-brand); font-weight:500; }

/* 无封面兜底：音符占位替代品牌渐变色块（绿块） */
.hm-ph{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; }
.hm-ph svg{ width:34%; height:34%; fill:none; stroke:rgba(255,255,255,.85); stroke-width:1.35; stroke-linecap:round; stroke-linejoin:round; }
/* 云音乐区（沿用全局 .hm-card 卡片，仅补充边框与间距） */
.hp-music{ gap:14px !important; align-content:center; }
.hp-music .hm-card{ transition:transform .15s; }
.hp-music .hm-card:hover{ transform:translateY(-2px); }
/* 封面点击即播放：封面为触发区（不跳转），歌名/歌手/「进入播放 ›」为进入播放页入口 */
.hp-music .hm-cover{ cursor:pointer; }
.hp-music .hm-cover:focus-visible{ outline:2px solid var(--hp-brand); outline-offset:2px; }
.hp-music .hm-t, .hp-music .hm-a{ text-decoration:none; }
.hp-music .hm-t:active, .hp-music .hm-a:active{ opacity:.7; }
/* 播放中态：封面内描边高亮 + 左上「正在播放」角标 + 常显播放层 */
.hp-music .hm-card.hm-playing{ border-color:var(--hp-brand); }
.hp-music .hm-card.hm-playing .hm-cover{ box-shadow:0 0 0 2px var(--hp-brand) inset; }
.hp-music .hm-card.hm-playing .hm-cover::before{
  content:"正在播放"; position:absolute; left:6px; top:6px; z-index:4;
  font-size:10px; line-height:1; padding:3px 7px; border-radius:20px;
  background:var(--hp-brand); color:#fff; pointer-events:none;
}
.hp-music .hm-card.hm-playing .hm-cover .hm-play{ opacity:1; }
/* fix-music-card：歌名单行省略（主流做法），不再两行+min-height 撑高卡片 */
.hp-music .hm-t{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; min-height:0; }
.hp-music .hm-a{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }

.hp-skel{ color:var(--hp-ink3); font-size:13px; padding:22px 0; text-align:center; }

/* ---------- 页脚 ---------- */
.hp-footer{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px;
  margin-top:8px; padding-top:22px; border-top:1px solid var(--hp-line);
  font-size:13px; color:var(--hp-ink2);
}
.hp-ft-brand{ font-size:15px; font-weight:600; color:var(--hp-ink); }
.hp-ft-links a{ color:var(--hp-ink2); text-decoration:none; margin-right:16px; font-size:13px; transition:color .15s; }
.hp-ft-links a:hover{ color:var(--hp-brand); }
.hp-ft-copy{ font-size:12px; color:var(--hp-ink3); }

/* =========================================================
   移动端首页（.m-home 内，对应设计稿移动版）
   ========================================================= */
.hp-m-hero{
  background:var(--hp-card); border:1px solid var(--hp-line);
  border-radius:16px; padding:20px; margin-bottom:16px;
}
.hp-m-hero::after{ display:none; }
.hp-m-hi{ font-size:20px; font-weight:700; color:var(--hp-ink); margin-bottom:4px; }
.hp-m-sub{ font-size:13px; color:var(--hp-ink2); }

.hp-m-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
.hp-m-stat{ background:var(--hp-card); border:1px solid var(--hp-line); border-radius:12px; padding:12px 6px; text-align:center; }
.hp-m-stat b{ display:block; font-size:16px; font-weight:700; color:var(--hp-brand); line-height:1.2; }
.hp-m-stat span{ font-size:11px; color:var(--hp-ink2); }

.hp-m-modules{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:18px; }
.hp-m-mod{ display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--hp-ink); background:var(--hp-card); border:1px solid var(--hp-line); border-radius:12px; padding:14px; }
.hp-m-mod .ico{ width:42px; height:42px; border-radius:11px; flex:0 0 auto; background:var(--hp-brand-soft); color:var(--hp-brand); display:flex; align-items:center; justify-content:center; }
.hp-m-mod .ico svg{ width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.hp-m-mod .t{ font-size:14px; font-weight:600; }

.hp-m-sec{ margin-bottom:18px; }
.hp-m-sec-t{ display:flex; align-items:center; font-size:15px; font-weight:600; color:var(--hp-ink); margin-bottom:10px; }
.hp-m-sec-t .more{ margin-left:auto; font-size:12px; font-weight:500; color:var(--hp-brand); text-decoration:none; }
.hp-m-sec-t .m-refresh{ display:inline-flex; align-items:center; gap:4px; margin-left:8px; font-size:12px; font-weight:500; color:var(--hp-brand); background:var(--hp-brand-soft); border:1px solid transparent; border-radius:999px; padding:4px 11px; cursor:pointer; }
.hp-m-sec-t .m-refresh svg{ width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:1.8; }

/* 移动端云音乐 / 动态列表微调 */
/* 手机：三列（封面约 106px，贴近 QQ音乐/网易云手机版比例） */
.m-home .home-music{ gap:16px 10px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.m-home .hm-cover{ border-radius:10px; }
.m-home .hm-t{ font-size:13px; margin-top:8px; }
.m-home .hm-a{ font-size:11.5px; }
.m-home .hp-feed .df{ font-size:13px; padding:11px 2px; }
.hp-feed .m-frow{ display:flex; align-items:center; gap:10px; padding:12px 2px; border-bottom:1px solid var(--hp-line); text-decoration:none; color:var(--hp-ink); font-size:14px; transition:color .15s; }
.hp-feed .m-frow:last-child{ border-bottom:none; }
.hp-feed .m-frow:hover{ color:var(--hp-brand); }
.hp-feed .m-frow .dot{ flex:0 0 auto; width:7px; height:7px; border-radius:50%; background:var(--hp-brand); }
.hp-feed .m-frow .ft{ flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hp-feed .m-frow .fm{ flex:0 0 auto; font-size:12px; color:var(--hp-ink3); }
.m-home .hp-feed .m-frow{ font-size:13px; padding:11px 2px; }

/* ---------- 响应式断点 ---------- */
@media (max-width:980px){
  .hp-hero-inner{ flex-direction:column; align-items:stretch; }
  .hp-card{ width:100%; }
  .hp-modules{ grid-template-columns:repeat(2,1fr); gap:16px; }
  .hp-content{ grid-template-columns:1fr; }
}
@media (max-width:560px){
  .hp-modules{ grid-template-columns:1fr; }
  .hp-m-stats{ grid-template-columns:repeat(2,1fr); }
  .hp-footer{ flex-direction:column; align-items:flex-start; }
}

/* ---------- 移动端切换：≤860px 隐藏桌面区块、显示 .m-home（覆盖 inline display:none） ---------- */
@media (max-width:860px){
  .hp-home > .hp-hero,
  .hp-home > .hp-modules,
  .hp-home > .hp-content,
  .hp-home > .hp-footer{ display:none !important; }
  .m-home{ display:block !important; }
}
@media (min-width:861px){
  .m-home{ display:none !important; }
}

/* ---------- 平板：861–1024px（fix-mobile-unify，补 iPad 缺口） ---------- */
@media (max-width:1024px){
  .hp-modules{ grid-template-columns:repeat(2,1fr); }
  .hp-content{ grid-template-columns:1fr; }
  .hp-hero-inner{ flex-direction:column; align-items:stretch; gap:20px; }
  .hp-card{ width:100%; }
  .hp-m-stats{ grid-template-columns:repeat(2,1fr); }
}

/* ===== 音乐卡片比例（fix-music-card 20261119）=====
   手机三列已在上方 .m-home 处定义；此处补平板/窄桌面过渡档，
   保证封面边长始终落在主流区间（手机 ~106 / 平板 ~150 / 桌面 ~148~200）。 */
@media (min-width:561px) and (max-width:860px){
  .m-home .home-music{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:18px 14px; }
  .m-home .hm-t{ font-size:14px; }
  .m-home .hm-a{ font-size:12.5px; }
}
@media (min-width:861px){
  /* 桌面：音乐区在右栏（约占 45% 容器宽），minmax 下限控制在 120px，
     保证 1280 下仍有 3~4 列、封面不超过 170px（原来 2 列 212px 过大） */
  .home-music{ grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:18px 14px; }
  .home-music .hm-t{ font-size:13.5px; }
  /* 首页两栏：桌面宽屏下 5 首若排成一行会在等高面板底部留大片空白，
     固定 3 列使其呈 3+2 两行、封面变大填满高度（不影响 .m-home 移动端三列） */
  .hp-content .home-music{ grid-template-columns:repeat(3,minmax(0,1fr)); align-content:center; }
}

@media (min-width:1330px){ .hp-content .home-music{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (min-width:1800px){ .hp-content .home-music{ grid-template-columns:repeat(5,minmax(0,1fr)); } }
/* 首页音乐精选：铺满面板整行（不再限宽居中，左右不留空）。
   宽屏 ≥1800 为 5 列（相当于原 3 列左右各 +1）、1330~1799 为 4 列、窄桌面 3 列；
   列间距恒 14px，取数为「列数×2」整数倍，保证每行填满无缺口；
   封面在各视口稳定在 118~157px（1280≈152 / 1440≈130 / 1600≈150 / 1920≈149 / 2560≈157）。 */
.hp-content .home-music{ width:100%; }
.hp-content .home-music .hm-card{ width:100%; }
.hp-content .home-music .hm-t{ font-size:13px; }
.hp-content .home-music .hm-a{ font-size:11.5px; }
/* ===== 移动体验升级（fix-mobile-ux 20261119）===== */
@media (max-width:860px){
  .hp-m-sec-t .m-refresh{ padding:9px 14px; font-size:13px; }
  .hp-m-sec-t .m-refresh svg{ width:15px; height:15px; }
  .hp-m-sec-t .more{ padding:9px 2px; }
}
