:root {
    --bg: #f4f5f7;
    --ink: #0d0f13;
    --ink-2: #343a45;
    --muted: #77808f;
    --line: rgba(15, 23, 42, 0.07);
    --line-strong: rgba(15, 23, 42, 0.12);
    --card: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.9);
    --accent: #3b6ef6;
    --ok: #0fa968;
    --radius: 22px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.03), 0 14px 34px -18px rgba(16, 24, 40, 0.22);
    --shadow-lg: 0 30px 80px -24px rgba(16, 24, 40, 0.38);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--font);
    background:
        radial-gradient(1100px 720px at 10% -12%, #dde8ff 0%, rgba(221, 232, 255, 0) 62%),
        radial-gradient(900px 640px at 96% 0%, #ffe3ee 0%, rgba(255, 227, 238, 0) 58%),
        radial-gradient(1100px 820px at 52% 112%, #d9f7ea 0%, rgba(217, 247, 234, 0) 62%),
        linear-gradient(180deg, #f8f9fb 0%, #f2f3f6 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

button,
input,
select {
    font-family: inherit;
}

::selection {
    background: rgba(59, 110, 246, 0.18);
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.header-inner {
    height: 66px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #2f6bff 0%, #7a5cff 100%);
    box-shadow: 0 6px 16px -6px rgba(59, 110, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand-name {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.header-search {
    flex: 1;
    min-width: 0;
    max-width: 380px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.header-search:focus-within {
    background: #fff;
    border-color: rgba(59, 110, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.1);
}

.header-search svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
    flex-shrink: 0;
}

.header-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
    color: var(--ink);
}

.header-search input::placeholder {
    color: #98a0ad;
}

.header-search kbd {
    font-family: var(--font);
    font-size: 10px;
    color: #9aa2ae;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.7);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.soft-pill,
.env-pill {
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.soft-pill:hover,
.env-pill:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -10px rgba(16, 24, 40, 0.25), inset 0 1px 0 #fff;
}

.soft-pill svg {
    width: 14px;
    height: 14px;
}

.env-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c3c8d1;
    box-shadow: 0 0 0 3px rgba(195, 200, 209, 0.18);
    transition: 0.2s;
}

.env-pill.has-env .env-dot {
    background: #16b877;
    box-shadow: 0 0 0 3px rgba(22, 184, 119, 0.16);
}

/* ---------- Env banner ---------- */
.env-banner-wrap {
    padding-top: 18px;
}

.env-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 16px 14px 20px;
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.85), rgba(240, 246, 255, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 40px -28px rgba(16, 24, 40, 0.35), inset 0 1px 0 #fff;
}

.env-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.env-banner-text strong {
    font-size: 13px;
}

.env-banner-text span {
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Hero ---------- */
.hero {
    padding: 54px 2px 26px;
}

.eyebrow {
    display: inline-block;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.16em;
    color: #6b7280;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 #fff;
}

.hero h1 {
    margin: 16px 0 10px;
    font-size: clamp(34px, 4.6vw, 52px);
    line-height: 1.06;
    letter-spacing: -0.035em;
    font-weight: 800;
}

.hero-desc {
    margin: 0;
    max-width: 620px;
    font-size: 14.5px;
    line-height: 1.75;
    color: #5f6673;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 #fff;
}

.stat strong {
    font-size: 15px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.stat span {
    font-size: 11.5px;
    color: var(--muted);
}

/* ---------- Toolbar ---------- */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0 12px;
}

.chip-scroll {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: 0 0 auto;
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: rgba(255, 255, 255, 0.62);
    color: #4b5360;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    -webkit-tap-highlight-color: transparent;
}

.chip:hover {
    background: #fff;
    color: var(--ink);
}

.chip.is-active {
    background: #111318;
    border-color: #111318;
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(17, 19, 24, 0.8);
}

.chip-count {
    font-size: 10px;
    color: #9aa2ae;
    font-variant-numeric: tabular-nums;
}

.chip.is-active .chip-count {
    color: rgba(255, 255, 255, 0.55);
}

.toolbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.segment {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.seg-btn {
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: 0.2s;
}

.seg-btn:hover {
    color: var(--ink);
}

.seg-btn.is-active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.1);
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.14);
    position: relative;
    transition: 0.22s;
}

.switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25);
    transition: 0.22s;
}

.switch input:checked + .switch-track {
    background: #16b877;
}

.switch input:checked + .switch-track .switch-knob {
    transform: translateX(16px);
}

.switch-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #4b5360;
}

.select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    padding: 0 32px 0 13px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: rgba(255, 255, 255, 0.62);
    color: #4b5360;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    outline: 0;
}

.select-wrap svg {
    position: absolute;
    right: 10px;
    width: 14px;
    height: 14px;
    color: #8b93a0;
    pointer-events: none;
}

.result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 22px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--muted);
}

.result-hint {
    color: #0b8f5e;
    font-weight: 600;
}

