/* 知音 · 站内私信（悬浮球 + 面板）
   注意：面板与悬浮球都挂在 document.body 末尾，但站点部分页面（header.php 输出）会给
   body 或内容包裹层加 .zy-site，而 zhiyin.css 里有一条 (0,1,1) 的全局按钮规则：
   .zy-site input[type=submit],.zy-site input[type=button],.zy-site button{background:var(--brand-grad);color:#fff!important;border:0;padding:10px 28px;border-radius:10px;font-size:14px;font-weight:700;letter-spacing:1px}
   单类选择器 (0,1,0) 会被它压过，导致同一个聊天图标在不同页面变成不同颜色/形状。
   因此本文件所有按钮类规则统一加 .zyc-root 前缀（提到 0,2,0），关键属性再加 !important，
   保证「同一个组件在任何页面外观完全一致」。 */
.zyc-root{--zyc-brand:#C30E23;--zyc-brand-2:#9E0B1B;--zyc-ink:#1F2638;--zyc-ink2:#6B7688;--zyc-line:rgba(31,38,60,.10);--zyc-bg:#F5F7FA;font:14px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;color:var(--zyc-ink);}
.zyc-root *{box-sizing:border-box;}

/* ---------- 悬浮球（全站唯一外观，禁止被页面样式改写） ---------- */
.zyc-root .zyc-ball{position:fixed;right:24px;bottom:26px;width:58px;height:58px;min-width:58px;min-height:58px;
  border-radius:50% !important;border:0 !important;padding:0 !important;margin:0 !important;cursor:pointer;line-height:1;
  background:linear-gradient(135deg,#E01B2F,#A50C1C) !important;color:#fff !important;z-index:2147482000;
  box-shadow:0 10px 26px rgba(163,10,26,.34),0 2px 6px rgba(0,0,0,.12);
  display:flex;align-items:center;justify-content:center;transition:transform .35s cubic-bezier(.34,1.56,.64,1),box-shadow .35s;}
.zyc-root .zyc-ball:hover{transform:scale(1.07);box-shadow:0 14px 32px rgba(163,10,26,.42);}
.zyc-root .zyc-ball svg{width:27px;height:27px;fill:#fff;flex:0 0 auto;}
.zyc-root .zyc-ball .zyc-badge{position:absolute;top:-3px;right:-3px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;
  background:#FFB020;color:#5A3400;font-size:11.5px;font-weight:800;line-height:20px;text-align:center;
  box-shadow:0 2px 6px rgba(0,0,0,.2);display:none;}
.zyc-root .zyc-ball.has-unread .zyc-badge{display:block;animation:zycPop .4s ease;}
/* 页面自带的「发布乐谱」等右下角悬浮按钮占位，球自动上移让开，避免两个红块叠在一起 */
.zyc-root.zyc-has-fab .zyc-ball{bottom:98px;}
.zyc-root.zyc-has-fab .zyc-panel{bottom:168px;}

/* ---------- 面板 ---------- */
.zyc-panel{position:fixed;right:24px;bottom:96px;width:780px;height:560px;max-height:calc(100vh - 130px);
  background:#fff;border-radius:16px;overflow:hidden;z-index:2147482001;
  box-shadow:0 24px 60px rgba(16,24,40,.24),0 4px 12px rgba(16,24,40,.10);
  display:none;flex-direction:column;transform-origin:bottom right;}
.zyc-panel.is-open{display:flex;animation:zycIn .28s cubic-bezier(.22,1,.36,1);}
.zyc-head{display:flex;align-items:center;gap:10px;padding:0 14px;height:52px;flex:0 0 52px;
  background:linear-gradient(135deg,#C30E23,#8E0A18);color:#fff;}
.zyc-head h3{margin:0;font-size:15px;font-weight:700;letter-spacing:.5px;}
.zyc-head .zyc-sub{font-size:12px;opacity:.78;}
.zyc-head .zyc-sp{flex:1;}
.zyc-root .zyc-hbtn{width:30px;height:30px;min-width:30px;border:0 !important;border-radius:8px !important;background:rgba(255,255,255,.14) !important;
  color:#fff !important;cursor:pointer;padding:0 !important;letter-spacing:0 !important;font-size:16px;font-weight:400 !important;line-height:1;
  text-decoration:none;display:flex;align-items:center;justify-content:center;}
.zyc-root .zyc-hbtn:hover{background:rgba(255,255,255,.26) !important;}

.zyc-body{flex:1;display:flex;min-height:0;background:var(--zyc-bg);}

/* ---------- 左：联系人 ---------- */
.zyc-side{width:238px;flex:0 0 238px;background:#fff;border-right:1px solid var(--zyc-line);display:flex;flex-direction:column;min-height:0;}
.zyc-search{padding:10px 10px 8px;border-bottom:1px solid var(--zyc-line);}
.zyc-search input{width:100%;height:32px;border:1px solid var(--zyc-line);border-radius:8px;background:#F7F9FC;
  padding:0 10px;font-size:13px;outline:none;color:var(--zyc-ink);}
.zyc-search input:focus{border-color:rgba(195,14,35,.45);background:#fff;}
.zyc-list{flex:1;overflow-y:auto;overscroll-behavior:contain;}
.zyc-root .zyc-item{display:flex;align-items:center;gap:9px;padding:9px 10px;cursor:pointer;border:0 !important;background:none;
  width:100%;text-align:left;border-radius:0 !important;letter-spacing:0 !important;font-size:13px;font-weight:400 !important;
  border-bottom:1px solid rgba(31,38,60,.05) !important;transition:background .18s;}
.zyc-root .zyc-item:hover{background:#F4F6FA;}
.zyc-root .zyc-item.on{background:#FDF2F3;}
.zyc-av{position:relative;flex:0 0 36px;width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;font-size:14px;background:#8A94A6;}
.zyc-av.admin{background:linear-gradient(135deg,#E0A73C,#B8791A);}
.zyc-dot{position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:50%;background:#BBB;border:2px solid #fff;}
.zyc-dot.on{background:#22C55E;}
.zyc-meta{flex:1;min-width:0;}
.zyc-nm{display:flex;align-items:center;gap:5px;font-size:13.5px;font-weight:600;color:var(--zyc-ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.zyc-star{color:#E0A73C;font-size:11px;}
.zyc-last{font-size:12px;color:var(--zyc-ink2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px;}
.zyc-badge2{flex:0 0 auto;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#E01B2F;color:#fff;
  font-size:11px;font-weight:700;line-height:18px;text-align:center;}

/* ---------- 右：会话 ---------- */
.zyc-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;}
.zyc-chd{height:44px;flex:0 0 44px;display:flex;align-items:center;gap:8px;padding:0 14px;background:#fff;
  border-bottom:1px solid var(--zyc-line);font-weight:700;font-size:13.5px;}
.zyc-chd .zyc-tag{font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;background:#EEF2F8;color:#5B6B85;}
.zyc-msgs{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain;}
.zyc-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#9AA5B6;font-size:13px;}
.zyc-empty b{color:var(--zyc-ink);font-size:14px;}
.zyc-row{display:flex;gap:8px;align-items:flex-start;}
.zyc-row.mine{flex-direction:row-reverse;}
.zyc-row .zyc-av{width:30px;height:30px;flex:0 0 30px;border-radius:8px;font-size:12px;}
.zyc-bub{max-width:76%;padding:9px 12px;border-radius:12px;background:#fff;border:1px solid var(--zyc-line);
  font-size:13.5px;line-height:1.62;word-break:break-word;white-space:pre-wrap;box-shadow:0 1px 2px rgba(16,24,40,.04);}
.zyc-row.mine .zyc-bub{background:linear-gradient(135deg,#C30E23,#A00B1B);color:#fff;border-color:transparent;}
.zyc-time{align-self:center;font-size:11px;color:#9AA5B6;background:#E9EDF4;padding:2px 9px;border-radius:999px;margin:2px 0;}
.zyc-bub a{color:#2563EB;text-decoration:underline;}
.zyc-row.mine .zyc-bub a{color:#FFE0A3;}
.zyc-bub img{max-width:230px;max-height:230px;border-radius:8px;display:block;cursor:zoom-in;}
.zyc-att{display:block;margin-top:6px;}
.zyc-file{display:flex;align-items:center;gap:9px;text-decoration:none;color:inherit;}
.zyc-file i{flex:0 0 34px;width:34px;height:34px;border-radius:9px;background:#EEF2F8;color:#39506F;
  display:flex;align-items:center;justify-content:center;font-style:normal;font-weight:700;font-size:10.5px;text-transform:uppercase;}
.zyc-row.mine .zyc-file i{background:rgba(255,255,255,.2);color:#fff;}
.zyc-file span{display:block;font-size:13px;font-weight:600;word-break:break-all;}
.zyc-file em{font-style:normal;font-size:11px;color:#8A94A6;}
.zyc-row.mine .zyc-file em{color:rgba(255,255,255,.75);}
.zyc-card{margin-top:6px;border:1px solid rgba(31,38,60,.10);border-radius:10px;padding:9px 11px;background:#FAFBFD;}
.zyc-row.mine .zyc-card{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.28);}
.zyc-card b{display:block;font-size:13px;margin-bottom:2px;}
.zyc-card a{font-size:12px;}

/* ---------- 输入区 ---------- */
.zyc-cmp{flex:0 0 auto;background:#fff;border-top:1px solid var(--zyc-line);padding:8px 12px 10px;}
.zyc-tools{display:flex;align-items:center;gap:4px;margin-bottom:6px;}
.zyc-root .zyc-tool{width:30px;height:30px;min-width:30px;border:0 !important;border-radius:8px !important;background:none;
  cursor:pointer;font-size:16px;line-height:1;padding:0 !important;letter-spacing:0 !important;color:#5B6B85 !important;
  display:flex;align-items:center;justify-content:center;box-shadow:none !important;}
.zyc-root .zyc-tool:hover{background:#F0F3F8 !important;}
.zyc-tools .zyc-tip{margin-left:auto;font-size:11.5px;color:#9AA5B6;}
.zyc-pending{display:none;align-items:center;gap:8px;margin-bottom:6px;padding:6px 9px;border-radius:9px;
  background:#FDF2F3;border:1px solid rgba(195,14,35,.16);font-size:12.5px;color:#8E0A18;}
.zyc-pending.show{display:flex;}
.zyc-pending .zyc-px{margin-left:auto;border:0;background:none;cursor:pointer;color:#8E0A18;font-size:15px;line-height:1;padding:0 2px;}
.zyc-input{display:flex;gap:8px;align-items:flex-end;}
/* 输入框高度由用户自己拖右下角调整（resize:vertical），默认一行、最高 260px 后内部滚动 */
.zyc-input textarea{flex:1;height:40px;min-height:40px;max-height:260px;resize:vertical;overflow-y:auto;
  border:1px solid var(--zyc-line);border-radius:10px;padding:9px 11px;font:14px/1.55 inherit;outline:none;
  color:var(--zyc-ink);background:#FAFBFD;letter-spacing:0;}
.zyc-input textarea:focus{border-color:rgba(195,14,35,.45);background:#fff;}
.zyc-root .zyc-send{flex:0 0 auto;height:40px;min-width:70px;padding:0 18px !important;border:0 !important;border-radius:10px !important;
  cursor:pointer;color:#fff !important;font-weight:700 !important;font-size:13.5px !important;letter-spacing:0 !important;
  background:linear-gradient(135deg,#C30E23,#9E0B1B) !important;box-shadow:0 6px 14px rgba(158,11,27,.24);}
.zyc-root .zyc-send:disabled{opacity:.55;cursor:not-allowed;box-shadow:none;}

/* ---------- 表情 ---------- */
.zyc-emoji{display:none;position:absolute;left:12px;bottom:112px;width:320px;max-height:210px;overflow-y:auto;
  background:#fff;border:1px solid var(--zyc-line);border-radius:12px;box-shadow:0 14px 34px rgba(16,24,40,.18);
  padding:8px;grid-template-columns:repeat(9,1fr);gap:2px;}
.zyc-emoji.show{display:grid;}
.zyc-root .zyc-emoji button{border:0 !important;background:none;cursor:pointer;font-size:19px;line-height:1;
  padding:5px 0 !important;border-radius:6px !important;letter-spacing:0 !important;min-width:0;color:inherit;}
.zyc-root .zyc-emoji button:hover{background:#F0F3F8 !important;}

/* ---------- 未登录 ---------- */
.zyc-login{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:30px;text-align:center;}
.zyc-login p{margin:0;color:#6B7688;font-size:13.5px;}
.zyc-login a.zyc-go{display:inline-block;padding:10px 26px;border-radius:999px;color:#fff !important;text-decoration:none;font-weight:700;
  background:linear-gradient(135deg,#C30E23,#9E0B1B);box-shadow:0 8px 20px rgba(158,11,27,.26);}
.zyc-login .zyc-alt a{display:inline;padding:0;border-radius:0;background:none;box-shadow:none;
  color:#C30E23 !important;font-weight:700;text-decoration:none;margin-left:3px;}
.zyc-login .zyc-alt a:hover{text-decoration:underline;}

/* ---------- 乐谱页入口（联系作者） ----------
   这个按钮长在页面正文里，外面套着 .zy-site，站点全局按钮规则会把它染成另一种红。
   三档选择器 + !important 把外观钉死：任何页面都是「品牌红渐变胶囊 + 白色图标白字」，
   与右下角悬浮球同一套配色，视觉上是同一个聊天入口。 */
.zyc-author,
button.zyc-author,
.zy-site button.zyc-author{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-left:6px;
  padding:9px 18px !important;border:0 !important;border-radius:999px !important;cursor:pointer;
  background:linear-gradient(135deg,#E01B2F,#A50C1C) !important;color:#fff !important;
  font-size:13.5px !important;font-weight:700 !important;line-height:1 !important;letter-spacing:0 !important;
  text-decoration:none !important;white-space:nowrap;box-shadow:0 6px 16px rgba(163,10,26,.28);
  transition:filter .2s,box-shadow .2s,transform .2s;}
.zyc-author:hover,
button.zyc-author:hover,
.zy-site button.zyc-author:hover{background:linear-gradient(135deg,#E8283B,#B31022) !important;color:#fff !important;
  box-shadow:0 10px 22px rgba(163,10,26,.36);transform:translateY(-1px);}
.zyc-author svg{width:15px;height:15px;fill:#fff;flex:0 0 auto;}

@keyframes zycIn{from{opacity:0;transform:translateY(10px) scale(.98);}to{opacity:1;transform:none;}}
@keyframes zycPop{0%{transform:scale(.4);}60%{transform:scale(1.15);}100%{transform:scale(1);}}

@media (max-width:820px){
  .zyc-root .zyc-ball{right:14px;bottom:78px;width:50px;height:50px;min-width:50px;min-height:50px;}
  .zyc-root .zyc-ball svg{width:23px;height:23px;}
  .zyc-root.zyc-has-fab .zyc-ball{bottom:132px;}
  .zyc-panel{right:0;left:0;bottom:0;top:0;width:auto;height:auto;max-height:none;border-radius:0;}
  .zyc-root.zyc-has-fab .zyc-panel{bottom:0;}
  .zyc-side{width:38%;flex-basis:38%;}
  .zyc-root .zyc-item{padding:8px 7px;gap:7px;}
  .zyc-nm{font-size:12.5px;}
  .zyc-last{display:none;}
  .zyc-emoji{left:8px;right:8px;width:auto;}
  .zyc-bub{max-width:84%;}
  .zyc-author,.zy-site button.zyc-author{width:100%;justify-content:center;margin:8px 0 0;}
}
