/* ========================================
   WPS Office - Common Styles (v2.0)
   公共样式：变量、Reset、Header、Footer、
   Breadcrumb、Tag、响应式导航、工具类
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
  /* Brand Colors */
  --primary: #1677FF;
  --primary-hover: #0958D9;
  --primary-light: #E6F4FF;
  --accent: #FF6B35;
  --accent-hover: #E55A2B;

  /* Background */
  --bg-white: #FFFFFF;
  --bg-light: #F7F9FC;
  --bg-medium: #EEF2F8;

  /* Text */
  --text-primary: #1A1A2E;
  --text-secondary: #5A6072;
  --text-muted: #9CA3AF;
  --text-white: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Spacing (8px grid) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 96px;

  /* Typography */
  --font-xs: 12px;
  --font-sm: 14px;
  --font-base: 16px;
  --font-lg: 20px;
  --font-xl: 28px;
  --font-2xl: 40px;
  --font-hero: 56px;

  /* Layout */
  --header-height: 72px;

  /* Transition */
  --transition-base: 0.3s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Global Reset ---------- */
* {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-white);
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  font-size: var(--font-base);
  color: var(--text-primary);
}

body em,
body i {
  font-style: normal;
}

body ol,
body ul,
body li {
  list-style: none;
}

body img {
  border: 0;
  vertical-align: middle;
  max-width: 100%;
}

body p {
  margin: 0;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}

body a {
  text-decoration: none !important;
  cursor: pointer;
  transition: color var(--transition-base);
  color: var(--text-primary);
}

body a:hover {
  color: var(--primary) !important;
}

/* ---------- Header / Navigation ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: box-shadow var(--transition-smooth), background var(--transition-smooth);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.95);
}

.header .container,
.header .row {
  height: 100%;
}

.header .container {
  padding-left: 15px;
  padding-right: 15px;
}

.header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: -15px;
  margin-right: -15px;
}

.header .row::before,
.header .row::after {
  display: none;
}

.header .logo {
  float: none;
  flex-shrink: 0;
}

.header .logo a {
  display: flex;
  align-items: center;
  width: auto;
  height: var(--header-height);
  margin-top: 0;
}

.header .logo a img {
  height: 28px;
  width: auto;
  transition: transform var(--transition-base);
}

.header .logo a:hover img {
  transform: scale(1.05);
}

.header .menu {
  float: none;
}

.header .menu .list {
  display: flex;
  align-items: center;
  gap: 40px;
}

.header .menu .list li {
  float: none;
  line-height: var(--header-height);
  margin-right: 0;
  position: relative;
}

.header .menu .list li a {
  display: inline-block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
  transition: color var(--transition-base);
}

.header .menu .list li a::after {
  content: '';
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.header .menu .list li a:hover::after,
.header .menu .list li a.active::after {
  width: 100%;
}

.header .menu .list li a:hover {
  color: var(--primary) !important;
}

/* CTA Button */
.header .menu .list li:last-child {
  animation: none;
}

.header .menu .list li:last-child a {
  width: auto;
  height: 40px;
  line-height: 38px;
  padding: 0 24px;
  text-align: center;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  transition: all var(--transition-base);
}

.header .menu .list li:last-child a::after {
  display: none;
}

