:root {
    --home-bg: #eef3fb;
    --home-bg-soft: #f7f9fd;
    --home-card: rgba(255, 255, 255, 0.88);
    --home-text: #1a2332;
    --home-muted: #64748b;
    --home-border: rgba(100, 116, 139, 0.16);
    --home-accent: #3b82f6;
    --home-accent-soft: #60a5fa;
    --home-accent-glow: rgba(59, 130, 246, 0.22);
    --home-radius: 20px;
    --home-radius-sm: 14px;
    --home-shadow: 0 16px 48px rgba(59, 130, 246, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.home-page {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--home-text);
    background: linear-gradient(180deg, #e8f0fe 0%, var(--home-bg) 180px, var(--home-bg) 100%);
    padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
    position: relative;
    overflow-x: hidden;
}

.home-bg {
    display: none;
}

.home-wrap {
    max-width: 440px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.home-card {
    background: #fff;
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    border: 1px solid rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.home-card::before {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--home-accent), var(--home-accent-soft), transparent);
}

.home-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 20px 10px;
}

.home-hero-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.home-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: 0 8px 24px var(--home-accent-glow);
}

.home-hero-icon-wrap::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    pointer-events: none;
}

.home-hero-text h1 {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--home-accent);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
}

.home-hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--home-accent);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.home-hero-text p {
    margin: 0;
    font-size: 13px;
    color: var(--home-muted);
}

.home-links {
    display: flex;
    gap: 10px;
    padding: 8px 20px 18px;
}

.home-link-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--home-radius-sm);
    border: 1px solid var(--home-border);
    background: rgba(255, 255, 255, 0.75);
    color: var(--home-accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.home-link-btn:active {
    transform: scale(0.98);
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.28);
}

.home-form {
    padding: 4px 20px 22px;
}

.home-field {
    margin-bottom: 16px;
}

.home-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.home-label-icon {
    font-size: 14px;
    color: var(--home-accent);
    opacity: 0.85;
}

.home-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.home-input {
    flex: 1;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-sm);
    background: #f8fafc;
    font-size: 15px;
    color: var(--home-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
}

.home-input:focus {
    border-color: rgba(59, 130, 246, 0.55);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.home-input::placeholder {
    color: #94a3b8;
}

.home-btn-secondary {
    flex-shrink: 0;
    height: 50px;
    padding: 0 14px;
    border-radius: var(--home-radius-sm);
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
    color: var(--home-accent);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}

.home-btn-secondary:active {
    transform: scale(0.98);
    background: rgba(59, 130, 246, 0.12);
}

.home-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.home-section-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--home-muted);
}

.install-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.install-card {
    position: relative;
    display: block;
    cursor: pointer;
    margin: 0;
}

.install-card-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.install-card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 84px;
    padding: 12px 8px;
    border-radius: var(--home-radius-sm);
    border: 1.5px solid var(--home-border);
    background: #f8fafc;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.install-card:active .install-card-inner {
    transform: scale(0.98);
}

.install-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.install-card-icon--placeholder,
.install-card-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 14px;
    font-weight: 700;
    color: var(--home-accent);
}

.install-card-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.35;
    color: #1e293b;
    word-break: break-all;
    max-width: 100%;
}

.install-card-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--home-accent), var(--home-accent-soft));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px var(--home-accent-glow);
}

.install-card.is-selected .install-card-inner {
    border-color: rgba(59, 130, 246, 0.65);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 6px 20px rgba(59, 130, 246, 0.1);
}

.install-card.is-selected .install-card-check {
    opacity: 1;
    transform: scale(1);
}

.home-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
}

.home-agree input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--home-accent);
}

.home-submit {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: var(--home-radius-sm);
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 28px var(--home-accent-glow);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.home-submit:active {
    transform: scale(0.98);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
}

.home-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.home-faq-wrap {
    margin-top: 16px;
}

.home-faq {
    background: #fff;
    border-radius: var(--home-radius);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.06);
    margin-bottom: 10px;
    overflow: hidden;
}

.home-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    position: relative;
    padding-right: 36px;
}

.home-faq summary::-webkit-details-marker {
    display: none;
}

.home-faq summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 400;
    color: var(--home-muted);
}

.home-faq[open] summary::after {
    content: "−";
    color: var(--home-accent);
}

.home-faq-body {
    padding: 0 18px 16px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.65;
}

.home-faq-body ul {
    margin: 0;
    padding-left: 18px;
}

.home-faq-body li {
    margin-bottom: 8px;
}

.home-tutorial {
    color: #475569;
}

.home-tutorial p {
    margin: 0 0 10px;
}

.home-tutorial ul,
.home-tutorial ol {
    margin: 0 0 10px;
    padding-left: 18px;
}

.home-tutorial li {
    margin-bottom: 6px;
}

.home-tutorial h1,
.home-tutorial h2,
.home-tutorial h3,
.home-tutorial h4 {
    margin: 12px 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.home-tutorial img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.home-footer-note {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: var(--home-muted);
}

.home-result-modal.layui-layer {
    border-radius: 18px !important;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.15) !important;
    background: #fff !important;
}

.home-result-modal .layui-layer-title {
    background: #f8fafc !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15) !important;
    color: #1e293b !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 14px 18px !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.home-result-modal .layui-layer-setwin .layui-layer-close {
    color: #64748b !important;
}

.home-result-modal .layui-layer-content {
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
}

.home-result-box {
    padding: 18px 18px 20px;
}

.home-result-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--home-accent);
    background: #eff6ff;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
}

.home-result-text {
    margin: 0 0 16px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.home-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-result-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.home-result-btn:active {
    transform: scale(0.98);
}

.home-result-btn--primary {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #fff;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.25);
}

.home-result-btn--ghost {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #334155;
}

.home-result-btn--subtle {
    background: transparent;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    color: #64748b;
    height: 42px;
    font-size: 14px;
}

.layui-layer-msg {
    border-radius: 12px !important;
}

@media (max-width: 360px) {
    .install-cards {
        grid-template-columns: 1fr 1fr;
    }

    .home-input-row {
        flex-direction: column;
    }

    .home-btn-secondary {
        width: 100%;
    }
}
