:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --text: #111827;
  --muted: #5f6b7a;
  --soft: #8a96a8;
  --line: rgba(17, 24, 39, 0.08);
  --card: rgba(255, 255, 255, 0.72);
  --blue: #007aff;
  --cyan: #00a7d8;
  --green: #34c759;
  --orange: #ff9500;
  --purple: #5856d6;
  --shadow: 0 24px 70px rgba(64, 82, 111, 0.18);
  --radius: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(244,247,251,.96)),
    radial-gradient(circle at 18% 8%, rgba(0,122,255,.22), transparent 32rem),
    radial-gradient(circle at 78% 16%, rgba(52,199,89,.18), transparent 30rem),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image: linear-gradient(rgba(17,24,39,.035) 1px, transparent 1px);
  background-size: 100% 42px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .65;
  pointer-events: none;
}

.ambient-blue { top: -180px; left: -120px; background: rgba(0,122,255,.2); }
.ambient-green { right: -140px; top: 120px; background: rgba(52,199,89,.16); }

.dock {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  min-height: 66px;
  margin: 16px auto 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 12px 38px rgba(64,82,111,.12);
  backdrop-filter: blur(24px) saturate(170%);
}

.brand, .dock-nav, .hero-actions, .setting-row, .app-card, .chips {
  display: flex;
  align-items: center;
}

.brand { gap: 10px; padding-right: 12px; font-weight: 800; }

.brand-avatar, .profile-avatar, .app-icon, .setting-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #111827, #3b82f6);
  color: #fff;
  font-weight: 900;
}

.dock-nav {
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: rgba(17,24,39,.05);
}

.dock-nav a {
  padding: 9px 13px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.dock-nav a:hover { background: rgba(255,255,255,.82); color: var(--text); }

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 82px);
  padding: 56px 0 64px;
}

