/* Web 邮箱 & 临时邮箱 — 简约高端风格 */
.webmail-body {
    background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 42%, #f1f5f9 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.webmail-body .site-footer {
    margin-top: 0;
    flex-shrink: 0;
}

/* Webmail 全屏主区域（顶栏下方占满剩余视口） */
.webmail-body .webmail-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0;
    box-sizing: border-box;
}

.webmail-body .webmail-main > .alert {
    flex-shrink: 0;
    margin: 0;
    border-radius: 0;
    padding: 12px 28px;
}

.webmail-body .webmail-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px 28px 28px;
    border: none;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    min-height: calc(100vh - 56px - 72px);
    box-sizing: border-box;
}

.webmail-body .webmail-panel > h2,
.webmail-body .webmail-panel > .mail-read-toolbar {
    flex-shrink: 0;
}

.webmail-body .webmail-panel form.webmail-compose-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.webmail-body .webmail-compose-form .form-group:last-of-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 16px;
}

.webmail-body .webmail-compose-form .form-group textarea {
    flex: 1;
    min-height: 240px;
    resize: vertical;
}

.webmail-body .webmail-compose-actions {
    flex-shrink: 0;
    padding-top: 4px;
}

.webmail-body .webmail-panel .alert {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.webmail-body .mail-list {
    overflow: auto;
}

.webmail-body .mail-list table {
    width: 100%;
}

.webmail-body .mail-read {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.webmail-body .mail-read-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.webmail-body .mail-read-card .mail-content {
    flex: 1;
    overflow: auto;
}

.webmail-body .webmail-panel.mail-read-card {
    padding: 0;
}

.webmail-body .webmail-panel.mail-read-card .mail-read-toolbar {
    padding: 16px 28px 0;
    margin-bottom: 0;
}

.webmail-topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    color: #0f172a;
}

.webmail-topbar .topbar-brand {
    font-weight: 700;
    font-size: 17px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.webmail-topbar .topbar-brand img.brand-logo,
.webmail-from-avatar {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.webmail-compose-from .webmail-from-avatar {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 8px;
}

.webmail-topbar a {
    color: #475569;
    font-weight: 500;
    font-size: 14px;
}

.webmail-topbar a:hover {
    color: #2563eb;
}

.webmail-topbar .user-email {
    color: #64748b;
    font-size: 13px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webmail-compose-from {
    display: flex;
    align-items: center;
    gap: 12px;
}

.webmail-compose-from img,
.webmail-compose-from .webmail-from-avatar {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.webmail-compose-from input {
    flex: 1;
    min-width: 0;
}

/* 兼容旧版仍带 .container / .card 的页面结构 */
.webmail-body > .container,
.webmail-body .webmail-main.container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.webmail-body .webmail-main .card:not(.webmail-panel),
.webmail-body .container > .card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: calc(100vh - 56px - 72px);
}

.webmail-body .webmail-panel h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

/* 登录页 */
.webmail-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 45%, #312e81 100%);
}

.webmail-login-page .login-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 48px;
}

.webmail-login-page .login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.webmail-login-page .login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.webmail-login-page .login-brand img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin-bottom: 12px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.webmail-login-page .login-brand h1 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.webmail-login-page .login-brand p {
    font-size: 14px;
    color: #64748b;
    margin-top: 6px;
}

.webmail-login-page .form-group label {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.webmail-login-page .form-group input {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: 12px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.webmail-login-page .form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.webmail-login-page .btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.webmail-login-page .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.webmail-login-page .login-links {
    text-align: center;
    margin-top: 20px;
}

.webmail-login-page .login-links a {
    color: #6366f1;
    font-size: 14px;
    font-weight: 500;
}

/* 临时邮箱 */
.temp-mail-body .topbar-brand {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.temp-mail-body {
    background: linear-gradient(160deg, #ecfeff 0%, #f8fafc 50%, #eef2ff 100%);
}

.temp-page {
    max-width: 920px;
    margin: 0 auto;
}

.temp-intro-card,
.temp-info-card {
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-left: 4px solid #0ea5e9;
    padding: 28px;
}

.temp-hero {
    margin-bottom: 20px;
}

.temp-hero-compact {
    margin-bottom: 16px;
}

.temp-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #0369a1;
    background: linear-gradient(135deg, #e0f2fe, #eef2ff);
    margin-bottom: 10px;
}

.temp-hero-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.35;
}

.temp-hero-desc {
    color: #64748b;
    font-size: 15px;
    line-height: 1.65;
    max-width: 640px;
}

.temp-meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.temp-meta-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
}

.temp-meta-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.temp-meta-value {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.temp-email-box {
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0f9ff 0%, #eef2ff 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 16px;
    text-align: center;
}

.temp-email-display {
    font-size: clamp(18px, 4vw, 26px);
    font-weight: 800;
    background: linear-gradient(90deg, #0369a1, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    word-break: break-all;
    line-height: 1.4;
}

.temp-expire-chip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    margin-bottom: 12px;
}

.temp-expire-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.temp-expire-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.temp-expire-at {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.temp-expire-remaining {
    font-size: 14px;
    color: #b45309;
}

.temp-hint {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
}

.temp-actions-panel {
    padding: 20px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.temp-form-extras {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px dashed #e2e8f0;
}

.temp-issue-form {
    width: 100%;
    max-width: none;
}

.temp-btn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.temp-delay-cs-btn {
    pointer-events: none;
    cursor: not-allowed;
    user-select: none;
    opacity: 0.92;
    text-decoration: none;
    display: inline-block;
    vertical-align: middle;
}

.temp-actions-panel .temp-login-link {
    margin-top: 14px;
    text-align: center;
    width: 100%;
}

.temp-actions-panel .temp-ip-hint {
    margin-top: 12px;
    margin-bottom: 0;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

.temp-inbox-card {
    padding: 0;
    overflow: hidden;
}

.temp-inbox-card .temp-inbox-header {
    padding: 20px 24px 0;
    margin-bottom: 0;
}

.temp-inbox-table-wrap {
    padding: 12px 16px 20px;
    overflow-x: auto;
}

.temp-inbox-card table {
    margin: 0;
}

.temp-mail-body .btn-primary {
    background: linear-gradient(135deg, #0284c7, #4f46e5);
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.temp-mail-body .btn-secondary {
    background: linear-gradient(135deg, #475569, #64748b);
    border: none;
    font-weight: 600;
    color: #fff;
}

.temp-mail-body .btn-permanent {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.22);
}

.webmail-body .mail-list table {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.webmail-body .mail-list .mail-from {
    max-width: none;
    min-width: 180px;
}

.webmail-body .mail-list th {
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.webmail-body .mail-list tr.unread .mail-subject-link {
    color: #1d4ed8;
    font-weight: 700;
}

[data-theme="dark"] .webmail-login-page {
    background: radial-gradient(ellipse at top, #3d4252 0%, #2a2d3a 62%);
}
[data-theme="dark"] .webmail-login-page .login-card {
    background: #353945;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .webmail-body .mail-list th {
    background: #3d4252;
    color: #a8b0c0;
}
[data-theme="dark"] .temp-intro-card,
[data-theme="dark"] .temp-info-card {
    border-color: rgba(56, 189, 248, 0.2);
    background: #353945;
}

[data-theme="dark"] .temp-badge {
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.15);
}

[data-theme="dark"] .temp-hero-title { color: #e4e7ed; }
[data-theme="dark"] .temp-hero-desc,
[data-theme="dark"] .temp-hint { color: #a8b0c0; }

[data-theme="dark"] .temp-meta-item {
    background: #3d4252;
    border-color: #4a5060;
}

[data-theme="dark"] .temp-meta-value { color: #e4e7ed; }

[data-theme="dark"] .temp-email-box {
    background: linear-gradient(135deg, #2a3f55 0%, #353965 100%);
    border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .temp-mail-body .temp-email-display {
    -webkit-text-fill-color: #93c5fd;
    color: #93c5fd;
    background: none;
}

[data-theme="dark"] .temp-expire-chip {
    background: rgba(180, 83, 9, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .temp-expire-at,
[data-theme="dark"] .temp-expire-remaining { color: #fcd34d; }

[data-theme="dark"] .temp-actions-panel {
    background: #3d4252;
    border-color: #4a5060;
}

[data-theme="dark"] .temp-form-extras {
    border-bottom-color: #4a5060;
}

[data-theme="dark"] .temp-inbox-card {
    background: #353945;
}

[data-theme="dark"] .webmail-body .webmail-panel {
    background: #353945;
    border-top-color: #4a5060;
}

@media (max-width: 640px) {
    .webmail-body .webmail-panel {
        padding: 16px;
        min-height: calc(100vh - 56px - 64px);
    }

    .webmail-login-page .login-card {
        padding: 28px 20px;
    }
    .temp-intro-card,
    .temp-info-card {
        padding: 20px 16px;
    }
    .temp-actions-panel {
        padding: 16px;
    }
    .temp-btn-row {
        flex-direction: column;
        align-items: stretch;
    }
    .temp-btn-row .btn,
    .temp-btn-row .temp-delay-cs-btn {
        width: 100%;
        text-align: center;
    }
    .temp-actions-panel .temp-login-link {
        display: block;
    }
}