/* ---------- Grid & Card ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding-bottom: 10px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.64) 100%);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.28s, border-color 0.28s, opacity 0.2s;
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    opacity: 0.8;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03), 0 26px 50px -26px rgba(16, 24, 40, 0.32), inset 0 1px 0 #fff;
}

.card.is-compatible {
    border-color: rgba(22, 184, 119, 0.32);
    box-shadow: 0 0 0 1px rgba(22, 184, 119, 0.08), var(--shadow-sm), inset 0 1px 0 #fff;
}

.card.is-dimmed {
    opacity: 0.55;
}

.card.is-dimmed:hover {
    opacity: 0.8;
}

.tag-compat {
    background: rgba(22, 184, 119, 0.12);
    color: #077a57;
    box-shadow: inset 0 0 0 1px rgba(22, 184, 119, 0.2);
}

.tag-compat::before {
    content: "✓";
    margin-right: 3px;
    font-size: 9px;
}

.card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 0;
}

.app-icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 15px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 10px 20px -12px rgba(16, 24, 40, 0.35);
}

.card-title {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.card-title h3 {
    margin: 0 0 3px;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pkg {
    font-size: 11px;
    color: #8b93a0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.ver {
    flex-shrink: 0;
    padding: 3px 7px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.045);
    color: #6b7280;
    font-size: 10.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}


.card-desc {
    margin: 0;
    min-height: 38px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #5c6472;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.jb-rootful {
    background: rgba(245, 158, 11, 0.12);
    color: #a45f07;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}

.jb-rootless {
    background: rgba(16, 185, 129, 0.11);
    color: #077a57;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.16);
}

.jb-roothide {
    background: rgba(139, 92, 246, 0.12);
    color: #6733c4;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.16);
}

.jb-arm64e {
    background: rgba(59, 130, 246, 0.11);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.tag-section {
    background: rgba(15, 23, 42, 0.04);
    color: #7a828f;
    font-weight: 550;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #8b93a0;
    font-variant-numeric: tabular-nums;
}

.card-meta span + span::before {
    content: "·";
    margin-right: 8px;
    color: #c3c8d1;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(180deg, #23262d 0%, #0b0d11 100%);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(11, 13, 17, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -12px rgba(11, 13, 17, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    width: 76px;
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(15, 23, 42, 0.09);
    color: var(--ink-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn-ghost:hover {
    background: #fff;
}

.btn-dark {
    background: #111318;
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(11, 13, 17, 0.8);
}

.btn-sm {
    height: 32px;
    padding: 0 13px;
    font-size: 12px;
    border-radius: 10px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- Empty ---------- */
.empty {
    text-align: center;
    padding: 60px 20px 40px;
    color: var(--muted);
}

.empty-first {
    padding: 40px 20px 20px;
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.9);
    font-size: 22px;
    color: #9aa2ae;
    box-shadow: var(--shadow-sm);
}

.empty h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--ink);
}

.empty p {
    margin: 0 0 16px;
    font-size: 12.5px;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 46px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    background: rgba(255, 255, 255, 0.35);
}

.footer-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 11.5px;
    color: #8b93a0;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-right a,
.link-btn {
    color: #6b7280;
    text-decoration: none;
    border: 0;
    background: none;
    padding: 0;
    font-size: 11.5px;
    cursor: pointer;
}

.footer-right a:hover,
.link-btn:hover {
    color: var(--ink);
}

.footer-sep {
    color: #ced3da;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 18, 0.3);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    opacity: 0;
    transition: opacity 0.26s;
}

.modal.is-open .modal-backdrop {
    opacity: 1;
}

.modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: 88vh;
    overflow: auto;
    padding: 28px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(34px) saturate(160%);
    -webkit-backdrop-filter: blur(34px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 50px 120px -30px rgba(16, 24, 40, 0.4), inset 0 1px 0 #fff;
    transform: translateY(20px) scale(0.985);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.26s;
}

.modal.is-open .modal-panel {
    transform: none;
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    color: #6b7280;
    cursor: pointer;
    transition: 0.2s;
    z-index: 3;
}

.modal-close:hover {
    background: #fff;
    color: var(--ink);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-panel::-webkit-scrollbar {
    width: 8px;
}

.modal-panel::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

/* Detail */
.detail-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-right: 40px;
}

