/*
 * Pic2Vector 静态落地页共享样式（Linear 极简暗调风格）
 * 供所有 SEO 长尾落地页、首页与关于页共享引用
 */

:root {
  color-scheme: light;
  --canvas: #fafafa;
  --surface: #ffffff;
  --elevated: #f3f3f1;
  --tint: #ececf0;
  --hover: #e8e8e6;
  --edge: #dfdfdd;
  --edge-strong: #d4d4d8;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #67676f;
  --text-faint: #6e6e77;
  --accent: #e4f222;
  --accent-text: #08090a;
  /* 圆角规则：交互控件 8px，卡片/面板/图片等表面 12px；行内代码 4px、品牌角标 0.22em 为排版例外 */
  --radius-control: 8px;
  --radius-surface: 12px;
}

.dark {
  color-scheme: dark;
  --canvas: #08090a;
  --surface: #0f1011;
  --elevated: #161718;
  --tint: #1b1c1f;
  --hover: #1f2125;
  --edge: #23252a;
  --edge-strong: #383b3f;
  --text-primary: #ffffff;
  --text-secondary: #d0d6e0;
  --text-muted: #8a8f98;
  --text-faint: #7d838d;
  --accent: #e4f222;
  --accent-text: #08090a;
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--canvas);
  color: var(--text-primary);
  line-height: 1.6;
  font-feature-settings: 'cv01' 1, 'ss03' 1, 'zero' 1;
}

