/* ============ 总布局 ============ */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
.layout { opacity: 1; }

/* ============ 侧边栏（卡片化后已移除，保留 DOM 仅为兼容状态点/角标等 JS 引用）============ */
.sidebar {
  display: none !important;
}
.sidebar-legacy-unused {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #FFFFFF;
  border-right: 1px solid #F1F5F9;
  padding: 16px 0;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
  text-decoration: none;
}
.sidebar-brand .brand-marker { display: none; }
.sidebar-brand .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #2563EB;
  flex-shrink: 0;
}
.sidebar-brand .brand-title {
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.sidebar-brand .brand-title em {
  font-style: normal;
  color: #2563EB;
}
.sidebar-brand .brand-sub {
  display: none;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}

.sidebar-section-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  padding: 0 12px;
  margin-bottom: 3px;
  margin-top: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 0 10px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 1px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: #334155;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background .15s, color .15s;
  border-radius: 8px;
}
.nav-item:hover {
  color: #020617;
  background: #F8FAFC;
}
.files-nav-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}
.task-new-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #EF4444;
  flex-shrink: 0;
  display: inline-block;
}
.nav-item.active {
  color: #1D4ED8;
  background: #EFF6FF;
  font-weight: 500;
}
.nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #2563EB;
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .45; transition: opacity .15s; }
.nav-item:hover svg { opacity: .7; }
.nav-item.active svg { color: #2563EB; opacity: 1; }
.nav-item .nav-icon-spacer { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .nav-num {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  color: #94A3B8;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  background: #F8FAFC;
}
.nav-item.active .nav-num {
  color: #2563EB;
  border-color: #BFDBFE;
  background: #EFF6FF;
}

.sidebar-footer {
  padding: 14px 16px 0;
  border-top: 1px solid #E2E8F0;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
}
.status-dot {
  width: 8px; height: 8px;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(16,185,129,.2);
  flex-shrink: 0;
  border-radius: 50%;
}
.status-dot.running {
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(16,185,129,.2);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,.2); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,.1); } }

