/* ==========================================================================
   Immich 中文站 · 全局样式
   主题：亮色 | 设计定位：清爽、可信、面向零基础小白
   ========================================================================== */

:root {
  /* 品牌色 */
  --primary: #4f6df5;
  --primary-dark: #3a56d4;
  --primary-light: #eef1fe;
  --accent: #10b981;
  --accent-dark: #059669;
  --warm: #f59e0b;

  /* 文字 */
  --text-strong: #1f2937;
  --text-normal: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  /* 背景与边框 */
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-code: #1e293b;
  --border: #e5e7eb;
  --border-soft: #eef0f4;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

  --radius: 12px;
  --radius-lg: 18px;
  --maxw: 1160px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-normal);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.4; font-weight: 700; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; margin: 0 0 1rem; }
h3 { font-size: 1.25rem; margin: 0 0 .5rem; }

p { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1rem 1.25rem; }
li { margin: .35rem 0; }

strong { color: var(--text-strong); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* 跳转到主内容：平时视觉隐藏，键盘 Tab 聚焦时显示（WCAG 2.4.1） */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 9999;
  background: var(--primary); color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: .9rem; font-weight: 700;
  text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   顶部导航
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.navbar {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; color: var(--text-strong); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #4f6df5, #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.brand span em { font-style: normal; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; }
.nav-links a {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  color: var(--text-normal); font-weight: 500; font-size: .95rem;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-light); }
.nav-links a.active { color: var(--primary); background: var(--primary-light); }
.nav-links a.nav-cta {
  background: var(--primary); color: #fff !important; padding: 8px 16px;
  border-radius: 8px; font-weight: 600;
}
.nav-links a.nav-cta:hover { background: var(--primary-dark) !important; color: #fff !important; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: linear-gradient(160deg, #eef1fe 0%, #f7f9fc 45%, #eafaf4 100%);
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border-soft);
}
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--border);
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: 2.6rem; margin-bottom: 16px; letter-spacing: -.5px; }
.hero h1 .grad {
  background: linear-gradient(120deg, #4f6df5, #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 26px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text-muted); background: #fff;
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px;
}

.hero-visual {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 10px; position: relative; overflow: hidden;
}
.hero-visual img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 1024 / 928; object-fit: cover;
  border-radius: calc(var(--radius-lg) - 6px);
}

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: .98rem;
  cursor: pointer; border: none; transition: all .18s; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(79,109,245,.28); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.28); }
