/* =============================================================
   Davidcolin · 浏览器主页（PHP 版）
   在 base.css（复用自主站启动页）之上扩展：
   搜索引擎下拉、收藏管理、设置抽屉、壁纸与弹窗。
   ============================================================= */

[hidden] { display: none !important; }

body.no-scroll { overflow: hidden; }

/* 让搜索下拉浮在收藏区之上 */
.search { z-index: 20; }

body.no-aurora .bg-aurora { display: none; }
body.no-wallpaper .hero-art { display: none; }

/* ---------------- 顶栏补充 ---------------- */
.settings-btn:hover { transform: rotate(45deg) scale(1.06); }

/* ---------------- 搜索引擎下拉 ---------------- */
.engine { position: relative; flex-shrink: 0; }

.engine-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 42px;
  padding: 0 2px 0 0;
  border-radius: 10px;
  color: var(--ec, #0a84ff);
  transition: opacity .2s;
}
.engine-btn:hover { opacity: .82; }

.engine-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
  white-space: nowrap;
}

.engine-caret {
  width: 13px;
  height: 13px;
  margin-top: 3px;
  color: var(--faint);
  transition: transform .25s;
}
.engine-btn[aria-expanded="true"] .engine-caret { transform: rotate(180deg); }

.engine-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: -12px;
  z-index: 70;
  width: 224px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--shadow);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  animation: menuIn .18s ease both;
}
html[data-theme="dark"] .engine-menu { background: rgba(10, 16, 29, .95); }
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-5px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.engine-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 11px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  transition: background .2s, color .2s;
}
.engine-item:hover { background: rgba(139, 92, 246, .1); color: var(--text); }
.engine-item.active { background: rgba(139, 92, 246, .12); color: var(--text); }

.engine-dot {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  background: var(--ec);
  text-transform: none;
}
.engine-item b { font-weight: 600; }
.engine-check { width: 14px; height: 14px; margin-left: auto; color: var(--c2); opacity: 0; }
.engine-item.active .engine-check { opacity: 1; }

/* ---------------- 收藏区 ---------------- */
.bm-section { padding-top: 44px; }

.sec-tools { display: flex; align-items: center; gap: 12px; }

.bm-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--faint);
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: color .25s, border-color .25s, transform .25s, background .25s;
}
.add-btn svg { width: 14px; height: 14px; }
.add-btn:hover {
  color: var(--text);
  border-color: rgba(139, 92, 246, .45);
  background: rgba(139, 92, 246, .08);
  transform: translateY(-1px);
}

.bm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bm-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 82px;
  padding: 13px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-sm);
  transition: transform .3s, border-color .3s, box-shadow .3s, opacity .2s;
}
.bm-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, .4);
  box-shadow: 0 22px 44px -26px rgba(99, 102, 241, .55), var(--shadow-sm);
}

.bm-main { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }

.bm-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  overflow: hidden;
  color: #fff;
  font-size: 21px;
  line-height: 1;
  background-color: var(--bm, #6366f1);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, .32), rgba(0, 0, 0, .16));
  box-shadow: 0 10px 18px -12px var(--bm, #6366f1);
}
.bm-icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  padding: 2px;
  border-radius: 6px;
  background: #fff;
}
.bm-icon.has-img { background: rgba(255, 255, 255, .92); box-shadow: none; }

