:root {
  --color-white: #ffffff;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-blue-50: #eff6ff;
  --color-blue-100: #dbeafe;
  --color-blue-200: #bfdbfe;
  --color-blue-400: #60a5fa;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;
  --color-amber-500: #f59e0b;
  --color-emerald-50: #ecfdf5;
  --color-emerald-100: #d1fae5;
  --color-emerald-700: #047857;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.12), 0 4px 6px rgba(15, 23, 42, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC",
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-slate-50);
  color: var(--color-slate-900);
  font-family: var(--font-sans);
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-xs {
  font-size: 1rem;
}

.icon-sm {
  font-size: 1.125rem;
}

.icon-md {
  font-size: 1.25rem;
}

.page-shell {
  min-height: 100vh;
  padding: 2.5rem 1rem 5rem;
}

.page-container {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

.hero-card,
.content-card,
.tab-button,
.experience-card,
.project-card,
.skill-card,
.award-panel,
.cert-card {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    color 0.2s ease, transform 0.2s ease;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--color-white);
  border: 1px solid var(--color-slate-100);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}

.avatar-frame {
  width: 8rem;
  height: 8rem;
  border-radius: 9999px;
  overflow: hidden;
  border: 4px solid var(--color-white);
  box-shadow: var(--shadow-lg);
  background: var(--color-slate-200);
  color: var(--color-slate-400);
  flex-shrink: 0;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  flex: 1 1 auto;
  text-align: center;
  display: grid;
  gap: 1rem;
}

.hero-top-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-title {
  margin: 0;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  margin: 0.25rem 0 0;
  color: var(--color-slate-600);
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem;
  border: 1px solid var(--color-slate-200);
  border-radius: 9999px;
  background: var(--color-slate-50);
}

.language-button {
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-slate-600);
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  cursor: pointer;
}

.language-button:hover {
  color: var(--color-slate-900);
}

.language-button.is-active {
  background: var(--color-blue-600);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--color-slate-600);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.hero-highlight-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.hero-highlight {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid var(--color-blue-100);
  border-radius: 0.5rem;
  background: var(--color-blue-50);
  color: var(--color-blue-700);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  font-weight: 700;
}

.contact-item,
.inline-row {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.contact-link:hover,
.project-link:hover,
.project-title:hover {
  color: var(--color-blue-600);
}

.content-grid {
  display: grid;
  gap: 2rem;
}

.tab-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.tab-button {
  border: 1px solid var(--color-slate-100);
  background: var(--color-white);
  color: var(--color-slate-600);
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.tab-button .icon {
  color: var(--color-slate-400);
}

.tab-button:hover {
  background: var(--color-slate-100);
}

.tab-button.is-active {
  background: var(--color-blue-600);
  color: var(--color-white);
  border-color: var(--color-blue-600);
  box-shadow: 0 10px 15px rgba(191, 219, 254, 0.55), 0 4px 6px rgba(191, 219, 254, 0.4);
}

.tab-button.is-active .icon {
  color: var(--color-blue-200);
}

.content-card {
  background: var(--color-white);
  border: 1px solid var(--color-slate-100);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  min-height: 500px;
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel.is-visible {
  animation: panel-enter 0.2s ease;
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.panel-stack,
.panel-stack-lg,
.stack-lg,
.stack-md,
.timeline,
.achievement-list {
  display: grid;
}

.panel-stack {
  gap: 1.5rem;
}

.panel-stack-lg {
  display: grid;
  gap: 2.5rem;
}

.stack-lg {
  gap: 1.5rem;
}

.stack-md {
  gap: 1rem;
}

.section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}

.section-title-spaced {
  margin-bottom: 1.5rem;
}

.title-icon-blue {
  color: var(--color-blue-500);
}

.title-icon-amber {
  color: var(--color-amber-500);
}

.lead-copy,
.card-copy,
.project-copy,
.skill-copy,
.achievement-copy {
  margin: 0;
  color: var(--color-slate-600);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.lead-copy {
  font-size: 1.125rem;
}

.experience-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-100);
}

.experience-card:hover {
  border-color: var(--color-slate-200);
  box-shadow: var(--shadow-sm);
}

.experience-icon-box {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--color-blue-100);
  color: var(--color-blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.experience-body {
  flex: 1 1 auto;
}

.experience-head,
.project-head,
.cert-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.experience-head {
  margin-bottom: 0.25rem;
}

.card-title,
.project-title,
.timeline-title,
.panel-subtitle,
.achievement-title,
.skill-title {
  margin: 0;
  color: var(--color-slate-900);
  font-weight: 700;
}

.card-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.company-label {
  margin: 0 0 1rem;
  color: var(--color-blue-600);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.date-pill,
.project-year {
  border-radius: 9999px;
  border: 1px solid var(--color-slate-200);
  background: var(--color-white);
  color: var(--color-slate-500);
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.card-copy {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.disc-list,
.timeline-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--color-slate-600);
  font-size: 0.875rem;
  line-height: 1.625;
}

.disc-list li + li,
.timeline-list li + li {
  margin-top: 0.5rem;
}

.project-card,
.skill-card,
.award-panel,
.cert-card {
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-100);
}

.project-card {
  border-radius: 1rem;
  padding: 1.5rem;
}

.project-card:hover {
  border-color: var(--color-blue-200);
  box-shadow: var(--shadow-md);
}

.project-card:hover .project-title {
  color: var(--color-blue-600);
}

.project-head {
  margin-bottom: 1rem;
}

.project-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  margin-top: 0.25rem;
  color: var(--color-blue-500);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.project-link:hover {
  text-decoration: underline;
}

.project-copy {
  margin-bottom: 1.25rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: var(--color-blue-50);
  color: var(--color-blue-700);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
}

.dot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  color: var(--color-slate-600);
  font-size: 0.875rem;
}

.dot-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.dot-bullet {
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.45rem;
  border-radius: 9999px;
  background: var(--color-blue-400);
  flex-shrink: 0;
}

.timeline {
  gap: 2rem;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
}

.timeline-rail {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: var(--color-blue-100);
  border: 3px solid var(--color-blue-600);
}

.timeline-line {
  width: 2px;
  flex: 1 1 auto;
  margin-top: 0.5rem;
  background: var(--color-slate-200);
}

.timeline-body {
  padding-bottom: 1rem;
}

.timeline-title {
  font-size: 1.1rem;
  line-height: 1.5rem;
  margin-bottom: 0.25rem;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--color-slate-600);
  font-size: 0.875rem;
}

.meta-chip,
.gpa-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
}

