/* Pantry (食尽) — pantry.yilin.dev
   Apple-HIG-inspired static site. No build tools. Light/Dark via prefers-color-scheme. */

:root {
  --green: #2e9d63;
  --green-strong: #1f7a4d;
  --green-soft: rgba(46, 157, 99, 0.12);

  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --card: #ffffff;
  --card-alt: #f5f5f7;
  --line: #e3e3e8;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --green: #43b677;
    --green-strong: #2e9d63;
    --green-soft: rgba(67, 182, 119, 0.16);

    --bg: #000000;
    --bg-alt: #0c0c0d;
    --fg: #f5f5f7;
    --muted: #98989d;
    --card: #1c1c1e;
    --card-alt: #161618;
    --line: #2c2c2e;
    --nav-bg: rgba(20, 20, 22, 0.72);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Hiragino Sans", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1040px; margin: 0 auto; padding: 0 22px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.brand small { color: var(--muted); font-weight: 400; }
.nav__right { display: flex; align-items: center; gap: 16px; }
.nav__links { display: flex; gap: 22px; }
.nav__links a { color: var(--fg); font-size: 15px; opacity: 0.85; }
.nav__links a:hover { opacity: 1; text-decoration: none; }

/* Language switcher: custom <details> dropdown (fully styled, no native select) */
.lang { position: relative; }
.lang > summary {
  list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  border: 1px solid var(--line); border-radius: 980px; padding: 5px 11px;
  font-size: 13px; font-weight: 500; line-height: 1; color: var(--fg); background: var(--card);
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary::marker { content: ""; }
.lang > summary:hover { border-color: var(--green); background: var(--bg-alt); }
.lang > summary:active { transform: scale(0.97); }
.lang[open] > summary { border-color: var(--green); }
.lang > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.lang__globe { width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.6; flex: 0 0 auto; }
.lang__chev { width: 12px; height: 12px; stroke: var(--muted); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.lang[open] .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 152px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; z-index: 200; display: grid; gap: 2px;
  transform-origin: top right; animation: langPop .14s ease;
}
@keyframes langPop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.lang__menu a {
  display: block; padding: 9px 12px; border-radius: 9px; font-size: 14px;
  color: var(--fg); opacity: .85;
}
.lang__menu a:hover { background: var(--bg-alt); text-decoration: none; opacity: 1; }
.lang__menu a[aria-current="true"] { color: var(--green); font-weight: 600; opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; border-radius: 980px; font-size: 16px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, opacity .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-strong); }
.btn--primary[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn--ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn--ghost:hover { background: var(--green-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 96px 0 72px; }
.hero__logo { width: 92px; height: 92px; border-radius: 22px; margin: 0 auto 22px; display: block; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(40px, 8vw, 68px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 6px; }
.hero__zh { color: var(--muted); font-weight: 500; font-size: clamp(18px, 3.5vw, 22px); margin: 0 0 18px; }
.hero__tagline { font-size: clamp(22px, 4.4vw, 30px); font-weight: 600; letter-spacing: -0.01em; margin: 0 auto 16px; max-width: 18ch; line-height: 1.25; }
.hero__desc { color: var(--muted); font-size: 19px; max-width: 56ch; margin: 0 auto 30px; }
.hero .btn-row { justify-content: center; }

/* ---------- Section headings ---------- */
.section__head { text-align: center; max-width: 60ch; margin: 0 auto 52px; }
.section__head h2 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.02em; margin: 0 0 12px; }
.section__head p { color: var(--muted); font-size: 19px; margin: 0; }
.eyebrow { color: var(--green); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; display: block; margin-bottom: 10px; }

/* ---------- Feature cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px; box-shadow: var(--shadow);
}
.card__icon {
  width: 50px; height: 50px; border-radius: 14px; background: var(--green-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.card__icon svg { width: 26px; height: 26px; stroke: var(--green); fill: none; stroke-width: 2; }
.card h3 { font-size: 21px; margin: 0 0 8px; letter-spacing: -0.01em; }
.card p { color: var(--muted); margin: 0; font-size: 16px; }

/* ---------- Advantages ---------- */
.adv-list { list-style: none; padding: 0; max-width: 640px; margin: 0 auto; display: grid; gap: 14px; }
.adv-list li {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; font-size: 18px;
}
.adv-list svg { width: 22px; height: 22px; flex: 0 0 22px; stroke: var(--green); fill: none; stroke-width: 2.4; }

/* ---------- Screenshots ---------- */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; max-width: 860px; margin: 0 auto; }
.shot {
  width: 100%; height: auto; display: block;        /* 按图片真实比例等比缩放，不裁剪 */
  border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow);
  cursor: zoom-in; transition: transform .12s ease;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
.shot:hover { transform: translateY(-3px); }

/* Lightbox: 点击截图放大查看 */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 28px; background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: min(420px, 92vw); max-height: 92vh; width: auto; height: auto;
  border-radius: 22px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); cursor: zoom-out;
  transform: scale(0.96); transition: transform .2s ease;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
.lightbox.is-open img { transform: scale(1); }
.lightbox__close {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 980px;
  border: none; cursor: pointer; background: rgba(255, 255, 255, 0.16); color: #fff;
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.28); }

/* ---------- Privacy band ---------- */
.privacy-band { text-align: center; }
.privacy-band .lock { width: 56px; height: 56px; margin: 0 auto 18px; display: block; stroke: var(--green); fill: none; stroke-width: 1.8; }
.privacy-band ul { list-style: none; padding: 0; margin: 0 auto 28px; max-width: 54ch; color: var(--muted); display: grid; gap: 8px; font-size: 18px; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-bottom: 1px solid var(--line); padding: 6px 0;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 4px; font-size: 18px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green); font-size: 24px; font-weight: 400; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); margin: 0 4px 18px; font-size: 16px; }

/* ---------- Content pages (privacy/terms/support) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 64px 0 88px; }
.doc h1 { font-size: clamp(32px, 6vw, 46px); letter-spacing: -0.02em; margin: 0 0 6px; }
.doc__date { color: var(--muted); margin: 0 0 8px; }
.doc h2 { font-size: 22px; margin: 2em 0 .5em; padding-top: .6em; border-top: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 1.4em 0 .3em; }
.doc ul { padding-left: 1.25em; }
.doc li { margin: .35em 0; }
.doc code { background: var(--card-alt); padding: 1px 7px; border-radius: 6px; font-size: .92em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 44px 0; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer__brand { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.footer__brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer__links a { color: var(--muted); font-size: 15px; }
.footer__copy { color: var(--muted); font-size: 14px; width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav__links { gap: 18px; }
  .nav__links a.hide-sm { display: none; }
  .grid { grid-template-columns: 1fr; }
  .shots { gap: 14px; max-width: 600px; }
  .section { padding: 64px 0; }
}
@media (max-width: 460px) {
  .shots { grid-template-columns: repeat(2, 1fr); max-width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary::after, .lang__chev, .lang > summary, .shot, .lightbox, .lightbox img { transition: none; }
  .lang__menu { animation: none; }
}
