/* 三个工具页共用的顶栏和按钮。不改首页，不改格子和地图里的数据色。 */

.tool-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 44px;
  padding: 6px 12px;
  background: #faf6ef;
  border-bottom: 1px solid #e4ddd0;
  color: #28333c;
}

.tool-logo {
  height: 32px;
  width: auto;
  flex: 0 0 auto;
}

.tool-page-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  flex: 0 0 auto;
  font-family: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: #8c1d20;
}

.tool-page-sub {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #616a70;
}

.tool-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 2px;
  border-radius: 8px;
  background: rgba(36, 56, 74, 0.06);
}

.tool-nav a {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #616a70;
  text-decoration: none;
  white-space: nowrap;
}

.tool-nav a:hover {
  color: #24384a;
}

.tool-nav a[aria-current="page"] {
  background: #fffdf8;
  color: #24384a;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(40, 51, 60, 0.08);
}

.tool-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#nav-bar .tool-tools {
  margin-left: 0;
}

.tool-tools .find {
  position: relative;
  flex: 0 1 220px;
  max-width: 240px;
  min-width: 140px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #d8d2c5;
  background: #fffdf8;
  color: #28333c;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}

.tool-btn:hover {
  background: #fff;
  border-color: #8a9298;
}

.tool-btn.is-primary {
  background: #24384a;
  border-color: #24384a;
  color: #f7f3ea;
}

.tool-btn.is-primary:hover {
  background: #1c2c3b;
  border-color: #1c2c3b;
  color: #f7f3ea;
}

.tool-btn.on,
.tool-btn.is-on {
  background: #e7eef3;
  border-color: #24384a;
  color: #24384a;
}

.tool-field {
  height: 28px;
  border-radius: 8px;
  border: 1px solid #d8d2c5;
  background: #fffdf8;
  color: #28333c;
  font-size: 12px;
  box-shadow: none;
}

.tool-field:focus {
  outline: 2px solid #24384a;
  outline-offset: 1px;
}

.tool-zoom {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #616a70;
}

.tool-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#findBox.tool-field {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #d8d2c5;
  background: #fffdf8;
  box-shadow: none;
  font-size: 12px;
}

body.soft header.tool-bar {
  background: #faf6ef;
  border-bottom-color: #e4ddd0;
}

body.soft .tool-tools .tool-btn,
body.soft .tool-tools .tool-btn.on {
  background: #fffdf8;
  border-color: #d8d2c5;
  color: #28333c;
  box-shadow: none;
}

body.soft .tool-tools .tool-btn.on {
  background: #e7eef3;
  border-color: #24384a;
  color: #24384a;
}

#nav-bar.tool-bar {
  background: #faf6ef;
  border-bottom: 1px solid #e4ddd0;
  padding: 6px 12px;
  gap: 10px;
  min-height: 44px;
}

#nav-bar .action-btn {
  height: 28px;
  border-radius: 8px;
  border: 1px solid #d8d2c5;
  background: #fffdf8;
  color: #28333c;
  box-shadow: none;
}

#nav-bar .action-btn:hover,
#nav-bar .github-star-btn:hover {
  background: #fff;
  border-color: #8a9298;
  color: #28333c;
}

#nav-bar .action-btn.subtle.is-active {
  background: #e7eef3;
  border-color: #24384a;
  color: #24384a;
}

#nav-bar .github-star-btn:hover .star-mark {
  color: #ad8956;
  transform: none;
}

.dark .tool-bar {
  background: #14151c;
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
}

.dark .tool-nav {
  background: rgba(255, 255, 255, 0.06);
}

.dark .tool-nav a {
  color: #a1a1aa;
}

.dark .tool-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #f4f1ea;
}

.dark .tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e4e4e7;
}

.dark .tool-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.dark .tool-btn.is-primary {
  background: #f4f1ea;
  border-color: #f4f1ea;
  color: #24384a;
}

.dark .tool-btn.on,
.dark .tool-btn.is-on {
  background: rgba(231, 238, 243, 0.16);
  border-color: #d5dde4;
  color: #f4f1ea;
}

.dark .tool-field {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e4e4e7;
}

.dark .tool-zoom {
  color: #a1a1aa;
}

@media (max-width: 900px) {
  .tool-page-sub {
    display: none;
  }
}

@media (max-width: 800px) {
  .tool-btn {
    min-height: 44px;
    padding-inline: 12px;
    font-size: 14px;
  }

  .tool-tools {
    gap: 12px;
  }

  .tool-btn:focus-visible {
    outline: 2px solid #24384a;
    outline-offset: 2px;
  }

  .tool-field,
  #findBox.tool-field {
    min-height: 44px;
    height: 44px;
    font-size: 16px;
  }

  .tool-bar .tool-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-height: 75vh;
    overflow: auto;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .tool-bar .tool-menu button {
    min-height: 44px;
  }

  .tool-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .tool-tools {
    grid-column: 1 / -1;
    margin-left: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .tool-nav {
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .tool-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 14px;
  }
}
