/*!
 * 万能墙（lhuiye.cn） — SPDX-License-Identifier: LicenseRef-Proprietary
 * Copyright (c) 2026 辉夜 <18759765356@163.com> 保留所有权利
 * 第三方组件保留各自许可（见 THIRD_PARTY_NOTICES.md）
 */
/* ==========================================================================
   【界面模式】切换器 / 首访询问弹窗 / 提示条 样式（全站通用，始终加载）
   与极速模式样式 perf_lite.css 分离：本文件是"功能件"，任何模式都要用。
   ========================================================================== */

/* ---------------- 顶栏切换器 ---------------- */
.perf-switch { position: relative; display: inline-flex; align-items: center; }
.perf-switch-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(var(--card-rgb, 156, 39, 176), .22);
    background: rgba(255, 255, 255, .78);
    color: var(--primary, #9c27b0);
    font-size: 13px; font-weight: 600; line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.perf-switch-btn:hover { background: #fff; border-color: var(--primary, #9c27b0); }
.perf-switch-btn:active { transform: scale(.97); }
.perf-switch-btn.is-lite { background: var(--primary, #9c27b0); color: #fff; border-color: transparent; }
.perf-switch-label { white-space: nowrap; }

.perf-switch-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 90;
    width: 268px; padding: 10px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(0, 0, 0, .08); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.perf-switch.is-open .perf-switch-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.perf-switch-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #6b7280; padding: 2px 6px 8px; }
.perf-opt {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px; border-radius: 10px; text-decoration: none;
    color: #1f2937; font-size: 14px; box-sizing: border-box;
}
.perf-opt > i:first-child { width: 18px; text-align: center; color: var(--primary, #9c27b0); }
.perf-opt-text { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: left; }
.perf-opt-text b { font-weight: 600; font-size: 13.5px; }
.perf-opt-text small { color: #8b8b93; font-size: 11.5px; margin-top: 2px; }
.perf-opt-check { opacity: 0; color: #16a34a; font-size: 12px; }
.perf-opt:hover { background: rgba(var(--primary-rgb, 156, 39, 176), .07); }
.perf-opt.is-active { background: rgba(var(--primary-rgb, 156, 39, 176), .1); }
.perf-opt.is-active .perf-opt-check { opacity: 1; }
.perf-switch-note { margin: 8px 6px 4px; font-size: 11.5px; line-height: 1.6; color: #8b8b93; }
.perf-switch-more { display: block; text-align: center; font-size: 12px; color: var(--primary, #9c27b0); text-decoration: none; padding: 6px; }
.perf-switch-more:hover { text-decoration: underline; }

/* ---------------- 首访询问弹窗 ---------------- */
.perf-modal-mask {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(17, 12, 24, .5);
    display: flex; align-items: center; justify-content: center;
    padding: 18px; opacity: 0; transition: opacity .2s ease;
}
.perf-modal-mask.is-show { opacity: 1; }
.perf-modal {
    width: 100%; max-width: 420px; box-sizing: border-box;
    background: #fff; border-radius: 18px; padding: 20px 18px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
    transform: translateY(10px) scale(.98); transition: transform .22s cubic-bezier(.2, .8, .3, 1);
    max-height: 88vh; overflow: auto;
}
.perf-modal-mask.is-show .perf-modal { transform: none; }
.perf-modal-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: #1f2937; margin: 0 0 6px; }
.perf-modal-title i { color: var(--primary, #9c27b0); }
.perf-modal-sub { margin: 0 0 14px; font-size: 13px; line-height: 1.65; color: #6b7280; }
.perf-modal-opt {
    display: block; width: 100%; box-sizing: border-box; text-align: left; cursor: pointer;
    border: 2px solid #eceaf0; background: #fff; border-radius: 14px;
    padding: 12px 14px; margin-bottom: 10px; font-family: inherit;
    transition: border-color .18s ease, background .18s ease;
}
.perf-modal-opt:hover { border-color: rgba(var(--primary-rgb, 156, 39, 176), .45); }
.perf-modal-opt.is-active { border-color: var(--primary, #9c27b0); background: rgba(var(--primary-rgb, 156, 39, 176), .06); }
.perf-modal-opt-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: #1f2937; }
.perf-modal-opt-head i { color: var(--primary, #9c27b0); }
.perf-modal-opt-head em {
    font-style: normal; font-size: 11px; font-weight: 600; color: #16a34a;
    background: rgba(22, 163, 74, .1); padding: 1px 7px; border-radius: 999px;
}
.perf-modal-opt.is-active .perf-modal-opt-head em { background: rgba(var(--primary-rgb, 156, 39, 176), .12); color: var(--primary, #9c27b0); }
.perf-modal-opt-desc { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.6; color: #6b7280; }
.perf-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.perf-modal-snooze {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: 12.5px; color: #6b7280; user-select: none;
}
.perf-modal-snooze input { width: 15px; height: 15px; accent-color: var(--primary, #9c27b0); }
.perf-modal-close {
    border: 0; background: transparent; color: #9ca3af; cursor: pointer;
    font-size: 13px; padding: 6px 4px; font-family: inherit;
}
.perf-modal-close:hover { color: #6b7280; }
.perf-modal-hint {
    margin: 10px 0 0; padding-top: 10px; border-top: 1px solid #f1f0f4;
    font-size: 11.5px; line-height: 1.6; color: #9ca3af;
}

/* ---------------- 提示条 / 轻提示 ---------------- */
.perf-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
    z-index: 9999; max-width: 92vw; box-sizing: border-box;
    background: rgba(31, 26, 38, .94); color: #fff;
    padding: 10px 14px; border-radius: 12px; font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.perf-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.perf-toast a, .perf-toast button {
    color: #ffd9f4; background: transparent; border: 0; cursor: pointer;
    font-size: 13px; font-family: inherit; text-decoration: underline; padding: 0;
}

/* ---------------- 设置页卡片 ---------------- */
.perf-cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .perf-cards { grid-template-columns: 1fr 1fr; } }
.perf-card {
    display: flex; flex-direction: column; gap: 6px; text-decoration: none;
    border: 2px solid #eceaf0; border-radius: 14px; padding: 13px 14px; background: #fff;
    transition: border-color .18s ease, background .18s ease;
}
.perf-card:hover { border-color: rgba(var(--primary-rgb, 156, 39, 176), .45); }
.perf-card.is-active { border-color: var(--primary, #9c27b0); background: rgba(var(--primary-rgb, 156, 39, 176), .06); }
.perf-card-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: #1f2937; }
.perf-card-head i { color: var(--primary, #9c27b0); }
.perf-card-badge {
    font-style: normal; font-size: 11px; font-weight: 600; color: #6b7280;
    background: #f3f2f6; padding: 1px 7px; border-radius: 999px;
}
.perf-card.is-active .perf-card-badge { background: rgba(var(--primary-rgb, 156, 39, 176), .12); color: var(--primary, #9c27b0); }
.perf-card-desc { font-size: 12.5px; line-height: 1.65; color: #6b7280; }
.perf-card-state { font-size: 12px; font-weight: 600; color: var(--primary, #9c27b0); }
.perf-tip { margin: 10px 0 0; font-size: 12px; color: #9ca3af; }

/* 极速模式下弹窗/面板保持朴素（避免低配设备上弹窗本身卡顿） */
html[data-perf="lite"] .perf-modal-mask { transition: none; }
html[data-perf="lite"] .perf-modal { transition: none; transform: none; }
html[data-perf="lite"] .perf-switch-panel { transition: none; }
html[data-perf="lite"] .perf-toast { transition: none; }
