.tools-hero { padding-bottom: 2rem; }
.tools-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: -1.5rem 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 248, 0.92);
  backdrop-filter: blur(8px);
  padding: .65rem 0;
  border-bottom: 1px solid transparent;
}
.tools-nav-item {
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.tools-nav-item:hover,
.tools-nav-item.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.tool-section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 4rem;
}
.section-lead {
  color: var(--muted);
  margin: -.5rem 0 1.25rem;
  max-width: 40rem;
  line-height: 1.65;
}
.tool-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.25rem;
  height: 100%;
}
.tool-card-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .55rem;
}
.tool-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.tool-num {
  display: inline-flex;
  width: 1.7rem;
  height: 1.7rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f7eef1;
  color: var(--brand);
  font-size: .75rem;
  font-weight: 800;
}
.tool-card > p {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
  margin: 0 0 .9rem;
}
.tool-form {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.tool-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 600;
  color: #555;
}
.tool-form select,
.tool-form input[type="number"] {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: .95rem;
}
.tool-form .row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}
.tool-form .hidden { display: none !important; }
.btn-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  border: none;
  border-radius: 10px;
  padding: .7rem .9rem;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  background: var(--brand);
  color: #fff !important;
  transition: background .15s;
}
.btn-tool:hover { background: var(--brand-deep); }
.btn-tool.secondary {
  background: #edf2f7;
  color: #334155 !important;
}
.btn-tool.secondary:hover { background: #e2e8f0; }
.tool-steps {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: #475569;
  font-size: .86rem;
  line-height: 1.55;
}
.hint-inline {
  font-size: .8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}
.offset-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem;
  text-align: center;
}
.offset-cross {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto .6rem;
  background:
    linear-gradient(#cbd5e1 1px, transparent 1px) 0 50% / 100% 8px,
    linear-gradient(90deg, #cbd5e1 1px, transparent 1px) 50% 0 / 8px 100%,
    #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.offset-cross .cross {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
}
.offset-cross .cross.front {
  background: rgba(43, 108, 176, 0.15);
  color: #2b6cb0;
  border: 2px solid #2b6cb0;
  z-index: 1;
}
.offset-cross .cross.back {
  background: rgba(200, 80, 90, 0.15);
  color: #c8505a;
  border: 2px solid #c8505a;
  z-index: 2;
}
.offset-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: .78rem;
  margin-bottom: .45rem;
}
.offset-legend .lg-f { color: #2b6cb0; font-weight: 700; }
.offset-legend .lg-b { color: #c8505a; font-weight: 700; }
.axis-label {
  position: absolute;
  font-size: .65rem;
  color: #94a3b8;
  font-weight: 600;
  pointer-events: none;
}
.axis-label.axis-x {
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
}
.axis-label.axis-y {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1.15;
  text-align: center;
}
.field-help {
  font-size: .72rem;
  font-weight: 500;
  color: #94a3b8;
}
.xy-explain .xy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: .75rem 0;
}
@media (max-width: 700px) {
  .xy-explain .xy-grid { grid-template-columns: 1fr; }
}
.xy-box {
  background: #faf7f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
}
.xy-box strong {
  display: block;
  margin-bottom: .35rem;
  color: var(--brand);
}
.xy-box p {
  margin: 0 0 .5rem;
  font-size: .88rem;
  color: #475569;
  line-height: 1.55;
}
.xy-demo {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .8rem;
}
.demo-f {
  background: rgba(43, 108, 176, 0.12);
  color: #2b6cb0;
  padding: .2rem .45rem;
  border-radius: 6px;
  font-weight: 700;
}
.demo-b {
  background: rgba(200, 80, 90, 0.12);
  color: #c8505a;
  padding: .2rem .45rem;
  border-radius: 6px;
  font-weight: 700;
}
.demo-arrow { color: #94a3b8; font-weight: 700; }
.flip-guide { display: flex; flex-direction: column; gap: .65rem; }
.flip-item {
  background: #faf7f8;
  border-radius: 8px;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
}
.flip-item strong { display: block; margin-bottom: .2rem; font-size: .9rem; }
.flip-item p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 .75rem;
}
.check-list li { margin-bottom: .45rem; }
.check-list label {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  font-size: .9rem;
  color: #334155;
  cursor: pointer;
}
.check-list input { margin-top: .2rem; }
.fit-result {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-align: center;
}
.fit-stat span {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.fit-stat small {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-top: .2rem;
}
.fit-detail {
  margin: .5rem 0 .85rem;
  font-size: .92rem;
  color: #475569;
}
.fit-visual {
  display: grid;
  gap: 3px;
  margin: 0 auto;
  max-width: 180px;
  aspect-ratio: 210 / 297;
  background: #e2e8f0;
  padding: 6px;
  border-radius: 4px;
}
.fit-visual i {
  background: #fff;
  border: 1px dashed #94a3b8;
  border-radius: 2px;
  min-height: 12px;
}
.size-table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.size-table th,
.size-table td {
  padding: .65rem .85rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  white-space: nowrap;
}
.size-table th {
  background: #faf7f8;
  color: var(--brand);
  font-weight: 700;
}
.size-table tr:last-child td { border-bottom: none; }
.tool-card.tip h3 {
  margin: 0 0 .55rem;
  font-size: 1rem;
}
.tool-card.tip ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #475569;
  font-size: .9rem;
  line-height: 1.6;
}
.deg-legend {
  margin-top: .9rem;
  padding: .7rem .8rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .84rem;
  color: #334155;
}
.deg-legend strong { display: block; margin-bottom: .4rem; color: var(--brand); }
.deg-legend ul { list-style: none; margin: 0 0 .45rem; padding: 0; }
.deg-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .3rem;
}
.deg-legend p { margin: 0; color: var(--muted); line-height: 1.45; font-size: .8rem; }
.deg-legend .tick {
  display: inline-block;
  width: 0;
  border-left: 2px solid #1e293b;
  background: #1e293b;
}
.deg-legend .tick.t05 { height: 8px; border-left-width: 1px; }
.deg-legend .tick.t1 { height: 12px; }
.deg-legend .tick.t5 { height: 16px; border-left-width: 2px; }
.deg-legend .tick.t10 { height: 20px; border-left-width: 3px; }
@media (max-width: 576px) {
  .tools-nav { position: static; }
}
