/* 全局重置与基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "微软雅黑", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f9fafb;
    padding: 24px 0;
    color: #333;
    line-height: 1.5;
}

/* 页面容器：控制整体边距 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px; /* 页面左右固定边距 */
}

/* 标题区域：缩小与下方间距 */
.title-section {
    text-align: center;
    margin-bottom: 12px; /* 缩小与公告栏的间距 */
    padding: 18px 16px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.title-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background-color: #3b82f6;
}

.main-title {
    font-size: clamp(1.8em, 5vw, 2.6em);
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1em;
    color: #64748b;
    opacity: 0.9;
}

/* 公告滚动区域：缩小与上下间距，优化标签大小 */
.notice-scroll {
    margin: 0 auto 14px; /* 缩小与微信板块的间距 */
    padding: 12px 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative; /* 为固定标签提供定位上下文 */
}

/* 固定“公告”标签：更小巧 */
.notice-fixed-label {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: #ff5473;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 滚动公告容器：适配标签宽度 */
.notice-wrapper {
    display: flex;
    animation: scrollNotice 20s linear infinite;
    margin-left: 55px;
}

.notice-item {
    white-space: nowrap;
    padding: 0 28px;
    font-size: 0.95em;
    color: #4b5563;
    display: flex;
    align-items: center;
    line-height: 1.6;
}

.notice-item::before {
    content: "📢";
    margin-right: 10px;
    font-size: 1.1em;
}

/* 鼠标悬停暂停滚动 */
.notice-scroll:hover .notice-wrapper {
    animation-play-state: paused;
}

@keyframes scrollNotice {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 微信名片板块：固定比例和宽度，保持一致显示效果 */
.wechat-card {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 0 auto 20px; /* 与上下模块的间距 */
    /* 固定宽度约束，确保在任何设备上比例一致 */
    min-width: 300px;
    max-width: 600px;
    width: 90%; /* 在小屏幕上占90%宽度，大屏幕上受max-width限制 */
    flex-shrink: 0; /* 防止被压缩 */
}

.wechat-avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0; /* 头像尺寸固定 */
}

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

.wechat-info {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
    margin-right: 16px;
}

.wechat-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.wechat-desc {
    font-size: 0.9em;
    color: #64748b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wechat-add-btn {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(34, 197, 94, 0.25);
    flex-shrink: 0; /* 按钮尺寸固定 */
}

.wechat-add-btn:hover {
    background-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(34, 197, 94, 0.35);
}

/* 二维码弹窗 */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qr-modal.active {
    opacity: 1;
    visibility: visible;
}

.qr-content {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.qr-modal.active .qr-content {
    transform: scale(1);
}

.qr-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.qr-img {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

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

.qr-desc {
    font-size: 0.9em;
    color: #64748b;
    margin-bottom: 20px;
}

.qr-close-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
}

.qr-close-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(59, 130, 246, 0.35);
}

/* 演示项容器：固定间距 */
.demo-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: 30px; /* 增加底部间距，避免内容与回到顶部按钮重叠 */
}

/* 单个演示项：移除悬停放大效果 */
.demo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

/* 系统名称标题 */
.system-title {
    font-size: 1.25em;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.demo-item:hover .system-title {
    color: #2563eb;
}

/* 手机图片容器 */
.phone-container {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* 手机图片样式：移除悬停放大效果 */
.phone-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 12px;
}

/* 系统演示按钮：边距绝对一致 */
.demo-btn {
    margin: 0 12px;
    width: calc(100% - 24px);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 14px 0;
    font-size: 1em;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #4f94fc 0%, #3b82f6 100%);
}

.demo-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.demo-btn::after {
    content: "➤";
    margin-left: 8px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.demo-btn:hover::after {
    transform: translateX(3px);
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden; /* 初始隐藏 */
    z-index: 90; /* 低于弹窗z-index，避免遮挡 */
    font-size: 1.2em;
}

/* 显示回到顶部按钮的类 */
.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

/*  hover效果 */
.back-to-top:hover {
    background-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* 图片加载失败样式 */
.phone-img[src$=".png"]:not([src^="https"]) {
    min-height: 320px;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.9em;
    content: attr(alt);
    border: 1px dashed #cbd5e1;
}

/* 平板设备适配 */
@media (min-width: 600px) and (max-width: 991px) {
    .demo-container {
        gap: 20px;
    }
    .title-section {
        margin-bottom: 10px;
    }
    .notice-scroll {
        margin-bottom: 12px;
    }
    .wechat-card {
        margin-bottom: 18px;
    }
}

/* 桌面设备适配 */
@media (min-width: 992px) {
    .demo-container {
        gap: 24px;
        max-width: 900px;
        margin: 0 auto 30px;
    }
    .title-section {
        margin-bottom: 12px;
        padding: 24px 20px;
    }
    .notice-scroll {
        margin-bottom: 14px;
    }
    .wechat-card {
        margin-bottom: 20px;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 375px) {
    .system-title {
        font-size: 1.1em;
    }
    .demo-btn {
        font-size: 0.95em;
        padding: 12px 0;
    }
    .notice-item {
        font-size: 0.85em;
        padding: 0 18px;
    }
    .notice-fixed-label {
        padding: 0 10px;
        font-size: 0.8em;
    }
    .notice-wrapper {
        margin-left: 50px;
    }
    /* 微信名片在极小屏幕上保持横向布局，不改为垂直 */
    .wechat-card {
        padding: 12px;
        min-width: auto; /* 在极小屏幕上允许更窄一些 */
    }
    .wechat-avatar {
        margin-right: 12px;
        width: 50px;
        height: 50px;
    }
    .wechat-add-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    /* 回到顶部按钮适配小屏幕 */
    .back-to-top {
        width: 38px;
        height: 38px;
        bottom: 18px;
        right: 18px;
        font-size: 1em;
    }
}

/* 图片加载动画 */
.phone-img {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.phone-img.loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}