:root {
    --bg: #ffffff;
    --text: #222;
    --muted: #6b7280;
    --primary: #111827;
    --accent: #0ea5e9;
    --card: #f9fafb;
    --shadow: 0 4px 12px rgba(0, 0, 0, .08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

.inline-icon {
    width: 10em;
    /* 相對字體大小自適應 */
    height: auto;
    /* 高度自動保持比例 */
    vertical-align: middle;
    /* 垂直對齊文字 */
    margin-right: 0.3em;
    /* 圖片與文字間距 */
}

img {
    pointer-events: none;
    /* 完全禁用滑鼠事件 */
}

/*文字加粗跟顏色大小*/
.red-bold {
    color: red;
    font-weight: bold;
    font-size: 20px;
}

.blue-bold {
    color: blue;
    font-weight: bold;
    font-size: 22px;
}

/* 超連結樣式 */
/* 整段文字 <p> */
.highlight-text {
    font-weight: bold;
    /* ✅ 整段都粗體 */
    font-size: 1rem;
    /* 字體大小（可隨裝置調整） */
    line-height: 1.6;
    /* 行距舒適 */
    color: #333;
    /* 預設字色深灰，比黑色柔和 */
}

.highlight-link {
    display: inline-block;
    background-color: red;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    /* 相對單位，自適應 */
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* 滑鼠移上去效果 */
.highlight-link:hover {
    background-color: darkred;
    /* 顏色變深 */
    transform: scale(1.05);
    /* 微微放大 */
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Apple Color Emoji, Noto Color Emoji, "PingFang TC", "Microsoft JhengHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-user-select: none;
    /* Chrome / Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE / Edge */
    user-select: none;
    /* 標準語法 */
}

a {
    color: inherit;
    text-decoration: none;
}

#navbar {
    min-height: 0;
    /* 為載入提示或漢堡選單預留空間 */
}

#products {
    font-size: 100%;
}


.main-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 110px);
    /* 為 footer 和 navbar 預留空間 */
}

/* 側邊欄 (桌面預設顯示) */
.sidebar {
    width: 220px;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar .logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.sidebar .logo-text .line1 {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.sidebar .logo-text .line2 {
    font-size: 12px;
    color: #ccc;
}

.sidebar h2 {
    margin-top: 20px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar h2 .arrow {
    transition: transform 0.3s;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    transition: all 0.3s ease;
    display: none;
}

.sidebar ul.active {
    display: block;
}

.sidebar ul a {
    color: #ccc;
    text-decoration: none;
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.sidebar ul a:hover {
    background: #333;
}

/* 主要內容區 */
.content {
    flex: 1;
    padding: 20px;
    margin-left: 220px;
    /* 為側邊欄預留空間 */
    max-width: 100%;
    overflow-x: hidden;
}

/* 跑馬燈外框 */
.marquee-container {
    position: absolute;
    bottom: 83px;
    /* 距離搜尋欄底部 */
    width: 50%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    /* 半透明黑 */
    border-radius: 12px;
    padding: 10px 15px;
    overflow: hidden;
    z-index: 2;
    /* 確保在遮罩前面 */
}

/* 跑馬燈文字 */
.marquee-wrapper {
    width: 50%;
    height: 40px;
    /* 可改高度 */
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#marquee-text {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 14px;
    /* 文字大小 */
    opacity: 0;
    transform: translateY(40px);
    /* 從下方開始 */
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* 手機自適應 */
@media (max-width: 768px) {
    .marquee {
        font-size: 14px;
    }

    .marquee-container {
        bottom: 15px;
        padding: 8px 12px;
    }
}

/* 搜尋區塊 */
.search-container {
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: url('../assets/hero-bg.png');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
    margin-bottom: 20px;
    height: 345px;
    gap: 10px;
}

.search-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
    border-radius: 8px;
}

.search-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.search-container input {
    padding: 12px;
    width: 100%;
    max-width: 300px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background: #fff;
}

.search-container button {
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-container button:hover {
    background: #0284c7;
}

.search-icon {
    font-size: 18px;
}

.content h1 {
    color: #000;
    margin-bottom: 20px;
    font-size: 24px;
}

/* 商品格子 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.hot-tag {
    position: absolute;
    top: 5%;
    /* 上下0.25em 左右0.8em → 文字與框更寬 */
    padding: 0.25em 0.8em;
    /* 百分比定位 */
    right: 1%;
    font-size: clamp(0.55rem, 1.2vw, 0.65rem);
    /* 小字體，自適應 */
    font-weight: 700;
    color: #fff;
    /* 文字顏色 */
    /*border: 1px solid #ff3b3b;*/
    /* 紅色框線 */
    /*padding: 0.15em 0.4em;*/
    /* 框內距 */
    border-radius: 2px;
    /* 圓角小一些 */
    background-color: transparent;
    /* 透明底色 */
    z-index: 10;
    line-height: 1;
    text-align: center;
    background: linear-gradient(90deg, #ff3b3b 0%, #ff7a3b 100%);
}

.product-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    margin-left: 10px;
    flex-grow: 1;
}

.product-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.product-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* 頁尾 */
.footer {
    margin-top: 40px;
    padding: 15px;
    border-top: 1px solid #eee;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    background: #f5f5f5;
}

/* 漢堡選單按鈕 */
.menu-toggle {
    display: none;
    background: #1a1a1a;
    color: #fff;
    padding: 10px 15px;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
}

/* 手機版 */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: fixed;
        top: 50px;
        left: 0;
        background: #1a1a1a;
        flex-direction: column;
        z-index: 1000;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }

    .sidebar.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .menu-toggle {
        display: block;
    }

    .content {
        padding: 10px;
        margin-left: 0;
        margin-top: 50px;
    }

    .search-container {
        padding: 10px;
        height: 150px;
    }

    .search-container input {
        max-width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .content h1 {
        font-size: 20px;
    }

    .footer {
        font-size: 11px;
        padding: 10px;
    }
}


/* 平板調整 */
@media (max-width: 768px) {
    .hot-tag {
        font-size: clamp(0.5rem, 2vw, 0.6rem);
        padding: 0.22em 0.7em;
        top: 4.5%;
        right: 4.5%;
    }
}

/* 手機調整 */
@media (max-width: 480px) {
    .hot-tag {
        font-size: clamp(0.45rem, 3vw, 0.55rem);
        padding: 0.2em 0.6em;
        top: 4%;
        right: 4%;
    }
}

/* 超小螢幕（<360px）微調 */
@media (max-width: 360px) {
    .hot-tag {
        font-size: clamp(0.4rem, 3.5vw, 0.5rem);
        padding: 0.18em 0.5em;
        top: 3.5%;
        right: 3.5%;
    }
}
