:root {
  --primary: #a8d8ea;
  --secondary: #f8e8f0;
  --bg-main: #fefefe;
  --bg-soft: #f8f9fa;
  --text-main: #333333;
  --text-sub: #666666;
  --line: #e9eef2;
  --card: #ffffff;
  --shadow: 0 10px 24px rgba(168, 216, 234, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  background: linear-gradient(180deg, var(--bg-main) 0%, #f7fbff 45%, #fffafd 100%);
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(0);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-color: var(--line);
}

.nav-wrap {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  margin-bottom: 0.5rem;
}

.about-lead {
  margin: 0 0 0.75rem;
  color: var(--text-sub);
  font-size: 0.95rem;
}

.contact-inline {
  list-style: none;
  padding-left: 0;
}

.contact-inline li {
  margin-bottom: 0.35rem;
}

.form-intro {
  margin: 0 0 0.85rem;
}

.contact-form label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-sub);
}

.btn-lite:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.brand {
  text-decoration: none;
  color: var(--text-main);
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 1.35rem;
}

.menu-toggle {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: var(--text-sub);
  text-decoration: none;
  border-radius: 0.6rem;
  padding: 0.28rem 0.45rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
  background: #f3f8fb;
}

.section {
  padding: 2.3rem 0;
}

@keyframes hero-entrance {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff 0%, #f8fcff 55%, #fff9fc 100%);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2.6vw, 2rem);
  animation: hero-entrance 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: -30% -20%;
  background: radial-gradient(circle at 30% 30%, rgba(168, 216, 234, 0.36), transparent 52%),
    radial-gradient(circle at 70% 65%, rgba(248, 232, 240, 0.36), transparent 54%);
  animation: float-bg 14s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: #79b8d1;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.84rem;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.25;
}

h1 {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: clamp(1.5rem, 5vw, 2rem);
  margin-bottom: 0.8rem;
}

h2 {
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
}

.lead {
  color: var(--text-sub);
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 2.8vw, 1rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
}

.section-head {
  margin-bottom: 0.8rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.tags span {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.36rem 0.74rem;
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.card-grid > * {
  grid-column: span 3;
}

.card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 8px 18px rgba(168, 216, 234, 0.14);
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(168, 216, 234, 0.24);
}

.text-link {
  color: #6aaac5;
  text-decoration: none;
  font-weight: 700;
}

.quote-grid .card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.quote-text {
  margin: 0 0 0.62rem;
}

.quote-tag {
  display: inline-block;
  border-radius: 999px;
  background: #eef8fc;
  color: #5f9cb5;
  font-size: 0.8rem;
  padding: 0.24rem 0.58rem;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.memory-card {
  margin: 0;
  grid-column: span 4;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 18px rgba(168, 216, 234, 0.14);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.memory-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(168, 216, 234, 0.24);
}

.memory-card img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
}

.memory-card figcaption {
  padding: 0.68rem 0.8rem 0.95rem;
  color: var(--text-sub);
  font-size: 0.9rem;
}

.about-grid {
  margin-bottom: 1rem;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
}

.contact-card {
  max-width: 760px;
}

.contact-form {
  display: grid;
  gap: 0.45rem;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: #ffffff;
  color: var(--text-main);
  font: inherit;
  padding: 0.62rem 0.75rem;
}

.btn-lite {
  margin-top: 0.4rem;
  width: fit-content;
  border: 1px solid #bfe1ee;
  border-radius: 0.7rem;
  background: #eef8fc;
  color: #48788d;
  font-weight: 700;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-lite:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(168, 216, 234, 0.24);
}

.load-row {
  margin-top: 1rem;
  text-align: center;
}

.hint-text {
  min-height: 1.2rem;
  color: var(--text-sub);
  font-size: 0.92rem;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--text-sub);
  font-size: 0.92rem;
  padding: 0.9rem 0 1.2rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.2s; }