/* ============ 主区域 ============ */
.main {
  padding: 32px 48px 64px 44px;
  background: #F7FAFC;
  max-width: 1700px;
  position: relative;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main::-webkit-scrollbar { display: none; }

/* ============ 顶部导航栏 ============ */
.main-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-dim);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s;
}
.topbar-link:hover {
  color: var(--cyan);
}
.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--line-dim);
}
.topbar-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--cyan-dim);
  background: var(--cyan-ghost);
  border: 1px solid transparent;
  transition: transform .14s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.topbar-icon-btn:hover {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: var(--line);
  box-shadow: var(--glow-cyan-soft);
}
.topbar-icon-btn:active {
  transform: translateY(1px) scale(.96);
  box-shadow: none;
}
.topbar-icon-btn.active {
  background: var(--cyan);
  color: #FFFFFF;
  border-color: var(--cyan);
  box-shadow: 0 6px 16px rgba(37,99,235,.18);
}
.topbar-icon-btn.has-unread {
  color: var(--amber-dim);
  background: rgba(245,158,11,.10);
  border-color: rgba(245,158,11,.24);
}
.topbar-icon-btn.has-unread:hover {
  background: rgba(245,158,11,.16);
  color: var(--amber-dim);
}
.topbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--magenta);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-panel {
  position: fixed;
  top: 58px;
  right: 26px;
  width: min(820px, calc(100vw - 28px));
  height: min(660px, calc(100vh - 86px));
  background: var(--bg-0);
  border: 1px solid var(--line-dim);
  box-shadow: 0 18px 48px rgba(15,23,42,.14), 0 4px 12px rgba(15,23,42,.08);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(.985);
  transform-origin: top right;
  transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1), visibility .2s;
}
/* 消息面板圆角 —— 单一来源（!important 覆盖全局 *{border-radius:revert}） */
.message-panel { border-radius: 16px !important; }
.message-panel-head { border-radius: 16px 16px 0 0 !important; }
.message-sidebar { border-radius: 0 0 0 16px !important; }
.message-compose { border-radius: 0 0 16px 0 !important; }
.message-panel-body,
.message-main,
.message-chat-view,
.message-notice-view,
.message-thread,
.message-notices {
  border-radius: 0 !important;
}
.message-tab,
.message-tab-icon,
.message-contact,
.message-bubble,
.message-input,
.message-admin-card,
.message-admin-card textarea,
.message-admin-card button,
.message-compose button {
  border-radius: 12px !important;
}
.message-close { border-radius: 10px !important; }
.message-contact-avatar,
.message-peer-avatar,
.message-contact-avatar img,
.message-peer-avatar img {
  border-radius: 999px !important;
}
.message-list-badge { border-radius: 999px !important; }
.message-bubble::before { border-radius: 0 0 0 2px !important; }
.message-panel.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.message-panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}
.message-title { font-size: 18px; font-weight: 800; color: var(--text); }
.message-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.message-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: var(--bg-0);
  font-size: 18px;
  transition: all .18s;
}
.message-close:hover { color: var(--magenta); border-color: var(--magenta); }
.message-close:active {
  transform: translateY(1px) scale(.96);
  background: #FEF2F2;
}
.message-panel-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  overflow: hidden;
}
.message-sidebar {
  border-right: 1px solid var(--line-dim);
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  padding: 12px;
  overflow: auto;
}
.message-tab {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: all .18s;
}
.message-tab > span:nth-child(2) { flex: 1; text-align: left; }
.message-tab:hover { background: var(--cyan-ghost); color: var(--cyan-dim); }
.message-tab:active {
  transform: translateY(1px) scale(.985);
  background: var(--cyan-soft);
}
.message-tab.active {
  background: var(--cyan-soft);
  color: var(--cyan-dim);
}
.message-tab-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-soft);
  color: var(--cyan-dim);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.08);
}
.message-tab-icon.notice-icon,
.message-peer-avatar.notice-avatar {
  background: #FEF3C7;
  color: #D97706;
  box-shadow: inset 0 0 0 1px rgba(217,119,6,.12);
}
.message-side-title {
  margin: 14px 8px 8px;
  font-size: 12px;
  color: var(--text-ghost);
  font-weight: 700;
}
.message-contact-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.message-contact {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  color: var(--text-mid);
  transition: all .18s;
}
.message-list-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(239,68,68,.22);
}
.message-list-badge.msg-contact-badge {
  margin-left: auto;
}
.message-contact:hover { background: var(--cyan-ghost); color: var(--cyan-dim); }
.message-contact:active {
  transform: translateY(1px) scale(.985);
  background: var(--cyan-soft);
}
.message-contact.active {
  background: var(--cyan-soft);
  color: var(--cyan-dim);
}
.message-contact-avatar,
.message-peer-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-soft);
  color: var(--cyan-dim);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.08);
  overflow: hidden;
}
.message-contact-avatar img,
.message-peer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit !important;
}
.message-contact-main { min-width: 0; text-align: left; }
.message-contact-name {
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-contact-note {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-ghost);
}
.message-admin-card {
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line-dim);
  background: var(--bg-0);
}
.message-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
}
.message-chat-view,
.message-notice-view {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.message-chat-head {
  height: 66px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(255,255,255,.92);
}
.message-peer-avatar { width: 38px; height: 38px; }
.message-peer-avatar.notice-avatar {
  background: #FEF3C7;
  color: #D97706;
}
.message-peer-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.message-peer-note {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-ghost);
}
.message-thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(37,99,235,.025), rgba(255,255,255,0) 34%),
    #F8FAFC;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message-bubble {
  max-width: min(78%, 420px);
  padding: 10px 12px;
  border: 1px solid var(--line-dim);
  background: var(--bg-0);
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
  position: relative;
}
.message-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-left: 1px solid var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
  transform: rotate(45deg);
}
.message-bubble.mine {
  align-self: flex-end;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 4px 12px rgba(37,99,235,.16);
}
.message-bubble.mine::before {
  left: auto;
  right: -6px;
  border-left: none;
  border-bottom: none;
  border-right: 1px solid var(--cyan);
  border-top: 1px solid var(--cyan);
}
.message-bubble.mine .message-meta,
.message-bubble.mine .message-content {
  color: #FFFFFF;
}
.message-bubble.notice {
  max-width: 100%;
  background: var(--cyan-ghost);
  border-color: var(--line);
}
/* 通知列表：一条一条展示（区别于私信的聊天气泡） */
.notice-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line-dim);
  background: transparent;
}
.notice-item:last-child { border-bottom: none; }
.notice-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #CBD5E1;
  margin-top: 7px;
  flex-shrink: 0;
}
/* 新通知：圆点高亮 + 「新」角标，旧通知灰点 */
.notice-item.unread { background: var(--cyan-ghost); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.notice-item.unread .notice-item-dot { background: var(--cyan); }
.notice-new-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--cyan);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  vertical-align: 2px;
}
.notice-item-body { flex: 1; min-width: 0; }
.notice-item-meta {
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 5px;
  font-family: var(--font-mono);
}
.message-notices { gap: 0; padding: 8px 14px; }
.message-meta {
  font-size: 11px;
  color: var(--text-ghost);
  margin-bottom: 5px;
  font-family: var(--font-mono);
}
.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-mid);
  font-size: 13.5px;
  line-height: 1.55;
}
.message-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid var(--line-dim);
  background: #FFFFFF;
}
.message-panel .btn {
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease;
}
.message-panel .btn:active {
  transform: translateY(1px) scale(.98);
  box-shadow: none;
}
.message-input {
  min-height: 36px !important;
  height: 36px !important;
  max-height: 72px;
  padding: 8px 12px !important;
  resize: none;
  overflow-y: auto;
  line-height: 18px;
  background: var(--bg-1) !important;
  border-color: transparent !important;
}
.message-input:focus {
  background: #FFFFFF !important;
  border-color: var(--cyan) !important;
}
.message-input:active {
  background: #FFFFFF !important;
}
.message-notices {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 16px;
  background: #F8FAFC;
}
.message-empty {
  color: var(--text-ghost);
  font-size: 13px;
  text-align: center;
  padding: 28px 8px;
}
.message-empty.compact { padding: 16px 8px; }
@media (max-width: 760px) {
  .message-panel {
    inset: 54px 10px 10px 10px;
    width: auto;
    height: auto;
  }
  .message-panel-body { grid-template-columns: 1fr; }
  .message-sidebar { max-height: 230px; border-right: none; border-bottom: 1px solid var(--line-dim); }
}
.topbar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
}
.topbar-user:hover {
  background: var(--cyan-ghost);
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cyan);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-username {
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.topbar-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-0);
  border: 1px solid var(--line-dim);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  min-width: 140px;
  z-index: 1000;
  overflow: hidden;
}
.topbar-dropdown.show {
  display: block;
}
.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-cn);
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.topbar-dropdown-item:hover {
  background: var(--cyan-ghost);
  color: var(--magenta);
}
/* 下拉导航项默认桌面端隐藏，手机端才显示 */
.topbar-dropdown-nav { display: none; }
.topbar-dropdown-divider {
  height: 1px;
  background: var(--line-dim);
  margin: 4px 0;
}

