/* ==========================================================
   前台樣式：杏子色的小日子（溫馨杏色風）
   結構：設計 token（primitive → semantic）→ 基礎 → 版面 → 元件 → 響應式
   標題字型：粉圓體 Huninn（SIL OFL 1.1，可商用免費）
   ========================================================== */

/* ---------- 設計 token ---------- */
:root {
    /* primitive：杏色系 */
    --apricot-25: #fffaf4;
    --apricot-50: #fff3e6;
    --apricot-100: #fde6d0;
    --apricot-200: #f9d2b0;
    --apricot-300: #f4bb8e;
    --apricot-400: #ec9d68;
    --apricot-600: #b95c2b;
    --apricot-700: #9e4a1e;
    --brown-900: #4a3226;
    --brown-600: #85654f;
    --sage-300: #b9cfb8;
    --sage-600: #5f8564;
    --white: #ffffff;

    /* semantic */
    --bg: var(--apricot-25);
    --surface: var(--white);
    --surface-warm: var(--apricot-50);
    --text: var(--brown-900);
    --text-soft: var(--brown-600);
    --border: #f1dcc6;
    --accent: var(--apricot-600);
    --accent-hover: var(--apricot-700);
    --accent-soft: var(--apricot-100);
    --leaf: var(--sage-600);

    --font-display: "Huninn", "jf-openhuninn", "PingFang TC", "Microsoft JhengHei", sans-serif;
    --font-body: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;

    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 28px;
    --shadow-1: 0 2px 6px rgba(150, 90, 50, .06), 0 8px 24px rgba(150, 90, 50, .07);
    --shadow-2: 0 4px 10px rgba(150, 90, 50, .08), 0 18px 40px rgba(150, 90, 50, .14);
    --ease: cubic-bezier(.25, .8, .25, 1);
}

/* ---------- 基礎 ---------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background:
        radial-gradient(900px 500px at 8% -10%, rgba(249, 210, 176, .55), transparent 70%),
        radial-gradient(700px 420px at 100% 0%, rgba(185, 207, 184, .28), transparent 70%),
        var(--bg);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    color: var(--accent);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--apricot-400);
    outline-offset: 3px;
    border-radius: 6px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: .02em;
}

#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 24px 72px;
    flex: 1;
}

/* ---------- 頁首 ---------- */
.site_header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 250, 244, .86);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}

.site_header_inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site_logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.site_logo_icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.site_logo_text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.site_logo_name {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: .03em;
}

.site_tagline {
    font-size: 12px;
    color: var(--text-soft);
    letter-spacing: .12em;
}

.site_nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.site_nav a {
    padding: 8px 18px;
    border-radius: 99px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background .2s var(--ease), color .2s var(--ease);
}

.site_nav a:hover {
    background: var(--accent-soft);
}

.site_nav a.site_nav_active {
    background: var(--text);
    color: var(--apricot-25);
}

/* ---------- 通用元件 ---------- */
.breadcrumb {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--text-soft);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.section_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 64px 0 22px;
}

.section_head:first-child {
    margin-top: 0;
}

.section_title {
    margin: 0;
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* 標題前的小葉子 */
.section_title::before {
    content: "";
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ec9d68' d='M5 19C5 10 11 4 21 3c-1 10-7 16-16 16Z'/%3E%3Cpath fill='none' stroke='%23b95c2b' stroke-width='1.6' stroke-linecap='round' d='M5 19 14 10'/%3E%3C/svg%3E") center / contain no-repeat;
}

.section_more {
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--accent-soft);
    color: var(--accent);
    white-space: nowrap;
    transition: background .2s var(--ease);
}

.section_more:hover {
    background: var(--apricot-200);
}

.empty_text {
    grid-column: 1 / -1;
    padding: 48px 16px;
    text-align: center;
    color: var(--text-soft);
    background: var(--surface-warm);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    list-style: none;
}

.tag_ad {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .08em;
    padding: 1px 10px;
    border-radius: 99px;
    background: var(--surface-warm);
    color: var(--text-soft);
}

