/* ==========================================================================
   前台首页 / 分类页样式（仿 xunsoso.com 视觉风格）
   依赖 theme.css 中的主题变量
   ========================================================================== */

/* --------------------------------------------------------------------------
   基础与共享
   -------------------------------------------------------------------------- */
.search-page-wrapper {
    padding-top: 16px;
}

.search-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-container {
    max-width: 1048px;
    margin: 0 auto;
    padding: 16px 16px 24px;
}

.initial-prompt-area {
    padding: 40px 0;
}

.initial-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--theme-card-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-primary);
    font-size: 28px;
}

.initial-prompt-area h3 {
    color: var(--theme-text-secondary) !important;
    font-size: 1rem;
    font-weight: 500;
}

/* 兼容分类详情页顶部的搜索栏 */
.search-hero {
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-hero-image {
    max-width: 100%;
    border-radius: 16px;
}

.search-area {
    width: 100%;
}

.input-group-custom {
    display: flex;
    align-items: center;
    background: var(--theme-surface);
    border-radius: 12px;
    border: 2px solid var(--theme-border);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.input-group-custom:focus-within {
    border-color: var(--theme-primary);
}

.input-group-custom .form-control {
    flex: 1;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--theme-text);
    outline: none;
    padding: 0 16px;
}

.input-group-custom .btn {
    height: 40px;
    margin: 4px;
    padding: 0 20px;
    border: none;
    border-radius: 9px;
    background: var(--theme-primary-gradient);
    color: #fff;
}

/* --------------------------------------------------------------------------
   公告条
   -------------------------------------------------------------------------- */
.notice-bar {
    background: var(--theme-primary-gradient);
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 0 18px;
    box-shadow: 0 4px 16px var(--theme-primary-shadow);
    position: relative;
    overflow: hidden;
}

.notice-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.notice-bar-inner {
    display: flex;
    align-items: center;
    height: 44px;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.notice-icon {
    flex-shrink: 0;
    color: #fff;
    display: flex;
    align-items: center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    animation: notice-bell 3s ease-in-out infinite;
}

@keyframes notice-bell {
    0%, 80%, 100% { transform: rotate(0); }
    6% { transform: rotate(14deg); }
    12% { transform: rotate(-12deg); }
    18% { transform: rotate(9deg); }
    24% { transform: rotate(-6deg); }
    30% { transform: rotate(0); }
}

.notice-swiper {
    flex: 1;
    overflow: hidden;
}

.notice-item {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 公告滚动（内容超长时由 JS 追加 .is-scrolling 无缝横向滚动） */
.notice-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
}

.notice-track .notice-item {
    overflow: visible;
    text-overflow: clip;
}

.notice-track.is-scrolling {
    animation: notice-scroll var(--notice-duration, 16s) linear infinite;
}

.notice-track.is-scrolling .notice-item {
    padding-right: 80px;
}

.notice-swiper:hover .notice-track.is-scrolling {
    animation-play-state: paused;
}

@keyframes notice-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   主体布局：左搜索 + 右信息卡
   -------------------------------------------------------------------------- */
.home-main {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: stretch;
}

.search-section {
    flex: 1;
    min-width: 0;
    background: var(--theme-surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-header {
    margin-bottom: 16px;
}

.search-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--theme-text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-title .highlight {
    background: var(--theme-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.search-subtitle {
    font-size: 13px;
    color: var(--theme-text-secondary);
    line-height: 1.5;
}

.search-box-wrapper {
    margin-bottom: 14px;
    position: relative;
}

.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.search-suggest.is-open {
    display: block;
}

.search-suggest__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--theme-text);
    transition: background 0.15s ease;
}

.search-suggest__item:hover,
.search-suggest__item.is-active {
    background: color-mix(in srgb, var(--theme-primary) 10%, transparent);
}

.search-suggest__icon {
    flex: none;
    color: var(--theme-text-secondary);
    font-size: 12px;
}

.search-suggest__text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-suggest__text mark {
    color: var(--theme-primary);
    background: transparent;
    font-weight: 600;
}

.search-input-box {
    display: flex;
    align-items: center;
    background: var(--theme-background);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    overflow: hidden;
}

.search-input-box:focus-within {
    border-color: var(--theme-primary);
    background: var(--theme-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 12%, transparent);
}

.search-icon {
    width: 44px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text-secondary);
    font-size: 16px;
}

.search-input-box input {
    flex: 1;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--theme-text);
    outline: none;
    min-width: 0;
}

.search-input-box input::placeholder {
    color: var(--theme-text-secondary);
}

.search-btn {
    height: 40px;
    padding: 0 22px;
    margin: 4px;
    background: var(--theme-primary-gradient);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--theme-primary-shadow);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.search-btn.searching i {
    animation: search-spin 1s linear infinite;
}

@keyframes search-spin {
    to { transform: rotate(360deg); }
}

.hot-keywords {
    margin-top: 12px;
}

.hot-keywords-label {
    font-size: 12px;
    color: var(--theme-text-secondary);
    margin-bottom: 8px;
}

.hot-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hot-keyword {
    padding: 5px 12px;
    background: var(--theme-background);
    border-radius: 16px;
    font-size: 12px;
    color: var(--theme-text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    border: 1px solid transparent;
}

.hot-keyword:hover {
    background: color-mix(in srgb, var(--theme-primary) 12%, transparent);
    color: var(--theme-primary);
    border-color: color-mix(in srgb, var(--theme-primary) 30%, transparent);
}

.search-tips {
    margin-top: 14px;
    font-size: 11px;
    color: var(--theme-text-secondary);
    line-height: 1.5;
}

/* 右侧信息卡 */
.info-section {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    background: var(--theme-surface);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.info-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text);
}

.stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 11px;
    color: var(--theme-text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-text);
}

.welfare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.welfare-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 4px;
    border-radius: 8px;
    background: var(--theme-background);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    text-decoration: none;
}

