:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #edf3f5;
  --text: #16212b;
  --muted: #61707d;
  --line: #d9e1e6;
  --primary: #176b87;
  --primary-strong: #0f566e;
  --accent: #d97706;
  --success: #16845b;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(22, 33, 43, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 0;
  background: rgba(244, 247, 249, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy {
  display: grid;
  line-height: 1.25;
}

.brand-copy strong {
  font-size: 17px;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-strong);
  background: #e2eef2;
}

.header-tools {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.lang-switch {
  position: relative;
}

.lang-switch summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}

.lang-switch summary::-webkit-details-marker {
  display: none;
}

.lang-switch-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lang-switch-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.lang-switch-menu a:hover,
.lang-switch-menu a.active {
  color: var(--primary-strong);
  background: var(--surface-soft);
}

.site-main {
  padding: 28px 0 48px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.page-intro {
  max-width: 780px;
  margin-bottom: 22px;
}

.page-intro.compact {
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-intro h1,
.page-intro h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: 0;
}

.page-intro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.workspace-card,
.tool-browser,
.policy-note,
.tool-detail,
.guide-links a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace-card {
  padding: 20px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segment {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segment.active {
  color: #fff;
  background: var(--primary);
}

.media-pane {
  display: none;
  padding-top: 22px;
}

.media-pane.active {
  display: block;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 750;
}

.input-actions {
  display: flex;
  gap: 10px;
}

.input-actions input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: #fff;
  outline: none;
}

.input-actions input:focus,
.tool-form input:focus,
.tool-form select:focus,
.batch-settings input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 750;
  white-space: nowrap;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--line);
  background: #fff;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.consent-row input {
  margin-top: 4px;
}

.primary-actions {
  display: flex;
  gap: 10px;
}

.status-line {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.status-line.error {
  color: var(--danger);
}

.status-line.success {
  color: var(--success);
}

.media-result {
  margin-top: 18px;
}

.result-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.result-header h2 {
  margin: 0;
  font-size: 20px;
}

.result-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.media-preview {
  width: 100%;
  max-height: 540px;
  display: block;
  border-radius: 6px;
  background: #0f1720;
}

.result-actions,
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-meta {
  color: var(--muted);
  font-size: 13px;
}

.caption-box {
  width: 100%;
  min-height: 96px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.gallery-item {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}

.gallery-item .btn {
  width: calc(100% - 16px);
  min-height: 34px;
  margin: 8px;
}

.audio-preview {
  width: 100%;
  margin-top: 12px;
}

.policy-note {
  margin-top: 18px;
  padding: 18px 20px;
}

.policy-note h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.policy-note p {
  margin: 0;
  color: var(--muted);
}

.batch-settings {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.batch-settings label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.batch-settings input {
  width: 110px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.batch-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.batch-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 107, 135, 0.1);
}

.batch-item img,
.batch-cover-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-soft);
}

.batch-item h3 {
  margin: 9px 0 4px;
  font-size: 14px;
  line-height: 1.4;
}

