/*
Theme Name: YuyiBuy 導覽
Description: YuyiBuy Search 網站目錄。
Version: 1.0.0
Text Domain: yuyibuy-directory
*/
:root {
  color-scheme: dark;
  --bg:#191c22; --surface:#242932; --surface-soft:#20242c; --rail:#22262d;
  --header:#252931; --text:#f0f3f7; --muted:#a8b1bd; --faint:#909ba9;
  --line:#343a45; --field:#14171c; --accent:#79d5df; --accent-fill:#66cbd9;
  --accent-text:#082c34; --active-bg:#293c44; --button:#303640; --focus:#8ce3eb;
  --elevation:0 8px 25px rgb(0 0 0 / .16); --rail-width:198px; --mast-height:68px;
  --scroll-gap:calc(var(--mast-height) + 16px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:#f4f6f8; --surface:#fff; --surface-soft:#f7f9fa; --rail:#fff;
  --header:#fff; --text:#222b36; --muted:#535f6d; --faint:#66717f;
  --line:#dce2e7; --field:#fff; --accent:#087486; --accent-fill:#0a7588;
  --accent-text:#fff; --active-bg:#e5f1f3; --button:#eef2f4; --focus:#087486;
  --elevation:0 9px 25px rgb(20 41 54 / .08);
}
* { box-sizing:border-box; }
html { scroll-padding-top:var(--scroll-gap); scroll-behavior:smooth; }
body.ybs-directory { margin:0; min-height:100vh; background:var(--bg); color:var(--text); font-family:"Inter","Segoe UI","PingFang TC","Microsoft JhengHei",sans-serif; font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased; }
.ybs-directory a { color:inherit; text-decoration:none; }
button,input,textarea,select { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { cursor:wait; opacity:.62; }
.ybs-directory :focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.ybs-directory [hidden] { display:none !important; }
.visually-hidden,.skip-link:not(:focus) { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.skip-link:focus { position:fixed; top:10px; left:12px; z-index:150; padding:8px 14px; background:var(--surface); }
.ui-icon { display:inline-block; width:20px; height:20px; flex:none; vertical-align:middle; }
.icon-btn { align-items:center; justify-content:center; display:inline-flex; width:39px; height:39px; padding:0; color:var(--muted); background:transparent; border:0; border-radius:9px; }
.icon-btn:hover { background:var(--button); color:var(--text); }
.mast { position:fixed; inset:0 0 auto; z-index:40; height:var(--mast-height); display:flex; align-items:center; gap:12px; background:var(--header); border-bottom:1px solid var(--line); }
.brand { flex:0 0 198px; align-self:stretch; display:flex; gap:9px; align-items:center; padding:0 19px; white-space:nowrap; }
.brand-mark { width:32px; height:32px; display:grid; place-items:center; background:var(--accent-fill); color:var(--accent-text); border-radius:10px 10px 10px 3px; }
.brand-mark .ui-icon { width:21px; height:21px; stroke-width:2.4; }
.brand-word { font-weight:750; letter-spacing:-1px; font-size:22px; line-height:1; }
.brand-word small { letter-spacing:0; font-size:14px; color:var(--muted); }
.menu-trigger { flex:none; }
.channel-nav { min-width:0; align-self:stretch; overflow-x:auto; display:flex; gap:3px; align-items:stretch; scrollbar-width:none; }
.channel-nav::-webkit-scrollbar,.search-tabs::-webkit-scrollbar,.engines::-webkit-scrollbar { display:none; }
.channel-nav a { position:relative; display:inline-flex; align-items:center; flex:none; padding:0 clamp(8px,1.15vw,21px); font-size:14px; font-weight:600; color:var(--muted); }
.channel-nav a:is(:hover,[aria-current]) { color:var(--text); }
.channel-nav a[aria-current]::after { content:""; position:absolute; bottom:0; left:12px; right:12px; height:3px; border-radius:3px 3px 0 0; background:var(--accent); }
.rail { position:fixed; top:var(--mast-height); left:0; bottom:0; width:var(--rail-width); background:var(--rail); border-right:1px solid var(--line); display:flex; flex-direction:column; z-index:33; }
.section-nav { flex:1; overflow:auto; padding:12px 9px; scrollbar-width:thin; }
.section-nav a,.rail-submit { display:flex; align-items:center; gap:12px; min-height:43px; padding:8px 12px; border-radius:7px; color:var(--muted); white-space:nowrap; }
.section-nav a + a { margin-top:2px; }
.section-nav a:hover,.rail-submit:hover { color:var(--text); background:var(--button); }
.section-nav a[aria-current],.rail-submit[aria-current] { background:var(--active-bg); color:var(--accent); }
.rail-submit { margin:8px 9px 12px; position:relative; }
.rail-submit::before { content:""; position:absolute; left:0; right:0; top:-6px; border-top:1px solid var(--line); }
.rail-small { --rail-width:66px; }
.rail-small .section-nav a,.rail-small .rail-submit { justify-content:center; padding-inline:0; }
.rail-small .section-nav span,.rail-small .rail-submit span { display:none; }
.drawer-shade { position:fixed; inset:var(--mast-height) 0 0; border:0; background:#07101799; z-index:30; }
.page-layout { margin-left:var(--rail-width); padding-top:var(--mast-height); min-width:0; min-height:100vh; }
body[data-view="home"] .page-layout { margin-left:0; }
.page-layout:focus { outline:none; }
.page-body { max-width:1760px; padding:0 clamp(18px,2.1vw,38px); margin-inline:auto; }
.search-hero { display:grid; grid-template-columns:minmax(0,1fr); place-items:center; min-height:185px; padding:30px 25px 25px; }
.search-box { min-width:0; width:min(100%,800px); }
.search-tabs,.engines { display:flex; align-items:center; justify-content:safe center; gap:clamp(4px,1.4vw,18px); overflow-x:auto; scrollbar-width:none; }
.search-tabs button,.engines button,.switch-tabs button { appearance:none; border:0; color:var(--muted); background:transparent; white-space:nowrap; }
.search-tabs button { position:relative; min-height:36px; padding:3px 6px 9px; font-size:15px; }
.search-tabs button:hover,.engines button:hover { color:var(--text); }
.search-tabs button[aria-pressed="true"] { color:var(--text); font-weight:650; }
.search-tabs button[aria-pressed="true"]::after { content:""; position:absolute; height:3px; border-radius:5px; bottom:3px; left:7px; right:7px; background:var(--accent); }
.search-form { display:flex; align-items:center; background:var(--field); border:1px solid var(--line); border-radius:28px; margin-top:6px; }
.search-form:focus-within { border-color:var(--accent); }
.search-form input { min-width:0; flex:1; background:transparent; color:var(--text); border:0; height:47px; padding:0 3px 0 20px; border-radius:inherit; }
.search-form input:focus-visible { outline:none; }
input::placeholder,textarea::placeholder { color:var(--faint); opacity:1; }
.search-form button { width:48px; height:45px; align-self:center; display:grid; place-items:center; border:0; border-radius:100%; color:var(--text); background:transparent; }
.search-form button:hover { color:var(--accent); }
.engine-groups { min-height:32px; }
.engines { gap:5px; padding:4px 0; }
.engines button { border-radius:15px; padding:3px 10px; font-size:12px; }
.engines button[aria-pressed="true"] { color:var(--accent); background:var(--active-bg); }
.switch-tabs { display:inline-flex; gap:2px; padding:3px; background:var(--field); border:1px solid var(--line); border-radius:20px; margin:0 0 19px; }
.switch-tabs button { font-size:13px; padding:4px 13px; border-radius:15px; }
.switch-tabs button[aria-pressed="true"] { background:var(--accent-fill); color:var(--accent-text); font-weight:700; }
.directory-section,.featured { margin:0 0 30px; }
.section-title { display:flex; align-items:center; gap:9px; font-size:17px; line-height:1.4; font-weight:650; margin:0 0 16px; color:var(--text); }
.section-title .ui-icon { width:20px; height:20px; color:var(--muted); }
.site-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,176px),1fr)); gap:16px clamp(12px,1.5vw,25px); }
.site-card { min-width:0; display:flex; align-items:stretch; background:var(--surface); border:1px solid var(--line); border-radius:9px; min-height:68px; transition:border-color .15s,transform .15s,box-shadow .15s; }
.site-card:is(:hover,:focus-within) { border-color:var(--accent); transform:translateY(-2px); box-shadow:var(--elevation); }
.site-card.show-preview { position:relative; z-index:12; }
.card-preview { position:absolute; left:0; top:100%; width:100%; aspect-ratio:16/9; object-fit:cover; object-position:top center; background:var(--surface); border:1px solid var(--accent); border-radius:7px; box-shadow:var(--elevation); }
.preview-above .card-preview { top:auto; bottom:100%; }
.card-body { display:flex; align-items:center; gap:10px; min-width:0; flex:1; padding:12px 0 12px 12px; border-radius:inherit; }
.card-copy { display:flex; flex-direction:column; min-width:0; gap:2px; }
.card-copy strong,.card-copy small { text-overflow:ellipsis; overflow:hidden; white-space:nowrap; }
.card-copy strong { font-size:13px; font-weight:690; line-height:1.45; }
.card-copy small { font-size:11px; color:var(--muted); line-height:1.45; }
.card-go { align-self:stretch; flex:0 0 26px; display:grid; place-items:center; color:var(--faint) !important; border-radius:0 8px 8px 0; }
.card-go .ui-icon { width:13px; height:13px; opacity:.7; }
.card-go:hover { color:var(--accent) !important; }
.card-go:hover .ui-icon { opacity:1; }
.site-badge { --badge-bg:#b4e7ef; --badge-fg:#153e51; border-radius:50%; background:var(--badge-bg); color:var(--badge-fg); display:grid; place-items:center; flex:none; width:38px; height:38px; letter-spacing:-.8px; font-family:"Segoe UI","Microsoft JhengHei",sans-serif; font-size:16px; line-height:1; font-weight:750; }
.site-badge { position:relative; }
.site-icon { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; padding:3px; border-radius:inherit; background:#fff; opacity:0; }
.site-icon.is-ready { opacity:1; }
.site-badge-big .site-icon { inset:0; margin:auto; width:auto; height:auto; max-width:78%; max-height:78%; object-fit:scale-down; padding:0; border-radius:0; background:transparent; }
.site-badge-big:has(.site-icon.is-ready) { background:#fff; }
.site-badge-big:has(.site-icon.is-ready) .badge-initial,
.site-badge-big:has(.site-logo.is-ready) .site-icon:not(.site-logo) { visibility:hidden; }
.ink-1 { --badge-bg:#f3d2df; --badge-fg:#763954; }
.ink-2 { --badge-bg:#c9daf8; --badge-fg:#314a83; }
.ink-3 { --badge-bg:#e0d5f7; --badge-fg:#5d447c; }
.ink-4 { --badge-bg:#c1e6d4; --badge-fg:#305b48; }
.ink-5 { --badge-bg:#f2d9bd; --badge-fg:#794b23; }
.ink-6 { --badge-bg:#e9e1b6; --badge-fg:#655729; }
.ink-7 { --badge-bg:#bcdce1; --badge-fg:#2b5962; }
.ink-8 { --badge-bg:#f0caba; --badge-fg:#793f3c; }
.ink-9 { --badge-bg:#cfdaeb; --badge-fg:#405570; }
.friend-links { display:flex; flex-wrap:wrap; gap:6px 20px; padding:12px 16px; background:var(--surface); border:1px solid var(--line); border-radius:8px; font-size:14px; }
.friend-links a { padding:3px 0; }
.friend-links a:hover,.other-links a:hover,.crumbs a:hover,.crumb:hover { color:var(--accent); }
.friend-links .ui-icon,.other-links .ui-icon,.crumbs .ui-icon { width:13px; height:13px; }
.more-link { color:var(--muted) !important; }
.page-footer { color:var(--muted); border-top:1px solid var(--line); font-size:12px; padding:22px 0 27px; margin-top:36px; }
.page-tools { position:fixed; bottom:20px; right:15px; z-index:25; display:flex; flex-direction:column; gap:7px; }
.page-tools .icon-btn { background:var(--surface); color:var(--muted); border:1px solid var(--line); border-radius:50%; box-shadow:var(--elevation); }
.page-tools .icon-btn:hover { color:var(--accent); }
.page-tools .ui-icon { width:17px; height:17px; }
[data-theme="dark"] .dark-icon,[data-theme="light"] .light-icon { display:none; }
.inner-page { padding:clamp(24px,4vw,60px) 0 8px; }
.inner-page h1,.channel-heading { font-size:clamp(24px,3.1vw,38px); margin:9px 0 16px; letter-spacing:-.035em; line-height:1.25; }
.channel-heading { font-size:24px; margin:0 0 24px; }
.crumb,.crumbs,.list-summary,.domain { color:var(--muted) !important; }
.crumb,.crumbs { font-size:13px; }
.crumbs { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.list-summary { margin:0 0 25px; }
.list-page { padding-top:22px; }
.empty-state,.status-banner { background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:18px; }
.status-banner { color:var(--accent); border-left:3px solid var(--accent); }
.detail-shell { display:grid; grid-template-columns:clamp(130px,16vw,195px) minmax(0,1fr); gap:clamp(20px,3vw,45px); align-items:center; margin:23px 0 42px; padding:clamp(20px,3vw,40px); border:1px solid var(--line); background:var(--surface-soft); border-radius:14px; }
.detail-identity { min-width:0; }
.detail-preview { grid-column:1 / -1; min-width:0; width:100%; max-width:640px; margin:0; }
.detail-preview figcaption { margin-bottom:7px; font-size:13px; font-weight:600; color:var(--muted); }
.preview-frame { position:relative; aspect-ratio:16/9; overflow:hidden; border-radius:9px; border:1px solid var(--line); background:var(--field); }
.preview-frame a { display:block; width:100%; height:100%; }
.preview-frame a:focus-visible { outline-offset:-3px; }
.preview-frame img { display:block; width:100%; height:100%; object-fit:cover; object-position:top center; }
.preview-frame img.is-loading { opacity:0; }
.preview-frame p { position:absolute; inset:0; display:grid; place-content:center; padding:12px; margin:0; color:var(--muted); font-size:13px; }
.site-badge-big { width:100%; height:auto; aspect-ratio:1; border-radius:18px; font-size:clamp(42px,6vw,72px); }
.detail-metrics { display:flex; align-items:center; justify-content:center; gap:12px; padding:8px 0 0; }
.detail-metrics > * { display:inline-flex; align-items:center; gap:4px; background:none; border:0; color:var(--muted); font-size:12px; }
.detail-metrics .ui-icon { width:16px; height:16px; }
.detail-metrics button[aria-pressed="true"] { color:var(--accent); }
.detail-metrics button[aria-pressed="true"] .ui-icon { fill:currentColor; }
.category-pill,.tags a { display:inline-flex; align-items:center; padding:3px 9px; border-radius:5px; background:var(--active-bg); color:var(--accent) !important; font-size:12px; }
.detail-copy { min-width:0; overflow-wrap:anywhere; }
.detail-copy h1 { margin:9px 0; }
.domain { margin:0 0 12px; }
.tags,.other-links,.detail-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.tags,.other-links { font-size:13px; color:var(--muted); }
.detail-actions { margin:17px 0 4px; }
.other-links { margin-top:15px; gap:6px 12px; }
.btn { display:inline-flex; justify-content:center; align-items:center; gap:7px; white-space:nowrap; border:1px solid var(--line); border-radius:7px; background:var(--button); color:var(--text); padding:7px 13px; min-height:37px; font-weight:600; font-size:14px; }
.btn:hover { border-color:var(--accent); }
.btn.accent { color:var(--accent-text); background:var(--accent-fill); border-color:var(--accent-fill); }
.btn .ui-icon { width:16px; height:16px; }
.dialog { color:var(--text); width:min(440px,calc(100% - 32px)); max-height:calc(100dvh - 44px); background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:22px; box-shadow:0 22px 70px #0005; }
.dialog::backdrop { background:#071017aa; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.dialog-head h2 { margin:0; font-size:20px; }
.dialog-close { width:32px; height:32px; }
.outbound-dialog p { margin:0; color:var(--muted); }
.outbound-dialog .outbound-destination { margin:16px 0 20px; padding:10px 12px; border:1px solid var(--line); border-radius:7px; background:var(--field); color:var(--text); text-align:left; overflow-wrap:anywhere; }
.outbound-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.outbound-actions .btn { min-height:44px; }
.outbound-content { min-width:0; }
.outbound-art { display:none; }
@media (min-width:640px) {
  .outbound-dialog:has(.outbound-art) { width:min(660px,calc(100% - 48px)); }
  .outbound-layout:has(.outbound-art) { display:grid; grid-template-columns:minmax(125px,.47fr) minmax(0,1fr); align-items:center; gap:24px; }
  .outbound-art { display:flex; justify-content:center; align-items:center; height:clamp(235px,37vh,345px); background:#000; overflow:hidden; border-radius:8px; }
  .outbound-art img { display:block; width:100%; height:100%; object-fit:contain; }
}
.qr-dialog { text-align:center; max-width:265px; }
.qr-dialog img { display:block; margin:18px auto 10px; image-rendering:pixelated; border-radius:3px; background:#fff; }
.qr-dialog p { margin:8px 0; color:var(--muted); overflow-wrap:anywhere; }
.submit-page { max-width:820px; margin-inline:auto; }
.submit-form { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:clamp(16px,3vw,32px); }
.submit-form fieldset,.dialog fieldset { min-width:0; border:0; margin:0 0 20px; padding:0; }
.submit-form legend,.dialog legend { font-weight:700; font-size:16px; padding:0; margin-bottom:12px; }
.form-field { display:flex; flex-direction:column; gap:5px; margin:0 0 14px; font-size:14px; min-width:0; }
.form-field input,.form-field textarea,.form-field select,.submit-form input:not([type="hidden"]),.submit-form select,.submit-form textarea { background:var(--field); color:var(--text); border:1px solid var(--line); padding:9px 11px; border-radius:6px; min-width:0; max-width:100%; }
.form-field textarea { resize:vertical; }
.ybs-challenge,.ybs-challenge label { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.ybs-challenge input { width:180px; }
.ybs-challenge img { max-width:100%; border-radius:5px; }
.form-pair { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.input-action { display:flex; gap:7px; }
.input-action input { flex:1; width:0; }
.form-feedback { color:var(--muted); font-size:13px; }
.form-feedback:empty { display:none; }
.radio-option { display:inline-flex; align-items:center; gap:5px; margin:4px 15px 4px 0; }
.radio-option input { accent-color:var(--accent-fill); }
.inner-page .section-title:not(:first-child) { margin-top:22px; }
/* The WordPress toolbar is visible to editors during private previews. */
html:has(body.ybs-directory.admin-bar) {
  --editor-bar:32px;
  margin-top:var(--editor-bar) !important;
  scroll-padding-top:calc(var(--scroll-gap) + var(--editor-bar));
}
.ybs-directory.admin-bar .mast { top:var(--editor-bar); }
.ybs-directory.admin-bar .rail,.ybs-directory.admin-bar .drawer-shade { top:calc(var(--mast-height) + var(--editor-bar)); }
.ybs-directory.admin-bar #wpadminbar { position:fixed; }
@media (max-width:782px) {
  html:has(body.ybs-directory.admin-bar) { --editor-bar:46px; }
}
@media (min-width:1600px) {
  .site-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
}
@media (min-width:1100px) {
  .detail-shell.with-preview { grid-template-columns:clamp(110px,11vw,165px) minmax(0,1.2fr) minmax(230px,.8fr); }
  .detail-preview { grid-column:auto; }
}
@media (max-width:1000px) and (min-width:801px) {
  :root { --rail-width:171px; }
  .brand { flex-basis:171px; padding-left:13px; }
  .mast { gap:4px; }
  .channel-nav a { padding-inline:10px; }
  .page-body { padding-inline:17px; }
}
@media (max-width:800px) {
  :root { --rail-width:0px; --mast-height:97px; }
  .mast { display:grid; grid-template-columns:auto 1fr; grid-template-rows:54px 42px; gap:0; }
  .brand { grid-column:2; grid-row:1; padding:0 10px 0 0; }
  .brand-word { font-size:20px; }
  .brand-mark { width:29px; height:29px; }
  .menu-trigger { grid-column:1; grid-row:1; margin:0 7px 0 8px; }
  .channel-nav { grid-column:1 / -1; grid-row:2; gap:0; border-top:1px solid var(--line); padding-inline:7px; }
  .channel-nav a { padding:0 12px; font-size:13px; }
  .rail { width:min(254px,84vw); transform:translateX(-102%); }
  .drawer-open .rail { transform:translateX(0); }
  .page-layout { margin-left:0; }
  .page-body { padding-inline:15px; }
  .search-hero { min-height:160px; padding:23px 15px 14px; }
  .site-grid { gap:11px; grid-template-columns:repeat(auto-fill,minmax(min(100%,155px),1fr)); }
  .card-body { padding:10px 0 10px 10px; gap:8px; }
  .card-go { flex-basis:23px; }
  .site-badge:not(.site-badge-big) { width:33px; height:33px; font-size:14px; }
  .site-card { min-height:62px; }
  .directory-section,.featured { margin-bottom:24px; }
  .section-title { margin-bottom:12px; }
  .page-tools { right:9px; bottom:13px; }
  .page-tools .icon-btn { width:34px; height:34px; }
}
@media (max-width:520px) {
  .search-tabs { justify-content:space-between; gap:0; }
  .search-tabs button { font-size:13px; padding-inline:4px; }
  .search-tabs button[aria-pressed="true"]::after { left:4px; right:4px; }
  .engines { justify-content:flex-start; }
  .site-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .card-copy strong { font-size:12px; }
  .card-copy small { font-size:10px; }
  .card-go { flex-basis:20px; }
  .detail-shell { grid-template-columns:1fr; padding:18px; gap:16px; }
  .detail-identity { display:flex; gap:12px; align-items:center; }
  .site-badge-big { width:79px; font-size:33px; }
  .form-pair { grid-template-columns:1fr; gap:0; }
  .detail-actions .btn { padding-inline:9px; }
}
@media (max-width:340px) {
  .page-body { padding-inline:10px; }
  .card-body { padding-left:7px; gap:5px; }
  .site-badge:not(.site-badge-big) { width:27px; height:27px; font-size:11px; }
  .search-tabs { justify-content:flex-start; gap:4px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { transition-duration:.01ms !important; animation-duration:.01ms !important; }
}
