/* MXH 无限邮箱 - 样式表 */
/* 作者: mi */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-hover: #1a1a28;
    --bg-input: #1a1a28;
    --border: #2a2a3a;
    --text: #e0e0e8;
    --text-muted: #666680;
    --primary: #6c5ce7;
    --primary-hover: #7c6cf7;
    --primary-glow: rgba(108, 92, 231, 0.3);
    --success: #00d2a0;
    --danger: #ff4757;
    --warning: #ffa502;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon { font-size: 28px; }
.logo h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-tag {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(0, 210, 160, 0.15);
    color: var(--success);
    border-radius: 20px;
    border: 1px solid rgba(0, 210, 160, 0.3);
}

.user-email {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { opacity: 0.9; }

/* ===== Auth Panel ===== */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.auth-hero {
    text-align: center;
    padding: 40px 30px 24px;
    background: linear-gradient(180deg, rgba(108,92,231,0.08) 0%, transparent 100%);
}

.hero-icon { font-size: 56px; margin-bottom: 12px; }
.auth-hero h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}
.auth-hero p {
    color: var(--text-muted);
    font-size: 14px;
}
.author {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--primary);
    opacity: 0.7;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 24px;
}
.tab-content.active { display: block; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea { resize: vertical; }

select {
    width: auto;
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}
select:focus { box-shadow: none; }

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: border-color 0.2s;
}
.input-with-suffix:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-with-suffix input {
    border: none;
    background: transparent;
    padding: 10px 0;
    flex: 1;
}
.input-with-suffix input:focus { box-shadow: none; }
.suffix {
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ===== Mail Panel ===== */
.mail-panel {
    height: calc(100vh - 60px);
}

.mail-layout {
    display: flex;
    height: 100%;
}

.mail-sidebar {
    width: 340px;
    min-width: 340px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.mail-stats {
    padding: 8px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.mail-list {
    flex: 1;
    overflow-y: auto;
}

.mail-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.mail-item:hover { background: var(--bg-hover); }
.mail-item.active { background: var(--bg-hover); border-left: 3px solid var(--primary); }
.mail-item.unread { border-left: 3px solid var(--success); }

.mail-item-from {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mail-item-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}
.mail-item-subject {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-item-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mail Content */
.mail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.ctab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.ctab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.content-pane {
    display: none;
    flex: 1;
    overflow-y: auto;
}
.content-pane.active { display: flex; flex-direction: column; }

.mail-detail {
    flex: 1;
    padding: 24px;
}

.mail-detail-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.mail-detail-subject {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}
.mail-detail-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.mail-detail-meta strong {
    color: var(--text);
}

.mail-detail-body {
    line-height: 1.7;
    font-size: 14px;
}
.mail-detail-body a { color: var(--primary); }
.mail-detail-body img { max-width: 100%; height: auto; border-radius: 8px; }

.mail-detail-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Send Form */
.send-form {
    padding: 24px;
    max-width: 600px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.text-muted { color: var(--text-muted); }

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
    text-align: center;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }

/* Loading */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header { padding: 10px 16px; }
    .logo h1 { font-size: 16px; }
    .provider-tag { display: none; }
    
    .mail-layout { flex-direction: column; }
    .mail-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .mail-content { min-height: 60vh; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Copy Button ===== */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
