/* 首頁(公開零件搜尋)專用樣式;企業色票來自 member-ui.css(橘 #CC7341、深橘 #A34E24、深棕 #3A332E、金 #E5BD42) */
body[data-page="home"] { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 520px at 50% -120px, #FBEBDD 0%, var(--bg) 65%); }

/* 頂部列:淺色底,右側「登入」為描邊按鈕、「註冊」為實心主色 */
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; }
.home-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--dark); }
.home-brand .mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--orange); color: #211811; font-size: 16px; }
.home-nav { display: flex; align-items: center; gap: 10px; }
.home-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 20px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s; }
.nav-login { color: var(--dark); border: 1px solid #D8C3B4; background: rgba(255, 255, 255, .7); }
.nav-login:hover { background: #fff; border-color: var(--orange); color: var(--brand); }
.nav-register { background: var(--orange); color: #211811; border: 1px solid var(--orange); }
.nav-register:hover { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(163, 78, 36, .28); }

/* 主區塊 */
.home-main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px 24px; }
.hero { text-align: center; padding: 9vh 0 30px; transition: padding .25s; }
.hero-title { font-size: clamp(30px, 5vw, 48px); line-height: 1.25; margin: 0 0 10px; letter-spacing: 1px; color: var(--dark); }
.hero-title span { color: var(--brand); }
.hero-sub { color: var(--muted); font-size: 16px; margin: 0 0 28px; }

/* Google 風格的置中大搜尋框:圓角膠囊、淡陰影、聚焦時加深 */
.searchbox { display: flex; align-items: center; gap: 10px; width: min(720px, 100%); margin: 0 auto; padding: 6px 6px 6px 20px; background: #fff; border: 1px solid #E2D2C5; border-radius: 999px; box-shadow: 0 2px 10px rgba(58, 51, 46, .08); transition: box-shadow .2s, border-color .2s; }
.searchbox:hover { box-shadow: 0 4px 18px rgba(58, 51, 46, .13); }
.searchbox:focus-within { border-color: var(--orange); box-shadow: 0 4px 22px rgba(204, 115, 65, .25); }
.icon-search { flex: none; color: #A09186; }
.searchbox input[type="search"] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 4px; font-size: 17px; min-height: 48px; outline: 0; box-shadow: none; }
.qty-wrap { display: flex; align-items: center; gap: 6px; flex: none; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.qty-wrap input { width: 84px; border: 1px solid transparent; background: var(--bg); border-radius: 999px; padding: 6px 10px; min-height: 36px; text-align: center; }
.qty-wrap input:focus { border-color: var(--orange); outline: 0; }
.searchbox button { flex: none; border-radius: 999px; min-height: 46px; padding: 0 28px; background: var(--orange); border-color: var(--orange); color: #211811; font-weight: 700; font-size: 16px; }
.searchbox button:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); color: #fff; }
.searchbox input:focus-visible, .searchbox button:focus-visible { outline: 3px solid var(--gold, #E5BD42); outline-offset: 2px; }

/* 範例料號 */
.examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.chip { min-height: 32px; padding: 3px 14px; border-radius: 999px; background: #fff; color: var(--brand); border: 1px solid #E2D2C5; font-size: 13.5px; }
.chip:hover { background: var(--soft); border-color: var(--orange); color: var(--brand); }

/* 介紹卡片 */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 920px; margin: 36px auto 0; }
.feature { background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 14px; padding: 22px; text-align: center; }
.feature h3 { margin: 10px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.f-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--soft); color: var(--brand); font-size: 20px; font-weight: 800; }

/* 搜尋後:搜尋框縮到上方,隱藏介紹卡片與範例 */
body.searched .hero { padding: 12px 0 18px; }
body.searched .hero-title, body.searched .hero-sub, body.searched .features, body.searched .examples { display: none; }

/* 結果表格 */
.home-main h2 { margin-bottom: 10px; }
.home-main td.num, .home-main th.num { text-align: right; white-space: nowrap; }
.mask { letter-spacing: 1px; color: var(--muted); font-family: Consolas, monospace; }
.breaks { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tag { display: inline-block; background: var(--soft); color: #783918; border-radius: 12px; padding: 2px 9px; font-size: 12.5px; white-space: nowrap; }
.price { font-weight: 700; white-space: nowrap; }

.home-foot { text-align: center; padding: 18px 12px 26px; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
    .home-top { padding: 12px 14px; }
    .home-brand { font-size: 15px; }
    .home-nav a { padding: 0 14px; min-height: 36px; font-size: 14px; }
    .hero { padding: 5vh 0 22px; }
    .hero-sub { font-size: 14px; }
    /* 手機:搜尋框改為上下排列,避免擠在同一行 */
    .searchbox { flex-wrap: wrap; border-radius: 22px; padding: 10px 12px; }
    .searchbox input[type="search"] { flex: 1 1 calc(100% - 40px); }
    .qty-wrap { border-left: 0; padding-left: 0; flex: 1; }
    .searchbox button { flex: 1; }
    .features { grid-template-columns: 1fr; margin-top: 24px; }
}

/* 輸入框本身不畫聚焦外框(共用樣式會加金色框),改由整個搜尋框的外圈亮起 */
.searchbox input[type="search"]:focus, .searchbox input[type="search"]:focus-visible { outline: 0; box-shadow: none; border: 0; }
.searchbox input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.hero, .searchbox { max-width: 100%; }
.hero-title { overflow-wrap: anywhere; }

/* 沒有結果的說明、即時報價提示 */
#emptyState { padding: 30px 20px; }
#emptyState p { margin: 6px 0 0; }
.live-notice { margin: 4px 0 22px; padding: 14px 18px; background: #FFF7E3; border-left: 4px solid var(--gold, #E5BD42); border-radius: 6px; color: var(--dark); }
.live-notice p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.empty-actions .button { border-radius: 999px; padding: 8px 22px; }
.empty-actions .button:not(.secondary) { background: var(--orange); border-color: var(--orange); color: #211811; font-weight: 700; }
