/* Irivi · static/app/search.css（REFACTOR_PLAN 3.1a 搜索页列表）
   对照 design/ui-2026-10-21/search/search.html；令牌、抽屉与压暗层来自 static/app/base.css。
   竖屏 = 手机版：@media (max-aspect-ratio:1/1)。 */

/* ===== 页面框架 ===== */
html body[data-page="search"] .page-header{display:none!important}
html body[data-page="search"]>main#discoverMain{max-width:1600px;margin:0 auto;padding:4px 32px 64px 52px!important}
html body .search-page{min-width:0}
html body .search-mobile-query{display:none}

/* ===== 顶栏搜索框（2026-10-28 §3：宽屏在渐变顶栏中间，白色实底胶囊高 44；框内“AI 找角色”= 浅灰胶囊 + 鸢尾紫光球，墨色字） ===== */
html body .search-query{position:relative;display:flex;align-items:center;gap:8px;width:100%;max-width:560px;height:44px;margin:0 auto;padding:0 6px 0 16px;border:0;border-radius:var(--r-pill);background:#fff;box-sizing:border-box}
html body .search-query-icon{width:18px;height:18px;flex:none;fill:none;stroke:var(--ink-3);stroke-width:1.9;stroke-linecap:round}
html body .search-query input{flex:1;min-width:0;height:100%;margin:0;padding:0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;color:var(--ink);font:inherit;font-size:14px}
html body .search-query input::placeholder{color:var(--ink-3)}
html body .search-query-ai{flex:none;display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 12px;border:0;border-radius:var(--r-pill);background:var(--soft);color:var(--ink);font:inherit;font-size:13px;font-weight:800;white-space:nowrap;cursor:pointer;transition:background-color var(--t-base) var(--ease-out)}
html body .search-query-ai::before{content:"";flex:none;width:12px;height:12px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff 0 12%,#C98EFF 40%,var(--iris) 75%)}
html body .search-query-ai:hover{background:#ECEAF0}
/* 2026-10-29 负责人：去掉“AI 找角色”入口；节点保留并隐藏（ai_search_assistant 脚本按 id 绑定） */
html body .search-query-ai[hidden],html body .search-query .search-query-ai[hidden]{display:none}
html body .discover-suggestions{position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:80;display:grid;gap:2px;max-height:min(360px,60vh);overflow:auto;padding:6px;border-radius:var(--r-md);background:#fff;box-shadow:var(--shadow-pop)}
html body .discover-suggestions[hidden]{display:none}
html body .search-suggestion{display:block;width:100%;padding:8px 12px;border:0;border-radius:var(--r-xs);background:transparent;color:var(--ink);font:inherit;font-size:14px;font-weight:600;text-align:left;cursor:pointer}
html body .search-suggestion:hover,html body .search-suggestion:focus-visible{background:var(--soft);outline:0}

/* ===== 结果头：左 标题 + 已选；右 排序滑块 + 省流量 ===== */
html body .search-head{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:18px 0 6px}
html body .search-title{display:flex;align-items:baseline;gap:8px;margin:0;font-size:22px;font-weight:900;white-space:nowrap;letter-spacing:0}
html body .search-title small{margin:0;font-size:13px;font-weight:600;color:var(--ink-3);font-variant-numeric:tabular-nums}
html body .search-chosen{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
html body .search-chip{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 8px 0 13px;border:0;border-radius:var(--r-pill);background:var(--c,var(--brand));color:#fff;font:inherit;font-size:13px;font-weight:800;white-space:nowrap;cursor:pointer;transition:transform var(--t-fast) var(--ease-out)}
html body .search-chip small{font-size:12px;font-weight:600;opacity:.82}
html body .search-chip svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
html body .search-chip:active{transform:scale(.96)}
html body .search-clear{padding:4px 2px;border:0;background:none;color:var(--ink-3);font:inherit;font-size:13px;cursor:pointer}
html body .search-clear:hover{color:var(--ink)}
html body .search-head-space{flex:1}
html body .search-sort{position:relative;display:grid;grid-auto-flow:column;padding:3px;border-radius:var(--r-pill);background:var(--soft)}
html body .search-sort-thumb{position:absolute;top:3px;bottom:3px;left:0;width:0;border-radius:var(--r-pill);background:#fff;box-shadow:0 1px 3px rgba(36,33,42,.15);transition:transform var(--t-base) var(--ease-out),width var(--t-base) var(--ease-out)}
html body .search-sort-opt{position:relative;z-index:1;padding:5px 14px;border:0;border-radius:var(--r-pill);background:none;color:var(--ink-3);font:inherit;font-size:13px;font-weight:700;white-space:nowrap;cursor:pointer;transition:color var(--t-base)}
html body .search-sort-opt.is-on{color:var(--brand)}
html body .search-sort-opt:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
html body .search-lowdata,html body .search-drawer-lowdata{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink-2);white-space:nowrap}
/* 滑动开关 */
html body .search-switch{position:relative;flex:none;width:34px;height:20px;padding:0;border:0;border-radius:var(--r-pill);background:#DCD6E6;cursor:pointer;transition:background-color var(--t-base) var(--ease-out)}
html body .search-switch::after{content:"";position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.15);transition:transform var(--t-base) var(--ease-out)}
html body .search-switch[aria-pressed="true"]{background:var(--brand)}
html body .search-switch[aria-pressed="true"]::after{transform:translateX(14px)}
html body .search-switch:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
html body .search-related{display:flex;align-items:center;gap:8px;margin:6px 0 16px;font-size:13px;color:var(--ink-3);white-space:nowrap;flex-wrap:wrap}
html body .search-related[hidden]{display:none}
html body .search-pending{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:var(--r-pill);background:var(--soft);color:var(--ink-3);font-size:11px;font-weight:700}
html body .search-status{margin:0;color:var(--ink-2);font-size:13px}
html body .search-status:empty{display:none}

/* ===== 瀑布流：只有图片和空白 ===== */
html body #grid.search-masonry{display:flex!important;align-items:flex-start;gap:12px;width:100%!important;overflow:visible!important;margin-top:8px}
html body #grid.search-masonry[aria-busy="true"]{opacity:.55;transition:opacity var(--t-base)}
html body .search-col{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:12px}
html body .search-tile{position:relative;border-radius:var(--r-sm);overflow:hidden;background:#E4E1E8}
html body .search-tile .discover-tile-open{display:block;width:100%;padding:0;border:0;background:none;cursor:zoom-in}
html body .search-tile .discover-tile-open img{display:block;width:100%;height:auto;object-fit:cover;background:#E4E1E8}
html body .search-tile::after{content:"";position:absolute;inset:0;background:rgba(20,14,34,.08);opacity:0;pointer-events:none;transition:opacity var(--t-fast)}
html body .search-tile-lamp{position:absolute;left:8px;top:8px;z-index:1;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.9);color:#C69128;pointer-events:none}
html body .search-tile-lamp svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
html body .search-tile-queue{position:absolute;right:8px;top:8px;z-index:2;display:none;align-items:center;gap:4px;height:32px;padding:0 12px;border:0;border-radius:var(--r-pill);background:var(--brand);color:#fff;font:inherit;font-size:12px;font-weight:800;box-shadow:0 2px 8px rgba(0,0,0,.15);cursor:pointer}
html body .search-tile-queue svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
html body .search-tile-like{position:absolute;right:6px;bottom:6px;z-index:2;display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;background:none;color:#fff;cursor:pointer;filter:drop-shadow(0 1px 3px rgba(20,10,30,.45));transition:color var(--t-base) var(--ease-out)}
html body .search-tile-like svg{width:22px;height:22px;fill:currentColor;stroke:none}
html body .search-tile-like.is-on{color:var(--pink);filter:drop-shadow(0 1px 3px rgba(236,44,100,.45))}
html body .search-tile-like.is-pop svg{animation:iriviHeartPop .45s var(--ease-spring)}
html body .search-tile-like:focus-visible,html body .search-tile-queue:focus-visible,html body .search-tile .discover-tile-open:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
@media (hover:hover){
  html body .search-tile:hover::after{opacity:1}
  html body .search-tile:hover .search-tile-queue,html body .search-tile:has(:focus-visible) .search-tile-queue{display:inline-flex}
}
html body .search-end{margin:0;padding:28px 0 56px;text-align:center;font-size:13px;color:var(--ink-3)}
html body .search-end[hidden]{display:none}
html body #loadMoreSentinel .btn{display:block;margin:24px auto}

/* ===== 加入队列小弹层 ===== */
html body .search-queue-picker{position:fixed;z-index:1150;width:260px;max-height:min(360px,70vh);overflow:auto;padding:8px;border-radius:var(--r-md);background:#fff;box-shadow:var(--shadow-pop);animation:iriviPopIn var(--t-base) var(--ease-out)}
html body .search-queue-picker[hidden]{display:none}
html body .search-queue-title{padding:6px 8px 8px;font-size:13px;font-weight:900;color:var(--ink)}
html body .search-queue-note{margin:0;padding:6px 8px 10px;font-size:13px;color:var(--ink-3)}
html body .search-queue-note.is-error{color:var(--danger)}
html body .search-queue-list{display:grid;gap:2px}
html body .search-queue-item{display:flex;align-items:center;gap:8px;width:100%;min-height:38px;padding:0 10px;border:0;border-radius:var(--r-xs);background:none;color:var(--ink);font:inherit;font-size:14px;font-weight:700;text-align:left;cursor:pointer}
html body .search-queue-item span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .search-queue-item small{color:var(--ink-3);font-size:12px;font-variant-numeric:tabular-nums}
html body .search-queue-item:hover,html body .search-queue-item:focus-visible{background:var(--soft);outline:0}
html body .search-queue-manage{display:block;margin-top:6px;padding:8px 10px;border-top:1px solid var(--line);color:var(--brand);font-size:13px;font-weight:800;text-decoration:none}

/* ===== 左侧“筛选 N”小标签 ===== */
html body .search-filter-tab{position:fixed;left:0;top:50%;z-index:60;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;width:34px;padding:14px 0;border:0;border-radius:0 12px 12px 0;background:var(--brand);color:#fff;box-shadow:0 6px 18px rgba(80,40,160,.25);cursor:pointer;transition:transform var(--t-fast) var(--ease-out),opacity var(--t-base)}
html body .search-filter-tab svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
html body .search-filter-tab span{writing-mode:vertical-rl;font-size:13px;font-weight:800;letter-spacing:.2em}
html body .search-filter-tab b{display:grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:var(--r-pill);background:#fff;color:var(--brand);font-size:11px;font-variant-numeric:tabular-nums}
html body .search-filter-tab b[hidden]{display:none}
html body .search-filter-tab:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
html body.search-filters-open .search-filter-tab{opacity:0;pointer-events:none}
html body.no-scroll .search-filter-tab{display:none}

/* ===== 筛选抽屉（从左侧拉出，悬浮覆盖；宽屏 340px / 窄屏 86%） ===== */
html body .search-filter-dim{z-index:1190;background:rgba(22,18,28,.28)}
html body .search-filter-dim[hidden],html body .search-drawer[hidden]{display:none!important}
html body .search-drawer{display:flex;flex-direction:column;overflow:hidden;z-index:1195}
html body .search-drawer-head{display:flex;align-items:center;gap:10px;padding:18px 20px 10px}
html body .search-drawer-head h2{margin:0;font-size:18px;font-weight:900;letter-spacing:0}
html body #discoverReset{margin-left:auto;padding:4px 2px;border:0;background:none;color:var(--ink-2);font:inherit;font-size:13px;cursor:pointer}
html body .search-drawer-x{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:var(--soft);color:var(--ink);cursor:pointer}
html body .search-drawer-x svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
html body .search-drawer-find{display:flex;align-items:center;gap:6px;height:36px;margin:0 20px 6px;padding:0 12px;border-radius:var(--r-pill);background:var(--soft);color:var(--ink-3)}
html body .search-drawer-find svg{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
html body .search-drawer-find input{flex:1;min-width:0;height:100%;padding:0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;color:var(--ink);font:inherit;font-size:13px}
html body .search-drawer-body{flex:1;overflow:auto;overscroll-behavior:contain;padding:0 20px}
html body .search-find-results{display:flex;flex-wrap:wrap;gap:6px;padding:10px 0}
html body .search-find-results[hidden]{display:none}
html body .search-find-empty{margin:0;font-size:13px;color:var(--ink-3)}
html body .search-categories[hidden]{display:none}
html body .search-cat{padding:12px 0;border-bottom:1px solid var(--line)}
html body .search-cat-head{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:none;color:var(--ink);font:inherit;font-size:14px;font-weight:800;text-align:left;cursor:pointer}
html body .search-cat-swatch{width:4px;height:16px;border-radius:2px;background:var(--c)}
html body .search-cat-count{padding:0 7px;border-radius:var(--r-pill);background:var(--c);color:#fff;font-size:11px;line-height:17px;font-variant-numeric:tabular-nums}
html body .search-cat-chevron{width:16px;height:16px;margin-left:auto;fill:none;stroke:var(--ink-3);stroke-width:2;stroke-linecap:round;transition:transform var(--t-base) var(--ease-out)}
html body .search-cat.is-closed .search-cat-chevron{transform:rotate(-90deg)}
html body .search-cat.is-closed .search-cat-body{display:none}
html body .search-opts{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
html body .search-opt{padding:3px 11px;border:1.5px solid var(--c);border-radius:var(--r-pill);background:#fff;color:color-mix(in srgb,var(--c) 85%,#000);font:inherit;font-size:13px;font-weight:700;line-height:1.5;cursor:pointer;transition:background-color var(--t-base) var(--ease-out),color var(--t-base)}
html body .search-opt.is-on{background:var(--c);color:#fff;font-weight:800}
html body .search-opt.is-all{border-color:transparent;background:none;color:var(--ink-3);padding:3px 6px}
html body .search-opt.is-all.is-on{color:var(--ink-2);background:var(--soft)}
html body .search-opt:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
html body .search-sub{margin-top:9px;padding:10px;border-radius:var(--r-sm);background:color-mix(in srgb,var(--c) 6%,#fff)}
html body .search-sub small{display:block;margin-bottom:2px;font-size:12px;color:var(--ink-3)}
html body .search-sub .search-opts{margin-top:4px}
html body .search-drawer-foot{padding:12px 20px calc(18px + var(--safe-bottom));border-top:1px solid var(--line)}
html body .search-drawer-row{display:flex;align-items:center;gap:10px;margin-bottom:12px;font-size:14px;font-weight:700;color:var(--ink)}
html body .search-drawer-row .search-switch{margin-left:auto}
html body .search-lamp{width:20px;height:20px;flex:none;fill:none;stroke:#C69128;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html body .search-drawer-lowdata{display:none}
html body .search-drawer-go{display:flex;align-items:center;justify-content:center;width:100%;height:44px;border:0;border-radius:var(--r-pill);background:var(--brand);color:#fff;font:inherit;font-size:15px;font-weight:900;cursor:pointer;transition:transform var(--t-fast) var(--ease-out)}
html body .search-drawer-go:active{transform:scale(.98)}

/* ===== 无结果 ===== */
html body .search-empty{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:center;margin:8px 0 0;padding:28px 32px;border-radius:var(--r-md);background:var(--soft)}
html body .search-empty[hidden]{display:none}
html body .search-empty h3{margin:0;font-size:20px;font-weight:900}
html body .search-empty .discover-status{margin:4px 0 0;color:var(--ink-2)}
html body .search-empty-hint{margin:14px 0 0;font-size:13px;color:var(--ink-3)}
html body .search-relax{margin:6px 0 0;padding:0;list-style:none}
html body .search-relax li{display:flex;align-items:center;gap:10px;margin-top:8px;padding:10px 14px;border-radius:var(--r-sm);background:#fff;font-size:14px}
html body .search-relax li b{padding:1px 10px;border-radius:var(--r-pill);background:var(--c);color:#fff;font-size:12px}
html body .search-relax .search-pending{margin-left:auto}
html body .search-relax-go{padding:0;border:0;background:none;color:var(--brand);font:inherit;font-size:13px;font-weight:800;cursor:pointer}

/* ===== 竖屏 = 手机版 ===== */
@media (max-aspect-ratio:1/1){
  html body[data-page="search"]>main#discoverMain{padding:8px 12px calc(32px + var(--tabbar-h) + var(--safe-bottom))!important}
  html body .search-mobile-query{display:block;margin:4px 0 6px}
  /* 手机：搜索框不在顶栏内，放在页面上，浅灰底；AI 按钮改白底 */
  html body .search-query{max-width:none;height:40px;background:var(--soft)}
  html body .search-query .search-query-ai{background:#fff}
  html body .search-head{gap:10px;padding-top:10px}
  html body .search-title{font-size:18px}
  html body .search-chosen{flex:1;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  html body .search-chosen::-webkit-scrollbar{display:none}
  html body .search-clear,html body .search-head-space,html body .search-head .search-lowdata{display:none}
  html body .search-sort{order:9;width:100%;grid-auto-columns:1fr}
  html body .search-sort-opt{padding:5px 0;font-size:12px;text-align:center}
  html body .search-related{flex-wrap:nowrap;overflow-x:auto;margin:8px -12px 12px;padding:0 12px}
  html body #grid.search-masonry,html body .search-col{gap:8px}
  html body .search-tile{border-radius:8px}
  html body .search-filter-tab{width:26px;padding:10px 0;gap:6px}
  html body .search-filter-tab span{font-size:12px}
  html body .search-drawer{width:86%}
  html body .search-drawer-lowdata{display:flex}
  html body .search-drawer-lowdata .search-switch{margin-left:auto}
  html body .search-empty{grid-template-columns:minmax(0,1fr);padding:20px}
}
