@charset "UTF-8";

/* =======================
   全局基础样式
   ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0px;
}

.container {
    width: 100%;
    max-width: 1600px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 5px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #e74c3c, #3498db);
}

/* =======================
   顶部导航区
   ======================= */
.nav_top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    flex-wrap: wrap;
}

.nav_left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav_left .logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

.nav_left .title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: 2px;
}

.nav_right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scan-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 14px;
    color: #fff;
    background: #4caf50;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.scan-link:hover {
    background: #128717;
    color: #fff;
}

.action-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s, opacity 0.3s;
}

.action-button.export {
    background: #4caf50;
    color: #fff;
}

.action-button.export:hover {
    background: #128717;
}

.action-button.update {
    background: #007bff;
    color: #fff;
}

.action-button.update:hover {
    background: #0056b3;
}

/* =======================
   Tabs 样式
   ======================= */
.tabs {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 60;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tabs.hidden {
    transform: translateY(-100%);
    top: -180px;
    opacity: 0;
}

.tab-buttons {
    display: flex;
    gap: 2px;
    padding: 10px 10px 0;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
}

.tab-button {
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f8f8f8;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.tab-button:hover {
    background: #fff;
}

.tab-button.active {
    background: #fff;
    border-bottom: 2px solid #4CAF50;
    font-weight: bold;
}

.tab-content {
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
}

/* =======================
   表格容器和滚动条
   ======================= */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    max-height: 70vh;
    position: relative;
    
    /* Firefox 滚动条 */
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f1f1f1;
}

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

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

.table-container::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* =======================
   表格基础样式
   ======================= */
.result-table {
    width: 180%;
    min-width: 1600px;
    border-collapse: collapse;
    table-layout: fixed;
}

.result-table th,
.result-table td {
    border: 1px solid #ccc;
    padding: 5px 12px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 100px;
    max-width: 300px;
}

.result-table th {
    background-color: #f8f8f8;
    position: relative;
    font-weight: bold;
    z-index: 50;
}

/* 表头固定 */
#resizableTable thead tr {
    position: sticky;
    top: 0px;
    background: #fff;
    z-index: 70;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* =======================
   表格列宽设置
   ======================= */
.result-table th[data-column="seq"]   { width: 50px; }
.result-table th[data-column="jan"]   { width: 148px; }
.result-table th[data-column="name"]  { width: 200px; }
.result-table th[data-column="photo"] { width: 110px; }

/* =======================
   固定列样式
   ======================= */
.result-table th[data-column="seq"],
.result-table td[data-column="seq"] {
    width: 50px;
    position: sticky;
    left: 0;
    z-index: 60;
    background: #fff;
}

.result-table th[data-column="jan"],
.result-table td[data-column="jan"] {
    width: 150px;
    position: sticky;
    left: 50px;
    background: #fff;
    z-index: 60;
    box-shadow: 3px 0 5px -2px rgba(0,0,0,0.2);
    text-align: center;
}

/* JAN 列链接和图片样式 */
.result-table td[data-column="jan"] a {
    text-decoration: none;
    color: inherit;
}

.result-table td[data-column="jan"] img {
    width: 148px;
    height: 50px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 其他列设置 */
.result-table th[data-column="photo"],
.result-table td[data-column="photo"] {
    width: 140px;
}

.result-table th[data-column="product_description"],
.result-table td[data-column="product_description"] {
    width: 140px;
    overflow-y: auto;
}

/* =======================
   表格内容样式
   ======================= */
.result-table td .description {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
    max-height: 120px;
    overflow-y: auto;
}

.result-table td img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.name_jp {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-width: 200px;
}

/* 特殊行样式 */
.result-table tr.not-found { background-color: #fff3f3; }
.result-table tr:hover { background-color: #f5f5f5; }

/* =======================
   可调整列宽功能
   ======================= */
.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    cursor: col-resize;
    z-index: 40;
    transition: background-color 0.2s;
}

.resize-handle:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.resize-line {
    position: fixed;
    top: 0;
    width: 1px;
    height: 100vh;
    background-color: #0066ff;
    z-index: 100;
    display: none;
    pointer-events: none;
}

/* =======================
   搜索表单
   ======================= */
.search-form {
    margin: 20px 0;
    z-index: 101;
}

.search-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.search-form button {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.2);
}

.search-form button:hover {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
}

/* =======================
   复选框网格
   ======================= */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 15px;
}

.checkbox-grid.active {
    display: block;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

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

/* =======================
   选择按钮
   ======================= */
.select-buttons {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    margin-bottom: 5px;
}

.select-buttons button {
    padding: 6px 12px;
    margin-right: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.select-buttons button:hover { 
    background: #f0f0f0; 
}

/* =======================
   分类样式
   ======================= */
.category {
    margin-bottom: 10px;
}

.category h3 {
    margin: 10px 0 5px 0;
}

/* =======================
   导出选项
   ======================= */
.export-options {
    padding: 10px;
}

.export-type-selector {
    margin-top: 15px;
}

.export-type-selector select {
    width: 100%;
    max-width: 600px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* =======================
   操作按钮区域
   ======================= */
.tab-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 5px;
    border-top: 1px solid #ddd;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.action-button:hover { 
    opacity: 0.9; 
}

/* =======================
   分页样式
   ======================= */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 20px 0;
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    border: 1px solid #ddd;
    transition: all 0.3s;
    font-size: 14px;
}

.pagination .current {
    background-color: #4CAF50;
    color: #fff;
    font-weight: bold;
    border-color: #4CAF50;
}

.pagination .disabled {
    color: #aaa;
    border-color: #eee;
    cursor: not-allowed;
}

.pagination a:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

/* =======================
   响应式设计
   ======================= */
@media (max-width: 768px) {
    .nav_left .title {
        display: none;
    }

    .tabs {
        position: fixed;
        top: -180px;
        width: 100%;
        opacity: 1 !important;
    }

    #resizableTable thead tr {
        top: 0;
    }

    .checkbox-grid {
        display: none;
    }

    .checkbox-grid.active {
        display: grid;
    }

    .filter-toggle {
        display: inline-block;
        padding: 6px 12px;
        font-size: 14px;
        background: #007bff;
        color: #fff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* 隐藏小屏幕的 case_size 列 */
    .result-table th[data-column^="case_size"],
    .result-table td[data-column^="case_size"] {
        display: none;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 4px;
        font-size: 12px;
    }
    
    .pagination a,
    .pagination span {
        padding: 4px 8px;
    }
}