:root {
  --bg: #f7f3ec;
  --panel: #ffffff;
  --text: #21313c;
  --muted: #63717b;
  --line: #dce3df;
  --brand: #0f8b8d;
  --accent: #f25c54;
  --gold: #f0b429;
  --green: #6abf69;
  --shadow: 0 18px 45px rgba(29, 47, 59, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f7f3ec 0%, #e8f2ee 48%, #fff7dd 100%);
  letter-spacing: 0;
}

body.dark {
  --bg: #18242a;
  --panel: #22313a;
  --text: #edf4f2;
  --muted: #b8c7c3;
  --line: #38515b;
  background: linear-gradient(135deg, #142227 0%, #263d42 52%, #3f3442 100%);
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

body.dark .site-header {
  background: rgba(34, 49, 58, .9);
}

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: conic-gradient(from 120deg, var(--brand), var(--accent), var(--gold), var(--brand));
  animation: logoPulse 3.6s ease-in-out infinite;
}

.main-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
  flex: 1;
}

.main-menu a {
  position: relative;
  display: block;
  padding: 10px 13px;
  border-radius: 8px;
  color: var(--muted);
  transition: color .25s ease, background .25s ease, transform .25s ease;
}

.main-menu a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}

.main-menu a:hover,
.main-menu a.active {
  color: var(--text);
  background: rgba(15, 139, 141, .1);
  transform: translateY(-2px);
}

.main-menu a:hover::after,
.main-menu a.active::after {
  transform: scaleX(1);
}

.menu-toggle,
.theme-toggle,
button,
.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

button:hover,
.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--brand);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock {
  min-width: 78px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.theme-toggle {
  padding: 9px 12px;
  color: #fff;
  background: var(--text);
}

.section-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.hero {
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 44px;
}

.page-hero {
  min-height: 340px;
  display: grid;
  align-content: center;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 1.02;
}

h2 {
  margin: 0;
  font-size: 2rem;
}

h3 {
  margin: 0 0 12px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
}

.primary-btn {
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow);
}

.ghost-btn {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .45);
}

.hero-media img,
.project-card img,
.slide img {
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform .35s ease, filter .35s ease;
}

.hero-media img:hover,
.project-card:hover img,
.slide.active img {
  transform: translateY(-6px) scale(1.015);
  filter: saturate(1.08);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

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

.profile-grid {
  grid-template-columns: 2fr 1fr;
}

.info-card,
.award-card,
.project-card,
.media-box,
.tabs,
.contact-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 26px rgba(34, 49, 58, .08);
}

.resume-table {
  width: 100%;
  border-collapse: collapse;
}

.resume-table th,
.resume-table td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
}

.resume-table th {
  background: rgba(15, 139, 141, .1);
}

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

.tag-cloud span {
  padding: 9px 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--green));
  animation: floatTag 4s ease-in-out infinite;
}

.carousel {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.carousel-track {
  min-height: 330px;
  overflow: hidden;
}

.slide {
  display: none;
  grid-template-columns: minmax(220px, 440px) 1fr;
  align-items: center;
  gap: 24px;
  min-height: 330px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  animation: slideIn .45s ease both;
}

.slide.active {
  display: grid;
}

.carousel-btn {
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--brand);
  font-size: 2rem;
}

.carousel-dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dots button {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 50%;
  background: var(--line);
}

.carousel-dots button.active {
  width: 28px;
  border-radius: 8px;
  background: var(--accent);
}

.tab-list,
.filter-bar,
.select-tools,
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tab,
.filter-bar button,
.project-card button,
.contact-form button {
  padding: 10px 14px;
  color: var(--text);
  background: rgba(15, 139, 141, .12);
}

.tab.active,
.filter-bar button.active,
.contact-form button[type="submit"] {
  color: #fff;
  background: var(--brand);
}

.tab-panel {
  display: none;
  margin-top: 18px;
  padding: 18px;
  border-left: 5px solid var(--accent);
  background: rgba(242, 92, 84, .08);
  animation: fadeUp .3s ease both;
}

.tab-panel.active {
  display: block;
}

.skills {
  display: grid;
  gap: 16px;
}

.skill {
  display: grid;
  gap: 8px;
}

.bar {
  height: 14px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(99, 113, 123, .18);
}

.bar i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--accent));
  animation: growBar 1.1s ease both;
}

.award-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.award-card {
  transition: opacity .25s ease, transform .25s ease;
}

.award-card.hidden {
  display: none;
}

.award-card label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.project-card {
  display: grid;
  gap: 12px;
}

.media-box {
  display: grid;
  gap: 12px;
}

audio {
  width: 100%;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 18px;
  text-align: left;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
}

.timeline-item small {
  display: none;
  color: var(--muted);
}

.timeline-item.active {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.timeline-item.active small {
  display: block;
  animation: fadeUp .28s ease both;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  transition: border .2s ease, box-shadow .2s ease;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, .16);
}

.form-msg {
  min-height: 24px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.elevator {
  position: fixed;
  right: 18px;
  top: 42%;
  z-index: 15;
  display: grid;
  gap: 8px;
}

.elevator a,
.back-top {
  width: 48px;
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--text);
  border-radius: 8px;
  font-size: .86rem;
  box-shadow: var(--shadow);
}

.elevator a.active {
  background: var(--accent);
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 20px;
  opacity: 0;
  pointer-events: none;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

.site-footer {
  margin-top: 50px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 28, .58);
}

.modal.show {
  display: grid;
}

.modal-card {
  width: min(520px, 100%);
  position: relative;
  padding: 28px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: popIn .25s ease both;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}

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

@keyframes logoPulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(4deg) scale(1.06); }
}

@keyframes floatTag {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes growBar {
  from { width: 0; }
  to { width: var(--value); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 860px) {
  .nav-wrap {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    margin-left: auto;
  }

  .main-menu {
    order: 5;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .main-menu.open {
    display: flex;
  }

  .nav-tools {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .profile-grid,
  .slide,
  .project-grid,
  .award-list {
    grid-template-columns: 1fr;
  }

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

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

  .carousel-btn {
    display: none;
  }

  .elevator {
    display: none;
  }
}

@media print {
  .site-header,
  .elevator,
  .back-top,
  .site-footer,
  .contact-form button {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