.bm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bm-text b {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bm-text i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-edit {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  color: var(--faint);
  opacity: 0;
  transition: opacity .2s, background .2s, color .2s;
}
.bm-edit svg { width: 13px; height: 13px; }
.bm-card:hover .bm-edit,
.bm-card:focus-within .bm-edit { opacity: 1; }
.bm-edit:hover { color: var(--text); background: var(--stroke-2); }

.bm-grip {
  display: grid;
  place-items: center;
  width: 18px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 6px;
  color: var(--faint);
  opacity: .45;
  cursor: grab;
  touch-action: none;
  transition: opacity .2s, background .2s;
}
.bm-grip svg { width: 14px; height: 14px; }
.bm-grip:hover { opacity: .9; background: var(--stroke-2); }
.bm-grip:active { cursor: grabbing; }

.bm-add {
  justify-content: center;
  gap: 7px;
  border-style: dashed;
  background: rgba(255, 255, 255, .12);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
html[data-theme="dark"] .bm-add { background: rgba(15, 23, 39, .24); }
.bm-add svg { width: 16px; height: 16px; }
.bm-add:hover {
  color: var(--c1);
  border-color: rgba(139, 92, 246, .5);
  background: rgba(139, 92, 246, .07);
}

.bm-tip { margin-top: 12px; font-size: 10.8px; letter-spacing: .02em; color: var(--faint); }
.bm-section.is-empty .bm-tip { display: none; }

.bm-card.dragging {
  z-index: 5;
  opacity: .92;
  transform: scale(1.03);
  border-color: rgba(168, 85, 247, .6);
  box-shadow: 0 24px 50px -24px rgba(99, 102, 241, .6);
}
.bm-grid.sorting .bm-card { transition: none; }
body.is-dragging { cursor: grabbing; user-select: none; }

/* ---------------- 设置抽屉 ---------------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 7, 15, .46);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s;
}
.drawer-mask.show { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 91;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100dvh;
  background: #f7f9ff;
  border-left: 1px solid var(--stroke);
  box-shadow: -30px 0 80px -42px rgba(0, 0, 0, .6);
  transform: translateX(102%);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
html[data-theme="dark"] .drawer { background: #0a101d; }
.drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 8px;
}
.drawer-head h2 { font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.drawer-head .sec-kicker { margin-bottom: 4px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--muted);
  transition: color .2s, background .2s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--text); background: var(--stroke-2); }

.drawer-body {
  flex: 1;
  padding: 4px 22px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.set-block { padding: 18px 0; border-top: 1px solid var(--stroke-2); }
.set-block:first-child { border-top: 0; }
.set-block h3 {
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--stroke-2);
}
.segmented button {
  height: 34px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background .25s, color .25s, box-shadow .25s;
}
.segmented button.active {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .35);
}

.wp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wp-opt {
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.wp-opt:hover { transform: translateY(-1px); border-color: rgba(139, 92, 246, .35); }
.wp-opt.active {
  border-color: rgba(139, 92, 246, .6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}
.wp-thumb {
  display: block;
  height: 62px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--stroke-2);
}
.wp-thumb-default { background-image: linear-gradient(115deg, #dfe7ff 0 50%, #0b1220 50% 100%); }
.wp-thumb-none { background-image: linear-gradient(135deg, var(--c1), var(--c3)); }
.wp-opt b {
  display: block;
  margin-top: 6px;
  font-size: 10.8px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px dashed var(--stroke-2);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}
.upload-btn svg { width: 15px; height: 15px; }
.upload-btn:hover { color: var(--c1); border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .06); }

.url-row { display: flex; gap: 8px; margin-top: 8px; }
.url-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.url-row input:focus { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 3px rgba(139, 92, 246, .1); }
.url-row button {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(139, 92, 246, .14);
  color: var(--c1);
  font-size: 12px;
  font-weight: 700;
}
.url-row button:hover { background: rgba(139, 92, 246, .22); }

.set-hint { margin-top: 8px; font-size: 10.5px; line-height: 1.6; color: var(--faint); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i {
  position: relative;
  width: 40px;
  height: 23px;
  flex-shrink: 0;
  border-radius: 99px;
  background: var(--stroke-2);
  transition: background .25s;
}
.switch-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform .25s;
}
.switch-row input:checked + i { background: linear-gradient(112deg, var(--c1), var(--c3)); }
.switch-row input:checked + i::after { transform: translateX(17px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--c2); outline-offset: 3px; }

.select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.select:focus { border-color: rgba(139, 92, 246, .55); }

.reset-btn {
  width: 100%;
  height: 42px;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, .28);
  background: rgba(239, 68, 68, .08);
  color: #ef4444;
  font-size: 12.5px;
  font-weight: 700;
  transition: background .25s;
}
.reset-btn:hover { background: rgba(239, 68, 68, .14); }

.set-foot { margin-top: 12px; font-size: 10.5px; line-height: 1.6; color: var(--faint); }

/* ---------------- 收藏弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 15, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s;
}
.modal-mask.show { opacity: 1; }

.modal {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  padding: 22px;
  overflow-y: auto;
  border-radius: 22px;
  background: #f8faff;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.98);
  transition: transform .25s;
}
html[data-theme="dark"] .modal { background: #0b1120; }
.modal-mask.show .modal { transform: none; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.modal-head h3 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

.field { display: block; margin-top: 14px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
}
.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.field input:focus { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 3px rgba(139, 92, 246, .1); }
.field small { display: block; margin-top: 5px; font-size: 10.5px; color: var(--faint); }

.icon-field { display: flex; align-items: center; gap: 8px; }
.icon-field input { flex: 1; min-width: 0; }
.icon-preview {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 11px;
  background: rgba(139, 92, 246, .12);
  font-size: 20px;
}
.icon-preview img { width: 24px; height: 24px; object-fit: contain; }

.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid transparent;
  background: var(--sw);
  transition: transform .2s, box-shadow .2s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--sw); }

.form-error { margin-top: 10px; font-size: 12px; color: #ef4444; }

.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn.primary {
  color: #fff;
  background: linear-gradient(112deg, var(--c1), var(--c3));
  box-shadow: 0 10px 22px -12px rgba(99, 102, 241, .9);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(168, 85, 247, .85); }
.btn.ghost { color: var(--muted); background: var(--stroke-2); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { color: #ef4444; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .25); }
.btn.danger:hover { background: rgba(239, 68, 68, .16); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .bm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .bm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-tip { display: none; }
}

@media (max-width: 720px) {
  .engine-name { font-size: 17px; }
  .engine-caret { width: 12px; height: 12px; }
  .engine-menu { left: -10px; width: 210px; }
  .bm-section { padding-top: 34px; }
  .bm-section .sec-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 10px; }
  .bm-section .sec-tools { flex-shrink: 0; }
  .sec-tools { gap: 8px; }
  .bm-count { display: none; }
}

@media (max-width: 520px) {
  .search-box { gap: 8px; }
  .engine-name { font-size: 16px; }
  .engine-btn { height: 38px; }
  .engine-menu { left: -8px; width: 200px; }

  .bm-grid { gap: 10px; }
  .bm-card { min-height: 74px; padding: 11px; border-radius: 16px; gap: 4px; }
  .bm-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
  .bm-text b { font-size: 13px; }
  .bm-text i { font-size: 9.8px; }
  .bm-edit { opacity: .5; width: 24px; height: 24px; }
  .bm-grip { width: 14px; opacity: .28; }
  .bm-add { font-size: 11.5px; }

  .drawer { width: 100%; }
  .drawer-head { padding: 18px 18px 6px; }
  .drawer-body { padding: 2px 18px 30px; }
  .modal { padding: 18px; border-radius: 18px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .spacer { display: none; }
  .btn { flex: 1; }
  .btn.danger { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .engine-menu { animation: none; }
  .drawer { transition: none; }
  .modal, .modal-mask { transition: none; }
}

/* =============================================================
   2.0 品牌 / Hero 文案 / 时间 / 收藏视图 / 壁纸扩展
   ============================================================= */

/* 隐藏但保留占位，避免 Hero 其他控件跳动 */
.is-hidden { visibility: hidden !important; pointer-events: none !important; }
.chip-time.is-hidden { display: none; }

body[data-wallpaper="solid"] .bg { background: var(--solid, #101528); }
body[data-wallpaper="solid"] .bg-aurora { opacity: .32; }

.name-grad { min-height: .98em; }
.hero-surname { min-height: 1.1em; }
.name-grad,
.hero-surname {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-time {
  margin-left: 7px;
  padding-left: 8px;
  border-left: 1px solid var(--stroke-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

#brandLogo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.brand-text { min-width: 0; }
.brand-text b,
.brand-text i {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .nav-tools { gap: 6px; }
  .nav-chip { width: 38px; height: 38px; }
  .theme-btn { width: 38px; height: 38px; }
  .brand { gap: 8px; padding: 4px 10px 4px 4px; }
  .brand-avatar { width: 34px; height: 34px; }
  .brand-text b { font-size: 12.5px; max-width: 88px; }
  .brand-text i { max-width: 88px; }
}

@media (max-width: 360px) {
  .nav-tools { gap: 4px; }
  .nav-chip,
  .theme-btn { width: 34px; height: 34px; }
  .brand { gap: 6px; padding: 3px 8px 3px 3px; }
  .brand-avatar { width: 30px; height: 30px; }
  .brand-text b { max-width: 58px; }
}

/* ---------------- 设置：通用输入 ---------------- */
.set-field { display: block; margin-bottom: 8px; }
.set-field > span {
  display: block;
  margin-bottom: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--faint);
}
.set-field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.set-field input:focus { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 3px rgba(139, 92, 246, .1); }

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}
.mini-btn svg { width: 13px; height: 13px; }
.mini-btn:hover { color: var(--c1); border-color: rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .06); }

/* ---------------- 设置：品牌编辑 ---------------- */
.brand-editor { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.brand-preview {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1), var(--c3));
}
.brand-preview img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.brand-fields { flex: 1; min-width: 0; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

/* ---------------- 设置：壁纸扩展 ---------------- */
.wp-thumb-solid { background-image: linear-gradient(135deg, #101528 0 50%, #6366f1 50% 100%); }
.wp-thumb-custom { background-image: linear-gradient(135deg, #1e293b, #a855f7 60%, #ec4899); }
.wp-opt-wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; text-align: left; }
.wp-opt-wide .wp-thumb { width: 64px; height: 42px; flex-shrink: 0; }
.wp-opt-wide b { margin: 0; text-align: left; font-size: 11px; }

.wp-color-panel,
.wp-upload-panel {
  margin-top: 10px;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
}

.color-line { display: flex; align-items: center; gap: 10px; }
.color-line input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  background: none;
  cursor: pointer;
}
.color-line span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.color-swatches button {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--sw);
  transition: transform .2s, box-shadow .2s;
}
.color-swatches button:hover { transform: translateY(-1px); }
.color-swatches button.active { border-color: #fff; box-shadow: 0 0 0 2px var(--sw); }

.wp-upload-panel { display: flex; flex-direction: column; gap: 8px; }
.wp-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
  border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, .2);
}
html[data-theme="dark"] .wp-slot { background: rgba(15, 23, 39, .3); }
.wp-slot-thumb {
  width: 54px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background-color: var(--stroke-2);
  background-size: cover;
  background-position: center;
}
.wp-slot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wp-slot-text b { font-size: 11.5px; font-weight: 700; }
.wp-slot-text i {
  font-style: normal;
  font-size: 9.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 设置：收藏视图 ---------------- */
.view-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.view-picker button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  color: var(--muted);
  text-align: left;
  transition: border-color .25s, color .25s, box-shadow .25s;
}
.view-picker button:hover { border-color: rgba(139, 92, 246, .4); }
.view-picker button.active {
  color: var(--text);
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .08);
}
.view-picker b { font-size: 11px; font-weight: 600; }

.view-demo {
  display: grid;
  width: 48px;
  height: 34px;
  flex-shrink: 0;
  padding: 5px;
  gap: 3px;
  border-radius: 7px;
  background: var(--stroke-2);
  color: var(--muted);
}
.view-demo i { display: block; background: currentColor; opacity: .35; border-radius: 2px; }
.vd-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.vd-icons { display: flex; align-items: center; justify-content: center; gap: 4px; }
.vd-icons i { width: 10px; height: 10px; border-radius: 50%; }
.vd-tiles { display: flex; align-items: center; justify-content: center; gap: 7px; }
.vd-tiles i { width: 10px; height: 10px; border-radius: 50%; }
.vd-list { display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.vd-list i { width: 100%; height: 4px; }

/* ---------------- 收藏四种视图 ---------------- */
.bm-section.view-icons .bm-grid {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 14px;
}
.view-icons .bm-card {
  justify-content: center;
  min-height: 0;
  padding: 8px;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.view-icons .bm-card:hover { transform: translateY(-2px); box-shadow: none; }
.view-icons .bm-main { flex-direction: column; gap: 8px; align-items: center; justify-content: center; }
.view-icons .bm-icon { width: 62px; height: 62px; border-radius: 50%; font-size: 26px; }
.view-icons .bm-text { display: none; }
.view-icons .bm-edit {
  position: absolute;
  top: 2px;
  right: 10px;
  width: 22px;
  height: 22px;
  opacity: 0;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
}
.view-icons .bm-grip {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 18px;
  opacity: 0;
}
.view-icons .bm-card:hover .bm-edit,
.view-icons .bm-card:hover .bm-grip,
.view-icons .bm-card:focus-within .bm-edit,
.view-icons .bm-card:focus-within .bm-grip { opacity: 1; }
.view-icons .bm-add {
  width: 62px;
  height: 62px;
  min-height: 0;
  justify-self: center;
  border-radius: 50%;
  border: 1px dashed rgba(148, 163, 184, .4);
  background: rgba(255, 255, 255, .14);
  padding: 0;
}
html[data-theme="dark"] .view-icons .bm-add {
  background: rgba(15, 23, 39, .32);
  border-color: rgba(148, 163, 184, .34);
}
.view-icons .bm-add:hover {
  color: var(--c1);
  border-color: rgba(139, 92, 246, .5);
  background: rgba(139, 92, 246, .07);
}
.view-icons .bm-add span { display: none; }
.view-icons .bm-add svg { width: 20px; height: 20px; }

.bm-section.view-tiles .bm-grid {
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 12px;
}
.view-tiles .bm-card {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 10px 8px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
}
.view-tiles .bm-main { flex-direction: column; gap: 8px; width: 100%; text-align: center; }
.view-tiles .bm-icon { width: 62px; height: 62px; border-radius: 50%; font-size: 26px; }
.view-tiles .bm-text { align-items: center; width: 100%; }
.view-tiles .bm-text b { font-size: 13px; max-width: 100%; }
.view-tiles .bm-text i { display: none; }
.view-tiles .bm-edit {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  opacity: 0;
}
.view-tiles .bm-grip { position: absolute; right: 8px; bottom: 6px; opacity: 0; }
.view-tiles .bm-card:hover .bm-edit,
.view-tiles .bm-card:hover .bm-grip,
.view-tiles .bm-card:focus-within .bm-edit,
.view-tiles .bm-card:focus-within .bm-grip { opacity: 1; }
.view-tiles .bm-add { min-height: 106px; border-radius: 16px; border-style: dashed; }
.view-tiles .bm-add span { font-size: 11px; }

.bm-section.view-list .bm-grid { display: flex; flex-direction: column; gap: 8px; }
.view-list .bm-card { width: 100%; min-height: 62px; padding: 10px 14px; }
.view-list .bm-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.view-list .bm-text b { font-size: 13.5px; }
.view-list .bm-edit { opacity: 0; }
.view-list .bm-card:hover .bm-edit,
.view-list .bm-card:focus-within .bm-edit { opacity: 1; }
.view-list .bm-add { justify-content: center; min-height: 54px; border-style: dashed; }

@media (hover: none) {
  .view-icons .bm-edit,
  .view-icons .bm-grip,
  .view-tiles .bm-edit,
  .view-tiles .bm-grip,
  .view-list .bm-edit { opacity: .55; }
}

/* ---------------- 拖拽幽灵 ---------------- */
.bm-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 220;
  margin: 0 !important;
  pointer-events: none;
  opacity: .97;
  transform-origin: center;
  will-change: transform;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .55);
  cursor: grabbing;
}
.bm-ghost .bm-edit,
.bm-ghost .bm-grip { opacity: 0 !important; }
.bm-card.drag-origin { opacity: .25; }

/* ---------------- 品牌 / Hero 设置响应式 ---------------- */
@media (max-width: 520px) {
  .brand-editor { gap: 10px; }
  .brand-preview { width: 46px; height: 46px; }
  .view-picker { gap: 6px; }
  .view-picker button { padding: 6px; gap: 7px; }
  .view-demo { width: 40px; height: 30px; }
}

/* ---------------- 校园服务弹窗 ---------------- */
.modal-wide { width: min(720px, 100%); }
.campus-tip { margin: 6px 0 12px; font-size: 11.5px; line-height: 1.65; color: var(--faint); }
.campus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.campus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  transition: transform .25s, border-color .25s, background .25s;
}
.campus-item:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, .4);
  background: rgba(139, 92, 246, .06);
}
.campus-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(139, 92, 246, .12);
  font-size: 18px;
}
.campus-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.campus-main b { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campus-main em {
  font-style: normal;
  font-size: 9.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.campus-main i {
  font-style: normal;
  font-size: 9.5px;
  color: var(--muted);
  opacity: .78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.campus-arrow { width: 14px; height: 14px; margin-left: auto; flex-shrink: 0; color: var(--faint); }
@media (max-width: 600px) {
  .campus-grid { grid-template-columns: 1fr; }
  .campus-tip { font-size: 10.8px; }
}

/* ---------------- 图标上传 ---------------- */
.icon-upload-row { margin-top: 7px; }

/* ---------------- 实时天气 ---------------- */
.weather-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 12px;
  color: var(--muted);
  transition: transform .25s, border-color .25s, background .25s, color .25s;
}
.weather-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, .4);
  background: rgba(139, 92, 246, .07);
  color: var(--text);
}
.weather-icon { font-size: 15px; line-height: 1; }
.weather-temp {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.weather-temp:empty { display: none; }
.weather-text { font-size: 11.5px; }
.weather-city {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--faint);
}
.weather-city:not(:empty)::before { content: "·"; margin-right: 6px; color: var(--faint); }
.weather-city:empty { display: none; }

