/* 全局样式 - 统一手写体 + 指定蓝色主色调 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f0f7ff; /* 浅蓝背景，贴合蓝色主调 */
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
}

/* 标题样式 - 最深蓝色 #002fa7 */
.title {
    color: #002fa7; 
    margin-bottom: 30px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 身份选择按钮 - 核心蓝色 #2f4faf */
.role-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.role-btn {
    padding: 18px 35px;
    font-size: 15px;
    background-color: #2f4faf; 
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(47, 79, 175, 0.3);
}

.role-btn:hover {
    background-color: #002fa7; /* hover加深为最深蓝 */
    transform: translateY(-2px);
}

/* 提示文字 - 中蓝色 #5670be */
.hint {
    color: #5670be; 
    font-size: 16px;
    margin-top: 10px;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 头部导航 - 蓝色系 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0efff; /* 浅蓝分割线 */
}

.nav-btn {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    background-color: #5670be; /* 导航按钮用中蓝色 */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2f4faf; /* hover变核心蓝 */
}

/* 模式切换标签 - 蓝色渐变 */
.mode-tab {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    flex: 1;
    padding: 12px 0;
    background-color: #e8f3ff; /* 浅蓝未选中（搭配指定色系） */
    color: #2f4faf; /* 核心蓝文字 */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.mode-btn.active {
    background-color: #2f4faf; /* 选中变核心蓝 */
    color: white;
}

.mode-btn:hover:not(.active) {
    background-color: #d1e7ff;
}

/* 写信区域 - 浅蓝色背景 */
.write-area {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(47, 79, 175, 0.1);
}

.title-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #8a9cd2; /* 浅蓝边框 #8a9cd2 */
    border-radius: 6px;
    font-size: 16px;
    color: #333;
    outline: none;
}

.title-input:focus {
    border-color: #2f4faf; /* 聚焦变核心蓝 */
    box-shadow: 0 0 0 2px rgba(47, 79, 175, 0.2);
}

.content-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #8a9cd2; /* 浅蓝边框 #8a9cd2 */
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.8;
    min-height: 200px;
    resize: vertical;
    outline: none;
}

.content-input:focus {
    border-color: #2f4faf; /* 聚焦变核心蓝 */
    box-shadow: 0 0 0 2px rgba(47, 79, 175, 0.2);
}

.short-input {
    min-height: 100px;
}

.img-input {
    display: block;
    margin-bottom: 20px;
    color: #5670be; /* 中蓝色提示 */
    font-size: 16px;
}

.send-btn {
    width: 100%;
    padding: 15px;
    background-color: #2f4faf; /* 核心蓝 */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.send-btn:hover {
    background-color: #002fa7; /* hover变最深蓝 */
}

/* 历史信件标签 */
.history-tab {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 25px;
}

.history-tab-btn {
    flex: 1;
    padding: 12px 0;
    background-color: #e8f3ff; /* 浅蓝未选中 */
    color: #2f4faf; /* 核心蓝文字 */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.history-tab-btn.active {
    background-color: #2f4faf; /* 选中变核心蓝 */
    color: white;
}

.history-tab-btn:hover:not(.active) {
    background-color: #d1e7ff;
}

/* 历史信件列表 */
.history-list {
    max-width: 600px;
    margin: 0 auto;
}

.letter-item {
    background-color: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid #2f4faf; /* 核心蓝左侧边框 */
    box-shadow: 0 2px 10px rgba(47, 79, 175, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.letter-item:hover {
    transform: translateX(5px);
}

.letter-item-title {
    font-size: 18px;
    color: #002fa7; /* 最深蓝标题 */
    margin-bottom: 8px;
    font-weight: bold;
}

.letter-item-desc {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.letter-item-time {
    color: #888;
    font-size: 14px;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    border-top: 5px solid #2f4faf; /* 核心蓝顶部边框 */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #2f4faf; /* hover变核心蓝 */
}

.modal-title {
    color: #002fa7; /* 最深蓝标题 */
    font-size: 22px;
    margin-bottom: 10px;
}

.modal-sender {
    color: #5670be; /* 中蓝色发送者 */
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8f3ff; /* 浅蓝分割线 */
}

.modal-body {
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-body img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

.modal-time {
    color: #888;
    font-size: 14px;
    text-align: right;
}