:root {
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.tool-page {
  background: linear-gradient(180deg, #fff 0%, #f8f9ff 100%);
  min-height: 100vh;
  padding: 120px 20px 65px;
}
.tool-wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.tool-head {
  text-align: center;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(0, 102, 255, 0.1),
    rgba(0, 217, 255, 0.1)
  );
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tool-head h1 {
  font-family: sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 18px;
  line-height: 1.15;
}
.tool-head p {
  font-size: 1.05rem;
  color: #6b7280;
  max-width: 550px;
  margin: 12px auto 0;
  line-height: 1.7;
}

.surface-card {
  background: #fff;
  border-radius: 32px;
  border: 2px solid #f0f1f8;
  box-shadow: 0 20px 60px rgba(0, 102, 255, 0.08);
  margin-top: 48px;
}
.field-area {
  padding: 40px 44px 36px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1;
}
.section-label::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--gradient);
  border-radius: 20px;
  flex-shrink: 0;
  align-self: center;
  transform: translateY(-1px);
  will-change: transform;
}
* + .section-label {
  margin-top: 32px;
}

.btn-row {
  margin-top: 32px;
  display: flex;
  gap: 12px;
}
.btn-primary {
  flex: 1;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 22px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background-size: 150% 100%;
  transition: background-position 0.3s ease;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary:hover {
  background-position: right center;
  box-shadow: 0 0 20px rgba(0, 102, 255, 0.2);
}
.btn-secondary {
  padding: 13px 22px;
  background: #fff;
  color: var(--dark);
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s;
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 102, 255, 0.2);
}
.btn-secondary.btn-danger:hover {
  border-color: #ef4444;
  color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
}

.result-btn-row {
  padding: 24px 44px 32px;
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
  border-top: 2px solid #f0f1f8;
}
.result-btn-row .btn-secondary {
  flex: 1;
}

.toggle-row {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.toggle-switch {
  display: flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.toggle-btn {
  padding: 7px 18px;
  border: none;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #6b7280;
  transition: all 0.2s;
  white-space: nowrap;
}
.toggle-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.toggle-btn:not(.active):hover {
  color: var(--dark);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-grid:first-of-type {
  margin-top: 14px;
}
.field-grid:not(:first-of-type) {
  margin-top: 20px;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.field-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 13px;
  font-size: 1rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  color: var(--dark);
  background: #fafafa;
  transition: all 0.25s;
  box-sizing: border-box;
}
.field-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}
.field-input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}
.field-input::placeholder {
  color: #757575;
  font-weight: 600;
}
.field-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 13px;
  font-size: 1rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  color: var(--dark);
  background: #fafafa;
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.field-select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff var(--select-arrow) no-repeat right 12px center;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}
.field-select.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}
.field-required {
  color: #ef4444;
}
.field-optional {
  font-size: 0.8rem;
  color: #9ca3af;
  font-weight: 300;
  margin-left: 7px;
  text-transform: none;
  letter-spacing: 0;
}

.result-area {
  display: none;
}
.result-area.show {
  display: block;
}

.result-area,
.result-area * {
  user-select: text;
  -webkit-user-select: text;
}

.info-section {
  margin-top: 50px;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.info-tile {
  background: #fff;
  border: 2px solid #f0f1f8;
  border-radius: 20px;
  padding: 24px 20px;
  transition: all 0.25s ease;
}
.info-tile-icon {
  font-size: 1.8rem;
  display: block;
}
.info-tile h3 {
  font-family: sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 12px;
}
.info-tile p {
  font-size: 0.83rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
  margin-top: 6px;
}

.tips-section {
  background: #fff;
  border: 2px solid #f0f1f8;
  border-radius: 24px;
  margin-top: 30px;
  overflow: hidden;
}
.tips-header {
  width: 100%;
  background: none;
  border: none;
  padding: 28px 32px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: opacity 0.2s;
}
.tips-header:hover {
  background: linear-gradient(
    90deg,
    rgba(0, 102, 255, 0.08) 0%,
    rgba(0, 102, 255, 0.025) 75%,
    #fff 100%
  );
}
.tips-header:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}
.tips-header h2 {
  font-family: sans-serif;
  font-size: 1.4rem;
  color: var(--dark);
  margin: 0;
  text-align: left;
}
.tips-header svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.3s ease;
}
.tips-header:hover svg {
  stroke: #0066ff;
}
.tips-section.open .tips-header {
  background: linear-gradient(
    90deg,
    rgba(0, 102, 255, 0.08) 0%,
    rgba(0, 102, 255, 0.025) 75%,
    #fff 100%
  );
}
.tips-section.open .tips-header svg {
  transform: rotate(180deg);
  stroke: var(--primary);
}
.tips-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.tips-section.open .tips-body {
  max-height: 800px;
}
.tip-row:first-child {
  border-top: 2px solid #f0f1f8;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1.5px solid #f0f1f8;
  transition: background 0.2s;
}
.tip-row:last-child {
  border-bottom: none;
}
.tip-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.tip-text {
  flex: 1;
  font-size: 0.95rem;
  color: #374151;
  font-weight: 500;
  line-height: 1.55;
  display: inline;
}
.tip-keys {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1.5px solid #d1d5db;
  border-bottom-width: 3px;
  border-radius: 7px;
  margin: 0 5px;
  padding: 4px 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #374151;
  line-height: 1;
  white-space: nowrap;
}
.tip-plus {
  margin: 0 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
}
.tip-text kbd:last-child {
  margin-right: 5px;
}

