/* picbutler static site - hand-written CSS, no external dependencies */

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

:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:root {
  /* Brand colors */
  --brand-primary: #0C8C79;
  --brand-primary-dark: #075E53;
  --brand-accent: #F2B84B;
  /* Cross-brand reference (主品牌色, 供 cross-link 使用) */
  --brand-nimbo: #5B7FFF;

  /* Neutrals (5 级灰阶, 与 nimbo.cn 一致) */
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9ca3af;
  --color-border: #d1d5db;
  --color-bg-subtle: #f3f4f6;
  --color-bg: #ffffff;
  --color-code-bg: #f5f5f5;

  /* Typography scale */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --fs-h1: 40px;
  --fs-h2: 22px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 13px;
  --lh-tight: 1.2;
  --lh-base: 1.6;
  --lh-relaxed: 1.8;

  /* Spacing scale */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;
  --sp-7: 96px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);

  /* Transitions */
  --transition-base: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #e0e0e0;
    --color-text-muted: #999999;
    --color-text-subtle: #777777;
    --color-border: #333333;
    --color-bg-subtle: #242424;
    --color-bg: #1a1a1a;
    --color-code-bg: #2a2a2a;
    --brand-primary-dark: #5FE0CF;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--sp-4) 20px;
}

@media (max-width: 480px) {
  .container {
    padding: 20px var(--sp-2);
  }
  body {
    font-size: 15px;
  }
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-header .brand a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-icon {
  display: block;
  border-radius: var(--radius-sm);
}

.brand-name {
  color: var(--color-text);
  font-weight: 600;
}

.site-header .brand .tagline {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}

.site-nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--brand-primary);
}

.cross-link {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
}

.cross-link:hover {
  color: var(--brand-nimbo);
}

/* Hero */
.hero {
  padding: var(--sp-3) 0 var(--sp-5);
  text-align: center;
}

.hero-product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.95fr);
  align-items: center;
  gap: var(--sp-4);
  text-align: left;
  min-height: 360px;
}

.hero-copy {
  min-width: 0;
}

.hero-icon {
  display: block;
  border-radius: 18px;
  margin-bottom: var(--sp-2);
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-size: var(--fs-h1);
  margin-bottom: 12px;
  color: var(--brand-primary);
  letter-spacing: 0;
}

.hero p.lead {
  font-size: var(--fs-h3);
  color: var(--color-text-muted);
}

.hero-note {
  color: var(--color-text-muted);
  margin-top: 10px;
}

.compress-visual {
  display: flex;
  justify-content: center;
}

.phone-frame {
  position: relative;
  width: min(100%, 238px);
  aspect-ratio: 10 / 14;
  border-radius: 34px;
  background: #075E53;
  box-shadow: 0 22px 48px rgba(12, 140, 121, 0.25);
  padding: 28px 22px;
  overflow: hidden;
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 58px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  transform: translateX(-50%);
}

.image-card {
  position: relative;
  height: 58%;
  border-radius: 18px;
  background: #f9fafb;
  border: 1px solid #d2f2ed;
  overflow: hidden;
  margin-top: 18px;
}

.sun {
  position: absolute;
  top: 26px;
  left: 26px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #A7DCD2;
}

.mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  background:
    linear-gradient(135deg, transparent 0 37%, #A7DCD2 38% 58%, transparent 59%),
    linear-gradient(45deg, transparent 0 44%, #A7DCD2 45% 66%, transparent 67%);
  background-color: #fff;
}

.compress-arrow {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--brand-accent);
  border-style: solid;
}

.compress-arrow::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 5px;
  border-radius: 999px;
  background: var(--brand-accent);
}

.arrow-a { top: 58px; left: 36px; border-width: 5px 0 0 5px; }
.arrow-a::after { top: 12px; left: 4px; transform: rotate(45deg); transform-origin: left center; }

.arrow-b { top: 58px; right: 36px; border-width: 5px 5px 0 0; }
.arrow-b::after { top: 12px; right: 4px; transform: rotate(-45deg); transform-origin: right center; }

