/* HTML报告生成器样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #e8eef8 0%, #f0e8f5 100%);
    min-height: 100vh;
    padding: 20px;
    color: #555;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fafbfc;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #b8c5e8 0%, #d4c4e4 100%);
    color: #4a5568;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.report-info {
    font-size: 1.1em;
    opacity: 0.85;
    margin: 5px 0;
}

.summary-section {
    padding: 30px 40px;
    background: #f5f7fa;
    border-bottom: 1px solid #e1e8ed;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-align: center;
}

.summary-card h3 {
    color: #7c8fc2;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.summary-card .value {
    font-size: 2em;
    font-weight: bold;
    color: #555;
}

.content-section {
    padding: 40px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-item {
    padding: 15px;
    background: #f5f7fa;
    border-radius: 6px;
    border-left: 4px solid #a8b8d8;
}

.info-item label {
    display: block;
    font-weight: bold;
    color: #7c8fc2;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.info-item .value {
    font-size: 1.1em;
    color: #555;
    word-break: break-word;
}

.comparison-section {
    margin-top: 30px;
}

.comparison-title {
    font-size: 1.5em;
    color: #7c8fc2;
    margin-bottom: 20px;
    border-bottom: 1px solid #c8d4e8;
    padding-bottom: 10px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

.comparison-table th {
    background: linear-gradient(135deg, #b8c5e8 0%, #d4c4e4 100%);
    color: #4a5568;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e8ed;
}

.comparison-table tr:hover {
    background: #f5f7fa;
}

.diff-positive {
    color: #5db884;
    font-weight: 500;
}

.diff-negative {
    color: #d6848a;
    font-weight: 500;
}

.diff-pass {
    color: #5db884;
    font-weight: 500;
}

.diff-warning {
    color: #d6848a;
    font-weight: 500;
}

.diff-zero {
    color: #6c757d;
}

.data-detail {
    margin-top: 20px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.data-detail pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.sql-section {
    margin-top: 20px;
}

.sql-box {
    background: #f5f7fa;
    color: #555;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    overflow-x: auto;
    border: 1px solid #e1e8ed;
}

.sql-box pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

/* 表格视图样式 */
/* 表格容器，支持横向滚动 */
.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin-top: 20px;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    /* 美化滚动条样式 */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #a8b8d8 #f5f7fa; /* Firefox */
}

/* Webkit浏览器滚动条样式 */
.table-container::-webkit-scrollbar {
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: #f5f7fa;
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #a8b8d8;
    border-radius: 6px;
    border: 2px solid #f5f7fa;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #7c8fc2;
}

.table-view {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: auto; /* 使用自动布局，允许列宽根据内容调整 */
}

.table-view th, .table-view td {
    padding: 12px 15px;
    border: 1px solid #e1e8ed;
    text-align: left;
    /*white-space: nowrap;  防止文本换行，保持列宽 */
    /* overflow: hidden;
    /* text-overflow: ellipsis;  超出部分显示省略号 */
}

/* 为所有列设置默认的最小和最大宽度范围 */
.table-view th, .table-view td {
    min-width: 80px; /* 最小宽度 */
    max-width: 400px; /* 最大宽度 */
}

/* 用例序号列 - 较窄 */
.table-view th.col-idx, .table-view td.col-idx {
    min-width: 80px;
    max-width: 120px;
    width: 100px;
}

