
/* 全局样式和重置 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* 柔和的背景色 */
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动条 */
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* 容器和布局 */
header {
    background-color: #4CAF50; /* 主题色 */
    color: white;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    margin: 0;
    font-size: 1.8em; /* 手机端标题大小 */
    letter-spacing: 1px;
}

header p {
    margin: 5px 0 0;
    font-size: 0.9em;
    opacity: 0.9;
}

main {
    padding: 20px 15px;
    max-width: 800px; /* 限制内容最大宽度 */
    margin: 0 auto; /* 居中显示 */
}

.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card h2 {
    color: #388E3C; /* 强调色 */
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.card h2 .icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.card .content {
    font-size: 0.95em;
}

/* Wi-Fi 部分 */
#wifi-guide .wifi-name {
    font-weight: bold;
    color: #D32F2F; /* 醒目颜色 */
    font-size: 1.1em;
    background-color: #ffebee;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Wi-Fi 密码隐藏样式 */
#wifi-guide .wifi-password {
    font-weight: bold;
    color: #D32F2F;
    font-size: 1.1em;
    background-color: #ffebee;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 2px; /* 让星号看起来更像密码 */
}

#wifi-guide .guide-steps h3 {
    color: #555;
    font-size: 1.1em;
    margin-top: 20px;
    margin-bottom: 10px;
}

#wifi-guide ol {
    padding-left: 20px;
    margin: 0;
}

#wifi-guide ol li {
    margin-bottom: 8px;
    font-size: 0.9em;
}

#wifi-guide .highlight {
    color: #1976D2;
    font-weight: bold;
}

/* 显示密码按钮 */
.show-password-btn {
    background-color: #4CAF50; /* 绿色 */
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

.show-password-btn:hover {
    background-color: #45a049;
}

.show-password-btn:active {
    background-color: #39843c;
}

/* QR Code 容器 (通用) */
.qr-code-container {
    text-align: center;
    margin: 20px 0;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.qr-code {
    width: 150px; /* 手机端二维码大小 */
    height: 150px;
    border: 1px solid #eee;
    border-radius: 5px;
    display: block;
    margin: 0 auto 10px;
    object-fit: contain; /* 确保图片完整显示 */
}

.qr-code-container p {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}

/* 小卖铺统一入口样式 */
.shop-single-order {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shop-single-order:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.shop-single-order p {
    font-size: 1em;
    color: #555;
    margin-bottom: 20px;
}

/* 支付宝点单按钮样式 (通用) */
.order-btn {
    background-color: #00A0E9; /* 支付宝品牌蓝色 */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: 80%;
    max-width: 250px; /* 适当调整最大宽度 */
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-btn:hover {
    background-color: #008CC9;
    transform: translateY(-2px);
}

.order-btn:active {
    background-color: #007BB0;
    transform: translateY(0);
}

.note {
    font-size: 0.85em;
    color: #777;
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
}

/* 其他功能 */
#other-functions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#other-functions ul li {
    background-color: #e8f5e9; /* 浅绿色背景 */
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#other-functions ul li p {
    margin: 0;
    color: #444;
}

#other-functions ul li p strong {
    color: #388E3C;
}

/* 宿舍联系方式部分样式 */
#contact-info .content {
    display: flex;
    flex-direction: column; /* 手机端垂直排列 */
    gap: 20px; /* 各个联系项之间的间距 */
}

.contact-item {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.contact-item h3 {
    color: #333;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap; /* 允许标题和副标题换行 */
}

.contact-item h3 small {
    font-size: 0.8em;
    color: #666;
    margin-left: 8px;
    white-space: nowrap; /* 防止副标题在中间断开 */
}

.contact-item p {
    font-size: 0.95em;
    margin: 5px 0;
    color: #555;
}

.contact-item .phone-number {
    font-weight: bold;
    color: #1976D2; /* 电话号码颜色 */
}

.contact-item .note-small {
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
    margin-bottom: 15px;
}

/* 拨号按钮样式 */
.call-btn {
    display: inline-block;
    background-color: #4CAF50; /* 绿色，与主题色协调 */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    text-decoration: none; /* 移除链接下划线 */
    margin-top: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.call-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.call-btn:active {
    background-color: #39843c;
    transform: translateY(0);
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px 15px;
    margin-top: 30px;
    background-color: #333;
    color: #bbb;
    font-size: 0.8em;
}

footer p {
    margin: 5px 0;
}

/* 模态框（弹窗）样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* 确保在最上层 */
    opacity: 0;
    visibility: hidden; /* 初始隐藏 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90%;
    width: 350px; /* 弹窗最大宽度 */
    transform: scale(0.8); /* 初始缩小，用于动画 */
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1); /* 弹窗显示时放大 */
}

.modal-content h2 {
    color: #388E3C;
    margin-top: 0;
    font-size: 1.5em;
}

.modal-password {
    font-size: 1.8em;
    font-weight: bold;
    color: #D32F2F; /* 醒目颜色 */
    margin: 15px 0 25px; /* 上下间距 */
    word-break: break-all; /* 防止长密码溢出 */
}

.modal-copy-btn, .modal-close-btn {
    background-color: #1976D2; /* 蓝色 */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    margin: 0 10px;
    transition: background-color 0.2s ease;
}

.modal-close-btn {
    background-color: #6C757D; /* 灰色 */
}

.modal-copy-btn:hover {
    background-color: #1565C0;
}

.modal-close-btn:hover {
    background-color: #5a6268;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out forwards;
    opacity: 0; /* 初始隐藏 */
}

/* 延迟动画 */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
.delay-5 { animation-delay: 1.0s; }
.delay-6 { animation-delay: 1.2s; }
.delay-7 { animation-delay: 1.4s; }
.delay-8 { animation-delay: 1.6s; } /* 新增留言板的延迟 */


.fade-in-item { /* 仍然用于 shop-single-order */
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

/* 媒体查询 - 针对平板和桌面设备 */
@media (min-width: 768px) {
    header h1 {
        font-size: 2.5em;
    }

    header p {
        font-size: 1.1em;
    }

    .card {
        padding: 30px;
        margin-bottom: 35px;
    }

    .card h2 {
        font-size: 1.8em;
    }

    .card .content {
        font-size: 1em;
    }

    .qr-code {
        width: 180px;
        height: 180px;
    }

    #contact-info .content {
        flex-direction: row; /* 桌面端横向排列 */
        flex-wrap: wrap; /* 允许换行 */
        justify-content: space-around; /* 均匀分布 */
    }

    .contact-item {
        flex: 1; /* 弹性布局，使其占据可用空间 */
        min-width: 280px; /* 最小宽度，防止过窄 */
        max-width: 32%; /* 每行最多3个，留有间距 */
    }
}

/* 新增：宿舍状态样式 */
#dorm-status-container {
    background-color: #388E3C; /* 与主题色协调 */
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    margin: 15px auto 0 auto;
    max-width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
}

