/* 管理后台样式 */

body {
    background: #f7f9fc;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f9fc;
}

.login-box {
    background: white;
    padding: 48px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 420px;
}

/* 微软风格登录 */
.ms-login {
    padding: 44px 48px;
    overflow: hidden;
    position: relative;
    animation: boxFadeIn 0.5s ease-out;
}

@keyframes boxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ms-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    animation: fadeSlideUp 0.4s ease-out 0.2s both;
}

.ms-header .ms-title {
    margin: 0;
    animation: none;
}

.ms-logo-svg {
    flex-shrink: 0;
}

.ms-logo-svg rect {
    opacity: 0;
    animation: logoBlockIn 0.4s ease-out forwards;
}

.ms-logo-svg rect:nth-child(1) { animation-delay: 0.1s; }
.ms-logo-svg rect:nth-child(2) { animation-delay: 0.2s; }
.ms-logo-svg rect:nth-child(3) { animation-delay: 0.3s; }
.ms-logo-svg rect:nth-child(4) { animation-delay: 0.4s; }

@keyframes logoBlockIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ms-step {
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-step.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.ms-step.slide-out-left {
    display: flex;
    opacity: 0;
    transform: translateX(-30px);
}

.ms-step.slide-in-right {
    display: flex;
    opacity: 0;
    transform: translateX(30px);
}

.ms-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    animation: fadeSlideUp 0.4s ease-out 0.3s both;
}

.ms-subtitle {
    font-size: 14px;
    color: #5f6368;
    margin: 0 0 28px 0;
    animation: fadeSlideUp 0.4s ease-out 0.4s both;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-input-group {
    position: relative;
    margin-bottom: 24px;
    animation: fadeSlideUp 0.4s ease-out 0.5s both;
}

.ms-input {
    width: 100%;
    padding: 12px 12px 12px 12px;
    font-size: 15px;
    border: 1px solid #8a8a8a;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.ms-input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
}

.ms-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #5f6368;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    padding: 0 4px;
}

.ms-input:focus + .ms-label,
.ms-input:not(:placeholder-shown) + .ms-label {
    top: 0;
    font-size: 12px;
    color: #0078d4;
}

.ms-input:not(:focus):not(:placeholder-shown) + .ms-label {
    color: #5f6368;
}

.ms-btn-primary {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: #0078d4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 8px;
    animation: fadeSlideUp 0.4s ease-out 0.6s both;
}

.ms-btn-primary:hover {
    background: #106ebe;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.ms-btn-primary:active {
    background: #005a9e;
    transform: translateY(0);
    box-shadow: none;
}

.ms-links {
    margin-top: 28px;
    text-align: left;
    animation: fadeSlideUp 0.4s ease-out 0.7s both;
}

.ms-links a {
    color: #0078d4;
    font-size: 13px;
    text-decoration: none;
}

.ms-links a:hover {
    text-decoration: underline;
}

.ms-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 8px;
    margin: -8px;
    cursor: pointer;
    color: #1a1a1a;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.ms-back-btn:hover {
    background: #f3f3f3;
}

.ms-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px 0;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
}

.ms-avatar {
    width: 32px;
    height: 32px;
    background: #0078d4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ms-username {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.ms-message {
    min-height: 20px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #d93025;
}

.ms-message:empty {
    display: none;
}

/* 管理后台主界面 */
.admin-container {
    display: none;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 12px 20px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.header-left h1 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    opacity: 0;
    animation: fadeSlideIn 0.5s ease-out 0.5s forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.header-logo rect {
    animation: logoBlockIn 0.4s ease-out forwards;
}

.header-logo rect:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.header-logo rect:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.header-logo rect:nth-child(3) { animation-delay: 0.3s; opacity: 0; }
.header-logo rect:nth-child(4) { animation-delay: 0.4s; opacity: 0; }

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.admin-name {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.btn-header {
    padding: 5px 10px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.3;
    white-space: nowrap;
}

.btn-header:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* 统计弹窗 */
.stats-modal-body {
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-modal-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.stats-modal-item {
    flex: 1;
    min-width: 80px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stats-modal-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.stats-modal-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.stats-modal-row:last-child {
    padding-top: 4px;
    justify-content: center;
}

@media (max-width: 480px) {
    .stats-modal-item {
        min-width: 60px;
        padding: 10px 8px;
    }
    .stats-modal-value {
        font-size: 18px;
    }
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    color: #374151;
}

.tab.active {
    color: #0078d4;
    border-bottom-color: #0078d4;
}

.tab-content {
    display: none;
    background: white;
    padding: 28px;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
}

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

.tab-content h2 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 日志中心：子标签与「刷新日志」同一行 */
.logs-center-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.logs-center-toolbar .logs-center-tabs {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.logs-center-toolbar .logs-refresh-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 转发子标签 */
.forward-subtab {
    display: none;
}

/* 表格容器 - 支持横向滚动 */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* 性能优化 */
    contain: layout style paint;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px; /* 确保表格有足够宽度避免右侧空白 */
    table-layout: auto; /* 自动调整列宽 */
    /* 性能优化 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

table th {
    background: #f9fafb;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap; /* 防止表头换行 */
}

table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #1f2937;
    line-height: 1.3;
}

/* 操作列基础样式 - 仅应用于有操作列的表格 */
#cardsTable table th:last-child,
#cardsTable table td:last-child,
#usersTable table th:last-child,
#usersTable table td:last-child,
#serversTable table th:last-child,
#serversTable table td:last-child {
    text-align: center;
    padding: 6px 4px;
}

/* 卡密管理表格固定布局 */
#cardsTable table {
    table-layout: fixed;
    width: 100%;
    /* 精确设置最小宽度以避免右侧空白：所有列宽度总和 */
    min-width: 840px;
}

/* 卡密管理表格更紧凑的间距 */
#cardsTable table th,
#cardsTable table td {
    padding: 5px 6px;
}

/* 单按钮操作列（卡密管理）- 紧凑模式 */
#cardsTable table th:last-child,
#cardsTable table td:last-child {
    width: 70px;
    max-width: 70px;
    min-width: 70px;
}

/* 卡密管理表格列宽度优化 */
/* 第1列：卡密 */
#cardsTable table th:nth-child(1),
#cardsTable table td:nth-child(1) {
    width: 160px;
    max-width: 160px;
    min-width: 160px;
}

/* 第2列：卡类型 */
#cardsTable table th:nth-child(2),
#cardsTable table td:nth-child(2) {
    width: 60px;
    max-width: 60px;
    min-width: 60px;
}

/* 第3列：有效期 */
#cardsTable table th:nth-child(3),
#cardsTable table td:nth-child(3) {
    width: 70px;
    max-width: 70px;
    min-width: 70px;
}

/* 第4列：主题 */
#cardsTable table th:nth-child(4),
#cardsTable table td:nth-child(4) {
    width: 100px;
    max-width: 100px;
    min-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 第5列：权限 */
#cardsTable table th:nth-child(5),
#cardsTable table td:nth-child(5) {
    width: 60px;
    max-width: 60px;
    min-width: 60px;
}

/* 第6列：状态 */
#cardsTable table th:nth-child(6),
#cardsTable table td:nth-child(6) {
    width: 70px;
    max-width: 70px;
    min-width: 70px;
}

/* 第7列：使用者 */
#cardsTable table th:nth-child(7),
#cardsTable table td:nth-child(7) {
    width: 90px;
    max-width: 90px;
    min-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 第8列：创建时间 */
#cardsTable table th:nth-child(8),
#cardsTable table td:nth-child(8) {
    width: 140px;
    max-width: 140px;
    min-width: 140px;
    font-size: 11px;
}

/* 卡密管理表格操作按钮优化 */
#cardsTable td .btn-danger {
    padding: 3px 10px;
    font-size: 11px;
    min-width: 45px;
    font-weight: 500;
    background: #fca5a5;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

#cardsTable td .btn-danger:hover {
    background: #f87171;
    border-color: #fca5a5;
}

/* 用户管理表格操作按钮优化 */
#usersTable .action-buttons .btn {
    padding: 3px 10px;
    font-size: 11px;
    min-width: 45px;
    font-weight: 500;
}

#usersTable .action-buttons .btn-success {
    background: #86efac;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

#usersTable .action-buttons .btn-success:hover {
    background: #6ee7b7;
    border-color: #86efac;
}

#usersTable .action-buttons .btn-danger {
    background: #fca5a5;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

#usersTable .action-buttons .btn-danger:hover {
    background: #f87171;
    border-color: #fca5a5;
}

/* 操作列内的按钮优化 - 仅应用于有操作列的表格 */
#cardsTable table td:last-child .btn-sm,
#usersTable table td:last-child .btn-sm,
#serversTable table td:last-child .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 50px;
    white-space: nowrap;
}

table tr:hover {
    background: #f9fafb;
}

table code {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    color: #374151;
    word-break: break-all;
}

