/*
  99appworks shared tool page styles.
  Low-pollution rule: every public class in this file uses the aw-tool prefix.
*/

.aw-tool-page,
.aw-tool-page * {
  box-sizing: border-box;
}

.aw-tool-page {
  --aw-tool-bg: #f6f8fc;
  --aw-tool-surface: #ffffff;
  --aw-tool-surface-soft: #f9fbff;
  --aw-tool-ink: #182235;
  --aw-tool-muted: #66728a;
  --aw-tool-line: #dfe6f2;
  --aw-tool-primary: #2454ff;
  --aw-tool-primary-dark: #173287;
  --aw-tool-accent: #10a37f;
  --aw-tool-warning-bg: #fff8e7;
  --aw-tool-warning-line: #f3d18b;
  --aw-tool-shadow: 0 18px 44px rgba(25, 40, 84, 0.1);
  margin: 0;
  min-height: 100vh;
  color: var(--aw-tool-ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(36, 84, 255, 0.1), transparent 28rem),
    linear-gradient(180deg, #fbfcff 0%, var(--aw-tool-bg) 48%, #ffffff 100%);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

.aw-tool-page a {
  color: inherit;
  text-decoration: none;
}

.aw-tool-page button,
.aw-tool-page input,
.aw-tool-page select,
.aw-tool-page textarea {
  font: inherit;
}

.aw-tool-container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.aw-tool-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 230, 242, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.aw-tool-header__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.aw-tool-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.aw-tool-brand__mark {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--aw-tool-primary), var(--aw-tool-accent));
  box-shadow: 0 12px 28px rgba(36, 84, 255, 0.22);
}

.aw-tool-brand__text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.aw-tool-brand__text strong,
.aw-tool-brand__text span {
  overflow-wrap: anywhere;
}

.aw-tool-brand__text span {
  color: var(--aw-tool-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.aw-tool-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--aw-tool-muted);
  font-weight: 800;
}

.aw-tool-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
}

.aw-tool-nav a:hover {
  color: var(--aw-tool-primary-dark);
  background: rgba(36, 84, 255, 0.07);
}

.aw-tool-main {
  padding: 48px 0 72px;
}

.aw-tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 30px;
  padding: 34px;
  border: 1px solid rgba(223, 230, 242, 0.9);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.9)),
    radial-gradient(circle at 80% 20%, rgba(16, 163, 127, 0.14), transparent 22rem);
  box-shadow: var(--aw-tool-shadow);
}

.aw-tool-hero__eyebrow {
  margin: 0 0 12px;
  color: var(--aw-tool-primary);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aw-tool-hero__title {
  max-width: 760px;
  margin: 0;
  color: var(--aw-tool-ink);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.aw-tool-hero__description {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--aw-tool-muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.aw-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.aw-tool-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.aw-tool-button:hover {
  transform: translateY(-2px);
}

.aw-tool-button:focus-visible {
  outline: 3px solid rgba(30, 64, 175, 0.2);
  outline-offset: 2px;
}

.aw-tool-button--primary {
  color: #ffffff !important;
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.14);
}

.aw-tool-button--primary:hover {
  color: #ffffff !important;
  background: #1e40af;
  border-color: #1e40af;
  box-shadow: 0 12px 24px rgba(30, 64, 175, 0.16);
}

.aw-tool-button--primary:visited,
.aw-tool-button--primary:focus-visible,
.aw-tool-button--primary * {
  color: #ffffff !important;
}

.aw-tool-button--primary:focus-visible {
  outline: 3px solid rgba(30, 64, 175, 0.22);
  outline-offset: 2px;
}

.aw-tool-page .aw-tool-button.aw-tool-button--primary,
.aw-tool-page a.aw-tool-button.aw-tool-button--primary,
.aw-tool-page button.aw-tool-button.aw-tool-button--primary {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.18);
}

.aw-tool-page .aw-tool-button.aw-tool-button--primary:hover,
.aw-tool-page a.aw-tool-button.aw-tool-button--primary:hover,
.aw-tool-page button.aw-tool-button.aw-tool-button--primary:hover {
  background: #1e40af !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #1e40af !important;
}

.aw-tool-page a.aw-tool-button.aw-tool-button--primary:visited,
.aw-tool-page a.aw-tool-button.aw-tool-button--primary:active,
.aw-tool-page a.aw-tool-button.aw-tool-button--primary:focus,
.aw-tool-page a.aw-tool-button.aw-tool-button--primary:focus-visible {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.aw-tool-page .aw-tool-button.aw-tool-button--primary *,
.aw-tool-page a.aw-tool-button.aw-tool-button--primary *,
.aw-tool-page button.aw-tool-button.aw-tool-button--primary * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.aw-tool-button--secondary {
  color: #334155;
  background: #ffffff;
  border-color: #cbd5e1;
}

.aw-tool-button--secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.aw-tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 20px;
  margin-top: 28px;
}

.aw-tool-card,
.aw-tool-panel,
.aw-tool-result,
.aw-tool-pro,
.aw-tool-notice {
  border: 1px solid var(--aw-tool-line);
  border-radius: 18px;
  background: var(--aw-tool-surface);
  box-shadow: 0 12px 34px rgba(25, 40, 84, 0.07);
}

.aw-tool-card {
  padding: 24px;
}

.aw-tool-section {
  margin-top: 28px;
}

.aw-tool-section__heading {
  margin-bottom: 16px;
}

.aw-tool-section__heading h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.25;
}

