:root {
  --color-primary: #1a3a5c;
  --color-primary-light: #2c5a8a;
  --color-accent: #e8b04b;
  --color-accent-light: #f5cc7a;
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.72);
  --color-text: #1f2933;
  --color-text-soft: #52606d;
  --color-text-muted: #7b8794;
  --color-border: rgba(26, 58, 92, 0.12);
  --color-shadow: rgba(26, 58, 92, 0.12);
  --color-shadow-strong: rgba(26, 58, 92, 0.22);
  --gradient-hero: linear-gradient(135deg, #1a3a5c 0%, #2c5a8a 45%, #3d7ab5 100%);
  --gradient-accent: linear-gradient(135deg, #e8b04b 0%, #f5cc7a 100%);
  --gradient-card: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 244, 249, 0.85) 100%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(26, 58, 92, 0.08);
  --shadow-md: 0 8px 24px rgba(26, 58, 92, 0.12);
  --shadow-lg: 0 16px 48px rgba(26, 58, 92, 0.18);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --container-max: 1200px;
  --header-height: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #7fb3e0;
    --color-primary-light: #a6cdf0;
    --color-accent: #e8b04b;
    --color-accent-light: #f5cc7a;
    --color-bg: #0d1620;
    --color-surface: #16222e;
    --color-surface-glass: rgba(22, 34, 46, 0.7);
    --color-text: #e4ebf2;
    --color-text-soft: #b3c1cf;
    --color-text-muted: #8496a8;
    --color-border: rgba(127, 179, 224, 0.16);
    --color-shadow: rgba(0, 0, 0, 0.4);
    --color-shadow-strong: rgba(0, 0, 0, 0.6);
    --gradient-hero: linear-gradient(135deg, #0d1620 0%, #16283a 45%, #1e3d5c 100%);
    --gradient-card: linear-gradient(160deg, rgba(30, 46, 62, 0.92) 0%, rgba(20, 32, 44, 0.88) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

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

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: var(--color-primary);
}

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--color-accent);
  color: #1a3a5c;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), background var(--transition-base);
}

header > div {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

header > div > a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

header > div > a:hover {
  color: var(--color-primary);
  opacity: 0.85;
}

header > div > a svg {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
}

header > div > a:hover svg {
  transform: rotate(-8deg) scale(1.05);
}

header nav {
  flex: 1 1 auto;
  min-width: 0;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

header nav a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-soft);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

header nav a:hover {
  color: var(--color-primary);
  background: rgba(232, 176, 75, 0.16);
  transform: translateY(-1px);
}

header form[role="search"] {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}

header form[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

header form[role="search"] input[type="search"] {
  width: 200px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), width var(--transition-base);
}

header form[role="search"] input[type="search"]::placeholder {
  color: var(--color-text-muted);
}

header form[role="search"] input[type="search"]:focus {
  outline: none;
  width: 240px;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(232, 176, 75, 0.22);
}

header form[role="search"] button {
  padding: 9px 18px;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
  color: #1a3a5c;
  background: var(--gradient-accent);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

header form[role="search"] button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232, 176, 75, 0.4);
  filter: brightness(1.05);
}

header form[role="search"] button:active {
  transform: translateY(0);
}

/* ============ Main / Sections ============ */
main {
  display: block;
}

main > section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px 20px;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

main > section:nth-of-type(even) {
  animation-delay: 0.05s;
}

main > section > article,
main > section > ul {
  background: var(--gradient-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}

main > section > article:hover,
main > section > ul:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(232, 176, 75, 0.35);
}

main > section > article + article,
main > section > article + ul,
main > section > ul + article {
  margin-top: 20px;
}

main > section > article h3:first-child {
  margin-top: 0;
}

/* ============ Hero ============ */
#hero {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 80px 20px 96px;
  background: var(--gradient-hero);
  color: #ffffff;
  overflow: hidden;
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 25%, rgba(232, 176, 75, 0.22), transparent 42%),
    radial-gradient(circle at 82% 15%, rgba(127, 179, 224, 0.25), transparent 40%),
    radial-gradient(circle at 70% 85%, rgba(232, 176, 75, 0.12), transparent 45%);
  z-index: -1;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 75%);
  z-index: -1;
  pointer-events: none;
}

#hero > * {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

#hero h1 {
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  max-width: 900px;
}

#hero p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 820px;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

#hero > div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

#hero > div a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), color var(--transition-base);
  position: relative;
  overflow: hidden;
}

#hero > div a:first-child {
  color: #1a3a5c;
  background: var(--gradient-accent);
  box-shadow: 0 8px 24px rgba(232, 176, 75, 0.4);
}

#hero > div a:first-child:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 36px rgba(232, 176, 75, 0.55);
  color: #1a3a5c;
}

#hero > div a:last-child {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#hero > div a:last-child:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--color-accent);
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ============ Breadcrumb ============ */
nav[aria-label="面包屑导航"] {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 20px 20px 0;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

nav[aria-label="面包屑导航"] li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  color: var(--color-text-muted);
  opacity: 0.6;
}

nav[aria-label="面包屑导航"] a {
  color: var(--color-text-soft);
  padding: 2px 4px;
  border-radius: 4px;
}

nav[aria-label="面包屑导航"] a:hover {
  color: var(--color-accent);
  background: rgba(232, 176, 75, 0.12);
}

