:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #152033;
  --muted: #66758a;
  --line: #dce5f1;
  --primary: #0f9f7b;
  --primary-dark: #08745f;
  --blue: #2f6eea;
  --purple: #6f5bd8;
  --orange: #d97706;
  --shadow: 0 18px 55px rgba(20, 34, 56, 0.11);
  --soft-shadow: 0 10px 28px rgba(20, 34, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(47, 110, 234, 0.08), transparent 420px),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 52%, #f8f6f2 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(220, 229, 241, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.muted,
.tool-card p,
.info-card p,
.site-footer p {
  color: var(--muted);
}

.top-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-nav a,
.footer-links a {
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 750;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a.active,
.footer-links a:hover {
  background: #eaf6f2;
  color: var(--primary-dark);
}

#app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  outline: none;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 250, 0.94)),
    linear-gradient(135deg, rgba(47, 110, 234, 0.08), rgba(15, 159, 123, 0.1));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.home-hero p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.quick-panel {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(220, 229, 241, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.quick-panel span {
  color: var(--primary-dark);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.quick-panel strong {
  font-size: 1.08rem;
}

.quick-panel p {
  font-size: 0.92rem;
}

.tool-finder {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
}

.search-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 159, 123, 0.16);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.tab:hover,
.tab.active {
  border-color: rgba(15, 159, 123, 0.42);
  background: #e9f7f2;
  color: var(--primary-dark);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 14px;
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 196px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 8px 22px rgba(20, 34, 56, 0.05);
  text-decoration: none;
  transition:
    border 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.tool-card:hover {
  border-color: rgba(15, 159, 123, 0.48);
  box-shadow: 0 18px 36px rgba(20, 34, 56, 0.12);
  transform: translateY(-3px);
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 900;
}

.tool-icon.image {
  background: linear-gradient(135deg, #0f9f7b, #2f6eea);
}

.tool-icon.pdf {
  background: linear-gradient(135deg, #d97706, #e74c3c);
}

.tool-icon.calculator {
  background: linear-gradient(135deg, #2f6eea, #6f5bd8);
}

.tool-icon.developer {
  background: linear-gradient(135deg, #152033, #2f6eea);
}

.tool-icon.text {
  background: linear-gradient(135deg, #6f5bd8, #c056bc);
}

.tool-icon.ai {
  background: linear-gradient(135deg, #0f9f7b, #6f5bd8);
}

.tool-category {
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.tool-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

.category-header,
.tool-page-header,
.tool-workspace,
.info-card,
.policy-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.category-header {
  margin-bottom: 18px;
  padding: clamp(24px, 4vw, 42px);
}

.category-header p,
.tool-page-header p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}

.tool-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 36px);
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.68fr);
  gap: 18px;
  padding: 22px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.field span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.6;
}

.checkbox-field {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  border: 1.5px dashed #9fcabd;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 159, 123, 0.08), rgba(47, 110, 234, 0.06)),
    #f4fbf8;
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--primary);
  background: #e9f7f2;
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone span {
  margin-top: 6px;
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-pill span:first-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.file-remove:hover {
  border-color: rgba(15, 159, 123, 0.45);
  color: var(--primary-dark);
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
}

.button {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 159, 123, 0.22);
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.tool-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.result-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

.result-box {
  min-height: 220px;
  max-height: 440px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.preview-image {
  max-width: 100%;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.info-card {
  padding: 20px;
  box-shadow: var(--soft-shadow);
}

.info-card ol,
.info-card ul {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.site-footer p {
  margin: 6px 0 0;
}

.policy-page {
  max-width: 850px;
  padding: clamp(24px, 4vw, 44px);
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1040px) {
  .home-hero,
  .tool-workspace {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-panel {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .tool-page-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-grid,
  .info-grid,
  .input-row {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 22px;
  }

  .quick-panel {
    grid-template-columns: 1fr;
  }

  #app {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }
}