/* 卡密单元格样式 - 可点击 */
.card-code-cell {
    cursor: pointer;
    color: #0078d4;
    font-weight: 500;
    transition: all 0.2s;
    user-select: none;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    max-width: 160px;
    width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-code-cell:hover {
    color: #0078d4;
    background: #f3f4f6;
}

.card-code-cell:active {
    transform: scale(0.98);
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

/* 按钮组容器 - 用于表单底部按钮 */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 固定宽度按钮 - 确保同组按钮宽度一致 */
.btn-fixed {
    min-width: 110px;
    justify-content: center;
}

/* 移动端按钮组优化 */
@media (max-width: 768px) {
    .btn-group {
        gap: 10px;
    }
    
    .btn-fixed {
        min-width: 90px;
        font-size: 14px;
        padding: 10px 16px;
    }
}

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

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 600;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

.close:hover {
    color: #374151;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
    }

    .header-left {
        gap: 8px;
    }

    .header-logo {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .header-left h1 {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-right {
        gap: 6px;
    }

    .admin-name {
        display: none;
    }

    .btn-header {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .main-content {
        padding: 20px 12px;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }
    
    .tab-content {
        padding: 12px;
        overflow-x: visible; /* 允许表格横向滚动 */
    }
    
    .tab-content h2 {
        font-size: 16px;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-header {
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 模态框内所有按钮统一尺寸 */
    .modal-content .btn,
    .modal-content button,
    .detail-modal-actions .btn,
    .detail-modal-actions button,
    .bark-modal-content .modal-actions .btn,
    .bark-modal-content .modal-actions button,
    .detail-actions .btn,
    .detail-actions button {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 80px;
    }
    
    /* 表格移动端：与 tab-content 内边距对齐，勿用负边距拉宽（会破坏空状态/提示块对齐） */
    .table-container {
        margin-top: 16px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }

    /* 搜索框移动端紧凑尺寸 */
    .tab-content input[type="text"],
    .tab-content input[type="search"] {
        font-size: 13px;
        padding: 7px 10px;
    }

    /* 勾选框 label 移动端紧凑 */
    .tab-content label:has(input[type="checkbox"]) {
        font-size: 12px;
    }

    /* 搜索栏外层 div（卡密/用户管理搜索区）移动端 */
    .tab-content > div:first-child[style*="flex"] {
        gap: 10px;
    }

    .tab-content > div:first-child[style*="flex"] h2 {
        font-size: 15px;
    }

    .tab-content > div:first-child[style*="flex"] > div {
        min-width: 0;
    }

    /* 按钮组移动端紧凑 */
    .tab-content > div[style*="display: flex"][style*="gap: 10px"] {
        gap: 8px;
    }

    table {
        font-size: 12px;
        min-width: 850px; /* 移动端设置合理的最小宽度，避免右侧空白，通过横向滚动查看完整内容 */
    }
    
    table th,
    table td {
        padding: 8px 10px;
    }
    
    table code {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    /* 移动端显示完整表格内容，通过横向滚动查看 */
    /* 确保操作列有足够宽度 */
    table th:nth-child(9),
    table td:nth-child(9) {
        min-width: 120px;
    }
}

/* ========== 加载动画和效果 ========== */

/* 全局加载遮罩层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 旋转加载动画 */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.loading-spinner.large {
    width: 64px;
    height: 64px;
    border-width: 5px;
}

/* 加载文字 */
.loading-text {
    margin-left: 16px;
    font-size: 16px;
    color: #374151;
    font-weight: 500;
}

/* 页面切换动画 */
.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid currentColor;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    color: white;
}

/* 表格行悬停动画 */
table tr {
    transition: all 0.2s ease;
}

table tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* hover状态下保持操作列的渐变效果 */
table tr:hover td.action-column {
    background: linear-gradient(to right, rgba(249, 250, 251, 0) 0%, rgba(249, 250, 251, 0.9) 20%, rgba(249, 250, 251, 1) 40%, rgba(249, 250, 251, 1) 100%);
    box-shadow: -4px 0 8px -2px rgba(0, 0, 0, 0.12); /* hover时阴影加深 */
}

/* 卡片悬停效果 */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* 模态框弹出动画 - 微软Fluent风格 */
.modal {
    animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 转发规则模态框 - 简洁扁平风格 */
.rule-modal-content {
    max-width: 520px;
    padding: 24px;
}

.rule-modal-content .form-group {
    margin-bottom: 14px;
}

.rule-modal-content .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.rule-modal-content .form-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

.rule-modal-content .label-hint {
    color: #9ca3af;
    font-weight: normal;
    font-size: 12px;
}

.rule-modal-content .form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.rule-modal-content .form-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.rule-modal-content .form-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    margin-left: 24px;
}

.rule-modal-content .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.rule-modal-content .modal-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

@media (max-width: 480px) {
    .rule-modal-content {
        padding: 16px;
    }

    .rule-modal-content .form-row-2 {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* 内容骨架屏 */
.loading-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.loading-skeleton.text {
    height: 16px;
    width: 100%;
    margin: 8px 0;
}

.loading-skeleton.button {
    height: 40px;
    width: 100px;
    border-radius: 8px;
}

.loading-skeleton.card {
    height: 100px;
    width: 100%;
    border-radius: 12px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 徽章动画 */
.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* 操作按钮动画 */
.action-buttons button {
    transition: all 0.2s ease;
}

.action-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 消息提示动画 */
.message {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .loading-text {
        font-size: 14px;
        margin-left: 12px;
    }

    .loading-spinner {
        width: 36px;
        height: 36px;
    }

    .hide-mobile {
        display: none !important;
    }
    
    /* 卡密单元格移动端优化 */
    .card-code-cell {
        font-size: 13px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 操作按钮移动端优化 */
    .action-buttons {
        flex-direction: row; /* 保持横向排列 */
        flex-wrap: nowrap; /* 不换行 */
        gap: 6px;
    }
    
    .action-buttons .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 50px;
        white-space: nowrap;
    }
}

/* 超小屏幕优化 (小于480px) */
@media (max-width: 480px) {
    .tab-content {
        padding: 10px;
    }
    
    .tab-content h2 {
        font-size: 15px;
    }

    /* 搜索框超小屏更紧凑 */
    .tab-content input[type="text"],
    .tab-content input[type="search"] {
        font-size: 12px;
        padding: 6px 8px;
    }

    /* 勾选框 label 超小屏 */
    .tab-content label:has(input[type="checkbox"]) {
        font-size: 11px;
    }

    /* 模态框超小屏幕优化 */
    .modal-content {
        padding: 12px 16px;
    }
    
    .modal-header h3 {
        font-size: 15px;
    }
    
    .modal-header {
        margin-bottom: 12px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 11px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* 模态框内所有按钮超小屏幕统一尺寸 */
    .modal-content .btn,
    .modal-content button,
    .detail-modal-actions .btn,
    .detail-modal-actions button,
    .bark-modal-content .modal-actions .btn,
    .bark-modal-content .modal-actions button,
    .detail-actions .btn,
    .detail-actions button {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    /* 卡密单元格超小屏幕优化 */
    .card-code-cell {
        max-width: 120px;
        font-size: 11px;
    }
    
    /* 超小屏幕也显示完整内容，通过横向滚动查看 */
    /* 调整操作列宽度以适配竖向按钮 */
    table th:nth-child(9),
    table td:nth-child(9) {
        min-width: 80px;
    }
    
    /* 优化操作按钮在超小屏幕的显示 */
    .action-buttons {
        flex-direction: column; /* 改为竖向排列 */
        gap: 4px;
    }
    
    .action-buttons .btn-sm {
        padding: 5px 8px;
        font-size: 11px;
        min-width: 45px;
        width: 100%; /* 按钮填充整个宽度 */
    }
}

/* 分页组件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0;
    flex-wrap: wrap; /* 允许换行 */
}

.pagination button {
    min-width: 36px;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* 防止按钮收缩 */
    white-space: nowrap; /* 防止文字换行 */
}

.pagination button:hover:not(.disabled):not(.active) {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.pagination button.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.pagination button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 500;
    width: 100%; /* 独占一行 */
    text-align: center; /* 居中显示 */
    margin-top: 8px; /* 与按钮行保持间距 */
    order: 999; /* 确保在最后显示 */
}

.pagination-dots {
    color: #9ca3af;
    padding: 0 4px;
    user-select: none;
    flex-shrink: 0; /* 防止省略号收缩 */
}

/* 分页按钮大小调整 */
.pagination .btn-sm {
    min-width: 32px;
    height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

/* 响应式分页 */
@media (max-width: 768px) {
    .pagination {
        gap: 6px;
        margin-top: 20px;
        padding: 12px 0;
        justify-content: center; /* 居中对齐 */
    }

    .pagination button {
        min-width: 32px;
        height: 32px;
        padding: 6px 8px;
        font-size: 13px;
    }

    .pagination-info {
        font-size: 12px;
        /* 保持独占一行的样式 */
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 4px;
        margin-top: 16px;
        justify-content: center; /* 居中对齐 */
    }

    .pagination button {
        min-width: 28px;
        height: 28px;
        padding: 4px 6px;
        font-size: 12px;
    }

    .pagination-info {
        font-size: 12px;
        /* 保持独占一行的样式 */
    }
}

/* 可折叠面板样式 */
.collapse-panel {
    margin-bottom: 24px;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.collapse-header {
    background: #f8fafc;
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
}

.collapse-header:hover {
    background: #f1f5f9;
}

.collapse-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.collapse-toggle {
    font-size: 20px;
    color: #64748b;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.collapse-content {
    padding: 24px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.collapse-content.expanded {
    display: block;
}

.collapse-toggle.expanded {
    transform: rotate(180deg);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 面板描述 */
.collapse-description {
    font-size: 14px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

/* ==================== 移动端表格滑动手势 ==================== */

/* 启用滑动的表格容器 */
.table-container.swipe-enabled {
    touch-action: pan-y; /* 允许垂直滚动，横向由JS控制 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    position: relative;
    will-change: scroll-position; /* GPU加速提示 */
    transform: translateZ(0); /* 强制GPU加速 */
    backface-visibility: hidden; /* 防止闪烁 */
}

/* 操作列样式 */
.action-column {
    position: sticky;
    right: 0;
    /* 组合背景：渐变 + 左侧阴影 */
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 20%, rgba(255, 255, 255, 1) 40%, rgba(255, 255, 255, 1) 100%);
    /* 左侧阴影，让它看起来像浮动层 */
    box-shadow: -4px 0 8px -2px rgba(0, 0, 0, 0.08);
    z-index: 10;
    transition: transform 0.03s linear, opacity 0.03s linear;
    transform-origin: right center;
    padding-left: 20px !important; /* 增加左侧内边距，为阴影和渐变留出空间 */
    padding-right: 8px !important;
    will-change: transform, opacity; /* GPU加速 */
    backface-visibility: hidden; /* 防止闪烁 */
    -webkit-font-smoothing: antialiased; /* 字体抗锯齿 */
}

/* 表头的操作列 */
table th.action-column {
    /* 从左到右渐变：左边透明，右边不透明（灰色背景） */
    background: linear-gradient(to right, rgba(249, 250, 251, 0) 0%, rgba(249, 250, 251, 0.8) 20%, rgba(249, 250, 251, 1) 40%, rgba(249, 250, 251, 1) 100%);
    box-shadow: -4px 0 8px -2px rgba(0, 0, 0, 0.08);
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 确保表格容器可以横向滚动 */
    .table-container.swipe-enabled {
        overflow-x: auto;
        overflow-y: visible;
    }
    
    /* 操作列在移动端固定在右侧 - 减小宽度 */
    .action-column {
        min-width: 60px;
        max-width: 60px;
        white-space: nowrap;
        padding-left: 12px !important; /* 移动端渐变区域较小 */
        padding-right: 4px !important;
        /* 移动端渐变调整 */
        background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 25%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 1) 100%);
        box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.08);
    }
    
    table th.action-column {
        background: linear-gradient(to right, rgba(249, 250, 251, 0) 0%, rgba(249, 250, 251, 0.85) 25%, rgba(249, 250, 251, 1) 50%, rgba(249, 250, 251, 1) 100%);
        box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.08);
    }
    
    table tr:hover td.action-column {
        background: linear-gradient(to right, rgba(249, 250, 251, 0) 0%, rgba(249, 250, 251, 0.9) 25%, rgba(249, 250, 251, 1) 50%, rgba(249, 250, 251, 1) 100%);
        box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.12);
    }
    
    /* 操作列按钮样式优化 - 更紧凑 */
    .action-column .btn {
        display: inline-block;
        width: auto;
        margin: 0;
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* 操作按钮容器优化 */
    .action-column .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 480px) {
    .action-column {
        min-width: 50px;
        max-width: 50px;
        padding-left: 10px !important; /* 超小屏幕渐变区域更小 */
        padding-right: 2px !important;
        /* 超小屏幕渐变调整 */
        background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 1) 55%, rgba(255, 255, 255, 1) 100%);
        box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.08);
    }
    
    table th.action-column {
        background: linear-gradient(to right, rgba(249, 250, 251, 0) 0%, rgba(249, 250, 251, 0.9) 30%, rgba(249, 250, 251, 1) 55%, rgba(249, 250, 251, 1) 100%);
        box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.08);
    }
    
    table tr:hover td.action-column {
        background: linear-gradient(to right, rgba(249, 250, 251, 0) 0%, rgba(249, 250, 251, 0.95) 30%, rgba(249, 250, 251, 1) 55%, rgba(249, 250, 251, 1) 100%);
        box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.12);
    }
    
    .action-column .btn {
        padding: 3px 6px;
        font-size: 10px;
        line-height: 1.2;
    }
}

/* 移动端按钮文本优化 - 使用更短的文本 */
@media (max-width: 768px) {
    .action-column .btn-danger {
        background: #ef4444;
    }
    
    .action-column .btn-success {
        background: #10b981;
    }
    
    .action-column .btn-info {
        background: #64748b;
    }
    
    .action-column .btn-detail {
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
    }
    
    /* 移动端表格样式优化 - 更紧凑间距 */
    table th {
        padding: 4px 4px;
        font-size: 11px;
    }
    
    table td {
        padding: 4px 4px;
        font-size: 11px;
    }
    
    /* 移动端卡密管理表格更紧凑 */
    #cardsTable table {
        min-width: 690px; /* 移动端卡密表格精确宽度，显示所有字段，避免右侧空白 */
    }
    
    #cardsTable table th,
    #cardsTable table td {
        padding: 4px 5px;
    }
    
    /* 移动端操作列更紧凑 - 仅应用于有操作列的表格 */
    #cardsTable table th:last-child,
    #cardsTable table td:last-child,
    #usersTable table th:last-child,
    #usersTable table td:last-child,
    #serversTable table th:last-child,
    #serversTable table td:last-child {
        padding: 6px 3px;
    }
    
    /* 卡密管理表格操作列宽度 */
    #cardsTable table th:last-child,
    #cardsTable table td:last-child {
        width: 55px;
        max-width: 55px;
        min-width: 55px;
    }
    
    /* 移动端badge更小 */
    .badge {
        padding: 1px 4px;
        font-size: 10px;
    }
    
    /* 移动端按钮更小 */
    .btn-sm {
        padding: 3px 8px;
        font-size: 11px;
        min-width: 45px;
    }
    
    /* 卡密单元格移动端优化 */
    .card-code-cell {
        font-size: 11px;
        max-width: 120px;
        width: 120px;
    }
    
    /* 移动端卡密管理表格列宽度 */
    #cardsTable table th:nth-child(1),
    #cardsTable table td:nth-child(1) {
        width: 120px;
        max-width: 120px;
        min-width: 120px;
    }
    
    #cardsTable table th:nth-child(2),
    #cardsTable table td:nth-child(2) {
        width: 55px;
        max-width: 55px;
        min-width: 55px;
    }
    
    #cardsTable table th:nth-child(3),
    #cardsTable table td:nth-child(3) {
        width: 60px;
        max-width: 60px;
        min-width: 60px;
    }
    
    #cardsTable table th:nth-child(4),
    #cardsTable table td:nth-child(4) {
        width: 80px;
        max-width: 80px;
        min-width: 80px;
    }
    
    #cardsTable table th:nth-child(5),
    #cardsTable table td:nth-child(5) {
        width: 55px;
    }
}

