/* Liquid Glass material · subset of the design's assets/liquid-glass-ios27.css (r27–r41).
   Tiers used by this page: .lg-pill (S), .lg-pill-lg (M). (.lg-card / .lg-sheet removed 2026-10-15: unused, off the corner steps.)
   The page is light-only; the source's dark recipe is carried over as the scoped [data-lg-theme="dark"] variant
   (2026-10-10), used where glass sits on a dark surface (the hardware panel). */

:root {
  --lg-surface: 252 251 248;
  --lg-opacity: .3;
  --lg-blur: 24px;
  --lg-saturate: 1.6;
  --lg-rim: rgb(0 0 0 / .22);
  --lg-glow-y: 5px;
  --lg-glow-blur: 6px;
  --lg-line: 1.5px;
  --lg-ring: 2px;
  --lg-hair: 1px;
  --lg-shade-y: 12px;
  --lg-shade-blur: 18px;
  --lg-shade-spread: -10px;
  --lg-drop-1: 0 1px 2px rgb(0 0 0 / .06);
  --lg-drop-2: 0 4px 12px rgb(0 0 0 / .05);
  --lg-sheen-a: 3px;
  --lg-sheen-b: 16px;
  --lg-text: rgb(0 0 0 / .92);
}

.lg {
  position: relative;
  isolation: isolate;
  color: var(--lg-text);
  border-radius: var(--lg-radius, 22px);
  --lg-sheen: linear-gradient(180deg, rgb(255 255 255 / .6) 0, rgb(255 255 255 / .2) var(--lg-sheen-a), rgb(255 255 255 / 0) var(--lg-sheen-b), rgb(255 255 255 / 0) calc(100% - var(--lg-sheen-b)), rgb(255 255 255 / .15) calc(100% - var(--lg-sheen-a)), rgb(255 255 255 / .5) 100%);
  background: var(--lg-sheen), rgb(var(--lg-surface) / var(--lg-opacity));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  --lg-shadow:
    inset 0 0 0 .5px var(--lg-rim),
    inset 0 0 0 var(--lg-hair) rgb(255 255 255 / .7),
    inset 0 var(--lg-line) 0 -.5px rgb(255 255 255 / 1),
    inset 0 calc(-1 * var(--lg-line)) 0 -.5px rgb(255 255 255 / 1),
    inset 0 var(--lg-glow-y) var(--lg-glow-blur) -2px rgb(255 255 255 / 1),
    inset 0 calc(-1 * var(--lg-glow-y)) var(--lg-glow-blur) -2px rgb(255 255 255 / 1),
    inset 0 var(--lg-shade-y) var(--lg-shade-blur) var(--lg-shade-spread) rgb(0 0 0 / .07),
    inset 0 calc(-1 * var(--lg-shade-y)) var(--lg-shade-blur) var(--lg-shade-spread) rgb(0 0 0 / .06),
    var(--lg-drop-1),
    var(--lg-drop-2);
  box-shadow: var(--lg-shadow);
}

