:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b7a;
  --accent: #ff9f1c;
  --accent-2: #f72585;
  --bg: #fdf7f8;
  --bg-elevated: #ffffff;
  --bg-soft: #fff0f2;
  --text: #241a1c;
  --text-muted: #6b5a5e;
  --text-faint: #9a888c;
  --border: rgba(230, 57, 70, 0.14);
  --border-strong: rgba(230, 57, 70, 0.28);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow-sm: 0 2px 8px rgba(120, 40, 55, 0.07);
  --shadow: 0 10px 30px rgba(120, 40, 55, 0.11);
  --shadow-lg: 0 22px 60px rgba(120, 40, 55, 0.18);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #ff5f6d 0%, #e63946 42%, #b5179e 100%);
  --grad-accent: linear-gradient(120deg, #ff9f1c 0%, #f72585 100%);
  --grad-soft: linear-gradient(160deg, #fff0f2 0%, #fdf7f8 60%, #f3e8ff 100%);
  --maxw: 1180px;
  --space: clamp(16px, 3vw, 32px);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff6b7a;
    --primary-dark: #e63946;
    --primary-light: #ff8f9a;
    --accent: #ffb347;
    --accent-2: #ff5fa2;
    --bg: #14101a;
    --bg-elevated: #1d1826;
    --bg-soft: #241d30;
    --text: #f6eef2;
    --text-muted: #c3b4be;
    --text-faint: #8d7f8a;
    --border: rgba(255, 107, 122, 0.18);
    --border-strong: rgba(255, 107, 122, 0.34);
    --glass: rgba(36, 29, 48, 0.55);
    --glass-strong: rgba(36, 29, 48, 0.82);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.6);
    --grad-hero: linear-gradient(135deg, #7a1030 0%, #4a0f4f 55%, #1c0f2e 100%);
    --grad-accent: linear-gradient(120deg, #ffb347 0%, #ff5fa2 100%);
    --grad-soft: linear-gradient(160deg, #1d1826 0%, #14101a 60%, #1a1226 100%);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image: var(--grad-soft);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent-2);
}

:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  margin: 0 0 0.6em;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 {
  font-size: clamp(1.75rem, 4.2vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--grad-accent);
}

h3 {
  font-size: clamp(1.12rem, 2.2vw, 1.4rem);
  color: var(--primary-dark);
}

h4 {
  font-size: 1.05rem;
  color: var(--text);
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.4em;
}

li::marker {
  color: var(--primary);
}

blockquote {
  margin: 0 0 1.2em;
  padding: 18px 22px;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

blockquote:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

blockquote p {
  margin: 0;
  color: var(--text);
  font-style: italic;
}

time {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ============ HEADER ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(120, 40, 55, 0.06);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(230, 57, 70, 0.35);
  transition: transform 0.5s var(--ease);
}

.brand:hover svg {
  transform: rotate(-12deg) scale(1.08);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary-dark);
  white-space: nowrap;
}

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

#site-header nav a {
  display: inline-block;
  padding: 7px 13px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

#site-header nav a:hover,
#site-header nav a:focus-visible {
  color: #fff;
  background: var(--grad-hero);
  transform: translateY(-2px);
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space) 60px;
}

main > section {
  margin: 0 0 28px;
  padding: clamp(20px, 3.4vw, 40px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 0.7s var(--ease) both;
}

main > section:nth-of-type(2n) {
  animation-delay: 0.06s;
}

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

/* ============ HERO ============ */
#hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--grad-hero);
  border: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: 0;
  padding: clamp(40px, 7vw, 84px) clamp(20px, 4vw, 56px);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

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

#hero::before {
  width: 420px;
  height: 420px;
  top: -160px;
  right: -100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34) 0%, transparent 70%);
  animation: float 12s ease-in-out infinite;
}

#hero::after {
  width: 340px;
  height: 340px;
  bottom: -140px;
  left: -80px;
  background: radial-gradient(circle, rgba(255, 159, 28, 0.4) 0%, transparent 70%);
  animation: float 16s ease-in-out infinite reverse;
}

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

#hero h1 {
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  max-width: 900px;
}

#hero .lead {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  max-width: 820px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  will-change: transform;
}

.btn-primary {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--primary-dark);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-4px) scale(1.03);
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

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

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

/* ============ ANCHOR NAV ============ */
.anchor-nav {
  margin: 18px 0 28px;
  padding: 14px 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.anchor-nav a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.3s var(--ease);
}

.anchor-nav a:hover,
.anchor-nav a:focus-visible {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(247, 37, 133, 0.28);
}

/* ============ ARTICLE CARDS ============ */
article {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

article::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-accent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

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

article:hover::after {
  opacity: 1;
}

article h3 {
  margin-bottom: 0.4em;
  transition: color 0.3s var(--ease);
}

article:hover h3 {
  color: var(--accent-2);
}

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

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

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

article a:hover::after {
  transform: translateX(5px);
}

/* ============ CONTACT LIST ============ */
#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

#contact > ul > li {
  margin: 0;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#contact > ul > li:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* ============ SITEMAP ============ */
#sitemap ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

#sitemap ul li {
  margin: 0;
}

#sitemap a {
  display: block;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.3s var(--ease);
}

#sitemap a:hover,
#sitemap a:focus-visible {
  color: #fff;
  background: var(--grad-hero);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(230, 57, 70, 0.28);
}

/* ============ FOOTER ============ */
footer {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--border);
  padding: clamp(32px, 5vw, 56px) var(--space) 24px;
  margin-top: 20px;
}

footer > section {
  max-width: var(--maxw);
  margin: 0 auto 28px;
}

footer h2 {
  font-size: 1.1rem;
  padding-left: 14px;
}

footer h2::before {
  width: 4px;
}

footer h3 {
  font-size: 0.98rem;
  color: var(--text);
  margin-top: 1em;
}

footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

footer ul li {
  margin: 0;
}

footer ul a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
}

footer ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transition: width 0.3s var(--ease);
}

footer ul a:hover {
  color: var(--primary);
}

footer ul a:hover::after {
  width: 100%;
}

footer .copyright {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  html {
    scroll-padding-top: 130px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #site-header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #site-header nav::-webkit-scrollbar {
    display: none;
  }

  #site-header nav ul {
    flex-wrap: nowrap;
    width: max-content;
    padding-bottom: 4px;
  }

  #site-header nav a {
    white-space: nowrap;
  }

  main > section {
    border-radius: var(--radius);
  }

  #hero {
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  article {
    padding: 18px;
  }

  #contact ul,
  #sitemap ul {
    grid-template-columns: 1fr;
  }

  blockquote {
    padding: 14px 16px;
  }
}

/* ============ MOTION PREFERENCES ============ */
@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;
  }
}

/* ============ SCROLL-DRIVEN REVEAL (progressive enhancement) ============ */
@supports (animation-timeline: view()) {
  main > section,
  article,
  blockquote {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 38%;
  }

  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(34px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* ============ SELECTION & SCROLLBAR ============ */
::selection {
  background: var(--primary);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--grad-accent);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-soft);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}