#dorm-current-status {
    color: #FFEB3B; /* 醒目黄色 */
    margin-left: 8px;
}

/* 实时滚动字幕样式 */
#marquee-section .content {
    background-color: #fffde7; /* 浅黄色背景 */
    border: 1px solid #ffecb3;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}



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


/* 新增：公告栏样式 */
#announcement-board .content {
    background-color: #e3f2fd; /* 浅蓝色背景 */
    border: 1px solid #bbdefb;
    padding: 15px;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#announcement-content {
    font-size: 1em;
    color: #333;
    line-height: 1.8;
    margin: 0;
}

/* 新增动画延迟 */
.delay-1-5 { animation-delay: 0.3s; } /* 介于 delay-1 和 delay-2 之间 */


#scroll-text-content {
    animation: marquee 20s linear infinite; /* 调整速度 */
    padding-left: 100%; /* 确保从右侧完全进入 */
}

/* 学习资料部分样式 */
#learning-resources .content h3 {
    color: #555;
    font-size: 1.1em;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 8px;
}

/* 主学习资料按钮 */
.main-learning-btn {
    display: block; /* 块级元素，使其独占一行并居中 */
    width: 80%;
    max-width: 300px;
    margin: 20px auto 30px auto; /* 上下间距，左右居中 */
    background-color: #007BFF; /* 蓝色 */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.main-learning-btn:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

.main-learning-btn:active {
    background-color: #004085;
    transform: translateY(0);
}

/* 专题分类容器 */
.learning-topics {
    display: flex;
    flex-wrap: wrap; /* 允许换行 */
    gap: 15px; /* 按钮之间的间距 */
    justify-content: center; /* 居中对齐 */
    margin-top: 15px;
    margin-bottom: 20px;
}

/* 专题按钮 */
.topic-btn {
    display: inline-block;
    background-color: #28a745; /* 绿色 */
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 120px; /* 最小宽度 */
    flex-grow: 1; /* 允许按钮增长填充空间 */
    max-width: 48%; /* 手机端一行最多两个 */
}

.topic-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.topic-btn:active {
    background-color: #1e7e34;
    transform: translateY(0);
}

/* 留言板样式 */
#message-board textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.95em;
    resize: vertical; /* 允许垂直调整大小 */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.submit-message-btn {
    background-color: #1976D2; /* 蓝色 */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto 20px auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.submit-message-btn:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
}

.submit-message-btn:active {
    background-color: #004085;
    transform: translateY(0);
}

#messages-list {
    margin-top: 20px;
    border-top: 1px dashed #e0e0e0;
    padding-top: 20px;
}

.message-item {
    background-color: #f0f4f7; /* 浅蓝色背景 */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    word-wrap: break-word; /* 防止长文本溢出 */
}

.message-item p {
    margin: 0;
    font-size: 0.95em;
    color: #333;
}

.message-item .timestamp {
    font-size: 0.8em;
    color: #777;
    margin-top: 8px;
    display: block;
    text-align: right;
}

/* 媒体查询 - 针对平板和桌面设备 */
@media (min-width: 768px) {
    .main-learning-btn {
        max-width: 400px; /* 桌面端主按钮宽度 */
    }

    .learning-topics {
        justify-content: flex-start; /* 桌面端左对齐 */
    }

    .topic-btn {
        max-width: none; /* 移除最大宽度限制 */
        flex-grow: 0; /* 禁用增长 */
    }
}