/* ===== 基础变量与主题 ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #1f2328;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, .06);
  --radius: 14px;
  --max-width: 1120px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --bg-alt: #16191f;
  --text: #e6e8eb;
  --text-muted: #9aa3ad;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --border: #262b33;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .3s, color .3s;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 720px; }

/* ===== 导航 ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 16px;
}

.nav-menu { display: flex; gap: 28px; }
.nav-link { font-size: 15px; color: var(--text-muted); position: relative; padding: 6px 0; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--primary); transition: width .25s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--bg-alt);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 16px;
}

.nav-hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-hamburger span { width: 22px; height: 2px; background: var(--text); transition: .3s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 首屏 ===== */
.hero { position: relative; padding: 150px 0 90px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; position: relative; z-index: 2; }

.eyebrow { color: var(--primary); font-weight: 600; letter-spacing: 2px; font-size: 14px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.25; margin: 14px 0 18px; }
.highlight { color: var(--primary); }
.hero-desc { color: var(--text-muted); max-width: 520px; margin-bottom: 28px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-bg {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(600px 300px at 15% 20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%),
    radial-gradient(500px 260px at 85% 70%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%);
}

.card-tilt {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow);
  transform: rotate(-3deg); transition: transform .4s;
}
.card-tilt:hover { transform: rotate(0) scale(1.02); }
.card-tilt img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ===== 通用区块 ===== */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: clamp(24px, 4vw, 34px); margin-bottom: 36px; text-align: center; }

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.about-grid p { color: var(--text-muted); margin-bottom: 14px; }

.skill-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.skill-list i { font-style: normal; color: var(--primary); font-weight: 600; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--card-shadow); transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-6px); }
.card-icon { font-size: 30px; margin-bottom: 14px; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: 15px; }

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work-item {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--bg); box-shadow: var(--card-shadow); transition: transform .3s;
}
.work-item:hover { transform: translateY(-6px); }
.work-thumb { height: 160px; }
.work-info { padding: 18px; }
.work-info h3 { font-size: 17px; margin-bottom: 6px; }
.work-info p { color: var(--text-muted); font-size: 14px; }

/* ===== 表单 ===== */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.form-tip { color: var(--primary); font-size: 14px; min-height: 20px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 10px; font-size: 15px;
  font-weight: 600; border: none; cursor: pointer; transition: .25s; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-grid p { color: var(--text-muted); font-size: 14px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--primary); }

/* ===== 滚动动画 ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .card-grid, .work-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-visual { max-width: 320px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .nav-hamburger { display: flex; }
  .nav-menu {
    position: fixed; top: 68px; right: 0; width: 220px; height: calc(100vh - 68px);
    background: var(--bg); border-left: 1px solid var(--border);
    flex-direction: column; padding: 24px; gap: 18px;
    transform: translateX(100%); transition: transform .3s;
  }
  .nav-menu.open { transform: translateX(0); }
  .card-grid, .work-grid, .form-row { grid-template-columns: 1fr; }
  .hero { padding: 120px 0 60px; }
  .section { padding: 60px 0; }
}
