/* ============================================================
   page-fuwu-tiaokuan.css — 服务条款 · 晶格浅域 (ts-*)
   与首页同系视觉，独立文档式布局
   ============================================================ */

html.theme-pearl-elegance .ts-terms-page {
  --ts-bg: #f4f8fc;
  --ts-bg-alt: #ffffff;
  --ts-surface: #ffffff;
  --ts-ink: #0c1222;
  --ts-muted: #5a6a85;
  --ts-body: #3d4d66;
  --ts-border: rgba(14, 165, 233, 0.18);
  --ts-border-strong: rgba(14, 165, 233, 0.35);
  --ts-cyan: #06b6d4;
  --ts-blue: #0ea5e9;
  --ts-blue-dark: #0284c7;
  --ts-glow: rgba(6, 182, 212, 0.15);
  --ts-shadow: 0 4px 20px -4px rgba(14, 165, 233, 0.12);
  --ts-shadow-lg: 0 20px 50px -12px rgba(14, 165, 233, 0.2);
  --ts-radius: 10px;
  --ts-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --ts-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
  font-family: var(--ts-sans);
  background: var(--ts-bg);
  color: var(--ts-ink);
  padding-bottom: 0;
}

html.theme-pearl-elegance:has(#page-fuwu-tiaokuan) body {
  background: var(--ts-bg);
  background-image: none;
}

html.theme-pearl-elegance:has(#page-fuwu-tiaokuan) body::after {
  display: none;
}

.ts-terms-page .container {
  max-width: 1180px;
  padding-inline: clamp(20px, 4vw, 32px);
}

/* —— 通用 —— */
.ts-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px 12px 5px 10px;
  border-radius: 6px;
  font-family: var(--ts-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ts-blue-dark);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--ts-border);
}

.ts-tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ts-cyan);
  box-shadow: 0 0 8px var(--ts-cyan);
  animation: ts-pulse 2s ease-in-out infinite;
}

@keyframes ts-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ts-gradient-text {
  background: linear-gradient(90deg, var(--ts-blue), var(--ts-cyan), var(--ts-blue));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ts-shimmer 5s linear infinite;
}

@keyframes ts-shimmer {
  to { background-position: 200% center; }
}

.ts-head {
  margin-bottom: clamp(36px, 5vw, 52px);
  max-width: 56ch;
}

.ts-head--center {
  text-align: center;
  margin-inline: auto;
}

.ts-head__title {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.8vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ts-head__sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ts-muted);
}

.ts-head__sub code {
  font-family: var(--ts-mono);
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid var(--ts-border);
  color: var(--ts-blue-dark);
  font-weight: 600;
}

.ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 8px;
  font-family: var(--ts-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ts-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--ts-blue), var(--ts-cyan));
  background-size: 200% 200%;
  box-shadow: 0 4px 16px -2px rgba(14, 165, 233, 0.45);
  animation: ts-btn-glow 4s ease-in-out infinite;
}

@keyframes ts-btn-glow {
  0%, 100% { background-position: 0% 50%; box-shadow: 0 4px 16px -2px rgba(14, 165, 233, 0.45); }
  50% { background-position: 100% 50%; box-shadow: 0 6px 22px -2px rgba(14, 165, 233, 0.55); }
}

.ts-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(14, 165, 233, 0.55);
  color: #fff;
}

.ts-btn--outline {
  color: var(--ts-blue-dark);
  background: var(--ts-surface);
  border: 1px solid var(--ts-border-strong);
}

.ts-btn--outline:hover {
  background: rgba(14, 165, 233, 0.06);
  border-color: var(--ts-blue);
  color: var(--ts-blue-dark);
}

.ts-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-blue);
  text-decoration: none;
}

.ts-link:hover {
  text-decoration: underline;
}

.ts-link i {
  width: 14px;
  height: 14px;
}

.ts-link--on-dark {
  color: rgba(255, 255, 255, 0.88);
}

.ts-link--on-dark:hover {
  color: #fff;
}

.ts-section {
  padding: clamp(64px, 9vw, 96px) 0;
}

.ts-section--alt {
  background: var(--ts-bg-alt);
  border-block: 1px solid var(--ts-border);
}

.ts-terms-page a:not(.ts-btn):not(.ts-part-card):not(.ts-more__nav a) {
  color: var(--ts-blue);
  font-weight: 600;
}

