/* ============================================================================
 * portal.css —— 前台首页（CSDN 新标签页风格）
 *
 * 本文件是「照着 CSDN 浏览器助手 v3.0.6 的新标签页复刻」的产物。
 * 关键数值全部来自对该插件的真实渲染量取（computed style 探针），不是目测：
 *
 *   .date-time-view .time        120px / text-shadow 0 8px 12px rgba(0,0,0,.1)
 *   .date-time-view .date        20px / line-height 1.5 / padding-bottom 16px
 *   .small-weather               16px, margin-bottom 16px, 居中
 *   .search-box                  --searchbar-width 645.67px, height 56.92px
 *   .search-input                18px, 圆角 15px, padding 1px 60px 1px 80px
 *                                背景 rgba(255,255,255,.5), 阴影 rgba(34,34,38,.1) 0 2px 12px
 *   .search-select               宽 64px, 圆角 8px 0 0 8px, padding-left 8px, logo 30×30
 *   .globar-blur-glass           绝对铺满 + backdrop-filter blur(var(--glass-blur)=10px)
 *   .contain-icon-view           圆角 10px, padding-top 32px
 *   .icon-link-item              宽 20%, margin 2px 0, border 2px transparent
 *   .icon-link-item-view         border-radius 13%, 边长 var(--icon-size)=68.83px
 *   .left/right-slick            宽 100px, font-size 42px, line-height 490px
 *   .point-item                  16×16 圆, margin 0 13px, 未选中 rgba(0,0,0,.2), 选中 #fff
 *   .elevator-content            宽 40px → hover 118px, 圆角 8px, left:-40px top:32px
 *                                渐变 232deg #f8eaf7f2 → #d8dff8f2
 *                                内阴影 rgb(238,219,233) 0 1px 11px 0 inset
 *   .elevator-item               高 48px, 图标 24×24 圆 margin 0 8px, hover 背景 #bedbfd
 *                                文字默认 opacity 0，hover 容器后为 1
 *   .settings-icon / .user-icon  40×40 圆 fixed top:32px right 86px / 30px
 *                                背景 rgba(0,0,0,.2) z-index 11
 *   .wallpaper-controlls         fixed bottom:30px right:22px 宽 112px
 *   .mask                        壁纸遮罩 rgba(0,0,0,.1)
 *
 * 所有规则挂在 #portal-page 作用域内，不影响后台（#app-page）样式。
 * ==========================================================================*/

#portal-page {
  --color-white: #fff;
  --color-black: #000;
  --color-text-1: #222226;
  --color-text-2: #555666;
  --color-text-3: #999aaa;
  --color-text-4: #86909c;
  --color-text-5: #c9cdd4;
  --glass-blur: 10px;
  --glass-backgound-color: rgba(255, 255, 255, 0.5);
  --searchbar-bg-color: rgba(255, 255, 255, 0.5);
  --wallpaper-blur: 0px;
  --icon-size: 68.8333px;
  --icon-radius: 13%;
  --searchbar-width: 645.67px;
  --searchbar-height: 56.92px;

  position: fixed;
  inset: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.65);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "noto sans", "Microsoft YaHei", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#portal-page[hidden] { display: none; }
#portal-page *, #portal-page *::before, #portal-page *::after { box-sizing: border-box; }
#portal-page p { margin: 0; }
#portal-page ul { margin: 0; padding: 0; list-style: none; }
#portal-page input { font-family: inherit; }
#portal-page img { border: 0; }

#portal-page .new-tab-box { position: relative; width: 100%; height: 100%; overflow: hidden; }

/* ============================================================ 壁纸层 ==*/
.bg-wrap,
.bg-wrap .mask,
.bg-wrap .bg-pure,
.bg-wrap .bg-image,
.bg-wrap .bg-blur { position: absolute; inset: 0; }

/* ⚠️ .bg-wrap 上**不能**写 z-index —— 一旦设了，它就形成层叠上下文，
   里面的 .wallpaper-controlls（z-index:11）会被困在里面，被 .content（z-index:4）
   整片盖住，右下角两个按钮就点不动了（探针实测 covered=true by DIV.content）。
   层级靠子元素自己的 z-index 表达：mask=2、bg-pure=3、content=4、控制按钮=11。 */

.bg-wrap .bg-image {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: opacity 0.5s ease;
}

.bg-wrap .bg-blur { backdrop-filter: blur(var(--wallpaper-blur)); }
.bg-wrap .mask { background-color: rgba(0, 0, 0, 0.1); z-index: 2; }
.bg-wrap .bg-pure { z-index: 3; }

/* ======================================================== 内容主区 ==*/
#portal-page .content {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow: hidden;
}

/* --------- 左半边：数据看板（本系统自有功能）
 * 用「深色毛玻璃」而不是搜索框那种白色毛玻璃：看板要压在各种壁纸上，
 * 深色玻璃 + 白字在深色/浅色壁纸上都可读；壁纸越花越稳定。
 * 玻璃语言与插件一致：半透明底 + backdrop blur + 圆角 + 一层内描边。
 * ------------------------------------------------------------------------*/
.portal-left {
  flex: 0 1 44%;
  max-width: 720px;
  min-width: 400px;
  max-height: 664px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0 4px;
  overflow: hidden;
}

.pd-card {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pd-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px 0;
}

.pd-h h3 { margin: 0; font-size: 14px; font-weight: 600; color: #fff; }
.pd-h .spacer { flex: 1; }
.pd-h .pd-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.55); }

.pd-link {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.pd-link:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }

