/* 温暖杂志风格（统一版） */
* ,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f6efe6;
  --bg-soft: #fbf7f1;
  --surface: #fffaf4;
  --surface-2: #f7efe4;
  --text: #3d2f25;
  --text-soft: #6f5b4b;
  --primary: #a86a3d;
  --primary-deep: #8d5631;
  --line: rgba(103, 75, 55, 0.2);
  --shadow-soft: 0 12px 30px rgba(88, 57, 35, 0.14);
  --shadow-card: 0 14px 34px rgba(86, 58, 40, 0.12);
  --radius-lg: 22px;
  --radius-md: 14px;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, #f9f3ea, #f6efe6 45%, #f2e8db 100%),
    repeating-linear-gradient(
      0deg,
      rgba(122, 96, 76, 0.016) 0px,
      rgba(122, 96, 76, 0.016) 1px,
      transparent 1px,
      transparent 3px
    );
  background-blend-mode: normal, multiply;
  color: var(--text);
  line-height: 1.68;
}

h1,
h2,
h3,
.logo {
  font-family: "Noto Serif SC", "Songti SC", serif;
  letter-spacing: 0.02em;
}

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

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

.container {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1.7rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 86, 49, 0.25);
  background: linear-gradient(135deg, #b77848, #99603a);
  color: #fff8ef;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(141, 86, 49, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(141, 86, 49, 0.42);
  filter: saturate(1.06);
}

.btn-primary:active {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(250, 244, 235, 0.84);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.78rem 0;
}

.logo {
  font-size: 1.64rem;
  font-weight: 700;
  color: #3f2a1b;
}

.logo span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.nav a {
  position: relative;
  padding-block: 0.22rem;
  color: var(--text-soft);
  font-weight: 500;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: #b5784a;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.nav a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7efe5;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background-color: #6f4a30;
}

.hero-section {
  padding-top: 96px;
  padding-bottom: 72px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 3rem;
}

.hero-kicker {
  margin: 0 0 0.72rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a6a53;
}

.hero-text h1 {
  font-size: clamp(2.1rem, 3vw + 1.2rem, 3.05rem);
  margin-bottom: 0.78rem;
  color: #2f2016;
  line-height: 1.22;
}

.hero-text h1 span {
  color: var(--primary);
}

.hero-lead {
  color: var(--text-soft);
  max-width: 520px;
  margin-bottom: 1.6rem;
  line-height: 1.9;
  letter-spacing: 0.014em;
  text-wrap: pretty;
}

.hero-lead::first-letter {
  float: left;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.62em;
  line-height: 1.06;
  margin-right: 0.05em;
  margin-top: 0.01em;
  color: #8f5a34;
}

.carousel {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(77, 50, 32, 0.24);
  background: #f5e9dc;
  border: 1px solid rgba(124, 84, 56, 0.15);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(8%);
  transition: opacity 0.7s ease, transform 0.7s ease;
  display: flex;
  flex-direction: column;
}

.carousel-slide img {
  height: 320px;
  object-fit: cover;
}

.carousel-slide.active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

.carousel-caption {
  padding: 1rem 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: #543a28;
  background: linear-gradient(to bottom, #fdf8f1, #f4e8db);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: rgba(93, 61, 40, 0.7);
  color: #fff4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(66, 43, 28, 0.32);
}

.carousel-btn:hover {
  background: rgba(93, 61, 40, 0.9);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(160, 120, 88, 0.58);
  cursor: pointer;
  transition: width 0.15s ease, background 0.15s ease;
}

.carousel-dot.active {
  width: 18px;
  background: #a86a3d;
}

.section-block { padding: 58px 0; }
.section-alt { background: rgba(255, 250, 243, 0.68); }

.section-title {
  font-size: 1.64rem;
  margin-bottom: 0.52rem;
  color: #2d2016;
}

.section-description {
  color: var(--text-soft);
  max-width: 650px;
}

.grid-portfolio {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(138, 97, 69, 0.16);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
  min-height: 170px;
  padding: 1.05rem 1.2rem 1.24rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.12rem;
  color: #3f2b1d;
}

.card p {
  margin: 0;
  font-size: 0.96rem;
  color: #765d4b;
  line-height: 1.88;
  letter-spacing: 0.012em;
  text-wrap: pretty;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(79, 52, 35, 0.2);
}

.contact-info a {
  color: #9a5d35;
  font-weight: 600;
}

.site-footer {
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
  background: rgba(249, 241, 232, 0.93);
}

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

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6f4a30;
  color: #fff7ee;
  box-shadow: 0 8px 18px rgba(88, 57, 35, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  background: #a86a3d;
  box-shadow: 0 12px 24px rgba(88, 57, 35, 0.36);
}

.footer-meta {
  font-size: 0.86rem;
  color: #7b6453;
}

.chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(141, 86, 49, 0.26);
  background: linear-gradient(145deg, #b67646, #985f39);
  color: #fffaf3;
  box-shadow: 0 14px 32px rgba(99, 62, 38, 0.38);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: transform 0.15s ease;
}

.chat-toggle:hover { transform: translateY(-2px) scale(1.03); }

.chat-widget {
  position: fixed;
  right: 16px;
  bottom: 88px;
  width: min(380px, 100% - 32px);
  height: 560px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 248, 239, 0.98);
  border: 1px solid rgba(141, 99, 70, 0.2);
  box-shadow: 0 26px 62px rgba(75, 49, 32, 0.34);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 35;
}