.arrow-c { bottom: 118px; left: 36px; border-width: 0 0 5px 5px; }
.arrow-c::after { bottom: 12px; left: 4px; transform: rotate(-45deg); transform-origin: left center; }

.arrow-d { bottom: 118px; right: 36px; border-width: 0 5px 5px 0; }
.arrow-d::after { bottom: 12px; right: 4px; transform: rotate(45deg); transform-origin: right center; }

.size-row {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 60px;
  display: flex;
  justify-content: space-between;
  color: #d1fae5;
  font-size: 13px;
}

.size-row strong {
  color: #fff;
}

.quality-bar {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 36px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  overflow: hidden;
}

.quality-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-accent);
}

@media (max-width: 680px) {
  .hero {
    padding: var(--sp-2) 0 var(--sp-3);
  }
  .hero-product {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-3);
    min-height: 0;
  }
  .hero h1 {
    font-size: 38px;
  }
  .hero-icon {
    width: 60px;
    height: 60px;
  }
  .hero-icon {
    margin-left: auto;
    margin-right: auto;
  }
  .phone-frame {
    width: min(56vw, 190px);
  }
  .image-card {
    margin-top: 16px;
  }
  .size-row {
    bottom: 52px;
    font-size: 12px;
  }
  .quality-bar {
    bottom: 30px;
  }
  section {
    margin: var(--sp-4) 0;
  }
}

/* Sections */
section {
  margin: var(--sp-5) 0;
}

section h2 {
  font-size: var(--fs-h2);
  margin-bottom: var(--sp-2);
  border-left: 4px solid var(--brand-primary);
  padding-left: 12px;
}

section h3 {
  font-size: var(--fs-h3);
  margin: 20px 0 10px;
}

section p {
  margin: 12px 0;
}

section ul, section ol {
  padding-left: var(--sp-3);
  margin: 12px 0;
}

section li {
  margin: 6px 0;
}

/* Links */
a {
  color: var(--brand-primary);
  text-decoration: none;
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-2) 0;
  font-size: var(--fs-sm);
}

table th, table td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

table th {
  background-color: var(--color-bg-subtle);
  font-weight: 600;
}

@media (max-width: 480px) {
  table {
    font-size: var(--fs-xs);
  }
  table th, table td {
    padding: 8px;
  }
}

/* Cards (download / legal links on home) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: var(--sp-2);
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
  background-color: var(--color-bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

article.card {
  display: block;
}

.card:hover {
  border-color: var(--brand-primary);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card.disabled:hover,
.card[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

.card .card-title {
  font-weight: 600;
}

.card .card-desc {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  display: block;
}

.card .card-action {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.card.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.card.disabled .card-action {
  color: var(--color-text-muted);
}

.card.primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.card.primary .card-desc,
.card.primary .card-action {
  color: rgba(255, 255, 255, 0.88);
}

.card.primary:hover {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  color: #ffffff;
  text-decoration: none;
}

.status-panel {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  padding: var(--sp-2);
  margin-top: var(--sp-2);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: #fff;
  text-decoration: none;
}

.button-link:hover {
  background: var(--brand-primary-dark);
  color: #fff;
  text-decoration: none;
}

code {
  background-color: var(--color-code-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  word-break: break-all;
}

/* Meta info (last updated etc) */
.meta {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-3);
  padding: 10px 14px;
  background-color: var(--color-bg-subtle);
  border-left: 3px solid var(--brand-primary);
  border-radius: 4px;
}

.meta p {
  margin: 4px 0;
}

/* Details / summary (SDK collapsible) */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px var(--sp-2);
  margin: var(--sp-2) 0;
  background-color: var(--color-bg-subtle);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}

details[open] summary {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

/* Footer */
.site-footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--brand-primary);
}

.site-footer .footer-links {
  margin-bottom: 8px;
}

.site-footer .footer-links a {
  margin-right: 12px;
  text-decoration: none;
}

/* Utility */
.muted {
  color: var(--color-text-muted);
}

.center {
  text-align: center;
}

/* Scroll-triggered fade-in */
.fade-in {
    opacity: 1;
    transform: none;
    transition: none;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
