/* ===== 基础设置 ===== */
:root {
  --primary-color: #165DFF;
  --secondary-color: #36D399;
  --dark-color: #1E293B;
  --light-color: #F8FAFC;
  --gray-color: #64748B;
  --gray-light: #F1F5F9;
  --gray-dark: #334155;
  --border-color: #E2E8F0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--gray-dark);
}

ul, ol {
  margin-bottom: 1rem;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== 导航栏 ===== */
header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  transition: all 0.3s ease;
}

header.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--primary-color);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.25rem;
}

.logo-text {
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--dark-color);
}

nav {
  display: none;
}

@media (min-width: 768px) {
  nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }

  nav a {
    color: var(--gray-dark);
    font-weight: 500;
    transition: color 0.2s ease;
  }

  nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
  }

  nav a.active {
    color: var(--primary-color);
    font-weight: 600;
  }
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--dark-color);
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  color: var(--gray-dark);
  font-weight: 500;
}

/* ===== 页面标题区域 ===== */
.page-header {
  padding: 3rem 0;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.05), rgba(54, 211, 153, 0.05));
}

.page-header h1 {
  text-wrap: balance;
}

.page-header p {
  color: var(--gray-color);
  font-size: 1.125rem;
}

/* ===== 条款与条件内容 ===== */
.terms-content {
  padding: 3rem 0;
}

@media (min-width: 1024px) {
  .terms-content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 3rem;
  }
}

/* 侧边导航 */
.sidebar {
  position: sticky;
  top: 2rem;
  height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-right: 1rem;
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: var(--gray-dark);
  transition: all 0.2s ease;
}

.sidebar-nav a:hover {
  background-color: var(--gray-light);
  text-decoration: none;
}

.sidebar-nav a.active {
  background-color: rgba(22, 93, 255, 0.1);
  color: var(--primary-color);
  font-weight: 500;
}

/* 主要内容 */
.main-content {
  scroll-margin-top: 4rem;
}

.terms-section {
  margin-bottom: 3rem;
}

.terms-section h2 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.terms-section h3 {
  margin-top: 2rem;
}

.terms-section ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.terms-section ul li {
  margin-bottom: 0.5rem;
  color: var(--gray-dark);
}

/* ===== 页脚 ===== */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 4rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-col h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: white;
  text-decoration: none;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.footer-logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: white;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.25rem;
}

.footer-logo-text {
  font-weight: bold;
  font-size: 1.25rem;
  color: white;
}

.footer-col p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: white;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-item i {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

.contact-item span,
.contact-item a {
  color: rgba(255, 255, 255, 0.7);
}

.contact-item a:hover {
  color: white;
  text-decoration: none;
}

.copyright {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

/* ===== Cookie 弹窗 ===== */
.cookie-consent {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 30rem;
  background-color: var(--dark-color);
  color: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 50;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-consent.visible {
  transform: translateY(0);
}

.cookie-content {
  padding: 1.5rem;
}

.cookie-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.cookie-icon {
  color: rgba(22, 93, 255, 0.8);
  font-size: 1.25rem;
}

.cookie-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.cookie-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.cookie-text a {
  color: rgba(22, 93, 255, 0.8);
}

.cookie-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cookie-accept {
  background-color: rgba(22, 93, 255, 0.8);
  color: white;
}

.cookie-accept:hover {
  background-color: rgba(22, 93, 255, 1);
}

.cookie-customize {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.cookie-customize:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Cookie 偏好设置弹窗 */
.cookie-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cookie-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: white;
  border-radius: 0.5rem;
  max-width: 30rem;
  width: 90%;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
}

.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cookie-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.cookie-input {
  margin-right: 0.5rem;
}

.cookie-description {
  color: var(--gray-color);
  font-size: 0.875rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.save-button {
  padding: 0.5rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.save-button:hover {
  background-color: rgba(22, 93, 255, 0.9);
}

/* ===== 响应式调整 ===== */
@media (max-width: 767px) {
  .page-header {
    padding: 2rem 0;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .terms-section {
    margin-bottom: 2rem;
  }

  .cookie-consent {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
  }
}