.chat-widget.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  padding: 12px 14px;
  background: linear-gradient(135deg, #b77747, #935a36);
  color: #fff9f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header strong { display: block; font-size: 0.98rem; }

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  opacity: 0.95;
}

.chat-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: #56b465;
}

.chat-header-actions { display: flex; gap: 6px; }

.chat-header-actions button {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 248, 239, 0.18);
  color: #fff9f0;
  cursor: pointer;
  font-size: 0.8rem;
}

.chat-header-actions button:hover {
  background: rgba(255, 248, 239, 0.3);
}

.chat-body {
  flex: 1;
  padding: 10px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #fffaf4, #fbf2e7);
}

.chat-messages { flex: 1; overflow-y: auto; padding-right: 4px; }
.message-row { display: flex; margin-bottom: 8px; }
.message-row.ai { justify-content: flex-start; }
.message-row.user { justify-content: flex-end; }

.message-bubble {
  max-width: 76%;
  border-radius: 18px;
  padding: 8px 12px 9px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.message-row.ai .message-bubble {
  border-bottom-left-radius: 4px;
  background: #fffdf8;
  color: #4a3526;
  border: 1px solid rgba(148, 109, 82, 0.16);
  box-shadow: 0 8px 18px rgba(86, 58, 40, 0.1);
}

.message-row.user .message-bubble {
  border-bottom-right-radius: 4px;
  background: #a86a3d;
  color: #fff8ef;
  box-shadow: 0 10px 22px rgba(111, 74, 48, 0.28);
}

.typing-indicator { display: inline-flex; align-items: center; gap: 3px; }
.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #aa8567;
  animation: typingBlink 1.1s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBlink {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}

.chat-footer {
  border-top: 1px solid rgba(160, 120, 88, 0.25);
  padding: 8px 10px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: #fbf1e6;
}

.chat-input {
  flex: 1;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(163, 124, 94, 0.34);
  padding: 7px 9px;
  font-family: inherit;
  font-size: 0.9rem;
  max-height: 96px;
  outline: none;
  background: #fffdf9;
}

.chat-input:focus {
  border-color: #b17244;
  box-shadow: 0 0 0 1px rgba(177, 114, 68, 0.25);
}

.chat-send {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #a86a3d;
  color: #fff8ef;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: 0 8px 18px rgba(111, 74, 48, 0.28);
}

.chat-send:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.chat-send:not(:disabled):hover { background: #91592f; }

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(160, 120, 88, 0.58);
  border-radius: 999px;
}

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-section { padding-top: 92px; }
  .hero-text { order: 2; }
  .carousel { order: 1; }
  .grid-portfolio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .header-inner { padding-block: 0.6rem; }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    padding: 0.6rem 1rem 0.9rem;
    background: rgba(250, 243, 234, 0.98);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    transform-origin: top;
    transform: scaleY(0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .nav.open {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }

  .nav-toggle { display: inline-flex; }
  .hero-inner { gap: 2.2rem; }
  .carousel-slide img { height: 260px; }
  .grid-portfolio { grid-template-columns: minmax(0, 1fr); }
  .site-footer { padding-bottom: 24px; }

  .chat-widget {
    right: 10px;
    left: 10px;
    width: auto;
    height: min(520px, 80vh);
  }
}
