/* 现代化临时邮箱界面样式 */

/* CSS变量定义 */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色主题 */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #93bbfc;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border: #334155;
    --border-light: #475569;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
.aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    background: radial-gradient(circle at 20% 50%, var(--primary) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, var(--primary-light) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, var(--primary-dark) 0%, transparent 50%);
    filter: blur(100px);
    animation: aurora 20s ease-in-out infinite;
}

@keyframes aurora {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* 头部 */
.header {
    margin-bottom: 2rem;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .header-content {
    background: rgba(30, 41, 59, 0.5);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.brand-icon:hover {
    transform: rotate(-5deg) scale(1.05);
}

.brand-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 主题切换器 */
.theme-switcher {
    position: relative;
}

.theme-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.theme-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.theme-btn svg {
    transition: var(--transition);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* 主内容区 */
.main {
    animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 控制面板 */
.control-panel {
    margin-bottom: 2rem;
}

.control-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

[data-theme="dark"] .control-card {
    background: rgba(30, 41, 59, 0.9);
}

.control-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 35px -5px rgb(0 0 0 / 0.15);
}

/* 输入组 */
.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-field {
    width: 100%;
    height: 52px;
    padding: 0 1rem 0 3rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.input-field::placeholder {
    color: var(--text-tertiary);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgb(59 130 246 / 0.1);
}

[data-theme="dark"] .input-field:focus {
    box-shadow: 0 0 0 4px rgb(96 165 250 / 0.1);
}

/* 操作行 */
.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.action-btn {
    height: 52px;
    padding: 0 2rem;
    border-radius: var(--radius-md);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn.primary:active {
    transform: translateY(0);
}

.action-btn.primary.active {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.btn-icon {
    transition: var(--transition);
}

.action-btn.primary:hover .btn-icon {
    transform: scale(1.1);
}

/* 状态组 */
.status-group {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-tertiary);
    position: relative;
}

.status-dot.active {
    background: var(--success);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgb(16 185 129 / 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgb(16 185 129 / 0);
    }
}

.fetch-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.fetch-counter strong {
    color: var(--primary);
    font-size: 1rem;
}

/* 邮件区域 */
.mail-section {
    min-height: 400px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
    text-align: center;
}

[data-theme="dark"] .empty-state {
    background: rgba(30, 41, 59, 0.5);
}

.empty-illustration {
    margin-bottom: 2rem;
    color: var(--primary);
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-secondary);
}

/* 邮件列表 */
.mail-list {
    display: grid;
    gap: 1rem;
}

/* 邮件卡片 */
.mail-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    opacity: 0;
}

[data-theme="dark"] .mail-card {
    background: rgba(30, 41, 59, 0.95);
}

.mail-card.fade-in {
    animation: slideUp 0.5s ease-out forwards;
}

.mail-card.visible {
    opacity: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.mail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.mail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mail-badge {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mail-time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.mail-sender {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.mail-subject {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* 邮件标签 */
.mail-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.mail-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.mail-tab:hover {
    color: var(--text-primary);
}

.mail-tab.active {
    background: var(--bg-primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* 邮件内容 */
.mail-content {
    position: relative;
    min-height: 200px;
}

.mail-text,
.mail-html {
    display: none;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.mail-text.active,
.mail-html.active {
    display: block;
}

.mail-html {
    width: 100%;
    height: 400px;
    border: 1px solid var(--border);
}

/* 滚动条 */
.mail-text::-webkit-scrollbar,
.mail-html::-webkit-scrollbar {
    width: 8px;
}

.mail-text::-webkit-scrollbar-track,
.mail-html::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.mail-text::-webkit-scrollbar-thumb,
.mail-html::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: var(--radius-sm);
}

.mail-text::-webkit-scrollbar-thumb:hover,
.mail-html::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 页脚 */
.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: var(--transition);
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .brand-info h1 {
        font-size: 1.25rem;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-row {
        flex-direction: column;
    }
    
    .status-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .mail-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mail-subject {
        font-size: 1.125rem;
    }
    
    .empty-illustration svg {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .control-card {
        padding: 1.5rem 1rem;
    }
    
    .status-group {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .mail-card {
        padding: 1rem;
    }
}