:root {
  --primary: #5B4B8A;
  --primary-light: #7C6BA8;
  --primary-dark: #3D3160;
  --accent: #E8A0BF;
  --accent-light: #F2C4D8;
  --accent-dark: #C77BA0;
  --bg: #F8F6FC;
  --bg-alt: #EFEBF5;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #2A2438;
  --text-secondary: #6B6280;
  --text-muted: #9B93AB;
  --border: rgba(91, 75, 138, 0.12);
  --border-glass: rgba(255, 255, 255, 0.45);
  --shadow-sm: 0 2px 8px rgba(61, 49, 96, 0.06);
  --shadow-md: 0 8px 24px rgba(61, 49, 96, 0.10);
  --shadow-lg: 0 16px 48px rgba(61, 49, 96, 0.14);
  --shadow-glow: 0 0 32px rgba(91, 75, 138, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Noto Serif SC", "Songti SC", serif;
  --max-width: 1200px;
  --header-height: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #9B8BC4;
    --primary-light: #B8A8D8;
    --primary-dark: #7C6BA8;
    --accent: #E8A0BF;
    --accent-light: #F2C4D8;
    --accent-dark: #C77BA0;
    --bg: #12101A;
    --bg-alt: #1A1725;
    --bg-card: rgba(30, 26, 42, 0.78);
    --bg-glass: rgba(30, 26, 42, 0.62);
    --text: #EDEAF4;
    --text-secondary: #B0A8C4;
    --text-muted: #7A7290;
    --border: rgba(155, 139, 196, 0.15);
    --border-glass: rgba(155, 139, 196, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 32px rgba(155, 139, 196, 0.15);
  }
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(91, 75, 138, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(232, 160, 191, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(91, 75, 138, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(ellipse 80% 60% at 10% 0%, rgba(155, 139, 196, 0.10) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 90% 20%, rgba(232, 160, 191, 0.06) 0%, transparent 55%),
      radial-gradient(ellipse 70% 40% at 50% 100%, rgba(155, 139, 196, 0.06) 0%, transparent 60%);
  }
}

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 5px;
  border: 2px solid var(--bg-alt);
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--accent-dark);
}

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

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--accent-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (prefers-color-scheme: dark) {
  h1 {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 40%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width var(--transition-smooth);
}

section:hover > h2::after {
  width: 96px;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

@media (prefers-color-scheme: dark) {
  h3 {
    color: var(--primary-light);
  }
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

header {
  position: relative;
  padding: 0;
  background: linear-gradient(135deg, #3D3160 0%, #5B4B8A 35%, #7C6BA8 65%, #E8A0BF 100%);
  color: #fff;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(232, 160, 191, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

header::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.04), transparent, rgba(232, 160, 191, 0.06), transparent);
  animation: headerRotate 24s linear infinite;
  pointer-events: none;
}

@keyframes headerRotate {
  to { transform: rotate(360deg); }
}

header > h1 {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 0.5rem;
  font-size: clamp(1.6rem, 3.8vw, 2.5rem);
  color: #fff;
  background: none;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease both;
}

header > p {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
  animation: fadeInUp 0.8s 0.15s ease both;
}

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

header nav {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 1.75rem;
  animation: fadeInUp 0.8s 0.3s ease both;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

header nav li {
  flex: 0 0 auto;
}

header nav a {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-bounce),
    box-shadow var(--transition-fast);
  white-space: nowrap;
}

header nav a:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

header nav a:active {
  transform: translateY(0) scale(0.98);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

section {
  margin-bottom: 3rem;
  padding: 2rem 1.75rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--transition-smooth),
    transform var(--transition-smooth),
    border-color var(--transition-smooth);
  opacity: 0;
  transform: translateY(32px);
  animation: sectionReveal 0.7s ease forwards;
}

section:nth-child(odd) {
  animation-delay: 0.05s;
}

section:nth-child(even) {
  animation-delay: 0.1s;
}

@keyframes sectionReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(91, 75, 138, 0.2);
  transform: translateY(-2px);
}

section:target {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

section h3 {
  margin-top: 1.5rem;
}

section h3:first-of-type {
  margin-top: 0.5rem;
}

section ul,
section ol {
  padding-left: 0;
}

section ul li,
section ol li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast), padding-left var(--transition-fast);
}

section ul li:last-child,
section ol li:last-child {
  border-bottom: none;
}

section ul li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
}

section ul li:hover::before {
  transform: scale(1.5);
  box-shadow: 0 0 12px rgba(91, 75, 138, 0.5);
}

section ol {
  counter-reset: item;
}

section ol li {
  counter-increment: item;
}

section ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(91, 75, 138, 0.3);
}

section ul li:hover,
section ol li:hover {
  background: rgba(91, 75, 138, 0.04);
  padding-left: 2rem;
  border-radius: var(--radius-sm);
}

@media (prefers-color-scheme: dark) {
  section ul li:hover,
  section ol li:hover {
    background: rgba(155, 139, 196, 0.06);
  }
}

article {
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-color var(--transition-smooth);
}

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

article:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-md);
  border-color: rgba(91, 75, 138, 0.25);
}

article h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  transition: color var(--transition-fast);
}

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

article time {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0.15rem 0.6rem;
  background: rgba(91, 75, 138, 0.08);
  border-radius: 100px;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  article time {
    background: rgba(155, 139, 196, 0.12);
  }
}

article p {
  margin-bottom: 0.5rem;
  font-size: 0.925rem;
}

article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  background: rgba(91, 75, 138, 0.08);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-bounce),
    gap var(--transition-fast);
}

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

article a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(4px);
}

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

blockquote {
  position: relative;
  margin: 1rem 0;
  padding: 1.25rem 1.5rem 1.25rem 3rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-left-color var(--transition-fast);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  left: 0.75rem;
  top: 0.25rem;
  font-size: 3.5rem;
  font-family: var(--font-serif);
  color: var(--accent);
  opacity: 0.5;
  line-height: 1;
}

blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--primary);
}

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

#contact p {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.925rem;
}

#contact p:last-child {
  border-bottom: none;
}

#contact p::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-top: 0.65rem;
  border-radius: 50%;
  background: var(--accent);
}

#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

#sitemap li,
#links li {
  border-bottom: none;
  padding: 0.4rem 0.75rem;
  background: rgba(91, 75, 138, 0.04);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), transform var(--transition-bounce);
}

@media (prefers-color-scheme: dark) {
  #sitemap li,
  #links li {
    background: rgba(155, 139, 196, 0.06);
  }
}

#sitemap li::before,
#links li::before {
  display: none;
}

#sitemap li:hover,
#links li:hover {
  background: rgba(91, 75, 138, 0.1);
  transform: translateX(4px);
  padding-left: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  #sitemap li:hover,
  #links li:hover {
    background: rgba(155, 139, 196, 0.12);
  }
}

#sitemap a,
#links a {
  font-size: 0.875rem;
  font-weight: 500;
}

#author p {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}

#author p:last-child {
  border-bottom: none;
}

footer {
  position: relative;
  margin-top: 2rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #3D3160 0%, #5B4B8A 50%, #7C6BA8 100%);
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 160, 191, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

footer p {
  position: relative;
  z-index: 1;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

footer p:last-child {
  margin-bottom: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 1024px) {
  :root {
    --max-width: 100%;
  }

  main {
    padding: 1.5rem 1.25rem 3rem;
  }

  section {
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  body {
    font-size: 15px;
  }

  header {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  header > h1 {
    padding: 2.5rem 1.25rem 0.5rem;
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }

  header > p {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.875rem;
  }

  header nav {
    padding: 0 0.75rem 1.25rem;
  }

  header nav ul {
    gap: 0.4rem;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav ul::-webkit-scrollbar {
    display: none;
  }

  header nav a {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  main {
    padding: 1rem 0.875rem 2.5rem;
  }

  section {
    padding: 1.5rem 1.125rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
  }

  h2 {
    font-size: 1.35rem;
  }

  h2::after {
    width: 40px;
    height: 3px;
  }

  h3 {
    font-size: 1.05rem;
  }

  article {
    padding: 1.125rem;
    border-radius: var(--radius-sm);
  }

  blockquote {
    padding: 1rem 1rem 1rem 2.5rem;
  }

  blockquote::before {
    font-size: 2.5rem;
    left: 0.5rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.4rem;
  }

  footer {
    padding: 2rem 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
    line-height: 1.7;
  }

  header > h1 {
    padding: 2rem 1rem 0.4rem;
    font-size: 1.25rem;
    line-height: 1.4;
  }

  header > p {
    padding: 0 1rem 1rem;
    font-size: 0.825rem;
  }

  header nav {
    padding: 0 0.5rem 1rem;
  }

  main {
    padding: 0.75rem 0.625rem 2rem;
  }

  section {
    padding: 1.25rem 0.875rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  h3 {
    font-size: 1rem;
  }

  p {
    font-size: 0.875rem;
  }

  article {
    padding: 1rem;
  }

  article h3 {
    font-size: 1rem;
  }

  article p {
    font-size: 0.85rem;
  }

  blockquote {
    padding: 0.875rem 0.875rem 0.875rem 2.25rem;
  }

  blockquote p {
    font-size: 0.85rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  #sitemap li,
  #links li {
    padding: 0.35rem 0.5rem;
  }

  #sitemap a,
  #links a {
    font-size: 0.8rem;
  }

  #contact p {
    font-size: 0.85rem;
  }

  footer {
    padding: 1.5rem 0.875rem;
  }

  footer p {
    font-size: 0.78rem;
  }
}

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

  section {
    opacity: 1;
    transform: none;
  }
}

@media print {
  header {
    background: none;
    color: #000;
    border-radius: 0;
    box-shadow: none;
  }

  header > h1 {
    color: #000;
    -webkit-text-fill-color: #000;
  }

  header nav {
    display: none;
  }

  section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    opacity: 1;
    transform: none;
  }

  footer {
    background: none;
    color: #000;
    border-radius: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}