/* 临时邮箱接码页面样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.email-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-page .container-narrow {
    max-width: 540px;
    margin-top: 20vh;
}

.login-page .login-card {
    background: white;
    border-radius: 16px;
    padding: 24px 22px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-page .login-hero {
    text-align: center;
    margin-bottom: 18px;
}

.login-page .login-hero-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.28);
}

.login-page .login-hero-icon svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-page .login-hero h1 {
    font-size: 1.9rem;
    line-height: 1.1;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-page .login-hero p {
    font-size: 0.9rem;
    color: #6c757d;
}

.login-page .login-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-bottom: 18px;
}

.login-page .login-tab {
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 10px;
    min-height: 44px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.login-page .login-tab.is-active {
    background: #ffffff;
    color: #667eea;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.login-page .tab-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.login-page .tab-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-page .login-panel-wrap {
    display: grid;
    background: transparent;
    border-radius: 16px;
    padding: 0;
    box-shadow: none;
}

.login-page .login-panel {
    grid-area: 1 / 1;
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.login-page .login-panel.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.login-page .login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.login-page .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.login-page .form-input {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-page .form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.login-page .textarea-wrap {
    position: relative;
}

.login-page .textarea-icon {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

.login-page .textarea-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-page .form-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 16px 12px 12px 50px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-page .form-textarea::placeholder {
    color: #adb5bd;
}

.login-page .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.login-page .form-note {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.8rem;
}

.login-page .form-note-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #a5b4fc;
    color: #667eea;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.login-page .primary-btn {
    margin-top: auto;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    box-shadow: none;
}

.login-page .primary-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.login-page .btn-arrow {
    margin-left: 6px;
    font-size: 1rem;
    line-height: 1;
}

.email-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 15px;
}

.email-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.email-address {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.switch-btn {
    background: #eef2ff;
    color: #5568d3;
    border: 1px solid #c7d2fe;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.switch-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    transform: translateY(-2px);
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
    margin-left: 15px;
}

.copy-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.status {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.status.loading {
    background: #fff3cd;
    color: #856404;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

.inbox-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.inbox-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-btn:hover {
    background: #e9ecef;
}

.refresh-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 激活按钮 */
.activate-btn-wrap {
    position: relative;
    display: inline-flex;
}

.activate-btn {
    background: #fff8e1;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.activate-btn:hover {
    background: #fff3cd;
}

.activate-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.activate-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(0,0,0,0.78);
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.6;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    z-index: 10;
    pointer-events: none;
}

.activate-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 14px;
    border: 5px solid transparent;
    border-bottom-color: rgba(0,0,0,0.75);
}

.activate-btn-wrap:hover .activate-tooltip {
    display: block;
}

.message-list {
    height: 330px;
    overflow-y: auto;
}

.message-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.message-item:hover {
    background: #f8f9fa;
}

.message-item:last-child {
    border-bottom: none;
}

.message-main {
    flex: 1;
    min-width: 0;
}

.message-subject {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
}

.delete-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid #e5e7eb;
    padding: 5px 9px;
    margin-left: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    color: #9ca3af;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.delete-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-text {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.empty-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
}

.countdown {
    font-size: 0.85rem;
    color: #667eea;
    margin-top: 5px;
}

/* 邮件详情模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 25px;
}

.detail-row {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.detail-value {
    color: #333;
    font-size: 0.95rem;
}

.message-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* iframe 渲染 HTML 邮件内容 */
.email-iframe {
    width: 100%;
    min-height: 200px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 收取邮件 loading */
.fetch-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-bottom: 15px;
    background: #e8f0fe;
    color: #1a56db;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #155724;
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.toast-error {
    background: #721c24;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .login-page .login-card {
        padding: 20px 16px 16px;
        border-radius: 16px;
    }

    .email-display {
        flex-direction: column;
        gap: 15px;
    }

    .email-actions {
        width: 100%;
        flex-direction: column;
    }

    .login-card {
        padding: 0;
    }

    .login-page .container-narrow {
        max-width: 100%;
        margin-top: 12vh;
    }

    .login-page .login-hero-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        margin-bottom: 14px;
    }

    .login-page .login-hero h1 {
        font-size: 1.6rem;
    }

    .login-page .login-tabs {
        grid-template-columns: 1fr;
        border-radius: 20px;
        padding: 8px;
    }

    .login-page .login-tab {
        min-height: 42px;
        font-size: 0.88rem;
    }

    .login-page .login-panel-wrap {
        padding: 0;
    }

    .login-page .form-textarea {
        min-height: 96px;
        padding-left: 46px;
    }

    .copy-btn {
        margin-left: 0;
        width: 100%;
    }

    .switch-btn {
        width: 100%;
    }

    .email-address {
        font-size: 1.1rem;
    }

    .inbox-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============ 邮箱卡片选择 ============ */
.picker-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
    padding: 20px;
}
.picker-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 640px;
    padding: 24px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.picker-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1f2937;
}
.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    overflow-y: auto;
}
.picker-card {
    position: relative;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.picker-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}
.picker-card-icon {
    font-size: 1.6rem;
    line-height: 1;
}
.picker-card-email {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    word-break: break-all;
    line-height: 1.3;
}
.picker-card-provider {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.picker-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.picker-card-remove:hover {
    background: #dc2626;
    color: #fff;
}
.picker-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}
.picker-add {
    color: #3b82f6;
    font-size: 0.9rem;
    text-decoration: none;
}
.picker-add:hover {
    text-decoration: underline;
}

.picker-modal { position: relative; }
.picker-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #475569;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.picker-close:hover {
    background: #dc2626;
    color: #fff;
}

/* ============ 登录页统一错误条 ============ */
/* 宽度与 .login-card 同（受外层 .container-narrow 540px 约束），跟 tab 行宽一致 */
.login-error-box {
    margin: 12px 0 0;
    padding: 12px 22px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 16px;
    color: #b91c1c;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.08);
}
.login-error-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.login-error-text { line-height: 1.4; }
