:root {
  --sakura-50: #fff5f8;
  --sakura-100: #fde8ee;
  --sakura-200: #fbd0dd;
  --sakura-300: #f8b4c4;
  --sakura-400: #f08fa8;
  --sakura-500: #e86a8a;
  --sakura-600: #d44d70;
  --mint-100: #eef7f2;
  --mint-200: #d8f3e3;
  --mint-300: #b7e4c7;
  --blue-100: #eef2fb;
  --blue-200: #dde8fb;
  --blue-300: #c5d8f8;
  --ink-900: #2b2430;
  --ink-700: #4a4152;
  --ink-500: #6f6578;
  --ink-300: #9a90a3;
  --bg: #fffafc;
  --bg-alt: #fff5f8;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.65);
  --border: rgba(248, 180, 196, 0.35);
  --border-soft: rgba(43, 36, 48, 0.08);
  --shadow-sm: 0 2px 8px rgba(232, 106, 138, 0.08);
  --shadow-md: 0 8px 28px rgba(232, 106, 138, 0.12);
  --shadow-lg: 0 18px 48px rgba(212, 77, 112, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17141b;
    --bg-alt: #1d1922;
    --surface: #221d29;
    --surface-glass: rgba(34, 29, 41, 0.62);
    --ink-900: #f4eef7;
    --ink-700: #d9d0e2;
    --ink-500: #a99db6;
    --ink-300: #7d7288;
    --border: rgba(248, 180, 196, 0.22);
    --border-soft: rgba(255, 255, 255, 0.08);
    --sakura-50: #2a1f28;
    --sakura-100: #33242e;
    --sakura-200: #432c39;
    --mint-100: #1c2621;
    --mint-200: #223029;
    --blue-100: #1c2029;
    --blue-200: #232a38;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-700);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(248, 180, 196, 0.18), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(183, 228, 199, 0.16), transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  color: var(--ink-900);
  line-height: 1.4;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.08rem, 2.2vw, 1.3rem); }

p { margin: 0 0 1em; }

a {
  color: var(--sakura-600);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--sakura-500);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

ul, ol { margin: 0 0 1em; padding-left: 1.3em; }

blockquote {
  margin: 0 0 1.2em;
  padding: 1.1em 1.4em;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 4px solid var(--sakura-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--ink-700);
  font-style: normal;
}

blockquote p { margin: 0; }

address { font-style: normal; }

time {
  color: var(--ink-300);
  font-size: 0.9em;
}

::selection {
  background: var(--sakura-300);
  color: #fff;
}

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

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(232, 106, 138, 0.06);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink-900);
  text-decoration: none;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.logo:hover { text-decoration: none; color: var(--sakura-600); }

.logo svg {
  transition: transform 0.5s var(--ease);
  filter: drop-shadow(0 2px 6px rgba(232, 106, 138, 0.3));
}

.logo:hover svg { transform: rotate(18deg) scale(1.06); }

#site-header nav { flex: 1 1 auto; }

#site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

#site-header nav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink-700);
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#site-header nav a:hover,
#site-header nav a:focus-visible {
  background: linear-gradient(135deg, var(--sakura-100), var(--mint-100));
  color: var(--sakura-600);
  text-decoration: none;
  transform: translateY(-1px);
}

#site-header form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#site-header input[type="search"] {
  width: 180px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: width 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#site-header input[type="search"]::placeholder { color: var(--ink-300); }

#site-header input[type="search"]:focus {
  width: 220px;
  outline: none;
  border-color: var(--sakura-400);
  box-shadow: 0 0 0 4px rgba(248, 180, 196, 0.25);
}

#site-header button[type="submit"] {
  padding: 8px 18px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--sakura-400), var(--sakura-600));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232, 106, 138, 0.3);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#site-header button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(232, 106, 138, 0.42);
}

#site-header button[type="submit"]:active { transform: translateY(0); }

/* ---------- Layout ---------- */
main {
  display: block;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section {
  margin: 0 0 32px;
  padding: clamp(20px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.7s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% entry 40%;
}

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

@supports not (animation-timeline: view()) {
  main > section { animation: none; opacity: 1; }
}

/* ---------- Hero ---------- */
#hero {
  position: relative;
  margin-top: 24px;
  padding: clamp(24px, 5vw, 56px) clamp(20px, 5vw, 56px);
  background:
    linear-gradient(135deg,
      rgba(248, 180, 196, 0.55) 0%,
      rgba(253, 232, 238, 0.85) 35%,
      rgba(238, 247, 242, 0.9) 70%,
      rgba(221, 232, 251, 0.85) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}

#hero::before,
#hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  opacity: 0.7;
  pointer-events: none;
}

#hero::before {
  width: 340px;
  height: 340px;
  top: -120px;
  right: -80px;
  background: var(--sakura-300);
  animation: floaty 12s ease-in-out infinite;
}

#hero::after {
  width: 300px;
  height: 300px;
  bottom: -140px;
  left: -60px;
  background: var(--mint-300);
  animation: floaty 15s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 18px) scale(1.08); }
}

