/* ==========================================================================
   Yosonia CMP · 同意横幅 / 偏好中心 / 常驻入口 (V4.7.16)
   自带一套 --yxc-* 令牌，深色由 <html class="yxv2-dark"> 覆盖，不依赖父主题变量。
   --yxc-bottom 由 cmp.js 按底部标签栏实际高度写入，避免悬浮按钮压住导航。
   ========================================================================== */

/* 变量挂在 :root 上，「我的」页里的 [yxv2_cookie_settings] 按钮也能取到。 */
:root{
  --yxc-bg:#f4f7f6;
  --yxc-card:#ffffff;
  --yxc-ink:#172235;
  --yxc-muted:#5d6879;
  --yxc-line:#dfe7e2;
  --yxc-lime:#0b9c25;
  --yxc-lime-ink:#ffffff;
  --yxc-shadow:0 12px 44px rgba(12,35,20,.20);
  --yxc-bottom:18px;
}
.yxv2-dark{
  --yxc-bg:#0b160e;
  --yxc-card:#101d13;
  --yxc-ink:#eaf5eb;
  --yxc-muted:#a6b9ab;
  --yxc-line:#2c4331;
  --yxc-lime:#65ef43;
  --yxc-lime-ink:#071a0b;
  --yxc-shadow:0 16px 54px rgba(0,0,0,.58);
}
.yxc-root{
  font-family:inherit;
  font-size:14px;
  line-height:1.6;
  color:var(--yxc-ink);
}
.yxc-root [hidden]{display:none!important}
.yxc-root *, .yxc-root *::before, .yxc-root *::after{box-sizing:border-box}

/* 「我的 → 站点设置」及短代码 [yxv2_cookie_settings] 生成的常驻入口 */
button.yxv2-cmp-open{
  padding:7px 13px;border-radius:8px;border:1px solid var(--yxc-line);
  background:var(--yxc-card);color:var(--yxc-ink);
  font:inherit;font-size:13px;font-weight:600;line-height:1.3;cursor:pointer
}
button.yxv2-cmp-open:hover{border-color:var(--yxc-lime)}
button.yxv2-cmp-open:focus-visible{outline:3px solid var(--yxc-lime);outline-offset:2px}

/* ---- 遮罩 ------------------------------------------------------------- */
.yxc-root .yxc-backdrop{
  position:fixed;inset:0;z-index:99998;
  background:rgba(4,12,7,.56);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);
}

/* ---- 首次同意横幅 ----------------------------------------------------- */
.yxc-root .yxc-banner{
  position:fixed;left:50%;bottom:var(--yxc-bottom);transform:translateX(-50%);
  width:860px;max-width:calc(100% - 32px);z-index:100000;
  padding:18px 20px 14px;
  background:var(--yxc-card);color:var(--yxc-ink);
  border:1px solid var(--yxc-line);border-radius:14px;
  box-shadow:var(--yxc-shadow);
}
.yxc-root .yxc-banner-main{display:flex;align-items:center;gap:20px}
.yxc-root .yxc-banner-text{flex:1 1 auto;min-width:0}
.yxc-root #yxc-title{margin:0 0 5px;font-size:17px;line-height:1.35;color:var(--yxc-ink)}
.yxc-root #yxc-desc{margin:0;font-size:13px;color:var(--yxc-muted)}
.yxc-root .yxc-links{margin-top:7px}
.yxc-root .yxc-links a{color:var(--yxc-lime);font-size:12px;text-decoration:underline;margin-right:14px}
.yxc-root .yxc-banner-actions{display:flex;flex-direction:column;gap:7px;flex:0 0 168px}
.yxc-root .yxc-foot{margin:11px 0 0;font-size:11px;color:var(--yxc-muted);text-align:center}
.yxc-root .yxc-gpc{
  margin:9px 0 0;padding:8px 11px;border-left:3px solid #d99b18;
  border-radius:6px;background:rgba(217,155,24,.13);
  font-size:12px;color:var(--yxc-ink)
}

/* ---- 偏好中心 --------------------------------------------------------- */
.yxc-root .yxc-prefs{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  width:620px;max-width:calc(100% - 28px);max-height:min(86vh,760px);overflow:auto;
  z-index:100001;padding:22px 24px 18px;
  background:var(--yxc-card);color:var(--yxc-ink);
  border:1px solid var(--yxc-line);border-radius:16px;
  box-shadow:var(--yxc-shadow);
}
.yxc-root .yxc-prefs-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.yxc-root #yxc-pref-title{margin:0;font-size:19px;line-height:1.3;color:var(--yxc-ink)}
.yxc-root .yxc-x{
  width:32px;height:32px;flex:0 0 32px;border-radius:8px;
  background:transparent;border:1px solid var(--yxc-line);color:var(--yxc-ink);
  font-size:21px;line-height:1;cursor:pointer
}
.yxc-root .yxc-prefs-desc{margin:8px 0 4px;font-size:13px;color:var(--yxc-muted)}
.yxc-root .yxc-cat{
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  padding:14px 0;border-bottom:1px solid var(--yxc-line)
}
.yxc-root .yxc-cat:last-child{border-bottom:0}
.yxc-root .yxc-cat-text{flex:1 1 auto;min-width:0}
.yxc-root .yxc-cat-text strong{display:block;font-size:15px;color:var(--yxc-ink)}
.yxc-root .yxc-cat-text p{margin:4px 0 0;font-size:13px;color:var(--yxc-muted)}
.yxc-root .yxc-cat-text small{display:block;margin-top:6px;font-size:11px;color:var(--yxc-muted);word-break:break-word}
.yxc-root .yxc-cat-control{flex:0 0 auto;padding-top:2px}
.yxc-root .yxc-always{font-size:12px;font-weight:700;color:var(--yxc-lime);white-space:nowrap}
.yxc-root .yxc-prefs-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px;flex-wrap:wrap}
.yxc-root .yxc-prefs-gpc{margin:12px 0 0}