.reveal-delay-2 { transition-delay: 0.4s; }
.reveal-delay-3 { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .hero-panel {
    animation: none;
  }
}

@keyframes float-bg {
  from {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2%, -1%, 0) scale(1.03);
  }
}

.blog-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.blog-list-item {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.blog-list-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  text-decoration: none;
  color: inherit;
}

.blog-list-link:hover .blog-list-title {
  color: #6aaac5;
}

.blog-list-title {
  font-weight: 700;
  font-size: 1.05rem;
  transition: color 0.25s ease;
}

.blog-list-date {
  color: var(--text-sub);
  font-size: 0.88rem;
}

.blog-list-excerpt {
  margin: 0.45rem 0 0;
  color: var(--text-sub);
  font-size: 0.92rem;
}

.article-wrap {
  max-width: 760px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  color: var(--text-sub);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.article-content {
  font-size: 1rem;
  line-height: 1.75;
}

.markdown-body {
  white-space: normal;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.markdown-body h1 {
  font-size: 1.35rem;
}

.markdown-body h2 {
  font-size: 1.2rem;
}

.markdown-body p {
  margin: 0 0 0.75rem;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 0.75rem;
  padding-left: 1.35rem;
}

.markdown-body pre {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
}

.markdown-body code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: #eef6f9;
  padding: 0.12rem 0.35rem;
  border-radius: 0.35rem;
}

.markdown-body pre code {
  background: none;
  padding: 0;
}

.markdown-body blockquote {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.85rem;
  border-left: 3px solid var(--primary);
  color: var(--text-sub);
  background: #fafcfd;
}

.md-fallback {
  white-space: normal;
}

.works-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.filter-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  border-color: #bfe1ee;
  color: var(--text-main);
}

.filter-btn.active {
  border-color: #bfe1ee;
  background: #eef8fc;
  color: #48788d;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.portfolio-card {
  grid-column: span 4;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 8px 18px rgba(168, 216, 234, 0.14);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(168, 216, 234, 0.24);
}

.portfolio-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.portfolio-card h3 {
  font-size: 1.02rem;
  margin: 0.65rem 0.85rem 0.25rem;
}

.portfolio-card p {
  margin: 0 0.85rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-sub);
}

.portfolio-card.is-hidden {
  display: none;
}

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(40, 55, 65, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.work-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.work-modal-inner {
  position: relative;
  width: min(520px, 100%);
  max-height: min(80vh, 560px);
  overflow-y: auto;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.work-modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--bg-soft);
  color: var(--text-main);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.work-modal-close:hover {
  background: #eef8fc;
}

.work-modal-title {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 1.2rem;
  margin: 0 2rem 0.65rem 0;
}

.work-modal-detail {
  margin: 0;
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .portfolio-card {
    grid-column: span 6;
  }
}

@media (max-width: 680px) {
  .portfolio-card {
    grid-column: span 12;
  }
}

.comments-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.comment-form {
  margin-top: 0.75rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
  background: #fff;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-sub);
}

.comment-text {
  margin: 0;
  font-size: 0.95rem;
}

.form-error {
  color: #b54d4d;
  font-size: 0.92rem;
}

.form-success {
  color: #3d7a5c;
  font-size: 0.92rem;
}

.admin-hint {
  margin-top: 1rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-table {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.admin-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.btn-danger {
  border: 1px solid #e8c4c4;
  border-radius: 0.65rem;
  background: #fff5f5;
  color: #a34a4a;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: #ffecec;
}

.message-row {
  align-items: flex-start;
}

.message-row .message-body {
  flex: 1;
  min-width: 0;
}

.message-text {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--text-main);
}

.admin-post-form textarea {
  min-height: 8rem;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text-sub);
}

@media (max-width: 900px) {
  .card-grid > *,
  .memory-card {
    grid-column: span 6;
  }
}

@media (max-width: 680px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.72rem 4%;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
  }

  .nav.open {
    display: flex;
  }

  .card-grid > *,
  .memory-card {
    grid-column: span 12;
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
