
:root {
    --bg: #f8f9fb;
    --card-bg: #ffffff;
    --text-main: #101828;
    --text-sub: #667085;
    --line: #e4e7ec;
    --primary: #111827;
    --primary-weak: #f2f4f7;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
}

header {
    padding: 16px 18px 10px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(to bottom, #f8f9fb 75%, rgba(248, 249, 251, 0));
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.4px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cloud-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: #111827;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: none;
}

.site-desc {
    margin: 10px 2px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sub);
    word-break: break-word;
}

.app-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 18px 20px;
}

.app-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
}

.app-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    padding: 16px;
}

.app-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid var(--line);
    object-fit: cover;
    flex: none;
    background: #f2f4f7;
}

.app-main {
    min-width: 0;
    flex: 1;
}

.app-name {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-all;
}

.app-meta {
    margin-top: 5px;
    color: var(--text-sub);
    font-size: 12px;
}

.app-desc {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sub);
    word-break: break-word;
}

.card-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-get {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-get:active {
    transform: scale(0.98);
}

.btn-get:disabled,
.btn-get.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-get.is-loading {
    opacity: 0.88;
    pointer-events: none;
}

.btn-get.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    animation: spin 0.75s linear infinite;
}

.btn-backup {
    background: var(--primary-weak);
    color: var(--text-main);
    border: 1px solid var(--line);
}

.btn-backup.is-loading::after {
    border-color: rgba(16, 24, 40, 0.2);
    border-top-color: #111827;
}

.empty {
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text-sub);
    text-align: center;
    padding: 24px 12px;
    font-size: 14px;
}

.install-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    width: calc(100% - 32px);
    max-width: 520px;
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 10px;
    padding: 10px 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 30;
    text-align: center;
}

.install-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