.detail-loading {
    padding: 46px 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.detail-icon {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 16px 30px -18px rgba(16, 24, 40, 0.4);
}

.detail-title {
    flex: 1;
    min-width: 0;
}

.detail-title h2 {
    margin: 2px 0 4px;
    font-size: 23px;
    font-weight: 780;
    letter-spacing: -0.025em;
}

.detail-pkg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: #8b93a0;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

.detail-pkg:hover {
    color: var(--ink);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 22px 0 4px;
}

.detail-stat {
    padding: 11px 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 1px 0 #fff;
}

.detail-stat b {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 2px;
}

.detail-stat span {
    font-size: 10.5px;
    color: var(--muted);
}

.detail-section {
    margin-top: 24px;
}

.detail-section h3 {
    margin: 0 0 11px;
    font-size: 12.5px;
    font-weight: 750;
    color: #3f4652;
    letter-spacing: 0.01em;
}

.detail-desc {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.85;
    color: #454c58;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-empty {
    font-size: 12.5px;
    color: #9aa2ae;
}

.shots {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.shots::-webkit-scrollbar {
    display: none;
}

.shots img {
    width: 150px;
    height: 268px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #eef0f4;
    flex-shrink: 0;
}

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: inset 0 1px 0 #fff;
    transition: 0.2s;
}

.variant.is-compat {
    border-color: rgba(22, 184, 119, 0.38);
    background: rgba(241, 253, 247, 0.8);
}

.variant-main {
    flex: 1;
    min-width: 0;
}

.variant-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 650;
    flex-wrap: wrap;
}

.variant-title .ver {
    margin: 0;
}

.variant-meta {
    margin-top: 4px;
    font-size: 11px;
    color: #8b93a0;
    font-variant-numeric: tabular-nums;
}

.variant-meta span + span::before {
    content: "·";
    margin: 0 6px;
    color: #c3c8d1;
}

.variant .btn {
    height: 32px;
    padding: 0 13px;
    font-size: 12px;
    flex: 0 0 auto;
}

.variant-note {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #0b8f5e;
    font-weight: 650;
}

/* Env modal */
.env-panel {
    width: min(520px, 100%);
}

.env-panel h2 {
    margin: 2px 0 6px;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.modal-sub {
    margin: 0 0 20px;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--muted);
}

.env-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.env-option {
    text-align: left;
    padding: 13px 12px;
    border-radius: 15px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.env-option strong {
    display: block;
    font-size: 13.5px;
    margin-bottom: 3px;
    color: var(--ink);
}

.env-option span {
    display: block;
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--muted);
}

.env-option:hover {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.18);
}

.env-option.is-active {
    background: #fff;
    border-color: #111318;
    box-shadow: 0 0 0 1.5px #111318 inset, 0 10px 20px -16px rgba(16, 24, 40, 0.5);
}

.field-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    font-size: 11.5px;
    color: var(--muted);
}

.field input {
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    color: var(--ink);
    outline: 0;
    transition: 0.2s;
}

.field input:focus {
    border-color: rgba(59, 110, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.1);
    background: #fff;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    font-size: 11.5px;
    color: #4b5360;
    cursor: pointer;
    white-space: nowrap;
}

.check input {
    accent-color: #111318;
    width: 15px;
    height: 15px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.modal-actions .btn {
    min-width: 88px;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 200;
    transform: translate(-50%, 14px);
    max-width: min(88vw, 520px);
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(17, 19, 24, 0.92);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 12.5px;
    font-weight: 550;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: 0.26s;
    text-align: center;
}

.toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .header-search {
        max-width: none;
    }

    .header-search kbd {
        display: none;
    }

    .soft-pill {
        display: none;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    }
}

@media (max-width: 720px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        gap: 8px 10px;
        padding: 9px 0;
    }

    .brand {
        order: 1;
    }

    .header-actions {
        order: 2;
    }

    .header-search {
        order: 3;
        flex: 1 0 100%;
        max-width: none;
        height: 38px;
    }

    .brand-name {
        display: none;
    }

    .header-search kbd {
        display: none;
    }

    .env-pill {
        padding: 0 11px;
    }

    .hero {
        padding: 36px 0 18px;
    }

    .hero h1 {
        margin-top: 14px;
    }

    .hero-desc {
        font-size: 13.5px;
    }

    .stats {
        margin-top: 18px;
    }

    .toolbar {
        margin-top: 18px;
    }

    .switch {
        margin-left: 0;
    }

    .toolbar-tools {
        gap: 8px;
    }

    .chip-scroll {
        flex-wrap: wrap;
        overflow: visible;
        padding-bottom: 0;
    }

    .segment {
        flex: 1 0 100%;
    }

    .segment .seg-btn {
        flex: 1;
    }

    .select-wrap {
        margin-left: auto;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .env-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .result-hint {
        display: none;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-panel {
        width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    }

    .modal-close {
        top: 14px;
        right: 14px;
    }

    .detail-head {
        padding-right: 36px;
    }

    .detail-icon {
        width: 66px;
        height: 66px;
        border-radius: 17px;
    }

    .detail-title h2 {
        font-size: 20px;
    }

    .detail-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .detail-stat {
        padding: 9px 10px;
    }

    .variant {
        flex-wrap: wrap;
    }

    .variant .btn {
        width: 100%;
    }

    .env-options {
        grid-template-columns: 1fr;
    }

    .field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .check {
        height: auto;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 24px;
    }
}

@media (max-width: 420px) {
    .header-inner {
        gap: 8px 10px;
    }

    .env-pill {
        margin-left: auto;
    }

    .card {
        padding: 16px;
    }

    .app-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
}

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