/* ==================== 底部导航栏 ==================== */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav {
    display: none;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 3px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    min-height: 48px;
}

.nav-item:active {
    transform: scale(0.95);
    background: #f3f4f6;
}

.nav-item.active {
    color: #0078d4;
    background: #f0f9ff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* 移动端显示底部导航栏 */
@media (max-width: 768px) {
    .bottom-nav {
        display: grid;
    }
    
    /* 为底部导航栏留出空间 */
    .admin-container {
        padding-bottom: 80px;
    }
    
    .main-content {
        padding-bottom: 20px;
    }
    
    /* 隐藏桌面端主标签页 */
    .main-content > .tabs {
        display: none;
    }
    
    /* 转发页：标签条与下方内容区同宽；勿对 #forwardTab 设 overflow:hidden，以免破坏 sticky */
    #forwardTab {
        min-width: 0;
    }
    
    #forwardTab .tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        align-items: center;
        gap: 6px;
        padding: 0 0 12px;
        margin: 0 0 16px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
        border-radius: 8px 8px 0 0;
        position: sticky;
        top: 0;
        z-index: 10;
        scrollbar-width: thin;
    }
    
    #forwardTab .tabs .tab {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
        background: #f3f4f6;
        border: none;
        border-bottom: 2px solid transparent;
    }
    
    #forwardTab .tabs .tab.active {
        background: #e0f2fe;
        color: #0078d4;
        border-bottom-color: transparent;
    }

    /* 日志中心：与转发页相同的二级标签条（移动端主顶栏已隐藏，此处需单独显示） */
    #logsTab {
        min-width: 0;
    }

    #logsTab .logs-center-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 0 12px;
        margin: 0 0 16px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
        border-radius: 8px 8px 0 0;
        position: sticky;
        top: 0;
        z-index: 10;
        flex-wrap: nowrap;
    }

    #logsTab .logs-center-toolbar .logs-center-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: none;
        background: transparent;
        scrollbar-width: thin;
    }

    #logsTab .logs-center-toolbar .tab {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
        background: #f3f4f6;
        border: none;
        border-bottom: 2px solid transparent;
    }

    #logsTab .logs-center-toolbar .tab.active {
        background: #e0f2fe;
        color: #0078d4;
        border-bottom-color: transparent;
    }

    #logsTab .logs-center-toolbar .logs-refresh-btn {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* 隐藏转发页面的标题，因为二级标签更重要 */
    #forwardTab > h2 {
        display: none;
    }
    
    /* 优化tab内容卡片 */
    .tab-content {
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .nav-item {
        padding: 4px 2px;
        gap: 1px;
        min-height: 44px;
    }
    
    .nav-label {
        font-size: 9px;
        max-width: 45px;
        min-width: 45px;
    }
}

/* ==================== 详情模态框样式 ==================== */

