* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
    padding: 16px;
}
.app {
    max-width: 1400px;
    margin: 0 auto;
}
.topbar {
    background: white;
    border-radius: 16px;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}
.topbar .logo {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0f172a;
}
.topbar .logo i {
    color: #6366f1;
    font-size: 26px;
}
.topbar .logo span {
    color: #94a3b8;
    font-weight: 400;
    font-size: 14px;
}
.topbar .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tab-nav {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 8px 20px 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
}
.tab-nav .tab-btn {
    padding: 12px 28px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.25s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tab-nav .tab-btn:hover {
    color: #1e293b;
    background: #f8fafc;
}
.tab-nav .tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    background: #eef2ff;
}
.tab-nav .tab-btn .badge {
    font-size: 11px;
    background: #e2e8f0;
    color: #64748b;
    padding: 1px 10px;
    border-radius: 20px;
    font-weight: 400;
}
.tab-nav .tab-btn.active .badge {
    background: #e0e7ff;
    color: #6366f1;
}
.tab-nav .tab-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: none;
    flex-shrink: 0;
}
.tab-nav .tab-btn .dot.active {
    display: inline-block;
}
.tab-content {
    background: white;
    border-radius: 0 0 16px 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    min-height: 500px;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}
.card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid #e2e8f0;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}
.card-title i {
    color: #6366f1;
    width: 20px;
}
.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.text-muted {
    color: #94a3b8;
    font-size: 13px;
}
.fw-600 {
    font-weight: 600;
}
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
.btn-primary { background: #6366f1; color: white; }
.btn-primary:hover { background: #4f46e5; }
.btn-success { background: #22c55e; color: white; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-info { background: #3b82f6; color: white; }
.btn-info:hover { background: #2563eb; }
.btn-purple { background: #8b5cf6; color: white; }
.btn-purple:hover { background: #7c3aed; }
.btn-gray { background: #e2e8f0; color: #475569; }
.btn-gray:hover { background: #cbd5e1; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #1e293b;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-control::placeholder {
    color: #94a3b8;
}
select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.account-card {
    background: white;
    border-radius: 10px;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.account-card:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}
.account-card .info {
    flex: 1;
    min-width: 0;
}
.account-card .info .name {
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
}
.account-card .info .phone {
    font-size: 13px;
    color: #94a3b8;
    font-family: monospace;
}
.account-card .info .sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}
.account-card .status {
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}
.account-card .status.online {
    background: #dcfce7;
    color: #16a34a;
}
.account-card .status.offline {
    background: #fee2e2;
    color: #dc2626;
}
.account-card .status.frozen {
    background: #fef3c7;
    color: #d97706;
}
.account-card .checkbox {
    margin-left: 12px;
    accent-color: #6366f1;
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.account-card .btn-del {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}
.account-card .btn-del:hover {
    background: #dc2626;
}
.account-card .badge-frozen {
    font-size: 11px;
    background: #fef3c7;
    color: #d97706;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 8px;
}
.empty {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-size: 14px;
}
.account-list-item {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}
.account-list-item:hover {
    border-color: #6366f1;
    background: #f8fafc;
}
.account-list-item.active {
    border-color: #6366f1;
    background: #eef2ff;
}
.account-list-item .name {
    font-weight: 500;
    font-size: 14px;
}
.account-list-item .count {
    font-size: 12px;
    color: #94a3b8;
}
.account-list-item .del-btn {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}
.account-list-item .del-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}
.phrase-row {
    display: grid;
    grid-template-columns: 30px 1.2fr 0.8fr 0.6fr 1.2fr 0.8fr 0.6fr 30px;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}
.phrase-row input, .phrase-row select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    background: white;
    width: 100%;
}
.phrase-row input:focus, .phrase-row select:focus {
    border-color: #6366f1;
    outline: none;
}
.phrase-row .del-btn {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}
.phrase-row .del-btn:hover {
    background: #fef2f2;
    border-radius: 4px;
}
.phrase-header {
    display: grid;
    grid-template-columns: 30px 1.2fr 0.8fr 0.6fr 1.2fr 0.8fr 0.6fr 30px;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    align-items: center;
}
.log-container {
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.8;
}
.log-container .log-line {
    display: flex;
    gap: 12px;
    padding: 2px 0;
    border-bottom: 1px solid #1e293b;
    align-items: flex-start;
}
.log-container .log-line .time {
    color: #475569;
    font-size: 10px;
    min-width: 75px;
    flex-shrink: 0;
}
.log-container .log-line .tag {
    font-weight: 600;
    font-size: 11px;
    min-width: 60px;
    flex-shrink: 0;
}
.log-container .log-line .tag.dm-in { color: #3b82f6; }
.log-container .log-line .tag.dm-out { color: #22c55e; }
.log-container .log-line .tag.system { color: #f59e0b; }
.log-container .log-line .tag.a { color: #22c55e; }
.log-container .log-line .tag.admin { color: #a78bfa; }
.log-container .log-line .tag.close { color: #ef4444; }
.log-container .log-line .tag.next { color: #f59e0b; }
.log-container .log-line .msg { color: #e2e8f0; word-break: break-word; }
.dm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}
.dm-item:hover {
    background: #f8fafc;
}
.dm-item.unread {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}
.dm-item .info {
    flex: 1;
    min-width: 0;
}
.dm-item .info .from {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}
.dm-item .info .from .phone {
    font-weight: 400;
    color: #94a3b8;
    font-size: 12px;
    margin-left: 8px;
}
.dm-item .info .msg {
    font-size: 14px;
    color: #475569;
    margin-top: 4px;
    word-break: break-word;
}
.dm-item .info .time {
    font-size: 11px;
    color: #94a3b8;
}
.dm-item .btn {
    flex-shrink: 0;
}
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}
.modal-header h3 i { color: #6366f1; }
.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 32px;
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: #1e293b; }
.modal-body { padding: 24px 28px; }
.modal-footer {
    padding: 16px 28px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
@media (max-width: 1024px) {
    .row-3 { grid-template-columns: 1fr 1fr; }
    #accountRows { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
    .row-2, .row-3 { grid-template-columns: 1fr; }
    .tab-nav .tab-btn { padding: 10px 16px; font-size: 14px; }
    .tab-nav .tab-btn span { display: none; }
    .tab-content { padding: 16px; }
    .topbar .logo span { display: none; }
    .topbar { padding: 12px 16px; }
    .phrase-row, .phrase-header {
        grid-template-columns: 25px 1fr 0.6fr 0.5fr 1fr 0.6fr 0.5fr 25px;
        font-size: 12px;
        gap: 4px;
    }
    .modal-box { max-width: 100%; margin: 10px; border-radius: 12px; }
}
@media (max-width: 480px) {
    .row-3 { grid-template-columns: 1fr; }
    .phrase-row, .phrase-header {
        grid-template-columns: 20px 1fr 0.5fr 0.4fr 1fr 0.5fr 0.4fr 20px;
        font-size: 11px;
        gap: 2px;
    }
}
/* ===== 批量加群样式 ===== */
#batchJoinAccounts {
    height: 140px !important;
    padding: 6px !important;
}
#batchJoinAccounts option {
    padding: 4px 8px;
    border-bottom: 1px solid #f1f5f9;
}
#batchJoinAccounts option:checked {
    background: #6366f1;
    color: white;
}
#batchJoinProgress {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
}
#batchJoinBar {
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s ease;
}
#batchJoinLogContainer {
    max-height: 150px;
    overflow-y: auto;
    background: #0f172a;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.8;
    border: 1px solid #1e293b;
}
#batchJoinLogContainer::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
#batchJoinLogContainer::-webkit-scrollbar-track {
    background: #1e293b;
}
#batchJoinLogContainer::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}