:root {
  color-scheme: light;
  --bg: #fff8fb;
  --bg-soft: #fff1f7;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --text: #2a2130;
  --muted: #746978;
  --line: rgba(90, 61, 84, 0.14);
  --accent: #ff7eb6;
  --accent-strong: #ef4f97;
  --mint: #54d9c2;
  --lilac: #a98bff;
  --sun: #ffd166;
  --danger: #ef6f6c;
  --shadow: 0 22px 58px rgba(125, 78, 108, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 126, 182, 0.22), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(84, 217, 194, 0.2), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(169, 139, 255, 0.16), transparent 30rem),
    linear-gradient(180deg, var(--bg) 0%, #fffdf7 52%, #fff8fb 100%);
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand,
.site-nav,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 860;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid rgba(42, 33, 48, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #ffe2ef);
  color: var(--accent-strong);
  box-shadow: 4px 4px 0 rgba(255, 126, 182, 0.2);
}

.site-nav {
  justify-content: center;
  gap: 6px;
}

.site-nav a,
.ghost-btn,
.secondary-btn,
.primary-btn,
.chip {
  min-height: 42px;
  border-radius: 999px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.site-nav a {
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 760;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255, 126, 182, 0.14);
  color: var(--accent-strong);
}

.header-actions,
.hero-actions,
.form-actions,
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.chip {
  border: 1px solid var(--line);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--accent), #ff9fc9);
  border-color: rgba(239, 79, 151, 0.32);
  color: #fff;
  font-weight: 860;
  box-shadow: 0 12px 26px rgba(239, 79, 151, 0.22);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #ff90c1, var(--accent-strong));
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(239, 79, 151, 0.28);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.chip:active,
.tag-cloud button:active,
.close-btn:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn.small {
  min-height: 38px;
  padding: 8px 14px;
}

.primary-btn.full {
  width: 100%;
}

.secondary-btn,
.ghost-btn,
.chip {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 780;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
}

.secondary-btn:hover,
.ghost-btn:hover,
.chip:hover {
  background: #fff;
  border-color: rgba(239, 79, 151, 0.34);
  box-shadow: 0 10px 24px rgba(125, 78, 108, 0.12);
}

.ghost-btn {
  padding: 8px 13px;
}

.ghost-btn.tiny {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

.section-band {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.hero {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.76fr);
  align-items: center;
  gap: 48px;
  border-top: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: 78px;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-lead,
.about-copy,
.contact-note,
.login-hint {
  color: var(--muted);
  line-height: 1.8;
}

.hero-lead {
  max-width: 660px;
  margin: 24px 0 28px;
  font-size: 18px;
  font-weight: 620;
}

.hero-panel,
.chart-panel,
.contact-form,
.login-card,
.project-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 209, 102, 0.28), transparent 7rem),
    radial-gradient(circle at 88% 0%, rgba(169, 139, 255, 0.22), transparent 8rem);
}

.hero-panel > * {
  position: relative;
}

.status-row,
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-weight: 760;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--sun);
  box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.24);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0;
}

.metric-grid article {
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.metric-grid strong {
  display: block;
  font-size: 26px;
  color: var(--accent-strong);
}

.metric-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.mini-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-timeline span {
  min-width: 0;
  padding: 10px;
  border-radius: 999px;
  background: rgba(84, 217, 194, 0.16);
  color: #157865;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.about-grid,
.skills-layout,
.contact-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 44px;
}

.about-copy {
  font-weight: 620;
}

.about-copy p:first-child {
  margin-top: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.chip {
  padding: 9px 14px;
  color: var(--muted);
}

.chip.active,
.chip[aria-pressed="true"] {
  background: rgba(255, 126, 182, 0.18);
  border-color: rgba(239, 79, 151, 0.42);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(239, 79, 151, 0.1);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  min-width: 0;
  padding: 20px;
  transform: translateY(10px);
  opacity: 0;
  animation: cardIn 0.55s ease forwards;
}

.project-card:hover {
  border-color: rgba(239, 79, 151, 0.32);
  transform: translateY(-2px);
  background: var(--panel-strong);
}

.project-card h3 {
  margin: 14px 0 10px;
  font-size: 20px;
}

.project-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 620;
}

.project-meta,
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span,
.project-stack span,
.tag-cloud button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.project-meta span,
.project-stack span {
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.project-stack {
  margin-top: 16px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(239, 79, 151, 0.34);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.tag-cloud button {
  min-height: 40px;
  padding: 8px 13px;
  color: var(--text);
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.tag-cloud button:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: rgba(84, 217, 194, 0.42);
}

.tag-cloud button.active {
  background: rgba(84, 217, 194, 0.18);
  border-color: rgba(84, 217, 194, 0.56);
  color: #157865;
}

.chart-panel {
  min-width: 0;
  padding: 20px;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 14px;
}

.contact-form,
.login-card {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 760;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  outline: none;
}

input {
  min-height: 46px;
  padding: 10px 13px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: 13px;
}

input:focus,
textarea:focus {
  border-color: rgba(239, 79, 151, 0.62);
  box-shadow: 0 0 0 4px rgba(255, 126, 182, 0.16);
}

.login-dialog {
  width: min(440px, calc(100% - 32px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.login-dialog::backdrop {
  background: rgba(42, 33, 48, 0.34);
  backdrop-filter: blur(8px);
}

.login-card {
  position: relative;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(239, 79, 151, 0.35);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 820;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

@keyframes cardIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 28px, 720px);
  }

  .site-header {
    grid-template-columns: auto auto;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .site-nav,
  .header-actions {
    grid-column: 1 / -1;
    display: none;
    justify-content: stretch;
  }

  .site-nav.open,
  .header-actions.open {
    display: flex;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav a,
  .header-actions button {
    width: 100%;
    justify-content: center;
  }

  .hero,
  .about-grid,
  .skills-layout,
  .contact-layout,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    font-size: 54px;
  }

  h2 {
    font-size: 36px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100% - 24px);
  }

  .section-band {
    padding: 48px 0;
  }

  h1 {
    font-size: 38px;
    line-height: 1;
  }

  h2 {
    font-size: 28px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .metric-grid,
  .mini-timeline {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .form-actions,
  .filter-group {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions > *,
  .form-actions > *,
  .filter-group > * {
    width: 100%;
  }
}