.detail-content {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    gap: 16px;
    transition: background-color 0.2s ease;
}

.detail-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 6px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 100px;
}

.detail-value {
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

.detail-value-mono {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.detail-actions .btn {
    flex: 1;
    min-width: 80px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.detail-actions .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 移动端详情模态框优化 */
@media (max-width: 768px) {
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 0;
    }
    
    .detail-label {
        font-size: 12px;
        min-width: auto;
    }
    
    .detail-value {
        font-size: 13px;
        text-align: left;
        width: 100%;
    }
    
    .detail-value-mono {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* 详情模态框按钮保持水平一排显示 */
    .detail-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .detail-actions .btn {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 13px;
    }
}

/* ==================== 转发页下拉框与过滤器 ==================== */

/* 转发页过滤行（按钮+下拉框右侧） */
.filter-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* 转发页工具栏 */
.fw-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.fw-toolbar-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fw-toolbar-top {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fw-toolbar-bottom {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* 转发页搜索框（与 .fw-toolbar .btn 同高，避免 input 默认高度过大） */
.fw-search {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 8px;
    min-width: 140px;
    max-width: 200px;
    height: 32px;
    box-sizing: border-box;
}

.fw-search:focus-within {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

.fw-search svg {
    color: #9ca3af;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.fw-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #374151;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    line-height: 1.2;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

.fw-search input::placeholder {
    color: #9ca3af;
}

/* 转发页通用下拉框 */
.fw-select {
    padding: 6px 32px 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    min-width: 120px;
    max-width: 180px;
    transition: border-color 0.2s;
}

/* 与工具栏按钮、搜索框同高 */
.fw-toolbar .fw-select {
    height: 32px;
    padding: 0 28px 0 10px;
    line-height: 30px;
    box-sizing: border-box;
}

.fw-select:hover {
    border-color: #9ca3af;
}

.fw-select:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

/* 帮助按钮 */
.btn-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #0078d4;
    background: transparent;
    color: #0078d4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.btn-help:hover {
    background: #e0f2fe;
}

/* 帮助说明弹窗 */
.help-popup {
    position: relative;
    margin-top: 12px;
    padding: 14px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: #0c4a6e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.help-popup strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #0369a1;
}

.help-popup p {
    margin: 0;
}

/* 文本替换工具栏单行模式 */
.fw-toolbar-single {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

/* 移动端：文本替换工具栏分为两行 */
@media (max-width: 768px) {
    .fw-toolbar-single {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .fw-toolbar-single .fw-toolbar-row {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .fw-toolbar-single .fw-toolbar-row:first-child {
        justify-content: flex-start;
    }

    .fw-toolbar-single .fw-toolbar-row:last-child {
        justify-content: flex-start;
    }
}

/* 移动端：帮助弹窗撑满宽度 */
@media (max-width: 768px) {
    .filter-row-right {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .fw-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .fw-toolbar-row {
        justify-content: flex-start;
        gap: 6px;
    }

    .fw-toolbar-top {
        justify-content: flex-start;
    }

    .fw-toolbar-bottom {
        justify-content: flex-start;
        gap: 6px;
    }

    .fw-search {
        min-width: 120px;
        max-width: 150px;
        height: 32px;
        padding: 0 8px;
    }

    .fw-search input {
        font-size: 12px;
    }

    .fw-select {
        flex: 1;
        max-width: none;
        font-size: 12px;
        padding: 7px 30px 7px 8px;
    }

    .fw-toolbar .fw-select {
        height: 32px;
        padding: 0 28px 0 8px;
        line-height: 30px;
    }

    .btn-help {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .help-popup {
        font-size: 12px;
        padding: 12px 14px;
    }

    .help-popup strong {
        font-size: 12px;
    }
}

/* 移动端：批量操作栏紧凑 */
@media (max-width: 768px) {
    #includeKeywordBatchBar {
        padding: 10px 12px;
        gap: 10px;
    }

    #includeKeywordBatchBar > div:first-child {
        font-size: 12px;
    }

    #includeKeywordBatchBar > div:last-child {
        font-size: 12px;
    }

    #ikwBatchTargetRulesList {
        max-height: 140px;
    }
}

@media (max-width: 480px) {
    .fw-toolbar {
        gap: 6px;
    }

    .fw-toolbar-single .fw-toolbar-row {
        gap: 6px;
    }

    .fw-toolbar-top,
    .fw-toolbar-bottom,
    .fw-toolbar-row {
        gap: 6px;
    }

    .fw-select {
        min-width: 70px;
        font-size: 11px;
        padding: 6px 26px 6px 6px;
    }

    .fw-search {
        min-width: 100px;
        max-width: 120px;
        height: 30px;
        padding: 0 6px;
    }

    .fw-search svg {
        width: 11px;
        height: 11px;
    }

    .fw-search input {
        font-size: 11px;
    }

    .fw-toolbar .fw-select {
        height: 30px;
        padding: 0 26px 0 6px;
        line-height: 28px;
        font-size: 11px;
    }

    .fw-toolbar .btn {
        height: 30px;
        padding: 0 8px;
        font-size: 11px;
    }
}

/* 转发页工具栏按钮（与 .fw-search 同高） */
.fw-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 13px;
    min-width: auto;
    height: 32px;
    box-sizing: border-box;
    line-height: 1.2;
}

/* 主要操作按钮组 - 更紧凑 */
.tab-content > div:not(.fw-toolbar)[style*="display: flex"] .btn,
.forward-subtab > div:not(.fw-toolbar)[style*="display: flex"] .btn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 80px;
}

/* 移动端进一步缩小 */
@media (max-width: 768px) {
    .tab-content > div:not(.fw-toolbar)[style*="display: flex"] .btn,
    .forward-subtab > div:not(.fw-toolbar)[style*="display: flex"] .btn {
        padding: 7px 12px;
        font-size: 12px;
        min-width: 70px;
    }

    .fw-toolbar .btn {
        padding: 0 10px;
        font-size: 12px;
        height: 32px;
    }
    
    #cardsTable table th:nth-child(6),
    #cardsTable table td:nth-child(6) {
        width: 65px;
        max-width: 65px;
        min-width: 65px;
    }
    
    #cardsTable table th:nth-child(7),
    #cardsTable table td:nth-child(7) {
        width: 70px;
        max-width: 70px;
        min-width: 70px;
    }
    
    #cardsTable table th:nth-child(8),
    #cardsTable table td:nth-child(8) {
        width: 110px;
        max-width: 110px;
        min-width: 110px;
        font-size: 11px;
    }
    
    /* 移动端用户管理按钮优化 */
    #usersTable .action-buttons .btn {
        padding: 2px 8px;
        font-size: 10px;
        min-width: 40px;
    }
    
    /* 移动端卡密管理按钮优化 */
    #cardsTable td .btn-danger {
        padding: 2px 8px;
        font-size: 10px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .tab-content > div[style*="display: flex"] .btn,
    .forward-subtab > div[style*="display: flex"] .btn {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .btn-sm {
        padding: 3px 6px;
        font-size: 10px;
        min-width: 40px;
    }
    
    table th {
        padding: 3px 5px;
        font-size: 10px;
    }
    
    table td {
        padding: 3px 5px;
        font-size: 11px;
    }
    
    /* 超小屏幕卡密管理表格更紧凑 */
    #cardsTable table {
        min-width: 608px; /* 超小屏幕卡密表格精确宽度，显示所有字段，避免右侧空白 */
    }
    
    #cardsTable table th,
    #cardsTable table td {
        padding: 3px 4px;
    }
    
    /* 超小屏幕操作列更窄 - 仅应用于有操作列的表格 */
    #cardsTable table th:last-child,
    #cardsTable table td:last-child,
    #usersTable table th:last-child,
    #usersTable table td:last-child,
    #serversTable table th:last-child,
    #serversTable table td:last-child {
        padding: 5px 2px;
    }
    
    /* 卡密管理表格操作列宽度 */
    #cardsTable table th:last-child,
    #cardsTable table td:last-child {
        width: 48px;
        max-width: 48px;
        min-width: 48px;
    }
    
    .badge {
        padding: 1px 3px;
        font-size: 9px;
    }
    
    .btn-sm {
        padding: 2px 6px;
        font-size: 10px;
        min-width: 40px;
    }
    
    .card-code-cell {
        font-size: 10px;
        max-width: 100px;
        width: 100px;
    }
    
    /* 超小屏幕卡密管理表格列宽度 */
    #cardsTable table th:nth-child(1),
    #cardsTable table td:nth-child(1) {
        width: 100px;
        max-width: 100px;
        min-width: 100px;
    }
    
    #cardsTable table th:nth-child(2),
    #cardsTable table td:nth-child(2) {
        width: 50px;
        max-width: 50px;
        min-width: 50px;
    }
    
    #cardsTable table th:nth-child(3),
    #cardsTable table td:nth-child(3) {
        width: 55px;
        max-width: 55px;
        min-width: 55px;
    }
    
    #cardsTable table th:nth-child(4),
    #cardsTable table td:nth-child(4) {
        width: 70px;
        max-width: 70px;
        min-width: 70px;
    }
    
    #cardsTable table th:nth-child(5),
    #cardsTable table td:nth-child(5) {
        width: 50px;
        max-width: 50px;
        min-width: 50px;
    }
    
    #cardsTable table th:nth-child(6),
    #cardsTable table td:nth-child(6) {
        width: 60px;
        max-width: 60px;
        min-width: 60px;
    }
    
    #cardsTable table th:nth-child(7),
    #cardsTable table td:nth-child(7) {
        width: 65px;
        max-width: 65px;
        min-width: 65px;
    }
    
    #cardsTable table th:nth-child(8),
    #cardsTable table td:nth-child(8) {
        width: 100px;
        max-width: 100px;
        min-width: 100px;
        font-size: 10px;
    }
    
    /* 超小屏幕卡密管理按钮 */
    #cardsTable td .btn-danger {
        padding: 2px 6px;
        font-size: 9px;
        min-width: 38px;
    }
}