.btn-accent:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--text-strong); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* ==========================================================================
   区块
   ========================================================================== */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head .eyebrow {
  display: inline-block; color: var(--primary); font-weight: 700; font-size: .85rem;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px;
}
.section-head h2 { font-size: 2rem; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* 特性卡片网格 */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.feature-card {
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 26px; transition: transform .18s, box-shadow .18s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border); }
.feature-card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px; background: var(--primary-light);
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: .94rem; margin: 0; }

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 560px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th { background: var(--bg-soft); color: var(--text-strong); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfe; }
.tick { color: var(--accent); font-weight: 700; }
.cross { color: #ef4444; font-weight: 700; }

/* ==========================================================================
   代码块
   ========================================================================== */
.code-block { margin: 0 0 1.2rem; }
.code-block pre { margin-bottom: 0; }
pre {
  background: var(--bg-code); color: #e2e8f0; border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; font-size: .88rem; line-height: 1.6;
  margin: 0 0 1.2rem; position: relative;
}
pre code { font-family: "SF Mono", "Fira Code", Consolas, "Courier New", monospace; }
code { font-family: "SF Mono", "Fira Code", Consolas, monospace; }
:not(pre) > code {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 2px 7px; border-radius: 5px; font-size: .88em;
}
/* ==========================================================================
   面包屑
   ========================================================================== */
.breadcrumb {
  font-size: .85rem; color: var(--text-muted); padding: 18px 0 0; margin: 0;
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb li:last-child { color: var(--text-strong); }

/* 提示框 */
.callout { border-radius: var(--radius); padding: 16px 18px 16px 20px; margin: 0 0 1.2rem; border-left: 4px solid; font-size: .95rem; }
.callout.tip { background: #ecfdf5; border-color: var(--accent); }
.callout.tip strong { color: var(--accent-dark); }
.callout.warn { background: #fffbeb; border-color: var(--warm); }
.callout.warn strong { color: #b45309; }
.callout.info { background: var(--primary-light); border-color: var(--primary); }
.callout.info strong { color: var(--primary-dark); }
.callout p { margin: 0; }

/* 步骤列表 */
.steps { list-style: none; margin: 0 0 1.2rem; counter-reset: step; }
.steps > li {
  position: relative; padding-left: 58px; margin: 0 0 20px; min-height: 44px;
}
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 40px; height: 40px;
  background: var(--primary); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.steps > li strong { display: block; margin-bottom: 4px; }

/* ==========================================================================
   下载页
   ========================================================================== */
.download-hero { text-align: center; padding: 60px 0 40px; }
.download-hero h1 { margin-bottom: 12px; }
.download-hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto; }
.download-card {
  max-width: 620px; margin: 0 auto; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px; text-align: center;
}
.download-card .qrcode {
  width: 220px; height: 220px; margin: 0 auto 20px; border: 1px solid var(--border);
  border-radius: 14px; padding: 10px; background: #fff;
}
.download-card .qrcode img { width: 100%; height: 100%; object-fit: contain; }
.download-card .dl-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.download-card .dl-sub { color: var(--text-muted); font-size: .95rem; margin-bottom: 22px; }
.download-card .btn { width: 100%; justify-content: center; }
.dl-code { text-align: center; color: var(--text-muted); font-size: .95rem; margin-top: 14px; }
.dl-code code { display: inline-block; background: var(--primary-light); color: var(--primary); font-weight: 700; font-size: 1.05rem; letter-spacing: 2px; padding: 4px 14px; border-radius: 6px; user-select: all; }
.dl-hint { text-align: center; color: var(--text-faint); font-size: .85rem; margin-top: 18px; }
.ver-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: #fff; }
.faq-item summary {
  cursor: pointer; padding: 18px 22px; font-weight: 600; color: var(--text-strong);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--primary); flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-body { padding: 0 22px 20px; color: var(--text-muted); font-size: .95rem; }

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer { background: #0f172a; color: #94a3b8; padding: 50px 0 30px; margin-top: 40px; }
.site-footer .foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 34px; }
.site-footer h4, .site-footer .foot-title { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; }
.site-footer ul li { margin: 8px 0; }
.site-footer .foot-brand { color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 10px; }
.site-footer .foot-desc { font-size: .9rem; max-width: 380px; }
.site-footer .copyright {
  border-top: 1px solid #1e293b; padding-top: 22px; font-size: .82rem;
  text-align: center; color: #64748b;
}

/* ==========================================================================
   移动端适配 (applicable-device: mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { max-width: 460px; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.1rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .site-footer .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 8px 10px; font-size: .88rem; }
  .navbar { height: 58px; }
}

@media (max-width: 520px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .hero { padding: 44px 0 40px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .download-card { padding: 28px 20px; }
  .steps > li { padding-left: 48px; }
  .steps > li::before { width: 34px; height: 34px; }
}

@media (max-width: 360px) {
  .brand { font-size: 1.05rem; }
  .brand .logo { width: 30px; height: 30px; }
}

/* ==========================================================================
   教程中心页（使用教程）：卡片墙
   ========================================================================== */
.tutorial-hero {
  padding: 48px 0 24px;
  text-align: center;
}
.tutorial-hero h1 { font-size: 2.3rem; margin-bottom: 12px; }
.tutorial-hero .lead {
  color: var(--text-muted); font-size: 1.08rem; max-width: 680px; margin: 0 auto 26px;
}
.tutorial-hero .stats {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 20px;
}

/* 文章卡片网格 */
.tutorial-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px;
  scroll-margin-top: 84px;
}
.tutorial-card {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 24px 22px; text-align: left; cursor: pointer; position: relative;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tutorial-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--border);
}
.tutorial-card .card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tutorial-card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; background: var(--primary-light); flex-shrink: 0;
}
.tutorial-card .num {
  font-size: .8rem; color: var(--text-faint); font-weight: 700; letter-spacing: 1px;
  background: var(--bg-soft); padding: 3px 9px; border-radius: 999px;
}
.tutorial-card h3 { font-size: 1.08rem; margin: 0; color: var(--text-strong); line-height: 1.4; }
.tutorial-card .desc { color: var(--text-muted); font-size: .9rem; margin: 0; line-height: 1.6; flex: 1; }
.tutorial-card .card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tutorial-card .tag {
  font-size: .75rem; color: var(--text-muted); background: var(--bg-soft);
  border: 1px solid var(--border-soft); padding: 2px 9px; border-radius: 999px;
}
.tutorial-card .card-link {
  font-size: .85rem; color: var(--primary); font-weight: 600; margin-top: 2px;
}
.tutorial-card:hover .card-link { color: var(--primary-dark); }

/* 教程中心：分类分组标题 */
.tut-group { margin: 40px 0 0; }
.tut-group:first-of-type { margin-top: 26px; }
.tut-group .tut-group-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.tut-group .tut-group-head h2 { font-size: 1.35rem; margin: 0; }
.tut-group .tut-group-head .count {
  font-size: .78rem; color: var(--text-faint); background: var(--bg-soft);
  padding: 2px 10px; border-radius: 999px; font-weight: 600;
}

/* ==========================================================================
   独立文章页（深度实战文章）
   ========================================================================== */
.article-page { max-width: 820px; margin: 0 auto; padding: 34px 20px 20px; }
.article-page .art-cat {
  display: inline-block; background: var(--primary-light); color: var(--primary-dark);
  font-size: .82rem; font-weight: 700; padding: 4px 13px; border-radius: 999px; margin-bottom: 16px;
}
.article-page h1 { font-size: 2rem; line-height: 1.4; margin-bottom: 14px; letter-spacing: -.3px; }
.article-page .article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-faint);
  font-size: .85rem; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--border-soft);
}
.article-page .lead {
  font-size: 1.08rem; color: var(--text-muted); line-height: 1.8;
  background: var(--bg-soft); border-left: 4px solid var(--primary);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1.5rem;
}
.article-page h2 { font-size: 1.45rem; margin: 2.2rem 0 .8rem; padding-top: .6rem; border-top: 1px solid var(--border-soft); }
.article-page h2:first-of-type { border-top: none; }
.article-page h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.article-page p, .article-page li { color: var(--text-normal); font-size: 1rem; line-height: 1.9; }
.article-end {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border-soft);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}

