/* netscope.css 的补充，不会被 sync-netscope-css.mjs 覆盖。
 * 去掉 Windows 原生 button 的 min-width / 系统皮肤，避免顶栏「退出」被拉宽。 */
button {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

@media (max-width: 900px) {
  .account-actions {
    display: none;
  }
  .brand small {
    display: block;
  }
}

/* 顶栏品牌：Logo 按原图比例完整显示，宽度跟后台「显示宽度」走。
 * netscope.css 后半段 .home-page .brand img 仍是 40×40 + object-fit:cover，必须全用 !important 压住。 */
.topbar,
.home-page .topbar {
  overflow: visible !important;
}
.brandbar,
.topbar .brandbar,
.home-page .brandbar,
.home-page .topbar .brandbar {
  height: auto !important;
  min-height: 72px;
  overflow: visible !important;
  padding-top: 12px;
  padding-bottom: 12px;
  align-items: center;
}
.brand,
.topbar .brand,
.home-page .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-self: center;
  gap: 4px;
  min-width: 0;
  overflow: visible;
  line-height: 0;
}
.brand span {
  display: contents;
}
.brand img,
.topbar .brand img,
.home-page .brand img,
.home-page .topbar .brand img,
.mobile-nav .brand img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: min(var(--logo-w, 150px), 72vw) !important;
  max-height: 72px !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: left center !important;
  box-shadow: none !important;
  flex: none;
}
.brand small,
.topbar .brand small,
.home-page .brand small {
  display: block;
  margin-top: 4px;
  max-width: min(var(--logo-w, 150px), 72vw);
  overflow: hidden;
  color: #3d5a66;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: left;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="dark"] .brand small,
html[data-theme="dark"] .home-page .brand small {
  color: #9bb4bb;
}
.mobile-nav-head {
  min-height: 72px;
  height: auto !important;
  overflow: visible !important;
  padding: 14px 16px !important;
  align-items: center;
}
.mobile-nav-head .brand {
  flex: 1 1 auto;
  min-width: 0;
}
.mobile-nav-head .brand small {
  display: none;
}

/* 抽屉底栏：登录态资料卡 + 右侧主题钮；未登录主题钮带文字 */
.mobile-nav-foot .mobile-nav-session {
  display: flex;
  grid-column: 1 / -1;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.mobile-nav-foot .theme-toggle.is-mobile-foot,
html[data-theme="dark"] .mobile-nav-foot .theme-toggle.is-mobile-foot {
  grid-column: auto !important;
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 12px !important;
  gap: 8px;
  justify-content: center;
}
.mobile-nav-session.is-logged-in .theme-toggle.is-mobile-foot,
html[data-theme="dark"] .mobile-nav-session.is-logged-in .theme-toggle.is-mobile-foot {
  flex: none;
  align-self: stretch;
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 !important;
  border-radius: 10px;
}
.mobile-nav-foot .theme-toggle.is-mobile-foot span {
  display: inline !important;
}
.mobile-nav-session.is-logged-in .theme-toggle.is-mobile-foot span {
  display: none !important;
}
.mobile-nav-foot .account-user,
html[data-theme="dark"] .mobile-nav-foot a.account-user,
html[data-theme="dark"] .mobile-nav-foot a.account-user:not(.solid) {
  display: flex !important;
  flex: 1 1 auto;
  grid-column: auto;
  align-items: center;
  justify-content: flex-start !important;
  gap: 10px;
  min-width: 0;
  min-height: 56px !important;
  height: 56px !important;
  padding: 0 12px !important;
  border: 1px solid #d7e6e8 !important;
  border-radius: 10px;
  color: inherit !important;
  background: #f7fbfb !important;
  box-shadow: none !important;
  text-decoration: none;
}
.mobile-nav-foot .account-user:hover,
html[data-theme="dark"] .mobile-nav-foot a.account-user:hover {
  border-color: var(--brand-primary) !important;
  color: inherit !important;
  background: #eef8f8 !important;
}
.mobile-nav-foot .account-avatar {
  width: 36px;
  height: 36px;
}
.mobile-nav-foot .account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}
.mobile-nav-foot .account-name {
  max-width: none;
  font-size: 14px;
  font-weight: 700;
}
.mobile-nav-foot .account-meta small {
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
html[data-theme="dark"] .mobile-nav-foot .account-user,
html[data-theme="dark"] .mobile-nav-foot a.account-user:not(.solid) {
  border-color: #2a4a52 !important;
  background: #10242c !important;
}
html[data-theme="dark"] .mobile-nav-foot .account-user:hover {
  border-color: #6eb8b4 !important;
  background: rgba(42, 158, 154, .1) !important;
}
@media (max-width: 620px) {
  .brandbar,
  .topbar .brandbar,
  .home-page .brandbar,
  .home-page .topbar .brandbar {
    height: auto !important;
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .brand img,
  .topbar .brand img,
  .home-page .brand img,
  .mobile-nav .brand img {
    max-height: 56px !important;
  }
}

/* 顶栏登录态：账号和「控制台」同高，悬停展开退出 */
.topbar .theme-toggle,
.home-page .theme-toggle {
  height: 36px;
  min-height: 36px;
}
.account-actions a.account-user,
.account-actions .account-user,
.home-page .account-actions a.account-user,
.home-page .account-actions .account-user,
html[data-theme="dark"] .account-actions a.account-user,
html[data-theme="dark"] .account-actions .account-user,
html[data-theme="dark"] .home-page .account-actions a.account-user,
html[data-theme="dark"] .home-page .account-actions .account-user {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 196px;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 10px 0 6px !important;
  border: 1px solid #c5dce0 !important;
  border-radius: var(--radius-sm, 6px);
  color: #355662 !important;
  background: #fff !important;
  box-shadow: none !important;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.account-actions a.account-user:hover,
.account-actions .account-user:hover,
.home-page .account-actions a.account-user:hover,
.home-page .account-actions .account-user:hover,
.account-menu:hover .account-user,
.account-menu:focus-within .account-user,
html[data-theme="dark"] .account-actions a.account-user:hover,
html[data-theme="dark"] .account-actions .account-user:hover,
html[data-theme="dark"] .home-page .account-actions a.account-user:hover,
html[data-theme="dark"] .home-page .account-actions .account-user:hover {
  border-color: var(--brand-primary) !important;
  color: var(--brand-primary) !important;
  background: #f4fbfb !important;
}
.account-actions .account-menu-item,
.home-page .account-actions .account-menu-item,
html[data-theme="dark"] .account-actions .account-menu-item,
html[data-theme="dark"] .home-page .account-actions .account-menu-item {
  width: 100%;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: var(--radius-sm, 6px);
  color: #4b6b76 !important;
  background: transparent !important;
  box-shadow: none !important;
  justify-content: flex-start;
}
.account-actions .account-menu-item:hover,
.home-page .account-actions .account-menu-item:hover,
html[data-theme="dark"] .account-actions .account-menu-item:hover,
html[data-theme="dark"] .home-page .account-actions .account-menu-item:hover {
  border: 0 !important;
  color: var(--brand-primary) !important;
  background: #f2fafa !important;
}
html[data-theme="dark"] .account-menu-panel {
  border-color: #234650;
  background: #10242c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .account-actions .account-menu-item,
html[data-theme="dark"] .home-page .account-actions .account-menu-item {
  color: var(--dark-text-strong, #c5d8db) !important;
}
html[data-theme="dark"] .account-actions .account-menu-item:hover,
html[data-theme="dark"] .home-page .account-actions .account-menu-item:hover {
  color: var(--dark-accent, #6eb8b4) !important;
  background: rgba(42, 158, 154, .1) !important;
}
.account-avatar {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #e8eef2;
}
.account-name {
  overflow: hidden;
  max-width: 110px;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="dark"] .account-avatar {
  background: #1a333c;
}
html[data-theme="dark"] .account-actions .account-user,
html[data-theme="dark"] .home-page .account-actions .account-user {
  border-color: #2a4a52 !important;
  color: #c5d8db !important;
  background: #10242c !important;
}
html[data-theme="dark"] .account-actions .account-user:hover,
html[data-theme="dark"] .home-page .account-actions .account-user:hover,
html[data-theme="dark"] .account-menu:hover .account-user,
html[data-theme="dark"] .account-menu:focus-within .account-user {
  border-color: #6eb8b4 !important;
  color: #6eb8b4 !important;
  background: rgba(42, 158, 154, .1) !important;
}
html[data-theme="dark"] .account-actions,
html[data-theme="dark"] .topbar .account-actions,
html[data-theme="dark"] .home-page .account-actions {
  border-left-color: #243e46;
}

/* DNS「解析结果分布」图例：浅色 hover 底在深色模式下会把 IP 字冲没 */
html[data-theme="dark"] .dns-bar {
  background: #0e1f26;
}
html[data-theme="dark"] .dns-bar-seg + .dns-bar-seg {
  box-shadow: -1px 0 0 rgba(6, 16, 20, .55);
}
html[data-theme="dark"] .dns-legend-item {
  color: var(--muted);
}
html[data-theme="dark"] .dns-legend-ip {
  color: var(--dark-text-strong);
}
html[data-theme="dark"] .dns-legend-item:hover,
html[data-theme="dark"] .dns-legend-item:focus,
html[data-theme="dark"] .dns-legend-item:focus-visible {
  border-color: var(--line);
  background: rgba(42, 158, 154, .1);
}
html[data-theme="dark"] .dns-legend-item:hover .dns-legend-ip,
html[data-theme="dark"] .dns-legend-item:focus .dns-legend-ip,
html[data-theme="dark"] .dns-legend-item:focus-visible .dns-legend-ip {
  color: var(--dark-accent);
}
html[data-theme="dark"] .dns-legend-item svg {
  color: var(--muted);
}
html[data-theme="dark"] .dns-legend-item:hover svg,
html[data-theme="dark"] .dns-legend-item:focus svg,
html[data-theme="dark"] .dns-legend-item:focus-visible svg {
  color: var(--dark-accent);
  opacity: 1;
}

/* 文章列表：窄屏不要再单行截断，封面旁给标题，摘要和底栏拉满整行 */
@media (max-width: 620px) {
  .article-row-card {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: start;
    gap: 8px 12px;
    padding: 14px;
  }
  .article-cover.row {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
    padding: 5px;
  }
  .article-row-copy {
    display: contents;
  }
  .article-row-copy h4 {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    text-overflow: unset;
    word-break: break-word;
  }
  .article-row-copy p {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    align-items: unset;
    gap: 0;
    overflow: hidden;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
  }
  .article-row-copy p span {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
  }
  .article-row-foot {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 2px;
    padding-top: 8px;
  }
  .article-row-date {
    display: inline-flex;
  }
  .article-row-arrow {
    display: none;
  }
  .article-feature-card .article-cover {
    aspect-ratio: 16 / 8;
    max-height: 148px;
  }
  .article-feature-copy {
    padding: 14px 16px 16px;
  }
  .article-feature-copy h3 {
    font-size: 17px;
    -webkit-line-clamp: 3;
  }
  .article-feature-copy p {
    -webkit-line-clamp: 3;
  }
}

/* 文章资讯下各分类共用帮助中心那套青绿封面/标签 */
.article-cover.cover-news,
.article-cover.cover-help,
.article-cover.cover-notices {
  background: linear-gradient(145deg, #e6f8f2 0%, #cceee3 100%);
}
html[data-theme="dark"] .article-cover.cover-news,
html[data-theme="dark"] .article-cover.cover-help,
html[data-theme="dark"] .article-cover.cover-notices {
  background: linear-gradient(145deg, #0e2a28 0%, #123a34 100%);
}
.article-cat-tag.news,
.article-cat-tag.help,
.article-cat-tag.notices {
  color: #0e9f86;
  background: #e6f8f2;
}
html[data-theme="dark"] .article-cat-tag.news,
html[data-theme="dark"] .article-cat-tag.help,
html[data-theme="dark"] .article-cat-tag.notices {
  color: #7ec9b4;
  background: rgba(46, 140, 120, .16);
}

/* 开始检测：结果出来前禁用，去掉 hover 高亮，避免看起来还能点 */
.ping-action:disabled,
.website-warm-button:disabled,
.findping-search-btn:disabled,
.hero-speed-slow:disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: .68;
}
.ping-action.primary:disabled,
.ping-action.primary:disabled:hover,
html[data-theme="dark"] .ping-action.primary:disabled,
html[data-theme="dark"] .ping-action.primary:disabled:hover {
  background: var(--brand-primary);
  box-shadow: none;
}
.website-warm-button:disabled:hover {
  color: #9b6b24;
  background: #fff9ee;
  border-color: #f2c985;
}

/* 批量节点选满上限：未选项文字置灰，禁止图标仅 hover 出现 */
.batch-node-grid button.disabled {
  gap: 5px;
  cursor: not-allowed;
  opacity: 1;
  color: #9aafb6;
  background: #fff;
  border-color: #e8eef0;
}
.batch-node-grid button.disabled:hover {
  color: #9aafb6;
  background: #f7fafb;
  border-color: #e8eef0;
}
.batch-node-lock-icon {
  display: none;
  flex: none;
  align-items: center;
}
.batch-node-grid button.disabled:hover .batch-node-lock-icon {
  display: inline-flex;
}
.batch-node-lock-icon svg {
  width: 13px;
  height: 13px;
  color: #b0c2c8;
}
html[data-theme="dark"] .batch-node-grid button.disabled,
html[data-theme="dark"] .batch-node-grid button.disabled:hover {
  color: #6b858c;
  background: #10242c;
  border-color: var(--line);
}
html[data-theme="dark"] .batch-node-lock-icon svg {
  color: #6b858c;
}

/* Whois / 详情页：结果卡片留白，键值表贴齐标签 */
.intercept-result-view.ping-card {
  padding: 4px 4px 12px;
}
.intercept-result-view.ping-card:has(.yc-hijack-table),
.intercept-live-card.ping-card:has(.yc-hijack-table) {
  overflow: visible;
}
.yc-domain-result.ping-card {
  margin-top: 0;
}
.yc-domain-result .domain-kv-table-wrap,
.yc-whois-kv .domain-kv-table-wrap {
  width: 100%;
}
html[data-theme="dark"] .yc-kv-table td:first-child {
  color: #8aa8ad;
  background: #0a171d;
}
html[data-theme="dark"] .yc-kv-table td:last-child {
  color: var(--dark-text-strong);
}
html[data-theme="dark"] .yc-kv-table td {
  border-color: var(--line);
}
html[data-theme="dark"] .domain-kv-table tr:hover th {
  background: #123038;
  color: #8fd9d4;
}
html[data-theme="dark"] .domain-kv-table tr:hover td {
  background: rgba(42, 158, 154, .1);
  color: var(--dark-text-strong);
}

/* 完整截图：结果表 overflow 会让部分浏览器只画出当前窗口，截图时放开裁剪 */
html.is-screenshotting .ping-card,
html.is-screenshotting .ping-result-scroll,
html.is-screenshotting .trace-result-scroll,
html.is-screenshotting .batch-result-scroll,
html.is-screenshotting .region-table,
html.is-screenshotting .coverage-map,
html.is-screenshotting .cn-map-wrap {
  overflow: visible !important;
  max-height: none !important;
}
html.is-screenshotting .cn-tooltip {
  display: none !important;
}

/* 目录卡片：图标方框与标题同一行垂直居中（覆盖 .tool-card .tool-icon 的 margin-top） */
.catalog-index-page .tool-icon {
  margin-top: 0;
  align-self: center;
}
.catalog-index-page .tool-head {
  align-self: center;
  height: 48px;
}
.catalog-index-page .tool-head strong {
  line-height: 1.2;
}