/* vertical highlight ring: brightest at top and bottom edges */
.lg::before {
  content: "";
  position: absolute;
  inset: .5px;
  border-radius: inherit;
  corner-shape: inherit;
  padding: var(--lg-ring);
  background: linear-gradient(180deg, rgb(255 255 255 / 1) 0%, rgb(255 255 255 / .4) 15%, rgb(255 255 255 / .1) 50%, rgb(255 255 255 / .5) 78%, rgb(255 255 255 / 1) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* side darkening: .5px dark ends, clear middle */
.lg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  corner-shape: inherit;
  padding: .5px;
  background: linear-gradient(90deg, rgb(0 0 0 / .25), rgb(0 0 0 / .25) 6%, transparent 13%, transparent 87%, rgb(0 0 0 / .25) 94%, rgb(0 0 0 / .25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
.lg-pill::before, .lg-pill-lg::before { border-radius: 999px; }

/* capsules: side darkening sized by height, not width */
.lg-pill::after, .lg-pill-lg::after {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1' viewBox='0 0 1 1'%3E%3ClinearGradient id='g'%3E%3Cstop offset='0' stop-opacity='.25'/%3E%3Cstop offset='.2' stop-opacity='.25'/%3E%3Cstop offset='.5' stop-opacity='0'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E") left center / auto 100% no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='1' x2='0'%3E%3Cstop offset='0' stop-opacity='.25'/%3E%3Cstop offset='.2' stop-opacity='.25'/%3E%3Cstop offset='.5' stop-opacity='0'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E") right center / auto 100% no-repeat;
}
.lg-pill {
  --lg-radius: 999px;
  --lg-glow-y: 2px; --lg-glow-blur: 3px; --lg-line: 1px; --lg-hair: .5px; --lg-ring: 1px;
  --lg-shade-y: 6px; --lg-shade-blur: 10px; --lg-shade-spread: -6px;
  --lg-drop-1: 0 .5px 1px rgb(0 0 0 / .06);
  --lg-drop-2: 0 2px 6px rgb(0 0 0 / .05);
  --lg-sheen-a: 2px; --lg-sheen-b: 8px;
  --lg-blur: 12px;
}
.lg-pill-lg {
  --lg-radius: 999px;
  --lg-glow-y: 3px; --lg-glow-blur: 4px; --lg-line: 1px; --lg-hair: 1px; --lg-ring: 1px;
  --lg-shade-y: 8px; --lg-shade-blur: 12px; --lg-shade-spread: -7px;
  --lg-drop-1: 0 1px 2px rgb(0 0 0 / .06);
  --lg-drop-2: 0 3px 9px rgb(0 0 0 / .05);
  --lg-sheen-a: 2px; --lg-sheen-b: 10px;
  --lg-blur: 16px;
}

/* Dark glass (2026-10-10), the source's r27 dark recipe (iOS native): a deep grey body at .55, a dark .5px rim, a faint
   edge light instead of the white ring and sheen (they glow on dark), a deeper lift. The edge light mirrors the light
   recipe's side darkening (same 6% / 13% stops): bright at the two ends, dim along the middle.
   Scoped to [data-lg-theme="dark"] on any ancestor; the page itself stays light. */
[data-lg-theme="dark"] {
  --lg-surface: 28 28 30;
  --lg-opacity: .55;
  --lg-blur: 28px;
  --lg-saturate: 1.5;
  --lg-rim: rgb(0 0 0 / .55);
  --lg-edge-hi: rgb(255 255 255 / .14); /* was .36 / .2: on the page's dark films and panel it read as a bright outline (2026-10-23/25, the user: “太亮了”). Kept 1px wide: a .5px ring drew broken on the straight runs (2026-10-25, the user: “断断续续”) */
  --lg-edge-lo: rgb(255 255 255 / .1);
  --lg-lift: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .45);
  --lg-text: rgb(255 255 255 / .94);
}
[data-lg-theme="dark"] .lg { background: rgb(var(--lg-surface) / var(--lg-opacity)); box-shadow: inset 0 0 0 .5px var(--lg-rim), var(--lg-lift); }
[data-lg-theme="dark"] .lg::before { background: linear-gradient(90deg, var(--lg-edge-hi), var(--lg-edge-hi) 6%, var(--lg-edge-lo) 13%, var(--lg-edge-lo) 87%, var(--lg-edge-hi) 94%, var(--lg-edge-hi)); }
[data-lg-theme="dark"] .lg::after { display: none; }
[data-lg-theme="dark"] :is(.lg-pill) { --lg-lift: 0 .5px 1px rgb(0 0 0 / .4), 0 5px 15px rgb(0 0 0 / .45); }
[data-lg-theme="dark"] .lg-pill-lg { --lg-lift: 0 1px 2px rgb(0 0 0 / .4), 0 7.5px 22.5px rgb(0 0 0 / .45); }

/* large glass surfaces: drop the highlight ring so it does not read as a border */
.lg-flat::before { display: none; }

@media (prefers-reduced-transparency: reduce) {
  :root { --lg-opacity: .97; --lg-blur: 0px; }
  .lg-pill, .lg-pill-lg { --lg-blur: 0px; }
  .lg::before { display: none; }
}