/* —— ① 首屏 —— */
.ts-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(88px, 11vw, 120px) 0 clamp(56px, 7vw, 72px);
}

html.theme-pearl-elegance:has(#page-fuwu-tiaokuan) .ts-terms-page .ts-hero {
  margin-top: calc(-1 * var(--nav-height));
  padding-top: calc(var(--nav-height) + clamp(40px, 7vw, 72px));
}

.ts-hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}

.ts-hero__glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.ts-hero__glow--left {
  top: -10%;
  left: -15%;
  background: radial-gradient(circle, var(--ts-glow) 0%, transparent 70%);
}

.ts-hero__glow--right {
  top: 10%;
  right: -10%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
}

.ts-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.ts-hero__title {
  margin: 0 0 18px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.ts-hero__lead {
  margin: 0 auto 32px;
  max-width: 58ch;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.75;
  color: var(--ts-muted);
}

.ts-hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0 auto 28px;
  padding: 0;
  max-width: 820px;
  text-align: left;
}

.ts-hero__meta li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--ts-radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--ts-border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ts-hero__meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.ts-hero__meta-icon i {
  width: 16px;
  height: 16px;
  color: var(--ts-blue-dark);
}

.ts-hero__meta-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ts-muted);
}

.ts-hero__meta-text strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ts-ink);
}

.ts-hero__meta-text time {
  font-weight: 600;
  color: var(--ts-ink);
  white-space: nowrap;
}

.ts-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* —— ② 三篇卡片 —— */
.ts-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ts-part-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  border-radius: var(--ts-radius);
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ts-part-card:hover {
  border-color: var(--ts-cyan);
  box-shadow: var(--ts-shadow-lg);
  transform: translateY(-3px);
  color: inherit;
}

.ts-part-card--accent {
  border-color: var(--ts-border-strong);
  box-shadow: var(--ts-shadow);
}

.ts-part-card__num {
  display: inline-block;
  margin-bottom: 14px;
  font-family: var(--ts-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ts-blue-dark);
}

.ts-part-card > i {
  width: 24px;
  height: 24px;
  margin-bottom: 12px;
  color: var(--ts-blue);
}

.ts-part-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.ts-part-card p {
  margin: 0 0 16px;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ts-muted);
}

.ts-part-card__chapters {
  font-family: var(--ts-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ts-blue);
}

/* —— ③ 索引表 —— */
.ts-table-wrap {
  overflow-x: auto;
  border-radius: var(--ts-radius);
  border: 1px solid var(--ts-border);
  background: var(--ts-surface);
  box-shadow: var(--ts-shadow);
}

.ts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ts-table th,
.ts-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--ts-border);
}

.ts-table thead th {
  font-family: var(--ts-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ts-muted);
  background: rgba(14, 165, 233, 0.04);
}

.ts-table tbody tr:last-child th,
.ts-table tbody tr:last-child td {
  border-bottom: none;
}

.ts-table tbody th[scope="row"] {
  font-family: var(--ts-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ts-blue-dark);
  white-space: nowrap;
}

.ts-table tbody td {
  color: var(--ts-body);
}

.ts-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.03);
}

.ts-table a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ts-table a i {
  width: 14px;
  height: 14px;
}

/* —— ④ 正文 —— */
.ts-body {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.ts-chapter-group {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.ts-group-head {
  margin-bottom: clamp(32px, 5vw, 48px);
  max-width: 62ch;
}

.ts-group-head__title {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.25;
}

.ts-group-head__sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ts-muted);
}

.ts-clauses {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ts-clause {
  scroll-margin-top: calc(var(--nav-height) + 16px);
  border-radius: var(--ts-radius);
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ts-section:not(.ts-section--alt) .ts-clause {
  background: var(--ts-bg-alt);
}

.ts-clause:hover {
  border-color: var(--ts-border-strong);
  box-shadow: var(--ts-shadow);
}

.ts-clause__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: clamp(18px, 2.5vw, 22px) clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--ts-border);
  background: rgba(14, 165, 233, 0.03);
}

.ts-clause__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--ts-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ts-blue), var(--ts-cyan));
}

.ts-clause__head h3 {
  margin: 0;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 700;
}

.ts-clause__body {
  padding: clamp(20px, 3vw, 28px);
}

