/* ============================================================
   PDFnoted 首页 — Apple-grade 浅色打磨 (基于 impeccable skill)
   设计上下文：AI PDF 工具站，Cleanup-first，专业克制浅色 SaaS，主色靛蓝 #4F46E5
   约束：保持浅色，不引入深色/霓虹；单一强调色克制使用 (60-30-10)
   仅做视觉打磨，不改动 DOM 结构与文案
   ============================================================ */
:root {
  --home-accent: #4f46e5;
  --home-accent-strong: #4338ca;
  --home-accent-soft: #eef2ff;
  --home-ink: #0f172a;
  --home-ink-2: #475569;
  --home-ink-3: #64748b;
  --home-line: #e5e7eb;
  --home-line-2: #e0e7ff;
  --home-shadow-card: 0 18px 40px -16px rgba(79,70,229,.28), 0 6px 14px -8px rgba(15,23,42,.10);
  --home-ease: cubic-bezier(.22,.61,.36,1); /* ease-out-quart 近似 */
}

/* ---- Hero：更克制的浅色基底 + 极淡靛蓝光晕（非霓虹） ---- */
.home-hero { position: relative; }
.home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(48% 42% at 12% 96%, rgba(124,58,237,.06), transparent 70%);
  pointer-events: none;
}
/* 主标题流体化：移动端不挤、桌面端不空 */
.home-hero h1 {
  font-size: clamp(2.05rem, 1.1rem + 3.4vw, 3.15rem) !important;
  letter-spacing: -.03em !important;
}

/* Hero 图：更克制的描边 + 柔和分层阴影 + 悬浮微抬起 */
.home-hero .home-hero-img {
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 18px;
  box-shadow: 0 24px 60px -12px rgba(79,70,229,.20), 0 8px 20px -8px rgba(15,23,42,.10);
  transition: transform .55s var(--home-ease), box-shadow .55s var(--home-ease);
}
.home-hero .home-hero-img:hover { transform: translateY(-6px); }

/* ---- 卡片悬浮：轻微抬起 + 柔和阴影（与既有 border 高亮叠加，不冲突） ---- */
.home-popular a, .home-caps > div {
  transition: transform .28s var(--home-ease), box-shadow .28s var(--home-ease) !important;
}
.home-popular a:hover, .home-caps > div:hover {
  transform: translateY(-5px);
  box-shadow: var(--home-shadow-card);
}

/* 场景 / 编辑器 卡片：轻抬起 + 柔和阴影（这些块无内联过渡，由 CSS 完全控制） */
.home-scen > div, .home-editor > div {
  transition: transform .28s var(--home-ease), box-shadow .28s var(--home-ease);
}
.home-scen > div:hover, .home-editor > div:hover {
  transform: translateY(-4px);
  box-shadow: var(--home-shadow-card);
}
/* 场景关键词链接：悬浮 affordance（indigo → 强调色 + 下划线） */
.home-scen a { transition: color .2s var(--home-ease); }
.home-scen a:hover { color: var(--home-accent); text-decoration: underline; text-underline-offset: 3px; }

/* 键盘焦点环：清晰可见，符合 WCAG */
.home-popular a:focus-visible,
.home-caps a:focus-visible,
.home-hero a:focus-visible,
.home-scen a:focus-visible,
.home-more a:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ---- 入场：淡入上浮，轻微错落（仅 transform/opacity，无 CLS） ---- */
@keyframes homeRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-reveal { animation: homeRise .72s var(--home-ease) both; }
.home-reveal[data-d="1"] { animation-delay: .04s; }
.home-reveal[data-d="2"] { animation-delay: .10s; }
.home-reveal[data-d="3"] { animation-delay: .16s; }
.home-reveal[data-d="4"] { animation-delay: .22s; }

@media (prefers-reduced-motion: reduce) {
  .home-reveal { animation: none; }
  .home-hero .home-hero-img,
  .home-popular a,
  .home-caps > div,
  .home-scen > div,
  .home-editor > div { transition: none !important; }
  .home-hero .home-hero-img:hover,
  .home-popular a:hover,
  .home-caps > div:hover,
  .home-scen > div:hover,
  .home-editor > div:hover { transform: none; }
}

