* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
}

.login-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
}

.btn:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.register-link {
    text-align: center;
    margin-top: 15px;
}

.register-link a {
    color: #4CAF50;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* 导航栏样式 */
.navbar {
    background-color: #333;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 20px;
    font-weight: bold;
}

.navbar .nav-links {
    display: flex;
    gap: 15px;
}

.navbar .nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar .nav-left h2 {
    margin: 0;
    font-size: 18px;
    color: white;
}

.navbar .nav-links a {
    color: white;
    text-decoration: none;
}

/* 邮件导航样式 */
.email-nav {
    margin: 15px 0;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.email-nav .nav-item {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.email-nav .nav-item:hover {
    background-color: #f0f0f0;
}

.email-nav .nav-item.active {
    background-color: #4CAF50;
    color: white;
}

/* 表格样式 */
.email-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.email-table th, .email-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    line-height: 1.4;
}

.email-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    padding: 8px;
}

.email-table tr:hover {
    background-color: #f9f9f9;
}

.email-table tr.unread {
    background-color: #fff3cd;
}

/* 内联表单样式 */
.form-group.inline-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 空消息样式 */
.empty-message {
    text-align: center;
    padding: 50px;
    color: #666;
}

/* 危险按钮样式 */
.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.navbar .nav-links a:hover {
    text-decoration: underline;
}

/* 内容区域样式 */
.content {
    padding: 20px;
    flex: 1;
    /* max-width: calc(100% - 220px); */
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 6px 10px;
    text-align: left;
    line-height: 1.4;
}

th {
    background-color: #f2f2f2;
    padding: 8px 10px;
}

/* 按钮样式 */
.btn-sm {
    padding: 3px 8px;
    font-size: 12px;
    margin-top: 0;
}

.btn-wide {
    padding: 3px 16px;
    font-size: 12px;
}

.btn-danger {
    background-color: #f44336;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

/* 橙色按钮样式 */
.btn-orange {
    background-color: #ff9800;
}

.btn-orange:hover {
    background-color: #f57c00;
}

/* 红色按钮样式 */
.btn-red {
    background-color: #e53935;
}

.btn-red:hover {
    background-color: #c62828;
}

/* 删除按钮样式 */
.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* 恢复按钮样式 */
.btn-restore {
    background-color: #17a2b8;
}

.btn-restore:hover {
    background-color: #138496;
}

/* 邮件链接样式 */
.email-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.email-link:hover {
    text-decoration: underline;
    color: #007bff;
}

/* 美化 select 样式 */
.form-select {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    color: #495057;
    cursor: pointer;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 16px;
}

.form-select:hover {
    border-color: #adb5bd;
}

.form-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

/* 美化 textarea 样式 */
.form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

/* 表单操作按钮容器 */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 主按钮样式 */
.btn-primary {
    background-color: #4CAF50;
    padding: 6px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

/* 表单样式 */
.form-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 20px auto;
}

.form-container h2 {
    margin-bottom: 20px;
    color: #333;
}

/* 错误信息样式 */
.error {
    color: red;
    margin-bottom: 10px;
}

/* 成功信息样式 */
.success {
    color: green;
    margin-bottom: 10px;
}

/* 警告框样式 */
.alert {
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 页面容器样式 */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    display: flex;
}

/* 侧边栏样式 */
.sidebar {
    width: 220px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 50px);
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    color: #ecf0f1;
}

.sidebar-accounts {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-account-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #bdc3c7;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-account-item:hover {
    background-color: #34495e;
    color: #fff;
}

.sidebar-account-item.active {
    background-color: #34495e;
    color: #fff;
    border-left-color: #4CAF50;
}

.sidebar-account-item .account-icon {
    font-size: 18px;
    margin-right: 10px;
}

.sidebar-account-item .account-name {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-account-item .unread-badge {
    background-color: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* 仪表板邮箱链接样式 */
.account-link {
    color: #333;
    text-decoration: none;
    font-weight: normal;
}

.account-link:hover {
    color: #4CAF50;
    text-decoration: underline;
}

.stat-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.stat-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 网站脚部样式 */
.site-footer {
    background-color: #444;
    color: #fff;
    padding: 15px 20px;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-left .site-name {
    font-weight: bold;
    font-size: 16px;
}

.footer-left .site-version {
    color: #aaa;
    font-size: 12px;
    margin-left: 5px;
}

.footer-center {
    color: #ccc;
    font-size: 14px;
}

.footer-right {
    color: #ccc;
    font-size: 14px;
}

/* 管理员页面脚部样式 */
.admin-footer {
    margin-left: 200px;
    width: calc(100% - 240px);
}