/* 沒有圖片時的暖色占位圖（中間放一個小提袋圖示） */
.thumb_ph {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23fff3e6' stroke='%23e0a072' stroke-width='2.5' stroke-linejoin='round' d='M14 22h36l-3 32H17z'/%3E%3Cpath fill='none' stroke='%23e0a072' stroke-width='2.5' stroke-linecap='round' d='M24 26v-6a8 8 0 0 1 16 0v6'/%3E%3Ccircle cx='32' cy='38' r='5' fill='%23f4bb8e'/%3E%3C/svg%3E") center / 64px no-repeat,
        radial-gradient(circle at 30% 25%, var(--apricot-50), var(--apricot-100));
}

/* ---------- 首頁：歡迎區 + 焦點文章 ---------- */
.home_welcome {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 32px;
    align-items: center;
    margin-bottom: 8px;
    animation: rise .6s var(--ease) both;
}

.home_welcome_hi {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--leaf);
}

.home_welcome_title {
    margin: 0 0 14px;
    font-size: clamp(30px, 4.2vw, 46px);
    line-height: 1.35;
}

.home_welcome_title em {
    font-style: normal;
    color: var(--accent);
    background: linear-gradient(transparent 62%, var(--apricot-200) 62%);
    padding: 0 4px;
}

.home_welcome_text {
    margin: 0;
    color: var(--text-soft);
    max-width: 30em;
}

.home_hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border);
}

.home_hero_body {
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home_hero_kicker {
    align-self: flex-start;
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 3px 12px;
    border-radius: 99px;
}

.home_hero_title {
    margin: 0 0 10px;
    font-size: 22px;
}

.home_hero_title a {
    color: var(--text);
    text-decoration: none;
}

.home_hero_title a:hover {
    color: var(--accent);
}

.home_hero_summary {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home_hero_media {
    background: var(--white);
    border-left: 1px solid var(--border);
    min-height: 260px;
}

.home_hero_media img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: contain;
    padding: 18px;
    display: block;
}

.home_hero_media .thumb_ph {
    min-height: 260px;
}

.btn_read {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--accent);
    color: var(--white);
    border-radius: 99px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(185, 92, 43, .25);
    transition: background .2s var(--ease), transform .2s var(--ease);
}

.btn_read:hover {
    background: var(--accent-hover);
    color: var(--white);
    transform: translateY(-2px);
}

/* ---------- 文章卡片（橫式：圖左字右，數量少也不會空蕩）---------- */
.post_cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.post_card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
    animation: rise .6s var(--ease) both;
}

.post_card:nth-child(2) { animation-delay: .05s; }
.post_card:nth-child(3) { animation-delay: .1s; }
.post_card:nth-child(4) { animation-delay: .15s; }
.post_card:nth-child(5) { animation-delay: .2s; }
.post_card:nth-child(6) { animation-delay: .25s; }

.post_card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
}

.post_card_thumb {
    display: block;
    background: var(--white);
    border-right: 1px solid var(--border);
    overflow: hidden;
    min-height: 150px;
}

.post_card_thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    display: block;
    transition: transform .4s var(--ease);
}

.post_card:hover .post_card_thumb img {
    transform: scale(1.05);
}

.post_card_body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}

