/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d8a4e;
    --primary-light: #4caf7c;
    --primary-dark: #1e5f35;
    --accent-color: #f5a623;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.25);
}

html,
body {
    height: 100%;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        linear-gradient(135deg,
            rgba(34, 85, 50, 0.92) 0%,
            rgba(45, 138, 78, 0.88) 30%,
            rgba(76, 175, 124, 0.85) 60%,
            rgba(139, 195, 160, 0.9) 100%),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=1920&q=80') center/cover no-repeat fixed;
    background-blend-mode: overlay;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(245, 166, 35, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* 头部样式 */
.header {
    position: relative;
    z-index: 10;
    padding: 2rem 1.5rem 1rem;
    text-align: center;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.logo-icon {
    width: 60px;
    height: 60px;
    color: var(--text-primary);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.title-group {
    text-align: left;
}

.main-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.08em;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    font-weight: 300;
    letter-spacing: 0.15em;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    position: relative;
    z-index: 10;
}

/* 导航网格 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    max-width: 1500px;
    width: 100%;
}

/* 导航卡片 */
.nav-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.25),
        0 0 60px rgba(255, 255, 255, 0.1) inset;
}

.nav-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--text-primary);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.nav-card:hover .card-icon {
    transform: scale(1.1);
    opacity: 1;
}

.card-content {
    text-align: center;
}

.card-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.card-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    backdrop-filter: blur(4px);
}

/* 不同类型卡片的个性化颜色 */
.nav-card[data-type="miniprogram"]:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.15));
}

.nav-card[data-type="monitor"]:hover {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.3), rgba(66, 165, 245, 0.15));
}

.nav-card[data-type="iot"]:hover {
    background: linear-gradient(135deg, rgba(171, 71, 188, 0.3), rgba(171, 71, 188, 0.15));
}

.nav-card[data-type="health"]:hover {
    background: linear-gradient(135deg, rgba(236, 64, 122, 0.3), rgba(236, 64, 122, 0.15));
}

.nav-card[data-type="party"]:hover {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.3), rgba(229, 57, 53, 0.15));
}

.nav-card[data-type="training"]:hover {
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.3), rgba(255, 167, 38, 0.15));
}

.nav-card[data-type="gov"]:hover {
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.3), rgba(38, 166, 154, 0.15));
}

.nav-card[data-type="startup"]:hover {
    background: linear-gradient(135deg, rgba(255, 112, 67, 0.3), rgba(255, 112, 67, 0.15));
}

/* 底部样式 */
.footer {
    position: relative;
    z-index: 10;
    padding: 1rem 1.5rem 1.5rem;
    text-align: center;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.admin-link svg {
    width: 18px;
    height: 18px;
}

.admin-link:hover {
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .main-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .logo-icon {
        width: 45px;
        height: 45px;
    }

    .nav-card {
        padding: 1.2rem 0.8rem;
    }

    .card-icon {
        width: 40px;
        height: 40px;
    }

    .card-content h3 {
        font-size: 1rem;
    }

    .card-content p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem 0.8rem;
    }

    .main-content {
        padding: 0.8rem 1rem;
    }

    .logo-area {
        flex-direction: column;
        gap: 0.8rem;
    }

    .title-group {
        text-align: center;
    }

    .main-title {
        font-size: 1.4rem;
    }

    .nav-grid {
        gap: 0.6rem;
    }

    .nav-card {
        padding: 1rem 0.6rem;
        border-radius: 12px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 0.5rem;
    }

    .card-content h3 {
        font-size: 0.9rem;
    }

    .card-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.4rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.nav-card:nth-child(1) {
    animation-delay: 0.1s;
}

.nav-card:nth-child(2) {
    animation-delay: 0.15s;
}

.nav-card:nth-child(3) {
    animation-delay: 0.2s;
}

.nav-card:nth-child(4) {
    animation-delay: 0.25s;
}

.nav-card:nth-child(5) {
    animation-delay: 0.3s;
}

.nav-card:nth-child(6) {
    animation-delay: 0.35s;
}

.nav-card:nth-child(7) {
    animation-delay: 0.4s;
}

.nav-card:nth-child(8) {
    animation-delay: 0.45s;
}

.header {
    animation: fadeInUp 0.6s ease forwards;
}

.footer {
    animation: fadeInUp 0.6s ease 0.5s forwards;
    opacity: 0;
}

/* 微妙的闪光效果 */
.nav-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            transparent 40%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 60%,
            transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.nav-card:hover::after {
    transform: rotate(45deg) translateX(100%);
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 360px;
    width: 90%;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d8a4e;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.qrcode-container {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.qrcode-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    display: block;
}

.modal-tip {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
}