.pill, .section-kicker, .widget-label, .mini-widget span, .stat-widget span, .timeline-item span, .app-head span {
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  padding: 9px 14px;
  border: 1px solid rgba(0,122,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: var(--blue);
  box-shadow: 0 10px 30px rgba(0,122,255,.08);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 14px;
  font-size: clamp(72px, 12vw, 148px);
  line-height: .9;
}

.hero-title {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.08;
}

.hero-lead {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.hero-actions { flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button.primary { background: #111827; color: #fff; box-shadow: 0 16px 36px rgba(17,24,39,.2); }
.button.glass { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.64); color: var(--text); backdrop-filter: blur(18px); }

.iphone {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 42px;
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(238,244,252,.82));
  box-shadow: var(--shadow);
}

.phone-bar {
  width: 118px;
  height: 28px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #111827;
}

.profile-widget, .mini-widget, .settings-list, .large-widget, .stat-widget,
.app-card, .project-card, .review-list, .timeline, .education-card, .contact-card {
  border: 1px solid rgba(255,255,255,.86);
  background: var(--card);
  box-shadow: 0 16px 44px rgba(64,82,111,.1);
  backdrop-filter: blur(20px) saturate(160%);
}

.profile-widget {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 28px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.widget-label { display: block; margin-bottom: 6px; color: var(--soft); }
.profile-widget strong { font-size: 20px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

.mini-widget {
  min-height: 104px;
  padding: 16px;
  border-radius: 28px;
  color: #fff;
}

.mini-widget span, .mini-widget strong { display: block; }
.mini-widget span { margin-bottom: 20px; color: rgba(255,255,255,.76); }
.mini-widget strong { font-size: 20px; }
.mini-widget.blue { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.mini-widget.green { background: linear-gradient(135deg, #30d158, #64d2ff); }

.settings-list { display: grid; gap: 1px; margin-top: 12px; padding: 8px; border-radius: 28px; }
.setting-row { gap: 12px; padding: 12px; border-radius: 20px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }

.setting-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  font-weight: 900;
}

.setting-icon.code { background: var(--blue); }
.setting-icon.db { background: var(--green); }
.setting-icon.ops { background: var(--orange); }
.setting-row strong { display: block; margin-bottom: 3px; font-size: 15px; }
.setting-row p { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.section { padding: 88px 0 0; }
.section-heading { max-width: 760px; margin-bottom: 26px; }
.section-kicker { display: block; margin-bottom: 8px; color: var(--blue); }

.section-heading h2, .contact-card h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.16;
}

.widget-grid { display: grid; grid-template-columns: 1.5fr repeat(2, 1fr); gap: 14px; }
.large-widget, .stat-widget { min-height: 172px; padding: 22px; border-radius: var(--radius); }
.large-widget { grid-row: span 2; }
.large-widget h3 { max-width: 520px; margin-bottom: 14px; font-size: 31px; line-height: 1.16; }
.large-widget p { color: var(--muted); font-size: 17px; line-height: 1.75; }

.stat-widget {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #111827, #3b82f6);
  color: #fff;
}

.stat-widget span { color: rgba(255,255,255,.72); }
.stat-widget strong { font-size: 25px; line-height: 1.15; }
.stat-widget.cyan { background: linear-gradient(135deg, var(--cyan), #64d2ff); }
.stat-widget.orange { background: linear-gradient(135deg, var(--orange), #ffcc00); }
.stat-widget.purple { background: linear-gradient(135deg, var(--purple), #af52de); }

.app-list, .project-grid { display: grid; gap: 14px; }
.project-grid { grid-template-columns: repeat(2, 1fr); }

.app-card { gap: 18px; padding: 18px; border-radius: var(--radius); }
.app-icon { width: 74px; height: 74px; border-radius: 22px; color: #fff; font-size: 28px; font-weight: 900; }
.app-icon.blue { background: linear-gradient(135deg, var(--blue), #64d2ff); }
.app-icon.green { background: linear-gradient(135deg, var(--green), #00c7be); }
.app-icon.orange { background: linear-gradient(135deg, var(--orange), #ff3b30); }
.app-content { min-width: 0; flex: 1; }

.app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.app-head h3 { margin-bottom: 0; font-size: 24px; }
.app-head span { flex: 0 0 auto; color: var(--soft); }
.app-card p { margin-bottom: 14px; color: var(--muted); line-height: 1.7; }

.chips { flex-wrap: wrap; gap: 8px; }
.chips span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(17,24,39,.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.project-card { min-height: 270px; padding: 22px; border-radius: var(--radius); }
.project-tag {
  display: inline-flex;
  margin-bottom: 20px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(0,122,255,.08);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.project-card h3 { margin-bottom: 12px; font-size: 24px; }
.project-card p { color: var(--muted); line-height: 1.7; }
.project-card strong { display: block; color: var(--soft); font-size: 13px; line-height: 1.6; }

.timeline, .education-card, .review-list { display: grid; gap: 1px; padding: 8px; border-radius: var(--radius); }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 22px; padding: 18px; border-radius: 22px; }
.timeline-item + .timeline-item { border-top: 1px solid var(--line); }
.timeline-item span { color: var(--blue); }
.timeline-item h3 { margin-bottom: 8px; font-size: 22px; }
.timeline-item p { margin-bottom: 0; color: var(--muted); line-height: 1.7; }

.education-card {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 22px;
}

.education-card span { display: block; margin-bottom: 12px; color: var(--blue); font-size: 13px; font-weight: 900; }
.education-card h3 { margin-bottom: 8px; font-size: 24px; }
.education-card p { margin-bottom: 0; color: var(--muted); }
.education-card strong { color: var(--soft); font-size: 14px; }

.review-list p {
  margin: 0;
  padding: 16px;
  border-radius: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.review-list p + p { border-top: 1px solid var(--line); }

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin: 88px 0 48px;
  padding: 28px;
  border-radius: 32px;
}

.contact-card .hero-actions { margin-top: 0; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 16px 38px rgba(64,82,111,.16);
  color: var(--text);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(18px);
}

.toast.show { opacity: 1; transform: translateY(0); }

.reveal {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); }

@media (max-width: 920px) {
  .hero, .contact-card { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .iphone { max-width: 460px; }
  .widget-grid { grid-template-columns: repeat(2, 1fr); }
  .large-widget { grid-column: 1 / -1; grid-row: auto; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .dock {
    top: 10px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    width: calc(100% - 20px);
    border-radius: 22px;
  }

  .dock-nav { justify-content: space-between; }
  .dock-nav a { padding: 8px 9px; font-size: 13px; }
  .page { width: calc(100% - 20px); }
  .hero { gap: 30px; padding-top: 46px; }
  h1 { font-size: clamp(64px, 22vw, 104px); }
  .hero-title { font-size: clamp(30px, 10vw, 44px); }
  .hero-lead { font-size: 16px; }
  .button { width: 100%; }
  .iphone { border-radius: 34px; padding: 12px; }
  .widget-grid, .quick-grid { grid-template-columns: 1fr; }
  .app-card { align-items: flex-start; }
  .app-icon { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; }
  .app-head { flex-direction: column; gap: 4px; }
  .timeline-item, .education-card { grid-template-columns: 1fr; gap: 8px; }
}

@media print {
  @page { size: A4; margin: 12mm; }

  :root {
    --bg: #fff;
    --text: #111827;
    --muted: #4b5563;
    --soft: #6b7280;
    --line: rgba(17,24,39,.14);
    --card: #fff;
    --shadow: none;
  }

  html { scroll-behavior: auto; }
  body { min-width: 0; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body::before, .ambient, .no-print, .toast { display: none !important; }

  .dock {
    position: static;
    width: 100%;
    min-height: 0;
    margin: 0 0 10mm;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .brand-avatar { width: 36px; height: 36px; border-radius: 10px; }
  .page { width: 100%; margin: 0; }
  .hero { grid-template-columns: 1.2fr .8fr; gap: 8mm; min-height: 0; padding: 0 0 10mm; }
  .pill { box-shadow: none; }
  h1 { font-size: 56pt; }
  .hero-title { font-size: 24pt; }
  .hero-lead { font-size: 11pt; line-height: 1.6; }
  .iphone { padding: 4mm; border-radius: 12mm; box-shadow: none; }
  .phone-bar { height: 6mm; margin-bottom: 4mm; }

  .profile-widget, .mini-widget, .settings-list, .large-widget, .stat-widget,
  .app-card, .project-card, .review-list, .timeline, .education-card, .contact-card {
    box-shadow: none;
    backdrop-filter: none;
    break-inside: avoid;
  }

  .section { padding-top: 9mm; break-inside: avoid; }
  .section-heading { margin-bottom: 5mm; }
  .section-heading h2, .contact-card h2 { font-size: 21pt; }
  .widget-grid, .project-grid { grid-template-columns: 1fr 1fr; }
  .large-widget { grid-column: 1 / -1; }
  .large-widget, .stat-widget, .project-card { min-height: auto; padding: 5mm; }
  .large-widget h3 { font-size: 18pt; }
  .large-widget p, .app-card p, .timeline-item p, .project-card p, .review-list p { font-size: 10.5pt; line-height: 1.55; }
  .app-card { align-items: flex-start; padding: 5mm; }
  .app-icon { width: 14mm; height: 14mm; border-radius: 4mm; font-size: 14pt; }
  .app-head h3, .timeline-item h3, .project-card h3 { font-size: 14pt; }
  .timeline-item { grid-template-columns: 32mm 1fr; padding: 5mm; }
  .education-card { grid-template-columns: 1fr auto; padding: 5mm; }
  .contact-card { grid-template-columns: 1fr; margin: 10mm 0 0; padding: 6mm; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
