:root{--bg: #f7f7f8;--surface: #fff;--surface-alt: #f4f4f7;--header-bg: #1f2430;--header-field: #2a2f3c;--line: #e5e5e8;--line-dark: #3a4051;--fg: #1a1a1a;--fg-invert: #e6e6e6;--muted: #8a8f9c;--muted-invert: #a9adba;--accent: #4a5aff;--accent-bright: #7f8cff;--cat-bar: #333c50;--cat-bar-hover: #3f4a63;--cat-count: #b8bdcb;--group-bar: #e7eaf4;--group-fg: #3d4356;--line-strong: #d2d6e2;--up: #c0342b;--down: #14804a;--up-soft: #fdecea;--down-soft: #e7f5ee;--radius: 6px;--radius-sm: 4px;--pad-x: 2rem}*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Microsoft JhengHei,sans-serif;color:var(--fg);background:var(--bg)}.app{min-height:100vh}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.app-header :focus-visible{outline-color:#9aa4ff}.app-header{background:var(--header-bg);color:var(--fg-invert);padding:1.25rem var(--pad-x)}.app-header h1{font-size:1.1rem;margin:0 0 .25rem}.app-header .muted{color:var(--muted-invert)}.search-bar{margin-top:.85rem;display:flex;flex-wrap:wrap;gap:.5rem .75rem;align-items:flex-end}.search-field{display:flex;flex-direction:column;gap:.25rem;flex:0 0 auto;min-width:0}.search-field-grow{flex:1 1 260px}.search-label{font-size:.72rem;letter-spacing:.06em;color:var(--muted-invert)}.category-select,.search-input{padding:.45rem .75rem;border:1px solid var(--line-dark);border-radius:var(--radius-sm);background:var(--header-field);color:var(--fg-invert);font-size:.9rem;font-family:inherit;min-height:2.35rem}.category-select{flex:0 0 auto;min-width:11rem;max-width:100%;cursor:pointer}.search-input{min-width:0;width:100%}.search-input::placeholder{color:var(--muted)}.trend-filter-field{flex:0 0 auto}.trend-filter-group{display:flex;gap:.4rem}.trend-filter{border:1px solid var(--line-dark);border-radius:var(--radius-sm);background:var(--header-field);color:var(--fg-invert);font:inherit;font-size:.85rem;padding:.45rem .7rem;min-height:2.35rem;cursor:pointer;white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.trend-filter:hover{border-color:var(--accent-bright)}.trend-filter.up.active{background:var(--up-soft);border-color:var(--up);color:var(--up)}.trend-filter.down.active{background:var(--down-soft);border-color:var(--down);color:var(--down)}.result-summary{margin:.7rem 0 0;font-size:.9rem;color:#cdd1dc;display:flex;flex-wrap:wrap;align-items:baseline;gap:.4rem}.result-summary strong{color:#fff;font-size:1.05rem;font-variant-numeric:tabular-nums}.result-summary .muted{color:var(--muted-invert)}.reset-filter{background:transparent;border:1px solid var(--line-dark);border-radius:var(--radius-sm);color:#cdd1dc;font:inherit;font-size:.8rem;padding:.2rem .6rem;cursor:pointer}.reset-filter:hover{border-color:var(--accent);color:#fff}.empty-state .reset-filter{color:var(--accent);border-color:var(--line);margin-left:.5rem}.empty-state .reset-filter:hover{border-color:var(--accent);color:var(--accent)}.muted{color:var(--muted);font-size:.85rem}.content{padding:1.5rem var(--pad-x)}.empty-state{color:#4a4f5c;font-size:.9rem}.category-list-toolbar{display:flex;justify-content:flex-end;margin-bottom:.6rem}.toggle-all-btn{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);color:var(--accent);font:inherit;font-size:.82rem;padding:.35rem .8rem;cursor:pointer;transition:background .12s ease,border-color .12s ease}.toggle-all-btn:hover{background:var(--surface-alt);border-color:var(--accent)}.category-list-wrapper{display:flex;flex-direction:column;gap:.9rem}.category-section{background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--radius);overflow:hidden}.category-section>summary{list-style:none;cursor:pointer;padding:.7rem 1rem .7rem calc(1rem - 4px);display:flex;align-items:baseline;gap:.75rem;flex-wrap:wrap;background:var(--cat-bar);color:var(--fg-invert);border-left:4px solid var(--accent-bright);font-weight:600}.category-section>summary:hover{background:var(--cat-bar-hover)}.category-section>summary:focus-visible{outline:2px solid var(--accent-bright);outline-offset:-4px}.category-section>summary::-webkit-details-marker{display:none}.category-section>summary:before{content:"▸";margin-right:.25rem;display:inline-block;transition:transform .15s ease}.category-section[open]>summary:before{transform:rotate(90deg)}.category-name{font-size:.95rem;letter-spacing:.01em}.category-count,.category-count .muted{font-size:.85rem;font-weight:400;color:var(--cat-count)}.product-list{list-style:none;margin:0;padding:0}.product-group-label{padding:.4rem 1rem;font-size:.8rem;font-weight:600;letter-spacing:.02em;color:var(--group-fg);background:var(--group-bar);border-top:1px solid var(--line)}.category-section>summary+.product-list>:first-child{border-top:0}.product-item{display:flex;align-items:center;gap:.75rem;padding:.5rem 1rem;border-top:1px solid #eee;font-size:.9rem;cursor:pointer}.product-item:hover{background:#f0f2fa}.product-item.inactive{color:#9a9a9a;filter:grayscale(1);background:#fafafa}.product-item.inactive .product-name{text-decoration:line-through}.product-name{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.product-meta{flex:0 0 auto;display:flex;align-items:center;gap:.75rem}.product-subcategory{flex:0 0 auto}.product-price{flex:0 0 auto;font-variant-numeric:tabular-nums;min-width:6ch;text-align:right}.product-trend{display:inline-block;margin-left:.3rem;font-weight:700}.product-trend.up{color:var(--up)}.product-trend.down{color:var(--down)}.product-item.inactive .product-trend{color:inherit}.product-tag{flex:0 0 auto;font-size:.75rem;border:1px solid #b5b5b5;border-radius:3px;padding:.05rem .4rem;white-space:nowrap}.error{color:#b3261e}.history-backdrop{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background:#0f121a73;animation:fade-in .15s ease-out}.history-panel{position:fixed;top:0;right:0;width:400px;max-width:100vw;height:100%;background:var(--surface);box-shadow:-8px 0 28px #0f121a38;padding:1.25rem 1.5rem 2rem;overflow-y:auto;animation:slide-in .18s ease-out}.history-panel-top{display:flex;justify-content:space-between;align-items:center;gap:.75rem}.history-eyebrow{margin:0;font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}.history-close{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);color:#4a4f5c;font:inherit;font-size:.85rem;padding:.4rem .9rem;min-height:2.25rem;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}.history-close:hover{background:#eef0f7;border-color:#c9cede;color:var(--fg)}.history-close:active{background:#e2e6f3}.history-headline{padding:.75rem 0 1rem;border-bottom:1px solid var(--line)}.history-headline h2{margin:0;font-size:1.15rem;line-height:1.4;font-weight:700;overflow-wrap:anywhere}.history-breadcrumb{margin:.35rem 0 0;font-size:.8rem;color:var(--muted)}.history-current{margin-top:.9rem;display:flex;align-items:baseline;flex-wrap:wrap;gap:.5rem}.history-current-label{font-size:.78rem;color:var(--muted)}.history-current-price{font-size:1.85rem;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums}.history-badges{margin:.5rem 0 0;font-size:.82rem;color:#b3261e}.history-inactive{margin:.5rem 0 0;font-size:.8rem;color:#4a4f5c;background:var(--surface-alt);border:1px solid var(--line);border-radius:var(--radius-sm);padding:.25rem .5rem;display:inline-block}.history-state{margin:1.25rem 0 0;font-size:.88rem}.history-list{list-style:none;margin:.5rem 0 0;padding:0}.history-row{padding:.7rem 0;border-bottom:1px solid #f0f0f3}.history-row:first-child{padding-top:.9rem}.history-row:last-child{border-bottom:none}.history-row-main{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem}.history-price{font-size:1rem;font-weight:600;font-variant-numeric:tabular-nums}.history-row-meta{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.2rem}.history-date{font-size:.78rem;color:var(--muted);font-variant-numeric:tabular-nums}.history-row-badges{font-size:.78rem;color:#b3261e}.price-delta{font-size:.8rem;font-weight:600;font-variant-numeric:tabular-nums;border-radius:999px;padding:.1rem .5rem;white-space:nowrap}.price-delta.up{color:var(--up);background:var(--up-soft)}.price-delta.down{color:var(--down);background:var(--down-soft)}.price-delta.flat,.price-delta.first{color:var(--muted);background:var(--surface-alt);font-weight:400}.history-current .price-delta{font-size:.85rem}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes slide-in{0%{transform:translate(16px);opacity:0}to{transform:none;opacity:1}}@media (max-width: 640px){:root{--pad-x: 1rem}.app-header{padding:1rem var(--pad-x)}.search-bar{flex-direction:column;align-items:stretch;gap:.6rem}.search-field,.search-field-grow,.trend-filter-field{flex:1 1 auto;width:100%}.category-select,.search-input{width:100%;min-width:0;min-height:2.75rem;font-size:1rem}.trend-filter-group{width:100%}.trend-filter{flex:1 1 0;min-height:2.75rem;font-size:.9rem}.result-summary{margin-top:.85rem}.content{padding:1rem var(--pad-x)}.category-section>summary{padding:.75rem .75rem .75rem calc(.75rem - 4px);min-height:2.75rem;align-items:center}.product-item{flex-wrap:wrap;gap:.25rem .6rem;padding:.6rem .75rem;min-height:2.75rem}.product-name{flex:1 1 100%}.product-meta{flex:1 1 100%;flex-wrap:wrap;gap:.5rem;justify-content:flex-start}.product-price{text-align:left;min-width:0;font-weight:600}.history-backdrop{display:block}.history-panel{top:auto;bottom:0;left:0;right:0;width:100%;max-width:100vw;height:auto;max-height:88vh;border-radius:var(--radius) var(--radius) 0 0;box-shadow:0 -8px 28px #0f121a47;padding:1rem 1rem 1.5rem;animation:slide-up .18s ease-out}.history-panel-top{position:sticky;top:0;z-index:1;background:var(--surface);margin:-1rem -1rem 0;padding:1rem 1rem .6rem}.history-close{min-height:2.75rem;padding:.5rem 1rem}.history-current-price{font-size:1.6rem}}@keyframes slide-up{0%{transform:translateY(16px);opacity:0}to{transform:none;opacity:1}}@media (min-width: 641px) and (max-width: 900px){:root{--pad-x: 1.25rem}.history-panel{width:min(400px,90vw)}}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.001ms!important;transition-duration:.001ms!important}}
