/* ===== 全局变量与 CSS Reset ===== */
:root {
    --bg-color: #e3f2fd;
    --card-bg: #ffffff;
    --text-main: #8c8c8c;
    --text-slogan: #ff0000;
    --btn-bg: #001e4a;
    --primary-blue: #1877f2;
    --star-color: #ffb833;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;

    position: relative;
    overflow-x: hidden;
}

/* ===== 背景装饰图案 ===== */
.bg-dots {
    position: absolute;
    width: 80px;
    height: 150px;
    background-image: radial-gradient(#a3c2e0 20%, transparent 20%);
    background-size: 15px 15px;
    /* 点阵大小与间距 */
    opacity: 0.5;
    z-index: -1;
}

.top-left {
    top: 20px;
    left: -20px;
    height: 120px;
}

.bottom-left {
    bottom: 50px;
    left: -10px;
    height: 100px;
}

.right-edge {
    top: 30%;
    right: -40px;
    width: 60px;
    height: 200px;
}

/* 星星形状 */
.star-shape {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    /* 防止遮挡底层按钮的点击事件 */
}

.star-left {
    width: 60px;
    height: 60px;
    bottom: 25%;
    left: 15px;
    transform: rotate(-15deg);
    animation: float 4s ease-in-out infinite;
}

.star-right {
    width: 60px;
    height: 60px;
    bottom: 8%;
    right: 15px;
    transform: rotate(10deg);
    animation: float 5s ease-in-out infinite alternate;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* ===== 主体容器 ===== */
.container {
    width: 100%;
    max-width: 400px;
    /* 移动端最佳尺寸 */
    padding: 20px;
    padding-top: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

.container.loaded {
    opacity: 1;
}

/* ===== 中央卡片 ===== */
.card {
    background: var(--card-bg);
    width: 100%;
    border-radius: 24px;
    padding: 40px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-top: 40px;
    /* 为超出的头像留出空间 */
}

.avatar-container {
    position: absolute;
    top: -35px;
    /* 头像溢出卡片效果 */
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.title {
    font-size: 20px;
    color: var(--text-main);
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
}

.subtitle_top,
.subtitle_bottom {
    font-size: 14px;
    color: #a0a0a0;
    text-align: center;
    margin: 10px 0;
}

.qrcode-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 15px 0;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.qrcode-container:active {
    transform: scale(0.98);
}

.qrcode {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.qr-center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: #000;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #fff;
    font-size: 30px;
    color: #fff;
}

/* ===== 底部标语 ===== */
.slogan-container {
    width: 100%;
    margin: 40px 0 30px;
    position: relative;
}

.slogan {
    color: var(--text-slogan);
    font-style: italic;
    font-weight: 800;
    font-size: 24px;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
    /* 柔和阴影 */
    letter-spacing: 1px;
    text-align: center;
}

/* ===== 联系按钮 ===== */
.action-btn {
    width: 100%;
    background: var(--btn-bg);
    border: none;
    border-radius: 50px;
    /* 胶囊形状 */
    padding: 12px 20px;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 30, 74, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 30, 74, 0.3);
}

.btn-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 32px;
    flex-shrink: 0;
    margin-right: 15px;
}

.btn-text {
    flex-grow: 1;
    text-align: left;
    color: white;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-right: 20px;
    /* 平衡左侧图标带来的视觉偏移 */
}

.star-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    right: 15px;
    top: -20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Toast 提示框 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}