:root {
  --tools-text: #0f172a;
  --tools-text-soft: #4f5f72;
  --tools-muted: #6b7d90;
  --tools-line: rgba(15, 61, 78, 0.12);
  --tools-line-strong: rgba(15, 61, 78, 0.2);
  --tools-accent: #0085a1;
  --tools-warm: #b46f18;
  --tools-bg: #f7f9fc;
}

@media (min-width: 992px) {
  body.view-tools_index #mainNav .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"],
  body.view-totp_tool #mainNav .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"] {
    position: relative;
    color: #fff;
    box-shadow: none !important;
  }

  body.view-tools_index #mainNav .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"]::after,
  body.view-totp_tool #mainNav .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"]::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1.05rem;
    width: 2.1rem;
    height: 2px;
    border-radius: 999px;
    background: rgba(120, 234, 247, 0.92);
    transform: translateX(-50%);
    pointer-events: none;
  }

  body.view-tools_index #mainNav.is-fixed .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"],
  body.view-totp_tool #mainNav.is-fixed .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"] {
    color: var(--tools-accent);
  }

  body.view-tools_index #mainNav.is-fixed .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"]::after,
  body.view-totp_tool #mainNav.is-fixed .navbar-nav > li.nav-item > a.nav-link[data-nav-key="tools"]::after {
    background: rgba(0, 133, 161, 0.92);
  }
}

.view-tools_index main.mb-4 > .container.px-4.px-lg-5,
.view-totp_tool main.mb-4 > .container.px-4.px-lg-5 {
  position: relative;
  z-index: 2;
  margin-top: -4.2rem;
  margin-bottom: 2rem;
}

.tools-page {
  font-family: "Open Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.tools-shell,
.totp-shell {
  border: 1px solid var(--tools-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(251, 253, 255, 1)),
    radial-gradient(circle at right top, rgba(180, 111, 24, 0.08), transparent 58%);
  box-shadow: 0 16px 30px rgba(11, 35, 54, 0.07);
  animation: tools-rise 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tools-shell {
  padding: 1.08rem;
}

.tools-hero {
  position: relative;
  padding: 0.28rem 0 0.9rem;
  border-bottom: 1px solid rgba(15, 61, 78, 0.1);
}

.tools-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(180, 111, 24, 0.38), rgba(0, 133, 161, 0.65));
}

.tools-eyebrow {
  margin: 0;
  color: #5d7388;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

.tools-title {
  margin: 0.54rem 0 0;
  color: var(--tools-text);
  font-family: "Open Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  line-height: 1.34;
  font-weight: 800;
  letter-spacing: 0;
}

.tools-summary {
  margin: 0.58rem 0 0;
  color: var(--tools-text-soft);
  font-size: 0.93rem;
  line-height: 1.75;
  max-width: 62ch;
}

.tools-grid {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.82rem;
}

.tools-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 118px;
  padding: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--tools-line);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tools-card:hover,
.tools-card:focus {
  color: inherit;
  transform: translateY(-2px);
  border-color: rgba(0, 133, 161, 0.24);
  box-shadow: 0 12px 22px rgba(12, 32, 49, 0.08);
}

.tools-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(0, 133, 161, 0.09);
  color: var(--tools-accent);
  font-size: 1.12rem;
}

.tools-card-main {
  min-width: 0;
}

.tools-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.46rem;
  margin-bottom: 0.35rem;
}

.tools-card-top strong {
  color: var(--tools-text);
  font-size: 1rem;
  line-height: 1.3;
}

.tools-card-top em {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.14rem 0.48rem;
  border: 1px solid rgba(180, 111, 24, 0.24);
  border-radius: 8px;
  background: rgba(180, 111, 24, 0.08);
  color: #6b420f;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 700;
}

.tools-card-main > span:last-child {
  display: block;
  color: var(--tools-text-soft);
  font-size: 0.9rem;
  line-height: 1.58;
}

.tools-card-arrow {
  color: var(--tools-muted);
  transition: transform 0.18s ease, color 0.18s ease;
}

.tools-card:hover .tools-card-arrow,
.tools-card:focus .tools-card-arrow {
  color: var(--tools-accent);
  transform: translateX(3px);
}

.totp-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(300px, 0.94fr);
  grid-template-areas:
    "toolbar toolbar"
    "input code";
  gap: 1px;
  padding: 1px;
  background:
    linear-gradient(135deg, rgba(0, 133, 161, 0.34), rgba(180, 111, 24, 0.22)),
    #fff;
  overflow: hidden;
}

.totp-toolbar {
  grid-area: toolbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.82rem 0.95rem;
  background:
    linear-gradient(90deg, rgba(247, 251, 253, 0.98), rgba(255, 255, 255, 0.95)),
    repeating-linear-gradient(135deg, rgba(0, 133, 161, 0.05) 0 1px, transparent 1px 10px);
}

.totp-panel {
  min-width: 0;
  padding: 1.22rem;
  background: rgba(255, 255, 255, 0.98);
}

.totp-input-panel {
  grid-area: input;
}

.totp-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(15, 61, 78, 0.14);
  border-radius: 8px;
  background: #fff;
  color: #315268;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.totp-back-link:hover,
.totp-back-link:focus {
  border-color: rgba(0, 133, 161, 0.24);
  color: var(--tools-accent);
}

.totp-trust-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.totp-trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-height: 2.15rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(180, 111, 24, 0.22);
  border-radius: 8px;
  background: rgba(180, 111, 24, 0.07);
  color: #684313;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
}

.totp-trust-strip i {
  color: var(--tools-warm);
}

.totp-section-heading {
  margin-bottom: 1rem;
}