/* ==================== 消息发送表单 - 精简版 ==================== */

.msg-card {
    max-width: 520px;
    margin: 0 auto;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 120, 212, 0.08);
}

.msg-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.msg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-field label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-field .optional {
    font-weight: 400;
    text-transform: none;
    color: #94a3b8;
    font-size: 11px;
}

.msg-field input,
.msg-field select,
.msg-field textarea {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.msg-field input:hover,
.msg-field select:hover,
.msg-field textarea:hover {
    border-color: #cbd5e1;
}

.msg-field input:focus,
.msg-field select:focus,
.msg-field textarea:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.msg-field textarea {
    min-height: 80px;
    max-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.msg-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* 主题下拉选择区 */
.topic-field {
    flex: 1;
    position: relative;
    overflow: visible;
    z-index: 10000;
}

.topic-combo {
    position: relative;
    display: flex;
    overflow: visible;
    z-index: 10000;
}

/* 发送消息页：避免下拉层被 tab/卡片裁剪 */
#messageTab.tab-content,
#messageTab .msg-card {
    overflow: visible;
}

.topic-combo input {
    flex: 1;
    padding-right: 40px;
    border-radius: 10px;
}

.topic-dropdown-btn {
    /* 不再 absolute，改为在 flex 布局中占位 */
    width: 36px;
    height: 38px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.topic-dropdown-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.topic-dropdown-btn.active {
    background: #0078d4;
    color: white;
}

.topic-dropdown-btn.active svg {
    transform: rotate(180deg);
}

/* 主题下拉：fixed + JS 定位；必须保留 .show 否则永远 display:none */
.topic-dropdown {
    position: fixed;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    display: none;
    min-width: 200px;
    min-height: 48px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.topic-dropdown.show {
    display: block !important;
    animation: dropdownShow 0.2s ease;
}

@keyframes dropdownShow {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.topic-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background 0.15s ease;
}

.topic-item:hover {
    background: #f1f5f9;
}

.topic-item:first-child {
    border-radius: 10px 10px 0 0;
}

.topic-item:last-child {
    border-radius: 0 0 10px 10px;
}

.topic-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 14px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
}

/* 优先级按钮组 */
.priority-field {
    width: auto;
}

.priority-btns {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.priority-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.priority-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.priority-btn.active {
    background: #0078d4;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

/* 推送选项区 */
.msg-options {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
}

/* 开关样式 */
.msg-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    position: relative;
}

.msg-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.msg-toggle input:checked + .toggle-slider {
    background: #0078d4;
}

.msg-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

.toggle-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.msg-toggle input:checked ~ .toggle-text {
    color: #0078d4;
}

/* 更多选项按钮 */
.more-opts-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
}

.more-opts-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.more-opts-btn.active {
    background: #eff6ff;
    border-color: #0078d4;
    color: #0078d4;
}

/* 更多选项面板 */
.msg-extra-options {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.extra-opt-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.extra-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
}

.extra-opt input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0078d4;
    cursor: pointer;
}

/* Bark目标行（横向单选按钮） */
.bark-target-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.bark-target-radio.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    user-select: none;
}

.bark-target-radio.inline input[type="radio"] {
    display: none;
}

.bark-target-radio.inline .radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bark-target-radio.inline input[type="radio"]:checked + .radio-custom {
    border-color: #0078d4;
}

.bark-target-radio.inline input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #0078d4;
    border-radius: 50%;
}

.bark-target-radio.inline:hover .radio-custom {
    border-color: #94a3af;
}

/* 搜索框（横向内联） */
.bark-user-search-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 10px;
    height: 28px;
    box-sizing: border-box;
    min-width: 140px;
}

.bark-user-search-inline:focus-within {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

.bark-user-search-inline svg {
    color: #9ca3af;
    flex-shrink: 0;
}

.bark-user-search-inline input {
    border: none;
    outline: none;
    font-size: 12px;
    flex: 1;
    min-width: 0;
    background: transparent;
}

/* 用户卡片横向滚动 */
.bark-users-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: thin;
}

.bark-users-scroll::-webkit-scrollbar {
    height: 4px;
}

.bark-users-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* 用户项（紧凑横向） */
.bark-user-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 60px;
}

.bark-user-item:hover {
    border-color: #94a3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.bark-user-item.selected {
    border-color: #0078d4;
    background: #eff6ff;
}

.bark-user-item .bark-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.bark-user-item.selected .bark-user-avatar {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
}

.bark-user-item .bark-user-name {
    font-size: 11px;
    color: #475569;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bark-user-item.selected .bark-user-name {
    color: #0078d4;
    font-weight: 500;
}

/* 已选提示 */
.bark-user-tip {
    font-size: 12px;
    color: #0078d4;
    padding: 4px 0;
}

.bark-no-user {
    font-size: 12px;
    color: #94a3b8;
    padding: 8px 0;
}

/* 发送按钮 */
.msg-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 120, 212, 0.3);
    position: relative;
    overflow: hidden;
}

.msg-send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.msg-send-btn:hover::before {
    left: 100%;
}

.msg-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.4);
}

.msg-send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 120, 212, 0.3);
}

.msg-send-btn svg {
    transition: transform 0.25s ease;
}

.msg-send-btn:hover svg {
    transform: translateX(2px) translateY(-2px);
}

/* ==================== 移动端消息表单 ==================== */

