/* ==========================================================================
   Privacy Policy · 如意动态壁纸
   Static site stylesheet
   ========================================================================== */

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
img, picture, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* Tokens */
:root {
  --color-bg: #ffffff;
  --color-bg-elevated: #f8fafc;
  --color-bg-tint: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-soft: #64748b;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-accent: #0066cc;
  --color-accent-hover: #004999;
  --color-accent-soft: rgba(0, 102, 204, 0.08);
  --color-code-bg: #f1f5f9;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Source Han Sans CN", "Noto Sans CJK SC", "Noto Sans SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --max-width: 1120px;
  --content-width: 720px;
  --toc-width: 240px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;
  --space-9: 4rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);

  --header-height: 76px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1020;
    --color-bg-elevated: #131a31;
    --color-bg-tint: #1a2240;
    --color-text: #f1f5f9;
    --color-text-muted: #cbd5e1;
    --color-text-soft: #94a3b8;
    --color-border: #1e293b;
    --color-border-strong: #334155;
    --color-accent: #8ee7ff;
    --color-accent-hover: #b8efff;
    --color-accent-soft: rgba(142, 231, 255, 0.10);
    --color-code-bg: #1e293b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.40);

    color-scheme: dark;
  }
}

/* Base */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
  transition: color 0.15s ease;
}
a:hover { color: var(--color-accent-hover); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: var(--space-4); color: #ffffff; text-decoration: none; }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
@media (min-width: 720px) {
  .container { padding: 0 var(--space-6); }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  border-bottom: 1px solid var(--color-border);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: var(--space-3) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  text-decoration: none;
}
.brand:hover { color: inherit; text-decoration: none; }

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  /* iOS-style squircle ratio: ~22.37% of icon size */
  border-radius: 22%;
  overflow: hidden;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
}
.brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-app { font-size: 1.0625rem; font-weight: 600; color: var(--color-text); letter-spacing: -0.005em; }
.brand-company { font-size: 0.75rem; color: var(--color-text-soft); margin-top: 2px; }

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  font-size: 0.8125rem;
  color: var(--color-text-soft);
}
.header-meta time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.header-meta .version {
  padding: 2px 8px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  padding: var(--space-7) 0 var(--space-9);
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: var(--toc-width) 1fr;
    gap: var(--space-8);
  }
}

/* TOC */
.toc { font-size: 0.875rem; }
.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin-bottom: var(--space-3);
  padding-left: var(--space-3);
}

.toc-list {
  list-style: none;
  border-left: 1px solid var(--color-border);
}
.toc-list a {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.toc-list a:hover { color: var(--color-text); background: var(--color-accent-soft); }
.toc-list a:focus-visible { color: var(--color-text); background: var(--color-accent-soft); }
.toc-list a[data-current="true"] {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
  font-weight: 600;
}

@media (max-width: 959px) {
  .toc {
    padding: var(--space-5);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }
  .toc-list {
    columns: 2;
    column-gap: var(--space-5);
    border-left: none;
  }
  .toc-list li { break-inside: avoid; }
  .toc-list a { border-left: none; padding: var(--space-1) 0; }
  .toc-list a[data-current="true"] {
    border-left: none;
    border-radius: var(--radius-sm);
  }
}

@media (min-width: 960px) {
  .toc {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    max-height: calc(100vh - var(--header-height) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-strong) transparent;
  }
  .toc::-webkit-scrollbar { width: 6px; }
  .toc::-webkit-scrollbar-track { background: transparent; }
  .toc::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 3px; }
}

/* Main / article */
.policy { max-width: var(--content-width); }

.policy-header { margin-bottom: var(--space-8); }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.policy-header h1 {
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.section {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--color-border);
}
.section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.section h2 {
  font-size: clamp(1.375rem, 3vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
.section p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}
.section p:last-child { margin-bottom: 0; }

.section ul, .section ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}
.section li {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}
.section li::marker { color: var(--color-text-soft); }
.section strong { color: var(--color-text); font-weight: 600; }

.section code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 2px 6px;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  word-break: break-all;
}

.contact-list { list-style: none; padding: 0; margin: var(--space-5) 0; }
.contact-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  flex-wrap: wrap;
}
.contact-list li:last-child { border-bottom: none; }
.contact-list strong {
  flex: 0 0 7em;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.875rem;
}
.contact-list span { flex: 1 1 0; min-width: 0; }

.policy-footer {
  margin-top: var(--space-9);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}
.policy-footer p { margin-bottom: var(--space-2); color: var(--color-text-soft); }

/* Site footer */
.site-footer {
  margin-top: var(--space-9);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  font-size: 0.875rem;
  color: var(--color-text-soft);
}
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: var(--space-2); }

/* Back to top */
.back-to-top {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 20;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  opacity: 0.92;
}
.back-to-top:hover { background: var(--color-accent-hover); transform: translateY(-2px); opacity: 1; }
.back-to-top:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.back-to-top[hidden] { display: none; }

/* Print */
@media print {
  :root {
    --color-bg: #ffffff;
    --color-bg-elevated: #ffffff;
    --color-text: #000000;
    --color-text-muted: #1a1a1a;
    --color-text-soft: #333333;
    --color-border: #cccccc;
    --color-accent: #000000;
    --color-accent-hover: #000000;
  }

  html { font-size: 11pt; scroll-behavior: auto; }
  body { background: #ffffff; color: #000000; }

  .site-header {
    position: static;
    background: transparent;
    border-bottom: 2px solid #000;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .toc, .back-to-top, .site-footer { display: none; }

  .layout { display: block; padding: 0; }
  .policy { max-width: 100%; }

  .section { page-break-inside: avoid; break-inside: avoid; }
  .section h2 { page-break-after: avoid; break-after: avoid; }
  .section h3 { page-break-after: avoid; break-after: avoid; }

  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  a[href^="#"]::after { content: ""; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