.hero-slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.slide {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.slide:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--shadow-lg);
}

.slide svg { width: 100%; height: auto; display: block; }

#hero h1 {
  max-width: 900px;
  background: linear-gradient(120deg, var(--sakura-600), #b06a9a 55%, #5f8fb8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--sakura-600);
}

.hero-lead {
  max-width: 860px;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: var(--ink-700);
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  margin: 6px 12px 6px 0;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--sakura-400), var(--sakura-600));
  box-shadow: 0 8px 22px rgba(232, 106, 138, 0.35);
}

.btn-primary:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(232, 106, 138, 0.5);
}

.btn-secondary {
  color: var(--sakura-600);
  background: var(--surface-glass);
  border: 1.5px solid var(--sakura-300);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  color: var(--sakura-600);
  text-decoration: none;
  transform: translateY(-3px);
  background: var(--sakura-50);
  box-shadow: var(--shadow-md);
}

/* ---------- Breadcrumb & Anchor nav ---------- */
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--ink-500);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--sakura-400);
}

.anchor-nav {
  padding: 14px 16px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.anchor-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.anchor-nav a {
  display: inline-block;
  padding: 5px 14px;
  font-size: 0.85rem;
  color: var(--ink-700);
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.25s var(--ease);
}

.anchor-nav a:hover,
.anchor-nav a:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--sakura-400), var(--sakura-600));
  border-color: transparent;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 106, 138, 0.28);
}

/* ---------- Content cards & articles ---------- */
main > section > h2 {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

main > section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sakura-400), var(--mint-300));
}

article {
  margin: 0 0 18px;
  padding: 20px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

article h3 { margin-bottom: 6px; }

article p:last-child { margin-bottom: 0; }

article a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

article a::after {
  content: " →";
  transition: margin 0.25s var(--ease);
}

article a:hover::after { margin-left: 4px; }

#cases article,
#news article,
#articles article {
  background: linear-gradient(135deg, var(--surface), var(--sakura-50));
}

#articles article:nth-child(3n+2) {
  background: linear-gradient(135deg, var(--surface), var(--mint-100));
}

#articles article:nth-child(3n) {
  background: linear-gradient(135deg, var(--surface), var(--blue-100));
}

/* ---------- Contact ---------- */
#contact address {
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--sakura-50), var(--mint-100));
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

#contact address p {
  margin: 0 0 8px;
  word-break: break-word;
}

#contact address p:last-child { margin-bottom: 0; }

/* ---------- Sitemap & links ---------- */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap li,
#links li { margin: 0; }

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.88rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  transition: all 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: var(--sakura-600);
  border-color: var(--sakura-300);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

/* ---------- Aside & author ---------- */
aside {
  margin: 0 0 32px;
  padding: 22px 26px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

aside h2 { font-size: 1.1rem; }

#author-info p { margin: 0 0 6px; }

/* ---------- Footer ---------- */
footer {
  background: linear-gradient(180deg, var(--bg-alt), var(--sakura-100));
  border-top: 1px solid var(--border);
  padding: 40px 20px 56px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-500);
}

.footer-inner p { margin: 0 0 8px; }

.footer-inner nav ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

.footer-inner nav a {
  color: var(--ink-700);
  font-size: 0.86rem;
}

.footer-inner nav a:hover { color: var(--sakura-600); }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--sakura-400), var(--sakura-600));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(232, 106, 138, 0.4);
  opacity: 0.92;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.3s var(--ease);
}

#back-to-top:hover {
  transform: translateY(-4px);
  opacity: 1;
  box-shadow: 0 14px 30px rgba(232, 106, 138, 0.55);
}

#back-to-top:active { transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .header-inner { gap: 12px; }
  #site-header nav { order: 3; flex-basis: 100%; }
  #site-header nav ul { justify-content: center; }
  #site-header form { margin-left: auto; }
  #site-header input[type="search"] { width: 150px; }
  #site-header input[type="search"]:focus { width: 180px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; line-height: 1.75; }
  .header-inner { padding: 10px 14px; }
  #site-header nav a { padding: 5px 10px; font-size: 0.84rem; }
  #site-header input[type="search"] { width: 120px; }
  #site-header input[type="search"]:focus { width: 150px; }
  #site-header button[type="submit"] { padding: 8px 14px; }
  main { padding: 0 14px 32px; }
  main > section { padding: 20px 16px; border-radius: var(--radius-md); }
  #hero { padding: 24px 18px; border-radius: var(--radius-lg); }
  .hero-slider { grid-template-columns: 1fr; }
  .btn-primary, .btn-secondary { display: block; text-align: center; margin: 8px 0; }
  article { padding: 16px 16px; }
  #back-to-top { right: 12px; bottom: 16px; padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  #site-header, #back-to-top, .anchor-nav, .breadcrumb, footer nav { display: none; }
  body { background: #fff; color: #000; }
  main > section { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}