.totp-eyebrow {
  margin: 0;
  color: var(--tools-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.totp-section-heading h2 {
  margin: 0.28rem 0 0;
  color: var(--tools-text);
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 800;
}

.totp-field label,
.totp-options span {
  display: block;
  color: #2f4054;
  font-size: 0.82rem;
  font-weight: 800;
}

.totp-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 0.58rem;
  margin-top: 0.48rem;
}

.totp-secret-input,
.totp-options select,
.totp-options input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(15, 61, 78, 0.18);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--tools-text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.totp-secret-input {
  padding: 0 0.88rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.totp-secret-input:focus,
.totp-options select:focus,
.totp-options input:focus {
  border-color: rgba(0, 133, 161, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 133, 161, 0.11);
}

.totp-icon-button,
.totp-copy-button,
.totp-clear-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(15, 61, 78, 0.16);
  background: #fff;
  color: #2f4054;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.totp-icon-button {
  width: 46px;
  height: 48px;
}

.totp-icon-button:hover,
.totp-icon-button:focus,
.totp-clear-button:hover,
.totp-clear-button:focus {
  border-color: rgba(0, 133, 161, 0.28);
  background: rgba(0, 133, 161, 0.06);
  color: var(--tools-accent);
}

.totp-field-hint {
  margin: 0.5rem 0 0;
  color: var(--tools-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.totp-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.78rem;
  margin-top: 1.1rem;
}

.totp-options select,
.totp-options input {
  margin-top: 0.42rem;
  padding: 0 0.76rem;
}

.totp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.64rem;
  margin-top: 1.12rem;
}

.totp-copy-button,
.totp-clear-button {
  min-height: 44px;
  padding: 0 0.92rem;
  gap: 0.46rem;
  font-size: 0.86rem;
}

.totp-copy-button {
  border-color: #007891;
  background: linear-gradient(180deg, #0790ad, #007891);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 133, 161, 0.18);
}

.totp-copy-button:hover,
.totp-copy-button:focus {
  background: linear-gradient(180deg, #0786a1, #026f86);
  border-color: #026f86;
  color: #fff;
  transform: translateY(-1px);
}

.totp-copy-button:disabled {
  border-color: rgba(100, 116, 139, 0.16);
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
  transform: none;
}

.totp-status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0;
  padding: 0.48rem 0.64rem;
  border: 1px solid rgba(0, 133, 161, 0.12);
  border-radius: 8px;
  background: rgba(0, 133, 161, 0.05);
  color: #3f647a;
  font-size: 0.84rem;
  line-height: 1.55;
}

.totp-status.is-error {
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(180, 35, 24, 0.05);
  color: #b42318;
}

.totp-code-panel {
  grid-area: code;
  display: grid;
  place-items: stretch;
  min-height: 360px;
  background:
    linear-gradient(145deg, rgba(11, 62, 73, 0.94), rgba(17, 89, 103, 0.9)),
    radial-gradient(circle at left top, rgba(255, 210, 137, 0.2), transparent 58%);
  text-align: center;
}

.totp-code-panel-inner {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.08rem;
  min-height: 100%;
  padding: 1.45rem 1.12rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.totp-code-ring {
  --totp-progress: 0deg;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0d4652 56%, transparent 58%),
    conic-gradient(#f0b75d var(--totp-progress), rgba(255, 255, 255, 0.18) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 16px 28px rgba(0, 0, 0, 0.18);
  color: #ffe0a8;
  font-size: 1.34rem;
  font-weight: 800;
}

.totp-code-block {
  width: 100%;
}

.totp-code-label {
  margin: 0;
  color: rgba(239, 252, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.totp-code {
  display: block;
  min-height: 4.7rem;
  margin-top: 0.24rem;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 3.25rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
}

.totp-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.05rem;
  margin: 0.1rem 0 0;
  padding: 0 0.72rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(239, 252, 255, 0.82);
  font-size: 0.86rem;
  font-weight: 700;
}

@keyframes tools-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (max-width: 991.98px) {
  .view-tools_index main.mb-4 > .container.px-4.px-lg-5,
  .view-totp_tool main.mb-4 > .container.px-4.px-lg-5 {
    margin-top: -3rem;
    margin-bottom: 1.5rem;
  }

  .tools-grid,
  .totp-shell {
    grid-template-columns: 1fr;
  }

  .totp-shell {
    grid-template-areas:
      "toolbar"
      "code"
      "input";
  }

  .totp-code-panel {
    min-height: 300px;
  }
}

@media (max-width: 767.98px) {
  .view-tools_index main.mb-4 > .container.px-4.px-lg-5,
  .view-totp_tool main.mb-4 > .container.px-4.px-lg-5 {
    margin-top: -2.2rem;
  }

  .tools-shell,
  .totp-panel {
    padding: 0.9rem;
  }

  .totp-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.78rem;
  }

  .totp-trust-strip {
    justify-content: flex-start;
  }

  .tools-card {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 112px;
  }

  .tools-card-arrow {
    display: none;
  }

  .totp-options {
    grid-template-columns: 1fr;
    gap: 0.62rem;
  }

  .totp-code-panel {
    min-height: 260px;
  }

  .totp-code-ring {
    width: 86px;
    height: 86px;
    font-size: 1.12rem;
  }

  .totp-code {
    min-height: 3.7rem;
    font-size: 2.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tools-shell,
  .totp-shell,
  .tools-card,
  .tools-card-arrow,
  .totp-icon-button,
  .totp-copy-button,
  .totp-clear-button {
    animation: none;
    transition: none;
    transform: none;
  }
}
