/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #2a2a2a;
    --primary: #00d4ff;
    --primary-hover: #00b8e6;
    --danger: #ff3366;
    --success: #00ff88;
    --warning: #ffaa00;
    --text: #e0e0e0;
    --text-dim: #888888;
    --border: #333333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content h2 {
    color: var(--primary);
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.points {
    color: var(--text);
    font-size: 1rem;
}

.points strong {
    color: var(--warning);
    font-size: 1.2rem;
}

/* 容器 */
.container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 登录框 */
.login-box {
    max-width: 450px;
    margin: 5rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 50px rgba(0, 212, 255, 0.2);
    animation: fadeInUp 0.5s ease;
}

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

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* 表单标签页 */
.form-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 1rem;
}

.tab-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.tab-btn:hover:not(.active) {
    background: var(--bg-card);
    border-color: var(--primary);
}

/* 表单 */
.form-content {
    display: none;
}

.form-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

/* 按钮 */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #e62958;
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
.nav-right .btn-small {
    background: var(--primary); 
    color: #000000;
    border: 1px solid var(--primary);
}

.nav-right .btn-small:hover {
    background: var(--primary-hover);
    color: #000000;
    border-color: var(--primary-hover);
}

.nav-right .btn-danger {
    background: var(--danger);
    border: 1px solid var(--danger);
}
.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* 卡片 */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.dashboard-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

/* 节点选择 */
.node-selection {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.node-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* 节点项 */
.node-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.node-item:hover:not(.node-offline) {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.node-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}




/* 移除旧的状态指示器样式 */
.node-status {
    display: none;
}
/* 节点内容 */
.node-content {
    flex: 1;
    min-width: 0;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.node-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.node-location {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 状态徽章 */
.node-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.node-status-badge.online {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.node-status-badge.offline {
    background: rgba(136, 136, 136, 0.15);
    color: var(--text-dim);
    border: 1px solid var(--text-dim);
}

/* 离线节点样式 */
.node-item.node-offline {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-input);
    border-style: dashed;
}

.node-item.node-offline:hover {
    transform: none;
    box-shadow: none;
}

.node-item.node-offline input[type="checkbox"] {
    cursor: not-allowed;
}

.node-item.node-offline .node-name {
    color: var(--text-dim);
}

/* 任务列表 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
}

.task-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.task-url {
    color: var(--primary);
    font-weight: 600;
    word-break: break-all;
}

.task-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: var(--warning);
    color: #000;
}

.status-processing {
    background: var(--primary);
    color: #000;
}

.status-completed {
    background: var(--success);
    color: #000;
}

.status-failed {
    background: var(--danger);
    color: #fff;
}

.task-info {
    display: flex;
    gap: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 最终落地页长度显示 */
.result-card .result-value:nth-child(4) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 检测结果表格 - 10列版本（新增错误详情列） */
.results-grid {
    display: block;
}

.result-table-header {
    display: grid;
    grid-template-columns: 120px 100px 130px 90px 200px 70px 100px 80px 180px 80px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-input);
    border: 1px solid var(--primary);
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    text-align: center;
}

.result-table-header > div:first-child {
    text-align: left;
}

.result-card {
    display: grid;
    grid-template-columns: 120px 100px 130px 90px 200px 70px 100px 80px 180px 80px;
    gap: 1rem;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-top: none;
    padding: 1rem 1.5rem;
    transition: all 0.3s;
}

.result-card:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.result-card:last-child {
    border-radius: 0 0 10px 10px;
}

/* 执行中的卡片样式 */
.result-card.executing {
    background: rgba(0, 212, 255, 0.05);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 20px 5px rgba(0, 212, 255, 0.2);
    }
}

.result-node {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    text-align: left;
}

.result-status-cell {
    text-align: center;
}

.result-success {
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
}

.result-executing {
    color: var(--primary);
    font-weight: 600;
}

.result-failed {
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
}

.result-value {
    font-size: 0.85rem;
    color: var(--text);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 错误详情列样式（新增） */
.result-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-height: 40px;
}

.result-error .error-message {
    display: inline-block;
    max-width: 180px;
    color: var(--danger);
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    padding: 4px 8px;
    background: rgba(255, 51, 102, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--danger);
    transition: all 0.3s;
}

.result-error .error-message:hover {
    white-space: normal;
    max-width: 300px;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 51, 102, 0.3);
    background: rgba(255, 51, 102, 0.15);
}