.page { display: none; }
.page.active {
  display: block;
  animation: pageEnter .5s cubic-bezier(.2,.8,.2,1);
}
#page-preview.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  overflow: hidden;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 页标题 */
.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  color: #0B1222;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-title .title-it { color: var(--cyan); }
.page-title .title-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line-dim);
  background: var(--bg-3);
  border-radius: 6px;
}
.page-subtitle {
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
  padding: 10px 14px;
  border-left: 3px solid var(--cyan);
  background: var(--cyan-ghost);
  border-radius: 0 8px 8px 0;
}


/* ============================================================
   爬虫平台 · 卡片首页（功能宫格）
   ============================================================ */
#page-home.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.home-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 40px 56px;
  box-sizing: border-box;
  background: #F7FAFC;
}
.home-wrap > * { max-width: 1280px; margin-left: auto; margin-right: auto; }

/* —— 页面头部 —— */
.home-head { margin-bottom: 24px; }
.home-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: #111827; }
.home-subtitle { margin: 8px 0 0; font-size: 14px; color: #6B7280; }

/* —— 搜索 + 平台筛选 —— */
.home-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}
.home-search {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
  max-width: 460px;
}
.home-search svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: #94A3B8;
  pointer-events: none;
}
.home-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  font-size: 14px;
  color: #111827;
  background: #FFFFFF;
  border: 1px solid #E5EAF0;
  border-radius: 10px !important;
  box-sizing: border-box;
  transition: border-color .16s, box-shadow .16s;
}
.home-search input::placeholder { color: #94A3B8; }
.home-search input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.home-filters { display: inline-flex; gap: 8px; flex-shrink: 0; }
.home-filter {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  background: #FFFFFF;
  border: 1px solid #E5EAF0;
  border-radius: 9px !important;
  cursor: pointer;
  transition: all .16s;
}
.home-filter:hover { color: #2563EB; border-color: #C7D7F5; }
.home-filter.active {
  color: #FFFFFF;
  background: #2563EB;
  border-color: #2563EB;
  box-shadow: 0 4px 10px rgba(37,99,235,.22);
}

/* —— 分组 —— */
.home-group { margin-bottom: 28px; }
.home-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin: 0 2px 12px;
}
.home-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E5EAF0;
}

