/*!
 * 首页 · 页面样式
 * 来源：index.php（原内联代码，已抽离为外部文件统一调用）
 */
/* 已收录网站数量：位于「聚合/学术」栏右侧、排序菜单左边 */
.left-col .nav-count { margin-left: auto; display: inline-flex; align-items: center; font-size: 13px; color: #9aa0ac; white-space: nowrap; }
.left-col .nav-count b { font-weight: 700; color: #1b5bd5; margin: 0 3px; }
.left-col .nav-count ~ .nav-controls { margin-left: 14px; }
/* 工具栏三段式定位：
   ① 分类标签恒定居左——可按住拖拽调整顺序，但整体始终靠左，不会再跑到中间；
   ② 「已收录数量」+「排序菜单」恒定居右，且数量紧贴排序左侧（示意图蓝框位置）。
   order 锁定三段的左右次序；数量→排序用通用兄弟(~)选择器，确保数量始终紧贴排序左侧。 */
.left-col .cnt-nav .cnt-tab      { order: 0; }   /* 拖拽抓手光标由 front.css 的 cursor:grab 提供 */
.left-col .cnt-nav .nav-count    { order: 8; }
.left-col .cnt-nav .nav-controls { order: 9; }
.left-col .site-section { position: relative; padding-right: 48px; }
.sec-add { position: absolute; right: 8px; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.left-col .site-section:hover .sec-add,
.left-col .site-section:focus-within .sec-add { opacity: 1; pointer-events: auto; }
.sec-add-btn {
  width: 26px; height: 26px; padding: 0; border: none; cursor: pointer; border-radius: 50%;
  background: #eef1f6; color: #aeb6c2; font-size: 18px; font-weight: 300; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
  transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.sec-add-btn:hover, .sec-add-btn:focus-visible { background: #1b5bd5; color: #fff; transform: scale(1.08); box-shadow: 0 2px 8px rgba(27,91,213,.45); }
.sec-add-btn:active { background: #1749a8; color: #fff; transform: scale(.96); box-shadow: 0 1px 4px rgba(27,91,213,.4); }
.sec-add-btn:focus-visible { outline: 2px solid #b3cfff; outline-offset: 2px; }

.sec-more-btn {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  background: #eef1f6; color: #aeb6c2;
  transition: background .15s, color .15s, transform .15s;
}
.sec-more-btn:hover, .sec-more-btn:focus-visible { background: #e3e7ef; color: #5b6270; transform: scale(1.08); }
.sec-more-btn:focus-visible { outline: 2px solid #cfd6e4; outline-offset: 2px; }
.sec-more-btn svg { display: block; }

/* 网址标题过长时以省略号截断，避免撑破/溢出格子 */
.left-col .sg-item { min-width: 0; }
.left-col .sg-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-item.sg-custom { position: relative; }
.sg-del {
  position: absolute; top: 2px; right: 4px; width: 15px; height: 15px; border-radius: 50%;
  background: #dcdcdc; color: #fff; font-size: 12px; line-height: 15px; text-align: center;
  display: none; cursor: pointer;
}
.sg-item.sg-custom:hover .sg-del { display: block; }
.sg-del:hover { background: #f56c6c; }

.agg-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.42); display: none; align-items: center; justify-content: center; z-index: 9999; }
.agg-modal-mask.show { display: flex; }
.agg-modal { width: 380px; max-width: calc(100vw - 32px); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.18); animation: aggPop .16s ease; }
@keyframes aggPop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.agg-modal-hd { padding: 16px 20px; font-size: 15px; font-weight: 600; color: #222; border-bottom: 1px solid #f0f0f0; }
.agg-modal-bd { padding: 18px 20px 4px; }
.agg-field { margin-bottom: 14px; }
.agg-field label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; }
.agg-field input { width: 100%; box-sizing: border-box; height: 38px; padding: 0 12px; border: 1px solid #dcdfe6; border-radius: 8px; font-size: 14px; color: #333; outline: none; transition: border-color .15s; }
.agg-field input:focus { border-color: #1b5bd5; }
.agg-err { color: #f56c6c; font-size: 12px; min-height: 16px; margin: -4px 0 6px; }
.agg-modal-ft { padding: 6px 20px 18px; display: flex; justify-content: flex-end; gap: 10px; }
.agg-btn { height: 36px; padding: 0 18px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.agg-btn-cancel { background: #fff; border-color: #dcdfe6; color: #606266; }
.agg-btn-cancel:hover { background: #f5f5f5; }
.agg-btn-ok { background: #1b5bd5; color: #fff; }
.agg-btn-ok:hover { background: #1749a8; }
.agg-btn[disabled] { opacity: .6; cursor: default; }

.home-ai{width:1200px;max-width:100%;margin:12px auto 24px;background:#fff;border:1px solid #efefef;border-radius:var(--hai-radius,4px);overflow:hidden;display:none}
.home-ai.on{display:block}
.home-ai-hd{position:relative;display:flex;align-items:center;justify-content:center;padding:14px 20px 12px;border-bottom:1px solid #f0f0f0}
.home-ai.hd-left .home-ai-hd{justify-content:flex-start}
.home-ai-hd .hai-tt{font-size:16px;font-weight:600;color:#333;letter-spacing:1px}
.home-ai.hd-left .hai-tt{letter-spacing:0;display:inline-flex;align-items:center}
.home-ai.hd-left .hai-tt::before{content:'';display:inline-block;width:3px;height:16px;background:var(--hai-accent,#1b5bd5);border-radius:2px;margin-right:8px;vertical-align:middle}
.home-ai-hd .hai-all{position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:12px;color:#999;text-decoration:none;transition:color .15s}
.home-ai-hd .hai-all:hover{color:#f25d30}
.home-ai-tabs{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;padding:14px 20px 2px}
.home-ai.hd-left .home-ai-tabs{justify-content:flex-start}
.hai-tab{font-size:13px;line-height:1;color:#666;background:#f5f6f8;border:1px solid transparent;border-radius:14px;padding:7px 15px;text-decoration:none;cursor:pointer;white-space:nowrap;transition:color .15s,background .15s,border-color .15s}
.hai-tab:hover{color:var(--hai-accent,#1b5bd5);background:#f0f5ff;border-color:#cfe0ff}
.hai-tab.on{color:#fff;background:var(--hai-accent,#1b5bd5);border-color:var(--hai-accent,#1b5bd5)}
.hai-panel{display:none;padding:14px 20px 18px}
.hai-panel.on{display:block}
.hai-grid{display:grid;grid-template-columns:repeat(var(--hai-cols,8),minmax(0,1fr));gap:10px}
.hai-app{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:14px 6px 12px;border:1px solid #eef0f3;border-radius:8px;background:#fafbfc;text-decoration:none;color:#555;transition:border-color .15s,background .15s,color .15s,box-shadow .15s,transform .15s}
.hai-app:hover{border-color:#cfe0ff;background:#f0f5ff;color:var(--hai-accent,#1b5bd5);box-shadow:0 4px 14px rgba(27,91,213,.08);transform:translateY(-2px)}
.hai-app-nm{font-size:13px;line-height:1.2;max-width:100%;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hai-ico{width:34px;height:34px;border-radius:var(--hai-icon-radius,8px);flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:14px;font-weight:600;line-height:1;overflow:hidden;position:relative}
.hai-ico.r{border-radius:50%}
.hai-ico .site-favicon{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hai-more{color:#8a94a3}
.hai-more-ic{width:34px;height:34px;border-radius:var(--hai-icon-radius,8px);flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;background:#eef1f6;color:#8a94a3;font-size:20px;font-weight:600;line-height:1;transition:background .15s,color .15s}
.hai-more:hover .hai-more-ic{background:#dfe9fb;color:var(--hai-accent,#1b5bd5)}
@media (max-width:1000px){.hai-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media (max-width:600px){.hai-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.home-ai-tabs{justify-content:flex-start}}
