/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header 样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 3rem;
    color: #ffd700;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* Card 样式 */
.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 i {
    color: #667eea;
}

/* Email Generator 样式 */
.generator-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.option-group label:hover {
    color: #667eea;
}

/* 自定义单选按钮 */
.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

input[type="radio"] {
    display: none;
}

input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
    background: #667eea;
}

input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Input Group 样式 */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 250px;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.domain {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #4fd1c7 0%, #45b7aa 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 209, 199, 0.3);
}

.btn-copy {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 12px;
    min-width: auto;
}

.btn-copy:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Generated Email 样式 */
.generated-email {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.email-display {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.email-display input {
    flex: 1;
    padding: 15px;
    border: 2px solid #667eea;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    background: white;
}

.email-info {
    display: flex;
    gap: 30px;
    color: #718096;
    font-size: 0.9rem;
}

.email-info i {
    color: #667eea;
    margin-right: 5px;
}

/* Account Status 样式 */
.account-status {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #f0fff4 0%, #f7fffc 100%);
    border-radius: 15px;
    border: 1px solid #68d391;
}

.status-info h3 {
    color: #2f855a;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-info p {
    margin-bottom: 10px;
    color: #4a5568;
}

.highlight {
    font-weight: 700;
    color: #2f855a;
    font-size: 1.1rem;
}

/* Progress Bar 样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Tabs 样式 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #718096;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

/* Send Form 样式 */
.send-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
}

.form-select {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Email Editor 样式 */
.editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

.editor-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.editor-btn.active {
    background: #667eea;
    color: white;
}

.email-editor {
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: white;
    outline: none;
    line-height: 1.6;
    font-size: 1rem;
}

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

.email-editor:empty::before {
    content: attr(data-placeholder);
    color: #a0aec0;
    pointer-events: none;
}

.character-count {
    text-align: right;
    font-size: 0.875rem;
    color: #718096;
    margin-top: 5px;
}

.character-count.warning {
    color: #ed8936;
}

.character-count.error {
    color: #e53e3e;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.send-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.send-status.success {
    background: #f0fff4;
    border: 1px solid #68d391;
    color: #2f855a;
}

.send-status.error {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #c53030;
}

.send-status.sending {
    background: #e6fffa;
    border: 1px solid #4fd1c7;
    color: #285e61;
}

/* Email Verification 样式 */
.email-verification {
    margin-top: 10px;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-verification.valid {
    background: #f0fff4;
    border: 1px solid #68d391;
    color: #2f855a;
}

.email-verification.invalid {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #c53030;
}

.email-verification.checking {
    background: #e6fffa;
    border: 1px solid #4fd1c7;
    color: #285e61;
}

.verification-content {
    flex: 1;
}

.verification-email {
    font-weight: 600;
    margin-bottom: 5px;
}

.verification-status {
    font-size: 0.85rem;
    opacity: 0.9;
}

.verification-expiry {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Modal 样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.email-meta {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.meta-row {
    display: flex;
    margin-bottom: 10px;
}

.meta-row:last-child {
    margin-bottom: 0;
}

.meta-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
}

.meta-value {
    color: #2d3748;
    word-break: break-all;
}

.modal-body .email-content {
    line-height: 1.6;
    color: #2d3748;
}

.modal-body .email-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.modal-body .email-content pre {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: #f7fafc;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 101, 101, 0.3);
}

.email-list h3 {
    color: #4a5568;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.email-item {
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.email-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.email-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 20px;
}

.email-sender {
    font-weight: 600;
    color: #4a5568;
}

.email-time {
    color: #a0aec0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.email-subject {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.email-preview {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Features Grid 样式 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.feature {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.feature h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature p {
    color: #718096;
    line-height: 1.5;
}

/* Footer 样式 */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    color: white;
    opacity: 0.8;
}

.footer p {
    margin-bottom: 5px;
}

/* Loading Overlay 样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast 样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.toast.error {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.toast.info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .option-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input[type="text"] {
        min-width: auto;
    }
    
    .email-display {
        flex-direction: column;
    }
    
    .email-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .email-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* 新增响应式样式 */
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #e2e8f0;
        border-radius: 0;
    }
    
    .tab-btn.active {
        border-bottom-color: #667eea;
        border-left: 3px solid #667eea;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .editor-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .meta-row {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .card h2 {
        font-size: 1.3rem;
    }
    
    .feature {
        padding: 20px;
    }
    
    .feature i {
        font-size: 2rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

.card:nth-child(4) {
    animation-delay: 0.3s;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .card {
        background: rgba(45, 55, 72, 0.9);
        color: #e2e8f0;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .card h2 {
        color: #e2e8f0;
    }
    
    .input-group input[type="text"] {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .input-group input[type="text"]:focus {
        border-color: #667eea;
        background: #2d3748;
    }
    
    .generated-email {
        background: rgba(26, 32, 44, 0.8);
        border-color: #4a5568;
    }
    
    .account-status {
        background: rgba(22, 54, 35, 0.8);
        border-color: #48bb78;
    }
    
    .feature {
        background: rgba(45, 55, 72, 0.8);
        border-color: #4a5568;
    }
    
    .email-item {
        background: rgba(45, 55, 72, 0.9);
        border-color: #4a5568;
        color: #e2e8f0;
    }
}