.meta-chip {
  background: var(--color-slate-100);
}

.gpa-chip {
  border: 1px solid var(--color-emerald-100);
  background: var(--color-emerald-50);
  color: var(--color-emerald-700);
  font-weight: 600;
}

.skills-grid {
  display: grid;
  gap: 1rem;
}

.skill-card {
  border-radius: 0.75rem;
  padding: 1rem;
}

.skill-title {
  margin-bottom: 0.5rem;
}

.panel-subtitle {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--color-slate-800);
  border-bottom: 1px solid var(--color-slate-200);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.award-panel {
  border-radius: 1rem;
  padding: 1.25rem;
}

.achievement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
}

.achievement-item {
  display: flex;
  gap: 1rem;
}

.achievement-rank {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: var(--color-blue-100);
  color: var(--color-blue-600);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.achievement-title {
  display: block;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--color-slate-800);
}

.achievement-copy {
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.cert-card {
  border-radius: 1rem;
  padding: 1.25rem;
}

.cert-card:hover {
  border-color: #fde68a;
  box-shadow: var(--shadow-sm);
}

.cert-row {
  align-items: flex-start;
}

.cert-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-slate-800);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}

.cert-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-slate-200);
  background: var(--color-white);
  color: var(--color-slate-500);
  border-radius: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.viewer-map-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  pointer-events: none;
}

.viewer-map-toggle,
.viewer-map-close {
  border: 1px solid var(--color-slate-200);
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-slate-700);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  pointer-events: auto;
}

.viewer-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  border-radius: 9999px;
  padding: 0.625rem 0.95rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
}

.viewer-map-toggle:hover,
.viewer-map-close:hover {
  border-color: var(--color-blue-200);
  color: var(--color-blue-700);
}

.viewer-map-panel {
  width: min(calc(100vw - 2rem), 28rem);
  overflow: hidden;
  border: 1px solid var(--color-slate-200);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.viewer-map-panel[hidden] {
  display: none;
}

.viewer-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-slate-100);
}

.viewer-map-title,
.viewer-map-summary {
  margin: 0;
}

.viewer-map-title {
  color: var(--color-slate-900);
  font-size: 1rem;
  line-height: 1.375rem;
  font-weight: 800;
}

.viewer-map-summary {
  margin-top: 0.25rem;
  color: var(--color-slate-500);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.viewer-map-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  font-size: 1.25rem;
  line-height: 1;
}

.viewer-map-canvas {
  width: 100%;
  height: 18rem;
  background: var(--color-slate-100);
}

.viewer-map-canvas .leaflet-control-attribution {
  font-size: 0.625rem;
}

@media (min-width: 768px) {
  .hero-card {
    flex-direction: row;
    align-items: flex-start;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-top-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .contact-list {
    justify-content: flex-start;
  }

  .hero-highlight-list {
    justify-content: flex-start;
  }

  .project-head,
  .cert-row {
    flex-direction: row;
    align-items: center;
  }

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

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .tab-nav {
    grid-column: span 3 / span 3;
    flex-direction: column;
    overflow: visible;
    padding-bottom: 0;
  }

  .tab-button {
    white-space: normal;
  }

  .content-card {
    grid-column: span 9 / span 9;
  }
}

@media (max-width: 767px) {
  .experience-head,
  .project-head,
  .cert-row {
    flex-direction: column;
  }

  .viewer-map-widget {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
  }

  .viewer-map-panel {
    width: 100%;
  }

  .viewer-map-canvas {
    height: 16rem;
  }
}
