/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background-color: #646cff;
    color: white;
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin-bottom: 10px;
}

.header .user-info {
    float: right;
    margin-top: -60px;
}

.header .user-info span {
    margin-right: 15px;
}

.header .user-info button {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.header .user-info button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #646cff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 5px;
}

.btn:hover {
    background-color: #535bf2;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    margin-right: 5px;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* 魔盒列表样式 */
.box-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.box-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s;
}

.box-item:hover {
    transform: translateY(-5px);
}

.box-item h3 {
    margin-bottom: 10px;
    color: #333;
}

.box-item p {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.box-item .sealed {
    color: #dc3545;
    font-weight: bold;
    margin-top: 10px;
}

/* 日记样式 */
.diary-list {
    margin-bottom: 30px;
}

.diary-entry {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #646cff;
}

.diary-entry.private {
    border-left-color: #dc3545;
}

.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.diary-header .private-tag {
    color: #dc3545;
    font-weight: bold;
}

.diary-content {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 登录页面样式 */
.login-form {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-form .btn {
    width: 100%;
    margin-top: 20px;
}

/* 错误和成功消息 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

/* 日历样式 */
.calendar-container {
    margin-top: 20px;
}

.calendar-header {
    text-align: center;
    margin-bottom: 15px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.calendar-table th {
    background-color: #f0f0f0;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ddd;
}

.calendar-table td {
    background-color: white;
    padding: 10px;
    min-height: 80px;
    border: 1px solid #ddd;
    vertical-align: top;
    position: relative;
    width: 14.28%; /* 7列，每列约14.28% */
}

.calendar-day.empty {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    position: relative;
}

.calendar-day.has-entry {
    cursor: pointer;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.calendar-day.has-entry:hover {
    background-color: #bbdefb;
}

.calendar-day.has-entry .day-number {
    position: relative;
    font-weight: bold;
}

.calendar-day.has-entry .day-number::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #2196f3;
    border-radius: 50%;
}

.calendar-event {
    font-size: 12px;
    margin-top: 5px;
    padding: 2px 4px;
    background-color: #e3f2fd;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 当天记录样式 */
.day-record {
    margin-top: 10px;
}

.record-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.record-item.diary {
    border-left: 4px solid #4caf50;
}

.record-item.event {
    border-left: 4px solid #ff9800;
}

.record-item h5 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.record-item p {
    margin: 0;
    line-height: 1.5;
    color: #666;
}

/* 日记媒体样式 */
.diary-media {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diary-media img {
    max-width: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.diary-media video {
    max-width: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header .user-info {
        float: none;
        margin-top: 10px;
        text-align: center;
    }
    
    .box-list {
        grid-template-columns: 1fr;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    .calendar-grid {
        font-size: 14px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 5px;
    }
}