/* --- 指标磁贴 3×2 --- */
.pd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 12px 16px 15px;
}
.pd-stat { text-align: center; padding: 3px 4px; }
.pd-stat .k { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); margin-bottom: 3px; }
.pd-stat .v { font-size: 26px; font-weight: 600; line-height: 1.15; color: #fff; }
.pd-stat.is-run .v { color: #6cb6ff; }
.pd-stat.is-ok  .v { color: #4ddba0; }
.pd-stat.is-err .v { color: #ff8b85; }
.pd-stat .s { font-size: 10.5px; color: rgba(255, 255, 255, 0.42); margin-top: 2px; }

/* --- 设备行 --- */
.pd-devrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 12.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.pd-devrow:first-child { border-top: 0; }
.pd-devrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ddba0; flex: none; }
.pd-devrow .dot.off { background: rgba(255, 255, 255, 0.35); }
.pd-devrow .nm { font-weight: 600; color: #fff; }
.pd-devrow .hs { color: rgba(255, 255, 255, 0.45); font-size: 11.5px; }
.pd-devrow .spacer { flex: 1; }
.pd-devrow .tag {
  font-size: 11px; color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.13); border-radius: 999px; padding: 1px 8px;
}
.pd-devbody { padding-bottom: 8px; max-height: 152px; overflow: auto; }

/* --- 最近任务 --- */
.pd-taskbody { padding: 8px 8px 10px; max-height: 232px; overflow: auto; }
.pd-task {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.pd-task:hover { background: rgba(255, 255, 255, 0.11); }
.pd-task .bd {
  font-size: 10.5px; line-height: 16px; padding: 0 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.82); flex: none;
}
.pd-task .bd.ok  { background: rgba(77, 219, 160, 0.22); color: #7bf0bc; }
.pd-task .bd.err { background: rgba(255, 139, 133, 0.22); color: #ffb3ae; }
.pd-task .bd.run { background: rgba(108, 182, 255, 0.22); color: #9ed2ff; }
.pd-task .pn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.pd-task .tn { font-size: 11px; color: rgba(255, 255, 255, 0.45); flex: none; }
.pd-task .tm { font-size: 11px; color: rgba(255, 255, 255, 0.45); flex: none; }
.pd-empty { padding: 22px 16px; text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, 0.5); }
.pd-skel { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #6cb6ff; border-radius: 50%; animation: pd-spin .7s linear infinite; vertical-align: -2px; }
@keyframes pd-spin { to { transform: rotate(360deg); } }

/* --------- 右半边：CSDN 新标签页原样构图 --- */
#portal-page .main {
  flex: 0 1 56%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------ 时间 / 日期 / 天气 */
.date-time-view { position: relative; text-align: center; }
.date-time-view .time {
  /* 字号由 JS 按视口高度算（--time-size），插件同样不是固定值：
     实测 905px 高 → 90px。公式见 portal.js 的 paintScale()。 */
  font-size: var(--time-size, 90px);
  line-height: 1;
  color: #fff;
  padding-bottom: 16px;
  text-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
  letter-spacing: -2px;
}
.date-time-view .time-type {
  position: absolute; top: 0; right: -50px; color: #fff; font-size: 25px;
}
.date-time-view .date {
  padding-bottom: 16px;
  font-size: 20px;
  line-height: 1.5;
  color: #fff;
  vertical-align: baseline;
}

.small-weather {
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 16px; font-size: 16px; cursor: pointer; min-height: 22px;
}
.small-weather .city-name { font-weight: 400; color: #fff; line-height: 22px; margin-right: 28px; }
.small-weather .city-temp { display: flex; align-items: center; margin-right: 16px; }
.small-weather .city-temp img { width: 16px; height: 16px; user-select: none; pointer-events: none; margin-right: 8px; }
.small-weather .city-temp span { font-weight: 400; color: #fff; line-height: 17px; }
.small-weather .curtemp { font-weight: 400; color: #fff; line-height: 22px; }

/* --------------------------------------------------------------- 搜索 */
.search-box { position: relative; display: flex; justify-content: center; }
.search-input-out { position: relative; width: var(--searchbar-width); height: var(--searchbar-height); z-index: 100004; }

.globar-blur-glass {
  position: absolute; inset: 0;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  pointer-events: none;
}

.search-input-out .search-btn-input { display: flex; height: 100%; }

.search-input-out .search-btn-input .search-select {
  position: absolute; left: 0; top: 0;
  width: 64px; height: 100%;
  display: flex; align-items: center; justify-content: flex-start;
  padding-left: 8px;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  z-index: 2;
}
.search-select .engine-logo { width: 30px; height: 30px; display: block; pointer-events: none; }
.search-select .dropdown-icon {
  position: absolute; top: 50%; left: 50px;
  width: 14px; height: 8px; margin-top: -3px;
  background-repeat: no-repeat; background-size: 100%;
  transition: transform 0.2s;
}
.search-select.open .dropdown-icon { transform: rotate(180deg); }

.search-input {
  width: 100%; height: 100%;
  font-size: 18px; line-height: 27px;
  color: var(--color-text-1);
  background-color: var(--searchbar-bg-color);
  border: 0; outline: 0;
  border-radius: 15px;
  padding: 1px 60px 1px 80px;
  box-shadow: rgba(34, 34, 38, 0.1) 0 2px 12px 0;
  transition: background-color 0.2s;
  position: relative; z-index: 1;
}
/* 占位文字用 --color-text-2：搜索框底是半透明白，落在深色壁纸上会变中灰，
   用更浅的 --color-text-4 会糊掉看不清（截图确认过） */
.search-input::placeholder { color: var(--color-text-2); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input-out.focus .search-input { background-color: rgba(255, 255, 255, 0.92); }

/* 搜索按钮（放大镜）默认**不显示** —— 参考图2 的搜索框右侧没有它。
 * 只有布局设置里把「显示搜索按钮」打开时（#portal-page[data-submit=1]）才出现。 */
.search-input-out .search-submit {
  position: absolute; right: 0; top: 0;
  width: 62px; height: 100%;
  background: #1a87ff; border: 0; cursor: pointer;
  border-radius: 0 15px 15px 0;
  display: none; align-items: center; justify-content: center;
  z-index: 2;
}
#portal-page[data-submit="1"] .search-input-out .search-submit { display: flex; }
.search-input-out .search-submit img { display: block; width: 32px; height: 32px; }

.clear-search {
  position: absolute; right: 18px; top: 50%; margin-top: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(34, 34, 38, 0.28); cursor: pointer; display: none;
}
/* 搜索按钮出现时要给清除按钮让位（原来写死在 index.html 的内联样式里） */
#portal-page[data-submit="1"] .clear-search { right: 76px; }
.clear-search::before, .clear-search::after {
  content: ''; position: absolute; left: 4px; top: 8px;
  width: 10px; height: 1.5px; background: #fff; border-radius: 1px;
}
.clear-search::before { transform: rotate(45deg); }
.clear-search::after { transform: rotate(-45deg); }

/* 搜索引擎下拉 */
.search-engines-list {
  position: absolute; left: 0; top: calc(100% + 8px);
  width: var(--searchbar-width);
  border-radius: 15px; display: none; z-index: 100005;
  overflow: hidden;
}
.search-engines-list.show { display: block; }
.search-engines-list .globar-blur-glass { border-radius: 15px; background: rgba(255, 255, 255, 0.72); }
.search-engines-content {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap;
  padding: 10px 12px 6px;
  max-height: 232px; overflow: auto;
}
.engines-item {
  position: relative;
  width: calc(12.5% - 8px);
  margin: 0 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 0; border-radius: 8px; cursor: pointer;
  transition: background 0.2s;
}
.engines-item:hover { background: rgba(26, 135, 255, 0.1); }
.engines-item.on { background: rgba(26, 135, 255, 0.16); }
.engines-item img { width: 32px; height: 32px; display: block; border-radius: 50%; }
.engines-item .engines-name {
  font-size: 12px; color: var(--color-text-1); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 「添加」格 —— 照参考图2 面板末尾那格：白底圆角方块 + 加号 + 「添加」 */
.engines-add .eg-add-box {
  width: 32px; height: 32px; border-radius: 7px;
  background: #fff; color: #9aa3ad;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1; padding-bottom: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}
.engines-add:hover .eg-add-box { color: #1a87ff; }
/* 自定义引擎右上角的删除角标（内置引擎没有） */
.eg-del {
  position: absolute; right: 2px; top: 2px; z-index: 2;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; color: #fff;
  background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.15s;
}
.engines-item:hover .eg-del { opacity: 1; }
.eg-del:hover { background: #d4380d; }
.engines-hint {
  margin: 2px 16px 12px; padding-top: 10px;
  border-top: 1px solid rgba(34, 34, 38, 0.08);
  font-size: 12px; color: var(--color-text-3);
  display: flex; align-items: center; gap: 8px;
}
.engines-hint b { color: var(--color-text-2); }

/* -------------------------------------------------------- 图标网格 ==*/
.contain-icon-view {
  position: relative;
  width: auto;
  /* 左侧留 56px 给电梯坞（它挂在 left:-40px），形成
     「电梯坞 → 翻页箭头 → 图标网格」的横向顺序，与插件一致 */
  margin-left: 56px;
  padding-top: 32px;
  border-radius: 10px;
}

.elevator-wrapper { position: absolute; top: 32px; left: 0; width: 0; }

.elevator-content {
  position: absolute; top: 0; left: -40px; z-index: 99;
  width: 40px; min-width: 0; overflow: hidden;
  border-radius: 8px; margin: 0;
  box-shadow: rgb(238, 219, 233) 0 1px 11px 0 inset;
  background: linear-gradient(232deg, rgba(248, 234, 247, 0.95) 0%, rgba(216, 223, 248, 0.95) 100%);
  transition: all 0.4s;
}
.elevator-content:hover { width: 118px; }

/* 注意要盖过 #portal-page ul 的 padding:0 —— 插件这里是 padding:8px 0
   （面板总高 = 5×48 + 16 = 256px，探针实测值） */
#portal-page .elevator-list { padding: 8px 0; user-select: none; }
.elevator-list .elevator-item {
  height: 48px; display: flex; cursor: pointer;
  color: var(--color-text-1); align-items: center;
  transition: all 0.2s;
}
.elevator-list .elevator-item:hover,
.elevator-list .elevator-item.active { background-color: #bedbfd; }
.elevator-list .elevator-item img { width: 24px; height: 24px; border-radius: 50%; margin: 0 8px; flex: none; }
.elevator-list .elevator-item.link img { background-color: #fff; }
.elevator-list .elevator-item span {
  opacity: 0; transition: all 0.2s; white-space: nowrap; font-size: 13px;
}
.elevator-content:hover .elevator-list .elevator-item span { opacity: 1; }
.elevator-list .elevator-item.active span { opacity: 1; }

.icon-swiper-link { width: 100%; overflow: hidden; margin: 0 auto; }

.icon-links-scroll-content { position: relative; }

/* 图标可视窗口：左右各留 90px 通道，箭头圆钮居中落在通道里（与插件实测
   位置一致 —— 圆钮紧贴图标网格外侧，垂直居中）。 */
.icon-links-scroll-overflow { overflow: hidden; margin: 0 90px; }
.icon-link-wrap { position: relative; display: flex; flex-wrap: nowrap; width: 100%; }

.icon-link-view { display: inline-block; box-sizing: border-box; flex: none; width: 100%; }
.icon-link-transition-container {
  display: flex; flex-wrap: wrap; position: relative;
  margin: 0 auto; overflow: hidden;
  transition: opacity 0.18s ease;
}
.icon-link-transition-container.pd-fading { opacity: 0; }

.icon-link-item {
  width: 20%; margin: 2px 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  border: 2px solid rgba(0, 0, 0, 0);
  color: rgba(0, 0, 0, 0.65);
}
.icon-link-item-hover {
  display: inline-block; padding: 8px 0; position: relative; cursor: pointer;
  border-radius: 4px; transition: background 0.3s; max-width: 92%;
}
.icon-link-item-view {
  display: block; text-align: center; text-decoration: none;
  font-size: 0; position: relative; margin: 0 auto;
  border-radius: var(--icon-radius);
  width: var(--icon-size); height: var(--icon-size);
  transition: all 0.2s; transform: scale(1);
  box-shadow: 0 0 10px 1px rgba(58, 58, 58, 0.18);
}
.icon-link-item-hover:hover .icon-link-item-view {
  box-shadow: 0 0 10px 1px rgba(58, 58, 58, 0.3); transform: scale(1.05);
}
.icon-link-item-view .icon-item-img {
  position: relative; display: inline-block; overflow: hidden;
  width: 100%; height: 100%; border-radius: var(--icon-radius);
  transition: all 0.2s;
}
.icon-link-item-view .icon-item-img > img { width: 100%; height: 100%; cursor: pointer; display: block; }
.icon-link-item-view .icon-item-img .edit-icon {
  position: absolute; inset: 0; display: none; cursor: pointer;
  border-radius: var(--icon-radius);
  background: rgba(255, 255, 255, 0.6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222226' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 50%;
  justify-content: center; align-items: center;
  transition: opacity 0.3s ease; opacity: 0;
}
.icon-link-item:hover .icon-item-img .edit-icon { display: flex; opacity: 1; }
.icon-link-item-view img.delete {
  position: absolute; top: -15px; right: -15px; z-index: 99;
  display: none; width: 18px; height: 18px; padding: 9px;
  box-sizing: content-box; border-radius: 50%; cursor: pointer;
  background: rgba(34, 34, 38, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/12px no-repeat;
}
.icon-link-item:hover .icon-link-item-view img.delete { display: block; }
.icon-link-title {
  margin-top: 12px; font-size: 14px; line-height: 22px; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; max-width: 100%;
}

/* 左右翻页箭头 */
.left-slick, .right-slick {
  position: absolute; top: 0; width: 100px; height: 100%;
  font-size: 42px; text-align: center; cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
}
.left-slick { left: 0; }
.right-slick { right: 0; }
.left-slick[hidden], .right-slick[hidden] { display: none; }
.left-slick > p, .right-slick > p {
  position: absolute; top: 50%; left: 50%;
  width: 32px; height: 32px; border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  background-size: 100%; background-repeat: no-repeat;
  transform: translateX(-50%) translateY(-50%);
  transition: background-color 0.2s;
}
.left-slick > p { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7L11 16l9 9'/%3E%3C/svg%3E"); }
.right-slick > p { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7l9 9-9 9'/%3E%3C/svg%3E"); }
.left-slick > p:hover, .right-slick > p:hover { background-color: rgba(0, 0, 0, 0.4); }
.left-slick.enable-hover:hover, .right-slick.enable-hover:hover { color: #fff; background: rgba(255, 255, 255, 0.4); }

/* 分页点 */
.link-point-wrap { margin: 0 10px; display: flex; justify-content: center; align-items: center; }
.link-point-view { padding: 8px 0; display: flex; justify-content: space-between; align-items: center; position: relative; }
.link-point-view .point-item {
  width: 16px; height: 16px; margin: 0 13px; cursor: pointer;
  border-radius: 50%; background-color: rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s;
}
.link-point-view .point-item.active { background-color: #fff; }

/* ==================================================== 右上 / 右下角 ==*/
.settings-icon, .user-icon {
  position: fixed; top: 32px; z-index: 11;
  width: 40px; height: 40px; border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  background-size: 100%; background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: background-color 0.2s, filter 0.2s;
}
.settings-icon:hover, .user-icon:hover { background-color: rgba(0, 0, 0, 0.4); filter: brightness(1.1); }
.settings-icon { right: 86px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 15h16M12 20h16M12 25h16'/%3E%3C/svg%3E"); }
.user-icon { right: 30px; }

/* 头像下拉：WordPress 式的「后台入口」 */
.user-icon .avatar-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 0; user-select: none;
}
.user-icon.has-photo .avatar-text { display: none; }

.avatar-menu {
  position: fixed; top: 82px; right: 24px; z-index: 100010;
  width: 264px; padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(34, 34, 38, 0.06);
  color: var(--color-text-1);
  transform-origin: 100% 0;
  animation: avm-in 0.16s ease-out;
}
@keyframes avm-in { from { opacity: 0; transform: scale(0.94) translateY(-4px); } to { opacity: 1; transform: none; } }
.avatar-menu[hidden] { display: none; }

.avm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 11px;
  border-bottom: 1px solid rgba(34, 34, 38, 0.08);
  margin-bottom: 5px;
}
.avm-head .av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #1a87ff, #6a5cff);
  color: #fff; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.avm-head .nm { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.avm-head .rl { font-size: 11.5px; color: var(--color-text-3); line-height: 1.4; }

.avm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13px; color: var(--color-text-1);
  border: 0; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.avm-item:hover { background: rgba(26, 135, 255, 0.1); }
.avm-item .ic { width: 18px; text-align: center; font-size: 14px; opacity: 0.72; flex: none; }
.avm-item .spacer { flex: 1; }
.avm-item .hint { font-size: 11px; color: var(--color-text-3); }
.avm-item.primary { background: rgba(26, 135, 255, 0.1); font-weight: 600; }
.avm-item.primary:hover { background: rgba(26, 135, 255, 0.18); }
.avm-item.danger { color: #d4380d; }
.avm-item.danger:hover { background: rgba(212, 56, 13, 0.1); }
.avm-sep { height: 1px; margin: 5px 8px; background: rgba(34, 34, 38, 0.08); }

/* ---- 头像菜单里的「账户与备份」（照 CSDN 头像卡：信息行 + 立即备份 / 恢复 / 回滚） ---- */
.avm-sub {
  padding: 5px 10px 1px; font-size: 11px; font-weight: 600;
  color: var(--color-text-3); letter-spacing: 0.4px;
}
.avm-line {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; font-size: 12.5px; color: var(--color-text-1);
}
.avm-line > span:first-child { color: var(--color-text-3); flex: none; }
.avm-line .v {
  flex: 1; min-width: 0; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avm-mini {
  flex: none; height: 22px; padding: 0 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(26, 135, 255, 0.35); background: rgba(26, 135, 255, 0.08);
  color: #1a87ff; font-family: inherit; font-size: 11.5px;
}
.avm-mini:hover { background: rgba(26, 135, 255, 0.16); }
.avm-mini[disabled] { opacity: 0.45; cursor: not-allowed; }
.avm-btnrow { display: flex; gap: 8px; padding: 7px 10px 4px; }
.avm-btn {
  flex: 1; height: 30px; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--color-text-1);
  border: 1px solid rgba(34, 34, 38, 0.14); background: rgba(255, 255, 255, 0.7);
}
.avm-btn:hover { border-color: rgba(26, 135, 255, 0.5); color: #1a87ff; }
.avm-btn.primary {
  border-color: transparent; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #1a87ff, #6a5cff);
}
.avm-btn.primary:hover { color: #fff; filter: brightness(1.06); }

/* 右下角壁纸控制 */
.bg-wrap .wallpaper-controlls {
  position: fixed; bottom: 30px; right: 22px; z-index: 11;
  width: 112px; text-align: right; font-size: 0;
}
.bg-wrap .wallpaper-controlls .changeWallpaper,
.bg-wrap .wallpaper-controlls .openWallpaper {
  width: 40px; height: 40px; margin-right: 16px;
  border-radius: 50%; display: inline-block;
  background-color: rgba(0, 0, 0, 0.2);
  background-size: 100%; background-repeat: no-repeat;
  cursor: pointer;
  transition: background-color 0.2s, filter 0.2s;
}
.bg-wrap .wallpaper-controlls .changeWallpaper:hover,
.bg-wrap .wallpaper-controlls .openWallpaper:hover {
  filter: brightness(1.1); background-color: rgba(0, 0, 0, 0.4);
}
.bg-wrap .wallpaper-controlls .changeWallpaper {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M31 22a11 11 0 1 1-3.2-7.8'/%3E%3Cpath d='M31 11v5h-5'/%3E%3C/svg%3E");
}
.bg-wrap .wallpaper-controlls .openWallpaper {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='10' y='11' width='20' height='18' rx='2.5'/%3E%3Cpath d='M10 24l5-4.5 4 3.5 4.5-5L30 24'/%3E%3Ccircle cx='16' cy='17' r='1.6' fill='%23fff' stroke='none'/%3E%3C/svg%3E");
  margin-right: 8px; background-size: 75%; background-position: 50%;
}

/* ⚠️ 右下角碰撞修正：全局吐司钉在 right:20px / bottom:20px（z-index 200），
   而上面「换壁纸 / 壁纸库」两个常驻按钮也在右下角（z-index 11）—— 吐司一出现就把
   按钮整片盖住，它停留的 2~3 秒里两个按钮点不动（交互链路脚本已实测复现：
   elementFromPoint 返回 DIV.toast）。
   前台激活时把吐司整体抬到按钮之上（按钮占 30~70px，吐司抬到 88px 起，互不遮挡）。
   #toasts 与 #portal-page 同为 body 直接子节点，兄弟选择器即可只在前台生效，
   后台不受影响。 */
#portal-page:not([hidden]) ~ #toasts { bottom: 88px; }

/* ================================================== 壁纸库 / 设置弹层 ==
 * 视觉口径照 CSDN 浏览器助手（实测量取自其截图）：
 *   · 整块是**暗玻璃**：深色半透明 + 背景模糊，压在任意壁纸上都可读
 *   · 选中项底色 = 浅蓝灰 #98a5b7（参考里「必应壁纸」药丸 / 左栏选中行的实测值）
 *   · 强调色 = #1890ff（参考的单选圆点、开关、勾选徽标、选中缩略图描边）
 *   · 输入框/按钮 = 透明底 + 1px 浅边框 + 圆角 10px
 * ==========================================================================*/
.pd-sheet-mask {
  position: absolute; inset: 0; z-index: 100020;
  background: rgba(0, 0, 0, 0.34);
  display: flex; align-items: center; justify-content: center;
  animation: pd-fade 0.16s ease-out;
}
@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }

/* 暗玻璃令牌 —— 挂在使用者身上，子元素继承 */
.pd-sheet, .pd-win {
  --pd-accent: #1890ff;
  --pd-pill: #98a5b7;
  --pd-panel: rgba(20, 21, 24, 0.80);
  --pd-head: rgba(0, 0, 0, 0.32);
  --pd-line: rgba(255, 255, 255, 0.10);
  --pd-t1: #fff;
  --pd-t2: rgba(255, 255, 255, 0.72);
  --pd-t3: rgba(255, 255, 255, 0.46);
}

/* 「窗口」：壁纸设置 / 浏览器助手两个面板共用 */
.pd-win {
  width: 820px; max-width: calc(100vw - 56px);
  max-height: calc(100vh - 88px);
  border-radius: 12px; overflow: hidden;
  background: var(--pd-panel);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--pd-line);
  color: var(--pd-t1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
  animation: pd-pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.pd-win.pd-win-sm { width: 560px; }

.pd-win-h {
  display: flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 14px; flex: none;
  background: var(--pd-head);
  border-bottom: 1px solid var(--pd-line);
}
.pd-win-h h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.2px; }
.pd-win-h .ic { width: 18px; height: 18px; display: block; flex: none; }
.pd-win-h .spacer { flex: 1; }
.pd-win-h .x {
  width: 26px; height: 26px; border-radius: 6px; border: 0; cursor: pointer;
  background: transparent; color: var(--pd-t2);
  font-size: 15px; line-height: 1; font-family: inherit; flex: none;
}
.pd-win-h .x:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* 标题栏右侧的「文字 + 开关」组合（参考：每日更新壁纸） */
.pd-swlab { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pd-t1); }
.pd-switch {
  width: 38px; height: 20px; border-radius: 999px; border: 0; padding: 0;
  background: rgba(255, 255, 255, 0.24); position: relative;
  cursor: pointer; flex: none; transition: background 0.18s;
}
.pd-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: left 0.18s;
}
.pd-switch.on { background: var(--pd-accent); }
.pd-switch.on::after { left: 20px; }

/* 两个等宽 Tab（参考：网站商城 / 布局设置） */
.pd-win-tabs { display: flex; flex: none; border-bottom: 1px solid var(--pd-line); }
.pd-wtab {
  flex: 1; height: 44px; border: 0; cursor: pointer; font-family: inherit;
  font-size: 13.5px; color: var(--pd-t3); background: transparent;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border-right: 1px solid var(--pd-line); transition: background 0.15s, color 0.15s;
}
.pd-wtab:last-child { border-right: 0; }
.pd-wtab .ic { width: 16px; height: 16px; opacity: 0.45; }
.pd-wtab:hover { background: rgba(255, 255, 255, 0.05); }
.pd-wtab.on { background: rgba(255, 255, 255, 0.10); color: #fff; }
.pd-wtab.on .ic { opacity: 1; }

/* 搜索行（参考：搜索名称 + 自定义） */
.pd-win-search { display: flex; flex-direction: column; padding: 12px 14px 4px; flex: none; }
/* 搜索行：输入框 + 「自定义」按钮（两者一行；下面的添加表单另起一块） */
.pd-ba-top { display: flex; gap: 10px; }
.pd-input {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.04);
}
.pd-input .ic { width: 15px; height: 15px; flex: none; opacity: 0.8; }
.pd-input input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px; color: #fff;
}
.pd-input input::placeholder { color: rgba(255, 255, 255, 0.62); }
.pd-input:focus-within { border-color: var(--pd-accent); box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.16); }
.pd-cust {
  height: 36px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.04); color: #fff;
  font-family: inherit; font-size: 13px;
  display: flex; align-items: center; gap: 5px; flex: none;
}
.pd-cust:hover { background: rgba(255, 255, 255, 0.10); }
.pd-cust .plus { color: var(--pd-accent); font-size: 16px; line-height: 1; font-weight: 600; }
/* 展开状态（表单已打开）—— 与磁贴的选中态同一种视觉语言 */
.pd-cust.on { border-color: var(--pd-accent); background: rgba(24, 144, 255, 0.18); }

/* ---- 「自定义」就地展开的添加表单（照 CSDN 参考图：输入网址 / 输入名称 / 图标URL） ---- */
.pd-addform {
  margin-top: 10px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--pd-line); background: rgba(255, 255, 255, 0.06);
}
.pd-af-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pd-af-row > span { width: 58px; flex: none; font-size: 12.5px; color: var(--pd-t2); }
.pd-af-row input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--pd-line); background: rgba(0, 0, 0, 0.22);
  color: var(--pd-t1); font-family: inherit; font-size: 13px;
}
.pd-af-row input::placeholder { color: var(--pd-t2); }
.pd-af-row input:focus { outline: 0; border-color: var(--pd-accent); }
.pd-af-pv {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 8px;
  font-size: 12px; color: var(--pd-t2);
}
.pd-af-pv img {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  object-fit: cover; background: rgba(255, 255, 255, 0.08);
}
.pd-af-foot { display: flex; align-items: center; gap: 8px; }
.pd-af-msg { flex: 1; min-width: 0; font-size: 12px; color: var(--pd-t2); }
/* 类型分段（网页 / 本地快捷方式）—— 复用 .pd-seg 的外观，只收一下高度 */
.pd-af-seg { margin-bottom: 10px; }
.pd-af-seg .pd-segbtn { height: 26px; padding: 0 12px; font-size: 12px; }

/* 主体：左侧栏 + 右内容 */
.pd-win-b { display: flex; flex: 1; min-height: 0; }
.pd-rail {
  width: 200px; flex: none; overflow: auto;
  padding: 14px 0; border-right: 1px solid var(--pd-line);
}
.pd-rail.pd-rail-narrow { width: 134px; }

/* 左栏条目通用（图标 + 文字，满宽行） */
.pd-railitem {
  width: 100%; border: 0; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px;
  background: transparent; color: #fff;
  font-size: 13.5px; text-align: left; transition: background 0.15s;
}
.pd-railitem .ic { width: 18px; height: 18px; flex: none; opacity: 0.5; }
.pd-railitem:hover { background: rgba(255, 255, 255, 0.06); }
.pd-railitem.on { background: var(--pd-pill); color: #fff; }
.pd-railitem.on .ic { opacity: 1; }

/* 壁纸设置的来源单选行：白圆点 → 选中变「白环 + 蓝心」，整行右圆角药丸 */
.pd-srcitem {
  width: 100%; border: 0; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 12px;
  height: 34px; margin: 6px 0; padding: 0 14px;
  background: transparent; color: #fff;
  font-size: 13.5px; text-align: left;
  border-radius: 0 999px 999px 0; transition: background 0.15s;
}
.pd-srcitem .dot {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: #fff; box-shadow: 0 0 0 0 transparent;
}
.pd-srcitem:hover { background: rgba(255, 255, 255, 0.08); }
.pd-srcitem.on { background: var(--pd-pill); }
.pd-srcitem.on .dot { background: var(--pd-accent); box-shadow: 0 0 0 2px #fff; }

.pd-main { position: relative; flex: 1; min-width: 0; overflow: auto; padding: 16px 18px; }

/* 3 列缩略图网格（壁纸设置） */
.pd-wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pd-wcell {
  position: relative; aspect-ratio: 16 / 9; border-radius: 6px;
  cursor: pointer; overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}
.pd-wcell .im {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  border-radius: 6px; transition: inset 0.16s, border-color 0.16s;
  /* 外链缩略图用 <img> 渲染（这样才能用 onerror 回落大图），这里把裁切口径对齐背景图 */
  object-fit: cover;
}
.pd-wcell:hover .im { filter: brightness(1.08); }
.pd-wcell.on { background: var(--pd-pill); }
.pd-wcell.on .im {
  inset: 9px; border: 2px solid var(--pd-accent); border-radius: 5px;
}
.pd-wcell .cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  font-size: 11px; color: #fff; padding: 12px 8px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.66));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 勾选徽标：整块用一张 data-URI SVG，避免圆+勾两个元素各自对齐 */
.pd-check {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  width: 22px; height: 22px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%231890ff'/%3E%3Cpath d='M6.8 12.4l3.4 3.4L17.2 8.8' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.pd-wcell.on .pd-check { right: 4px; top: 4px; width: 24px; height: 24px; }

/* ---- 纯色壁纸：「自定义颜色」卡片 + 取色器（参考图1） ---- */
.pd-wcell.is-custom .im { display: flex; align-items: center; justify-content: center; }
.pd-custom-box {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: #fff; font-size: 12.5px; letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.pd-custom-box b { font-weight: 400; }
.pd-custom-ico { width: 34px; height: 34px; background: center/contain no-repeat; display: block; }

/* 取色器：参考图里是「白卡片」压在暗玻璃上，照抄 */
.pd-picker {
  position: absolute; z-index: 30; width: 268px; padding: 12px;
  border-radius: 8px; background: #fff; color: #333;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.pd-pk-sv { position: relative; height: 170px; border-radius: 3px; cursor: crosshair; }
.pd-pk-bar { position: relative; height: 12px; border-radius: 999px; margin-top: 10px; cursor: pointer; }
.pd-pk-alpha { background-color: #efefef; }
.pd-pk-dot {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.pd-pk-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pd-pk-mode { font-size: 12px; color: #666; flex: none; }
.pd-pk-hex {
  flex: 1; min-width: 0; font-family: inherit; font-size: 12.5px; text-transform: uppercase;
  padding: 6px 9px; border-radius: 3px; border: 1px solid #e2e2e2;
  background: #fff; color: #333; outline: 0;
}
.pd-pk-hex:focus { border-color: #1890ff; }
.pd-pk-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.pd-pk-foot .pd-btn { color: #333; border-color: #d9d9d9; padding: 5px 14px; }
.pd-pk-foot .pd-btn:hover { border-color: #1890ff; color: #1890ff; background: rgba(24, 144, 255, 0.06); }

/* ---- 本地壁纸：轮播设置行 + 单张移除角标 ---- */
.pd-car { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pd-car-sel {
  font-family: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06);
  color: #fff; outline: 0;
}
.pd-car-sel option { background: #23242a; color: #fff; }
.pd-del {
  position: absolute; right: 4px; bottom: 4px; z-index: 4;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; color: #fff; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.15s;
}
.pd-wcell:hover .pd-del { opacity: 1; }
.pd-del:hover { background: #d4380d; }

/* 3 列磁贴网格（浏览器助手 / 快捷入口） */
.pd-tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.pd-tile {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: #fff; padding: 0;
}
.pd-tile .box {
  position: relative; width: 62px; height: 62px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s;
}
.pd-tile:hover .box { transform: translateY(-2px); }
.pd-tile .box img { width: 38px; height: 38px; display: block; }
.pd-tile .box .glyph {
  font-size: 22px; font-weight: 700; color: #fff; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
}
.pd-tile .nm {
  font-size: 12.5px; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; opacity: 0.94;
}
/* 勾选徽标位置：**磁贴右下角**。
   参考图2 里 GitHub / 猫如意 那两个「已添加」的磁贴，蓝勾都压在圆角块的右下角，
   不是右上角（这点和壁纸网格相反 —— 壁纸网格的勾在右上角，见上面 .pd-wcell.on）。
   两个面板刻意分开写，别合并成一条通用规则。 */
.pd-tile .pd-check { right: -3px; bottom: -3px; top: auto; width: 19px; height: 19px; }
.pd-tile .box .pd-check { right: -4px; bottom: -4px; top: auto; }
.pd-tile .box { position: relative; }

.pd-grid-empty {
  grid-column: 1 / -1; padding: 34px 10px; text-align: center;
  font-size: 12.5px; color: var(--pd-t3);
}

/* ---- 小表单弹层（添加 / 编辑快捷方式）沿用同一套暗玻璃语言 ---- */
.pd-sheet {
  width: 660px; max-width: calc(100vw - 48px);
  max-height: calc(100vh - 96px);
  border-radius: 12px; overflow: hidden;
  background: var(--pd-panel);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--pd-line);
  color: var(--pd-t1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
  animation: pd-pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes pd-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.pd-sheet-h {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px; flex: none;
  background: var(--pd-head); border-bottom: 1px solid var(--pd-line);
}
.pd-sheet-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pd-sheet-h .spacer { flex: 1; }
.pd-sheet-h .x {
  width: 26px; height: 26px; border-radius: 6px; border: 0; cursor: pointer;
  background: transparent; color: var(--pd-t2); font-size: 15px; line-height: 1; font-family: inherit;
}
.pd-sheet-h .x:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pd-sheet-b { padding: 16px 18px; overflow: auto; }
.pd-sheet-f {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px; border-top: 1px solid var(--pd-line);
  background: rgba(0, 0, 0, 0.18);
}
.pd-btn {
  font-family: inherit; font-size: 13px; cursor: pointer;
  padding: 7px 15px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent; color: var(--pd-t1);
  transition: all 0.15s;
}
.pd-btn:hover { border-color: #fff; background: rgba(255, 255, 255, 0.10); }
.pd-btn.primary { background: var(--pd-accent); border-color: var(--pd-accent); color: #fff; }
.pd-btn.primary:hover { background: #0f76e8; border-color: #0f76e8; }
.pd-btn.danger { color: #ff7875; border-color: rgba(255, 120, 117, 0.42); }
.pd-btn.danger:hover { background: #d4380d; border-color: #d4380d; color: #fff; }
.pd-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.pd-field { margin-bottom: 13px; }
.pd-field > label { display: block; font-size: 12.5px; color: var(--pd-t2); margin-bottom: 5px; }
.pd-field input[type=text], .pd-field select {
  width: 100%; font-family: inherit; font-size: 13px;
  padding: 8px 11px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06); color: #fff; outline: 0;
}
.pd-field select option { background: #23242a; color: #fff; }
.pd-field input[type=text]::placeholder { color: rgba(255, 255, 255, 0.42); }
.pd-field input[type=text]:focus, .pd-field select:focus {
  border-color: var(--pd-accent); box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.18);
}
.pd-field .hint { font-size: 11.5px; color: var(--pd-t3); margin-top: 4px; }

/* 设置里的来源/引擎小卡（沿用 3 列网格，但高度更矮） */
.pd-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pd-mini .m {
  position: relative; height: 58px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--pd-line); background: rgba(255, 255, 255, 0.05);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--pd-t2); font-size: 11.5px;
}
.pd-mini .m:hover { background: rgba(255, 255, 255, 0.10); }
.pd-mini .m.on { border-color: var(--pd-accent); background: rgba(24, 144, 255, 0.16); color: #fff; }
.pd-mini .m img { width: 20px; height: 20px; display: block; }
.pd-mini .m.on .pd-check { right: -4px; top: -4px; width: 18px; height: 18px; }

.pd-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.pd-tabs .t {
  font-size: 13px; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  color: var(--pd-t2); background: rgba(255, 255, 255, 0.08);
  border: 0; font-family: inherit;
}
.pd-tabs .t.on { background: var(--pd-accent); color: #fff; }

/* 壁纸设置右侧的「图片来源说明」小字 */
.pd-srcnote { font-size: 11.5px; color: var(--pd-t3); margin-top: 12px; line-height: 1.6; }
.pd-srcnote a { color: var(--pd-accent); text-decoration: none; }

/* ========================================== 浅色壁纸下的文字配色翻转 ==
 * 插件在浅色壁纸下会把时间/日期/图标标题改成深色，否则白字看不清。
 * 判定逻辑在 portal.js 的 isDarkBg()，结果写在 #portal-page[data-bg]。
 * ==========================================================================*/
#portal-page[data-bg="light"] .date-time-view .time,
#portal-page[data-bg="light"] .date-time-view .date,
#portal-page[data-bg="light"] .date-time-view .time-type,
#portal-page[data-bg="light"] .small-weather .city-name,
#portal-page[data-bg="light"] .small-weather .city-temp span,
#portal-page[data-bg="light"] .small-weather .curtemp,
#portal-page[data-bg="light"] .icon-link-title { color: #222226; }

#portal-page[data-bg="light"] .date-time-view .time { text-shadow: 0 8px 12px rgba(255, 255, 255, 0.35); }

#portal-page[data-bg="light"] .left-slick,
#portal-page[data-bg="light"] .right-slick { color: rgba(34, 34, 38, 0.5); }
#portal-page[data-bg="light"] .left-slick > p,
#portal-page[data-bg="light"] .right-slick > p { background-color: rgba(255, 255, 255, 0.55); }

#portal-page[data-bg="light"] .settings-icon,
#portal-page[data-bg="light"] .user-icon,
#portal-page[data-bg="light"] .wallpaper-controlls .changeWallpaper,
#portal-page[data-bg="light"] .wallpaper-controlls .openWallpaper { background-color: rgba(34, 34, 38, 0.16); }

#portal-page[data-bg="light"] .link-point-view .point-item { background-color: rgba(34, 34, 38, 0.22); }
#portal-page[data-bg="light"] .link-point-view .point-item.active { background-color: #222226; }

/* 小屏适配：左半边收窄时，看板改为压在壁纸上可滚动 */
@media (max-width: 1240px) {
  .portal-left { flex: 0 1 44%; min-width: 340px; }
  #portal-page .main { flex: 1 1 auto; }
  .date-time-view .time { font-size: 84px; }
  #portal-page { --searchbar-width: 520px; --icon-size: 60px; }
  .icon-link-item { width: 25%; }
}
@media (max-width: 900px) {
  #portal-page .content { flex-direction: column; justify-content: flex-start; padding-top: 64px; overflow: auto; }
  .portal-left { flex: none; width: 100%; max-width: 640px; max-height: none; }
  #portal-page .main { flex: none; padding: 24px 0 40px; }
}

/* ============================================================ 布局设置（需求4）
 * 参考图4：单列卡片流 + 卡片分组。所有控件都驱动真实样式变量。
 * ====================================================================*/
#portal-page {
  --bar-scale: 1;
  --bar-radius: 15px;
  --bar-bg-a: 0.5;
  --icon-cols: 5;
}
#portal-page .search-input-out {
  width: calc(645.67px * var(--bar-scale));
  height: calc(56.92px * var(--bar-scale));
}
#portal-page .search-input-out .globar-blur-glass {
  border-radius: var(--bar-radius) !important;
  background: rgba(255, 255, 255, var(--bar-bg-a));
}
#portal-page .search-input { border-radius: var(--bar-radius); }
#portal-page .search-input-out .search-submit {
  border-radius: 0 var(--bar-radius) var(--bar-radius) 0;
}
#portal-page .icon-link-item { width: calc(100% / var(--icon-cols)); }

/* 主视图四种形态（参考图4 的第一组卡片） */
#portal-page[data-view="simple"] .contain-icon-view,
#portal-page[data-view="simple"] .small-weather,
#portal-page[data-view="simple"] .date-time-view { display: none; }
#portal-page[data-view="time"] .contain-icon-view,
#portal-page[data-view="time"] .search-box,
#portal-page[data-view="time"] .small-weather { display: none; }
/* 「旧版」：修掉了「图标竖着排」的 bug —— 原先把 .icon-link-item 撑成 100% 宽，
   于是每行只放得下 1 个、整列竖排。现在改回网格（每行 4 个），只在圆角、
   标题间距、分组标题上做区分。 */
#portal-page[data-view="old"] .icon-link-item { width: calc(100% / 4); }
#portal-page[data-view="old"] .icon-link-item-view { border-radius: 22%; }
#portal-page[data-view="old"] .icon-link-item-view .icon-item-img { border-radius: 22%; }
#portal-page[data-view="old"] .icon-link-title { margin-top: 7px; font-size: 13px; }
#portal-page[data-view="old"] .icon-group-h { display: none; }

/* 卡片流 */
.pd-cards { padding: 14px 16px 18px; }
.pd-card {
  border-radius: 9px; padding: 12px 14px 14px; margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--pd-line);
}
.pd-card:last-child { margin-bottom: 0; }
.pd-card-h { font-size: 13px; color: var(--pd-t1); margin-bottom: 10px; font-weight: 400; }

/* 一行设置：左标签、右控件 */
.pd-row { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.pd-row .spacer { flex: 1; }
.pd-row-lab { font-size: 12.5px; color: var(--pd-t2); display: flex; align-items: center; gap: 7px; }

/* 主视图四张预览卡（2×2，照参考图4） */
.pd-viewgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pd-viewcard {
  position: relative; border: 0; cursor: pointer; font-family: inherit;
  background: transparent; padding: 0 0 2px; display: flex; flex-direction: column; gap: 6px;
  color: var(--pd-t2);
}
.pd-viewcard .pv {
  display: block; position: relative; height: 56px; border-radius: 7px; overflow: hidden;
  background: #fff;
}
.pd-viewcard.on .pv { outline: 2px solid var(--pd-accent); outline-offset: -2px; }
.pd-viewcard b { font-size: 12px; font-weight: 400; }
.pd-viewcard.on b { color: #fff; }
.pd-viewcard .pd-check { right: -4px; top: -4px; width: 18px; height: 18px; }
/* 四种主视图的缩略示意（纯 CSS 画，参考图4 的观感） */
.pd-viewcard .pv-new::before {
  content: ''; position: absolute; left: 8px; right: 8px; top: 9px; height: 12px;
  border-radius: 3px; background: #d8e6fb;
}
.pd-viewcard .pv-new::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 27px; height: 20px;
  background-image: radial-gradient(circle, #9db8e0 2.6px, transparent 2.8px);
  background-size: 19px 10px; background-position: 1px 1px;
}
.pd-viewcard .pv-old::before {
  content: ''; position: absolute; left: 8px; right: 8px; top: 9px; height: 38px;
  background: repeating-linear-gradient(to bottom, #c9d6e6 0 3px, transparent 3px 10px);
}
.pd-viewcard .pv-simple::before {
  content: ''; position: absolute; left: 12px; right: 12px; top: 24px; height: 8px;
  border-radius: 4px; background: #d8e6fb;
}
.pd-viewcard .pv-time::before {
  content: '9:59'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #b9c6d8; letter-spacing: 1px;
}

/* 滑块 + 数值框 */
.pd-range {
  -webkit-appearance: none; appearance: none;
  width: 118px; height: 3px; border-radius: 2px; flex: none;
  background: rgba(255, 255, 255, 0.26); outline: 0; cursor: pointer;
}
.pd-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.pd-num {
  display: flex; align-items: center; gap: 1px; flex: none;
  width: 58px; height: 26px; padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--pd-line); background: rgba(255, 255, 255, 0.06);
  font-size: 12px; color: var(--pd-t2);
}
.pd-num input {
  width: 100%; min-width: 0; border: 0; background: transparent; outline: 0;
  font-family: inherit; font-size: 12.5px; color: #fff; text-align: center;
}
.pd-num i { font-style: normal; }

/* 单选圆点（预设布局 / 自定义布局） */
.pd-radio {
  width: 15px; height: 15px; border-radius: 50%; flex: none; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.5); background: transparent; padding: 0;
}
.pd-radio.on { border-color: var(--pd-accent); background: radial-gradient(circle, var(--pd-accent) 0 4px, transparent 4.5px); }


/* 其他设置里的小输入框（天气地区） */
.pd-tin {
  width: 132px; height: 28px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--pd-line); background: rgba(255, 255, 255, 0.06);
  color: #fff; font-family: inherit; font-size: 12.5px; outline: 0;
}
.pd-tin::placeholder { color: rgba(255, 255, 255, 0.5); }
.pd-tin:focus { border-color: var(--pd-accent); }
.pd-card .pd-row .pd-btn { height: 28px; padding: 0 12px; font-size: 12.5px; }


/* ============================================================ 快捷图标分组（需求3）
 * 同一分组的图标排在一段里，段首是小组标题；未分组的排在最前且不显示标题
 * （没分组时观感跟改版前完全一致）。
 * ====================================================================*/
.icon-group { width: 100%; flex: none; }
.icon-group-grid { display: flex; flex-wrap: wrap; align-items: flex-start; }
.icon-group-h {
  display: flex; align-items: center; gap: 7px;
  margin: 10px 0 4px; padding-left: 6px;
  font-size: 13px; line-height: 20px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
}
.icon-group-h i {
  display: block; flex: none; width: 7px; height: 7px; border-radius: 2px;
}
.icon-group-h .n {
  font-size: 11px; color: rgba(255, 255, 255, 0.46);
}

/* 本地桌面快捷方式：右上角「本地」角标，一眼区分网页图标 */
.icon-link-item.pd-local .icon-item-img { position: relative; }
.icon-link-item.pd-local .local-tag {
  position: absolute; right: -3px; top: -3px; z-index: 2;
  padding: 1px 5px; border-radius: 7px;
  font-size: 10px; line-height: 14px; color: #fff;
  background: rgba(20, 21, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

/* 分段选择（对话框里的「网页 / 本地快捷方式」） */
.pd-seg {
  display: inline-flex; gap: 0; padding: 2px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pd-line);
}
.pd-segbtn {
  height: 28px; padding: 0 14px; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--pd-t2);
  font-family: inherit; font-size: 12.5px;
}
.pd-segbtn.on { background: var(--pd-accent); color: #fff; }
.pd-segbtn:hover { color: #fff; }

/* 对话框里的「删除」按钮与「保存」拉开距离 */
.pd-sheet-f .pd-btn.danger { margin-right: auto; }
.pd-sheet-f { display: flex; gap: 9px; }


/* ============================================================ 未登录只读态（需求6）
 * 头像换成「登录」，看板位置给登录引导卡。
 * ====================================================================*/
.avatar-text.is-guest, #pd-avatar.is-guest {
  font-size: 11px; letter-spacing: 0; color: #fff;
}
.avm-head .av.is-guest { font-size: 13px; }
.pd-guestcard { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pd-guestcard .pd-empty { margin: 0; }
.pd-guesttip {
  font-size: 12px; line-height: 1.7; color: rgba(255, 255, 255, 0.62);
  padding-left: 10px; border-left: 2px solid rgba(24, 144, 255, 0.6);
}


/* ============================================ 我的收藏（需求5 · 照 Pinbox）
 * 主题色走 --fv-accent，两个外观开关走 data-dark / data-tight，
 * 卡片/列表走 data-mode。所有颜色都用变量，切主题色不用重绘。
 * ====================================================================*/
.pd-main.pd-favs {
  --fv-accent: #1890ff;
  --fv-bg: rgba(255, 255, 255, 0.05);
  --fv-line: rgba(255, 255, 255, 0.10);
  --fv-t1: #fff;
  --fv-t2: rgba(255, 255, 255, 0.70);
  --fv-t3: rgba(255, 255, 255, 0.44);
  padding: 0;
  display: flex;
  flex-direction: column;
}
.pd-main.pd-favs[data-dark="1"] { background: rgba(0, 0, 0, 0.55); }
.pd-main.pd-favs[data-tight="1"] { --fv-gap: 6px; }
.pd-main.pd-favs { --fv-gap: 10px; }

/* 左栏计数 */
.fv-cnt {
  margin-left: auto; padding: 0 6px; border-radius: 8px;
  font-size: 11px; line-height: 16px; color: var(--pd-t3);
  background: rgba(255, 255, 255, 0.08);
}

/* 工具条 */
.fv-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px 8px; flex: none;
}
.fv-search {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--fv-line); background: rgba(255, 255, 255, 0.04);
}
.fv-search .ic { width: 14px; height: 14px; flex: none; opacity: 0.75; }
.fv-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--fv-t1);
}
.fv-search input::placeholder { color: var(--fv-t3); }
.fv-search:focus-within { border-color: var(--fv-accent); }
.fv-tbtn {
  height: 32px; padding: 0 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--fv-line); background: rgba(255, 255, 255, 0.04);
  color: var(--fv-t2); font-family: inherit; font-size: 12.5px;
}
.fv-tbtn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.fv-tbtn.on { color: #fff; background: var(--fv-accent); border-color: transparent; }
.fv-tbtn.danger { color: #ff9a9a; }
.fv-tbtn.danger:hover { background: rgba(220, 60, 60, 0.22); color: #fff; }
.fv-sync { font-size: 12px; color: var(--fv-t3); }
.fv-sync[data-st="ok"] { color: #7fe0b0; }
.fv-sync[data-st="fail"] { color: #ff9a9a; }
.fv-sync[data-st="saving"], .fv-sync[data-st="pending"] { color: #ffd479; }

/* 筛选 chip */
.fv-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 8px; flex: none; }
.fv-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 4px 0 10px; border-radius: 12px;
  font-size: 12px; color: #fff; background: var(--fv-accent);
}
.fv-chip i { cursor: pointer; font-style: normal; padding: 0 6px; opacity: 0.85; }
.fv-chip i:hover { opacity: 1; }

/* 批量条 */
.fv-batch {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin: 0 14px 8px; padding: 7px 10px; border-radius: 9px;
  font-size: 12.5px; color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--fv-line);
}

.fv-body { flex: 1; overflow: auto; padding: 0 14px 16px; }
.fv-empty { padding: 40px 0; text-align: center; font-size: 13px; color: var(--fv-t3); }

/* 分组标题 */
.fv-sec { margin-bottom: 14px; }
.fv-sech {
  display: flex; align-items: center; gap: 7px;
  margin: 6px 0 8px; font-size: 13px; color: var(--fv-t1);
}
.fv-sech span { font-size: 11px; color: var(--fv-t3); }

/* 卡片 / 列表 */
.fv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--fv-gap); }
.fv-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 11px 12px 9px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--fv-line); background: var(--fv-bg);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.fv-card:hover { border-color: var(--fv-accent); transform: translateY(-1px); }
.fv-card.on { border-color: var(--fv-accent); background: rgba(255, 255, 255, 0.10); }
.fv-top { display: flex; align-items: center; gap: 9px; }
.fv-tile {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
}
.fv-tt { min-width: 0; flex: 1; }
.fv-title {
  font-size: 13px; color: var(--fv-t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fv-host {
  font-size: 11.5px; color: var(--fv-t3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fv-star { color: #ffd479; font-size: 12px; }
.fv-note {
  font-size: 12px; line-height: 1.6; color: var(--fv-t2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fv-tags { display: flex; gap: 5px; flex-wrap: wrap; min-height: 18px; }
.fv-tag {
  padding: 1px 7px; border-radius: 8px; font-size: 11px; cursor: pointer;
  color: var(--fv-t2); background: rgba(255, 255, 255, 0.09);
}
.fv-tag:hover { color: #fff; background: var(--fv-accent); }
.fv-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.fv-a {
  border: 0; background: transparent; cursor: pointer; padding: 2px 6px;
  border-radius: 7px; font-family: inherit; font-size: 11.5px; color: var(--fv-t3);
}
.fv-a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.fv-a.danger:hover { background: rgba(220, 60, 60, 0.28); }

/* 多选勾 */
.fv-chk {
  position: absolute; left: -6px; top: -6px; width: 16px; height: 16px;
  border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(20, 21, 24, 0.9);
}
.fv-chk.on { border-color: var(--fv-accent); background: radial-gradient(circle, var(--fv-accent) 0 4px, transparent 4.5px); }

/* 列表样式 */
.pd-main.pd-favs[data-mode="list"] .fv-grid { grid-template-columns: 1fr; gap: 4px; }
.fv-rows { display: flex; flex-direction: column; gap: 3px; }
.fv-row {
  display: flex; align-items: center; gap: 10px; position: relative;
  padding: 6px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
}
.fv-row:hover { background: rgba(255, 255, 255, 0.06); }
.fv-row.on { border-color: var(--fv-accent); background: rgba(255, 255, 255, 0.09); }
.fv-row .fv-tile { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.fv-rt { font-size: 13px; color: var(--fv-t1); flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-rh { font-size: 11.5px; color: var(--fv-t3); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-rtags { display: flex; gap: 5px; flex: none; }
.fv-racts { display: flex; gap: 4px; flex: none; }

/* 标签墙 */
.fv-tagwall { display: flex; gap: 8px; flex-wrap: wrap; }
.fv-tagbig {
  height: 30px; padding: 0 12px; border-radius: 15px; cursor: pointer;
  border: 1px solid var(--fv-line); background: rgba(255, 255, 255, 0.05);
  font-family: inherit; font-size: 12.5px; color: var(--fv-t2);
}
.fv-tagbig span { margin-left: 6px; font-size: 11px; color: var(--fv-t3); }
.fv-tagbig.on { background: var(--fv-accent); border-color: transparent; color: #fff; }

/* 收藏集树 */
.fv-collist { display: flex; flex-direction: column; gap: 2px; }
.fv-colrow {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 9px; cursor: pointer;
}
.fv-colrow:hover { background: rgba(255, 255, 255, 0.06); }
.fv-colrow.on { background: rgba(255, 255, 255, 0.10); }
.fv-cico { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fv-cnm { font-size: 13px; color: var(--fv-t1); }
.fv-cacts { margin-left: 8px; display: none; gap: 2px; }
.fv-colrow:hover .fv-cacts { display: flex; }

/* 外观对话框里的色块 */
.fv-swatch {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  box-shadow: 0 0 0 2px transparent;
}
.fv-swatch.on { box-shadow: 0 0 0 2px #fff; }

/* 窄屏：卡片降到两列 */
@media (max-width: 860px) {
  .fv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ============================================ 版面排版（R1）+ 整屏滑动（R8）
 * 都由一个 data-layout 属性驱动，避免两条规则互相覆盖。
 *   left/right/top/bottom/hide → 运行看板相对主区的位置
 *   snapx / snapy             → 整屏左右 / 上下吸附滑动
 * ====================================================================*/
#portal-page[data-layout="right"] .content { flex-direction: row-reverse; }
#portal-page[data-layout="top"] .content { flex-direction: column; }
#portal-page[data-layout="bottom"] .content { flex-direction: column-reverse; }
#portal-page[data-layout="hide"] .portal-left { display: none; }
#portal-page[data-layout="top"] .portal-left,
#portal-page[data-layout="bottom"] .portal-left { max-height: 42vh; }
#portal-page[data-layout="top"] .main,
#portal-page[data-layout="bottom"] .main { max-width: none; }

/* 「页面」= .content 的直接子（运行看板 / 主区），整屏吸附 */
#portal-page[data-layout^="snap"] .content {
  gap: 0; overflow: auto; align-items: stretch; justify-content: flex-start;
  scrollbar-width: none; -ms-overflow-style: none;
}
#portal-page[data-layout^="snap"] .content::-webkit-scrollbar { display: none; }
#portal-page[data-layout="snapx"] .content { flex-direction: row; scroll-snap-type: x mandatory; }
#portal-page[data-layout="snapy"] .content { flex-direction: column; scroll-snap-type: y mandatory; }
#portal-page[data-layout^="snap"] .content > * {
  flex: 0 0 auto; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
}
#portal-page[data-layout="snapx"] .content > * { width: 100vw; max-width: none; height: 100%; }
#portal-page[data-layout="snapy"] .content > * { width: 100%; max-width: none; height: 100vh; }
#portal-page[data-layout^="snap"] .portal-left {
  max-height: none; min-width: 0; padding: 24px 16px; overflow: auto;
}
#portal-page[data-layout^="snap"] .main { padding: 24px 16px; }

/* 翻页圆点 */
#pd-snapdots {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 18px; z-index: 30;
  display: flex; gap: 9px; padding: 7px 13px; border-radius: 15px;
  background: rgba(0, 0, 0, 0.26); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#pd-snapdots i {
  display: block; width: 8px; height: 8px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.44); transition: all 0.18s;
}
#pd-snapdots i:hover { background: rgba(255, 255, 255, 0.75); }
#pd-snapdots i.on { width: 22px; border-radius: 5px; background: #fff; }

/* 布局设置里的小号分段控件 / 排序行 / 副标题 */
.pd-seg.pd-seg-s { padding: 2px; }
.pd-seg.pd-seg-s .pd-segbtn { height: 24px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.pd-subh { margin: 14px 0 4px; font-size: 12.5px; color: var(--pd-t2); }
.pd-orow { min-height: 28px; }
.pd-onum {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--pd-t3); background: rgba(255, 255, 255, 0.08);
}
.pd-obtn {
  width: 24px; height: 24px; flex: none; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--pd-line); background: rgba(255, 255, 255, 0.06);
  color: var(--pd-t2); font-size: 12px; line-height: 1;
}
.pd-obtn:hover:not([disabled]) { color: #fff; border-color: var(--pd-accent); }
.pd-obtn[disabled] { opacity: 0.32; cursor: default; }

/* 未登录左栏的内置板块（R7） */
.pd-badge {
  padding: 2px 9px; border-radius: 9px; font-size: 11px;
  color: var(--pd-t2); background: rgba(255, 255, 255, 0.10);
}
.pd-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pd-mod {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
}
.pd-mod .g {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; background: rgba(255, 255, 255, 0.14);
}
.pd-mod b { display: block; font-size: 12.5px; font-weight: 500; color: var(--pd-t1); }
.pd-mod i { font-style: normal; font-size: 11px; color: var(--pd-t3); }
.pd-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.pd-chip {
  padding: 3px 10px; border-radius: 9px; font-size: 12px;
  color: var(--pd-t2); background: rgba(255, 255, 255, 0.08);
}


/* ==================================== 图标全自定义（R4）+ 本地文件选择（R2）
 * ====================================================================*/
/* 图片型图标：白底衬托 + contain 缩放，避免透明 PNG 贴在壁纸上看不清 */
.icon-link-item-view .icon-item-img.has-icon {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.icon-link-item-view .icon-item-img.has-icon > img {
  object-fit: contain; padding: 12%; box-sizing: border-box;
}

/* 本地文件选择：主按钮 + 候选路径 */
.pd-lk-pickrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pd-lk-cands { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.pd-lk-candh { font-size: 12px; color: var(--pd-t2); }
.pd-lk-cand {
  text-align: left; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: 1px dashed var(--pd-line); background: rgba(255, 255, 255, 0.05);
  color: var(--pd-t1); font-family: inherit; font-size: 12px;
  word-break: break-all;
}
.pd-lk-cand:hover { border-style: solid; border-color: var(--pd-accent); }

/* 图标预览 */
.pd-lk-preview {
  display: flex; align-items: center; gap: 10px; margin-top: 9px;
  padding: 9px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.pd-lk-preview img {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  object-fit: contain; background: rgba(255, 255, 255, 0.94); padding: 4px;
  box-sizing: border-box;
}
.pd-lk-preview span { flex: 1; font-size: 12px; color: var(--pd-t2); }

/* 拖拽文件进对话框 */
.pd-sheet.pd-drop { outline: 2px dashed var(--pd-accent); outline-offset: -6px; }

/* 「恢复默认引擎」格子 */
.engines-item.engines-reset .eg-add-box {
  background: rgba(255, 255, 255, 0.16); color: #fff;
}


/* ============================ 我的收藏：菜单 / 发现 / 去重 / 帮助页（R6）
 * ====================================================================*/
#pd-ba-rail.pd-rail-fav { width: 156px; }
.fv-mgroup {
  padding: 11px 10px 5px; font-size: 11.5px; letter-spacing: 0.4px;
  color: var(--pd-t3); user-select: none;
}
.fv-madd {
  display: block; width: calc(100% - 16px); margin: 10px 8px 6px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  border: 1px dashed var(--pd-line); background: transparent;
  color: var(--pd-t2); font-family: inherit; font-size: 12px;
}
.fv-madd:hover { color: #fff; border-color: var(--pd-accent); }

/* 发现：最常收藏的站点 */
.fv-hosts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--fv-gap); }
.fv-hostcard {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 9px 10px; border-radius: 10px; text-align: left;
  border: 1px solid var(--fv-line); background: var(--fv-bg);
  font-family: inherit;
}
.fv-hostcard:hover { border-color: var(--fv-accent); }
.fv-hostcard b { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--fv-t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-hostcard i { font-style: normal; font-size: 11px; color: var(--fv-t3); }

/* 查找重复收藏 */
.fv-dup { padding: 10px 12px; border-radius: 11px; margin-bottom: 8px;
  border: 1px solid var(--fv-line); background: var(--fv-bg); }
.fv-duph { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fv-t1); }
.fv-duph span { font-size: 11px; color: var(--fv-t3); }
.fv-duph .spacer { flex: 1; }
.fv-duprow { margin-top: 6px; font-size: 12px; color: var(--fv-t2); }
.fv-dupt { margin-left: 8px; font-size: 11px; color: var(--fv-t3); }

/* 帮助页 */
.fv-help { padding: 4px 2px; }
.fv-helph { font-size: 13px; color: var(--fv-t1); margin-bottom: 10px; }
.fv-helprow {
  display: flex; gap: 12px; padding: 9px 0;
  border-top: 1px solid var(--fv-line); font-size: 12.5px;
}
.fv-helprow b { flex: none; width: 104px; color: var(--fv-t1); font-weight: 500; }
.fv-helprow span { flex: 1; color: var(--fv-t2); line-height: 1.7; }

/* 收藏集底部的内联新建 */
.fv-colnew { display: flex; gap: 8px; margin-top: 10px; }
.fv-colnew input {
  flex: 1; height: 32px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--fv-line); background: rgba(255, 255, 255, 0.05);
  color: #fff; font-family: inherit; font-size: 12.5px; outline: 0;
}
.fv-colnew input::placeholder { color: var(--fv-t3); }
.fv-colnew input:focus { border-color: var(--fv-accent); }

/* 自定义菜单对话框 */
.fv-mlist { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.fv-mrow { display: flex; align-items: center; gap: 6px; }
.fv-minput {
  flex: 1; min-width: 0; height: 28px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--pd-line); background: rgba(255, 255, 255, 0.05);
  color: #fff; font-family: inherit; font-size: 12.5px; outline: 0;
}
.fv-minput:focus { border-color: var(--pd-accent); }

/* 布局设置里的取色器 */
input[type="color"].pd-color {
  width: 34px; height: 26px; padding: 0; border: 1px solid var(--pd-line);
  border-radius: 7px; background: transparent; cursor: pointer; flex: none;
}