.aw-tool-section__heading p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--aw-tool-muted);
  line-height: 1.75;
}

.aw-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.aw-tool-panel {
  padding: 24px;
}

.aw-tool-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.aw-tool-field label,
.aw-tool-field__label {
  color: var(--aw-tool-ink);
  font-weight: 900;
}

.aw-tool-field input,
.aw-tool-field select,
.aw-tool-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--aw-tool-line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--aw-tool-ink);
  background: #ffffff;
}

.aw-tool-field small {
  color: var(--aw-tool-muted);
  line-height: 1.6;
}

.aw-tool-result {
  min-height: 320px;
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 24px;
  background:
    linear-gradient(180deg, var(--aw-tool-surface) 0%, var(--aw-tool-surface-soft) 100%);
}

.aw-tool-result__empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed #c8d3e6;
  border-radius: 14px;
  color: var(--aw-tool-muted);
  text-align: center;
  padding: 20px;
}

.aw-tool-result__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.aw-tool-result__metric {
  border: 1px solid var(--aw-tool-line);
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
}

.aw-tool-result__metric span {
  display: block;
  color: var(--aw-tool-muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.aw-tool-result__metric strong {
  display: block;
  margin-top: 6px;
  color: var(--aw-tool-primary-dark);
  font-size: 1.5rem;
}

.aw-tool-pro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background:
    linear-gradient(135deg, rgba(36, 84, 255, 0.08), rgba(16, 163, 127, 0.08)),
    #ffffff;
}

.aw-tool-pro h2,
.aw-tool-pro p,
.aw-tool-notice h2,
.aw-tool-notice p {
  margin: 0;
}

.aw-tool-pro p {
  margin-top: 6px;
  color: var(--aw-tool-muted);
  line-height: 1.7;
}

.aw-tool-pro__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--aw-tool-primary-dark);
  background: #ffffff;
  border: 1px solid rgba(36, 84, 255, 0.18);
  font-weight: 900;
  white-space: nowrap;
}

.aw-tool-notice {
  padding: 24px;
  background: var(--aw-tool-warning-bg);
  border-color: var(--aw-tool-warning-line);
}

.aw-tool-notice h2 {
  font-size: 1.2rem;
}

.aw-tool-notice p {
  margin-top: 10px;
  color: #5f4a20;
  line-height: 1.8;
}

.aw-tool-footer {
  border-top: 1px solid var(--aw-tool-line);
  background: #ffffff;
}

.aw-tool-footer__inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.aw-tool-footer__brand {
  display: grid;
  gap: 4px;
}

.aw-tool-footer__brand strong {
  color: var(--aw-tool-ink);
}

.aw-tool-footer__brand span {
  color: var(--aw-tool-muted);
}

.aw-tool-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
  color: var(--aw-tool-muted);
  font-weight: 800;
}

.aw-tool-footer__links a:hover {
  color: var(--aw-tool-primary);
}

@media (max-width: 920px) {
  .aw-tool-hero,
  .aw-tool-shell,
  .aw-tool-pro {
    grid-template-columns: 1fr;
  }

  .aw-tool-grid,
  .aw-tool-result__summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .aw-tool-container {
    width: min(100% - 24px, 1120px);
  }

  .aw-tool-header__inner,
  .aw-tool-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .aw-tool-nav,
  .aw-tool-footer__links {
    justify-content: flex-start;
  }

  .aw-tool-main {
    padding: 28px 0 52px;
  }

  .aw-tool-hero,
  .aw-tool-card,
  .aw-tool-panel,
  .aw-tool-result,
  .aw-tool-pro,
  .aw-tool-notice {
    border-radius: 14px;
    padding: 18px;
  }

  .aw-tool-actions,
  .aw-tool-button {
    width: 100%;
  }

  .aw-tool-button {
    min-height: 48px;
  }
}