.welfare-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.welfare-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-primary-gradient);
    color: #fff;
    font-size: 15px;
}

.welfare-name {
    font-size: 12px;
    color: var(--theme-text);
    text-align: center;
    line-height: 1.3;
}

.resource-missing {
    background: var(--theme-background);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.resource-missing-icon {
    width: 40px;
    height: 40px;
    background: var(--theme-primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #fff;
    font-size: 16px;
}

.resource-missing-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text);
    margin-bottom: 4px;
}

.resource-missing-desc {
    font-size: 11px;
    color: var(--theme-text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.resource-missing-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.resource-btn {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.resource-btn-primary {
    background: var(--theme-primary-gradient);
    color: #fff;
}

.resource-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--theme-primary-shadow);
}

.resource-btn-secondary {
    background: var(--theme-surface);
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
}

.resource-btn-secondary:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

/* --------------------------------------------------------------------------
   热门分类
   -------------------------------------------------------------------------- */
.category-section {
    background: var(--theme-surface);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-container {
    width: 100%;
}

.category-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.category-title i {
    color: var(--theme-primary);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tab {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--theme-border);
    background: var(--theme-background);
    color: var(--theme-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.category-tab:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.category-tab.active {
    background: var(--theme-primary-gradient);
    color: #fff;
    border-color: transparent;
    font-weight: 500;
}

.category-empty {
    text-align: center;
    padding: 30px;
    color: var(--theme-text-secondary);
}

.category-empty i {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
}

.category-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.category-resource-card {
    background: var(--theme-background);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.category-resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.category-resource-image {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--theme-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-resource-image .placeholder-icon {
    font-size: 28px;
    color: var(--theme-text-secondary);
}

.category-resource-card:hover .category-resource-image img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.external-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--theme-primary-gradient);
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
}

.category-resource-info {
    padding: 8px 10px;
}

.category-resource-title {
    font-size: 13px;
    color: var(--theme-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-score,
.ranking {
    font-size: 11px;
    color: var(--theme-text-secondary);
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   搜索结果区
   -------------------------------------------------------------------------- */
.search-shell {
    margin-top: 16px;
}

.results-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

#netdisk-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: var(--theme-surface);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-btn {
    padding: 5px 14px;
    font-size: 13px;
    border: none;
    background: transparent;
    color: var(--theme-text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.filter-btn:hover {
    color: var(--theme-primary);
}

.filter-btn.active {
    background: var(--theme-primary-gradient);
    color: #fff;
    font-weight: 600;
}

.filter-and-count-container {
    background: var(--theme-surface);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.result-count {
    font-size: 13px;
    color: var(--theme-text-secondary);
}

.filter-toggle-button {
    font-size: 12px;
}

.advanced-filter-panel {
    margin-top: 10px;
    padding: 12px;
    background: var(--theme-background);
    border-radius: 10px;
}

#advanced-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.advanced-filter-group {
    display: inline-flex;
    align-items: center;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    overflow: hidden;
}

.advanced-filter-label {
    background: transparent;
    border: none;
    color: var(--theme-text-secondary);
    font-size: 12px;
    padding: 0 8px;
}

.advanced-filter-input {
    border: none;
    background: transparent;
    color: var(--theme-text);
    font-size: 12px;
    height: 32px;
    outline: none;
    min-width: 140px;
}

.advanced-filter-apply {
    font-size: 12px;
}

#scrollableResults {
    max-height: 72vh;
    overflow-y: auto;
    padding-right: 4px;
}

#scrollableResults::-webkit-scrollbar {
    width: 6px;
}

#scrollableResults::-webkit-scrollbar-thumb {
    background: var(--theme-border);
    border-radius: 3px;
}

/* 结果卡片 */
.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border-color: color-mix(in srgb, var(--theme-primary) 40%, var(--theme-border));
}

.result-item.saved-result {
    border-left: 3px solid var(--theme-primary);
}

.result-item.hot-result {
    border-left: 3px solid #f59e0b;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    display: block;
    font-size: 14px;
    color: var(--theme-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-item.saved-result .result-title {
    font-weight: 600;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.priority-badge {
    font-size: 11px;
    color: var(--theme-primary);
    background: color-mix(in srgb, var(--theme-primary) 12%, transparent);
    padding: 2px 8px;
    border-radius: 10px;
}

.result-divider {
    display: none;
}

.netdisk-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.text-white {
    color: #fff;
}

.bg-secondary { background: #94a3b8; }
.bg-mid-blue { background: #3b82f6; }
.bg-terracotta { background: #e07a5f; }
.bg-navy-blue { background: #1e3a8a; }
.bg-coral { background: #ff7f50; }
.bg-orange { background: #f59e0b; }
.bg-teal { background: #14b8a6; }
.bg-warm-gold { background: #eab308; }
.bg-light-green { background: #22c55e; }
.bg-deep-violet { background: #7c3aed; }
.bg-purple { background: #9333ea; }
.bg-dark-mint { background: #0d9488; }
.bg-olive { background: #65a30d; }
.bg-salmon { background: #fa8072; }
.bg-grape { background: #8b5cf6; }
.bg-rose { background: #f43f5e; }
.bg-slate-blue { background: #64748b; }
.bg-dark { background: #334155; }

.resource-get-btn {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: var(--theme-primary-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.resource-get-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--theme-primary-shadow);
}

.resource-get-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   资源详情弹窗
   -------------------------------------------------------------------------- */
.resource-detail-modal {
    background: var(--theme-surface);
    color: var(--theme-text);
    border: none;
    border-radius: 14px;
    overflow: hidden;
}

.resource-detail-modal .modal-header {
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-surface);
}

.resource-detail-modal .modal-header .modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
}

.resource-detail-modal .modal-header i {
    color: var(--theme-primary);
}

.resource-detail-modal .modal-header .btn-close {
    filter: none;
    opacity: 0.6;
}

.resource-detail-modal .modal-body {
    background: var(--theme-surface);
}

.resource-detail-grid {
    display: flex;
    gap: 20px;
}

.resource-info-section {
    flex: 1;
    min-width: 0;
}

.field-label {
    display: block;
    font-size: 12px;
    color: var(--theme-text-secondary);
    margin-bottom: 4px;
}

.resource-detail-modal .field-value {
    font-size: 14px;
    color: var(--theme-text);
    word-break: break-all;
}

.resource-detail-modal .field-value.resource-name {
    font-weight: 600;
}

.link-container {
    display: flex;
    align-items: center;
}

.link-container .form-control {
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    color: var(--theme-text);
}

.link-container .btn-outline-primary {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.link-container .btn-outline-primary:hover {
    background: var(--theme-primary);
    color: #fff;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons .btn-primary {
    background: var(--theme-primary-gradient);
    border: none;
}

.action-buttons .btn-success {
    background: #22c55e;
    border: none;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .home-container {
        padding: 12px 14px 20px;
    }

    .home-main {
        flex-direction: column;
    }

    .info-section {
        display: none;
    }

    .search-section {
        padding: 18px;
    }

    .search-title {
        font-size: 20px;
    }

    .search-btn {
        padding: 0 16px;
    }

    .category-section {
        padding: 16px;
    }

    .category-resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .resource-detail-grid {
        flex-direction: column;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* 流式搜索结果逐条淡入，避免整块重绘时的闪动 */
.search-result-item.result-enter {
    animation: resultItemEnter 0.24s ease-out both;
}

@keyframes resultItemEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .search-result-item.result-enter {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   关键词 SEO 落地页
   -------------------------------------------------------------------------- */
.keyword-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--theme-text-secondary);
    margin: 12px 0 0;
}

.keyword-breadcrumb a {
    color: var(--theme-primary);
    text-decoration: none;
}

.keyword-breadcrumb-sep {
    opacity: 0.6;
}

.keyword-related {
    margin: 24px 0 8px;
    padding: 16px;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
}

.keyword-related-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text);
}

.keyword-related-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-related-link {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--theme-text-secondary);
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    text-decoration: none;
}

.keyword-related-link:hover {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

/* ===== 分享目录树（获取资源弹窗） ===== */
.tree-view {
    background: #fafbfc;
    border: 1px solid #eceef2;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    overscroll-behavior: contain;
}

.tree-view::-webkit-scrollbar {
    width: 8px;
}

.tree-view::-webkit-scrollbar-track {
    background: transparent;
}

.tree-view::-webkit-scrollbar-thumb {
    background: #d5dae3;
    border-radius: 4px;
}

.tree-view::-webkit-scrollbar-thumb:hover {
    background: #bcc4d0;
}

.tree-root {
    min-width: 0;
}

.tree-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 5px;
    line-height: 1.5;
    cursor: default;
    user-select: none;
    min-width: 0;
}

.tree-node.is-folder > .tree-node-row {
    cursor: pointer;
}

.tree-node-row:hover {
    background: rgba(78, 110, 242, 0.08);
}

.tree-node-toggle {
    width: 14px;
    display: inline-flex;
    justify-content: center;
    color: #9aa4b2;
    font-size: 10px;
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}

.tree-node-icon {
    width: 16px;
    text-align: center;
    color: #8a94a6;
    flex: 0 0 auto;
}

.tree-node.is-folder > .tree-node-row .tree-node-icon {
    color: #f0a020;
}

.tree-node-name {
    color: #2b2f38;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.tree-node-size {
    margin-left: 8px;
    color: #9aa4b2;
    font-size: 12px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.tree-node-children {
    margin-left: 15px;
    border-left: 1px dashed #d9dde5;
    padding-left: 8px;
}

.tree-node.collapsed > .tree-node-children {
    display: none;
}

.tree-node.collapsed > .tree-node-row .tree-node-toggle {
    transform: rotate(-90deg);
}

/* ==================== 收藏按钮 / 资源详情页 / 收藏页 ==================== */
.search-result-btn.favorite {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.search-result-btn.favorite.is-saved {
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.resource-breadcrumb {
    margin: 12px 0;
    color: #8b95a5;
    font-size: 13px;
}

.resource-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.resource-breadcrumb span {
    margin: 0 6px;
}

.resource-detail-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e8ebf0);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.resource-detail-title {
    font-size: 22px;
    line-height: 1.4;
    margin: 0 0 14px;
    word-break: break-all;
}

.resource-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    color: #6b7280;
    font-size: 13px;
}

.resource-detail-remarks {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.resource-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.resource-detail-link {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.resource-detail-link-label {
    color: #6b7280;
    font-size: 13px;
}

.resource-detail-link-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e8ebf0);
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
}

.resource-related-title {
    font-size: 17px;
    margin: 0 0 12px;
}

.resource-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.resource-related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e8ebf0);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
}

.resource-related-item:hover {
    border-color: #f59e0b;
}

.resource-related-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-related-cloud {
    flex-shrink: 0;
    color: #8b95a5;
    font-size: 12px;
}

.favorites-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favorite-item {
    cursor: default;
}

/* 临时分享过期提醒（动态转存弹窗内常驻展示） */
.temp-share-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 4px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #ad6800;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
    text-align: left;
}

.temp-share-notice::before {
    content: "\f071";
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'FontAwesome';
    font-weight: 900;
    flex: 0 0 auto;
    margin-top: 2px;
}
