/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f4f9;
}

/* 页眉样式 */
header {
    background-color: #2a3d66;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.login-link a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-link a:hover {
    color: #a7c4bc;
}

/* 日期选择器容器样式 */
#datepicker {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* jQuery UI 日期选择器样式优化 */
#datepicker .ui-datepicker {
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

#datepicker .ui-datepicker-header {
    background-color: #2a3d66;
    color: white;
    border: none;
    border-radius: 0;
}

#datepicker .ui-datepicker-calendar th {
    color: #2a3d66;
}

/* 进一步拉伸日期选择器 */
#datepicker .ui-datepicker {
    width: 90%; /* 增加宽度 */
    max-width: 800px; /* 增加最大宽度 */
}

#datepicker .ui-datepicker-calendar {
    width: 100%;
}

#datepicker .ui-datepicker-calendar td {
    padding: 0;
}

#datepicker .ui-datepicker-calendar td a {
    text-align: center;
    padding: 0.5em;
}

/* 页脚样式 */
footer {
    background-color: #2a3d66;
    color: white;
    text-align: center;
    padding: 1rem;
}


/* 登录容器样式 */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column; /* 让子元素垂直排列 */
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* 活动详情容器样式 */
.event-detail-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 70%; /* 设置宽度为页面的 70% */
    max-width: 1200px; /* 设置最大宽度，避免在大屏幕下过宽 */
    margin: 2rem auto;
}

.event-detail-container h1 {
    color: #2a3d66;
    text-align: center;
    margin-bottom: 1.5rem;
}

.detail-item {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.detail-item strong {
    color: #333;
    margin-right: 0.5rem;
}

/* 错误信息样式 */
.error-message {
    background-color: #ffeeee;
    color: #ff4444;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    width: 70%; /* 设置宽度为页面的 70% */
    max-width: 1200px; /* 设置最大宽度，避免在大屏幕下过宽 */
    margin: 2rem auto;
}

.error-message {
    background-color: #ffeeee;
    color: #ff4444;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem; /* 让错误提示和表单有一定间距 */
    text-align: center;
    width: 100%; /* 宽度和表单一致 */
    max-width: 400px; /* 最大宽度和表单一致 */
    box-sizing: border-box; /* 包含内边距和边框 */
}

/* 优化后的表单样式 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 为表单元素添加统一间距 */
    position: relative;
    z-index: 2;
}

.login-form h2 {
    text-align: center;
    margin: 0 0 1rem; /* 减少底部外边距 */
    color: #2a3d66;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.5px; /* 添加字母间距 */
    text-transform: capitalize; /* 首字母大写 */
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-form label:hover {
    color: #2a3d66; /* 鼠标悬停时改变标签颜色 */
}

.login-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* 确保内边距和边框包含在宽度内 */
}

.login-form input:focus {
    outline: none;
    border-color: #2a3d66;
    box-shadow: 0 0 0 3px rgba(42, 61, 102, 0.2); /* 添加聚焦时的阴影效果 */
}

.login-form input[type="submit"] {
    background-color: #2a3d66;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加按钮阴影 */
}

.login-form input[type="submit"]:hover {
    background-color: #1a2a46;
    transform: translateY(-2px); /* 鼠标悬停时按钮上移 */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15); /* 鼠标悬停时加大阴影 */
}

/* 表单组样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%; /* 设置宽度为 100%，和其他输入框一致 */
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* 让内边距和边框包含在宽度内 */
}

.form-group textarea {
    height: 150px; /* 设置高度为 150px，可根据需求调整 */
    resize: vertical; /* 允许用户垂直调整文本框大小 */
}

/* 提交按钮样式 */
.submit-button {
    width: 100%;
    padding: 0.8rem;
    background-color: #2a3d66;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #1a2a46;
}


.manage-container {
    flex: 1;
    padding: 2rem;
    width: 70%; /* 设置宽度为 70% */
    max-width: 1200px;
    margin: 0 auto;
}

.event-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.event-table th,
.event-table td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: left;
}

.event-table th {
    background-color: #2a3d66;
    color: white;
}

.event-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.event-table tr:hover {
    background-color: #ddd;
}

.add-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: #2a3d66;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.add-button:hover {
    background-color: #1a2a46;
}


/* 新增点名详情容器样式 */
.rollcall-detail-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 70%;
    max-width: 1200px;
    margin: 2rem auto;
}

.rollcall-detail-container h2 {
    color: #2a3d66;
    text-align: center;
    margin-bottom: 1.5rem;
}

.rollcall-table {
    width: 100%;
    border-collapse: collapse;
}

.rollcall-table th,
.rollcall-table td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: left;
}

.rollcall-table th {
    background-color: #2a3d66;
    color: white;
}

.rollcall-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.rollcall-table tr:hover {
    background-color: #ddd;
}

/* 暂无点名详情提示样式 */
.no-rollcall-message {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin: 2rem 0;
}


/* 媒体查询，针对小屏幕设备（手机和平板） */
@media (max-width: 768px) {
    /* 全局样式调整 */
    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%; /* 防止 iOS 横屏时字体变大 */
    }

    /* 页眉样式调整 */
    header {
        padding: 1rem;
        flex-wrap: wrap; /* 允许页眉元素换行 */
    }

    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem; /* 为标题添加底部间距 */
    }

    .login-link {
        width: 100%; /* 让登录链接占满一行 */
        text-align: right;
    }

    /* 管理容器样式调整 */
    .manage-container {
        width: 90%;
        padding: 1rem;
    }

    /* 表格样式调整 */
    .event-table,
    .rollcall-table,
    #event-create-table,
    #event-details-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* 为 iOS 设备添加流畅滚动效果 */
        white-space: nowrap;
    }

    .event-table th,
    .event-table td,
    .rollcall-table th,
    .rollcall-table td,
    #event-create-table th,
    #event-create-table td,
    #event-details-table th,
    #event-details-table td {
        padding: 0.5rem;
    }

    /* 操作按钮样式调整 */
    .action-buttons {
        max-height: none;
    }

    .action-buttons .add-button {
        flex: 0 0 100%;
    }

    /* 表单容器样式调整 */
    .form-container {
        width: 90%;
        padding: 1rem;
    }

    /* 活动详情容器样式调整 */
    .event-detail-container,
    .rollcall-detail-container {
        width: 90%;
        padding: 1rem;
    }

    /* 日期选择器样式调整 */
    #datepicker .ui-datepicker {
        width: 100%;
    }

    /* 输入框样式调整 */
    .login-form input,
    .form-group input,
    .form-group textarea,
    .form-container input {
        -webkit-appearance: none; /* 去除 iOS 输入框默认样式 */
    }
}

.form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 70%;
    max-width: 800px;
    margin: 2rem auto;
}

.form-container h2 {
    color: #2a3d66;
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-container input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-container button {
    background-color: #2a3d66;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-container button:hover {
    background-color: #1a2d46;
}

/* 有活动日期在数字上添加五角星 */
#datepicker .ui-datepicker-calendar .has-event a::after {
    content: '★';
    color: #ff9900; 
    font-size: 0.8rem; 
    position: absolute;
    top: 0; 
    right: 0; 
    transform: translate(30%, -30%); /* 微调位置使其在数字右上方 */
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3); 
}

/* 确保以下样式被注释或删除 */
/*
#datepicker .ui-datepicker-calendar td.has-event a {
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
}
*/