@media (max-width: 768px) {
    .msg-card {
        padding: 10px;
        border-radius: 10px;
        margin: 0 -4px;
    }
    
    .msg-form {
        gap: 8px;
    }
    
    .msg-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .msg-field label {
        font-size: 10px;
    }
    
    .msg-field input,
    .msg-field select,
    .msg-field textarea {
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .msg-field textarea {
        min-height: 50px;
    }
    
    .topic-input-wrap {
        flex-direction: column;
        gap: 6px;
    }
    
    .topic-input {
        width: 100%;
    }
    
    .priority-field {
        width: 100%;
    }
    
    .priority-btns {
        justify-content: space-between;
        padding: 3px 4px;
    }
    
    .priority-btn {
        flex: 1;
        height: 32px;
        font-size: 13px;
    }
    
    .msg-options {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0;
    }
    
    .toggle-slider {
        width: 36px;
        height: 20px;
    }
    
    .toggle-slider::after {
        width: 16px;
        height: 16px;
    }
    
    .msg-toggle input:checked + .toggle-slider::after {
        transform: translateX(16px);
    }
    
    .toggle-text {
        font-size: 13px;
    }
    
    .more-opts-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .msg-extra-options {
        padding: 10px;
    }
    
    .extra-opt-grid {
        gap: 10px;
    }
    
    .extra-opt {
        font-size: 13px;
    }
    
    /* Bark目标选择响应式 */
    .bark-target-row {
        gap: 12px;
    }
    
    .bark-users-scroll {
        gap: 6px;
    }
    
    .bark-user-item {
        padding: 6px 10px;
        min-width: 50px;
    }
    
    .bark-user-item .bark-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .bark-user-item .bark-user-name {
        font-size: 10px;
        max-width: 50px;
    }
    
    .msg-send-btn {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .msg-card {
        padding: 10px;
        border-radius: 10px;
    }
    
    .msg-form {
        gap: 8px;
    }
    
    .msg-field input,
    .msg-field select,
    .msg-field textarea {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .msg-field textarea {
        min-height: 50px;
    }
    
    .priority-btn {
        height: 30px;
        font-size: 12px;
    }
    
    .msg-send-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ==================== Bark配置卡片网格 ==================== */
.bark-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bark-config-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bark-config-card:hover {
    border-color: #0078d4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.1);
    transform: translateY(-2px);
}

.bark-card-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 10px;
}

.bark-card-content {
    flex: 1;
    min-width: 0;
}

.bark-card-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.bark-card-content p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bark-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.status-dot.active {
    background: #22c55e;
}

.status-dot.inactive {
    background: #f59e0b;
}

.status-text {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.bark-card-arrow {
    font-size: 20px;
    color: #cbd5e1;
    font-weight: 300;
    flex-shrink: 0;
}

.bark-config-card:hover .bark-card-arrow {
    color: #0078d4;
}

/* Bark模态框样式 */
.bark-modal-content {
    max-width: 560px;
}

.bark-modal-content .form-group {
    margin-bottom: 18px;
}

.bark-modal-content .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.bark-modal-content .form-group input[type="text"],
.bark-modal-content .form-group input[type="url"],
.bark-modal-content .form-group input[type="number"],
.bark-modal-content .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bark-modal-content .form-group input:focus,
.bark-modal-content .form-group textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.bark-modal-content .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.bark-modal-content .form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.5;
}

.bark-modal-content .variables-hint {
    margin-top: 10px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 12px;
    color: #0369a1;
    line-height: 1.6;
}

.bark-modal-content .variables-hint strong {
    display: block;
    margin-bottom: 6px;
    color: #0c4a6e;
}

.bark-modal-content .variables-hint code {
    background: #e0f2fe;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
}

.bark-modal-content .toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.bark-modal-content .toggle-row label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.bark-modal-content .modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.bark-modal-content .modal-actions .btn {
    flex: 1;
}

.bark-modal-content .info-tip {
    margin-top: 16px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .bark-config-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bark-config-card {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .bark-card-icon {
        font-size: 20px;
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .bark-card-content {
        min-width: 0;
        flex: 1;
    }
    
    .bark-card-content h3 {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .bark-card-content p {
        font-size: 11px;
    }
    
    .bark-card-status {
        flex-shrink: 0;
    }
    
    .bark-card-status .status-text {
        display: none;
    }
    
    .bark-card-arrow {
        display: none;
    }
    
    .bark-modal-content {
        max-width: 100%;
        margin: 16px;
    }
    
    .bark-modal-content .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .bark-config-card {
        padding: 8px 10px;
        gap: 6px;
    }
    
    .bark-card-icon {
        font-size: 18px;
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    
    .bark-card-content h3 {
        font-size: 13px;
    }
    
    .bark-card-content p {
        font-size: 10px;
    }
}

/* 多选下拉框样式 */
.multi-select-container {
    position: relative;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.multi-select-container:hover {
    border-color: #9ca3af;
}

.multi-select-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-height: 28px;
    align-items: center;
}

.multi-select-tags:empty::before {
    content: '点击选择主题...';
    color: #9ca3af;
    font-size: 14px;
}

.multi-select-tag.global-tag {
    background: #dcfce7;
    color: #166534;
    cursor: default;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.multi-select-tag .tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(3, 105, 161, 0.2);
    color: #0369a1;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.multi-select-tag .tag-remove:hover {
    background: rgba(3, 105, 161, 0.4);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.multi-select-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.multi-select-option:hover {
    background: #f3f4f6;
}

.multi-select-option.selected {
    background: #e0f2fe;
    color: #0369a1;
}

.multi-select-option .check-icon {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
}

.multi-select-option.selected .check-icon {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.multi-select-empty {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.multi-select-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.multi-select-option.global-option {
    background: #f0fdf4;
    border-bottom: 1px solid #e5e7eb;
}

.multi-select-option.global-option:hover {
    background: #dcfce7;
}

.multi-select-option.global-option.selected {
    background: #bbf7d0;
    color: #166534;
}

.multi-select-option.global-option.selected .check-icon {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* ==================== 转发日志表格优化 ==================== */
#forwardLogsTable .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#forwardLogsTable table {
    min-width: 750px;
    width: 100%;
    table-layout: auto;
}

/* 转发日志表格列宽度定义 - 7列 */
/* 第1列：类型 */
#forwardLogsTable table th:nth-child(1),
#forwardLogsTable table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
}

/* 第2列：主题/服务器 */
#forwardLogsTable table th:nth-child(2),
#forwardLogsTable table td:nth-child(2) {
    width: 100px;
    min-width: 100px;
}

/* 第3列：消息内容 */
#forwardLogsTable table th:nth-child(3),
#forwardLogsTable table td:nth-child(3) {
    width: 150px;
    min-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第4列：用户数/目标 */
#forwardLogsTable table th:nth-child(4),
#forwardLogsTable table td:nth-child(4) {
    width: 120px;
    min-width: 120px;
}

/* 第5列：状态 */
#forwardLogsTable table th:nth-child(5),
#forwardLogsTable table td:nth-child(5) {
    width: 70px;
    min-width: 70px;
}

/* 第6列：失败原因 */
#forwardLogsTable table th:nth-child(6),
#forwardLogsTable table td:nth-child(6) {
    width: 120px;
    min-width: 120px;
}

/* 第7列：时间 */
#forwardLogsTable table th:nth-child(7),
#forwardLogsTable table td:nth-child(7) {
    width: 130px;
    min-width: 130px;
    text-align: left;
    white-space: nowrap;
    visibility: visible;
    display: table-cell;
    color: #1f2937;
}

/* 系统日志表格优化（#logsTable 兼容旧版，#systemLogsTable 为日志中心） */
#logsTable .table-container,
#systemLogsTable .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#logsTable table,
#systemLogsTable table {
    min-width: 700px;
    width: 100%;
    table-layout: auto;
}

/* 系统日志表格列宽度定义 - 6列 */
/* 第1列：操作 */
#logsTable table th:nth-child(1),
#logsTable table td:nth-child(1),
#systemLogsTable table th:nth-child(1),
#systemLogsTable table td:nth-child(1) {
    width: 100px;
    min-width: 100px;
}

/* 第2列：用户 */
#logsTable table th:nth-child(2),
#logsTable table td:nth-child(2),
#systemLogsTable table th:nth-child(2),
#systemLogsTable table td:nth-child(2) {
    width: 100px;
    min-width: 100px;
}

/* 第3列：详情 */
#logsTable table th:nth-child(3),
#logsTable table td:nth-child(3),
#systemLogsTable table th:nth-child(3),
#systemLogsTable table td:nth-child(3) {
    width: 200px;
    min-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第4列：状态 */
#logsTable table th:nth-child(4),
#logsTable table td:nth-child(4),
#systemLogsTable table th:nth-child(4),
#systemLogsTable table td:nth-child(4) {
    width: 70px;
    min-width: 70px;
}

/* 第5列：IP地址 */
#logsTable table th:nth-child(5),
#logsTable table td:nth-child(5),
#systemLogsTable table th:nth-child(5),
#systemLogsTable table td:nth-child(5) {
    width: 100px;
    min-width: 100px;
}

/* 第6列：时间 */
#logsTable table th:nth-child(6),
#logsTable table td:nth-child(6),
#systemLogsTable table th:nth-child(6),
#systemLogsTable table td:nth-child(6) {
    width: 130px;
    min-width: 130px;
    text-align: left;
    white-space: nowrap;
    visibility: visible;
    display: table-cell;
    color: #1f2937;
}

/* 可点击的表格行 */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row:hover {
    background-color: #f8fafc;
}

.clickable-row:active {
    background-color: #f1f5f9;
}

/* 多选模式选中行 */
.clickable-row.selected-row {
    background-color: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.clickable-row.selected-row:hover {
    background-color: #bfdbfe;
}

/* 批量操作规则复选框列表 */
.rule-checkbox-item {
    transition: background-color 0.15s ease;
}

.rule-checkbox-item:hover {
    background-color: #f0f9ff;
}

.rule-checkbox-item input[type="checkbox"]:checked + span {
    color: #1d4ed8;
    font-weight: 500;
}

/* 详情模态框 - Microsoft Fluent 风格 */
.detail-modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.detail-modal.active {
    display: flex;
}

.detail-modal-content {
    background: #ffffff;
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: fluentModalIn 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes fluentModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: none;
    background: transparent;
}

.detail-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.detail-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #616161;
    transition: all 0.1s ease;
}

.detail-modal-close:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.detail-modal-close:active {
    background: #e0e0e0;
}

.detail-modal-body {
    padding: 0 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* 详情表格 - Fluent 风格 */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.detail-table tr:last-child {
    border-bottom: none;
}

.detail-table th {
    text-align: left;
    padding: 14px 16px 14px 0;
    background: transparent;
    color: #616161;
    font-weight: 400;
    width: 100px;
    vertical-align: middle;
    font-size: 14px;
}

.detail-table td {
    padding: 14px 0;
    color: #1a1a1a;
    word-break: break-word;
    font-weight: 500;
}

.detail-table td .badge {
    display: inline-block;
}

/* 详情模态框操作按钮区域 - Fluent 风格 */
.detail-modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    justify-content: flex-end;
}

.detail-modal-actions .detail-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease;
    min-width: 80px;
    gap: 8px;
}

.detail-modal-actions .detail-action-btn:active {
    transform: scale(0.98);
}

/* 主要按钮 - 蓝色 */
.detail-action-btn.action-primary {
    background: #0078d4;
    color: white;
}

.detail-action-btn.action-primary:hover {
    background: #106ebe;
}

.detail-action-btn.action-primary:active {
    background: #005a9e;
}

/* 次要按钮 - 透明/边框 */
.detail-action-btn.action-secondary {
    background: transparent;
    color: #1a1a1a;
    border: 1px solid #d1d1d1;
}

.detail-action-btn.action-secondary:hover {
    background: #f5f5f5;
    border-color: #c1c1c1;
}

.detail-action-btn.action-secondary:active {
    background: #e0e0e0;
}

/* 成功按钮 - 绿色 */
.detail-action-btn.action-success {
    background: #107c10;
    color: white;
}

.detail-action-btn.action-success:hover {
    background: #0e6b0e;
}

/* 危险按钮 - 红色 */
.detail-action-btn.action-danger {
    background: transparent;
    color: #d13438;
    border: 1px solid #d13438;
}

.detail-action-btn.action-danger:hover {
    background: #fdf3f4;
}

.detail-action-btn.action-danger:active {
    background: #d13438;
    color: white;
}

