/* 基础样式 */
* {
    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;
    color: #333;
}

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

/* 头部 */
header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

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

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

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(255,255,255,0.3);
}

/* 导航卡片 */
.main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.nav-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.nav-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.nav-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #667eea;
}

.nav-card p {
    color: #666;
    margin-bottom: 15px;
}

.nav-card ul {
    list-style: none;
    color: #888;
}

.nav-card ul li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.nav-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
}

/* API信息 */
.api-info {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.api-info h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.api-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-box code {
    display: block;
    font-size: 1.1rem;
    color: #e83e8c;
    margin-bottom: 10px;
}

.api-test {
    margin-top: 20px;
}

.api-test h4 {
    margin-bottom: 15px;
}

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

.test-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.test-form input:focus {
    border-color: #667eea;
    outline: none;
}

.test-form button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.test-form button:hover {
    background: #5a6fd6;
}

#testResult {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* 主标签页 */
.main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.main-tab-btn {
    padding: 15px 40px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    cursor: pointer;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.main-tab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.main-tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.main-tab-content {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.main-tab-content.active {
    display: block;
}

/* 子标签页 */
.sub-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 12px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.1);
    padding: 5px;
    border-radius: 12px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    transition: background 0.3s;
}

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

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-refresh {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-refresh:hover {
    background: #e9ecef;
}

.btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

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

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

/* 表格 */
.table-container {
    overflow-x: visible;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th, td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    word-break: break-all;
    vertical-align: middle;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

tr:hover {
    background: #f8f9fa;
}

/* 表格列宽控制 */
table {
    table-layout: auto;
    width: 100%;
}

th, td {
    white-space: nowrap;
    padding: 10px 8px;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-info {
    color: #666;
    font-size: 0.9rem;
    margin-right: 10px;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

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

.page-dots {
    padding: 8px 5px;
    color: #999;
}

/* 个人中心样式 */
.profile-section {
    padding: 20px 0;
}

.profile-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.profile-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.profile-card h4 {
    margin: 0 0 15px 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.stats-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

.status-active {
    color: #28a745;
    font-weight: 500;
}

.status-inactive {
    color: #dc3545;
    font-weight: 500;
}

.action-btns {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
}

.action-btns .btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* 收件箱样式 */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.inbox-header h3 {
    margin: 0;
    color: #333;
}

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

.inbox-controls select,
.inbox-controls input[type="email"] {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    min-width: 300px;
}

.inbox-content {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

.email-list {
    width: 35%;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow-y: auto;
    max-height: 600px;
}

.email-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:hover {
    background: #f5f5f5;
}

.email-item.active {
    background: #e3f2fd;
    border-left: 3px solid #667eea;
}

.email-item-from {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-subject {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-date {
    color: #999;
    font-size: 0.75rem;
}

.email-item-folder {
    display: inline-block;
    padding: 2px 6px;
    background: #ff9800;
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.email-preview {
    flex: 1;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
    background: #fafafa;
}

.email-preview-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.email-preview-header h4 {
    margin: 0 0 10px 0;
    color: #333;
    word-break: break-word;
}

.email-preview-meta {
    font-size: 0.85rem;
    color: #666;
}

.email-preview-meta p {
    margin: 5px 0;
}

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

.email-preview-body iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    background: white;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
    font-size: 0.95rem;
}

/* 表单 */
.form-box {
    max-width: 600px;
    margin: 0 auto;
}

.form-box h3 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

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

.form-row .form-group {
    flex: 1;
}

.format-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.format-info h4 {
    margin-bottom: 10px;
    color: #667eea;
}

.format-info p {
    margin-bottom: 5px;
    font-family: monospace;
    font-size: 0.9rem;
}

.format-info .note {
    margin-top: 10px;
    color: #666;
    font-family: inherit;
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.result-box.success {
    background: #d4edda;
    color: #155724;
}

.result-box.error {
    background: #f8d7da;
    color: #721c24;
}

/* 批量生成 */
.batch-generate {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.batch-generate h4 {
    margin-bottom: 15px;
}

.batch-generate input {
    width: 100px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

/* DNS信息 */
.dns-info {
    margin-top: 30px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.dns-info h4 {
    margin-bottom: 10px;
}

.dns-info ul {
    margin-left: 20px;
    margin-top: 10px;
}

.dns-info li {
    margin-bottom: 5px;
}

.dns-record-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.dns-record-box h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.dns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 10px 0;
}

.dns-table th,
.dns-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.dns-table th {
    background: #667eea;
    color: white;
}

.dns-table td {
    background: white;
}

.dns-note {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
    color: #666;
}

.dns-tips {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.dns-tips h5 {
    margin: 0 0 10px 0;
    color: #856404;
}

.dns-tips ul {
    margin: 0;
    padding-left: 20px;
}

.dns-tips li {
    margin-bottom: 8px;
    color: #856404;
}

.dns-tips code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.dns-tips a {
    color: #667eea;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

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

.modal-body {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.email-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
}

.email-item:hover {
    background: #f8f9fa;
}

.email-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.email-from {
    font-weight: 500;
    color: #333;
}

.email-date {
    color: #999;
    font-size: 0.9rem;
}

.email-subject {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 10px;
}

.email-body {
    color: #666;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.no-emails {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 30px;
    color: rgba(255,255,255,0.7);
}

/* 响应式 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .nav-card {
        padding: 20px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .action-btns {
        flex-direction: column;
    }
}
