:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f8;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-border: #e5e7eb;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --container: 1080px;
  --nav-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

ul {
  list-style: none;
}

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  z-index: 100;
}

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.nav-wrap {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--color-primary);
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
}

.hero-inner {
  width: 100%;
}

.hero-greeting {
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.hero-name {
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-role {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.hero-desc {
  max-width: 560px;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== Sections ===== */
.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section-sub {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 40px;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

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

.about-facts {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.about-facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.about-facts li:last-child {
  border-bottom: none;
}

.about-facts span {
  color: var(--color-text-muted);
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.skill-card li {
  position: relative;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  padding: 6px 0 6px 18px;
}

.skill-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-header h3 {
  font-size: 1.05rem;
}

.project-tag {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.project-card p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  flex-grow: 1;
  margin-bottom: 16px;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Blog ===== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: box-shadow 0.2s;
}

.blog-item:hover {
  box-shadow: var(--shadow-md);
}

.blog-item time {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.blog-item h3 {
  font-size: 1.1rem;
  margin: 6px 0 8px;
  color: var(--color-text);
  transition: color 0.2s;
}

.blog-item a:hover h3 {
  color: var(--color-primary);
}

.blog-item p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

/* ===== Contact ===== */
.contact-wrap {
  max-width: 680px;
}

.contact-tip {
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.contact-form {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-row textarea {
  resize: vertical;
}

.contact-social {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.contact-social a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.contact-social a:hover {
  color: var(--color-primary);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav.open {
    max-height: 320px;
  }

  .site-nav a {
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .skill-card,
  .project-card,
  .blog-item,
  .toast {
    transition: none;
  }
}