/* 移动端详情模态框优化 */
@media (max-width: 768px) {
    .detail-modal {
        padding: 0;
        align-items: flex-end; /* 从底部弹出 */
    }
    
    .detail-modal-content {
        max-height: 85vh;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        margin-bottom: 0;
        animation: modalSlideUp 0.3s ease-out;
    }
    
    @keyframes modalSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .detail-modal-header {
        padding: 16px 20px;
        border-radius: 16px 16px 0 0;
    }
    
    .detail-modal-header h3 {
        font-size: 16px;
    }
    
    .detail-modal-body {
        padding: 0 20px 24px;
    }
    
    /* 移动端详情表格 - 垂直堆叠布局 */
    .detail-table,
    .detail-table tbody,
    .detail-table tr,
    .detail-table th,
    .detail-table td {
        display: block !important;
        width: 100% !important;
    }
    
    .detail-table {
        border: none;
    }
    
    .detail-table tr {
        padding: 12px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .detail-table tr:first-child {
        padding-top: 8px;
    }
    
    .detail-table tr:last-child {
        border-bottom: none;
        padding-bottom: 8px;
    }
    
    .detail-table th {
        padding: 0 0 6px 0 !important;
        background: transparent !important;
        font-size: 12px !important;
        color: #9ca3af !important;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left !important;
        border: none !important;
    }
    
    .detail-table td {
        padding: 0 !important;
        font-size: 14px !important;
        line-height: 1.6;
        color: #1f2937;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: left !important;
        white-space: normal !important;
        border: none !important;
    }
    
    .detail-table td .badge {
        margin-top: 2px;
    }
    
    /* 移动端详情模态框操作按钮 - 宽度由统一规则控制 */
    .detail-modal-actions {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px 24px;
    }

    .detail-modal-actions .detail-action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .detail-modal-header {
        padding: 12px 16px;
    }
    
    .detail-modal-header h3 {
        font-size: 15px;
    }
    
    .detail-modal-body {
        padding: 0 16px 20px;
    }
    
    .detail-table tr {
        padding: 10px 0;
    }
    
    .detail-table th {
        font-size: 11px !important;
    }
    
    .detail-table td {
        font-size: 13px !important;
    }
    
    .detail-modal-actions {
        padding: 12px 16px 20px;
    }
    
    /* 与全局表格容器一致，不再用负边距顶到屏幕边缘 */
    #forwardLogsTable .table-container,
    #logsTable .table-container,
    #systemLogsTable .table-container,
    #excludeKeywordsTable .table-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #forwardLogsTable table {
        min-width: 650px;
        width: max-content;
    }
    
    #logsTable table,
    #systemLogsTable table {
        min-width: 600px;
        width: max-content;
    }
    
    /* 移动端转发日志时间列 */
    #forwardLogsTable table th:nth-child(7),
    #forwardLogsTable table td:nth-child(7) {
        width: 110px;
        min-width: 110px;
        text-align: left;
        white-space: nowrap;
    }
    
    /* 移动端系统日志时间列 */
    #logsTable table th:nth-child(6),
    #logsTable table td:nth-child(6),
    #systemLogsTable table th:nth-child(6),
    #systemLogsTable table td:nth-child(6) {
        width: 110px;
        min-width: 110px;
        text-align: left;
        white-space: nowrap;
    }
    
    /* 移动端排除关键词表格 */
    #excludeKeywordsTable table {
        min-width: 580px !important;
    }
    
    #excludeKeywordsTable table th,
    #excludeKeywordsTable table td {
        padding: 4px 5px !important;
    }
    
    #excludeKeywordsTable table th:nth-child(1),
    #excludeKeywordsTable table td:nth-child(1) {
        width: 140px !important;
        min-width: 140px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    #excludeKeywordsTable table th:nth-child(2),
    #excludeKeywordsTable table td:nth-child(2) {
        width: 70px !important;
        min-width: 70px !important;
        white-space: nowrap;
    }
    
    #excludeKeywordsTable table th:nth-child(3),
    #excludeKeywordsTable table td:nth-child(3) {
        width: 60px !important;
        min-width: 60px !important;
    }
    
    #excludeKeywordsTable table th:nth-child(4),
    #excludeKeywordsTable table td:nth-child(4) {
        width: 140px !important;
        min-width: 140px !important;
    }
    
    #excludeKeywordsTable table th:nth-child(5),
    #excludeKeywordsTable table td:nth-child(5) {
        width: 110px !important;
        min-width: 110px !important;
        font-size: 11px !important;
    }
    
    #excludeKeywordsTable table th:nth-child(6),
    #excludeKeywordsTable table td:nth-child(6) {
        width: 60px !important;
        min-width: 60px !important;
    }
}

/* 排除关键词表格 */
#excludeKeywordsTable table {
    min-width: 650px;
    width: 100% !important;
    table-layout: fixed !important;
}

#excludeKeywordsTable table th:nth-child(1),
#excludeKeywordsTable table td:nth-child(1) {
    width: 170px;
    min-width: 170px;
}

#excludeKeywordsTable table th:nth-child(2),
#excludeKeywordsTable table td:nth-child(2) {
    width: 90px;
    min-width: 90px;
}

#excludeKeywordsTable table th:nth-child(3),
#excludeKeywordsTable table td:nth-child(3) {
    width: 70px;
    min-width: 70px;
}

#excludeKeywordsTable table th:nth-child(4),
#excludeKeywordsTable table td:nth-child(4) {
    width: 170px;
    min-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#excludeKeywordsTable table th:nth-child(5),
#excludeKeywordsTable table td:nth-child(5) {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
    font-size: 11px;
}

#excludeKeywordsTable table th:nth-child(6),
#excludeKeywordsTable table td:nth-child(6) {
    width: 70px;
    min-width: 70px;
}

/* ==================== 移动端通用卡片视图 ==================== */

.cards-container {
    display: none;
}

/* 紧凑列表行样式（移动端所有卡片统一采用） */
.compact-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    border-left-width: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 52px;
}

.compact-item:active {
    transform: scale(0.98);
    background: #f8fafc;
}