.ts-clause__body p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ts-body);
}

.ts-clause__body p:last-child {
  margin-bottom: 0;
}

.ts-clause__body ul {
  margin: 0 0 14px;
  padding-left: 1.4em;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ts-body);
}

.ts-clause__body li {
  margin-bottom: 6px;
}

.ts-clause__body li:last-child {
  margin-bottom: 0;
}

.ts-clause-id {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  font-family: var(--ts-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ts-blue-dark);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--ts-border);
}

/* —— ⑤ 关联文件 —— */
.ts-related {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.ts-related-card {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.6vw, 26px);
  border-radius: var(--ts-radius);
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.ts-related-card:hover {
  border-color: var(--ts-cyan);
  transform: translateY(-2px);
}

.ts-related-card--accent {
  background: linear-gradient(145deg, #0c1222 0%, #152238 100%);
  border-color: rgba(14, 165, 233, 0.3);
}

.ts-related-card--accent h3 {
  color: #fff;
}

.ts-related-card--accent p {
  color: rgba(255, 255, 255, 0.72);
}

.ts-related-card--accent .ts-link {
  color: var(--ts-cyan);
}

.ts-related-card--accent > i {
  color: var(--ts-cyan);
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.25);
}

.ts-related-card > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--ts-border);
  color: var(--ts-blue);
}

.ts-related-card > i svg {
  width: 20px;
  height: 20px;
}

.ts-related-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.ts-related-card p {
  margin: 0 0 14px;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ts-muted);
}

/* —— ⑥ 延伸阅读 —— */
.ts-more {
  padding: clamp(28px, 4vw, 40px) 0;
}

.ts-more__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.ts-more__nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ts-ink);
  text-decoration: none;
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ts-more__nav a:hover {
  border-color: var(--ts-cyan);
  transform: translateY(-2px);
  color: var(--ts-ink);
}

.ts-more__nav i {
  width: 16px;
  height: 16px;
  color: var(--ts-blue);
}

/* —— ⑦ CTA —— */
.ts-cta {
  margin: 0 clamp(16px, 3vw, 24px) clamp(24px, 4vw, 40px);
  padding: clamp(56px, 8vw, 80px) clamp(24px, 4vw, 40px);
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(145deg, #0c1222 0%, #152238 50%, #0c2847 100%);
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: var(--ts-shadow-lg);
}

.ts-cta__title {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.ts-cta__sub {
  margin: 0 auto 30px;
  max-width: 50ch;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.ts-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 20px;
}

/* —— fade-in & stagger —— */
#page-fuwu-tiaokuan .fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

#page-fuwu-tiaokuan .fade-in.visible,
#page-fuwu-tiaokuan .ts-hero.fade-in {
  opacity: 1;
  transform: none;
}

.ts-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in.visible .ts-stagger > *,
.ts-stagger.visible > * {
  opacity: 1;
  transform: none;
}

.fade-in.visible .ts-stagger > *:nth-child(1),
.ts-stagger.visible > *:nth-child(1) { transition-delay: 0.04s; }
.fade-in.visible .ts-stagger > *:nth-child(2),
.ts-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.fade-in.visible .ts-stagger > *:nth-child(3),
.ts-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.fade-in.visible .ts-stagger > *:nth-child(4),
.ts-stagger.visible > *:nth-child(4) { transition-delay: 0.22s; }

/* —— 响应式 —— */
@media (max-width: 900px) {
  .ts-hero__meta {
    grid-template-columns: 1fr;
  }

  .ts-parts {
    grid-template-columns: 1fr;
  }

  .ts-related {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .ts-related {
    grid-template-columns: 1fr;
  }

  .ts-table th,
  .ts-table td {
    padding: 12px 14px;
    font-size: 13px;
  }

  .ts-table thead th:nth-child(3),
  .ts-table tbody td:nth-child(3) {
    display: none;
  }

  .ts-cta {
    margin-inline: 12px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-fuwu-tiaokuan .fade-in,
  .ts-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ts-tag__dot,
  .ts-gradient-text,
  .ts-btn--primary {
    animation: none !important;
  }

  .ts-part-card:hover,
  .ts-related-card:hover,
  .ts-btn--primary:hover,
  .ts-more__nav a:hover {
    transform: none;
  }
}
