:root {
    --bg: #e4e7ea;
    --bg-soft: #f6f7f8;
    --bg-elevated: #ffffff;
    --ink: #1f2429;
    --ink-soft: #5e656d;
    --ink-mute: #848d96;
    --line: #c8ced5;
    --brand: #f2b705;
    --brand-strong: #c79300;
    --brand-soft: #fff2c7;
    --warn: #b86600;
    --danger: #c73b2f;
    --shadow: 0 14px 36px rgba(34, 40, 48, 0.12);
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --plate-bg: #ffd100;
    --plate-ink: #111;
    --font-main: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    --font-display: 'SF Pro Display', 'Noto Sans TC', sans-serif;
}

body.dark-mode {
    --bg: #000000;
    --bg-soft: #181818;
    --bg-elevated: #222222;
    --ink: #f0f3f5;
    --ink-soft: #b8c0c8;
    --ink-mute: #8f98a2;
    --line: #353535;
    --brand: #ffd34d;
    --brand-strong: #f2b705;
    --brand-soft: rgba(255, 211, 77, 0.16);
    --warn: #ffb347;
    --danger: #ff7e73;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    background: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.34) 25%, transparent 25%) 0 0/28px 28px,
        linear-gradient(315deg, rgba(255,255,255,0.26) 25%, transparent 25%) 0 0/28px 28px,
        radial-gradient(circle at 12% 10%, rgba(242, 183, 5, 0.22), transparent 40%),
        var(--bg);
    min-height: 100vh;
}

.app-container {
    width: min(1120px, 100% - 24px);
    margin: 20px auto 40px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

body.dark-mode .app-container {
    background: rgba(16, 26, 39, 0.75);
    border-color: rgba(69, 101, 136, 0.35);
}

.header-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0 2px;
}

.logo {
    width: auto;
    height: 44px;
    max-width: 210px;
}

.logo-dark {
    display: none;
}

body.dark-mode .logo-light {
    display: none;
}

body.dark-mode .logo-dark {
    display: block;
}

.site-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.dark-mode-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.dark-mode-toggle:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.dark-mode-toggle .icon-sun { display: none; }
.dark-mode-toggle .icon-moon { display: block; }
body.dark-mode .dark-mode-toggle .icon-sun { display: block; }
body.dark-mode .dark-mode-toggle .icon-moon { display: none; }

