/* 阿潘程序员官网 · 全站样式 · 手写 CSS，靛蓝单一配色 */
/* 颜色与字体变量 */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-light: #eef2ff;
  --brand-grad-a: #6366f1;
  --brand-grad-b: #8b5cf6;

  --ink: #111827;
  --ink-2: #1f2937;
  --text: #374151;
  --text-soft: #6b7280;
  --text-faint: #9ca3af;
  --line: #f1f1f4;
  --line-2: #e5e7eb;
  --bg-soft: #f9fafb;
  --bg-mute: #f3f4f6;
  --white: #ffffff;
}

/* 基础重置 */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: 80px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.25; }
p { margin: 0; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

/* 布局容器 */
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0; }
.section-lg { padding: 96px 0; }

/* ========== 滚动渐入 ========== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ========== 顶部导航 ========== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 32px; font-size: 14px; color: var(--text-soft); }
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  border-radius: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 10px 24px -8px rgba(79,70,229,.5); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--brand-light); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* ========== Hero ========== */
.hero {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(79,70,229,.08), transparent 42%),
    radial-gradient(circle at 80% 10%, rgba(139,92,246,.12), transparent 42%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 64px 0; }
.badge { display: inline-block; font-size: 12px; padding: 4px 12px; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-weight: 500; }
.hero-title { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 20px; }
.hero-sub { margin-top: 20px; font-size: 18px; color: var(--text-soft); line-height: 1.7; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 16px; }
.hero-stats { margin-top: 48px; display: flex; gap: 40px; }
.hero-stats .num { font-size: 30px; font-weight: 700; color: var(--brand); }
.hero-stats .label { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.hero-figure { display: flex; justify-content: center; position: relative; }
.hero-figure .glow {
  position: absolute; inset: -16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-grad-a), var(--brand-grad-b));
  filter: blur(40px); opacity: .2;
}
.hero-figure svg { position: relative; width: 224px; height: 224px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.12)); }

/* ========== 区块标题 ========== */
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { font-size: 30px; }
.section-head p { margin-top: 12px; color: var(--text-faint); }

/* ========== 服务卡 ========== */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  padding: 24px; border-radius: 18px; border: 1px solid var(--line);
  background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { border-color: var(--brand); box-shadow: 0 18px 40px -20px rgba(31,41,55,.25); transform: translateY(-2px); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-light); display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.card h3 { font-size: 18px; }