.faq-section {
  background: #fff;
  border: 2px solid #f0f1f8;
  border-radius: 24px;
  margin-top: 30px;
  overflow: hidden;
}
.faq-section-header {
  width: 100%;
  background: none;
  border: none;
  padding: 28px 32px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: opacity 0.2s;
}
.faq-section-header:hover {
  background: linear-gradient(
    90deg,
    rgba(0, 102, 255, 0.08) 0%,
    rgba(0, 102, 255, 0.025) 75%,
    #fff 100%
  );
}
.faq-section-header:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}
.faq-section-header h2 {
  font-family: sans-serif;
  font-size: 1.4rem;
  color: var(--dark);
  margin: 0;
  text-align: left;
}
.faq-section-header svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.3s ease;
}
.faq-section-header:hover svg {
  stroke: #0066ff;
}
.faq-section.open .faq-section-header {
  background: linear-gradient(
    90deg,
    rgba(0, 102, 255, 0.08) 0%,
    rgba(0, 102, 255, 0.025) 75%,
    #fff 100%
  );
}
.faq-section.open .faq-section-header svg {
  transform: rotate(180deg);
  stroke: var(--primary);
}
.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.faq-section.open .faq-body {
  max-height: 2000px;
}
.faq-item:first-child {
  border-top: 2px solid #f0f1f8;
}
.faq-item {
  border-bottom: 1.5px solid #f0f1f8;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 32px;
  text-align: left;
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s;
}
.faq-q:hover {
  color: var(--primary);
  background: #f8f9ff;
}
.faq-q:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}
.faq-q svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  stroke: currentColor;
}
.faq-item.open .faq-q svg {
  transform: rotate(180deg);
}
.faq-item.open .faq-q {
  color: var(--primary);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    padding 0.3s ease;
  padding: 0 32px;
}
.faq-item.open .faq-a {
  max-height: 200px;
  padding: 0 32px 20px;
}
.faq-a p {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.7;
  margin: 0;
}

.related-section {
  margin-top: 55px;
}
.related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.related-header h2 {
  font-family: sans-serif;
  font-size: 1.4rem;
  color: var(--dark);
}
.related-header a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.related-grid {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 2px solid #f0f1f8;
  border-radius: 16px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}
.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(0, 102, 255, 0.2);
}
.related-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  background: linear-gradient(
    135deg,
    rgba(0, 102, 255, 0.08),
    rgba(0, 217, 255, 0.08)
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.related-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
}
.related-info p {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .tool-page {
    padding: 100px 10px 60px;
  }

  .btn-row {
    flex-wrap: wrap;
  }

  .result-btn-row {
    padding: 20px 22px 24px;
    flex-wrap: wrap;
  }

  .toggle-row {
    gap: 14px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .tips-header {
    padding: 22px 20px 16px;
  }
  .tip-row {
    padding: 14px 20px;
    gap: 12px;
  }
  .tip-keys {
    display: none;
  }

  .faq-section-header {
    padding: 22px 20px 16px;
  }
  .faq-q {
    padding: 16px 20px;
  }
  .faq-a {
    padding: 0 20px;
  }
  .faq-item.open .faq-a {
    padding: 0 20px 16px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
