/**
 * catalog-detail.css —— 行业收藏目录详情页
 */

/* 统一容器宽度 1360px，水平居中 */
.detail-breadcrumb .container,
.detail-header .container,
.detail-categories.container,
.detail-container.container,
.search-container.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 面包屑 */
.detail-breadcrumb {
    background: #f7faf7;
    border-bottom: 1px solid #e8e8e8;
    padding: 12px 0;
}
.detail-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}
.detail-breadcrumb a { color: #0564F5; text-decoration: none; }
.detail-breadcrumb a:hover { text-decoration: underline; }
.detail-breadcrumb .sep { color: #ccc; }
.detail-breadcrumb .current { color: #1a1a1a; font-weight: 500; }

/* 页面标题 */
.detail-header {
    background: linear-gradient(135deg, #eaf7ec 0%, #ffffff 60%);
    padding: 30px 0 10px;
}
.detail-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}
.detail-desc {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px;
}
.detail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

/* 搜索框 */
.search-bar {
    display: flex;
    width: 320px;
}
.search-bar #search-input {
    flex: 1;
    padding: 7px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 3px 0 0 3px;
    outline: none;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
}
.search-bar #search-input:focus { border-color: #0564F5; }
.search-bar #search-button {
    background: #0564F5;
    color: #fff;
    border: none;
    padding: 0 16px;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
}
.search-bar #search-button:hover { background: #39863c; }

/* 一级分类按钮 */
.category-btn {
    padding: 6px 16px;
    border: 1px solid #e4e4e4;
    border-radius: 3px;
    background: #fff;
    color: #444;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
    box-sizing: border-box;
}
.category-btn:hover { background-color: #f5faf5; color: #2d6a30; border-color: #9ccc9c; }
.category-btn.active { background-color: #0564F5; color: #fff; border-color: #0564F5; }

/* 行业切换区域 */
.detail-categories {
    margin-top: 10px;
    margin-bottom: 20px;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
}
.detail-categories.flex {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: none;
}
.detail-categories.flex .category-title {
    flex-shrink: 0;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 20px;
}
.detail-categories .categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* 详情主内容 */
.detail-container { padding-top: 10px; }
.detail-content {
    background: #fff;
    border-radius: 6px;
    box-shadow: none;
    padding: 20px 24px;
    margin-bottom: 22px;
}

/* 筛选条 */
.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.filter-group:last-of-type {
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}
.filter-group .filter-label {
    flex-shrink: 0;
    font-size: 13px;
    color: #555;
    font-weight: 500;
    line-height: 28px;
    margin-right: 0;
    min-width: 74px;
}
.filter-group .filter-links {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-link {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    color: #555;
     border-radius: 14px;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
    line-height: 1.6;
}
.filter-link:hover { background: #e8f5e9; color: #2d6a30; }
.filter-link.active {
    background: #0564F5;
    color: #fff;
    border-color: #0564F5;
}

/* 可折叠筛选组 */
.filter-collapsible {
    position: relative;
    padding-right: 72px; /* 右侧给展开按钮留位 */
}
.filter-collapsible .filter-links {
    position: relative;
    transition: max-height 0.25s ease;
}
/* 默认折叠：两行高度（约 52px），多出隐藏 */
.filter-links-collapsed {
    max-height: 68px;
    overflow: hidden;
}
/* 展开：最多约 120px（约 3 行），超出滚动 */
.filter-links-expanded {
    max-height: 120px;
    overflow-y: auto;
}
/* 展开按钮 */
.filter-toggle {
    position: absolute;
    right: 4px;
    top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 10px;
    font-size: 12px;
    color: #0564F5;
    background: transparent;
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
    font-family: inherit;
    z-index: 2;
}
.filter-toggle:hover {
    background: #e8f5e9;
    border-color: #0564F5;
}
.filter-toggle .ico {
    width: 12px;
    height: 12px;
    color: #0564F5;
    transition: transform 0.25s;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #e0e0e0;
    color: #888;
    line-height: 1.7;
}
.empty-state .empty-hint {
    font-size: 13px;
    color: #aaa;
}

/* ============================================================
   表格上方工具条：左=tag checkbox   右=排序标签
   ============================================================ */
.table-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 2px;
    margin-bottom: 4px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

/* tag checkbox */
.tag-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}
/* 搜索框靠右对齐 */
.table-top-bar .search-bar {
    margin-left: auto;
    flex-shrink: 0;
}
.tag-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.tag-checkbox-item .tag-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.tag-checkbox-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1.5px solid #bbb;
    border-radius: 3px;
    background: #fff;
    transition: all 0.15s;
    position: relative;
    flex-shrink: 0;
}
.tag-checkbox-item .tag-checkbox:checked + .tag-checkbox-box {
    background: #0564F5;
    border-color: #0564F5;
}
.tag-checkbox-item .tag-checkbox:checked + .tag-checkbox-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.tag-checkbox-item:hover .tag-checkbox-box {
    border-color: #0564F5;
}
.tag-checkbox-label {
    font-size: 13px;
    color: #555;
    line-height: 1;
}

/* 排序条 */
.sort-bar-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sort-label {
    font-size: 13px;
    color: #555;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 4px;
}
.sort-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sort-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    font-size: 13px;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #e4e4e4;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.6;
}
.sort-tab:hover {
    background: #e8f5e9;
    color: #2d6a30;
    border-color: #9ccc9c;
}
.sort-tab.active {
    background: #0564F5;
    color: #fff;
    border-color: #0564F5;
}

/* ============================================================
   网站列表表格
   ============================================================ */
.sites-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    font-size: 14px;
    overflow: hidden;
}
.sites-table thead th {
    background: #f7faf7;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid #0564F5;
    border-right: 1px solid #e0e0e0;
    font-size: 13px;
}
.sites-table thead th:last-child { border-right: none; }
.sites-table tbody tr {
    transition: background 0.15s;
}
.sites-table tbody tr:last-child { border-bottom: none; }
.sites-table tbody tr:hover { background: #fafcfa; }
.sites-table tbody tr.is-bookmarked { background: #f8f8f0; }
.sites-table tbody tr.is-bookmarked:hover { background: #f5f5e6; }
.sites-table tbody td {
    padding: 12px 14px;
    color: #444;
    vertical-align: middle;
    border-right: 1px solid #f0f0f0;
}
.sites-table tbody td:last-child { border-right: none; }

/* 列宽 */
.col-idx    { width: 56px;  text-align: center; color: #999; font-variant-numeric: tabular-nums; }
.col-name   { width: 24%; }
.col-likes  { width: 90px;  text-align: center; font-variant-numeric: tabular-nums; }
.col-bookmarks { width: 90px;  text-align: center; font-variant-numeric: tabular-nums; }
.col-url    { width: auto; }
.col-action { width: 200px; text-align: center; }

/* 表头排序可点击 */
.sites-table thead th.sortable-th {
    cursor: pointer;
    user-select: none;
}
.sites-table thead th.sortable-th .th-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}
.sites-table thead th.sortable-th .th-sort-link:hover {
    color: #2d6a30;
}
.sites-table thead th.sortable-th .th-sort-link.active {
    color: #2d6a30;
}
.sites-table thead th.sortable-th .th-arrow {
    display: inline-flex;
    align-items: center;
}
.sites-table thead th.sortable-th .th-arrow .ico {
    width: 12px;
    height: 12px;
    color: #0564F5;
}
.sites-table thead th.sortable-th .th-sort-link:not(.active) .th-arrow {
    opacity: 0.35;
}
.sites-table thead th.sortable-th .th-sort-link:not(.active) .th-arrow::after {
    /* 默认显示双箭头（提示可排序） */
    content: '';
}

/* 点赞数 / 收藏数 单元格 */
.num-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #555;
    font-weight: 500;
}

/* ============================================================
   网站名 —— 加大加粗 + 放大镜图标
   ============================================================ */
.col-name .site-name-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #222;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s;
}
.col-name .site-name-link:hover { color: #2d6a30; text-decoration: none; }
.col-name .site-name-link:hover .site-name-icon { color: #2d6a30; }
.col-name .site-name-icon {
    display: inline-flex;
    color: #9e9e9e;
    transition: color 0.15s;
    flex-shrink: 0;
}
.col-name .site-name-icon .ico {
    width: 16px;
    height: 16px;
    display: block;
}
.col-name .site-name-text {
    line-height: 1.3;
}

/* 网址链接 */
.col-url a {
    color: #888;
    text-decoration: none;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}
.col-url a:hover { color: #0564F5; text-decoration: underline; }

/* 网站用途列 */
.col-purpose {
    width: 26%;
    color: #888;
    font-size: 13px;
}
.col-purpose .purpose-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}

/* 操作按钮容器：三按钮并排 */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

/* 通用 mini 按钮（纠错 / 置顶 / 收藏 共用） */
.correct-btn.mini,
.like-btn.mini,
.bm-btn.mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 8px;
    min-width: 48px;
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
    text-decoration: none;
    font-family: inherit;
    flex-shrink: 0;
}
.correct-btn.mini .ico,
.like-btn.mini .ico,
.bm-btn.mini .ico {
    width: 12px;
    height: 12px;
    color: #999;
    flex-shrink: 0;
}
.correct-btn.mini:hover { background: #ebebeb; color: #444; border-color: #d0d0d0; }
.correct-btn.mini:hover .ico { color: #666; }

.like-btn.mini:hover:not(:disabled) { background: #e8f5e9; color: #2d6a30; border-color: #a5d6a7; }
.like-btn.mini:hover:not(:disabled) .ico { color: #0564F5; }
.like-btn.mini.liked { background: #e8f5e9; color: #2d6a30; border-color: #0564F5; }
.like-btn.mini.liked .ico { color: #0564F5; }
.like-btn.mini:disabled { opacity: 0.5; cursor: not-allowed; }

.bm-btn.mini:hover { background: #fff8e1; color: #a0522d; border-color: #ffcc80; }
.bm-btn.mini:hover .ico { color: #e67e22; }
.bm-btn.mini.active { background: #fff3e0; color: #e65100; border-color: #ffb74d; }
.bm-btn.mini.active .ico { color: #e67e22; }

/* ============================================================
   图标徽章（HOT / 已认证 / 推荐）
   ============================================================ */
.site-badges {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.site-badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    line-height: 16px;
    vertical-align: middle;
}
.site-badge.hot {
    background: linear-gradient(135deg, #ff4d4f, #ff7a45);
    color: #fff;
    box-shadow: 0 1px 3px rgba(255,77,79,0.35);
}
.site-badge.verified {
    background: linear-gradient(135deg, #1890ff, #40a9ff);
    color: #fff;
}
.site-badge.recommend {
    background: linear-gradient(135deg, #0564F5, #66bb6a);
    color: #fff;
}

/* 奖牌徽章 */
.medal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 900;
    border-radius: 50%;
    line-height: 1;
    vertical-align: middle;
    margin-right: 4px;
    animation: medalPop 0.4s ease;
}
.medal-badge.gold {
    background: radial-gradient(circle at 30% 30%, #ffeb8a, #ff9800 70%, #d84315);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255,152,0,0.5);
}
.medal-badge.silver {
    background: radial-gradient(circle at 30% 30%, #f5f5f5, #9e9e9e 70%, #616161);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}
.medal-badge.bronze {
    background: radial-gradient(circle at 30% 30%, #ffb74d, #8d6e63 70%, #4e342e);
    color: #fff;
    box-shadow: 0 2px 5px rgba(141,110,99,0.5);
}
/* 简约大气奖牌：去背景，跟其他排名行一样的颜色 */
.medal-badge.medal-minimal {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 2px;
    margin-right: 6px;
    animation: none;
    font-size: 14px;
    font-weight: 500;
}
.medal-badge.medal-minimal.gold   { color: #888; }
.medal-badge.medal-minimal.silver { color: #888; }
.medal-badge.medal-minimal.bronze { color: #888; }
@keyframes medalPop {
    0% { transform: scale(0) rotate(-30deg); }
    70% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

/* 表格底部 */
.table-footer {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    text-align: right;
}

/* 错误提示 */
.detail-container .error {
    text-align: center;
    padding: 40px;
    background: #fdf2f2;
    border-radius: 8px;
    color: #e74c3c;
}
.detail-container .error a {
    color: #0564F5;
    text-decoration: underline;
}

/* 分页控件 */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 22px 10px 8px;
    flex-wrap: wrap;
}
.pagination-wrap .page-info {
    margin-right: 14px;
    color: #888;
    font-size: 13px;
}
.pagination-wrap .page-info b { color: #0564F5; font-weight: 600; }

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 11px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #555;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}
.pg-btn:hover:not(:disabled):not(.active) {
    border-color: #0564F5;
    color: #0564F5;
    background: #f0f9f2;
}
.pg-btn.active {
    background: #0564F5;
    color: #fff;
    border-color: #0564F5;
    cursor: default;
}
.pg-btn:disabled {
    color: #bbb;
    background: #f7f7f7;
    cursor: not-allowed;
    border-color: #eee;
}
.pg-btn.pg-nav { padding: 0 13px; }
.pg-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    color: #aaa;
    font-size: 14px;
}
.pg-size {
    margin-left: 12px;
    color: #888;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pg-size select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
}
.pg-size select:focus { border-color: #0564F5; }

/* 通用 SVG 图标类 */
.ico {
    display: block;
    width: 1em;
    height: 1em;
    line-height: 1;
    flex-shrink: 0;
}

/* 纠错弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.18s ease;
}
.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 440px;
    max-width: 92vw;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.22s ease;
    overflow: hidden;
}
.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-head .close-btn {
    border: none;
    background: transparent;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.modal-head .close-btn:hover { color: #333; }
.modal-body { padding: 18px 20px 6px; }
.modal-form .form-row { margin-bottom: 14px; }
.modal-form label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}
.modal-form .form-input,
.modal-form .form-textarea,
.modal-form .form-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s;
}
.modal-form .form-input:focus,
.modal-form .form-textarea:focus,
.modal-form .form-select:focus { border-color: #0564F5; }
.modal-form .form-textarea { resize: vertical; min-height: 70px; }
.modal-form .form-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 3px;
}
.modal-foot {
    padding: 12px 20px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-foot .btn {
    padding: 7px 20px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    transition: all 0.15s;
}
.modal-foot .btn:hover { border-color: #bbb; color: #333; }
.modal-foot .btn-primary {
    background: #0564F5;
    color: #fff;
    border-color: #0564F5;
}
.modal-foot .btn-primary:hover { background: #3d8b40; border-color: #3d8b40; }
.modal-success {
    text-align: center;
    padding: 30px 20px;
}
.modal-success .icon-ok {
    font-size: 44px;
    color: #0564F5;
    margin-bottom: 10px;
}
.modal-success p { color: #555; font-size: 14px; margin: 4px 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 移动端 */
@media (max-width: 768px) {
    .detail-header h1 { font-size: 22px; }
    .detail-top { flex-direction: column; align-items: stretch; }
    .detail-content { padding: 14px; }

    .sites-table thead { display: none; }
    .sites-table tbody tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .sites-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        border: none;
    }
    .sites-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #999;
        font-size: 12px;
        margin-right: 10px;
    }
    .col-idx, .col-name, .col-url, .col-action { width: auto; }
    .col-action { text-align: right; justify-content: flex-end; }

    .sort-bar { gap: 6px; }
    .sort-tabs { gap: 6px; }
    .sort-tab { padding: 4px 10px; font-size: 12px; }

    .col-name .site-name-link { font-size: 15px; }
}
