/* Tailwind CSS 核心样式 */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.bg-gray-900 { background-color: #111827; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-600 { background-color: #4b5563; }
.bg-blue-600 { background-color: #2563eb; }
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-orange-400 { color: #fb923c; }
.border-gray-700 { border-color: #374151; }
.border-gray-600 { border-color: #4b5563; }
.border-b { border-bottom-width: 1px; }
.border-r { border-right-width: 1px; }
.border-t { border-top-width: 1px; }
.border { border-width: 1px; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pl-4 { padding-left: 1rem; }
.pl-12 { padding-left: 3rem; }
.pr-4 { padding-right: 1rem; }
.pt-28 { padding-top: 7rem; }
.w-full { width: 100%; }
.w-64 { width: 16rem; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-0\.5 > * + * { margin-top: 0.125rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-base { font-size: 1rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.max-w-7xl { max-width: 90rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-0 { top: 0; }
.top-16 { top: 4rem; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.hidden { display: none !important; }
.table { display: table; }
.table-row { display: table-row; }
.table-cell { display: table-cell; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.divide-y > * + * { border-top-width: 1px; border-top-color: #374151; }
.divide-y > * + * { border-top-style: solid; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }
.focus\:border-transparent:focus { border-color: transparent; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:text-white:hover { color: #ffffff; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.placeholder-gray-400::placeholder { color: #9ca3af; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.max-h-96 { max-height: 24rem; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }

/* Font Awesome 图标样式 */
.fas { font-family: "Font Awesome 5 Free"; font-weight: 900; }
.fa-eye:before { content: "\f06e"; }
.fa-chart-line:before { content: "\f201"; }
.fa-crown:before { content: "\f521"; }
.fa-search:before { content: "\f002"; }
.fa-question:before { content: "\f128"; }
.fa-filter:before { content: "\f0b0"; }
.fa-chevron-down:before { content: "\f078"; }
.fa-chevron-up:before { content: "\f077"; }

/* 自定义样式 */
.sidebar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

/* 现代化卡片效果 */
.modern-card {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 1px solid #4b5563;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* 表格行悬停效果 */
.table-row-hover:hover {
    background: linear-gradient(90deg, #374151 0%, #4b5563 100%);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.sidebar {
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
}

/* 物品图片悬停提示框样式 */
.item-tooltip {
    position: fixed;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    pointer-events: none;
    max-width: 300px;
    max-height: 300px;
}

.item-tooltip img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    transform: scale(1.5); /* 放大50% */
}

.item-hover-area {
    position: relative;
    transition: all 0.2s ease;
}

.item-hover-area:hover {
    background-color: rgba(96, 165, 250, 0.1);
    border-radius: 4px;
}

.item-hover-area:hover .text-white {
    color: #60a5fa !important;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1f2937;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 侧边栏分类样式 */
.sidebar-category {
    cursor: pointer;
    padding: 4px 16px !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1px !important;
    position: relative;
    overflow: hidden;
}

.sidebar-category:hover {
    background: linear-gradient(90deg, #374151 0%, #4b5563 100%);
    transform: translateX(4px);
}

.sidebar-category.active {
    background: linear-gradient(90deg, #1e40af 0%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar-category.active .category-name {
    color: white;
    font-weight: 600;
}

/* 类别图标样式 - 固定宽度，确保对齐 */
.sidebar-category .category-icon {
    width: 20px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 类别数量样式 - 右对齐，个位对齐 */
.sidebar-category .item-count {
    margin-left: auto !important;
    text-align: right !important;
    width: 35px !important;
    display: inline-block;
    font-family: 'Courier New', Courier, monospace !important; /* 等宽字体，确保个位对齐 */
    font-variant-numeric: tabular-nums !important; /* 使用表格数字，确保对齐 */
}

.category-header {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 16px !important;
    margin-top: 12px !important;
    margin-bottom: 4px !important;
    background: linear-gradient(90deg, #374151 0%, transparent 100%);
    border-left: 3px solid #3b82f6;
}

/* 类别分隔条样式 */
.category-divider {
    height: 4px !important;
    margin: 16px 16px 12px 16px !important;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.6) 0%, 
        rgba(139, 92, 246, 0.7) 25%,
        rgba(236, 72, 153, 0.7) 50%,
        rgba(139, 92, 246, 0.7) 75%,
        rgba(59, 130, 246, 0.6) 100%) !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4) !important;
    display: block !important;
    width: calc(100% - 32px) !important;
}

/* 全部暗金按钮样式 */
.sidebar-category.unique-all-button {
    background: linear-gradient(90deg, rgba(55, 65, 81, 0.5) 0%, rgba(75, 85, 99, 0.5) 100%) !important;
    font-size: 14px !important;
    padding: 4px 16px !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
    border-left: 2px solid rgba(139, 92, 246, 0.5) !important;
    box-shadow: none !important;
}

.sidebar-category.unique-all-button .category-name {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #d1d5db !important;
}

.sidebar-category.unique-all-button:hover {
    background: linear-gradient(90deg, rgba(75, 85, 99, 0.7) 0%, rgba(107, 114, 128, 0.7) 100%) !important;
    transform: translateX(4px) !important;
}

.sidebar-category.unique-all-button.active {
    background: linear-gradient(90deg, #1e40af 0%, #3b82f6 100%) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5) !important;
}
.search-result-item {
    transition: all 0.2s ease;
}
.search-result-item:hover {
    background-color: #374151;
    transform: translateX(2px);
}
.search-result-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}
.search-result-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    border-bottom: none !important;
}

/* 锁定圣甲虫的边框样式 */
.locked-scarab-border {
    border: 2px solid #3b82f6; /* 蓝色边框 */
    border-radius: 8px; /* 轻微圆角 */
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); /* 蓝色发光效果 */
}

/* 页脚样式优化 */
#site-footer {
    background-color: #1f2937;
    border-top: 1px solid #374151;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* 确保footer内所有链接颜色正确 */
#site-footer a {
    color: inherit !important;
}

#footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    color: #9ca3af !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: #ffffff !important;
    background-color: #374151;
}

.footer-link:link,
.footer-link:visited {
    color: #9ca3af !important;
}

.footer-link-divider {
    margin: 0 0.375rem;
    color: #6b7280;
    font-weight: 300;
}

.footer-separator {
    color: #4b5563;
    margin: 0 0.5rem;
    font-weight: 300;
    user-select: none;
}

#icp-license-link {
    display: inline-block;
    color: #6b7280 !important;
    text-decoration: none !important;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

#icp-license-link:hover {
    color: #9ca3af !important;
    background-color: #374151;
}

#icp-license-link:link,
#icp-license-link:visited {
    color: #6b7280 !important;
}

/* 响应式设计 */
@media (max-width: 640px) {
    #footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-separator {
        display: none;
    }
    
    .footer-link {
        font-size: 0.8125rem;
    }
}

/* 移动端隐藏footer - 统一管理 */
@media (max-width: 768px) {
    footer#site-footer {
        display: none !important;
    }
}

/* PC端显示footer - 统一管理 */
@media (min-width: 769px) {
    footer#site-footer {
        display: block !important;
    }
}

/* ========== 统一导航栏响应式样式 ========== */
/* 移动端（max-width: 768px） */
@media (max-width: 768px) {
    /* 隐藏POE1/POE2/工具筛选按钮 */
    .game-filter-btn {
        display: none !important;
    }
    
    /* 显示汉堡菜单按钮 */
    #mobile-menu-toggle {
        display: block !important;
        background: #3b82f6;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 0.375rem;
        cursor: pointer;
        font-size: 1rem;
    }
    
    /* 导航链接默认隐藏 */
    .nav-link, 
    nav a[href]:not(#mobile-menu-toggle):not([href="/"]) {
        display: none !important;
    }
    
    /* 展开的导航菜单 */
    #mobile-nav-menu.mobile-nav-open {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        background: #1f2937 !important;
        border-bottom: 1px solid #374151 !important;
        padding: 1rem !important;
        gap: 0.5rem !important;
        z-index: 19 !important;
        max-height: calc(100vh - 64px) !important;
        overflow-y: auto !important;
    }
    
    /* 展开菜单时显示导航链接 */
    #mobile-nav-menu.mobile-nav-open .nav-link,
    #mobile-nav-menu.mobile-nav-open a[href]:not(#mobile-menu-toggle) {
        display: flex !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        border-radius: 0.375rem !important;
        background: #374151 !important;
        margin-bottom: 0.25rem !important;
    }
}

/* PC端（min-width: 769px） */
@media (min-width: 769px) {
    /* 隐藏汉堡菜单按钮（包括.hidden类和直接隐藏） */
    #mobile-menu-toggle,
    #mobile-menu-toggle.hidden {
        display: none !important;
    }
    
    /* PC端显示导航菜单容器 */
    #mobile-nav-menu {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    
    /* PC端显示所有导航链接 */
    #mobile-nav-menu .nav-link,
    #mobile-nav-menu a[href]:not(#mobile-menu-toggle):not(.hidden) {
        display: flex !important;
        width: auto !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    /* PC端隐藏hidden类的链接 */
    #mobile-nav-menu a.hidden,
    #mobile-nav-menu .nav-link.hidden {
        display: none !important;
    }
}

/* ========== 移动端表格标题栏优化 ========== */
@media (max-width: 768px) {
    /* 缩小表格标题栏高度 */
    table thead th,
    table th {
        padding-top: 0.25rem !important;  /* py-1 */
        padding-bottom: 0.25rem !important;  /* py-1 */
        font-size: 0.625rem !important;  /* text-xs 缩小 */
        line-height: 1.2 !important;
    }
    
    /* 表格标题栏文字可以换行，但尽量单行显示 */
    table thead th span,
    table th span {
        display: inline-block;
        max-width: 100%;
        word-break: break-word;
        white-space: normal;
        line-height: 1.2;
    }
    
    /* 表格标题栏图标缩小 */
    table thead th i,
    table th i {
        font-size: 0.5rem !important;
        margin-left: 0.125rem !important;
    }
    
    /* 表格单元格内容也缩小 */
    table tbody td {
        padding-top: 0.375rem !important;
        padding-bottom: 0.375rem !important;
        font-size: 0.75rem !important;
    }
    
    /* 可收起的表格标题栏（默认收起，点击展开） */
    .table-header-collapsible {
        position: relative;
    }
    
    .table-header-collapsible thead {
        position: sticky;
        top: 64px;  /* 导航栏高度 */
        z-index: 10;
        background: #1f2937;
    }
    
    /* 添加收起/展开按钮 */
    .table-header-toggle {
        position: sticky;
        top: 64px;
        left: 0;
        right: 0;
        z-index: 11;
        background: #2563eb;
        color: white;
        padding: 0.25rem 0.5rem;
        text-align: center;
        font-size: 0.75rem;
        cursor: pointer;
        border-bottom: 1px solid #374151;
    }
    
    /* 收起状态：隐藏表头 */
    .table-header-collapsed thead {
        display: none;
    }
    
    /* 收起按钮文字 */
    .table-header-toggle::before {
        content: "展开表头";
    }
    
    .table-header-collapsed .table-header-toggle::before {
        content: "收起表头";
    }
}
