/* ==========================================================================
   AppleApp · 开发者 App 前台
   ========================================================================== */

:root {
    --aa-bg: #f2f2f7;
    --aa-card: #ffffff;
    --aa-text: #1c1c1e;
    --aa-sub: #8a8a8e;
    --aa-line: #ececef;
    --aa-dash: #d9d9de;
    --aa-blue: #007aff;
    --aa-blue-soft: #eef6ff;
    --aa-radius: 22px;
    --aa-shadow: 0 18px 50px rgba(24, 32, 48, 0.08);
    --aa-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC",
        "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--aa-text);
    font-family: var(--aa-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.aa-page {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 50% -180px, rgba(0, 122, 255, 0.10), transparent 70%),
        var(--aa-bg);
}

.aa-shell {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.aa-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   列表页
   -------------------------------------------------------------------------- */

.aa-list-shell {
    padding: 28px 16px 56px;
}

.aa-list-card {
    overflow: hidden;
    background: var(--aa-card);
    border: 1px solid rgba(0, 0, 0, 0.035);
    border-radius: var(--aa-radius);
}

.aa-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-top: 1px solid var(--aa-line);
    transition: background-color 0.16s ease;
}

.aa-row:first-child {
    border-top: 0;
}

.aa-row:hover {
    background: #fafafc;
}

.aa-row-main {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.aa-icon-wrap {
    display: block;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    overflow: hidden;
    background: linear-gradient(160deg, #eef4ff, #f7f8fa);
    border-radius: 15px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.aa-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aa-row-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.aa-row-title {
    overflow: hidden;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.aa-row-sub {
    overflow: hidden;
    color: var(--aa-sub);
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.aa-dl {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 16px;
    color: var(--aa-blue);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    background: var(--aa-blue-soft);
    border: 1px solid rgba(0, 122, 255, 0.22);
    border-radius: 999px;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.aa-dl:hover {
    color: #fff;
    background: var(--aa-blue);
    border-color: var(--aa-blue);
}

.aa-empty {
    padding: 72px 24px 76px;
    text-align: center;
    background: var(--aa-card);
    border: 1px solid rgba(0, 0, 0, 0.035);
    border-radius: var(--aa-radius);
}

.aa-empty-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 20px;
}

.aa-empty-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.aa-empty-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.aa-empty-text {
    margin: 8px 0 0;
    color: var(--aa-sub);
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   详情页
   -------------------------------------------------------------------------- */

.aa-detail-page {
    padding-bottom: 110px;
    background: var(--aa-bg);
}

.aa-detail-page.is-qr {
    padding-bottom: 210px;
}

.aa-detail-shell {
    min-height: 100vh;
    padding: 18px 22px 40px;
    background: #fff;
    box-shadow: var(--aa-shadow);
}

.aa-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 20px -6px;
    padding: 6px 6px 6px 2px;
    color: var(--aa-sub);
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    border-radius: 8px;
}

.aa-back svg {
    width: 18px;
    height: 18px;
}

.aa-back:hover {
    color: var(--aa-text);
}

.aa-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 2px 0 22px;
    border-bottom: 1px dashed var(--aa-dash);
}

.aa-hero-icon-wrap {
    display: block;
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    overflow: hidden;
    background: linear-gradient(160deg, #eef4ff, #f7f8fa);
    border-radius: 20px;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.05),
        0 8px 20px rgba(24, 32, 48, 0.12);
}

.aa-hero-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aa-hero-body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 2px;
}

.aa-hero-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.6px;
    overflow-wrap: anywhere;
}

.aa-hero-sub {
    margin: 7px 0 0;
    color: var(--aa-sub);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.aa-dl-hero {
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
    padding: 7px 19px;
    background: #fff;
}

.aa-intro {
    padding: 20px 0 22px;
    border-bottom: 1px dashed var(--aa-dash);
}

.aa-more-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.aa-more {
    padding: 4px 0;
    color: var(--aa-blue);
    font: inherit;
    font-size: 14px;
    line-height: 1;
    background: none;
    border: 0;
    cursor: pointer;
}

.aa-more:hover {
    opacity: 0.72;
}

.aa-desc {
    display: block;
    margin-top: 0;
    color: #3a3a3c;
    font-size: 15px;
    line-height: 1.75;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.aa-desc.is-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
}

.aa-shots {
    margin: 24px 0 0;
}

.aa-shots-track {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.aa-shot {
    flex: 0 0 86%;
    width: 86%;
    height: auto;
    background: #f6f6f8;
    border: 1px solid #ececef;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(24, 32, 48, 0.07);
    scroll-snap-align: center;
}

.aa-shot:only-child {
    flex-basis: 100%;
    width: 100%;
}

.aa-shots-hint {
    margin: 10px 2px 0;
    color: var(--aa-sub);
    font-size: 12px;
    line-height: 1.4;
}

.aa-sticky {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 20;
    width: 100%;
    max-width: 560px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #fff 62%, rgba(255, 255, 255, 0.86));
    transform: translateX(-50%);
}

.aa-qr-mini {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.aa-qr-mini-hero {
    flex: 0 0 auto;
}

.aa-qr-mini-img {
    display: block;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 6px;
}

/* 详情页顶部：图标 84px 的 0.65 左右 */
.aa-qr-mini-hero .aa-qr-mini-img {
    width: 60px;
    height: 60px;
}

.aa-qr-mini-text {
    color: #8e8e93;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.aa-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
}

.aa-qr-img {
    display: block;
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 10px;
}

.aa-qr-text {
    margin: 0;
    color: #8e8e93;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.aa-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    background: var(--aa-blue);
    border-radius: 15px;
    box-shadow: 0 10px 26px rgba(0, 122, 255, 0.28);
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.aa-cta svg {
    width: 20px;
    height: 20px;
}

.aa-cta:hover {
    background: #006fe8;
}

.aa-cta:active {
    transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
    .aa-list-shell {
        padding: 56px 16px 72px;
    }

    .aa-detail-page {
        padding: 32px 0 120px;
    }

    .aa-detail-shell {
        min-height: calc(100vh - 64px);
        border-radius: 28px;
        padding: 22px 30px 44px;
    }

    .aa-sticky {
        bottom: 18px;
        border-radius: 0 0 24px 24px;
    }
}

@media (max-width: 400px) {
    .aa-list-shell {
        padding: 18px 12px 44px;
    }

    .aa-row {
        padding: 13px 14px;
    }

    .aa-row-main {
        gap: 12px;
    }

    .aa-icon-wrap {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .aa-row-title {
        font-size: 16px;
    }

    .aa-dl {
        padding: 6px 13px;
    }

    .aa-detail-shell {
        padding: 16px 16px 36px;
    }

    .aa-hero-icon-wrap {
        width: 72px;
        height: 72px;
        border-radius: 18px;
    }

    .aa-hero-title {
        font-size: 22px;
    }
}

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

:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.45);
    outline-offset: 2px;
}