/* 相关文章推荐 */
.related-section { max-width: 820px; margin: 0 auto; padding: 10px 20px 60px; }
.related-section .related-title { font-size: 1.25rem; margin-bottom: 18px; color: var(--text-strong); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card {
  display: block; background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border); }
.related-card .rc-icon { font-size: 1.5rem; margin-bottom: 10px; }
.related-card h4 { font-size: 1rem; margin-bottom: 6px; color: var(--text-strong); }
.related-card p { font-size: .85rem; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* 教程中心页移动端适配 */
@media (max-width: 1024px) {
  .tutorial-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .tutorial-hero h1 { font-size: 1.9rem; }
}
@media (max-width: 520px) {
  .tutorial-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .tutorial-hero { padding: 36px 0 16px; }
  .article-page h1 { font-size: 1.6rem; }
}

/* ==========================================================================
   首页深度实战聚合区 + 选型速查 + FAQ 速览
   ========================================================================== */
/* 首页深度实战：紧凑双列清单 */
.compact-links {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px;
  max-width: 880px; margin: 0 auto;
}
.cl-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: var(--radius); font-size: .93rem; font-weight: 600;
  color: var(--text-strong); line-height: 1.5; transition: all .15s;
}
.cl-item:hover { border-color: var(--primary); background: var(--primary-light); }
.cl-tag {
  flex-shrink: 0; font-size: .72rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; color: #fff; letter-spacing: .5px;
}
.t-pit { background: #ef4444; }
.t-vs  { background: #8b5cf6; }
.t-cn  { background: #f59e0b; }
.t-pro { background: #0ea5e9; }

.decision-table td:first-child { font-weight: 600; color: var(--text-strong); }

.index-faq { max-width: 760px; margin: 0 auto; }

@media (max-width: 720px) {
  .compact-links { grid-template-columns: 1fr; }
}

/* ==========================================================================
   配图：文章封面 / 正文示意图
   ========================================================================== */
.article-cover { margin: 0 0 1.8rem; }
.article-cover img,
.article-fig img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-soft);
}
.article-cover img { box-shadow: var(--shadow-md); }
.article-fig { margin: 1.8rem 0 2.2rem; }
.article-fig figcaption {
  margin-top: .7rem; font-size: .84rem; color: var(--text-muted);
  text-align: center; line-height: 1.6;
}
@media (max-width: 720px) {
  .article-cover { margin-bottom: 1.4rem; }
  .article-fig { margin: 1.4rem 0 1.8rem; }
  .article-cover img, .article-fig img { border-radius: 10px; }
}