/* ---- 开关 ------------------------------------------------------------- */
.yxc-root .yxc-switch{position:relative;display:inline-flex;align-items:center;cursor:pointer}
.yxc-root .yxc-switch input{position:absolute;width:1px;height:1px;opacity:0;margin:0}
.yxc-root .yxc-track{
  display:block;position:relative;width:46px;height:26px;border-radius:999px;
  background:var(--yxc-line);border:1px solid var(--yxc-line);
  transition:background .18s ease,border-color .18s ease
}
.yxc-root .yxc-track::after{
  content:'';position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;
  background:var(--yxc-lime-ink);box-shadow:0 1px 3px rgba(0,0,0,.28);
  transition:transform .18s ease
}
.yxc-root .yxc-switch input:checked + .yxc-track{background:var(--yxc-lime);border-color:var(--yxc-lime)}
.yxc-root .yxc-switch input:checked + .yxc-track::after{transform:translateX(20px)}
.yxc-root .yxc-switch input:disabled + .yxc-track{opacity:.5;cursor:not-allowed}
.yxc-root .yxc-switch input:focus-visible + .yxc-track{outline:3px solid var(--yxc-lime);outline-offset:2px}
.yxc-root .yxc-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---- 按钮 ------------------------------------------------------------- */
.yxc-root button.yxc-btn{
  display:inline-block;padding:9px 15px;border-radius:8px;
  border:1px solid var(--yxc-line);background:transparent;color:var(--yxc-ink);
  font:inherit;font-weight:600;font-size:13px;line-height:1.3;text-align:center;
  cursor:pointer;white-space:nowrap;transition:border-color .15s ease,transform .15s ease
}
.yxc-root button.yxc-btn:hover{border-color:var(--yxc-lime);transform:translateY(-1px)}
.yxc-root button.yxc-btn.primary{background:var(--yxc-lime);color:var(--yxc-lime-ink);border-color:var(--yxc-lime)}
.yxc-root button.yxc-btn.primary:hover{filter:brightness(1.06)}
.yxc-root button.yxc-btn:focus-visible,
.yxc-root button.yxc-x:focus-visible,
.yxc-root button.yxc-fab:focus-visible,
.yxc-root .yxc-links a:focus-visible{outline:3px solid var(--yxc-lime);outline-offset:2px}

/* ---- 常驻入口与提示 --------------------------------------------------- */
.yxc-root button.yxc-fab{
  position:fixed;right:16px;bottom:var(--yxc-bottom);z-index:99990;
  width:42px;height:42px;padding:0;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--yxc-card);color:var(--yxc-ink);
  border:1px solid var(--yxc-line);box-shadow:var(--yxc-shadow);
  font-size:18px;line-height:1;cursor:pointer;opacity:.88
}
.yxc-root button.yxc-fab:hover{opacity:1;border-color:var(--yxc-lime)}
.yxc-root button.yxc-fab svg{display:block}
.yxc-root .yxc-toast{
  position:fixed;left:50%;bottom:calc(var(--yxc-bottom) + 62px);transform:translateX(-50%);
  z-index:100002;max-width:calc(100% - 32px);padding:10px 16px;border-radius:9px;
  background:var(--yxc-card);color:var(--yxc-ink);
  border:1px solid var(--yxc-line);box-shadow:var(--yxc-shadow);font-size:13px
}

/* ---- 深色对比度修正：只改颜色，不改布局 -------------------------------- */
.yxv2-dark .yxc-root .yxc-links a{color:#8bef6b}
.yxv2-dark .yxc-root .yxc-always{color:#8bef6b}
.yxv2-dark .yxc-root button.yxc-btn.primary{color:#071a0b}
.yxv2-dark .yxc-root .yxc-gpc{background:rgba(217,155,24,.16);border-left-color:#e8b13c}

/* ---- 移动端 ----------------------------------------------------------- */
@media (max-width:720px){
  .yxc-root .yxc-banner{bottom:var(--yxc-bottom);max-width:calc(100% - 20px);padding:15px 15px 12px}
  .yxc-root .yxc-banner-main{display:block}
  .yxc-root .yxc-banner-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:13px}
  .yxc-root .yxc-banner-actions .primary{grid-column:1 / -1;order:-1}
  .yxc-root .yxc-prefs{width:calc(100% - 20px);max-height:88vh;padding:18px 16px 14px}
  .yxc-root .yxc-prefs-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;justify-content:stretch}
  .yxc-root .yxc-prefs-actions .primary{grid-column:1 / -1;order:-1}
  .yxc-root button.yxc-btn{width:100%}
  .yxc-root .yxc-cat{gap:10px}
  .yxc-root button.yxc-fab{right:12px;width:38px;height:38px;font-size:16px}
  .yxc-root .yxc-toast{bottom:calc(var(--yxc-bottom) + 58px)}
}
@media (prefers-reduced-motion:reduce){
  .yxc-root *{transition:none!important;animation:none!important}
}
