/* ===== Reset & Base ===== */
* {
    border: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    text-size-adjust: 100%;
    user-select: none;
    color: #333;
    width: var(--app-width, 100%);
    margin: 0 auto;
    overflow: hidden;
    height: 100dvh;
    background-color: #010226;
}

img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    transform: scale(1);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    font-family: inherit;
}

button:active {
    transform: scale(0.95);
    filter: brightness(0.88);
    transition-duration: 0.08s;
}

/* ===== Loading ===== */
.global-loading {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
}

.global-loading.is-hidden {
    display: none;
}

.global-loading .loading-cont {
    width: 10rem;
    height: 7rem;
    border-radius: 1.25rem;
    background: #151515;
    padding-top: 1rem;
    text-align: center;
}

.global-loading .loading-title {
    font-size: 0.75rem;
    color: #fff;
}

.global-loading .loading-img {
    width: 2.5rem;
    height: 2.5rem;
    margin: 1rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Home ===== */
.home {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #010226;
    background-image: linear-gradient(135deg, #010226 0%, #0a0a3e 50%, #1a0533 100%);
    background-repeat: no-repeat;
    background-size: cover;
}

.business-contact {
    position: fixed;
    top: 13%;
    right: 0.625rem;
    z-index: 100;
    width: 3.75rem;
    height: 3.75rem;
    background-color: rgba(0, 0, 0, 0.26);
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.625rem;
}

.home-top {
    position: relative;
    z-index: 20;
    width: 100%;
    height: auto;
    min-height: 4.1875rem;
    flex-shrink: 0;
    padding: env(safe-area-inset-top, 0) 0.875rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.4);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.375rem 0;
}

.logo {
    width: 2.8125rem;
    height: 2.8125rem;
    flex-shrink: 0;
    border-radius: 0.625rem;
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-name {
    color: #ff54f5;
    font-size: 1rem;
    font-weight: 700;
}

.app-tips {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 0.125rem;
}

.top-right-btn {
    width: 6.125rem;
    height: 1.875rem;
    flex-shrink: 0;
    background: linear-gradient(90deg, #ff54f5, #a855f7);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.375rem 0;
}

.home-h5 {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 0.75rem calc(1rem + env(safe-area-inset-bottom, 0));
    overflow: hidden;
}

.hero-stage {
    position: relative;
    width: 100%;
    max-width: 22rem;
    flex: 0 0 auto;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 18rem;
}

.hero-phone {
    width: min(58vw, 12.5rem);
    aspect-ratio: 9 / 16;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 40px rgba(255, 84, 245, 0.35), 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero-filmstrip {
    position: absolute;
    right: 0.5rem;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 3;
    transform: rotate(6deg);
}

.hero-filmstrip img {
    width: 3.2rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 0.35rem;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.25rem;
    z-index: 4;
    text-align: center;
    padding: 2.5rem 0.5rem 0.5rem;
    background: linear-gradient(transparent, rgba(1, 2, 38, 0.95) 55%);
}

.cta-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ff54f5, #ff8a80, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(255, 84, 245, 0.5));
}

.cta-subtitle {
    font-size: 0.85rem;
    color: #ff8ec8;
    margin-top: 0.4rem;
    line-height: 1.45;
    padding: 0 0.75rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.cat-gallery {
    display: flex;
    gap: 0.35rem;
    width: 100%;
    max-width: 22rem;
    margin-top: 1.25rem;
    padding: 0 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cat-gallery::-webkit-scrollbar {
    display: none;
}

.cat-item {
    position: relative;
    flex: 0 0 auto;
    width: 3.3rem;
    height: 5rem;
    border-radius: 0.35rem;
    overflow: hidden;
    border: 1px solid rgba(255, 84, 245, 0.35);
}

.cat-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-item span {
    position: absolute;
    left: 0;
    top: 0;
    writing-mode: vertical-rl;
    background: rgba(168, 85, 247, 0.85);
    color: #fff;
    font-size: 0.55rem;
    padding: 0.25rem 0.1rem;
    letter-spacing: 0.05em;
}

.home-cta {
    position: relative;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 1rem;
}

.promo-line {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 84, 245, 0.6);
    margin-bottom: 0.5rem;
}

.download-btn {
    width: min(60vw, 14rem);
    height: 3.2rem;
    background: linear-gradient(90deg, #ff54f5, #a855f7);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 84, 245, 0.4);
    padding: 0;
}

.download-btn:hover {
    box-shadow: 0 6px 30px rgba(255, 84, 245, 0.6);
}

/* ===== Install Guide ===== */
.install-guide {
    display: block;
    position: fixed;
    width: var(--app-width, 100%);
    height: 100dvh;
    z-index: 1500;
    top: 0;
    left: -200vw;
    transform: translateX(-50%);
    overflow-y: auto;
    font-size: 0.875rem;
    pointer-events: none;
    background: linear-gradient(180deg, #e8f4ff 0%, #f6f6f6 30%);
}

.install-guide.is-open {
    left: 50%;
    pointer-events: auto;
}

.guide-header {
    position: relative;
    width: 100%;
}

.title-bar {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.625rem;
    width: 100%;
    z-index: 11;
}

.title-bar > * {
    flex: 1;
    display: flex;
}

.back-btn {
    background: none;
    color: #000;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-title {
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #000;
    font-weight: 400;
    font-size: 1.125rem;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.625rem 1.5625rem;
    margin-top: 1.875rem;
}

.guide-heading h2 {
    color: #000;
    font-size: 1.5rem;
    font-weight: 600;
}

.guide-heading p {
    color: #000;
    font-size: 0.75rem;
    font-weight: 400;
}

.guide-tip {
    color: #000;
    font-size: 0.75rem;
    margin-top: 0.9rem;
}

.dl-btns {
    display: inline-flex;
    margin-top: 0.625rem;
}

.link-btn {
    width: 5.625rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff, #e0e0e0);
    color: #1f1f1f;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
    border: 2px solid orangered;
}

.guide-note {
    border-radius: 0.875rem;
    padding: 0.625rem;
    background-color: rgba(255,255,255,0.34);
    color: #4d4d4d;
    font-size: 0.75rem;
    line-height: 1.6;
}

.guide-section { margin-top: 0.5rem; }

.guide-section .step {
    font-size: 0.875rem;
    font-weight: 500;
    color: #000;
    margin-top: 0.5rem;
}

.step-img {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0.625rem 0 0.9375rem;
}

.step-img img {
    width: 90%;
    border-radius: 0.625rem;
}

.android-section p {
    font-size: 0.875rem;
    color: #000;
}

/* ===== Responsive ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (max-width: 767px) and (max-height: 700px) {
    .home-top { min-height: 3rem; }
    .logo { width: 2.4rem; height: 2.4rem; }
    .top-right-btn { width: 5.5rem; height: 1.75rem; font-size: 0.7rem; }
    .hero-stage { min-height: 14rem; }
    .hero-phone { width: min(48vw, 10rem); }
    .cta-title { font-size: 1.6rem; }
    .cat-item { width: 2.8rem; height: 4.2rem; }
}

@media (max-width: 767px) and (max-height: 620px) {
    .hero-stage { min-height: 12rem; }
    .cta-title { font-size: 1.4rem; }
    .cta-subtitle { font-size: 0.75rem; }
}