.card p { margin-top: 8px; font-size: 14px; color: var(--text-faint); line-height: 1.7; }
.card .more { display: inline-block; margin-top: 16px; font-size: 14px; color: var(--brand); transition: transform .2s; }
.card:hover .more { transform: translateX(4px); }
.card-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-grad-b));
  color: #fff; display: flex; flex-direction: column; justify-content: center;
}
.card-cta h3, .card-cta p { color: #fff; }
.card-cta p { color: rgba(255,255,255,.85); }

/* ========== 承诺条 ========== */
.promise { background: var(--bg-soft); }
.promise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.promise-item { padding: 16px; }
.promise-item .emoji { font-size: 30px; margin-bottom: 8px; }
.promise-item .title { font-weight: 700; color: var(--ink); }
.promise-item .desc { margin-top: 4px; font-size: 12px; color: var(--text-faint); }

/* ========== 流程 ========== */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { position: relative; padding: 24px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  margin-bottom: 16px;
}
.step h3 { font-size: 16px; }
.step p { margin-top: 8px; font-size: 14px; color: var(--text-faint); }

/* ========== 关于我摘要 ========== */
.about-brief { max-width: 720px; margin: 0 auto; text-align: center; }
.about-brief p { margin-top: 24px; color: var(--text); line-height: 1.9; font-size: 16px; }
.platforms { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.chip {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-soft); font-size: 14px;
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* ========== 底部 CTA / 二维码 ========== */
.cta-band { background: var(--brand-light); }
.qr-row { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 32px; }
.qr-card { background: #fff; padding: 24px; border-radius: 18px; box-shadow: 0 6px 20px -10px rgba(31,41,55,.2); text-align: center; }
.qr-placeholder {
  width: 160px; height: 160px; margin: 0 auto;
  border: 2px dashed var(--line-2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 13px; text-align: center; line-height: 1.6;
}
.qr-card .name { margin-top: 16px; font-weight: 700; color: var(--ink); }
.qr-card .sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.qr-img { width: 160px; height: 160px; margin: 0 auto; display: block; border-radius: 12px; object-fit: contain; background: #fff; }

/* ========== 页脚 ========== */
.site-footer { background: #111827; color: #9ca3af; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 48px 0; font-size: 14px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col p, .footer-col li { font-size: 12px; line-height: 1.8; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1f2937; padding: 16px 0; text-align: center; font-size: 12px; color: #6b7280; }

/* ========== 悬浮微信按钮（仅移动端） ========== */
.wx-fab {
  display: none;
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand); color: #fff;
  box-shadow: 0 12px 28px -6px rgba(31,41,55,.4);
  align-items: center; justify-content: center;
}
.wx-fab svg { width: 28px; height: 28px; }

/* ========== 微信弹层 ========== */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: 18px; padding: 32px;
  max-width: 320px; width: 100%; text-align: center;
}
.modal .qr-placeholder { width: 192px; height: 192px; }
.modal .qr-img { width: 192px; height: 192px; }
.modal .name { margin-top: 16px; font-weight: 700; color: var(--ink); }
.modal .sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ========== 作品页 ========== */
.page-head { text-align: center; padding: 64px 0 40px; }
.page-head h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin-top: 16px; color: var(--text-faint); }
.page-head .meta { margin-top: 8px; font-size: 14px; color: var(--brand); font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 40px; }
.filter-btn {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--bg-mute); color: var(--text-soft); transition: background .2s, color .2s;
}
.filter-btn:hover { background: var(--brand-light); color: var(--brand); }
.filter-btn.active { background: var(--brand); color: #fff; }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.work-card { border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); transition: box-shadow .2s, transform .2s; }
.work-card:hover { box-shadow: 0 18px 40px -20px rgba(31,41,55,.25); transform: translateY(-2px); }
.work-cover { height: 160px; display: flex; align-items: center; justify-content: center; position: relative; }
.work-cover.live { background: linear-gradient(135deg, var(--brand-grad-a), var(--brand-grad-b)); }
.work-cover.dev { background: linear-gradient(135deg, #4b5563, #1f2937); }
.work-cover .title { color: #fff; font-size: 20px; font-weight: 700; }
.work-badge { position: absolute; top: 12px; left: 12px; font-size: 12px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.92); font-weight: 500; }
.work-badge.live { color: #059669; }
.work-badge.dev { color: #d97706; }
.work-body { padding: 20px; }
.work-body p { font-size: 14px; color: var(--text-faint); }
.work-tags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.work-tags .tag { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--brand-light); color: var(--brand); }
.work-tags .tag.mute { background: var(--bg-mute); color: var(--text-soft); }
.work-meta { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-faint); }
.empty-state { text-align: center; padding: 64px 0; }
.empty-state .emoji { font-size: 40px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; }
.empty-state p { margin-top: 8px; font-size: 14px; color: var(--text-faint); }

/* ========== 服务页（五段锚点） ========== */
.subnav { position: sticky; top: 64px; z-index: 30; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.subnav .container { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; }
.subnav a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--text-soft); background: var(--bg-mute); }
.subnav a:hover, .subnav a.active { color: var(--brand); background: var(--brand-light); }
.service-block { padding: 72px 0; border-bottom: 1px solid var(--line); }
.service-block:last-of-type { border-bottom: 0; }
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.service-block h2 { font-size: 28px; }
.service-block .icon { font-size: 30px; margin-bottom: 12px; }
.service-block .lead { margin-top: 12px; font-size: 16px; color: var(--text-soft); line-height: 1.8; }
.service-list { margin-top: 24px; }
.service-list li { padding: 12px 0; border-bottom: 1px dashed var(--line-2); display: flex; gap: 12px; font-size: 14px; }
.service-list li:last-child { border-bottom: 0; }
.service-list .key { flex: 0 0 96px; color: var(--brand); font-weight: 600; }
.service-list .val { color: var(--text); line-height: 1.7; }
.service-side { background: var(--brand-light); border-radius: 18px; padding: 28px; }
.service-side h4 { font-size: 16px; }
.service-side ul { margin-top: 16px; }
.service-side li { padding: 8px 0; font-size: 14px; color: var(--text); display: flex; gap: 8px; }
.service-side li::before { content: "✓"; color: var(--brand); font-weight: 700; }

/* ========== 关于页 ========== */
.about-prose { max-width: 760px; margin: 0 auto; }
.about-prose p { margin-top: 20px; font-size: 16px; line-height: 1.95; color: var(--text); }
.about-qr { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px; margin-top: 56px; }
.platform-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 720px; margin: 56px auto 0; }
.platform-card { padding: 24px 16px; border: 1px solid var(--line); border-radius: 14px; text-align: center; transition: border-color .2s, transform .2s; }
.platform-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.platform-card .emoji { font-size: 28px; }
.platform-card .name { margin-top: 8px; font-weight: 600; color: var(--ink); }
.platform-card .sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ========== 表单页 ========== */
.form-wrap { max-width: 640px; margin: 0 auto; }
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.form-field label .req { color: #dc2626; margin-left: 4px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-field .error { display: none; margin-top: 6px; font-size: 12px; color: #dc2626; }
.form-field.invalid .error { display: block; }
.form-field.invalid input, .form-field.invalid textarea, .form-field.invalid select { border-color: #dc2626; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-actions .btn { flex: 1; }
.form-aside { margin-top: 32px; padding: 20px; background: var(--brand-light); border-radius: 14px; font-size: 14px; color: var(--text); }
.form-aside strong { color: var(--brand); }
.form-qr-row { display: flex; gap: 24px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.form-qr-row .qr-card { padding: 16px; }

/* ========== 友链页 ========== */
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.links-grid:empty { display: none; }
.link-card { padding: 24px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, transform .2s; }
.link-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.link-card .name { font-weight: 700; color: var(--ink); }
.link-card .desc { margin-top: 8px; font-size: 14px; color: var(--text-faint); }
.link-card .go { margin-top: 16px; font-size: 13px; color: var(--brand); display: inline-block; }

/* ========== 响应式：平板 ========== */
@media (max-width: 1024px) {
  .cards-grid, .work-grid, .links-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-figure { order: -1; }
  .service-grid { grid-template-columns: 1fr; gap: 32px; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== 响应式：手机 ========== */
@media (max-width: 768px) {
  .section, .section-lg { padding: 48px 0; }
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform .2s, opacity .2s;
    box-shadow: 0 18px 30px -16px rgba(31,41,55,.25);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-actions .btn-primary { display: none; }
  .nav-toggle { display: flex; }

  .hero-grid { padding: 40px 0; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-stats { gap: 24px; }
  .hero-figure svg { width: 180px; height: 180px; }

  .section-head h2, .page-head h1 { font-size: 26px; }
  .cards-grid, .work-grid, .links-grid, .promise-grid, .steps-grid, .footer-grid, .platform-grid { grid-template-columns: 1fr; }
  .promise-grid, .steps-grid { gap: 16px; }
  .footer-grid { gap: 24px; }

  .wx-fab { display: flex; }
  .service-block { padding: 48px 0; }
  .service-block h2 { font-size: 22px; }
  .subnav { top: 64px; }
}
