/**
 * 用户日志页面样式表
 * 使用PageHeader重构后的专用样式
 */

/* 基础样式 */
.hilite { 
    background: #fda; 
}

td {
    white-space: nowrap;
    overflow: hidden;
}

body {
    margin: 0px;
}

/* 主表格单元格样式 */
.td_main {
    max-width: 380px;
    overflow: hidden;
}

/* 搜索表单样式 - 现代化设计 */
.search-form {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: white;
    position: relative;
    overflow: hidden;
}

.search-form:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.search-form .form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.search-form .form-group {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-form label {
    margin-bottom: 0;
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
}

.search-form .form-control {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    background: transparent;
    box-shadow: none;
    transition: all 0.3s ease;
}

.search-form .form-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* 表格容器 - 现代化设计 */
.table-container {
    margin: 25px 0;
    overflow-x: auto;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    background: white;
    position: relative;
}

.table-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
}

/* 日志表格样式 - 现代化设计 */
.log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    min-width: 800px;
    background: white;
}

.log-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.log-table th:first-child {
    border-top-left-radius: 12px;
}

.log-table th:last-child {
    border-top-right-radius: 12px;
}

.log-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    transition: all 0.3s ease;
    position: relative;
}

.log-table tr {
    transition: all 0.3s ease;
}

.log-table tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.log-table tr:hover td {
    border-color: #667eea;
}

.log-table tr:nth-child(even) {
    background: #fafbff;
}

.log-table tr:nth-child(even):hover {
    background: linear-gradient(135deg, #f0f2ff 0%, #e8ebff 100%);
}

/* 表格行动画效果 */
.log-table tbody tr {
    animation: fadeInUp 0.5s ease;
}

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

/* 表格行延迟动画 */
.log-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.log-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.log-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.log-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.log-table tbody tr:nth-child(5) { animation-delay: 0.5s; }

/* IP链接样式 */
.ip-link {
    color: #007bff;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.ip-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* URL单元格样式 - 优化显示 */
.url-cell {
    max-width: 300px;
    min-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.url-cell a {
    color: #28a745;
    text-decoration: none;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-cell a:hover {
    text-decoration: underline;
    color: #1e7e34;
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
}

/* URL提示工具 */
.url-cell a[title]:hover:after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal;
    width: 400px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 表格列宽优化 */
.log-table th:nth-child(1), /* ID */
.log-table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
}

.log-table th:nth-child(2), /* 名称 */
.log-table td:nth-child(2) {
    width: 120px;
    min-width: 120px;
    max-width: 200px;
}

.log-table th:nth-child(3), /* IP地址 */
.log-table td:nth-child(3) {
    width: 120px;
    min-width: 120px;
}

.log-table th:nth-child(4), /* 用户名 */
.log-table td:nth-child(4) {
    width: 100px;
    min-width: 100px;
    max-width: 150px;
}

.log-table th:nth-child(5), /* 关键词 */
.log-table td:nth-child(5) {
    width: 100px;
    min-width: 100px;
    max-width: 150px;
}

.log-table th:nth-child(6), /* URL */
.log-table td:nth-child(6) {
    width: 300px;
    min-width: 150px;
    max-width: 300px;
}

.log-table th:nth-child(7), /* 时间 */
.log-table td:nth-child(7) {
    width: 140px;
    min-width: 140px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-form .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form .form-group {
        margin-bottom: 10px;
        justify-content: space-between;
    }
    
    .search-form .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .log-table {
        font-size: 12px;
    }
    
    .log-table th,
    .log-table td {
        padding: 8px 10px;
    }
    
    .url-cell {
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .table-container {
        margin: 10px -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .url-cell {
        max-width: 150px;
    }
}

/* 分页样式增强 */
#div_Page {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-left: 4px solid #17a2b8;
}

.alert h4 {
    margin-bottom: 10px;
    font-weight: 600;
}

/* 按钮样式增强 - 现代化设计 */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

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

.btn:hover:before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-outline-info {
    background: transparent;
    border: 2px solid #17a2b8;
    color: #17a2b8;
    box-shadow: 0 2px 10px rgba(23, 162, 184, 0.1);
}

.btn-outline-info:hover {
    background: #17a2b8;
    color: white;
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.3);
}

/* 特殊按钮样式 */
.btn-home {
    background: linear-gradient(135deg, #fd746c 0%, #ff9068 100%);
    color: white;
    border: none;
}

.btn-home:hover {
    background: linear-gradient(135deg, #e8655d 0%, #e8805d 100%);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 表格排序指示器 */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}

.sortable:after {
    content: "⇵";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.6;
}

.sortable.asc:after {
    content: "↑";
    opacity: 1;
}

.sortable.desc:after {
    content: "↓";
    opacity: 1;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    font-weight: 300;
}

/* 调试信息样式 */
.debug-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6c757d;
}