* {
    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;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.domain {
    font-size: 1.2em;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.mode-buttons {
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: #f0f0ff;
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

.refresh-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-control label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
}

.refresh-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #218838;
}

.stats {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 500;
    color: #495057;
}

.mail-list-container {
    overflow-x: auto;
}

.mail-table {
    width: 100%;
    border-collapse: collapse;
}

.mail-table thead {
    background: #f8f9fa;
}

.mail-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.mail-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.mail-table tbody tr:hover {
    background: #f8f9fa;
}

.to-addr {
    color: #667eea;
    font-weight: 500;
    min-width: 150px;
}

.subject {
    min-width: 200px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date {
    color: #6c757d;
    font-size: 0.9em;
    white-space: nowrap;
}

.code {
    text-align: center;
}

.code-value {
    display: inline-block;
    padding: 5px 15px;
    background: #28a745;
    color: white;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
    letter-spacing: 2px;
}

.no-code {
    color: #adb5bd;
}

.has-code {
    font-weight: 600;
}

.btn-view {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.btn-view:hover {
    background: #5568d3;
}

.loading, .empty, .error {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.error {
    color: #dc3545;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.detail-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    color: #495057;
    display: inline-block;
    min-width: 100px;
}

.code-value-large {
    display: inline-block;
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.5em;
    letter-spacing: 3px;
    margin-left: 10px;
}

.mail-body {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

/* 工具按钮 */
.tool-btn {
    background: #ff9800 !important;
    border-color: #ff9800 !important;
    color: white !important;
}

.tool-btn:hover {
    background: #f57c00 !important;
}

/* 生成账号面板 */
.panel {
    padding: 20px 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.panel-header h2 {
    color: #667eea;
    margin: 0;
}

.close-panel {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.close-panel:hover {
    color: #333;
}

.panel-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.panel-section h3 {
    margin-bottom: 15px;
    color: #495057;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.config-row label {
    font-weight: 500;
    min-width: 120px;
}

.config-row input[type="text"],
.config-row input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.config-row button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #6c757d;
    color: white;
    transition: background 0.3s;
}

.config-row button:hover {
    background: #5a6268;
}

.primary-btn {
    background: #28a745 !important;
}

.primary-btn:hover {
    background: #218838 !important;
}

.status-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-message:empty {
    display: none;
}

/* 任务列表 */
.task-list {
    max-height: 300px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #6c757d;
}

.task-item.running {
    border-left-color: #ffc107;
}

.task-item.completed {
    border-left-color: #28a745;
}

.task-item.failed {
    border-left-color: #dc3545;
}

.task-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.task-id {
    font-family: monospace;
    font-size: 12px;
    color: #6c757d;
}

.task-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-running {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.task-count, .task-result, .task-time {
    font-size: 13px;
    color: #6c757d;
}

.task-item button {
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.task-item button:hover {
    background: #5568d3;
}

/* 任务详情 */
.detail-header {
    padding: 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 15px;
    line-height: 1.8;
}

.results-list {
    max-height: 200px;
    overflow-y: auto;
}

.result-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 14px;
}

.result-item.success {
    background: #d4edda;
    color: #155724;
}

.result-item.failed {
    background: #f8d7da;
    color: #721c24;
}

.logs-container {
    max-height: 200px;
    overflow-y: auto;
    background: #1e1e1e;
    border-radius: 6px;
    padding: 15px;
}

.logs-container pre {
    margin: 0;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 进度条样式 */
.progress-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-name {
    font-weight: 600;
    color: #495057;
}

.progress-step {
    color: #667eea;
    font-size: 14px;
}

.progress-time {
    color: #6c757d;
    font-size: 13px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* 账号表格样式 */
.accounts-table {
    width: 100%;
    border-collapse: collapse;
}

.accounts-table th,
.accounts-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.accounts-table thead {
    background: #f8f9fa;
}

.accounts-table th {
    font-weight: 600;
    color: #495057;
}

.accounts-table tr.success {
    background: #f8fff8;
}

.accounts-table tr.failed {
    background: #fff8f8;
}

.accounts-table tr.used {
    background: #f5f5f5;
    opacity: 0.7;
}

.accounts-table tr:hover:not(.used) {
    background: #f0f0ff;
}

.account-email {
    font-family: monospace;
    font-size: 13px;
}

.account-pwd {
    font-family: monospace;
    font-size: 13px;
    color: #666;
}

.account-status.success {
    color: #28a745;
}

.account-status.failed {
    color: #dc3545;
}

.used-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #6c757d;
    color: white;
    border-radius: 10px;
    font-size: 12px;
}

.used-label {
    color: #adb5bd;
}

.small-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.small-btn.danger {
    background: #dc3545;
    color: white;
}

.small-btn.danger:hover {
    background: #c82333;
}

.small-btn.warning {
    background: #ffc107;
    color: #212529;
}

.small-btn.warning:hover {
    background: #e0a800;
}

.warning-btn {
    background: #ffc107 !important;
    color: #212529 !important;
}

.warning-btn:hover {
    background: #e0a800 !important;
}

.danger-btn {
    background: #dc3545 !important;
    color: white !important;
}

.danger-btn:hover {
    background: #c82333 !important;
}

.task-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.task-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    background: #6c757d;
    color: white;
}

.task-actions button:hover {
    background: #5a6268;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination span {
    color: #6c757d;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .mode-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .refresh-control {
        justify-content: center;
    }

    .mail-table {
        font-size: 0.9em;
    }

    .mail-table th,
    .mail-table td {
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .config-row {
        flex-direction: column;
        align-items: stretch;
    }

    .config-row input[type="text"] {
        width: 100% !important;
    }

    .task-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .accounts-table {
        font-size: 12px;
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 8px 5px;
    }
}


