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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container h1 {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

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

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-info {
    background-color: #16a085;
    color: white;
}

.btn-info:hover {
    background-color: #138871;
}

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

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

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

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.login-tip {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.main-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.statistics-bar {
    display: flex;
    gap: 30px;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

.stat-value.alive {
    color: #28a745;
}

.stat-value.dead {
    color: #dc3545;
}

.stat-note {
    font-size: 12px;
    color: #6c757d;
    margin-left: 5px;
}

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

.table-container {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

/* 管理员视图（含号的位置列） */
.admin-view .data-table th:nth-child(1) { width: 16%; }  /* 账号MAIL */
.admin-view .data-table th:nth-child(2) { width: 9%; }   /* 邮箱密码 */
.admin-view .data-table th:nth-child(3) { width: 7%; }   /* 发送时间 */
.admin-view .data-table th:nth-child(4) { width: 7%; }   /* 存活时间 */
.admin-view .data-table th:nth-child(5) { width: 7%; }   /* 原因 */
.admin-view .data-table th:nth-child(6) { width: 8%; }   /* 是否提款 */
.admin-view .data-table th:nth-child(7) { width: 7%; }   /* 卡号位置 */
.admin-view .data-table th:nth-child(8) { width: 7%; }   /* 号的位置 */
.admin-view .data-table th:nth-child(9) { width: 12%; }  /* TOKENS */
.admin-view .data-table th:nth-child(10) { width: 10%; } /* 操作 */

/* 普通用户视图（无号的位置列） */
.user-view .data-table th:nth-child(1) { width: 20%; }  /* 账号MAIL */
.user-view .data-table th:nth-child(2) { width: 12%; }  /* 邮箱密码 */
.user-view .data-table th:nth-child(3) { width: 9%; }   /* 发送时间 */
.user-view .data-table th:nth-child(4) { width: 9%; }   /* 存活时间 */
.user-view .data-table th:nth-child(5) { width: 9%; }   /* 原因 */
.user-view .data-table th:nth-child(6) { width: 9%; }   /* 是否提款 */
.user-view .data-table th:nth-child(7) { width: 9%; }   /* 卡号位置 */
.user-view .data-table th:nth-child(8) { width: 13%; }  /* TOKENS */
.user-view .data-table th:nth-child(9) { width: 10%; }  /* 操作 */

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 有存活时间的行显示淡红色背景 */
.data-table tr.has-deposit-time {
    background-color: #ffe6e6;
}

.data-table tr.has-deposit-time:hover {
    background-color: #ffcccc;
}

/* 货款退回的行显示淡绿色背景 */
.data-table tr.has-refund {
    background-color: #e6ffe6;
}

.data-table tr.has-refund:hover {
    background-color: #ccffcc;
}

.editable {
    cursor: pointer;
    position: relative;
    max-width: 100%;
}

.editable:hover {
    background-color: #e9ecef;
}

/* TOKENS列特殊处理 */
.admin-view .data-table td:nth-child(9) {
    font-size: 11px;
    line-height: 1.3;
    max-width: 180px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-view .data-table td:nth-child(8) {
    font-size: 11px;
    line-height: 1.3;
    max-width: 200px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editable input {
    width: 100%;
    padding: 8px;
    border: 1px solid #3498db;
    border-radius: 4px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

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

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 响应式处理 */
@media (max-width: 1400px) {
    .container,
    .nav-container {
        max-width: 100%;
    }
}

/* 操作按钮组 */
.data-table td:last-child {
    white-space: nowrap;
}

/* 优化小屏幕显示 */
@media (max-width: 1200px) {
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }
    
    .btn-sm {
        padding: 3px 8px;
        font-size: 12px;
    }
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
}

/* 批量导入说明样式 */
.batch-instructions {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.batch-instructions p {
    margin: 5px 0;
}

.batch-instructions code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.batch-instructions .example {
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
}

/* textarea样式 */
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* 下拉选择样式 */
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* 表格内下拉选择样式 */
.editable-select {
    cursor: pointer;
    position: relative;
}

.editable-select:hover {
    background-color: #e9ecef;
}

.speed-select {
    width: 100%;
    padding: 6px;
    border: 1px solid #3498db;
    border-radius: 4px;
    font-size: 14px;
}

/* 护眼模式切换按钮 */
.btn-dark-mode {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.btn-dark-mode:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 护眼模式（黑色主题）样式 */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #0d0d0d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.dark-mode .main-content {
    background: #2a2a2a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .login-box {
    background: #2a2a2a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

body.dark-mode .login-box h2 {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #444;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
    border-color: #4a9eff;
}

body.dark-mode .statistics-bar {
    background-color: #2a2a2a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.dark-mode .stat-label {
    color: #b0b0b0;
}

body.dark-mode .data-table th {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-mode .data-table td {
    border-bottom: 1px solid #444;
    color: #e0e0e0;
}

body.dark-mode .data-table tr:hover {
    background-color: #333;
}

body.dark-mode .data-table tr.has-deposit-time {
    background-color: #3a2828;
}

body.dark-mode .data-table tr.has-deposit-time:hover {
    background-color: #4a3333;
}

body.dark-mode .data-table tr.has-refund {
    background-color: #283a28;
}

body.dark-mode .data-table tr.has-refund:hover {
    background-color: #334a33;
}

body.dark-mode .editable:hover,
body.dark-mode .editable-select:hover {
    background-color: #444;
}

body.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .modal h3 {
    color: #e0e0e0;
}

body.dark-mode .close {
    color: #999;
}

body.dark-mode .close:hover {
    color: #e0e0e0;
}

body.dark-mode .alert-error {
    background-color: #4a2828;
    color: #ff9999;
    border: 1px solid #663333;
}

body.dark-mode .alert-success {
    background-color: #284a28;
    color: #99ff99;
    border: 1px solid #336633;
}

body.dark-mode .batch-instructions {
    background-color: #333;
}

body.dark-mode .batch-instructions code {
    background-color: #444;
    color: #e0e0e0;
}

body.dark-mode .btn-primary {
    background-color: #2a5a8a;
}

body.dark-mode .btn-primary:hover {
    background-color: #1e4a7a;
}

body.dark-mode .btn-danger {
    background-color: #8a2a2a;
}

body.dark-mode .btn-danger:hover {
    background-color: #7a1e1e;
}

body.dark-mode .btn-info {
    background-color: #2a6a5a;
}

body.dark-mode .btn-info:hover {
    background-color: #1e5a4a;
}

body.dark-mode .btn-success {
    background-color: #2a6a3a;
}

body.dark-mode .btn-success:hover {
    background-color: #1e5a2a;
}

body.dark-mode .btn-warning {
    background-color: #8a6a2a;
    color: #e0e0e0;
}

body.dark-mode .btn-warning:hover {
    background-color: #7a5a1e;
}

/* 排序功能样式 */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.6;
}

.sortable:hover .sort-icon {
    opacity: 1;
}

/* 深色模式下的排序样式 */
body.dark-mode .sortable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 搜索和按钮布局 */
.search-and-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-box .btn {
    padding: 8px 16px;
    white-space: nowrap;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .search-and-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
        width: 100%;
    }
    
    .button-group {
        justify-content: center;
    }
}

/* 深色模式下的搜索框样式 */
body.dark-mode .search-box input {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .search-box input:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.25);
}

body.dark-mode .search-box input::placeholder {
    color: #a0aec0;
}

/* 收信按钮样式 */
.check-email-btn {
    padding: 2px 6px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    border-radius: 3px !important;
    white-space: nowrap;
    min-width: 36px;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 3px;
}


/* 表格头部文本对齐和美观优化 */
.data-table th {
    text-align: center;
    vertical-align: middle;
    padding: 10px 4px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    background-color: #2c3e50;
    color: white;
}

/* 表格内容美观优化 */
.data-table td {
    padding: 10px 4px;
    font-size: 15px;
    vertical-align: middle;
    line-height: 1.5;
}

/* 邮箱列特殊处理 */
.data-table th:first-child, /* 账号MAIL列头 */
.data-table td:first-child { /* 邮箱内容 */
    font-size: 14px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 确保收信按钮居中 */
.check-email-btn {
    display: block;
    margin: 0 auto;
    font-size: 10px !important;
    padding: 1px 4px !important;
}

/* 优化表格整体布局 */
.data-table {
    font-size: 12px;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

/* 针对不同列的精确宽度控制 */
.data-table th:nth-child(1) { width: 160px; } /* 账号MAIL */
.data-table th:nth-child(2) { width: 100px; } /* 邮箱密码 */
.data-table th:nth-child(3) { width: 90px; }  /* 发送时间 */
.data-table th:nth-child(4) { width: 90px; }  /* 存活时间 */
.data-table th:nth-child(5) { width: 80px; }  /* 原因 */
.data-table th:nth-child(6) { width: 80px; }  /* 是否提款 */
.data-table th:nth-child(7) { width: 100px; } /* 卡号位置 */
.data-table th:nth-child(8) { width: 50px; }  /* 收信 */

/* 管理员模式下的列宽（账号列表页面，共13列） */
.admin-view .data-table th:nth-child(1) { width: 40px; }   /* 复选框 */
.admin-view .data-table th:nth-child(2) { width: 150px; }  /* 账号MAIL */
.admin-view .data-table th:nth-child(3) { width: 90px; }   /* 邮箱密码 */
.admin-view .data-table th:nth-child(4) { width: 80px; }   /* 发送时间 */
.admin-view .data-table th:nth-child(5) { width: 80px; }   /* 存活时间 */
.admin-view .data-table th:nth-child(6) { width: 60px; }   /* 原因 */
.admin-view .data-table th:nth-child(7) { width: 70px; }   /* 是否提款 */
.admin-view .data-table th:nth-child(8) { width: 90px; }   /* 卡号位置 */
.admin-view .data-table th:nth-child(9) { width: 45px; }   /* 收信 */
.admin-view .data-table th:nth-child(10) { width: 60px; }  /* 号的位置 */
.admin-view .data-table th:nth-child(11) { width: 150px; } /* TOKENS */
.admin-view .data-table th:nth-child(12) { width: 55px; }  /* 检测状态 */
.admin-view .data-table th:nth-child(13) { width: 200px; } /* 操作 */

/* 普通用户模式下的列宽 */
.user-view .data-table th:nth-child(1) { width: 40px; }   /* 复选框 */
.user-view .data-table th:nth-child(2) { width: 150px; }  /* 账号MAIL */
.user-view .data-table th:nth-child(3) { width: 90px; }   /* 邮箱密码 */
.user-view .data-table th:nth-child(4) { width: 80px; }   /* 发送时间 */
.user-view .data-table th:nth-child(5) { width: 80px; }   /* 存活时间 */
.user-view .data-table th:nth-child(6) { width: 60px; }   /* 原因 */
.user-view .data-table th:nth-child(7) { width: 70px; }   /* 是否提款 */
.user-view .data-table th:nth-child(8) { width: 90px; }   /* 卡号位置 */
.user-view .data-table th:nth-child(9) { width: 45px; }   /* 收信 */
.user-view .data-table th:nth-child(10) { width: 60px; }  /* 号的位置 */
.user-view .data-table th:nth-child(11) { width: 150px; } /* TOKENS */
.user-view .data-table th:nth-child(12) { width: 55px; }  /* 检测状态 */
.user-view .data-table th:nth-child(13) { width: 180px; } /* 操作 */

/* 240元账号列表专用样式（包含复选框、检测状态等所有列） */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(1) { width: 50px; }   /* 复选框 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(2) { width: 150px; }  /* 账号MAIL */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(3) { width: 95px; }   /* 邮箱密码 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(4) { width: 90px; }   /* 发送时间 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(5) { width: 90px; }   /* 存活时间 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(6) { width: 80px; }   /* 原因 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(7) { width: 85px; }   /* 是否提款 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(8) { width: 180px; }  /* 卡号位置 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(9) { width: 85px; }   /* 号的位置 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(10) { width: 400px; } /* TOKENS - 更宽 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(11) { width: 80px; }  /* 检测状态 */
body[data-page="premium-240"] .admin-view .data-table th:nth-child(12) { width: 150px; } /* 操作 */

/* TOKENS列特殊处理 - 显示完整内容并支持悬停 */
.data-table td[data-field="tokens"] {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    position: relative;
    padding: 3px 1px;
    font-size: 10px;
    line-height: 1.1;
}

/* TOKENS列表头也调整间距 */
.admin-view .data-table th:nth-child(10),
.user-view .data-table th:nth-child(9) {
    padding: 5px 1px;
    font-size: 11px;
}

/* TOKENS悬停显示完整内容 */
.data-table td[data-field="tokens"]:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    position: relative;
    padding: 8px;
    border-radius: 4px;
}

/* 排序图标在深色背景下的可见性 */
.data-table th .sort-icon {
    color: white;
    margin-left: 5px;
}

/* 可点击的表头悬停效果 */
.data-table th.sortable:hover {
    background-color: #34495e;
    cursor: pointer;
}