/* ---------- 首屏上传卡片 (PDF Clean) ---------- */
.hero-upload-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 40px 32px; text-align: center; box-shadow: var(--shadow-md);
  transition: all .25s ease;
}
.hero-upload-card.dragover { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-light); transform: translateY(-2px); }
.hero-upload-card .upload-icon {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 18px;
  background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center; letter-spacing: .5px;
}
.hero-upload-card h2 { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); margin: 0 0 6px; }
.hero-upload-card p { font-size: .95rem; color: var(--text-secondary); margin: 0 0 18px; }
.hero-upload-card .btn { width: 100%; }
.hero-upload-card small { display: block; margin-top: 14px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* =====================================================================
 * PDF Clean 首页重构 —— 能力矩阵 / 三步流程 / 前后对比 / Pro 转化
 * ===================================================================== */

/* ---------- 通用区块头 ---------- */
.home-sec { max-width: 1140px; margin: 0 auto; padding: 68px 20px 8px; }
.home-sec-head { text-align: center; margin-bottom: 36px; }
.home-sec-head h2 {
  font-size: 2rem; font-weight: 800; color: var(--text-primary);
  margin: 0 0 10px; letter-spacing: -.02em;
}
.home-sec-head p { font-size: 15px; color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* ---------- 能力矩阵 ---------- */
.clean-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cm-item {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 20px 18px; text-decoration: none;
  transition: border-color .18s var(--home-ease), box-shadow .18s var(--home-ease), transform .18s var(--home-ease);
  position: relative;
}
.cm-item:hover { border-color: var(--brand); box-shadow: 0 8px 26px rgba(79,70,229,.12); transform: translateY(-3px); }
.cm-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.cm-item.is-primary { border: 2px solid var(--brand); }
.cm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cm-ico { font-size: 22px; line-height: 1; }
.cm-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cm-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin: 0 0 12px; min-height: 38px; }
.cm-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-tag { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: .2px; }
.cm-tag.free { background: #ecfdf5; color: #059669; }
.cm-tag.pro { background: #f5f3ff; color: #7c3aed; }
.cm-tag.local { background: #f1f5f9; color: #475569; }

/* ---------- 三步流程 ---------- */
.flow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.flow-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 30px 26px; text-align: center;
  transition: transform .2s var(--home-ease), box-shadow .2s var(--home-ease);
}
.flow-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.flow-num {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.flow-step h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.flow-step p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.65; margin: 0; }
.flow-cta { text-align: center; margin-top: 30px; }

/* ---------- 前后对比 ---------- */
.ba-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ba-col { text-align: center; }
.ba-label {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; margin-bottom: 12px; letter-spacing: .3px;
}
.ba-label.before { background: #fef2f2; color: #dc2626; }
.ba-label.after { background: #ecfdf5; color: #059669; }
.ba-frame {
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface-2); aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.ba-note { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }
.ba-caption { text-align: center; font-size: 13px; color: var(--text-secondary); margin: 20px 0 0; line-height: 1.6; }

/* 纯 CSS 示意页（不额外发图片请求，零 CLS） */
.ba-demo-page {
  width: 100%; height: 100%; background: #fff; padding: 16px 18px; position: relative;
  display: flex; flex-direction: column; gap: 7px; overflow: hidden;
}
.ba-line { height: 7px; border-radius: 3px; background: #e2e8f0; }
.ba-line.w90 { width: 90%; }
.ba-line.w75 { width: 75%; }
.ba-line.w60 { width: 60%; }
.ba-line.w45 { width: 45%; }
.ba-line.title { height: 11px; width: 55%; background: #cbd5e1; margin-bottom: 4px; }
.ba-mark { position: absolute; font-weight: 800; letter-spacing: 2px; pointer-events: none; }
.ba-mark.wm {
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: rgba(220,38,38,.20); transform: rotate(-24deg);
}
.ba-mark.stamp {
  right: 12px; bottom: 12px; width: 52px; height: 52px; border: 3px solid rgba(220,38,38,.38);
  border-radius: 50%; color: rgba(220,38,38,.5); font-size: 10px; letter-spacing: 0;
  display: flex; align-items: center; justify-content: center; transform: rotate(-12deg);
}
.ba-mark.hdr { top: 9px; right: 16px; font-size: 8px; color: rgba(100,116,139,.75); letter-spacing: .5px; }

/* ---------- Pro 转化条 ---------- */
.pro-strip { max-width: 1140px; margin: 68px auto 0; padding: 0 20px; }
.pro-strip-inner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: var(--radius-xl); padding: 38px 40px; color: #fff;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center;
  box-shadow: var(--shadow-lg);
}
.pro-strip h2 { font-size: 1.65rem; font-weight: 800; margin: 0 0 10px; letter-spacing: -.01em; color: #fff; }
.pro-strip > .pro-strip-inner > div > p { font-size: 14.5px; opacity: .92; line-height: 1.65; margin: 0 0 18px; }
.pro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.pro-list li { font-size: 13.5px; opacity: .95; display: flex; gap: 8px; align-items: flex-start; }
.pro-list li::before { content: "\2713"; font-weight: 800; opacity: .9; }
.btn-white {
  display: inline-block; background: #fff; color: var(--brand); font-weight: 700; font-size: 15px;
  padding: 13px 26px; border-radius: var(--radius-md); text-decoration: none;
  transition: transform .18s var(--home-ease), box-shadow .18s var(--home-ease);
  min-height: 44px; line-height: 1.4; box-sizing: border-box;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.pro-strip small { display: block; margin-top: 12px; font-size: 12px; opacity: .82; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .flow-steps { grid-template-columns: 1fr; }
  .pro-strip-inner { grid-template-columns: 1fr; padding: 30px 26px; }
  .home-sec { padding: 48px 20px 8px; }
  .home-sec-head h2 { font-size: 1.6rem; }
}
@media (max-width: 640px) {
  .ba-grid { grid-template-columns: 1fr; }
  .cm-desc { min-height: 0; }
  .ba-wrap { padding: 18px; }
  .clean-matrix { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-item, .flow-step, .btn-white { transition: none !important; }
  .cm-item:hover, .flow-step:hover, .btn-white:hover { transform: none; }
}

/* ---------- AI PDF 工作台首屏层级 ---------- */
.home-hero { position: relative; overflow: hidden; }
.home-hero::before {
  content: ""; position: absolute; width: 420px; height: 420px; right: 3%; top: -180px;
  border-radius: 50%; background: radial-gradient(circle, rgba(129,140,248,.18), rgba(129,140,248,0) 70%);
  pointer-events: none;
}
.home-hero > div { position: relative; z-index: 1; }
.home-hero h1 { max-width: 700px; }
.home-hero [data-i18n="home.hero.slogan"] { max-width: 700px; }
.hero-upload-card {
  box-shadow: 0 20px 50px rgba(79,70,229,.12), 0 0 0 1px rgba(129,140,248,.14);
  transition: transform .2s var(--home-ease), box-shadow .2s var(--home-ease);
}
.hero-upload-card:hover { transform: translateY(-3px); box-shadow: 0 24px 58px rgba(79,70,229,.18), 0 0 0 1px rgba(129,140,248,.25); }
.hero-workflow {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  margin: 15px auto 0; color: #64748b; font-size: 11.5px; font-weight: 600;
}
.hero-workflow span {
  padding: 5px 8px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff;
}
.hero-workflow span.is-active { color: #4f46e5; border-color: #c7d2fe; background: #eef2ff; }
.home-sec-head h2 { letter-spacing: -.02em; }
@media (max-width: 900px) {
  .home-hero h1 { max-width: 100%; }
  .home-hero [data-i18n="home.hero.slogan"] { max-width: 100%; }
}

/* ---------- 首页账户弹窗 ---------- */
body.home-account-open { overflow: hidden; }
.home-account-modal {
  position: fixed; inset: 0; z-index: 10000; display: none; place-items: center;
  padding: 24px; background: rgba(15, 23, 42, .42); backdrop-filter: blur(8px);
}
.home-account-modal.is-open { display: grid; animation: homeAccountFadeIn .16s ease-out; }
.home-account-dialog {
  position: relative; width: min(560px, 100%); max-height: min(820px, calc(100vh - 32px)); overflow: auto;
  border: 1px solid rgba(226, 232, 240, .92); border-radius: 24px; background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24), 0 8px 24px rgba(79, 70, 229, .12);
  color: #334155; scrollbar-width: thin;
}
.home-account-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px;
  border: 0; border-radius: 11px; background: #f1f5f9; color: #94a3b8; font-size: 25px;
  line-height: 1; cursor: pointer; transition: background .16s, color .16s;
}
.home-account-close:hover, .home-account-close:focus-visible { background: #e2e8f0; color: #334155; outline: none; }
.home-account-head { display: flex; align-items: center; gap: 14px; padding: 28px 32px 22px; border-bottom: 1px solid #eef2f7; }
.home-account-ident { min-width: 0; flex: 1; }
.home-account-avatar { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 17px; background: #1e293b; color: #fff; font-size: 22px; font-weight: 800; }
.home-account-name { overflow: hidden; color: #0f172a; font-size: 17px; font-weight: 750; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.home-account-email { overflow: hidden; margin-top: 4px; color: #64748b; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.home-account-badge, .home-account-member-badge { display: inline-flex; align-items: center; border-radius: 999px; background: #dcfce7; color: #059669; font-size: 12px; font-weight: 750; padding: 6px 12px; white-space: nowrap; }
.home-account-section { padding: 22px 32px; border-bottom: 1px solid #f1f5f9; }
.home-account-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: #94a3b8; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.home-account-section-title::after { content: ''; height: 1px; flex: 1; background: #e8edf3; }
.home-account-label { margin: 14px 0 8px; color: #64748b; font-size: 12.5px; font-weight: 650; }
.home-account-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.home-account-chip { min-height: 38px; padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #64748b; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: border-color .16s, background .16s, color .16s, transform .16s; }
.home-account-chip:hover { border-color: #a5b4fc; color: #4f46e5; transform: translateY(-1px); }
.home-account-chip.is-active { border-color: #6366f1; background: #eef2ff; color: #4f46e5; }
.home-account-input-row { display: flex; gap: 8px; margin-top: 10px; }
.home-account-input-row input { min-width: 0; flex: 1; height: 42px; padding: 0 13px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fbfdff; color: #334155; font: inherit; font-size: 13px; outline: none; }
.home-account-input-row input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.home-account-add, .home-account-action, .home-account-copy { min-height: 42px; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: 11px; background: #f8fafc; color: #64748b; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.home-account-add:hover, .home-account-action:hover, .home-account-copy:hover { border-color: #a5b4fc; background: #eef2ff; color: #4f46e5; }
.home-account-membership { padding-bottom: 18px; }
.home-account-member-status { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: #64748b; font-size: 13px; }
.home-account-row { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid #f8fafc; font-size: 13px; }
.home-account-row > span { color: #475569; font-weight: 650; }
.home-account-input-row.compact { margin-top: 0; }
.home-account-invite { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.home-account-invite code { min-width: 70px; padding: 9px 11px; border-radius: 9px; background: #f8fafc; color: #64748b; text-align: center; }
.home-account-primary { display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 14px; border-radius: 12px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-size: 14px; font-weight: 750; text-decoration: none; box-shadow: 0 8px 18px rgba(217, 119, 6, .18); }
.home-account-primary:hover { filter: brightness(1.04); }
.home-account-footer { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 18px 32px 24px; }
.home-account-workspace { color: #4f46e5; font-size: 13px; font-weight: 700; text-decoration: none; }
.home-account-workspace:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-account-logout { border: 0; background: transparent; color: #94a3b8; font: inherit; font-size: 13px; cursor: pointer; }
.home-account-logout:hover { color: #ef4444; }
@keyframes homeAccountFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 640px) {
  .home-account-modal { padding: 12px; align-items: end; }
  .home-account-dialog { max-height: calc(100vh - 20px); border-radius: 22px 22px 0 0; }
  .home-account-head, .home-account-section { padding-left: 20px; padding-right: 20px; }
  .home-account-footer { padding-left: 20px; padding-right: 20px; }
  .home-account-row { grid-template-columns: 1fr; gap: 8px; }
  .home-account-invite { justify-content: flex-start; }
}

/* ---------- 首页 hero 移动端修复：双栏 → 单列（上传卡不再被挤压） ----------
   原 hero 是内联 grid 1.05fr/1fr，移动端未做单列覆盖 → 文案+上传卡在窄屏挤成两列不可用。
   这里在 ≤760px 强制单列 + 缩小标题，上传卡居中有最大宽度，保证手机可正常点击上传。 */
@media (max-width: 760px) {
  .home-hero { padding: 32px 16px 28px !important; }
  .home-hero > div { grid-template-columns: 1fr !important; gap: 22px !important; }
  .home-hero h1 { font-size: 1.7rem !important; line-height: 1.25 !important; margin: 14px 0 10px !important; }
  .home-hero .hero-upload-card { max-width: 420px; margin: 0 auto; }
}

/* 首页首屏次要入口弱化：避免「打开 PDF 工作台」跳转分流「上传」主动作 */
.hero-secondary-link {
  font-size: .92rem; color: #64748b;
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.hero-secondary-link:hover { color: #4f46e5; }
