* {
    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;
    color: #333;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 域名管理卡片 */
.domain-manager {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.domain-card h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.5em;
}

.domain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.domain-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.domain-selector label {
    font-weight: 600;
    color: #333;
}

.domain-select {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.domain-select:hover {
    border-color: #667eea;
}

.domain-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.domain-manager-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.domain-list {
    margin-bottom: 20px;
}

.domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.domain-item.current {
    background: #e3f2fd;
    border-color: #667eea;
}

.domain-item-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.domain-item-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
    width: auto;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.add-domain-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.domain-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.domain-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 邮箱生成卡片 */
.email-generator {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.generator-card h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.email-display {
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-display .email-address {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    word-break: break-all;
}

.email-display .placeholder {
    color: #999;
    font-style: italic;
}

.info-text {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 5px;
    color: #1976d2;
    font-size: 0.9em;
    text-align: center;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* 验证码显示区域 */
.verification-code {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.5s ease;
}

.code-card {
    text-align: center;
}

.code-card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.code-value {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 20px 40px;
    border: 3px solid #667eea;
    border-radius: 15px;
    min-width: 200px;
    letter-spacing: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-copy-code {
    background: #28a745;
    color: white;
    padding: 15px 30px;
    font-size: 1.1em;
    width: auto;
}

.btn-copy-code:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.code-hint {
    color: #999;
    font-size: 0.9em;
    margin-top: 15px;
}

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

/* 邮件列表 */
.email-list {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header h2 {
    color: #667eea;
}

.list-header .btn {
    width: auto;
    padding: 8px 20px;
}

.messages-container {
    max-height: 600px;
    overflow-y: auto;
}

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

.empty-state p {
    margin: 10px 0;
    font-size: 1.1em;
}

.hint {
    font-size: 0.9em !important;
    opacity: 0.7;
}

/* 邮件项 */
.message-item {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.message-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
    transform: translateX(5px);
}

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

.message-subject {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    flex: 1;
}

.message-time {
    color: #999;
    font-size: 0.9em;
    white-space: nowrap;
    margin-left: 15px;
}

.message-from {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.message-preview {
    color: #888;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 8px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

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

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

.modal-header h3 {
    color: #667eea;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.email-meta {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.email-meta p {
    margin: 8px 0;
    color: #666;
}

.email-content {
    line-height: 1.6;
    color: #333;
}

.email-content pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .email-display .email-address {
        font-size: 1.2em;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .list-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .list-header .btn {
        width: 100%;
    }
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.8;
}