.screenshot-preview {
    width: 70px;
    height: 45px;
    margin: 0 auto;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
}

.screenshot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-card .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    margin: 0 auto;
}

/* 让内部元素平铺到grid */
.result-header {
    display: contents;
}

.result-details {
    display: contents;
}

/* 检测点列 */
.result-node small {
    display: none;
}

.result-success,
.result-failed {
    display: inline-block;
}

/* 隐藏标签，完全移除 */
.result-label {
    display: none !important;
}

/* 每个数据行 */
.result-row {
    display: contents;
}

/* 让 result-value 直接参与 grid */
.result-row .result-value {
    display: block;
}

/* 用户信息 */
.user-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: var(--bg-input);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.info-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.info-label {
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

/* 提示信息 */
.hint {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* 错误消息 */
.error-message {
    color: var(--danger);
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--danger);
    border-radius: 8px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.success-message {
    color: var(--success);
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--success);
    border-radius: 8px;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s;
}

/* 加载动画 */
.loading {
    text-align: center;
    color: var(--text-dim);
    padding: 2rem;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .node-list {
        grid-template-columns: 1fr;
    }

    .login-box {
        margin: 2rem auto;
        padding: 2rem;
    }
    
    /* 移动端表格适配 */
    .result-table-header,
    .result-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .result-table-header > div {
        display: none;
    }
    
    .result-error .error-message {
        max-width: 100%;
    }
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 212, 255, 0.3);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--danger);
    color: #fff;
}

.modal-body {
    padding: 2rem;
    overflow: auto;
    flex: 1;
}

.modal-body pre {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: 8px;
    overflow: auto;
    margin: 0;
    max-height: 60vh;
}

.modal-body code {
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 执行中信息提示 */
.executing-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    margin-top: 1rem;
    color: var(--primary);
}

/* 加载旋转器 */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.no-results .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border-width: 4px;
}

.no-results p {
    font-size: 1.1rem;
    margin: 0;
}

/* 截图懒加载效果 */
.screenshot-preview img {
    opacity: 0;
    transition: opacity 0.3s;
}

.screenshot-preview img[src] {
    opacity: 1;
}

/* 截图模态框特殊样式 */
.screenshot-modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: #000;
}

.full-screenshot {
    max-width: 100%;
    max-height: calc(90vh - 180px);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 212, 255, 0.3);
}


/* 问号图标样式 */
.help-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #00f0ff; /* 与表头文字同色 */
  color: #1a1a1a; /* 深色背景凸显问号 */
  text-align: center;
  line-height: 16px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 6px; /* 与文字保持距离 */
  cursor: help; /* 鼠标变成帮助样式 */
  position: relative; /* 用于定位提示框 */
}

/* 悬浮提示框样式 */
.help-tooltip {
  visibility: hidden; /* 默认隐藏 */
  width: 200px; /* 提示框宽度 */
  background-color: #333; /* 深色背景 */
  color: #fff; /* 白色文字 */
  padding: 8px 10px;
  border-radius: 4px;
  position: absolute; /* 绝对定位 */
  bottom: 125%; /* 显示在图标上方 */
  left: 50%;
  transform: translateX(-50%); /* 水平居中 */
  opacity: 0; /* 初始透明 */
  transition: opacity 0.3s; /* 淡入动画 */
  font-size: 12px; /* 小号文字 */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* 轻微阴影 */
  z-index: 100; /* 确保在最上层 */
}

/* 提示框底部小箭头 */
.help-tooltip::after {
  content: "";
  position: absolute;
  top: 100%; /* 箭头在提示框底部 */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent; /* 箭头颜色与提示框一致 */
}

/* 鼠标悬停时显示提示框 */
.help-icon:hover .help-tooltip {
  visibility: visible;
  opacity: 1; /* 完全显示 */
}

.result-value a {
  color: white;
}
.result-value a:visited {
  color: white;
}
.result-value a:hover {
  color: white; /* 悬停时也保持白色，可根据需要修改 */
}