/* —— 卡片宫格：超宽屏 5 / 桌面 4 / 中屏 2 / 移动 1 ——
   功能目录本质是"浏览很多离散功能"，收紧密度后一屏能看到更多、滚动更少。 */
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 1600px) { .home-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .home-grid { grid-template-columns: 1fr; } }

/* 常用功能固定 5 张卡片，桌面宽度下就该凑成一行，不用等到超宽屏才切 5 列 */
@media (min-width: 1025px) { .home-grid-featured { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* —— 功能卡片 —— */
.fcard {
  display: flex;
  flex-direction: column;
  min-height: 160px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid #E5EAF0;
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, box-shadow .2s ease, border-color .18s ease;
}
.fcard:hover {
  transform: translateY(-2px);
  border-color: #2563EB;
  box-shadow: 0 10px 22px rgba(37,99,235,.12);
}
.fcard:active { transform: translateY(-1px); }
.fcard:focus-visible { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }

.fcard-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }

/* App 图标（左上） */
.fcard-logo {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px !important;
  flex-shrink: 0;
}
.fcard-logo.logo-xhs { background: #FF2442; }
.fcard-logo.logo-douyin { background: #111111; }
.fcard-icon {
  width: 21px; height: 21px;
  background: #FFFFFF;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
}
.logo-xhs .fcard-icon { -webkit-mask-image: url(/icons/xhs.svg); mask-image: url(/icons/xhs.svg); }
.logo-douyin .fcard-icon { -webkit-mask-image: url(/icons/tiktok.svg); mask-image: url(/icons/tiktok.svg); }

/* 状态标签（右上） */
.fcard-badge {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 6px !important;
  flex-shrink: 0;
}
.badge-hot    { background: #FFF3E5; color: #D97706; }
.badge-rec    { background: #EAF1FE; color: #2563EB; }
.badge-stable { background: #E7F6EE; color: #059669; }
.badge-new    { background: #F2ECFE; color: #7C3AED; }
.badge-risk   { background: #FEECEC; color: #DC2626; }

/* 名称 + 介绍 */
.fcard-name { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; color: #111827; line-height: 1.3; }
.fcard-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6B7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部：评分/人数 + 立即使用 */
.fcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}
.fcard-meta { display: inline-flex; align-items: center; gap: 12px; font-size: 12.5px; min-width: 0; }
.fcard-rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #111827; }
.fcard-rating svg { width: 13px; height: 13px; color: #F59E0B; }
.fcard-users { color: #94A3B8; white-space: nowrap; }
.fcard-cta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600;
  color: #2563EB;
  white-space: nowrap;
  flex-shrink: 0;
}
.fcard-cta svg { width: 14px; height: 14px; transition: transform .18s ease; }
.fcard:hover .fcard-cta svg { transform: translateX(3px); }

/* 空状态 */
.home-empty { padding: 48px 0; text-align: center; font-size: 14px; color: #94A3B8; }

/* 首页模式：主区交给卡片宫格自身排版 */
body.home-mode .main { padding: 0; }