.header .menu .list li:last-child a:hover {
  background: var(--primary);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

/* Active Link */
.header .menu .list li a.active {
  color: var(--primary) !important;
}

/* ---------- Footer ---------- */
.footer {
  padding: 30px 0 30px 0;
  text-align: center;
  background: var(--bg-light);
  border-top: 1px solid var(--bg-medium);
  position: relative;
}

/* Copyright */
.footer .copyright p {
  font-weight: 400;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 2;
  letter-spacing: 0.3px;
}

.footer .copyright p:first-child {
  color: var(--text-muted);
  font-size: var(--font-xs);
  letter-spacing: 0.5px;
}

.footer .copyright p:last-child {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer .copyright p:last-child strong {
  color: var(--primary);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: 20px 0;
  margin-top: var(--header-height);
}

.breadcrumb .breadcrumb-list a {
  font-weight: 400;
  font-size: var(--font-sm);
  color: var(--text-muted);
  transition: color var(--transition-base);
}

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

.breadcrumb .breadcrumb-list a:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---------- Tag Cloud ---------- */
.tag {
  padding-top: 60px;
  padding-bottom: 30px;
}

.tag .tag-title {
  text-align: center;
}

.tag .tag-title h1,
.tag .tag-title h2 {
  font-weight: 600;
  font-size: var(--font-2xl);
  color: var(--text-primary);
}

.tag .tag-title p {
  padding-top: 16px;
  font-weight: 400;
  font-size: var(--font-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

.tag .no-data {
  padding-top: 30px;
  text-align: center;
}

.tag .no-data p {
  line-height: 30px;
  font-size: var(--font-base);
  color: var(--text-secondary);
}

.tag .tag-list {
  padding-top: 40px;
  text-align: center;
}

.tag .tag-list a {
  display: inline-block;
  padding: 8px 24px;
  margin: 0 6px 12px 6px;
  background: var(--bg-medium);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-base);
}

.tag .tag-list a:hover {
  background: var(--primary-light);
  color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Related Tag ---------- */
.related-tag {
  padding-top: 60px;
}

.related-tag .related-title {
  text-align: center;
}

.related-tag .related-title h1 {
  font-weight: 600;
  font-size: var(--font-2xl);
  color: var(--text-primary);
}

.related-tag .related-list {
  padding-top: 40px;
  text-align: center;
}

.related-tag .related-list a {
  display: inline-block;
  padding: 8px 24px;
  margin: 0 6px 12px 6px;
  background: var(--bg-medium);
  border-radius: var(--rg-full);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-base);
}

.related-tag .related-list a:hover {
  background: var(--primary-light);
  color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Keyframes ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 2px solid var(--primary);
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--primary);
  border-top: 2px solid var(--primary);
  transform: rotate(45deg) translateY(2px);
  transition: border-color var(--transition-base);
}

.back-to-top:hover {
  background: var(--primary);
  box-shadow: 0 6px 20px rgba(22, 119, 255, 0.35);
}

.back-to-top:hover::before {
  border-color: var(--text-white);
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-medium);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================
   Responsive - Tablet (768px-991px)
   ======================================== */
@media (max-width: 991px) {
  :root {
    --font-hero: 40px;
    --font-2xl: 32px;
    --font-xl: 24px;
    --header-height: 64px;
  }

  .header .menu .list {
    gap: 24px;
  }

  .header .menu .list li a {
    font-size: var(--font-xs);
  }

  .header .menu .list li:last-child a {
    padding: 0 16px;
    height: 34px;
    line-height: 32px;
    font-size: var(--font-xs);
  }

  .tag {
    padding-top: 40px;
  }

  .tag .tag-title h1,
  .tag .tag-title h2 {
    font-size: var(--font-xl);
  }

  .related-tag {
    padding-top: 40px;
  }

  .related-tag .related-title h1 {
    font-size: var(--font-xl);
  }
}

/* ========================================
   Responsive - Mobile (< 768px)
   ======================================== */
@media (max-width: 767px) {
  :root {
    --header-height: 60px;
    --font-hero: 32px;
    --font-2xl: 28px;
  }

  .header {
    padding: 0 var(--space-sm);
  }

  .header .logo a img {
    height: 22px;
  }

  /* Hamburger Menu */
  .header .menu {
    position: relative;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--bg-medium);
    transition: all var(--transition-base);
  }

  .header .menu:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
  }

  .header .menu.active {
    background: var(--primary-light);
    border-color: var(--primary);
  }

  .header .menu::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: url("../images/menu.svg") no-repeat center center;
    background-size: contain;
  }

  /* Slide-out Menu */
  .header .menu .list {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    padding: 80px var(--space-md) var(--space-md);
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    transition: right var(--transition-smooth);
    z-index: 999;
    overflow-y: auto;
  }

  .header .menu .list.active {
    right: 0;
  }

  /* Close Button */
  .nav-close {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1000;
    border-radius: 50%;
    transition: background var(--transition-base);
  }

  .header .menu .list.active .nav-close {
    display: block;
  }

  .nav-close::before,
  .nav-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: background var(--transition-base), transform var(--transition-base);
  }

  .nav-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .nav-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .nav-close:hover {
    background: var(--primary-light);
  }

  .nav-close:hover::before,
  .nav-close:hover::after {
    background: var(--primary);
  }

  .nav-close:active::before,
  .nav-close:active::after {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  .header .menu .list li {
    float: none;
    line-height: 1;
    margin-right: 0;
    margin-bottom: var(--space-xs);
    width: 100%;
  }

  .header .menu .list li a {
    display: block;
    height: auto;
    line-height: 1;
    padding: 14px var(--space-sm);
    color: var(--text-primary);
    font-size: var(--font-base);
    border-radius: var(--radius-sm);
    transition: background var(--transition-base), color var(--transition-base);
  }

  .header .menu .list li a:hover {
    background: var(--primary-light);
    color: var(--primary) !important;
  }

  .header .menu .list li a::after {
    display: none;
  }

  /* CTA in mobile menu */
  .header .menu .list li:last-child {
    margin-bottom: 0;
    margin-top: var(--space-sm);
  }

  .header .menu .list li:last-child a {
    width: 100%;
    height: 44px;
    line-height: 42px;
    padding: 0;
    border: 2px solid var(--primary);
    color: var(--primary);
    text-align: center;
    border-radius: var(--radius-md);
    background: transparent;
  }

  .header .menu .list li:last-child a:hover {
    background: var(--primary);
    color: #fff !important;
  }

  /* Overlay */
  .header .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    transition: opacity var(--transition-base);
  }

  .header .nav-overlay.active {
    display: block;
    opacity: 1;
  }

  .breadcrumb {
    padding: 16px var(--space-sm);
    margin-top: var(--header-height);
  }

  .tag {
    padding: 40px var(--space-sm);
  }

  .tag .tag-title h1,
  .tag .tag-title h2 {
    font-size: 24px;
  }

  .tag .tag-list a {
    padding: 6px 16px;
    font-size: var(--font-xs);
  }

  .related-tag {
    padding: 40px var(--space-sm);
  }

  .related-tag .related-title h1 {
    font-size: 24px;
  }

  .related-tag .related-list a {
    padding: 6px 16px;
    font-size: var(--font-xs);
  }

  .footer {
    padding: 40px var(--space-sm) 30px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ========================================
   Responsive - Large Desktop (≥1400px)
   ======================================== */
@media (min-width: 1400px) {
  .container {
    max-width: 1240px;
    margin: 0 auto;
  }

  :root {
    --font-hero: 64px;
    --font-2xl: 44px;
    --font-xl: 30px;
    --font-lg: 22px;
    --font-base: 17px;
    --header-height: 80px;
  }

  .header .logo a img {
    height: 32px;
  }

  .header .menu .list li a {
    font-size: 15px;
  }

  .header .menu .list {
    gap: 48px;
  }

  .header .menu .list li:last-child a {
    height: 44px;
    line-height: 42px;
    padding: 0 28px;
  }

  .breadcrumb {
    margin-top: var(--header-height);
  }

  .footer {
    padding: 50px 0 30px;
  }
}