/* 现代超链接基础重置（杜绝浏览器原始纯蓝色与贴底硬下划线） */
a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--edge-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--text-primary);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* 正文、卡片列表与详情中的内联链接规范 */
p a,
li a,
.why-item p a,
.step p a,
.faq p a {
  color: var(--text-primary);
  font-weight: 510;
  text-decoration: underline;
  text-decoration-color: var(--edge-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

p a:hover,
li a:hover,
.why-item p a:hover,
.step p a:hover,
.faq p a:hover {
  text-decoration-color: var(--text-primary);
}

/* 显式去除组件/按钮/卡片类链接的下划线 */
a.brand,
a.cta,
a.lang-item,
.footer-col a,
.related-card {
  text-decoration: none;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header 导航 */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  border-bottom: 1px solid var(--edge);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 590;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

a.brand {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.brand:hover {
  opacity: 0.8;
}

.brand .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.05em;
  padding: 0 0.32em;
  border-radius: 0.22em;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 590;
}

/* 语言切换下拉框 */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-dropdown summary {
  list-style: none;
}

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

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 510;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  background: var(--hover);
  color: var(--text-primary);
  border-color: var(--edge-strong);
}

.lang-btn .icon-globe {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.lang-btn .icon-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.lang-dropdown[open] .lang-btn .icon-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 130px;
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-surface);
  background: var(--surface);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  font-size: 0.82rem;
  font-weight: 510;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.12s ease;
}

.lang-item:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.lang-item.active {
  color: var(--text-primary);
  background: var(--elevated);
  font-weight: 590;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 主题切换按钮 */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.theme-btn:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.theme-btn svg {
  width: 16px;
  height: 16px;
}

.icon-moon {
  display: none;
}

.dark .icon-sun {
  display: none;
}

.dark .icon-moon {
  display: block;
}

/* 主体区域 */
main {
  padding: 72px 0 48px;
}

/* 首屏 Hero */
.hero {
  text-align: center;
  padding: 24px 0 56px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 590;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero .sub {
  margin: 16px auto 0;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* 核心 CTA 按钮 */
.cta {
  display: inline-flex;
  align-items: center;
  margin-top: 28px;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 590;
  border-radius: var(--radius-control);
  text-decoration: none;
  border: 1px solid var(--edge);
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.cta:hover {
  opacity: 0.9;
}

/* 产品截图对比图 */
.hero-shot,
.compare-shot {
  margin: 36px auto 0;
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: var(--radius-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 20px 50px -16px rgba(0, 0, 0, 0.25);
}

.hero-shot {
  aspect-ratio: 1200/750;
  contain-intrinsic-size: 860px 537.5px;
}

.compare-shot {
  margin-top: 24px;
  aspect-ratio: 1600/1000;
  contain-intrinsic-size: 860px 537.5px;
}

.theme-img-dark {
  display: none;
}

html.dark .theme-img-light {
  display: none;
}

html.dark .theme-img-dark {
  display: block;
}

/* 章节通用 */
section {
  margin-top: 56px;
}

/* 首屏以下延后布局，缩短落地页主线程占用。 */
.why,
.faq,
.prose,
footer.site {
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}

section h2 {
  font-size: 1.5rem;
  font-weight: 590;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

/* 卖点卡片（Why Pic2Vector）：两列卡片网格，替代逐行发丝线长列表 */
.why-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.why-item {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius-surface);
}

.why-item h3 {
  font-size: 1rem;
  font-weight: 590;
  margin-bottom: 6px;
}

.why-item p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* 奇数个卖点时最后一张通栏，避免网格尾行留单边空位 */
.why-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* 步骤流水线：发丝竖线分隔的连续流程，替代三张等宽卡片 */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.step {
  padding: 0 28px;
}

.step:first-child {
  padding-left: 0;
}

.step:last-child {
  padding-right: 0;
}

.step + .step {
  border-left: 1px solid var(--edge);
}

.step h3 {
  font-size: 1rem;
  font-weight: 590;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Prose 富文本排版 */
.prose {
  width: 100%;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 590;
  color: var(--text-primary);
  margin-top: 44px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--edge);
}

.prose p {
  margin-top: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.prose strong {
  color: var(--text-primary);
  font-weight: 590;
}

.prose a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--edge-strong);
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.prose a:hover {
  text-decoration-color: var(--text-primary);
}

.prose ul {
  margin: 14px 0 0 20px;
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
}

.prose li {
  line-height: 1.7;
}

.prose li strong {
  color: var(--text-primary);
  font-weight: 590;
}

.prose code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--elevated);
  border: 1px solid var(--edge);
  border-radius: 4px; /* 行内代码：随字号缩放的小圆角例外 */
  color: var(--text-primary);
}

.prose .table-scroll {
  overflow-x: auto;
  margin-top: 18px;
  -webkit-overflow-scrolling: touch;
}

.prose .table-scroll table {
  margin-top: 0;
  min-width: 720px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 0.92rem;
}

.prose th,
.prose td {
  border: 1px solid var(--edge);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--elevated);
  font-weight: 590;
  color: var(--text-primary);
}

.prose td {
  color: var(--text-secondary);
}

.prose caption,
.prose .table-note {
  caption-side: bottom;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}

/* FAQ 折叠面板 */
.faq details {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius-surface);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.faq summary {
  font-weight: 510;
  cursor: pointer;
}

.faq p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 8px;
}

/* Footer 页脚 */
footer.site {
  border-top: 1px solid var(--edge);
  margin-top: 72px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 48px;
  padding: 48px 20px 36px;
  align-items: start;
}

.footer-tagline {
  display: none;
}

.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 590;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-lang {
  position: relative;
  width: auto;
  max-width: 180px;
  flex: 0 0 auto;
}

.footer-lang-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer.site .lang-dropdown {
  display: block;
  width: 100%;
  position: relative;
}

footer.site .lang-btn {
  width: 100%;
  min-width: 140px;
  height: 32px;
  padding: 0 10px;
  justify-content: space-between;
  background: var(--elevated);
  border-color: var(--edge);
  color: var(--text-primary);
  font-size: 0.82rem;
}

footer.site .lang-dropdown .lang-menu {
  top: auto;
  bottom: calc(100% + 6px);
  left: auto;
  right: 0;
  min-width: 100%;
}

.footer-bottom {
  border-top: 1px solid var(--edge);
  padding: 14px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom .brand {
  font-size: 0.82rem;
  margin-right: auto;
}

.footer-bottom > span {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* 响应式断点 */
@media (max-width: 840px) {
  .footer-grid {
    gap: 28px;
    padding: 36px 20px 28px;
  }
  .footer-bottom {
    padding: 18px 20px 22px;
  }
}

@media (max-width: 780px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .step {
    padding: 0;
  }
  .step + .step {
    border-left: none;
    border-top: 1px solid var(--edge);
    margin-top: 20px;
    padding-top: 20px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 20px;
  }
  .why-list {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 32px 20px 24px;
  }
  .footer-bottom {
    padding: 14px 20px 16px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 16px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 16px 20px;
  }
  .footer-bottom {
    padding: 16px 16px 20px;
  }
}

/* 相关工具卡片 */
.related-tools {
  margin-top: 56px;
}

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

.related-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius-surface);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.related-card:hover {
  border-color: var(--edge-strong);
  background: var(--elevated);
}

.related-card .title {
  font-weight: 590;
  font-size: 0.95rem;
}

.related-card .desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}

/* Hero Actions & Inline Dropzone */
.hero-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-actions .cta {
  margin-top: 0;
}

.hero-dropzone {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  background: var(--surface);
  border: 1px dashed var(--edge-strong);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  text-align: left;
}

.hero-dropzone:hover {
  border-color: var(--text-muted);
  background: var(--elevated);
}

.hero-dropzone:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.hero-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--elevated);
  box-shadow: 0 0 0 3px rgba(228, 242, 34, 0.25);
  transform: scale(1.02);
}