.compact-item.unused { border-left-color: #10b981; }
.compact-item.used { border-left-color: #ef4444; }
.compact-item.active { border-left-color: #10b981; }
.compact-item.deleted { border-left-color: #6b7280; }
.compact-item.success { border-left-color: #10b981; }
.compact-item.failed { border-left-color: #ef4444; }
.compact-item.filtered { border-left-color: #6b7280; }
.compact-item.excluded { border-left-color: #f59e0b; }
.compact-item.enabled { border-left-color: #10b981; }
.compact-item.disabled { border-left-color: #6b7280; }
.compact-item.warning { border-left-color: #f59e0b; }

/* 文本替换：移动端纵向排版，长 URL 换行且不与徽章重叠 */
.compact-item.text-rule-compact {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.text-rule-compact-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.text-rule-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.text-rule-k {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #94a3b8;
    text-transform: uppercase;
}

.text-rule-v {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}

.text-rule-find {
    color: #1e40af;
}

.text-rule-replace {
    color: #047857;
}

.text-rule-arrow {
    text-align: center;
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1;
    padding: 2px 0;
}

.text-rule-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.text-rule-scope {
    font-size: 11px;
    color: #94a3b8;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-rule-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.text-rule-badges .badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* 紧凑信息区 */
.compact-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 紧凑首行：类型/名称 + 状态 */
.compact-top {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.compact-title {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-sub {
    font-size: 11px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右侧时间和标签 */
.compact-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.compact-date {
    font-size: 11px;
    color: #9ca3af;
}

.compact-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.compact-badge.success { background: #dcfce7; color: #166534; }
.compact-badge.danger { background: #fee2e2; color: #991b1b; }
.compact-badge.warning { background: #fef3c7; color: #92400e; }
.compact-badge.info { background: #dbeafe; color: #1e40af; }
.compact-badge.neutral { background: #f1f5f9; color: #475569; }

/* 紧凑复制按钮 */
.compact-copy {
    padding: 4px 8px;
    background: #f1f5f9;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.compact-copy:active {
    background: #e2e8f0;
    color: #475569;
}

/* 原始大卡片样式（保留以备不时之需） */
.data-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.data-card:active {
    transform: scale(0.98);
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.data-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.data-card-body {
    margin-bottom: 10px;
}

.data-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.data-card-label {
    color: #6b7280;
}

.data-card-value {
    color: #1f2937;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
    color: #9ca3af;
}

.data-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.data-card-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
}

/* 移动端显示卡片 */
@media (max-width: 768px) {
    .cards-container {
        display: block;
    }

    .mobile-hide-table .table-container {
        display: none;
    }

    /* 确保分页组件在移动端正常显示 */
    #logsPagination,
    #cardsPagination,
    #usersPagination,
    #keywordsPagination {
        display: block !important;
    }

    /* 文本替换规则移动端紧凑卡片 */
    .compact-item.text-rule-compact {
        padding: 4px 6px;
        min-height: 0;
    }

    /* 所有移动端紧凑卡片统一缩小 */
    .compact-list {
        gap: 3px;
    }

    .compact-item {
        padding: 4px 6px;
        min-height: 30px;
        border-left-width: 2px;
        border-radius: 4px;
    }

    .text-rule-compact-inner {
        gap: 1px;
    }

    .text-rule-k {
        font-size: 7px;
    }

    .text-rule-v {
        font-size: 10px;
        line-height: 1.3;
    }

    .text-rule-arrow {
        font-size: 9px;
        padding: 0;
    }

    .text-rule-foot {
        margin-top: 1px;
        padding-top: 3px;
        gap: 1px 4px;
    }

    .text-rule-scope {
        font-size: 8px;
    }

    .text-rule-badges .badge {
        font-size: 7px;
        padding: 0 3px;
    }

    .text-rule-badges .compact-badge {
        font-size: 7px;
        padding: 0 3px;
    }
}

/* ==================== 移动端转发日志卡片视图 ==================== */

.log-cards-container {
    display: none;
}

.log-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.log-card:active {
    transform: scale(0.98);
}

.log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.log-card-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-card-type .badge {
    font-size: 11px;
    padding: 3px 8px;
}

.log-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-card-status .status-icon {
    font-size: 16px;
}

.log-card-status.success .status-icon { color: #10b981; }
.log-card-status.failed .status-icon { color: #ef4444; }
.log-card-status.filtered .status-icon { color: #6b7280; }
.log-card-status.excluded .status-icon { color: #f59e0b; }

.log-card-status .status-text {
    font-size: 12px;
    font-weight: 500;
}

.log-card-content {
    margin-bottom: 10px;
}

.log-card-message {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.log-card-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    font-size: 14px;
}

.log-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.log-card-target {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
    max-width: 60%;
    overflow: hidden;
}

.log-card-target code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-card-target .arrow {
    color: #9ca3af;
}

.log-card-time {
    font-size: 11px;
    color: #9ca3af;
}

.log-card-elapsed {
    font-size: 11px;
    color: #6b7280;
    background: #f0fdf4;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.log-card-elapsed.slow {
    background: #fef3c7;
    color: #92400e;
}

/* 移动端显示卡片视图，隐藏表格 */
@media (max-width: 768px) {
    #forwardLogsTable .table-container {
        display: none;
    }

    .log-cards-container {
        display: block;
    }

    .log-card {
        padding: 12px;
    }

    .log-card-message {
        font-size: 13px;
    }
}

/* 系统配置按钮组 */
.config-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.config-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
}

.config-actions .btn svg {
    vertical-align: middle;
}

.config-actions .btn-help {
    padding: 6px 10px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.config-actions .btn-help:hover {
    background: #e2e8f0;
    color: #475569;
}

/* 系统配置备份与恢复样式 */
.config-backup-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.config-backup-info .info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.config-backup-info .info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.config-backup-info .info-icon {
    font-size: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 10px;
    flex-shrink: 0;
}

.config-backup-info .info-content {
    flex: 1;
}

.config-backup-info .info-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.config-backup-info .info-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.config-notice {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #fde047;
}

.config-notice h4 {
    margin: 0 0 12px 0;
    color: #854d0e;
    font-size: 16px;
}

.config-notice ul {
    margin: 0;
    padding-left: 20px;
    color: #713f12;
    font-size: 14px;
    line-height: 1.8;
}

.config-notice ul ul {
    margin-top: 4px;
}

/* 系统配置 Tab 移动端优化 */
@media (max-width: 768px) {
    #systemConfigTab {
        padding: 12px;
    }

    #systemConfigTab h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* 按钮行紧凑 */
    .config-actions {
        gap: 6px;
        margin-bottom: 12px;
    }

    .config-actions .btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .config-actions .btn svg {
        width: 12px;
        height: 12px;
        margin-right: 3px;
    }

    .config-actions .btn-help {
        padding: 5px 8px;
    }

    /* 导出选项紧凑 */
    #exportOptions {
        padding: 12px;
        margin-bottom: 12px;
    }

    #exportOptions > div:first-child {
        font-size: 13px;
        margin-bottom: 10px;
    }

    #exportOptions label {
        font-size: 12px;
    }

    #exportOptions .form-hint {
        font-size: 11px;
        margin-left: 20px;
    }

    /* 信息卡片网格 - 2列紧凑 */
    .config-backup-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }

    .config-backup-info .info-card {
        padding: 10px;
        gap: 8px;
    }

    .config-backup-info .info-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .config-backup-info .info-icon svg {
        width: 18px;
        height: 18px;
    }

    .config-backup-info .info-label {
        font-size: 10px;
    }

    .config-backup-info .info-value {
        font-size: 18px;
    }

    /* 说明区域紧凑 */
    .config-notice {
        padding: 12px;
    }

    .config-notice h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .config-notice ul {
        font-size: 11px;
        line-height: 1.6;
        padding-left: 16px;
    }

    .config-notice ul ul {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .config-backup-info {
        gap: 6px;
    }

    .config-backup-info .info-card {
        padding: 8px;
        gap: 6px;
    }

    .config-backup-info .info-icon {
        width: 28px;
        height: 28px;
    }

    .config-backup-info .info-icon svg {
        width: 16px;
        height: 16px;
    }

    .config-backup-info .info-value {
        font-size: 16px;
    }

    .config-actions .btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .config-actions .btn-help {
        padding: 4px 6px;
    }
}

/* 导入模态框样式 */
.modal-body {
    padding: 20px;
}

/* 导入结果样式 */
.import-result-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 16px;
    color: #166534;
}

.import-result-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
    color: #991b1b;
}

.import-result-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
}

.import-result-item:last-child {
    border-bottom: none;
}

.import-result-item .label {
    font-weight: 500;
}

.import-result-item .counts {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.import-result-item .added {
    color: #16a34a;
}

.import-result-item .updated {
    color: #2563eb;
}

.import-result-item .skipped {
    color: #d97706;
}

/* ==================== 用户详情模态框移动端优化 ==================== */

/* 快捷延期按钮组 */
.quick-extend-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.quick-extend-btns .btn-xs {
    flex: 1;
    padding: 3px 4px;
    font-size: 11px;
    line-height: 1.2;
}

/* 状态行 */
.status-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* 用户详情模态框 - 停用/激活按钮（detailToggleBtn） */
#userDetailModal #detailToggleBtn {
    padding: 3px 8px;
    font-size: 11px;
    min-width: 0;
    line-height: 1.2;
}

/* 用户详情模态框 - 底部操作按钮组 */
#userDetailModal .modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

#userDetailModal .modal-actions .btn {
    flex: 1;
    min-width: 70px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.3;
}

/* 移动端用户详情模态框优化 */
@media (max-width: 768px) {
    /* 快捷延期按钮 - 移动端更小 */
    .quick-extend-btns {
        gap: 3px;
    }

    .quick-extend-btns .btn-xs {
        padding: 2px 3px;
        font-size: 10px;
        line-height: 1.1;
    }

    /* 停用/激活按钮 - 移动端缩小 */
    #userDetailModal #detailToggleBtn {
        padding: 2px 6px;
        font-size: 10px;
        line-height: 1.1;
    }

    /* 状态行优化 */
    .status-row {
        gap: 4px;
    }

    /* 底部操作按钮 - 移动端缩小 */
    #userDetailModal .modal-actions {
        gap: 6px;
        margin-top: 12px;
    }

    #userDetailModal .modal-actions .btn {
        flex: 1;
        min-width: 50px;
        padding: 5px 6px;
        font-size: 11px;
    }

    #userDetailModal .modal-actions .btn-danger {
        padding: 5px 6px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    /* 快捷延期按钮 - 超小屏更紧凑 */
    .quick-extend-btns {
        gap: 2px;
    }

    .quick-extend-btns .btn-xs {
        padding: 2px 2px;
        font-size: 10px;
        line-height: 1.1;
    }

    /* 停用/激活按钮 - 超小屏 */
    #userDetailModal #detailToggleBtn {
        padding: 2px 4px;
        font-size: 10px;
        line-height: 1.1;
    }

    /* 状态和切换按钮 */
    .status-row {
        gap: 3px;
    }

    /* 底部操作按钮 - 超小屏进一步缩小 */
    #userDetailModal .modal-actions {
        gap: 4px;
        margin-top: 10px;
    }

    #userDetailModal .modal-actions .btn {
        flex: 1;
        min-width: 40px;
        padding: 4px 5px;
        font-size: 10px;
    }

    #userDetailModal .modal-actions .btn-danger {
        padding: 4px 5px;
        font-size: 10px;
    }
}

/* ==================== 转发关键词批量操作浮动条 ==================== */

/* 桌面端批量操作栏 */
.batch-bar-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #bfdbfe;
}

.batch-bar-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #1e40af;
}

.batch-bar-count strong {
    color: #1d4ed8;
}

/* 移动端浮动底部操作条 */
.batch-bar-mobile {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e5e7eb;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    z-index: 200;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.batch-bar-mobile-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.batch-bar-mobile-left {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.batch-bar-mobile-left span:first-child {
    font-size: 20px;
    font-weight: 700;
    color: #3b82f6;
}

.batch-bar-mobile-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-bar-btn {
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.batch-bar-btn:active {
    transform: scale(0.96);
}

.batch-bar-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.batch-bar-btn-rules {
    background: #e0e7ff;
    color: #3730a3;
}

.batch-bar-btn-rules.has-rules {
    background: #c7d2fe;
}

.batch-bar-btn-confirm {
    background: #3b82f6;
    color: white;
}

.batch-bar-btn-confirm:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .batch-bar-desktop {
        display: none;
    }
}

/* 移动端规则选择模态框内复选框样式 */
.ikw-rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ikw-rule-item:active {
    background: #f8fafc;
}

.ikw-rule-item.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ikw-rule-item input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.ikw-rule-info {
    flex: 1;
    min-width: 0;
}

.ikw-rule-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.ikw-rule-path {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
