/* TG Gallery 管理后台样式 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #fff;
    min-height: 100vh;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
}
.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
    font-size: 14px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #ec4899;
}
.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #333; }
.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}
.error-msg {
    color: #e74c3c;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

/* 管理面板布局 */
.admin-container { display: none; }
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #333;
}
.sidebar-header h1 {
    font-size: 18px;
    color: #ec4899;
}

/* Session 状态指示器 */
.session-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #252525;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.session-status:hover {
    background: #333;
}
.session-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
.session-status .dot.online {
    background: #27ae60;
    box-shadow: 0 0 8px #27ae60;
}
.session-status .dot.offline {
    background: #e74c3c;
    box-shadow: 0 0 8px #e74c3c;
    animation: none;
}
.session-status .dot.checking {
    background: #f39c12;
    box-shadow: 0 0 8px #f39c12;
}
.session-status .text {
    color: #888;
}
.session-status .text.online { color: #27ae60; }
.session-status .text.offline { color: #e74c3c; }
.session-status .text.checking { color: #f39c12; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Session 详情弹窗 */
.session-detail-popup {
    display: none;
    position: fixed;
    top: 80px;
    left: 260px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    min-width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.session-detail-popup.show { display: block; }
.session-detail-popup h4 {
    margin-bottom: 12px;
    color: #ec4899;
}
.session-detail-popup .info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #252525;
    font-size: 13px;
}
.session-detail-popup .info-row:last-child { border-bottom: none; }
.session-detail-popup .label { color: #888; }
.session-detail-popup .value { color: #fff; }

/* 侧边栏导航 */
.sidebar-nav {
    padding: 16px 0;
}
.nav-section {
    padding: 8px 16px;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-item:hover {
    background: #252525;
    color: #fff;
}
.nav-item.active {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border-left-color: #ec4899;
}
.nav-item .icon { font-size: 18px; }
.nav-item .badge {
    margin-left: auto;
    background: #ec4899;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 24px;
}
.page-header .actions {
    display: flex;
    gap: 12px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
}
.stat-card .label {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}
.stat-card .value {
    font-size: 28px;
    font-weight: 700;
}
.stat-card .change {
    font-size: 12px;
    margin-top: 4px;
}
.stat-card .change.up { color: #27ae60; }
.stat-card .change.down { color: #e74c3c; }

/* 搜索和筛选 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
    padding: 10px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}
.filter-bar input { flex: 1; min-width: 200px; }

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
}
.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}
.tag-pink { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.tag-green { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.tag-yellow { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.tag-orange { background: rgba(230, 126, 34, 0.2); color: #e67e22; }
.tag-gray { background: rgba(136, 136, 136, 0.2); color: #888; }
.tag-red { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

.card-info {
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}
.card-info div {
    margin-bottom: 6px;
}
.card-stats {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    margin-bottom: 12px;
    font-size: 13px;
    color: #888;
}
.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.card-actions button {
    flex: 1;
    min-width: 70px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.2s;
}
.card-actions button:hover { opacity: 0.8; }
.btn-primary { background: #ec4899; color: #fff; }
.btn-edit { background: #333; color: #fff; }
.btn-sync { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid #333;
    color: #888;
}

/* 状态指示器 */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-active { background: #27ae60; }
.status-pending { background: #f1c40f; }
.status-disabled { background: #e74c3c; }

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }

/* 表格 */
.table-container {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #333;
}
th {
    background: #252525;
    font-weight: 600;
    font-size: 13px;
    color: #888;
}
td { font-size: 14px; }
tr:hover { background: #252525; }

/* 标签选择器 */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.tag-option {
    padding: 8px 16px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.tag-option:hover { border-color: #ec4899; }
.tag-option.selected {
    background: rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
    color: #ec4899;
}

/* 用户信息头 */
.user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid #333;
    margin-top: auto;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #db2777);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.user-info { flex: 1; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { color: #888; font-size: 12px; }
.logout-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
}
.logout-btn:hover { color: #e74c3c; }

/* 页面内容区 */
.page { display: none; }
.page.active { display: block; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; }

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* 开关 */
.switch {
    position: relative;
    width: 48px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #333;
    border-radius: 24px;
    transition: 0.3s;
}
.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .slider { background: #ec4899; }
.switch input:checked + .slider:before { transform: translateX(24px); }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #333;
}
.data-table th {
    background: #252525;
    color: #888;
    font-weight: 500;
    font-size: 13px;
}
.data-table td {
    font-size: 14px;
}
.data-table tbody tr:hover {
    background: #252525;
}

/* 待审核卡片样式 */
.pending-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    position: relative;
}
.pending-card .checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
}
.pending-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}
.pending-card .name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.pending-card .username {
    color: #ec4899;
    font-size: 13px;
    margin-bottom: 8px;
}
.pending-card .bio {
    color: #888;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
    max-height: 60px;
    overflow: hidden;
}
.pending-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.pending-card .tag {
    background: #252525;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #888;
}
.pending-card .tag.keyword {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}
.pending-card .actions {
    display: flex;
    gap: 8px;
}
.pending-card .actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.pending-card .actions button:hover {
    opacity: 0.8;
}
.pending-card .btn-approve {
    background: #27ae60;
    color: #fff;
}
.pending-card .btn-reject {
    background: #333;
    color: #fff;
}
.pending-card .btn-block {
    background: #e74c3c;
    color: #fff;
}

/* 线索卡片样式 */
.field-label {
    color: #888;
    margin-right: 4px;
    font-size: 13px;
}

.lead-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    position: relative;
}
.lead-card .lead-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.lead-card .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}
.lead-card .lead-info {
    flex: 1;
}
.lead-card .name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}
.lead-card .username {
    color: #ec4899;
    font-size: 13px;
    margin-bottom: 4px;
}
.lead-card .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: #252525;
}
.lead-card .status-pending { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.lead-card .status-invited { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.lead-card .status-confirmed { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.lead-card .status-deployed { background: rgba(39, 174, 96, 0.3); color: #2ecc71; }
.lead-card .status-rejected { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.lead-card .status-invite_failed { background: rgba(230, 126, 34, 0.2); color: #e67e22; }
.lead-card .bio {
    color: #888;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
    max-height: 60px;
    overflow: hidden;
    word-break: break-all;
}
.lead-card .links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.lead-card .preview-link {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}
.lead-card .preview-link:hover {
    background: rgba(236, 72, 153, 0.3);
}
.lead-card .bot-tag {
    background: #252525;
    color: #888;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}
.lead-card .no-link {
    color: #555;
    font-size: 12px;
}
.lead-card .meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #666;
}
.lead-card .actions {
    display: flex;
    gap: 8px;
}
.lead-card .actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.lead-card .actions button:hover {
    opacity: 0.8;
}
.lead-card .btn-approve {
    background: #27ae60;
    color: #fff;
}
.lead-card .btn-reject {
    background: #e74c3c;
    color: #fff;
}
.lead-card .btn-secondary {
    background: #3498db;
    color: #fff;
}

/* 异常账号卡片样式 */
.exception-card {
    border-left: 3px solid #e67e22;
}
.exception-card .exception-type {
    margin-bottom: 8px;
}
.exception-card .type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
}
.exception-card .type-badge.type-duplicate_channel {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}
.exception-card .type-badge.type-suspicious_bio {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}
.exception-card .exception-reason {
    color: #e67e22;
    font-size: 12px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(230, 126, 34, 0.1);
    border-radius: 4px;
}
.exception-card .status-resolved { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.exception-card .status-promoted { background: rgba(39, 174, 96, 0.3); color: #2ecc71; }
.exception-card .status-ignored { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.lead-card .btn-reject {
    background: #333;
    color: #fff;
}

/* Toast 动画 */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 养号卡片样式 */
.card-warming {
    border: 1px solid rgba(39, 174, 96, 0.3);
    background: linear-gradient(135deg, #1a2a1a 0%, #1a1a1a 100%);
}
.card-warming:hover {
    border-color: rgba(39, 174, 96, 0.5);
}

/* 养号按钮样式 */
.btn-warmup {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-warmup:hover {
    opacity: 0.9;
}

/* 养号状态栏 */
#warmingSessionsBar {
    animation: warmupGlow 2s ease-in-out infinite;
}
@keyframes warmupGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(39, 174, 96, 0.2); }
    50% { box-shadow: 0 0 20px rgba(39, 174, 96, 0.4); }
}

/* 养号日志表格 */
#warmupLogsContent table {
    border-collapse: collapse;
}
#warmupLogsContent tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 添加账号进度步骤样式 */
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.progress-step .step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}
.progress-step .step-label {
    font-size: 11px;
    color: #666;
    transition: color 0.3s ease;
}
.progress-step.active .step-circle {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    border-color: #ec4899;
    color: #fff;
}
.progress-step.active .step-label {
    color: #ec4899;
}
.progress-step.completed .step-circle {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}
.progress-step.completed .step-label {
    color: #27ae60;
}
.progress-line {
    flex: 1;
    height: 2px;
    background: #333;
    margin: 16px 8px 0;
    transition: background 0.3s ease;
}
.progress-line.active {
    background: linear-gradient(90deg, #27ae60 0%, #ec4899 100%);
}
.progress-line.completed {
    background: #27ae60;
}

/* 添加账号日志样式 */
#addAccountLogContent .log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #252525;
}
#addAccountLogContent .log-entry:last-child {
    border-bottom: none;
}
#addAccountLogContent .log-time {
    color: #666;
    margin-right: 8px;
}
#addAccountLogContent .log-success {
    color: #27ae60;
}
#addAccountLogContent .log-error {
    color: #e74c3c;
}
#addAccountLogContent .log-info {
    color: #3498db;
}


/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    flex-wrap: wrap;
}
.pagination button {
    padding: 8px 16px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.pagination button:hover {
    background: #333;
    border-color: #4a9eff;
}
.pagination button.active {
    background: #4a9eff;
    border-color: #4a9eff;
}
.pagination-info {
    color: #888;
    font-size: 14px;
    margin-right: 10px;
}