/* 测试用例名称列 - 中等宽度，允许换行 */
.table-view th.col-case, .table-view td.col-case {
    min-width: 150px;
    max-width: 300px;
    width: 200px;
    white-space: normal; /* 允许换行 */
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* VID列 - 中等宽度 */
.table-view th.col-vid, .table-view td.col-vid {
    min-width: 100px;
    max-width: 200px;
    width: 150px;
}

/* 频道名列 - 中等宽度 */
.table-view th.col-cname, .table-view td.col-cname {
    min-width: 120px;
    max-width: 250px;
    width: 180px;
}

/* 状态列 - 中等宽度（包含备注输入框） */
.table-view th.col-status, .table-view td.col-status {
    min-width: 120px;
    max-width: 250px;
    width: 180px;
}

/* 详细信息列 - 中等宽度 */
.table-view th.col-details, .table-view td.col-details {
    min-width: 200px;
    max-width: 500px;
    width: 300px;
}

/* 自定义列 - 默认中等宽度 */
.table-view th.col-custom, .table-view td.col-custom {
    min-width: 100px;
    max-width: 400px;
    width: 150px;
}

.table-view th {
    background: linear-gradient(135deg, #b8c5e8 0%, #d4c4e4 100%);
    color: #4a5568;
    font-weight: 600;
    position: sticky; /* 表头固定 */
    top: 0;
    z-index: 10;
}

.table-view tr:hover {
    background: #f5f7fa;
}

/* 过滤行隐藏样式 - 只作用于主表格行（有data-status属性的行），不影响详细信息里的表格 */
.table-view tr[data-status].filter-hidden {
    display: none !important;
}

/* 多层嵌套展示样式 */
.details {
    display: none;
    margin-left: 20px;
    margin-top: 10px;
}

.details ul {
    list-style-type: none;
    padding-left: 0;
}

.details li {
    margin-bottom: 8px;
}

/* 状态按钮样式 */
.status-btn {
    border: none;
    padding: 6px 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    margin: 2px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.status-btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.status-btn-pass {
    background-color: #9fd4b0;
    color: #2d5a3d;
}

.status-btn-fail {
    background-color: #f4b3b8;
    color: #7d3a42;
}

.status-btn-details {
    background-color: #a8b8d8;
    color: #4a5568;
}

/* 结果状态样式 */
.result-pass {
    color: #5db884;
    font-weight: 500;
}

.result-fail {
    color: #d6848a;
    font-weight: 500;
}

/* 状态选择框样式 */
.status-select {
    padding: 6px 30px 6px 12px;
    border: 1px solid #c8d4e8;
    border-radius: 4px;
    background: white;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237c8fc2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s;
    z-index: 1;
    position: relative;
    pointer-events: auto;
}

.status-select:hover {
    border-color: #a8b8d8;
    background-color: #f5f7fa;
}

.status-select:focus {
    outline: none;
    border-color: #7c8fc2;
    box-shadow: 0 0 0 2px rgba(124, 143, 194, 0.2);
}

.status-select.status-pass {
    border-color: #9fd4b0;
    color: #5db884;
}

.status-select.status-diff {
    border-color: #ffcc99;
    color: #d6a884;
}

.status-select.status-fail {
    border-color: #f4b3b8;
    color: #d6848a;
}

/* 状态单元格容器 */
.status-cell-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 100px;
}

/* 备注容器 */
.status-note-wrapper {
    position: relative;
    width: 100%;
}

/* 备注显示文本样式 */
.status-note-display {
    width: 100%;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid #c8d4e8;
    border-radius: 4px;
    background: white;
    color: #555;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.status-note-display:hover {
    border-color: #a8b8d8;
    background-color: #fafbfc;
}

.status-note-display .note-text {
    display: block;
    min-height: 28px;
    color: #555;
}

.status-note-display .note-text:empty::before {
    content: "添加备注...";
    color: #a8b8d8;
    font-style: italic;
}

.status-note-display .note-text.empty-note {
    color: #a8b8d8;
    font-style: italic;
}

/* 备注输入框样式（编辑状态） */
.status-note {
    width: 100%;
    min-width: 100px;
    max-width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: 6px 10px;
    border: 1px solid #7c8fc2;
    border-radius: 4px;
    background: white;
    color: #555;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    resize: vertical; /* 允许垂直调整大小 */
    transition: all 0.2s;
    box-sizing: border-box;
    line-height: 1.4;
}

.status-note:focus {
    outline: none;
    border-color: #7c8fc2;
    box-shadow: 0 0 0 2px rgba(124, 143, 194, 0.2);
    background-color: #fafbfc;
}

.status-note::placeholder {
    color: #a8b8d8;
    font-style: italic;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 0.9em;
    }
    
    .table-view {
        font-size: 0.9em;
    }
    
    /* 移动设备上列的最小宽度可以更小 */
    .table-view th, .table-view td {
        min-width: 60px;
        padding: 8px 10px;
    }
    
    .table-view th.col-idx, .table-view td.col-idx {
        min-width: 60px;
        max-width: 100px;
        width: 80px;
    }
    
    .table-view th.col-case, .table-view td.col-case {
        min-width: 120px;
        max-width: 250px;
        width: 180px;
    }
    
    /* 移动设备上状态列和备注输入框的调整 */
    .table-view th.col-status, .table-view td.col-status {
        min-width: 100px;
        max-width: 200px;
        width: 150px;
    }
    
    .status-note {
        min-height: 35px;
        max-height: 100px;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .status-note-display {
        min-height: 35px;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .status-cell-container {
        gap: 6px;
    }
}