.hero {
    text-align: center;
    padding: 14px 8px 18px;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 1.7vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hero .subtitle {
    margin-top: 8px;
    font-size: 0.96rem;
    color: var(--ink-soft);
}

.tab-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.tab-btn {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    background: var(--bg-soft);
    color: var(--ink-soft);
    font-family: var(--font-main);
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    border-color: var(--brand-strong);
    color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.marquee-section {
    margin-bottom: 14px;
}

.marquee-label {
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.marquee-container {
    overflow: hidden;
    background: linear-gradient(135deg, #353b42 0%, #21262c 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: var(--shadow);
    padding: 10px 0;
}

.marquee-track {
    display: flex;
    gap: 14px;
    width: max-content;
    flex-wrap: nowrap;
    animation: marquee 18s linear infinite;
}

.marquee-track:hover { animation-play-state: paused; }

.marquee-container {
    overflow: hidden;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    padding: 8px 14px;
    display: flex;
    gap: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    white-space: nowrap;
    cursor: pointer;
}

.marquee-plate { color: #ffe47d; font-weight: 700; }
.marquee-price { color: rgba(255,255,255,0.84); font-size: 0.88rem; }

.search-card,
.filters-section,
.ranking-card,
.result-card,
.ranking-section,
.disclaimer {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.search-card,
.results-section,
.stats-section {
    border: 2px double color-mix(in srgb, var(--ink-soft) 48%, var(--line));
}

.search-card {
    padding: 18px;
    margin-bottom: 12px;
}

.search-input-wrapper {
    display: grid;
    grid-template-columns: 1fr 54px;
    gap: 8px;
    position: relative;
}

.search-input,
.filter-input,
.filter-select {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--ink);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    transition: 0.2s ease;
}

.search-input {
    font-size: 1.06rem;
    letter-spacing: 0.02em;
    padding: 13px 14px;
}

.search-input:focus,
.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 26%, transparent);
}

.search-input::placeholder,
.filter-input::placeholder {
    color: var(--ink-mute);
}

.btn-search {
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.search-hint {
    margin-top: 10px;
    color: var(--ink-mute);
    font-size: 0.79rem;
}

.autocomplete-dropdown,
.search-history-dropdown {
    position: absolute;
    left: 0;
    right: 60px;
    top: calc(100% + 6px);
    z-index: 60;
    display: none;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.autocomplete-dropdown.active,
.search-history-dropdown.active { display: block; }

.autocomplete-item,
.search-history-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.autocomplete-item:hover,
.search-history-item:hover { background: var(--brand-soft); }
.autocomplete-item:last-child,
.search-history-item:last-child { border-bottom: none; }
.autocomplete-no-result,
.search-history-empty { padding: 12px; color: var(--ink-mute); }

.search-history-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.78rem;
}

.clear-history-btn {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    padding: 2px 10px;
    font-size: 0.72rem;
    color: var(--ink-soft);
    cursor: pointer;
}

.filters-title {
    margin: 6px 4px 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.01em;
    color: var(--ink-soft);
}

.filters-section {
    padding: 14px;
    margin-bottom: 12px;
}

.filter-group + .filter-group {
    margin-top: 10px;
}

.filter-label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 0.79rem;
    font-weight: 600;
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.filter-input,
.filter-select { padding: 10px 12px; font-size: 0.88rem; }

.price-separator { color: var(--ink-mute); }

.filter-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
    background-position: calc(100% - 16px) 46%, calc(100% - 10px) 46%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.tags-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-btn {
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    cursor: pointer;
}

.tag-btn.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.tag-btn[data-tag="英文名字"].active { background: #165ca8; border-color: #165ca8; }
.tag-btn[data-tag="數字"].active { background: #2f8b4c; border-color: #2f8b4c; }
.tag-btn[data-tag="諧音"].active { background: #b86600; border-color: #b86600; }
.tag-btn[data-tag="汽車品牌"].active { background: #c0396f; border-color: #c0396f; }
.tag-btn[data-tag="品牌"].active { background: #6f39af; border-color: #6f39af; }
.tag-btn[data-tag="日期"].active { background: #6b5646; border-color: #6b5646; }
.tag-btn[data-tag="100萬以上"].active { background: #8a6a00; border-color: #8a6a00; }
.tag-btn[data-tag="1000萬以上"].active { background: #5a4600; border-color: #5a4600; }
.tag-btn[data-tag="其他"].active { background: #5c7486; border-color: #5c7486; }

.stats-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--brand-soft);
    border: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent);
}

.stat-item { color: var(--ink-soft); font-size: 0.86rem; }
.stat-item strong { color: var(--brand-strong); }

.results-section { display: none; }
.results-section.active { display: block; }

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.results-count { color: var(--ink-soft); font-size: 0.86rem; }

.btn-export {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--ink-soft);
    padding: 8px 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-export:hover { border-color: var(--brand); color: var(--brand); }

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

.result-card {
    position: relative;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 14px;
    padding: 14px;
    transition: 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.result-card:has(.result-plate-text) { cursor: pointer; }

.result-plate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 9px 14px;
    border-radius: 6px;
    background: var(--plate-bg);
    color: var(--plate-ink);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.result-plate.exact-match {
    background: url('../plate-bg.png') center/520px 110px no-repeat;
    width: 100%;
    min-width: 0;
    height: 92px;
    font-size: 1.8rem;
}

.result-plate-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.result-label {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--ink-mute);
}

.result-price {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--brand-strong);
    margin-top: 2px;
}

.result-year {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-top: 3px;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag {
    font-size: 0.69rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.tag.英文名字 { background: #e7f1fd; color: #1f5ea6; }
.tag.數字 { background: #e7f8ec; color: #24763d; }
.tag.諧音 { background: #fff2e3; color: #a85f00; }
.tag.汽車品牌 { background: #fde7ef; color: #ac2a63; }
.tag.品牌 { background: #f2e9ff; color: #6640a6; }
.tag.日期 { background: #f2ede9; color: #6b5646; }
body.dark-mode .tag.英文名字 { background: rgba(31, 94, 166, 0.3); color: #9ec6ff; }
body.dark-mode .tag.數字 { background: rgba(36, 118, 61, 0.3); color: #9fe7b3; }
body.dark-mode .tag.諧音 { background: rgba(168, 95, 0, 0.35); color: #ffce83; }
body.dark-mode .tag.汽車品牌 { background: rgba(172, 42, 99, 0.35); color: #f7aacd; }
body.dark-mode .tag.品牌 { background: rgba(102, 64, 166, 0.35); color: #ccb8ff; }
body.dark-mode .tag.日期 { background: rgba(107, 86, 70, 0.35); color: #d7c0b1; }

.btn-share,
.btn-wishlist {
    position: absolute;
    top: 10px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
}

.btn-share {
    right: 48px;
    display: grid;
    place-items: center;
    color: var(--ink-soft);
}

.btn-share:hover,
.btn-share.copied { background: var(--brand); border-color: var(--brand); color: #fff; }

.btn-wishlist {
    right: 10px;
    font-size: 1rem;
}

.result-detail {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
}

.result-detail .result-plate {
    width: 100%;
    height: 82px;
    min-width: 0;
    margin-bottom: 10px;
    background: url('../plate-bg.png') center/520px 110px no-repeat;
    font-size: 1.7rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
}

.detail-row span:first-child { color: var(--ink-soft); }
.detail-value { font-weight: 700; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.btn-page {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    background: var(--bg-soft);
    color: var(--ink-soft);
    cursor: pointer;
}

.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { color: var(--ink-soft); font-size: 0.85rem; }

.no-results { display: none; text-align: center; padding: 32px 12px; color: var(--ink-mute); }
.no-results.active { display: block; }

.ranking-section { padding: 16px; }
.ranking-header { text-align: center; margin-bottom: 12px; }
.ranking-header h2 { font-size: 1.2rem; }
.ranking-subtitle { color: var(--ink-soft); font-size: 0.84rem; margin-top: 4px; }

.ranking-list { display: flex; flex-direction: column; gap: 9px; }

.ranking-card {
    padding: 12px;
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    align-items: center;
    gap: 10px;
}

.ranking-rank { font-weight: 700; text-align: center; }
.ranking-plate { font-size: 1.02rem; font-weight: 700; letter-spacing: 0.04em; }
.ranking-stats { text-align: right; }
.ranking-sales { color: var(--ink-soft); font-size: 0.75rem; }
.ranking-price { color: var(--brand-strong); font-weight: 700; font-size: 0.84rem; }

.btn-wishlist-add {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
}

.wishlist-toggle {
    position: fixed;
    right: 24px;
    bottom: 22px;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #d84553 0%, #f9734c 100%);
    color: #fff;
    box-shadow: 0 16px 30px rgba(216, 69, 83, 0.4);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 120;
}

.wishlist-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    background: #fff;
    color: #d84553;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.wishlist-panel {
    position: fixed;
    right: 22px;
    bottom: 90px;
    width: min(340px, calc(100vw - 24px));
    max-height: 420px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    z-index: 121;
}

.wishlist-panel.open { transform: translateY(0); opacity: 1; visibility: visible; }

.wishlist-header,
.wishlist-actions {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wishlist-actions { border-bottom: none; border-top: 1px solid var(--line); }
.wishlist-title { font-weight: 700; flex: 1; }
.wishlist-close {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--ink-soft);
    cursor: pointer;
}

.wishlist-items { padding: 10px; overflow: auto; max-height: 270px; }
.wishlist-empty { text-align: center; color: var(--ink-mute); padding: 20px 8px; }

.wishlist-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.wishlist-item + .wishlist-item { margin-top: 7px; }
.wishlist-item-price { color: var(--brand-strong); font-size: 0.8rem; font-weight: 700; }
.wishlist-item-remove {
    width: 24px;
    height: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--ink-soft);
    cursor: pointer;
}

.btn-compare,
.btn-clear-wishlist {
    flex: 1;
    border-radius: var(--radius-sm);
    padding: 9px;
    font-family: var(--font-main);
    cursor: pointer;
}

.btn-compare {
    border: none;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
}

.btn-compare:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-clear-wishlist {
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--ink-soft);
}

.compare-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 17, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 170;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
}

.compare-modal.active { opacity: 1; visibility: visible; }

.compare-content {
    width: min(560px, calc(100vw - 24px));
    max-height: 82vh;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.compare-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 1.25rem;
}

.compare-grid { padding: 14px; overflow: auto; max-height: calc(82vh - 64px); display: grid; gap: 10px; }

.compare-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    padding: 12px;
}

.compare-plate { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.05em; }
.compare-price { color: var(--brand-strong); font-weight: 700; margin-top: 4px; }
.compare-bar { height: 8px; border-radius: var(--radius-sm); background: var(--line); margin: 8px 0; overflow: hidden; }
.compare-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand) 0%, #46c97f 100%); }
.compare-year { color: var(--ink-soft); font-size: 0.8rem; margin-bottom: 8px; }
.compare-remove {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px;
    background: var(--bg-soft);
    color: var(--ink-soft);
    cursor: pointer;
}

.disclaimer {
    margin-top: 16px;
    padding: 12px;
    text-align: center;
}

.disclaimer p { color: var(--ink-mute); font-size: 0.73rem; }

.footer-social {
    margin-top: 8px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    background: var(--bg-elevated);
}

.footer-social a:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.footer-brand { margin-top: 6px; color: var(--ink-soft) !important; font-weight: 700; }

*:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

@media (max-width: 860px) {
    .app-container { width: calc(100% - 16px); margin-top: 10px; padding: 12px; }
    .result-card { grid-template-columns: 1fr; }
    .result-plate.exact-match { height: 72px; font-size: 1.3rem; background-size: 360px 78px; }
    .result-detail .result-plate { height: 72px; font-size: 1.3rem; background-size: 360px 78px; }
}

@media (max-width: 520px) {
    .hero h1 { font-size: 1.35rem; }
    .site-name { font-size: 1rem; }
    .search-input-wrapper { grid-template-columns: 1fr 48px; }
    .autocomplete-dropdown,
    .search-history-dropdown { right: 54px; }
    .ranking-card { grid-template-columns: 40px 1fr; gap: 8px; }
    .ranking-stats { grid-column: 2; display: flex; justify-content: space-between; text-align: left; }
    .btn-wishlist-add { position: absolute; right: 12px; }
    .wishlist-toggle { right: 14px; bottom: 14px; width: 52px; height: 52px; }
    .wishlist-panel { right: 10px; bottom: 78px; }
}

/* Marquee Tag Selection */
.marquee-tag-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.discover-label {
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-weight: 600;
}

.discover-select {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--ink);
    font-family: var(--font-main);
    padding: 8px 12px;
    min-width: 180px;
}

.discover-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

/* Stats Section - Year Chart */
.stats-section {
    padding: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.stats-header {
    text-align: center;
    margin-bottom: 14px;
}

.stats-header h2 {
    font-size: 1.2rem;
}

.stats-subtitle {
    color: var(--ink-soft);
    font-size: 0.84rem;
    margin-top: 4px;
}

.year-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.year-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.year-bar {
    width: 28px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
    cursor: pointer;
    transition: 0.2s ease;
    position: relative;
}

.year-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.year-bar.active {
    background: linear-gradient(180deg, var(--warn) 0%, #d48200 100%);
}

.year-bar-label {
    font-size: 0.68rem;
    color: var(--ink-mute);
    font-weight: 600;
}

.year-bar-count {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    color: var(--ink-soft);
    white-space: nowrap;
    font-weight: 600;
}

.year-detail {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 4px;
}

.year-detail-header {
    text-align: center;
    margin-bottom: 10px;
}

.year-detail-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-strong);
}

.year-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.year-stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.year-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-strong);
}

.year-stat-plate {
    font-size: 0.95rem;
    line-height: 1.25;
    word-break: break-word;
}

.year-stat-label {
    font-size: 0.72rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

/* Result Plate Age */
.result-age {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--ink-mute);
    margin-top: 4px;
    padding: 2px 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.result-age-icon {
    font-size: 0.75rem;
}
