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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.domain-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.domain-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: monospace;
    font-size: 1.1em;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stats {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.main-content {
    padding: 30px;
}

.email-input-section {
    background: #f8fafc;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.input-group {
    display: flex;
    align-items: stretch;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    height: 64px;
}

.input-group:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input {
    flex: 1;
    padding: 0 20px;
    border: none;
    font-size: 1.3em;
    outline: none;
    min-width: 0;
    height: 100%;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.domain-suffix {
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Fira Mono', monospace;
    font-size: 1.3em;
    font-weight: 700;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    height: 100%;
    white-space: nowrap;
}

//.domain-suffix::before {
//    content: "@";
//    color: #3b82f6;
//    font-weight: 800;
//    margin-right: 2px;
//}

#check-email-btn {
    padding: 0 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    height: 100%;
}

#check-email-btn:hover {
    background: linear-gradient(135deg, #0da271 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

#check-email-btn:active {
    transform: translateY(0);
}

.input-hint {
    color: #64748b;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.input-hint i {
    color: #3b82f6;
}

.email-info {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
}

.email-info h3 {
    color: #1e293b;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-email {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

#current-email-text {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 1.1em;
    word-break: break-all;
    color: #1e293b;
}

.copy-btn, .refresh-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 0.95em;
}

.copy-btn {
    background: #3b82f6;
    color: white;
}

.copy-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.refresh-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.refresh-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.email-meta {
    display: flex;
    gap: 20px;
    color: #64748b;
    font-size: 0.9em;
}

.inbox-section {
    background: white;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.inbox-header h2 {
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inbox-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.auto-refresh-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    transition: all 0.3s;
}

.auto-refresh-btn:hover {
    background: #e2e8f0;
}

.auto-refresh-btn.active {
    background: #10b981;
    color: white;
}

.auto-refresh-btn.active i {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.inbox-container {
    min-height: 200px;
}

.inbox-placeholder {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.inbox-placeholder i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.inbox-placeholder h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #64748b;
}

.placeholder-tips {
    max-width: 400px;
    margin: 30px auto 0;
    text-align: left;
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.placeholder-tips p {
    color: #475569;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.placeholder-tips ul {
    list-style: none;
    padding-left: 0;
}

.placeholder-tips li {
    padding: 5px 0;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.placeholder-tips li:before {
    content: "•";
    color: #10b981;
    font-weight: bold;
}

/* 邮件列表和折叠展开效果 */
.email-list {
    transition: all 0.3s ease;
}

.email-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.email-item-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: white;
    transition: all 0.3s ease;
}

.email-item:hover .email-item-header {
    background: #f8fafc;
}

.email-item.expanded .email-item-header {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
}

.email-item.unread .email-item-header {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
}

.email-item-read {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.email-item.unread .email-item-read {
    background: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.email-item.read .email-item-read {
    background: #94a3b8;
}

.email-content {
    flex: 1;
    min-width: 0;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.email-sender {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-time {
    color: #64748b;
    font-size: 0.9em;
    white-space: nowrap;
    margin-left: 10px;
}

.email-subject {
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-subject i {
    font-size: 0.8em;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.email-item.expanded .email-subject i {
    transform: rotate(180deg);
    color: #3b82f6;
}

.email-preview {
    color: #64748b;
    font-size: 0.95em;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.email-size {
    color: #94a3b8;
    font-size: 0.8em;
    margin-top: 5px;
}

/* 折叠内容区域 */
.email-detail-collapse {
    max-height: 0;
    overflow: hidden;
    background: white;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid transparent;
}

.email-item.expanded .email-detail-collapse {
    max-height: 800px;
    border-bottom: 1px solid #e2e8f0;
}

.email-detail-content {
    padding: 30px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease 0.1s;
}

.email-item.expanded .email-detail-content {
    opacity: 1;
    transform: translateY(0);
}

.email-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 15px;
}

.email-detail-info {
    flex: 1;
    min-width: 0;
}

.email-detail-subject {
    font-size: 1.5em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    word-break: break-word;
}

.email-detail-from, .email-detail-to, .email-detail-time {
    color: #64748b;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.email-detail-from strong, .email-detail-to strong, .email-detail-time strong {
    color: #475569;
    min-width: 60px;
}

.email-detail-body-container {
    margin-top: 20px;
}

.email-detail-body {
    line-height: 1.6;
    color: #334155;
    font-size: 1em;
    max-width: 100%;
    overflow-x: auto;
}

.email-detail-body.html-content img {
    max-width: 100%;
    height: auto;
}

.email-detail-body.html-content table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.email-detail-body pre {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.5;
}

.email-detail-body iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.no-content-message {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
}

/* 加载动画 */
.loading-detail {
    padding: 30px;
    text-align: center;
    color: #64748b;
}

.loading-detail i {
    font-size: 2em;
    margin-bottom: 15px;
    opacity: 0.7;
    animation: spin 1s linear infinite;
}

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

footer {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.9em;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.footer-note {
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.7;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .input-group {
        flex-direction: column;
        height: auto;
    }
    
    .input-group input,
    .domain-suffix,
    #check-email-btn {
        width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #e2e8f0;
        height: 60px;
    }
    
    .input-group input {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        font-size: 1.2em;
        padding: 0 15px;
    }
    
    .domain-suffix {
        font-size: 1.2em;
        padding: 0 15px;
        justify-content: center;
    }
    
    #check-email-btn {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        font-size: 1.2em;
        justify-content: center;
        padding: 0 15px;
    }
    
    .current-email {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .email-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .inbox-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .inbox-controls {
        justify-content: space-between;
    }
    
    .email-item-header {
        padding: 15px 20px;
    }
    
    .email-detail-content {
        padding: 20px;
    }
    
    .email-detail-subject {
        font-size: 1.2em;
    }
    
    .email-detail-meta {
        flex-direction: column;
        gap: 10px;
    }
}

/* 添加@符号的高亮效果 */
.input-group input:placeholder-shown + .domain-suffix {
    color: #64748b;
    font-weight: 600;
}

.input-group input:not(:placeholder-shown) + .domain-suffix {
    color: #1e293b;
    font-weight: 700;
}
