/* 兴同学 · V0.1
   配色、字号、间距集中在这里，方便统一调整 */

:root {
  --bg: #FAF9F6;
  --ink: #242827;
  --text: #4C514E;
  --muted: #777B78;
  --green: #243B34;
  --green-deep: #1D2F29;
  --accent: #D9A475;
  --line: #EBE8E2;
  --card-border: #EDEAE3;
  --sage: #EFF2EA;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
}

.wrap {
  width: min(1100px, calc(100% - 80px));
  margin-inline: auto;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--green);
  color: #F7F6F1;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 249, 246, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: auto;
  height: 26px;
}

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

.nav a {
  position: relative;
  padding: 6px 0;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav a.is-active {
  color: var(--ink);
  font-weight: 500;
}

.nav a.is-active::after {
  width: 18px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  width: 19px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 4px max(20px, calc((100% - 1100px) / 2)) 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.nav-panel a {
  display: block;
  padding: 14px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}

.nav-panel a + a {
  border-top: 1px solid var(--line);
}

.nav-panel a:hover,
.nav-panel a.is-active {
  color: var(--ink);
}

/* ---------- 首屏 ---------- */

.hero {
  padding: 42px 0 52px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.98fr);
  gap: 56px;
  align-items: center;
}

.hero-title {
  margin-bottom: 22px;
  font-size: clamp(32px, 4.1vw, 44px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.hero-title .mark {
  position: relative;
  display: inline-block;
}

.hero-title .mark::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -3px;
  height: 9px;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cpath d='M3 8C32 3.4 74 2 117 5.4' fill='none' stroke='%23D9A475' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.hero-text p {
  max-width: 440px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.95;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--green);
  color: #F7F6F1;
}

.btn-primary:hover {
  background: var(--green-deep);
}

.btn-ghost {
  border-color: #E1DED7;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: #C9C5BC;
}

.btn .arrow {
  transition: transform 0.2s ease;
}

.btn:hover .arrow {
  transform: translateX(2px);
}

.hero-media {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #EFE6D6;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- 区块通用 ---------- */

.section {
  padding: 36px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head h2 {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-head h2::before {
  content: "";
  width: 3px;
  height: 17px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--green);
}

.section-note {
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.section-sub {
  margin: 6px 0 0 13px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- 项目卡片 ---------- */

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

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #FFFFFF;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

a.project:hover {
  border-color: #D9D4C9;
  transform: translateY(-2px);
}

.project.has-qr:hover {
  border-color: #D9D4C9;
  transform: translateY(-2px);
}

.project-open {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.project-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.tone-sage {
  background: #EAF1E6;
  color: #5F7D62;
}

.tone-sand {
  background: #F7EBDC;
  color: #B98550;
}

.tone-rose {
  background: #F6E7E3;
  color: #BF7E72;
}

.project-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.project-desc {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.chip {
  padding: 3px 9px;
  border-radius: 6px;
  background: #F5F3EE;
  color: #6D736F;
  font-size: 12px;
  line-height: 1.7;
}

.project-go {
  color: var(--muted);
  font-size: 15px;
  transition: transform 0.2s ease, color 0.2s ease;
}

a.project:hover .project-go {
  color: var(--green);
  transform: translateX(3px);
}

.project.has-qr:hover .project-go {
  color: var(--green);
  transform: translateX(3px);
}

.project-soon {
  color: #A5A8A4;
  font-size: 12px;
}

/* ---------- 随便写写 ---------- */

.note-list {
  max-width: 760px;
}

.note {
  padding: 24px 0;
}

.note + .note {
  border-top: 1px solid #F0EDE7;
}

.note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #9A9D99;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.note-tag {
  color: var(--muted);
}

.note-tag::before {
  content: "·";
  margin-right: 6px;
  color: #C6C8C4;
}

.note-title {
  margin-top: 7px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.6;
}

.note-content {
  margin-top: 8px;
  color: #3C403E;
  font-size: 14.5px;
  line-height: 1.9;
  white-space: pre-line;
}

.note-title + .note-content {
  margin-top: 4px;
}

.note-link {
  display: inline-block;
  margin-top: 10px;
  border-bottom: 1px solid rgba(36, 59, 52, 0.18);
  color: var(--green);
  font-size: 13.5px;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.note-link:hover {
  border-color: var(--green);
}

/* ---------- 一起玩玩 ---------- */

.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  padding: 32px 36px;
  border-radius: 16px;
  background: var(--sage);
}

.cta-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.cta-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 600;
}

.cta-title svg {
  flex: none;
  color: var(--green);
}

.cta-desc {
  margin-top: 9px;
  color: #58605A;
  font-size: 14.5px;
  line-height: 1.8;
}

.cta .btn {
  position: relative;
  z-index: 1;
  flex: none;
}

.cta-hills {
  position: absolute;
  right: -10px;
  bottom: -6px;
  width: 300px;
  height: 150px;
  opacity: 0.85;
  pointer-events: none;
}

/* ---------- 关于 ---------- */

.section-about {
  padding-top: 40px;
}

.about-text p {
  max-width: 680px;
  color: var(--text);
  font-size: 15.5px;
  line-height: 2;
}

.about-text p + p {
  margin-top: 14px;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 20px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-brand .brand {
  font-size: 16px;
}

.footer-brand .brand img {
  width: auto;
  height: 22px;
}

.footer-tagline {
  color: var(--muted);
  font-size: 12.5px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: #D8D5CF;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.footer-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.wechat-copy {
  cursor: pointer;
  text-decoration: underline dotted #C9C6BF;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.wechat-copy:hover {
  color: var(--ink);
}

.wechat-copy.is-copied {
  color: var(--green);
  text-decoration-color: transparent;
}

.footer-link.is-disabled {
  color: #B4B6B2;
  cursor: default;
}

.icp {
  margin-top: 18px;
  color: #A9ACA8;
  font-size: 12px;
}

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

.icp a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 32, 30, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  width: min(360px, 100%);
  padding: 28px 26px 24px;
  border-radius: 16px;
  background: #FFFFFF;
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 24, 22, 0.16);
  animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #F4F2ED;
  color: var(--ink);
}

.qr-title {
  font-size: 17px;
  font-weight: 600;
}

.qr-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.qr-frame {
  width: 204px;
  margin: 18px auto 0;
  padding: 10px;
  border: 1px solid #ECE7DD;
  border-radius: 12px;
  background: #F7F5EF;
}

.qr-frame img {
  width: 100%;
  border-radius: 8px;
}

.qr-note {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #FBF3E8;
  color: #A87A4E;
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .wrap {
    width: calc(100% - 48px);
  }

  .hero {
    padding: 28px 0 40px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .hero-copy {
    max-width: 580px;
  }

  .hero-text p {
    max-width: 560px;
  }

  .section {
    padding: 32px 0;
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 780px) {
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-foot {
    padding-top: 14px;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 26px 24px;
  }

  .cta-hills {
    width: 230px;
    height: 120px;
    opacity: 0.6;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: calc(100% - 40px);
  }

  html {
    scroll-padding-top: 82px;
  }

  .header-inner {
    height: 64px;
  }

  .brand {
    font-size: 18px;
  }

  .brand img {
    height: 24px;
    width: auto;
  }

  .hero-title {
    margin-bottom: 20px;
    font-size: 30px;
  }

  .hero-text p {
    font-size: 15px;
    line-height: 1.9;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .btn {
    height: 42px;
    padding: 0 18px;
    font-size: 13.5px;
  }

  .section {
    padding: 26px 0;
  }

  .section-head {
    margin-bottom: 16px;
  }

  .section-head h2 {
    font-size: 18px;
  }

  .note {
    padding: 20px 0;
  }

  .note-title {
    font-size: 15.5px;
  }

  .note-content {
    font-size: 14px;
    line-height: 1.85;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .footer-links {
    gap: 20px;
  }

  .about-text p {
    font-size: 15px;
    line-height: 1.95;
  }

  .modal {
    padding: 20px;
  }

  .modal-dialog {
    padding: 26px 20px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 首页：文章列表补充 ---------- */

.note-title-link {
  color: inherit;
  text-decoration: none;
}

.note-title-link:hover .note-title {
  color: var(--green);
}

.section-more {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.section-more:hover {
  color: var(--ink);
}

/* ---------- 文章归档页 ---------- */

.archive {
  padding-top: 48px;
}

.archive-title {
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.archive-title::before {
  content: "";
  width: 3px;
  height: 19px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--green);
}

.note-cards {
  max-width: 760px;
}

.note-card a {
  display: block;
  padding: 22px 0;
  border-top: 1px solid #F0EDE7;
  color: inherit;
  text-decoration: none;
}

.note-card:first-child a {
  border-top: 0;
  padding-top: 6px;
}

.note-card-title {
  margin-top: 7px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  transition: color 0.15s ease;
}

.note-card a:hover .note-card-title {
  color: var(--green);
}

.note-card-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- 文章详情页 ---------- */

.article {
  max-width: 720px;
  padding: 48px 0 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9A9D99;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.article-title {
  margin: 12px 0 26px;
  font-size: clamp(24px, 3.2vw, 31px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.005em;
}

.article-body {
  color: var(--text);
  font-size: 16px;
  line-height: 2;
}

.article-body p {
  margin: 0 0 18px;
  white-space: pre-line;
}

.article-body h2 {
  margin: 34px 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.article-body h3 {
  margin: 28px 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.article-body ul,
.article-body ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body blockquote {
  margin: 0 0 18px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.article-body code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #F5F3EE;
  font-size: 0.9em;
}

.article-body pre {
  margin: 0 0 18px;
  padding: 16px 18px;
  overflow: auto;
  border-radius: 10px;
  background: var(--ink);
  color: #F7F6F1;
  font-size: 13px;
  line-height: 1.75;
}

.article-body pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.article-body img {
  margin: 6px 0 18px;
  border-radius: 10px;
}

.article-body a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 59, 52, 0.18);
}

.article-body a:hover {
  border-color: var(--green);
}

.article-link {
  margin-top: 26px;
}

.article-link a,
.article-back a {
  color: var(--green);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(36, 59, 52, 0.18);
}

.article-link a:hover,
.article-back a:hover {
  border-color: var(--green);
}

.article-back {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- 404 ---------- */

.notfound {
  padding: 90px 0 110px;
  text-align: center;
}

.notfound-code {
  color: var(--green);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.notfound-desc {
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 560px) {
  .article {
    padding-top: 34px;
  }

  .article-body {
    font-size: 15.5px;
    line-height: 1.95;
  }

  .archive {
    padding-top: 34px;
  }
}

