/* 法律文档页面样式 */

/* 页面布局 */
.legal-page {
  padding-top: 80px;
  background: #ffffff;
  min-height: 100vh;
}

/* 页头 */
.legal-header {
  background: linear-gradient(135deg, #fef3f8 0%, #f0f4ff 100%);
  padding: 4rem 0 3rem;
  border-bottom: 1px solid rgba(155, 89, 244, 0.1);
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.legal-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.legal-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* 法律文档切换器 */
.legal-switcher {
  display: inline-flex;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem;
  border-radius: 50px;
  border: 2px solid var(--border-color);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.switcher-btn {
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.switcher-btn:hover {
  color: var(--primary);
}

.switcher-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 2px 10px rgba(155, 89, 244, 0.3);
}

/* 内容区域 */
.legal-content {
  padding: 4rem 0;
}

.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* 目录 */
.legal-toc {
  position: relative;
}

.toc-sticky {
  position: sticky;
  top: 100px;
  background: var(--bg-light);
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
}

.toc-sticky h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.toc-sticky nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.toc-link:hover {
  background: rgba(155, 89, 244, 0.05);
  color: var(--primary);
  transform: translateX(3px);
}

.toc-link.active {
  background: rgba(155, 89, 244, 0.1);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* 文章内容 */
.legal-article {
  max-width: 800px;
  background: white;
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.legal-section {
  margin-bottom: 3rem;
  scroll-margin-top: 100px;
}

.legal-section:last-of-type {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.legal-section h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.legal-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}

.legal-section h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

.legal-section p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.legal-section ul {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.legal-section li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.75rem;
  position: relative;
}

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

.legal-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

.note {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 1rem;
  border-left: 3px solid var(--border-color);
  margin: 1.5rem 0;
}

/* 信息框 */
.info-box,
.warning-box {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
  border: 2px solid;
}

.info-box {
  background: rgba(77, 209, 197, 0.05);
  border-color: rgba(77, 209, 197, 0.3);
}

.warning-box {
  background: rgba(251, 191, 36, 0.05);
  border-color: rgba(251, 191, 36, 0.3);
}

.info-icon,
.warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-content strong,
.warning-content strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.info-content p,
.warning-content p {
  margin: 0;
  font-size: 0.95rem;
}

/* 目的卡片网格 */
.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.purpose-card {
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

.purpose-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.purpose-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.purpose-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.purpose-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* 安全措施网格 */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.security-badge {
  font-size: 1.5rem;
}

.security-item span:last-child {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* 权利列表 */
.rights-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.right-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.right-number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.right-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.right-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 联系卡片 */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.contact-card {
  text-align: center;
  padding: 2rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.contact-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contact-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.contact-card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-card a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.contact-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 页脚 */
.legal-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  text-align: center;
}

.legal-footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

/* 页脚激活状态 */
.footer-col a.active {
  color: white;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 1024px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .legal-toc {
    order: 2;
  }

  .toc-sticky {
    position: static;
    margin-top: 2rem;
  }

  .legal-article {
    order: 1;
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .legal-header {
    padding: 3rem 0 2rem;
  }

  .legal-title {
    font-size: 2rem;
  }

  .legal-content {
    padding: 2rem 0;
  }

  .legal-article {
    padding: 1.5rem;
  }

  .legal-section h2 {
    font-size: 1.5rem;
  }

  .legal-section h3 {
    font-size: 1.2rem;
  }

  .purpose-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .rights-list {
    gap: 1rem;
  }

  .right-item {
    flex-direction: column;
    gap: 1rem;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(155, 89, 244, 0.3);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(155, 89, 244, 0.4);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}