.batch-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.batch-results {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.batch-result {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.batch-result h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.batch-result .result-actions {
  margin-top: 8px;
}

.tool-browser {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
}

.tool-sidebar {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #f9fbfc;
}

.sidebar-title {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
}

.category-list {
  display: grid;
  gap: 6px;
}

.category-button {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.category-button.active,
.category-button:hover {
  color: var(--primary-strong);
  background: #e4eef2;
}

.category-count {
  font-size: 12px;
  color: inherit;
}

.tool-content {
  min-width: 0;
  padding: 20px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.tool-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  color: var(--text);
}

.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.tool-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.tool-detail {
  padding: 20px;
}

.tool-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tool-detail-header h2 {
  margin: 0;
  font-size: 22px;
}

.tool-detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-size: 13px;
  font-weight: 750;
}

.tool-form input[type="text"],
.tool-form input[type="number"],
.tool-form select,
.tool-form input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.tool-form input[type="file"] {
  padding: 7px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-value {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.25s ease;
}

.tool-result-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fbfc;
}

.tool-result-box h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.tool-result-box p {
  margin: 0 0 12px;
  color: var(--muted);
}

.guide-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.guide-links a {
  padding: 18px;
  color: var(--text);
  text-decoration: none;
}

.guide-links a:hover {
  border-color: var(--primary);
}

.guide-links strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.guide-links span {
  color: var(--muted);
  font-size: 13px;
}

.static-content {
  max-width: 980px;
  margin: 0 auto;
  padding-top: 28px;
}

.static-content > h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.16;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.tutorial-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tutorial-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.tutorial-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.tutorial-card h2 a:hover {
  color: var(--primary-strong);
}

.tutorial-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tutorial-card .meta,
.seo-updated {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.seo-editorial-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tool-directory-section {
  margin-top: 30px;
}

.tool-directory-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.tool-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tool-directory-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.tool-directory-card:hover {
  border-color: var(--primary);
}

.tool-directory-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.tool-directory-card span {
  color: var(--muted);
  font-size: 13px;
}

.seo-page-content {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.seo-page-content > p,
.seo-page-content > ul,
.seo-page-content > ol {
  color: #40515f;
}

.seo-page-content > p {
  margin: 12px 0 0;
}

.seo-page-content > p:first-of-type {
  margin-top: 16px;
}

.seo-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.seo-breadcrumb a {
  color: var(--primary-strong);
  text-decoration: none;
}

.seo-intro {
  margin: 0 0 18px;
  padding: 16px;
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  color: #3d4e5a;
  background: #edf4f6;
}

.seo-intro p {
  margin: 0;
}

.seo-section {
  margin-top: 26px;
}

.seo-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.seo-section p,
.seo-section li {
  color: #40515f;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.seo-section ul,
.seo-section ol {
  padding-left: 22px;
}

.seo-section li + li {
  margin-top: 6px;
}

.seo-related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.seo-related-links a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary-strong);
  background: #f9fbfc;
  text-decoration: none;
}

.seo-faq-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
}

.seo-faq-item + .seo-faq-item {
  margin-top: 8px;
}

.seo-faq-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.seo-faq-item p {
  margin: 0;
}

.seo-tool-cta {
  margin-top: 22px;
}

.seo-tool-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 15px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  font-weight: 750;
}

#seoContentRoot {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

#seoContentRoot h2 {
  margin-top: 28px;
  font-size: 22px;
}

#seoContentRoot h2:first-child {
  margin-top: 0;
}

#seoContentRoot p,
#seoContentRoot li {
  color: #40515f;
}

#seoContentRoot a {
  color: var(--primary-strong);
}

.site-footer {
  margin-top: 32px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

.site-footer-inner,
.site-footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.site-footer a:hover {
  color: var(--primary-strong);
}

.site-footer-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  transform: translateX(-50%);
  border-radius: var(--radius);
  color: #fff;
  background: #23323d;
  box-shadow: var(--shadow);
  font-size: 14px;
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .main-nav {
    order: 3;
    width: 100%;
    display: none;
    align-items: stretch;
    padding-top: 10px;
  }

  .main-nav.open {
    display: grid;
  }

  .nav-link {
    justify-content: flex-start;
  }

  .header-tools {
    margin-left: 8px;
  }

  .tool-browser {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .category-list {
    display: flex;
    overflow-x: auto;
  }

  .category-button {
    min-width: max-content;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 20px, 1240px);
  }

  .brand-copy small {
    display: none;
  }

  .site-main {
    padding-top: 20px;
  }

  .workspace-card,
  .tool-content,
  .tool-detail,
  #seoContentRoot {
    padding: 14px;
  }

  .input-actions {
    flex-wrap: wrap;
  }

  .input-actions input {
    flex-basis: 100%;
  }

  .primary-actions .btn,
  .batch-settings .btn {
    flex: 1;
  }

  .batch-grid,
  .tool-grid,
  .tutorial-grid {
    grid-template-columns: 1fr;
  }

  .seo-page-content,
  .static-content {
    padding-left: 0;
    padding-right: 0;
  }

  .page-intro h1 {
    font-size: 30px;
  }
}