.post_card_title {
    margin: 0 0 6px;
    font-size: 17px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post_card_title a {
    color: var(--text);
    text-decoration: none;
}

.post_card_title a:hover {
    color: var(--accent);
}

.post_card_summary {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post_card_meta {
    margin: auto 0 0;
    font-size: 12px;
    color: var(--text-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* ---------- 文章明細 ---------- */
.post_detail {
    max-width: 760px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 44px 52px 48px;
    box-shadow: var(--shadow-1);
}

.post_detail_title {
    font-size: clamp(26px, 4vw, 36px);
    margin: 0 0 12px;
}

.post_detail_meta {
    color: var(--text-soft);
    font-size: 14px;
    margin: 0 0 24px;
}

.affiliate_disclosure {
    background: var(--surface-warm);
    padding: 12px 18px;
    font-size: 13px;
    color: var(--text-soft);
    margin: 0 0 30px;
    border-radius: var(--radius-sm);
}

.post_detail_content {
    font-size: 17px;
    line-height: 2;
}

.post_detail_content h2,
.post_detail_content h3 {
    margin: 40px 0 12px;
    font-size: 22px;
}

.post_detail_content p {
    margin: 0 0 1.2em;
}

.post_detail_content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.post_detail_content blockquote {
    margin: 1.4em 0;
    padding: 6px 20px;
    background: var(--surface-warm);
    border-left: 5px solid var(--apricot-300);
    color: var(--text-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post_detail_content blockquote p {
    margin: .7em 0;
}

.post_detail_content a {
    font-weight: 700;
    text-underline-offset: 4px;
    text-decoration-color: var(--apricot-300);
    text-decoration-thickness: 2px;
}

.post_detail_content a:hover {
    color: var(--accent-hover);
}

/* 推薦商品卡（文章下方） */
.post_product {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 40px 0 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--apricot-50), var(--apricot-100));
    border-radius: var(--radius);
}

.post_product_img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--white);
    padding: 6px;
    flex-shrink: 0;
}

.post_product_info {
    flex: 1;
    min-width: 0;
}

.post_product_label {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--leaf);
}

.post_product_name {
    margin: 0 0 4px;
    font-weight: 700;
}

.post_product_price {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ---------- 商品櫥窗 ---------- */
.product_tabs {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    margin-bottom: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 99px;
}

.product_tabs a {
    padding: 8px 22px;
    border-radius: 99px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background .2s var(--ease), color .2s var(--ease);
}

.product_tabs a:hover {
    background: var(--accent-soft);
}

.product_tabs a.product_tab_active {
    background: var(--accent);
    color: var(--white);
}

.product_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.product_card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-1);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
    animation: rise .6s var(--ease) both;
}

.product_card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
}

.product_card_img {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 240px; /* 商品少、卡片被撐寬時，圖區不要變得太高 */
    object-fit: contain;
    padding: 14px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: block;
}

div.product_card_img {
    padding: 0;
}

.product_card_body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product_card_name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product_card_desc {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product_card_price {
    font-size: 18px;
    color: var(--accent);
    font-weight: 800;
    margin: 0 0 10px;
    font-variant-numeric: tabular-nums;
}

.product_card_link,
.btn_buy {
    display: block;
    margin-top: auto;
    text-align: center;
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s var(--ease), color .2s var(--ease);
}

.product_card_link:hover {
    background: var(--accent);
    color: var(--white);
}

.btn_buy {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 11px 26px;
    box-shadow: 0 6px 14px rgba(185, 92, 43, .25);
}

.btn_buy:hover {
    background: var(--accent-hover);
    color: var(--white);
}

/* ---------- 分頁 ---------- */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination a,
.pagination_current {
    min-width: 42px;
    padding: 8px 12px;
    text-align: center;
    border-radius: 99px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    transition: background .2s var(--ease);
}

.pagination a:hover {
    background: var(--accent-soft);
}

.pagination_current {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* ---------- 頁尾 ---------- */
.site_footer {
    position: relative;
    margin-top: 40px;
    background: var(--apricot-100);
    color: var(--text);
}

/* 頁尾上緣的波浪 */
.site_footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -28px;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 30' preserveAspectRatio='none'%3E%3Cpath fill='%23fde6d0' d='M0 30V15C150 0 300 0 450 12S750 30 900 15 1100 0 1200 10V30Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.site_footer_inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 30px 24px 34px;
    font-size: 13px;
    text-align: center;
}

.site_footer_inner p {
    margin: 4px 0;
    color: var(--text-soft);
}

.site_footer_logo {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text) !important;
}

/* ---------- 動畫 ---------- */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- 響應式 ---------- */
@media (max-width: 960px) {
    .home_welcome { grid-template-columns: 1fr; gap: 22px; }
    .post_cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    #content { padding: 20px 16px 56px; }
    .site_header_inner { padding: 10px 16px; flex-wrap: wrap; }
    .site_tagline { display: none; }
    .site_nav a { padding: 6px 12px; font-size: 14px; }
    .home_hero { grid-template-columns: 1fr; }
    .home_hero_media { order: -1; min-height: 200px; border-left: 0; border-bottom: 1px solid var(--border); }
    .home_hero_media img, .home_hero_media .thumb_ph { min-height: 200px; }
    .post_card { grid-template-columns: 112px minmax(0, 1fr); }
    .post_card_thumb { min-height: 120px; }
    .product_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .post_detail { padding: 26px 20px 30px; border-radius: var(--radius); }
    .post_product { flex-direction: column; text-align: center; }
    .section_head { margin-top: 48px; }
}
