/* ================================
   分类列表页面样式 - categories.css
   ================================ */

/* 移除所有可点击元素的焦点轮廓线 */
a, a:focus, a:active, a:visited, a:hover,
.category-item, .category-item:focus, .category-item:active, .category-item:visited,
.category-icon, .category-icon:focus, .category-icon:active,
.section-icon, .section-icon:focus, .section-icon:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-focus-ring-color: transparent;
}

/* 确保SVG元素没有焦点轮廓 */
a svg, .category-item svg, .category-icon svg, .section-icon svg,
svg, svg:focus, svg:active {
    outline: none !important;
    pointer-events: none;
}

/* ---------- 顶部导航 ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--bg-card) 0%, #FEFCF9 100%);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    max-width: 680px;
    margin: 0 auto;
}

.back-btn {
    width: 40px;
    height: 40px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
    text-decoration: none;
    flex-shrink: 0;
}

.back-btn:hover {
    transform: translateX(-2px);
    box-shadow: var(--shadow-hover);
    background: var(--primary);
    border-color: var(--primary);
}

.back-btn:hover svg {
    fill: white;
}

.back-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill 0.2s;
}

.header-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---------- 主内容区 ---------- */
.main {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 10px;
    padding-bottom: 120px;
}

/* ---------- 快捷搜索 ---------- */
.quick-search {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 85, 46, 0.1);
}

.search-bar svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* ---------- 热门关键词 ---------- */
.hot-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.keyword-tag {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.keyword-tag:hover {
    background: rgba(255, 85, 46, 0.08);
    border-color: rgba(255, 85, 46, 0.3);
    color: var(--primary);
}

.keyword-tag.hot {
    background: rgba(255, 85, 46, 0.1);
    border-color: rgba(255, 85, 46, 0.3);
    color: var(--primary);
    font-weight: 500;
}

/* ---------- 分类区块 ---------- */
.category-section {
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.category-section:nth-child(1) { animation-delay: 0.05s; }
.category-section:nth-child(2) { animation-delay: 0.1s; }
.category-section:nth-child(3) { animation-delay: 0.15s; }
.category-section:nth-child(4) { animation-delay: 0.2s; }
.category-section:nth-child(5) { animation-delay: 0.25s; }

/* ---------- 分类标题 ---------- */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.section-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.section-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
    outline: none;
}

.section-icon.local { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.section-icon.job { background: linear-gradient(135deg, var(--info) 0%, #42A5F5 100%); }
.section-icon.trade { background: linear-gradient(135deg, var(--success) 0%, #66BB6A 100%); }
.section-icon.property { background: linear-gradient(135deg, var(--accent) 0%, #FFC107 100%); }
.section-icon.service { background: linear-gradient(135deg, var(--purple) 0%, #BA68C8 100%); }

.section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* ---------- 分类网格 ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* ---------- 分类卡片 ---------- */
.category-grid .category-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    text-align: center;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.category-grid .category-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 85, 46, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.category-grid .category-item:hover::before {
    opacity: 1;
}

.category-grid .category-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 85, 46, 0.2);
}

.category-grid .category-item:active {
    transform: scale(0.97);
}

.category-grid .category-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.category-grid .category-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
    outline: none;
}

/* 不同颜色的图标 */
.category-grid .category-icon.c-orange { background: linear-gradient(135deg, #FF8055 0%, #FFAB91 100%); }
.category-grid .category-icon.c-red { background: linear-gradient(135deg, #EF5350 0%, #EF9A9A 100%); }
.category-grid .category-icon.c-yellow { background: linear-gradient(135deg, #FFCA28 0%, #FFE082 100%); }
.category-grid .category-icon.c-green { background: linear-gradient(135deg, #66BB6A 0%, #A5D6A7 100%); }
.category-grid .category-icon.c-teal { background: linear-gradient(135deg, #26A69A 0%, #80CBC4 100%); }
.category-grid .category-icon.c-blue { background: linear-gradient(135deg, #42A5F5 0%, #90CAF9 100%); }
.category-grid .category-icon.c-indigo { background: linear-gradient(135deg, #5C6BC0 0%, #9FA8DA 100%); }
.category-grid .category-icon.c-purple { background: linear-gradient(135deg, #AB47BC 0%, #CE93D8 100%); }
.category-grid .category-icon.c-pink { background: linear-gradient(135deg, #EC407A 0%, #F48FB1 100%); }
.category-grid .category-icon.c-brown { background: linear-gradient(135deg, #8D6E63 0%, #BCAAA4 100%); }
.category-grid .category-icon.c-grey { background: linear-gradient(135deg, #78909C 0%, #B0BEC5 100%); }

.category-grid .category-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ---------- 热门/新标签 ---------- */
.hot-tag {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 5px;
    background: linear-gradient(135deg, #FF4757 0%, #FF6B81 100%);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    border-radius: 4px;
    animation: pulse 2s ease-in-out infinite;
}

.new-tag {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 5px;
    background: linear-gradient(135deg, var(--accent) 0%, #FFC107 100%);
    color: #8B6914;
    font-size: 0.55rem;
    font-weight: 700;
    border-radius: 4px;
}

/* ---------- 底部提示 ---------- */
.footer-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 20px;
    color: var(--text-muted);
    text-align: center;
}

.footer-tip svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    opacity: 0.5;
}

.footer-tip p {
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
