/* 基础与主题变量 */
:root {
  /* 科技蓝主题（深色） */
  --bg: #081226;
  --bg-elev: #0c1833;
  --card: #0f1e40cc;
  --text: #e6ecf8;
  --muted: #a9b7d9;
  --brand: #0066cc;   /* 指定科技蓝 */
  --brand-2: #1a75ff; /* 更亮蓝 */
  --accent: #66a3ff;  /* 浅蓝高光 */
  --ring: #3385ff;
  --shadow: 0 18px 40px rgba(2, 8, 35, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    /* 科技蓝主题（浅色） */
    --bg: #f6f9ff;
    --bg-elev: #ffffff;
    --card: #ffffffcc;
    --text: #0b1220;
    --muted: #51607a;
    --brand: #0066cc;
    --brand-2: #1a75ff;
    --accent: #66a3ff;
    --ring: #2f7df4;
    --shadow: 0 14px 32px rgba(3, 12, 50, 0.08);
  }
}

/* 全局样式 */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "SF Pro Text", Segoe UI, Roboto, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(60% 60% at 12% 8%, #0066cc33 0%, transparent 60%),
    radial-gradient(50% 50% at 88% 12%, #1a75ff2e 0%, transparent 60%),
    radial-gradient(40% 40% at 48% 92%, #66a3ff22 0%, transparent 60%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景轻微动效（遵循减少动效偏好） */
@media (prefers-reduced-motion: no-preference) {
  body::before {
    content: "";
    position: fixed; inset: -20% -10% -10% -20%; z-index: -1;
    background: radial-gradient(40% 35% at 20% 20%, #0066cc22, transparent 60%),
                radial-gradient(40% 35% at 80% 30%, #1a75ff22, transparent 60%),
                radial-gradient(40% 35% at 40% 80%, #66a3ff22, transparent 60%);
    filter: blur(30px);
    animation: bg-pan 18s linear infinite alternate;
  }
  @keyframes bg-pan {
    0% { transform: translate3d(0,0,0) scale(1); }
    100% { transform: translate3d(-4%, 2%, 0) scale(1.04); }
  }
}

img { max-width: 100%; display: block; border-radius: 12px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92%); margin-inline: auto; }
.section { padding: 72px 0; }
.section { content-visibility: auto; contain-intrinsic-size: 720px; }
.section.alt { background: linear-gradient(0deg, var(--bg-elev), var(--bg-elev)); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(36px, 6vw, 64px); letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 18px; }
.lead { color: var(--muted); font-size: 18px; }
.muted, .subtle { color: var(--muted); }

.gradient-text {
  background: linear-gradient(90deg, var(--brand), var(--brand-2) 60%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Apple 风格：大字号标题与副标题 */
.headline-xl { font-size: clamp(40px, 8vw, 88px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.subhead { font-size: clamp(16px, 2.6vw, 22px); color: var(--muted); }
.kicker { display: block; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in oklab, var(--muted) 80%, var(--text)); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  background: var(--bg-elev); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);
}
.button:hover { border-color: color-mix(in oklab, var(--brand) 40%, transparent); text-decoration: none; }
.button.primary { background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: #fff; }

.skip-link { position: absolute; left: -9999px; top: auto; }
.skip-link:focus { left: 16px; top: 16px; background: var(--bg-elev); padding: 8px 12px; border-radius: 8px; }

/* 头部导航 */
.site-header { position: sticky; top: 0; z-index: 60; backdrop-filter: saturate(120%) blur(10px); background: color-mix(in oklab, var(--bg-elev) 70%, transparent); border-bottom: 1px solid rgba(255,255,255,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 15px; letter-spacing: .2px; }
.brand-logo { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; box-shadow: var(--shadow); }
.brand-name { letter-spacing: 0.2px; }

.nav-toggle { display: none; background: var(--bg-elev); color: var(--text); border: 1px solid rgba(255,255,255,0.12); padding: 8px 12px; border-radius: 10px; }
.nav-menu { display: flex; list-style: none; gap: 18px; margin: 0; padding: 0; }
.nav-menu a { color: var(--text); opacity: 0.9; }

@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu { position: absolute; right: 4%; top: 68px; flex-direction: column; background: var(--bg-elev); padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); display: none; }
  .nav-menu.show { display: flex; }
}

/* Hero */
.grid-2 { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: center; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.hero { padding-top: 48px; padding-bottom: 48px; }
.hero-text { padding: 16px 0; }
.hero-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hero-card { padding: 20px; border-radius: 16px; }
.glass { background: var(--card); border: 1px solid rgba(255,255,255,0.10); box-shadow: var(--shadow); }
.avatar { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: var(--shadow); }
.meta { margin-top: 12px; color: var(--muted); }
.meta-line { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); display: inline-block; }

/* 机器人 SVG 动效 */
.robot { display: block; margin-top: 16px; filter: drop-shadow(0 10px 20px rgba(2,6,23,0.35)); will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .robot { animation: float 6s ease-in-out infinite; }
  .robot .eye { animation: blink 4.2s infinite; transform-origin: center; }
  @keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
  @keyframes blink { 0%, 46%, 48%, 50%, 100% { transform: scaleY(1); } 47%, 49% { transform: scaleY(0.15); } }
}

/* 卡片与排版 */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
@media (max-width: 700px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.card ul { margin: 8px 0 0 18px; }

/* 画廊 */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }
.tile { margin: 0; }
.tile figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.tile img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #0c1833; }

/* 随笔 */
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
@media (max-width: 800px) { .notes { grid-template-columns: 1fr; } }
.note { background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.note time { display: block; color: var(--muted); margin-top: 8px; font-size: 14px; }

/* 联系 */
.contact-line { display: flex; align-items: center; gap: 8px; }
.icon { width: 18px; height: 18px; }

/* 页脚 */
.site-footer { border-top: 1px solid rgba(255,255,255,0.08); background: color-mix(in oklab, var(--bg-elev) 70%, transparent); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 72px; }
@media (max-width: 700px) { .footer-inner { height: auto; padding: 16px 0; flex-direction: column; align-items: flex-start; } }

/* 细节微交互 */
.card:hover, .glass:hover { transform: translateY(-1px); transition: transform .2s ease; }
.brand-logo { transition: transform .25s ease; }
.brand:hover .brand-logo { transform: rotate(8deg) scale(1.06); }

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(12px) scale(.995); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); }
.reveal[data-reveal="left"] { transform: translateX(-12px); }
.reveal[data-reveal="right"] { transform: translateX(12px); }
.reveal.is-visible { opacity: 1; transform: translate3d(0,0,0) scale(1); }

/* Tilt hover（JS 控制 transform） */
.tilt { will-change: transform; transform-style: preserve-3d; }
.tilt img { transform: translateZ(0.01px); }
@media (hover: hover) and (pointer: fine) {
  .tilt { transition: transform .12s ease; }
}

/* 顶部滚动进度条 */
.scroll-progress {
  position: fixed; inset: 0 auto auto 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 70; transform-origin: 0 50%;
}

/* 模块化分段样式（更像 Apple 版面） */
.section.split { padding: 96px 0; }
.feature { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: center; }
@media (max-width: 960px) { .feature { grid-template-columns: 1fr; } }
.feature .headline { font-size: clamp(28px, 4.8vw, 40px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.feature .desc { color: var(--muted); font-size: 16px; }

/* 轻微视差容器（JS 更新 transform） */
[data-parallax] { will-change: transform; }

/* 低清占位与懒加载过渡 */
.lazy-img { filter: blur(12px); transform: scale(1.02); transition: filter .35s ease, transform .35s ease; }
.lazy-img.is-loaded { filter: blur(0); transform: none; }
