* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #f3f4ff 0, #f9fafb 45%, #ffffff 100%);
  color: #111827;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  border-bottom: 1px solid #e5e7eb;
  background-color: #ffffffcc;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: #111827;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background-color: #eef2ff;
  color: #4338ca;
}

.nav-link.is-current {
  background-color: transparent;
  color: #111827;
  font-weight: 600;
  cursor: default;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: #4f46e5;
}

.nav-link.is-current:hover {
  background-color: transparent;
  color: #111827;
}

.site-main {
  flex: 1;
  padding: 2.5rem 0 3rem;
}

.hero {
  background-color: #ffffff;
  border-radius: 1.25rem;
  padding: 2rem 1.75rem 2.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 0.975rem;
  color: #4b5563;
  margin-bottom: 1.75rem;
}

.mode-tabs {
  display: inline-flex;
  padding: 0.15rem;
  border-radius: 999px;
  background-color: #eef2ff;
  margin-bottom: 1.5rem;
}

.mode-tab {
  border: none;
  background: transparent;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.mode-tab.is-active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #f9fafb;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.mode-tab-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.1rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: #ef4444;
  color: #fef2f2;
}

.mode-panel {
  display: none;
}

.mode-panel.is-active {
  display: block;
}

.thumbnail-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.size-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.size-option {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #374151;
}

.url-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.85rem 1.1rem;
  border-radius: 0.75rem;
  border-width: 2px;
  border-style: solid;
  border-color: #a5b4fc;
  background-color: #f9fafb;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.url-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px #4f46e5, 0 0 0 5px #e0e7ff;
}

.url-input::placeholder {
  color: #9ca3af;
}

.primary-button {
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #f9fafb;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

.primary-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.4);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.3);
}

.secondary-button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.secondary-button:hover {
  background-color: #f3f4f6;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.secondary-button:active {
  background-color: #e5e7eb;
  box-shadow: none;
}

.help-text {
  font-size: 0.85rem;
  color: #6b7280;
}

.step-label {
  font-size: 0.85rem;
  color: #4b5563;
  font-weight: 500;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.error-message {
  font-size: 0.85rem;
  color: #dc2626;
  margin-top: 0.75rem;
  min-height: 1.1em;
}

#batch-status {
  margin-top: 0.5rem;
  min-height: 1.1em;
  color: #4b5563;
}

.thumbnails {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.batch-preview {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.batch-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
}

.batch-preview-header .help-text {
  flex: 1;
  text-align: center;
}

.thumbnail-card {
  background-color: #f9fafb;
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  padding: 1rem 1rem 1.1rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.thumbnail-header {
  display: block;
  text-align: center;
}

.thumbnail-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.thumbnail-size {
  font-size: 0.8rem;
  color: #6b7280;
}

.thumbnail-image-wrapper {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background-color: #111827;
  text-align: center;
}

.thumbnail-image {
  width: auto;
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.thumbnail-actions {
  margin-top: 0.4rem;
  display: block;
  text-align: center;
}

.thumbnail-hint {
  font-size: 0.75rem;
  color: #6b7280;
}

.download-link {
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background-color: #eef2ff;
  color: #4338ca;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.download-link:hover {
  background-color: #4f46e5;
  color: #f9fafb;
}

.extensions {
  margin-top: 2.5rem;
  background-color: #f9fafb;
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid #e5e7eb;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-text {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.extension-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.primary-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background-color: #111827;
  color: #f9fafb;
  transition: background-color 0.15s ease, transform 0.08s ease;
}

.primary-link:hover {
  background-color: #020617;
  transform: translateY(-1px);
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  background-color: #ffffff;
}

.footer-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-text {
  font-size: 0.8rem;
  color: #9ca3af;
}

.policy-article {
  max-width: 960px;
  margin: 0 auto;
}

.policy-article .hero-title {
  margin-bottom: 1rem;
}

.policy-article .hero-subtitle {
  margin-bottom: 1.75rem;
}

.policy-article p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 0.9rem;
}

.policy-article .section-title {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.policy-article ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.policy-article li {
  margin-bottom: 0.35rem;
}

.policy-article a {
  color: #4f46e5;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    height: auto;
    padding: 0.75rem 0;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .container {
    padding: 0 1rem;
  }

  .site-main {
    padding: 2rem 0 2.25rem;
  }

  .hero {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .help-text,
  .error-message {
    font-size: 0.8rem;
  }

  .thumbnail-form {
    flex-direction: column;
    align-items: stretch;
  }

  .url-input {
    /* 解决高度和布局问题 */
    display: block; 
    width: 100%;
    height: 2.5rem; 
    line-height: 1.2rem; 
    
    /* 覆盖掉桌面端的高 padding，解决高度过高问题 */
    padding: 0 0.9rem;
    
    /* 覆盖掉桌面端的边框/阴影，使用更轻量级的移动端风格 */
    border-width: 1px;
    border-color: #d1d5db; /* 移动端更浅的边框颜色 */
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05); /* 移动端更浅的阴影 */
    
    /* ❗️ 强制取消 flex 属性对高度的潜在影响 */
    /* 在移动端改为 block，不再需要 flex 相关的拉伸行为 */
    flex: none; 
  }

  .url-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px #4f46e5, 0 0 0 3px #e0e7ff;
  }

  #batch-input {
    height: 6.25rem;
  }

  .primary-button {
    width: 100%;
    justify-content: center;
  }

   .thumbnails {
    margin-top: 1.5rem;
    gap: 1.25rem;
  }

  .thumbnail-card {
    padding: 1rem;
  }

   .policy-article {
     max-width: 100%;
   }
}