.segmented-2 { grid-template-columns: repeat(2, 1fr); }
.set-warn { color: #b45309; }
html[data-theme="dark"] .set-warn { color: #fbbf24; }

.consent-modal { width: min(480px, 100%); }
.consent-text {
  margin: 8px 0 10px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}
.consent-modal .modal-actions { justify-content: flex-end; }

/* 首次访问欢迎与使用同意 */
#welcomeModal { z-index: 140; }
.welcome-modal { width: min(620px, 100%); padding: 26px; }
.welcome-modal h3 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.welcome-text {
  margin: 8px 0 16px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.welcome-text strong { color: var(--text); font-weight: 700; }
.welcome-options { display: grid; gap: 8px; margin-bottom: 16px; }
.welcome-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: var(--glass);
  cursor: pointer;
  transition: border-color .25s, background .25s;
}
.welcome-option:hover {
  border-color: rgba(139, 92, 246, .4);
  background: rgba(139, 92, 246, .06);
}
.welcome-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--c1);
  cursor: pointer;
}
.welcome-option-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.welcome-option-body b {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
}
.welcome-option-body small { font-size: 11px; line-height: 1.5; color: var(--faint); }
.welcome-required, .welcome-optional {
  padding: 1px 5px;
  border-radius: 999px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
}
.welcome-required { color: #ef4444; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .25); }
.welcome-optional { color: var(--muted); background: var(--stroke-2); border: 1px solid var(--stroke); }
.welcome-enter { width: 100%; height: 44px; }
.welcome-enter:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.welcome-foot { margin: 8px 0 0; text-align: center; font-size: 10.8px; color: var(--faint); }

@media (max-width: 520px) {
  .welcome-modal { padding: 20px; }
  .welcome-modal h3 { font-size: 19px; }
  .welcome-text { font-size: 12.3px; line-height: 1.85; }
}

@media (max-width: 520px) {
  .weather-city { max-width: 112px; }
  .weather-chip { padding: 6px 10px; }
}


/* =============================================================
   3.0 搜索框两种位置 / 设置分组 / 空收藏状态
   ============================================================= */

/* 搜索框：底部悬浮长条 */
body.search-mode-bottom .search {
  position: fixed;
  left: 50%;
  z-index: 45;
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  margin: 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 30px 70px -32px rgba(0, 0, 0, .6);
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
html[data-theme="dark"] body.search-mode-bottom .search {
  background: rgba(10, 16, 29, .9);
}
html[data-theme="light"] body.search-mode-bottom .search {
  background: rgba(255, 255, 255, .93);
}
body.search-mode-bottom { padding-bottom: 190px; }
body.search-mode-bottom .toast { bottom: calc(196px + env(safe-area-inset-bottom)); }
body.search-mode-bottom .engine-menu {
  top: auto;
  bottom: calc(100% + 14px);
}

/* 设置分组小标题 */
.set-label {
  margin: 14px 0 7px;
  font-size: 10.8px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--faint);
}
.set-block h3 + .set-label { margin-top: 0; }
.set-label-gap { margin-top: 17px; }

/* 搜索框位置选择 */
.search-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}
.search-mode-picker button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 4px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--glass);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  transition: border-color .25s, color .25s, box-shadow .25s;
}
.search-mode-picker button:hover { border-color: rgba(139, 92, 246, .4); }
.search-mode-picker button.active {
  color: var(--text);
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .08);
}
.search-mode-picker b { font-size: 10.5px; font-weight: 600; }
.sm-demo {
  position: relative;
  display: block;
  width: 52px;
  height: 34px;
  border-radius: 7px;
  background: var(--stroke-2);
}
.sm-demo i {
  position: absolute;
  left: 5px;
  top: 50%;
  width: 24px;
  height: 8px;
  border-radius: 3px;
  background: currentColor;
  opacity: .38;
  transform: translateY(-50%);
}
.sm-bottom i {
  left: 50%;
  top: auto;
  bottom: 4px;
  width: 30px;
  transform: translateX(-50%);
}

/* 空收藏状态 */
.bm-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  padding: 24px 18px;
  border-radius: 18px;
  border: 1px dashed var(--stroke-2);
  background: var(--glass);
  text-align: center;
  transition: border-color .25s, background .25s, transform .25s;
}
.bm-empty b { font-size: 14px; font-weight: 700; color: var(--text); }
.bm-empty span { font-size: 11.5px; color: var(--faint); }
.bm-empty:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, .45);
  background: rgba(139, 92, 246, .07);
}

/* 拖拽幽灵：去掉昂贵的实时毛玻璃，提升跟手性 */
.bm-ghost {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: none;
  will-change: transform;
  background: var(--glass-strong);
}

@media (max-width: 720px) {
  body.search-mode-bottom .search { width: calc(100vw - 24px); }
  body.search-mode-bottom .search { bottom: max(12px, env(safe-area-inset-bottom)); }
  body.search-mode-bottom { padding-bottom: 172px; }
  body.search-mode-bottom .toast { bottom: calc(168px + env(safe-area-inset-bottom)); }
  .search-mode-picker { gap: 5px; }
  .sm-demo { width: 46px; height: 31px; }
}


