/* ==========================================================================
   笔点首页 样式复刻
   ========================================================================== */

:root {
  --primary: #0084ff;
  --text-darker: #222;
  --text-dark: #444d58;
  --text-default: #6b7386;
  --text-light: #8b9199;
  --text-lighter: #a1a7b7;
  --panel-bg: #fff;
  --page-bg: #f9f8f7;
  --line: #f2f3f5;
  --radius: 4px;
  --panel-shadow: 0 1px 3px rgba(0, 0, 0, .02), 0 4px 8px rgba(0, 0, 0, .02),
    inset 0 0 0 1px rgba(255, 255, 255, .1);
  --button-active: hsla(0, 0%, 96%, .7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-width: 1200px;
  background: var(--page-bg);
  color: var(--text-darker);
  font: 13px/1.5 "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", 微软雅黑, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
li { list-style: none; }
img { border: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; outline: 0; }
.hidden { display: none !important; }

.container { width: 1200px; margin: 0 auto; }
.panel {
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
}

/* ==========================================================================
   顶部（fu365 风格）
   ========================================================================== */
.site-head {
  position: relative;
  background: linear-gradient(180deg, #e8f6ff 0%, #f4fbff 55%, #fbfdff 100%);
}
body.has-skin .site-head { background: rgba(255, 255, 255, .25); }

/* 顶部工具条 */
.topbar { height: 27px; border-bottom: 1px solid #e6e6e6; background: #fff; }
.topbar-inner {
  display: flex;
  align-items: center;
  width: 1200px;
  height: 27px;
  margin: 0 auto;
  color: #5d6b7e;
  font-size: 12px;
}
.top-links, .top-sets { display: flex; align-items: center; gap: 14px; }
.top-sets { margin-left: auto; }
.topbar a:hover { color: #f23c3c; }
.set-color { display: flex; align-items: center; gap: 3px; }
.set-color a { display: block; width: 13px; height: 13px; border-radius: 2px; cursor: pointer; }
.set-color a.cur { outline: 1px solid rgba(0, 0, 0, .4); outline-offset: 1px; }
.set-blue { background: #5aa9ff; }
.set-green { background: #539815; }
.set-pink { background: #ff9db4; }
.theme-btn { display: flex; align-items: center; gap: 1px; color: #5d6b7e; font-size: 12px; }
.theme-btn i { font-size: 12px; }
.theme-btn:hover, .theme-btn.active { color: #f23c3c; }

/* 主头部 */
.head-main { height: 110px; }
.head-inner {
  display: flex;
  align-items: center;
  width: 1200px;
  height: 110px;
  margin: 0 auto;
}
.head-logo { display: block; }
.head-logo img { display: block; height: 78px; width: auto; }

.head-meta { display: flex; align-items: center; margin-left: 36px; }
.head-date {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px 8px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .65);
  box-shadow: 0 2px 8px rgba(10, 35, 63, .05), inset 0 0 0 1px rgba(0, 0, 0, .04);
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow .2s;
}
.head-date:hover { box-shadow: 0 4px 14px rgba(10, 35, 63, .1), inset 0 0 0 1px rgba(51, 118, 244, .18); }
.date-day { color: var(--primary); font: 600 40px/1 Bahnschrift, "DIN Alternate", "Segoe UI", Arial, sans-serif; }
.date-info { display: flex; flex-direction: column; gap: 3px; }
.date-main { color: #333; font-size: 14px; font-weight: 600; }
.date-lunar { color: #7c8899; font-size: 12px; }
.date-clock {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: 14px;
  border-left: 1px solid rgba(0, 0, 0, .08);
  color: #2b3a4b;
  font: 600 24px/1 "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.head-weather { margin-left: 18px; }
.head-weather iframe { display: block; width: 410px; height: 98px; border: 0; }

.head-side { margin-left: auto; }
.fav-box img { display: block; width: 160px; height: 61px; }

/* ==========================================================================
   搜索区
   ========================================================================== */
.index { padding-top: 15px; }

.engine-panel { position: relative; padding: 12px 0; }

/* hao123 风格搜索框 + 轻主页引擎切换 */
.hao-search { position: relative; display: flex; align-items: center; width: 751px; margin: 0 auto; }
.hao-bar {
  display: flex;
  flex: 1;
  align-items: center;
  height: 52px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(160deg, #3377fe, #4c6fff, #8370ff, #ba59ff) border-box;
}
.engine-select { position: relative; display: flex; align-items: center; height: 100%; }
.engine-trigger {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 100%;
  padding: 0 10px 0 14px;
  border-radius: 15px 0 0 15px;
  color: #9195a3;
}
.engine-trigger:hover { background: #f5f7fa; }
.engine-symbol { display: flex; width: 22px; height: 22px; }
.engine-symbol img { display: block; width: 100%; height: 100%; }
.engine-trigger i { font-size: 15px; }
.engine-menu {
  position: absolute;
  top: 58px;
  left: 0;
  z-index: 20;
  display: none;
  width: 188px;
  padding: 7px;
  border: 1px solid #e6ebf2;
  border-radius: 13px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 38px rgba(10, 35, 63, .18);
}
.engine-menu.open { display: block; }
.engine-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 9px;
  border-radius: 8px;
  color: #182b43;
  font-size: 14px;
}
.engine-option:hover { background: #f5f8ff; }
.engine-option.cur { background: #edf4ff; color: #3376f4; }
.engine-option img { width: 18px; height: 18px; }
.engine-option span { flex: 1; text-align: left; }
.engine-option i { visibility: hidden; color: #3376f4; font-size: 15px; }
.engine-option.cur i { visibility: visible; }
.hao-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 15px;
  border: 0;
  background: none;
  color: #333;
  font-size: 16px;
}
.hao-input::placeholder { color: #9195a3; }
.search-clear {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  border-radius: 50%;
  color: #8b9cb2;
}
.search-clear[hidden] { display: none; }
.search-clear:hover { background: rgba(21, 52, 95, .09); color: #3b5678; }
.search-clear svg { width: 12px; height: 12px; fill: currentColor; }
.hao-btn {
  flex: 0 0 auto;
  width: 108px;
  height: 44px;
  margin-right: 4px;
  border-radius: 12px;
  background: linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
  color: #fff;
  font-size: 16px;
}
.hao-btn:hover { background: linear-gradient(136deg, #1a5cf5, #3f61f0, #6668f7, #975bff); }

/* 搜索下拉：热搜 / 历史 */
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  width: 100%;
  max-height: 380px;
  padding: 14px 18px 16px;
  overflow-y: auto;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: rgba(255, 255, 255, .99);
  box-shadow: 0 18px 46px rgba(9, 30, 58, .18);
}
.search-suggest:not([hidden]) { animation: suggestIn .16s ease; }
@keyframes suggestIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.suggest-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.suggest-title { color: #9aa7b8; font-size: 13px; font-weight: 500; }
.suggest-refresh,
.suggest-clear { display: flex; align-items: center; gap: 4px; color: #9195a3; font-size: 12px; }
.suggest-refresh[hidden] { display: none; }
.suggest-refresh:hover,
.suggest-clear:hover { color: var(--primary, #3376f4); }
#suggestHot .suggest-head { justify-content: flex-start; gap: 8px; }
.hot-updated { color: #18a058; font-size: 12px; white-space: nowrap; }
.hot-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  gap: 2px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  color: #405266;
  font-size: 14px;
  text-align: left;
}
.hot-item:hover,
.hot-item.active { background: #f4f7ff; box-shadow: inset 2px 0 0 var(--primary, #3376f4); color: #182b43; }
.hot-rank { display: inline-block; flex: none; width: 18px; color: #9195a3; font-size: 13px; font-style: italic; font-weight: 700; text-align: center; transform: skewX(-6deg); }
.hot-item.r1 .hot-rank { color: #ff3b30; }
.hot-item.r2 .hot-rank { color: #ff8a1f; }
.hot-item.r3 .hot-rank { color: #f4c430; }
.hot-keyword { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-tag {
  flex: none;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
}
.hot-tag.new { background: linear-gradient(135deg, #07a15b, #59d39b); }
.hot-tag.hot { background: linear-gradient(135deg, #ff5f19, #ffa066); }
.hot-tag.up { background: linear-gradient(135deg, #2d6ff2, #6ea5ff); }
.suggest-history { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef2f7; }
.history-list { display: flex; flex-wrap: wrap; gap: 10px; max-height: 76px; margin-top: -6px; padding-top: 6px; overflow: hidden; }
.history-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: #f5f7fa;
  color: #55657a;
  font-size: 13px;
}
.history-word { max-width: 150px; overflow: hidden; color: inherit; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-word:hover { color: var(--primary, #3376f4); }
.history-del {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 32, 56, .18);
  color: #8b9cb2;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.history-chip:hover .history-del,
.history-chip:focus-within .history-del { opacity: 1; pointer-events: auto; }
.history-del:hover { background: #eef2f7; color: #3b5678; }
@media (prefers-reduced-motion: reduce) {
  .search-suggest:not([hidden]) { animation: none; }
}

/* 设置：搜索历史开关 */
.config-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch-copy { display: flex; flex-direction: column; gap: 4px; color: var(--text-default); font-size: 14px; }
.switch-copy small { color: #9195a3; font-size: 12px; }
.config-switch input {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  margin: 0;
  appearance: none;
  border-radius: 12px;
  background: #dcdfe6;
  cursor: pointer;
  transition: background .18s;
}
.config-switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.config-switch input:checked { background: var(--primary, #3376f4); }
.config-switch input:checked::after { transform: translateX(18px); }

/* 设置：恢复本地备份 */
.data-restore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.data-restore i { flex: none; color: var(--primary, #3376f4); font-size: 18px; }
.data-restore:hover .switch-copy { color: var(--primary, #3376f4); }

/* ==========================================================================
   常用网址
   ========================================================================== */
.link-panel { margin: 10px 0; padding: 8px 12px 6px; }
.web-header { position: relative; display: flex; align-items: center; height: 30px; margin-bottom: 8px; }
.web-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: #e8edf3; }
.tab-menu { display: flex; flex: 0 0 auto; align-items: center; height: 24px; overflow: hidden; }
.tab-menu li {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  height: 24px;
  margin-right: 10px;
  padding: 0 12px 0 16px;
  line-height: 24px;
  border-radius: 14px;
  color: var(--text-default);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.tab-menu li:hover { background: #f5f7fa; }
.tab-menu li.active { color: #fff; padding: 0 12px; }
.tab-menu li .dot { position: absolute; width: 7px; height: 7px; margin-left: -11px; border-radius: 50%; }

.web-tools { display: flex; flex: 0 0 auto; align-items: center; margin-left: auto; color: var(--text-light); }
.web-tools i { font-size: 14px; }
.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--button-active);
  color: var(--text-dark);
  font-size: 12px;
  cursor: pointer;
}
.tool-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-btn.width { width: 60px; }

.simple-link-box { display: grid; grid-template-columns: repeat(6, 1fr); }
body[data-mode]:not([data-mode="default"]) .simple-link-box,
body[data-mode]:not([data-mode="default"]) #group-my .group-links { grid-template-columns: repeat(7, 1fr); }
/* 图标样式：复刻原站「网址样式 - 图标」 */
.simple-link-box.layout-icon .link-item { height: auto; margin-bottom: 5px; padding-right: 5px; }
.simple-link-box.layout-icon .link-item a {
  position: relative;
  flex-direction: column;
  height: auto;
  padding: 11px 8px 6px;
  overflow: hidden;
  border-radius: 4px;
  text-align: center;
}
.simple-link-box.layout-icon .cover { width: 100%; height: 40px; }
.simple-link-box.layout-icon .cover img { width: auto; height: 30px; max-width: 30px; border-radius: 2px; }
.simple-link-box.layout-icon .title-h4 { width: 100%; height: 19px; margin: 10px 0 0; font-size: 13px; line-height: 19px; }
.simple-link-box.layout-icon .add-tile a { justify-content: center; height: 86px; }
.link-item { position: relative; height: 44px; margin-bottom: 4px; }
.link-item a {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--text-dark);
  transition: background .2s;
}
.link-item a:hover { background: #f5f7fa; }
.link-item .cover { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 17px; height: 17px; }
.link-item .cover img { width: 17px; height: 17px; object-fit: contain; }
.link-item .title-h4 {
  margin: 0 3px 0 8px;
  overflow: hidden;
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- 编辑模式 ---------- */
.link-panel.editing .tab-menu { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.link-panel.editing .tab-menu::-webkit-scrollbar { display: none; }
.link-panel.editing .tab-menu li { padding-right: 6px; cursor: default; }
.link-panel.editing .tab-menu li span { padding: 0 2px; border-radius: 3px; }
.tab-menu li .tab-edit {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--text-default);
}
.link-panel.editing .tab-menu li .tab-edit { display: flex; }
.tab-menu li .tab-edit:hover { background: var(--primary); color: #fff; }
.tab-menu li .tab-edit svg { width: 9px; height: 9px; }
.tab-menu li.dragover { outline: 2px dashed var(--primary); outline-offset: -2px; }
.link-panel.editing .tab-menu li[draggable="true"] { cursor: move; }
.tab-menu li.tab-add { border: 1px dashed #cbd7e6; background: #fff; color: var(--text-light); padding: 0 10px; }
.tab-menu li.tab-add:hover { border-color: var(--primary); background: #f5f9ff; color: var(--primary); }
.link-panel.editing .link-item a { padding-right: 24px; }
.link-panel.editing .simple-link-box.layout-icon .link-item a { padding: 11px 8px 6px; }
.link-item .link-edit {
  position: absolute;
  top: 1px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--text-default);
  font-size: 12px;
}
.link-item .link-edit:hover { background: var(--primary); color: #fff; }
.link-item .link-edit svg { width: 11px; height: 11px; }
.link-item.dragover { outline: 1px dashed var(--primary); outline-offset: -2px; background: #f5f9ff; }
.add-tile a { justify-content: flex-start; color: #8494a8; }
.add-tile .title-h4 { color: #8494a8; }
.add-tile .add-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--primary);
  font-size: 14px;
  transition: background .2s, color .2s;
}
.add-tile a:hover { background: #f5f9ff; color: var(--primary); }
.add-tile a:hover .add-plus { background: var(--primary); color: #fff; }
.simple-link-box.layout-icon .add-tile .add-plus { width: 30px; height: 30px; font-size: 17px; }
.link-empty { padding: 12px 8px; color: var(--text-lighter); font-size: 13px; }

/* ---------- 网址编辑弹窗 ---------- */
.link-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; }
.link-modal[hidden] { display: none; }
body.link-modal-open { overflow: hidden; }
.link-mask { position: absolute; inset: 0; background: rgba(18, 30, 48, .35); }
.link-dialog {
  position: relative;
  width: 420px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 30, 50, .2);
  animation: dialog-in .16s ease-out;
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
}
.link-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.link-dialog-head h3 { color: var(--text-darker); font-size: 15px; font-weight: 600; }
.link-dialog-close { color: var(--text-light); font-size: 18px; line-height: 1; }
.link-dialog-close:hover { color: var(--text-dark); }
.link-dialog-body { padding: 18px; }
.link-icon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.link-icon-preview {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid #e8eef6;
  border-radius: 10px;
  background: #f7f9fc;
  color: var(--text-lighter);
}
.link-icon-preview img { width: 28px; height: 28px; object-fit: contain; }
.link-icon-preview svg { width: 22px; height: 22px; }
.link-icon-fetch {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #dfe7f1;
  border-radius: 13px;
  color: var(--text-default);
  font-size: 12px;
}
.link-icon-fetch:hover { border-color: var(--primary); color: var(--primary); }
.link-icon-fetch:disabled { opacity: .6; cursor: default; }
.link-icon-fetch i { display: inline-block; }
.link-icon-fetch .spin { animation: spin .8s linear infinite; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.link-icon-info p { margin-top: 5px; color: var(--text-lighter); font-size: 12px; }
.link-field { display: block; margin-bottom: 14px; }
.link-field span { display: block; margin-bottom: 6px; color: var(--text-default); font-size: 12px; }
.link-field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #dfe7f1;
  border-radius: 6px;
  background: #fff;
  color: var(--text-dark);
  font-size: 13px;
}
.link-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 132, 255, .08); }
.link-dialog-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 18px; }
.link-delete { color: #f25656; font-size: 12px; }
.link-delete:hover { text-decoration: underline; }
.link-delete[hidden] { display: none; }
.link-dialog-actions { display: flex; gap: 8px; }
.link-cancel, .link-save { height: 32px; padding: 0 18px; border-radius: 6px; font-size: 13px; }
.link-cancel { background: #eef2f7; color: var(--text-dark); }
.link-save { background: var(--primary); color: #fff; }
.link-lib-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 34px;
  border: 1px dashed #d9e2ee;
  border-radius: 6px;
  color: var(--text-default);
  font-size: 12px;
}
.link-lib-entry:hover { border-color: var(--primary); background: #f5f9ff; color: var(--primary); }
.link-lib-entry[hidden] { display: none; }

/* ---------- 网址库弹窗 ---------- */
.lib-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 920px;
  max-width: calc(100vw - 48px);
  height: min(560px, 84vh);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 30, 50, .22);
  animation: dialog-in .16s ease-out;
}
.lib-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.lib-head h3 { color: var(--text-darker); font-size: 16px; font-weight: 600; }
.lib-head p { margin-top: 3px; color: var(--text-light); font-size: 12px; }
.lib-close {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-light);
  font-size: 18px;
}
.lib-close:hover { background: #f5f7fa; color: var(--text-dark); }
.lib-body { display: grid; flex: 1; grid-template-columns: 168px minmax(0, 1fr); min-height: 0; }
.lib-cats { padding: 16px; overflow-y: auto; border-right: 1px solid var(--line); background: #f7f8fa; }
.lib-cats-label { padding: 0 8px 8px; color: var(--text-light); font-size: 12px; }
.lib-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 14px;
  text-align: left;
}
.lib-cat em { color: var(--text-lighter); font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; }
.lib-cat:hover { background: #fff; }
.lib-cat.active { background: #e8f3ff; color: #0066cc; font-weight: 500; }
.lib-cat.active em { color: #0066cc; }
.lib-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 20px; }
.lib-toolbar { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.lib-search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  color: var(--text-lighter);
}
.lib-search:focus-within { border-color: var(--primary); }
.lib-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text-dark); font-size: 13px; }
.lib-search input::placeholder { color: var(--text-lighter); }
.lib-target-wrap { position: relative; flex: 0 0 auto; }
.lib-target {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  max-width: 210px;
  padding: 0 8px 0 12px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 13px;
  white-space: nowrap;
}
.lib-target span { overflow: hidden; text-overflow: ellipsis; }
.lib-target:hover { border-color: var(--primary); color: var(--primary); }
.lib-target-menu {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 2;
  width: 210px;
  max-height: 260px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #e6ecf4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 30, 50, .14);
}
.lib-target-menu[hidden] { display: none; }
.lib-target-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text-dark);
  font-size: 13px;
  text-align: left;
}
.lib-target-item:hover { background: #f5f8fc; }
.lib-target-item.active { background: #e8f3ff; color: #0066cc; }
.lib-target-item .dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.lib-target-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-target-item em { margin-left: auto; color: var(--text-lighter); font-size: 12px; font-style: normal; }
.lib-target-item .ri-check-line { color: var(--primary); }
.lib-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 8px;
  color: var(--text-light);
  font-size: 12px;
}
.lib-scroll { flex: 1; min-height: 120px; overflow-y: auto; }
.lib-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px 4px; padding-right: 4px; }
.lib-site {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: background .12s, border-color .12s;
}
.lib-site:hover { border-color: #d9dde3; background: #fafbfc; }
.lib-fav {
  display: flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 7px;
}
.lib-fav img { width: 34px; height: 34px; object-fit: contain; }
.lib-info { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.lib-name {
  overflow: hidden;
  color: var(--text-darker);
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-acts { display: flex; align-items: center; gap: 4px; }
.lib-open,
.lib-add,
.lib-remove {
  display: flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  transition: background .12s, color .12s;
}
.lib-open { background: #f2f5f9; color: var(--text-light); }
.lib-open:hover { background: #e8f3ff; color: var(--primary); }
.lib-add { background: #e8f3ff; color: #0066cc; }
.lib-add:hover { background: #0066cc; color: #fff; }
.lib-remove { background: #fdecec; color: #e5484d; }
.lib-remove:hover { background: #f9d7d9; color: #d63a3f; }
.lib-empty { padding: 40px 0; color: var(--text-lighter); font-size: 13px; text-align: center; }
.lib-retry { display: block; height: 28px; margin: 12px auto 0; padding: 0 14px; border-radius: 14px; background: #eef2f7; color: var(--text-dark); font-size: 12px; }
.lib-retry:hover { background: var(--primary); color: #fff; }
.lib-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
}
.lib-foot p { color: var(--text-lighter); font-size: 12px; }
.lib-custom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px dashed #d9e2ee;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 12px;
  white-space: nowrap;
}
.lib-custom:hover { border-color: var(--primary); background: #f5f9ff; color: var(--primary); }

/* 分类弹窗（参考 fu365 添加分类样式） */
.tab-dialog { width: 540px; border-radius: 12px; }
.tab-dialog .link-dialog-head { height: auto; padding: 24px 28px 10px; border-bottom: 0; }
.tab-dialog .link-dialog-head h3 { font-size: 21px; font-weight: 600; }
.tab-dialog .link-dialog-close { font-size: 20px; }
.tab-dialog .link-dialog-body { padding: 0 28px 22px; }
.tab-name-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  background: #fafbfc;
  color: var(--text-darker);
  font-size: 15px;
}
.tab-name-input::placeholder { color: #b6bec9; }
.tab-name-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(0, 132, 255, .1); }
.tab-colors { display: grid; grid-template-columns: repeat(9, 1fr); gap: 20px 8px; margin-top: 24px; justify-items: center; }
.tab-color { position: relative; width: 24px; height: 24px; border-radius: 50%; background: var(--c); transition: transform .15s; }
.tab-color:hover { transform: scale(1.15); }
.tab-color.cur { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.tab-color-white { border: 1px solid #d9e0ea; }
.tab-color-white.cur { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9aa7b8; }
.tab-dialog-foot { justify-content: flex-start; gap: 14px; padding: 0 28px 26px; }
.tab-dialog-actions { display: flex; flex: 1; gap: 14px; }
.tab-close-btn, .tab-save-btn { height: 46px; border-radius: 8px; font-size: 15px; }
.tab-close-btn { width: 140px; border: 1px solid #dfe4eb; color: var(--text-dark); }
.tab-close-btn:hover { border-color: #c3ccd9; }
.tab-save-btn { flex: 1; background: #0f9b8e; color: #fff; box-shadow: 0 6px 14px rgba(15, 155, 142, .22); }
.tab-save-btn:hover { background: #0c887d; }

.edit-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 38px;
  margin: 6px 0 4px;
  color: var(--text-default);
  font-size: 13px;
}
.edit-bar[hidden] { display: none; }
.edit-bar b { color: var(--primary); }
.edit-lib { height: 26px; padding: 0 12px; border-radius: 13px; background: #e8f3ff; color: #0066cc; font-size: 12px; }
.edit-lib:hover { background: #0066cc; color: #fff; }
.edit-cancel, .edit-save { height: 26px; padding: 0 14px; border-radius: 13px; font-size: 12px; }
.edit-cancel { background: #eef2f7; color: var(--text-dark); }
.edit-save { background: var(--primary); color: #fff; }











/* ==========================================================================
   精选模块（锚点导航 + 分组）
   ========================================================================== */
.source-wrapper { display: flex; gap: 14px; margin-top: 10px; }
.content-col { width: 100%; min-width: 0; }












/* 分组列表 */
.groups-panel { padding: 0 16px 0 0; }
.group { display: flex; padding: 8px 0; border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: 0; }
.group-head {
  display: flex;
  flex: 0 0 108px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding-left: 20px;
  color: var(--text-light);
  font-size: 13px;
}
.group-head i { color: #b9bec9; font-size: 26px; }
.group-links { display: grid; flex: 1; grid-template-columns: repeat(6, 1fr); gap: 0 8px; min-width: 0; }
.group-link {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  overflow: hidden;
  border-radius: 4px;
  color: var(--text-dark);
  font-size: 13px;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.group-link span { overflow: hidden; text-overflow: ellipsis; }
.group-link:hover { background: #f5f7fa; color: var(--primary); }

/* ==========================================================================
   页脚
   ========================================================================== */
footer { margin-top: 30px; background: #fafafa; }
.footer-inner { width: 100%; max-width: 1440px; margin: 0 auto; padding: 16px 30px 10px; }
.footer-main { display: flex; justify-content: space-between; }
.footer-brand { width: 380px; }
.footer-logo { height: 26px; }
.footer-logo img { display: block; height: 26px; }
.footer-brand .slogan { margin-top: 6px; color: var(--text-dark); }
.footer-brand .slogan h3 { font-size: 14px; font-weight: 500; line-height: 18px; }
.footer-brand .slogan p { display: flex; align-items: center; margin-top: 3px; color: var(--text-default); font-size: 13px; line-height: 16px; }
.footer-brand .slogan i { padding-right: 4px; color: var(--text-lighter); }

.footer-bottom { height: 42px; border-top: 1px solid #f4f4f4; }
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 14px;
}
.footer-bottom a, .footer-bottom span { margin: 0 10px; color: var(--text-dark); }
.footer-bottom a:hover { color: var(--primary); }

/* ==========================================================================
   布局模式选项
   ========================================================================== */
.layout-mode { display: flex; justify-content: space-between; margin-top: 15px; }
.mode-item {
  width: 50px;
  height: 60px;
  padding-top: 10px;
  border-radius: 4px;
  background: var(--button-active);
  color: var(--text-dark);
  text-align: center;
  cursor: pointer;
}
.mode-item:hover { background: rgba(222, 222, 222, .5); }
.mode-item p { font-size: 22px; line-height: 22px; }
.mode-item h3 { margin-top: 3px; font-size: 12px; font-weight: 400; }

/* ==========================================================================
   设置抽屉
   ========================================================================== */
.settings-layer { position: fixed; inset: 0; z-index: 1200; }
.settings-layer[hidden] { display: none; }
.settings-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  opacity: 0;
  transition: opacity .3s;
}
.settings-layer.open .settings-mask { opacity: 1; }
.settings-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 450px;
  height: 100%;
  background: #f5f6f7;
  box-shadow: -2px 0 10px rgba(0, 0, 0, .08);
  transform: translateX(100%);
  transition: transform .3s;
}
.settings-layer.open .settings-drawer { transform: none; }
.settings-head {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #f4f4f4;
}
.settings-head h3 { color: var(--text-dark); font-size: 16px; font-weight: 500; }
.settings-close {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  color: var(--text-light);
  font-size: 18px;
}
.settings-close:hover { color: var(--primary); }
.set-layout { height: calc(100% - 60px); padding: 20px; overflow-y: auto; }
.settings-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-bottom: 20px;
  padding: 0 16px;
  border-radius: 4px;
  background: #fdf6ec;
  color: #e6a23c;
  font-size: 13px;
}
.settings-alert > i:first-child { font-size: 16px; }
.settings-alert .alert-close { margin-left: auto; color: #c0c4cc; font-size: 14px; cursor: pointer; }
.settings-alert .alert-close:hover { color: #909399; }
.config-item {
  padding: 15px 20px 20px;
  border: 1px solid #f2f3f5;
  border-radius: 5px;
  background: #fff;
}
.config-item .item-title {
  margin-bottom: 15px;
  color: var(--text-dark);
  font-size: 18px;
  font-weight: 500;
}
.set-layout .layout-mode { display: flex; justify-content: flex-start; }
.set-layout .mode-item { flex: 1; width: auto; margin-right: 15px; }
.set-layout .mode-item:last-child { margin-right: 0; }
.set-layout .mode-item.active,
.set-layout .mode-item.active:hover { background: var(--primary); color: #fff; }
body.settings-open { overflow: hidden; }

/* ==========================================================================
   布局模式
   ========================================================================== */
/* 搜索区通用容器 */
body[data-mode="window"] .index { width: 100%; padding-top: 0; }
body[data-mode="simple"] .index { width: 100%; padding-top: 120px; }

/* 宽屏：头部与搜索框同步拉宽 */
body[data-mode="window"] .topbar-inner,
body[data-mode="window"] .head-inner { width: max(1200px, 88vw); }
body[data-mode="window"] .head-meta { margin-left: 20px; }
body[data-mode="window"] .head-weather { margin-left: 10px; }
body[data-mode="window"] .head-weather iframe { width: 720px; height: 98px; }
body[data-mode="window"] .hao-search { width: min(960px, 76vw); }
@media (max-width: 1619px) {
  body[data-mode="window"] .head-weather iframe { width: 565px; height: 98px; }
}
@media (max-width: 1439px) {
  body[data-mode="window"] .head-weather iframe { width: 410px; height: 98px; }
}

body[data-mode="window"] .link-panel { width: 88vw; margin: 0 auto 10px; }
body[data-mode="simple"] .link-panel { display: none; }

body[data-mode="window"] .source-wrapper { width: 88vw; margin: 0 auto; gap: 10px; }
body[data-mode="simple"] .source-wrapper { display: none; }

body[data-mode="window"] .content-col { width: auto; flex: 1; min-width: 0; }

/* 极简：展开书签 */
body[data-mode="simple"] .route-wrapper { min-height: calc(100vh - 137px); }
body[data-mode="simple"].simple-expanded .link-panel { display: block; width: 1200px; margin: -10px auto 0; }
body[data-mode="simple"].simple-expanded .simple-show { margin-top: 20px; }

/* 搜索区（宽屏 / 极简） */
body[data-mode="window"] .engine-panel,
body[data-mode="simple"] .engine-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  padding: 0 50px;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
body[data-mode="window"] .engine-panel {
  width: 88vw;
  margin: 0 auto 10px;
  border-radius: 8px;
}
body[data-mode="simple"] .engine-panel {
  height: 115px;
  padding: 0 50px;
}

/* 极简：显示书签按钮 */
.simple-show { display: none; }
body[data-mode="simple"] .simple-show { display: block; margin-top: 512px; text-align: center; }
.simple-show-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06);
  color: var(--text-default);
  font-size: 18px;
}
.simple-show-btn:hover { color: var(--primary); }
.simple-show-btn i { display: block; transition: transform .2s; }
body[data-mode="simple"].simple-expanded .simple-show-btn i { transform: rotate(180deg); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  z-index: 999;
  padding: 10px 18px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .75);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: all .25s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ==========================================================================
   换肤面板（热门皮肤，交互与 fu365 复刻版一致）
   ========================================================================== */
/* 应用皮肤后：壁纸从顶部栏下开始铺，不被白色顶栏遮挡 */
body.has-skin { position: relative; }
body.has-skin::before {
  content: "";
  position: absolute;
  top: 27px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: var(--skin-img) top center no-repeat;
  background-size: var(--skin-size, min(100%, 1920px) auto);
}

.skin-panel {
  height: 0;
  overflow: hidden;
  background: #ebebeb url(../img/theme-bg.gif);
  box-shadow: inset 0 -1px 0 #e6e6e6;
  transition: height .3s ease-out;
}
.skin-panel.open { height: 210px; }
.skin-inner { position: relative; width: 1200px; height: 210px; margin: 0 auto; }

/* 皮肤分类条 */
.skin-cats { display: flex; padding: 18px 0 0 60px; }
.skin-cats li { margin-right: 24px; color: var(--text-dark); font-size: 13px; cursor: pointer; }
.skin-cats li.cur { color: var(--primary); }

/* 缩略图滑块：一屏 6 张，左右箭头翻页 */
.skin-mid { position: relative; margin-top: 15px; border-bottom: 1px solid #d9d9d9; }
.skin-slider { position: relative; width: 900px; height: 115px; margin: 0 auto; overflow: hidden; }
.skin-slider ul { position: absolute; top: 0; left: 0; width: 6000px; transition: left .3s ease-out; }
.skin-slider li { position: relative; float: left; width: 140px; height: 100px; margin-right: 10px; cursor: pointer; }
.skin-slider .skin-thumb { display: block; padding: 5px; }
.skin-slider img { display: block; width: 130px; height: 90px; }
.skin-slider li.cur .skin-thumb { padding: 4px; background: #fff; border: 1px solid #68b500; }
.skin-name {
  position: absolute;
  bottom: 5px;
  left: 5px;
  display: none;
  width: 130px;
  height: 19px;
  overflow: hidden;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 12px;
  line-height: 19px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.skin-slider li:hover .skin-name,
.skin-slider li.cur .skin-name { display: block; }

.skin-arrow {
  position: absolute;
  top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 80px;
  color: #999;
  font-size: 26px;
}
.skin-arrow:hover { background: rgba(0, 0, 0, .03); color: var(--primary); }
.skin-prev { left: 0; }
.skin-next { right: 0; }

/* 翻页到边界时抖动反馈 */
@keyframes skinShakeLeft {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-14px); }
  70% { transform: translateX(7px); }
}
@keyframes skinShakeRight {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(14px); }
  70% { transform: translateX(-7px); }
}
.skin-slider ul.is-shake-left { animation: skinShakeLeft .45s ease-out; }
.skin-slider ul.is-shake-right { animation: skinShakeRight .45s ease-out; }

/* 底部：保存 / 取消 / 恢复默认 + 分页 */
.skin-bot { position: relative; clear: both; margin-top: 7px; text-align: center; }
.skin-save,
.skin-cancel {
  display: inline-block;
  width: 58px;
  height: 23px;
  margin: 0 2px;
  line-height: 23px;
  font-size: 12px;
  text-align: center;
}
.skin-save { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
.skin-cancel { background: #f2f2f2; border: 1px solid #dcdcdc; color: #666; }
.skin-reset {
  position: relative;
  display: inline-block;
  height: 23px;
  margin-left: 10px;
  padding-left: 15px;
  color: #e12222;
  font-size: 12px;
  line-height: 23px;
}
.skin-reset i { position: absolute; top: 4px; left: 0; font-size: 13px; }
.skin-pager {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  height: 25px;
  color: #666;
  font-size: 12px;
  line-height: 25px;
}
.skin-pager .num-wrap { position: relative; width: 15px; height: 25px; margin: 0 2px; overflow: hidden; text-align: right; }
.skin-pager ul { position: absolute; top: 0; left: 0; width: 15px; text-align: right; transition: top .3s ease-out; }
.skin-pager li { height: 24px; color: #e12222; line-height: 24px; }

/* ==========================================================================
   登录 / 用户菜单
   ========================================================================== */
.user-entry { position: relative; }
.user-entry > a { display: inline-flex; align-items: center; gap: 5px; }
.user-entry > a.logged { color: var(--primary); }
#loginLink:not(.logged) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 9px;
  border-radius: 10px;
  background: #07c160;
  color: #fff;
  line-height: 1;
}
#loginLink:not(.logged):hover { background: #06ad56; color: #fff; }
#loginLink:not(.logged)::before {
  content: '';
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: url(../img/wx.svg) center / contain no-repeat;
  mask: url(../img/wx.svg) center / contain no-repeat;
}
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.user-menu {
  position: absolute;
  top: 22px;
  right: -6px;
  z-index: 500;
  width: 190px;
  padding: 8px 0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(20, 40, 70, .16);
}
.user-menu[hidden] { display: none; }
.user-menu-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.user-menu-head .user-avatar { flex: 0 0 auto; width: 28px; height: 28px; font-size: 13px; }
.user-menu-head b,
.user-menu-head small {
  display: block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-head b { color: var(--text-darker); font-size: 13px; font-weight: 600; }
.user-menu-head small { color: var(--text-lighter); font-size: 11px; }
.user-menu ul { padding-top: 5px; }
.user-menu li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  color: var(--text-dark);
  font-size: 13px;
}
.user-menu li a:hover { background: #f5f7fa; color: var(--primary); }

/* ==========================================================================
   登录弹窗（微信扫码 / 邮箱验证码）
   ========================================================================== */
.auth-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; }
.auth-modal[hidden] { display: none; }
body.auth-open { overflow: hidden; }

.auth-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 19, 33, .56);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
  animation: auth-mask-in .24s ease-out;
}

.auth-dialog {
  position: relative;
  width: 424px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 24px);
  padding: 34px 36px 24px;
  border-radius: 24px;
  background:
    radial-gradient(120% 70% at 50% -10%, #f2f8ff 0%, rgba(255, 255, 255, 0) 62%),
    #fff;
  box-shadow:
    0 40px 90px -30px rgba(6, 20, 40, .55),
    0 12px 30px -18px rgba(6, 20, 40, .3),
    inset 0 0 0 1px rgba(255, 255, 255, .8);
  overflow: hidden auto;
  animation: auth-dialog-in .26s cubic-bezier(.22, 1, .36, 1);
}

/* 顶部柔光氛围，收拢视线到标题与扫码区 */
.auth-aurora {
  position: absolute;
  top: -140px;
  left: 50%;
  width: 320px;
  height: 240px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 132, 255, .22), rgba(0, 132, 255, 0));
  filter: blur(12px);
  pointer-events: none;
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #9aa5b6;
  font-size: 18px;
  line-height: 1;
  transition: background .18s, color .18s;
}
.auth-close:hover { background: rgba(15, 35, 60, .06); color: #33415c; }

.auth-intro { position: relative; text-align: center; }
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7b8aa1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
}
.auth-brand::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.auth-title {
  margin-top: 14px;
  color: #101c2e;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
}
/* 分段式切换：一屏只留一种登录方式 */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f6fb;
}
.auth-tab {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  color: #7b8698;
  font-size: 13px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tab:hover { color: #344258; }
.auth-tab.active {
  background: #fff;
  color: #12233a;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 32, 56, .08), 0 6px 14px -8px rgba(16, 32, 56, .35);
}

.auth-pane { min-height: 300px; padding-top: 18px; }
.auth-pane[hidden] { display: none; }

/* 扫码主视觉：唯一的视觉焦点 */
.auth-qr {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 360px;
  padding: 14px 12px 10px;
  overflow: hidden;
  border: 1px solid #e9eff8;
  border-radius: 18px;
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(7, 193, 96, .05), rgba(7, 193, 96, 0) 70%),
    #f9fbfe;
  color: #8c97a9;
  font-size: 12px;
  text-align: center;
}
.auth-qr > i { font-size: 42px; color: #b9cdea; }

/* 微信官方扫码页内嵌尺寸 300×400，等比缩放后占位 252×336 */
.auth-qr-stage {
  width: 252px;
  height: 336px;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 32, 56, .05), 0 18px 36px -26px rgba(16, 32, 56, .5);
}
.auth-qr-frame {
  display: block;
  width: 300px;
  height: 400px;
  border: 0;
  background: #fff;
  transform: scale(.84);
  transform-origin: top left;
}

.auth-qr-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: linear-gradient(160deg, #ffffff, #eefaf3);
  color: #07c160;
  font-size: 48px;
  box-shadow:
    0 18px 34px -16px rgba(7, 193, 96, .55),
    inset 0 0 0 1px rgba(7, 193, 96, .14);
}
/* 呼吸光环：提示“等待扫码” */
.auth-qr-mark::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 34px;
  border: 1px solid rgba(7, 193, 96, .28);
  animation: auth-pulse 2.8s ease-out infinite;
}
/* 扫描线：让静态标识拥有“正在工作”的生命感 */
.auth-qr-mark::after {
  content: "";
  position: absolute;
  top: 24px;
  right: 16px;
  left: 16px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(7, 193, 96, .75), transparent);
  animation: auth-scan 2.4s ease-in-out infinite;
}

.auth-qr-tip { color: #7d889b; font-size: 12px; line-height: 1.5; }

.auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 18px;
  margin: 14px 0 0;
  color: #7d889b;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.auth-status-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20c46a;
  box-shadow: 0 0 0 4px rgba(32, 196, 106, .14);
  animation: auth-blink 1.9s ease-in-out infinite;
}

.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; margin-bottom: 7px; color: #7d889b; font-size: 12px; }
.auth-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e6edf8;
  border-radius: 12px;
  background: #f8fafd;
  color: #22304a;
  font-size: 13.5px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.auth-field input::placeholder { color: #b3bdcc; }
.auth-field input:focus {
  border-color: #7cb3ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 132, 255, .1);
}
.auth-field.code { position: relative; }
.auth-field.code input { padding-right: 116px; }
.auth-code-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #eef4fe;
  color: #2c6df6;
  font-size: 12px;
  transition: background .18s;
}
.auth-code-btn:hover:not(:disabled) { background: #e2edff; }
.auth-code-btn:disabled { opacity: .55; cursor: default; }

.auth-submit {
  width: 100%;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #2f8dff, #0066ff);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 14px 26px -14px rgba(0, 104, 255, .7);
  transition: transform .18s, box-shadow .18s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 18px 30px -14px rgba(0, 104, 255, .8); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

.auth-hint { min-height: 18px; margin-top: 10px; color: #7d889b; font-size: 12px; line-height: 1.5; }
.auth-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1f5fb;
  color: #a7b1c0;
  font-size: 11.5px;
  text-align: center;
}

@keyframes auth-mask-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes auth-pulse {
  0% { transform: scale(.9); opacity: .9; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { opacity: 0; }
}
@keyframes auth-scan {
  0%, 100% { transform: translateY(0); opacity: .15; }
  50% { transform: translateY(48px); opacity: .85; }
}
@keyframes auth-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-mask,
  .auth-dialog,
  .auth-qr-mark::before,
  .auth-qr-mark::after,
  .auth-status-dot { animation: none !important; }
}