.dropzone-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.hero-dropzone:hover .dropzone-icon,
.hero-dropzone.drag-over .dropzone-icon {
  color: var(--text-primary);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
}

.dropzone-prompt {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.dropzone-browse {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--edge-strong);
}

.hero-dropzone:hover .dropzone-browse {
  color: var(--text-primary);
}

.dropzone-sub {
  font-size: 0.75rem;
  color: var(--text-faint);
  line-height: 1.3;
}

@media (max-width: 580px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .cta {
    width: 100%;
    justify-content: center;
  }
  .hero-dropzone {
    width: 100%;
    justify-content: center;
  }
}

/* 联系表单：正文内嵌，内容提交到 Cloudflare Pages Function */
.contact-page main {
  padding: 32px 0 48px;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: start;
}

.contact-intro {
  padding-top: 12px;
}

.contact-intro h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  font-weight: 590;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.contact-intro > p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

.contact-intro h2 {
  margin-top: 28px;
  font-size: 1rem;
  font-weight: 590;
}

.contact-intro ul {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form-panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius-surface);
  box-shadow: 0 18px 48px -28px rgba(0, 0, 0, 0.28);
}

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

.contact-field {
  display: grid;
  gap: 6px;
}

.contact-field label {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 510;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-field textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-submit {
  justify-self: start;
  padding: 10px 18px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 590;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.contact-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.contact-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.contact-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 0.88rem;
  font-weight: 510;
  line-height: 1.45;
  animation: contact-status-in 180ms ease-out;
}

.contact-status:empty {
  display: none;
}

.contact-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.contact-status[data-state="success"] {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.contact-status[data-state="error"] {
  border-color: #fecdca;
  background: #fef3f2;
  color: #b42318;
}

.dark .contact-status[data-state="error"] {
  border-color: #7a271a;
  background: #2a1210;
  color: #ffb4ab;
}

.dark .contact-status[data-state="success"] {
  border-color: #17663a;
  background: #0c2115;
  color: #75e0a7;
}

@keyframes contact-status-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact-form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .contact-page main {
    padding-top: 20px;
  }

  .contact-intro {
    padding-top: 0;
  }

  .contact-intro h1 {
    font-size: 2rem;
  }

  .contact-form-panel {
    padding: 20px;
  }

  .contact-submit {
    width: 100%;
  }
}

/* 动效守卫：用户偏好减少动态时关闭平滑滚动与过渡动画 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
