:root {
  --ink: #26352f;
  --muted: #748079;
  --paper: #f5f4ef;
  --surface: #fff;
  --sage: #dce8df;
  --green: #5d806d;
  --coral: #df806e;
  --line: #e1e5df;
  --yellow: #f6e6a8;
  --primary: #5d806d;
  --secondary: #748079;
  --accent: #df806e;
  --light: #f5f4ef;
  --dark: #26352f;
  --success: #06d6a0;
  --info: #118ab2;
  --warning: #f6e6a8;
  --danger: #ef476f;
  --gray-100: #f5f4ef;
  --gray-200: #e1e5df;
  --gray-300: #d5dbd6;
  --gray-400: #b4bcb7;
  --gray-500: #829089;
  --gray-600: #748079;
  --gray-700: #4a5851;
  --gray-800: #26352f;
  --gray-900: #1a2420;
  --border-radius: 16px;
  --box-shadow: 0 6px 12px rgba(38, 53, 47, 0.08);
  --box-shadow-lg: 0 12px 24px rgba(38, 53, 47, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  color: var(--ink);
  background-color: var(--paper);
  position: relative;
  min-height: 100vh;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

a:hover {
  color: var(--green);
}

strong {
  font-weight: 700;
}

/* Flexbox Utilities */
.fx-r {
  display: flex;
  flex-direction: row;
}

.fx-h {
  display: flex;
  flex-direction: column;
}

.fx-ac {
  align-items: center;
}

.fx-bc {
  justify-content: center;
}

.fx-jb {
  justify-content: space-between;
}

.fx-js {
  justify-content: flex-start;
}

.fx-je {
  justify-content: flex-end;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--green);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--box-shadow-lg);
  transition: var(--transition);
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  background-color: #4f6e5d;
  transform: translateY(-3px);
}

/* Shared shell */
.shell {
  max-width: 1080px;
  margin: auto;
  padding: 0 18px;
  width: 100%;
}

/* Header Styles */
.top {
  position: sticky;
  top: 0;
  z-index: 4;
  width: 100%;
  background: rgba(245, 244, 239, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}

.logo img,
.navLogo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.navlinks {
  display: flex;
  gap: 19px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.navlinks a:first-child {
  color: var(--green);
}

.navlinks a:hover {
  color: var(--green);
}

.actions {
  display: flex;
  gap: 8px;
  margin-left: 4px;
}

.icon {
  width: 37px;
  height: 37px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  padding: 0;
  transition: var(--transition);
}

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

/* Legacy nav helpers (other pages) */
.navbar {
  width: 100%;
  background: rgba(245, 244, 239, 0.94);
  border-bottom: 1px solid var(--line);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 19px;
  font-weight: 850;
  color: var(--ink);
  display: flex;
  align-items: center;
  letter-spacing: -0.04em;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
  width: clamp(220px, 50vw, 480px);
  opacity: 1;
  background: var(--surface);
  color: var(--ink);
}

/* 导航栏内的内联搜索仍采用激活展开动画 */
.search-container .search-input {
  width: 0;
  opacity: 0;
  padding: 0;
}

.search-container .search-input.active {
  width: 250px;
  opacity: 1;
  padding: 10px 15px;
  margin-right: 10px;
}

.search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(93, 128, 109, 0.2);
}

/* 搜索按钮样式 */
.search-btn {
  background-color: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background-color: #4f6e5d;
  transform: translateY(-2px);
}

.search-icon,
.menu-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: var(--transition);
  filter: invert(35%) sepia(12%) saturate(600%) hue-rotate(95deg) brightness(90%) contrast(90%);
}

.search-icon:hover,
.menu-icon:hover {
  filter: invert(45%) sepia(20%) saturate(500%) hue-rotate(95deg) brightness(90%) contrast(90%);
  transform: scale(1.1);
}

/* Menu Component */
.menu-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.menu-container.active {
  opacity: 1;
  visibility: visible;
}

.menu-content {
  background-color: white;
  width: 90%;
  max-width: 400px;
  border-radius: var(--border-radius);
  overflow: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: var(--box-shadow-lg);
}

.menu-container.active .menu-content {
  transform: translateY(0);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--sage);
  color: var(--ink);
}

.close-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
  filter: none;
  transition: var(--transition);
}

.close-icon:hover {
  transform: rotate(90deg);
}

.menu-items {
  padding: 20px;
}

.menu-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  font-weight: 600;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  color: var(--green);
  padding-left: 8px;
}

.menu-item::before {
  content: "";
  margin-right: 0;
  opacity: 0;
}

.menu-item:hover::before {
  opacity: 0;
}

/* Main Content */
.main-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
  width: 100%;
}

/* 添加评论表单样式 */
.comment-textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 15px;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(93, 128, 109, 0.2);
}

.comment-btn {
  background-color: var(--green);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.comment-btn:hover {
  background-color: #4f6e5d;
  transform: translateY(-2px);
}

/* Footer */
.footer {
  width: 100%;
  margin-top: 52px;
  background: #e7eee8;
  border-top: 1px solid var(--line);
  padding: 30px 0 42px;
  position: relative;
  color: var(--ink);
}

.footer::before {
  display: none;
}

.footgrid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}

.footgrid p {
  color: var(--muted);
  max-width: 280px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.foot-title {
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 9px;
}

.links {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.links a:hover {
  color: var(--green);
}

.copy {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #829089;
  grid-column: 1 / -1;
}

/* Legacy footer helpers (other pages if needed) */
.footer-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 0;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-logo {
  width: 38px;
  height: 38px;
}

.footer-brand-name {
  font-size: 19px;
  font-weight: 850;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.footer-desc {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 12px;
  max-width: 280px;
  font-size: 13px;
}

.footer-title {
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 9px;
  padding-bottom: 0;
}

.footer-title::after {
  display: none;
}

.footer-nav {
  list-style: none;
}

.footer-nav li {
  margin-bottom: 7px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.footer-link:hover {
  color: var(--green);
  padding-left: 0;
}

.footer-link::before {
  display: none;
}

.footer-info .footer-text {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.footer-bottom {
  padding-top: 14px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.copyright {
  color: #829089;
  font-size: 11px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .nav-container {
    gap: 15px;
  }

  .main-container {
    padding: 0 18px;
    width: 100%;
  }
}

@media (max-width: 992px) {
  .nav-container {
    gap: 15px;
  }

  .main-container {
    padding: 0 18px;
  }

  .footer-content,
  .footgrid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .footgrid > div:first-child,
  .footer-content > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 0 14px;
  }

  .nav {
    height: 62px;
  }

  .navlinks {
    display: none;
  }

  .actions {
    margin-left: auto;
  }

  .logo {
    font-size: 16px;
  }

  .logo span {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .footgrid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .footgrid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .nav-container {
    height: 62px;
    padding: 0 14px;
  }

  .site-title {
    font-size: 16px;
  }

  .search-input.active {
    width: 150px;
    font-size: 0.9rem;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
}

@media (max-width: 576px) {
  .site-title {
    font-size: 15px;
  }

  .search-input.active {
    width: 150px;
    font-size: 0.9rem;
  }
}