/* Privacy Policy - Board Game Box */

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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-bg: #f0f7ff;
  --highlight-bg: #fffbeb;
  --highlight-border: #f59e0b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --content-width: 800px;
  --sidebar-width: 260px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page wrapper */
.page-wrapper {
  min-height: 100vh;
}

/* Header */
.policy-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 40px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.app-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.policy-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.policy-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-sep {
  color: var(--border);
}

/* Content layout */
.content-layout {
  max-width: calc(var(--content-width) + var(--sidebar-width) + 48px);
  margin: 0 auto;
  display: flex;
  gap: 32px;
  padding: 32px 24px 80px;
}

/* TOC Sidebar */
.toc-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 140px;
  align-self: flex-start;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.toc-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.toc-list {
  list-style: none;
  counter-reset: toc-counter;
}

.toc-list li {
  counter-increment: toc-counter;
}

.toc-link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1.5;
  margin-bottom: 2px;
}

.toc-link::before {
  content: counter(toc-counter) ". ";
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.toc-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.toc-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

/* Main content */
.policy-content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-width);
}

/* Intro block */
.intro-block {
  margin-bottom: 40px;
}

.intro-block > p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.highlight-box {
  background: var(--highlight-bg);
  border-left: 3px solid var(--highlight-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.highlight-box p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Sections */
.policy-section {
  margin-bottom: 48px;
  scroll-margin-top: 140px;
}

.section-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  letter-spacing: -0.01em;
}

.subsection-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
}

.section-intro {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Info cards */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.info-card:hover {
  box-shadow: var(--shadow);
}

.info-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.info-card strong {
  color: var(--text);
  font-weight: 600;
}

/* Lists */
.policy-list {
  padding-left: 20px;
  margin: 12px 0;
}

.policy-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.policy-list.numbered {
  counter-reset: list-counter;
  list-style: none;
  padding-left: 0;
}

.policy-list.numbered > li {
  counter-increment: list-counter;
  padding-left: 28px;
  position: relative;
}

.policy-list.numbered > li::before {
  content: counter(list-counter) ".";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.sub-list {
  padding-left: 20px;
  margin: 8px 0;
  list-style: disc;
}

.sub-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 4px;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}

.policy-table th {
  background: var(--accent-light);
  font-weight: 600;
  color: var(--text);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 13px;
}

.policy-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  line-height: 1.6;
}

.policy-table tbody tr:last-child td {
  border-bottom: none;
}

.policy-table tbody tr:hover {
  background: var(--bg);
}

.sdk-table td:last-child {
  word-break: break-all;
}

/* External link */
.external-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.external-link:hover {
  border-bottom-color: var(--accent);
}

/* Note text */
.note-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  line-height: 1.7;
}

/* Contact card */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.contact-item + .contact-item {
  border-top: 1px solid var(--border-light);
}

.contact-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 72px;
  font-weight: 500;
}

.contact-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Footer */
.policy-footer {
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.policy-footer p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer-date {
  margin-top: 4px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  pointer-events: none;
  color: var(--text-secondary);
}

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

.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Responsive */
@media (max-width: 960px) {
  .toc-sidebar {
    display: none;
  }

  .content-layout {
    padding: 24px 16px 60px;
  }
}

@media (max-width: 640px) {
  .policy-header {
    padding: 32px 16px 28px;
  }

  .policy-title {
    font-size: 22px;
  }

  .policy-meta {
    flex-direction: column;
    gap: 4px;
  }

  .meta-sep {
    display: none;
  }

  .section-heading {
    font-size: 18px;
  }

  .info-card {
    padding: 16px;
  }

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

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

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

/* Print styles */
@media print {
  .toc-sidebar,
  .back-to-top,
  .policy-header {
    position: static;
  }

  .policy-header {
    box-shadow: none;
    border-bottom: 2px solid #000;
  }

  .info-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .policy-section {
    break-inside: avoid;
  }
}
