* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Microsoft YaHei",
        sans-serif;
    background: #f4f6f9;
    color: #202124;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 14px;
    padding: 34px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.09);
}

.mail-logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #eaf2ff;
    font-size: 30px;
}

.login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 26px;
}

.subtitle {
    margin: 10px 0 25px;
    text-align: center;
    color: #70757a;
    font-size: 14px;
}

label {
    display: block;
    margin: 16px 0 7px;
    font-size: 14px;
    font-weight: 600;
}

input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #d5d9df;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

input:focus {
    border-color: #3974d8;
    box-shadow: 0 0 0 3px rgba(57, 116, 216, 0.12);
}

button {
    width: 100%;
    height: 47px;
    margin-top: 24px;
    border: 0;
    border-radius: 8px;
    background: #3974d8;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    opacity: 0.92;
}

.alert {
    margin: 18px 0;
    padding: 12px;
    border-radius: 8px;
    background: #fff1f0;
    color: #b42318;
    font-size: 14px;
}

.notice {
    margin-top: 20px;
    color: #8a9099;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.topbar {
    min-height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.account-name {
    margin-left: 12px;
    color: #777;
    font-size: 13px;
}

.refresh-link,
.logout-link,
.back-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
}

.refresh-link:hover,
.back-link:hover {
    background: #edf3ff;
}

.logout-link {
    margin-left: 5px;
    color: #d93025;
}

.logout-link:hover {
    background: #fff0ef;
}

.mail-container,
.message-container {
    max-width: 1000px;
    margin: 28px auto;
    padding: 0 18px;
}

.mail-list,
.message-card,
.empty-box {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
}

.mail-item {
    display: grid;
    grid-template-columns: 240px 1fr 170px;
    gap: 16px;
    align-items: center;
    min-height: 67px;
    padding: 12px 18px;
    border-bottom: 1px solid #eceef1;
}

.mail-item:last-child {
    border-bottom: 0;
}

.mail-item:hover {
    background: #f5f8fd;
}

.mail-item.unread {
    background: #f1f6ff;
    font-weight: 600;
}

.mail-from,
.mail-subject,
.mail-date {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-date {
    color: #747a84;
    text-align: right;
    font-size: 13px;
}

.empty-box {
    padding: 70px 20px;
    color: #838a94;
    text-align: center;
}

.message-card {
    padding: 28px;
}

.message-card h1 {
    margin: 0 0 20px;
    font-size: 24px;
    word-break: break-word;
}

.message-meta {
    padding-bottom: 20px;
    border-bottom: 1px solid #eceef1;
    color: #68707b;
    font-size: 14px;
    line-height: 1.8;
}

.message-body {
    padding-top: 25px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.message-body img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 720px) {
    .login-card {
        padding: 26px 20px;
    }

    .topbar {
        padding: 0 12px;
    }

    .mail-item {
        display: block;
        padding: 14px;
    }

    .mail-from {
        margin-bottom: 5px;
    }

    .mail-subject {
        margin-bottom: 8px;
    }

    .mail-date {
        text-align: left;
    }

    .message-card {
        padding: 20px;
    }
}