/* ============ Section specific ============ */
#about > article h3 {
  margin-top: 1.2em;
}

#about > article h3:first-of-type {
  margin-top: 0;
}

#duiyi,
#fupan,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#security {
  position: relative;
}

#articles > article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(232, 176, 75, 0.14);
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

#articles > article a:hover {
  background: var(--gradient-accent);
  color: #1a3a5c;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 176, 75, 0.35);
}

#articles > article a:hover::after {
  transform: translateX(4px);
}

#news > article h3 {
  margin-bottom: 0.3em;
}

#news > article p:first-of-type {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 10px;
  display: inline-block;
  background: rgba(127, 179, 224, 0.14);
  border-radius: var(--radius-pill);
  margin-bottom: 0.8em;
}

#cases > article p:not(:first-of-type) {
  font-style: italic;
  color: var(--color-text-soft);
  padding-left: 16px;
  border-left: 3px solid var(--color-accent);
}

#faq > article h3 {
  color: var(--color-primary);
  padding-bottom: 0.4em;
  border-bottom: 1px dashed var(--color-border);
}

#faq > article:hover h3 {
  color: var(--color-accent);
}

#howto > article h3 {
  display: inline-block;
  padding: 2px 14px;
  background: linear-gradient(135deg, rgba(44, 90, 138, 0.12), rgba(232, 176, 75, 0.12));
  border-radius: var(--radius-pill);
  font-size: 1rem;
}

#contact > article p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

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

#sitemap > ul,
#links > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap > ul li a,
#links > ul li a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

#sitemap > ul li a:hover,
#links > ul li a:hover {
  color: #1a3a5c;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 176, 75, 0.3);
}

/* ============ Footer ============ */
footer {
  margin-top: 40px;
  padding: 56px 20px 40px;
  background: var(--gradient-hero);
  color: rgba(255, 255, 255, 0.82);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 90% 10%, rgba(232, 176, 75, 0.15), transparent 40%);
  pointer-events: none;
}

footer > section {
  max-width: var(--container-max);
  margin: 0 auto 28px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

footer > section:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(232, 176, 75, 0.4);
  transform: translateY(-2px);
}

footer > section h2 {
  color: #ffffff;
  font-size: 1.15rem;
  margin-bottom: 0.6em;
}

footer > section h2::after {
  background: var(--gradient-accent);
}

footer > section p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  font-size: 0.9rem;
}

footer > p {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: center;
}

footer > p a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a3a5c;
  background: var(--gradient-accent);
  border-radius: var(--radius-pill);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

footer > p a::before {
  content: "↑";
  font-weight: 700;
}

footer > p a:hover {
  color: #1a3a5c;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(232, 176, 75, 0.45);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: no-preference) {
  main > section > article,
  main > section > ul {
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  main > section:nth-child(2) > article { animation-delay: 0.05s; }
  main > section:nth-child(3) > article { animation-delay: 0.1s; }
  main > section:nth-child(4) > article { animation-delay: 0.15s; }

  #hero h1,
  #hero p,
  #hero > div {
    animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  #hero p:nth-of-type(1) { animation-delay: 0.1s; }
  #hero p:nth-of-type(2) { animation-delay: 0.18s; }
  #hero > div { animation-delay: 0.26s; }
}

@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;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  header nav a {
    padding: 7px 9px;
    font-size: 0.85rem;
  }

  header form[role="search"] input[type="search"] {
    width: 150px;
  }

  header form[role="search"] input[type="search"]:focus {
    width: 180px;
  }
}

@media (max-width: 860px) {
  header > div {
    padding: 12px 16px;
    gap: 12px;
    min-height: auto;
  }

  header nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

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

  header nav ul {
    flex-wrap: nowrap;
    gap: 2px;
  }

  header form[role="search"] {
    margin-left: auto;
  }

  header form[role="search"] input[type="search"] {
    width: 130px;
  }

  header form[role="search"] input[type="search"]:focus {
    width: 160px;
  }

  #hero {
    padding: 56px 16px 72px;
  }

  main > section {
    padding: 40px 16px;
  }

  main > section > article,
  main > section > ul {
    padding: 22px 20px;
    border-radius: var(--radius-md);
  }

  footer {
    padding: 40px 16px 32px;
  }

  footer > section {
    padding: 20px;
    border-radius: var(--radius-md);
  }
}

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

  header > div > a span {
    font-size: 1.15rem;
  }

  header > div > a svg {
    width: 34px;
    height: 34px;
  }

  header form[role="search"] input[type="search"] {
    width: 100px;
    padding: 8px 12px;
  }

  header form[role="search"] input[type="search"]:focus {
    width: 130px;
  }

  header form[role="search"] button {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  #hero > div {
    flex-direction: column;
    align-items: stretch;
  }

  #hero > div a {
    width: 100%;
    padding: 14px 24px;
  }

  main > section > article,
  main > section > ul {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }

  #sitemap > ul,
  #links > ul {
    gap: 8px;
  }

  #sitemap > ul li a,
  #links > ul li a {
    padding: 7px 14px;
    font-size: 0.85rem;
  }

  footer > section {
    padding: 16px;
  }

  footer > p a {
    width: 100%;
    justify-content: center;
  }
}

/* ============ Print ============ */
@media print {
  header,
  footer,
  #hero > div,
  nav[aria-label="面包屑导航"] {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  main > section > article {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

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