/* =====================================================
   黃金價格行情網 — 簡潔大氣 · App Window 設計系統
   靈感來源：Lenovo App Store 截圖 + web.baiwang.com
   核心特徵：圓角 App 容器 / 柔和漸層光斑背景 /
            潔白卡片網格 / 克制金彩 / 大量留白
   載入於 tech.css 之後，全站覆蓋
   ===================================================== */

/* ── 全局變量（App Window 金調） ── */
:root {
    /* 底色 */
    --bg-page: #f7f6f3;
    --bg-window: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fefdfb;
    --bg-hero-from: linear-gradient(135deg, #fdf8ee 0%, #fbf3d8 40%, #f9ecd0 100%);
    --bg-hero-gold: linear-gradient(135deg, #E8D5A8 0%, #D4B96A 50%, #C9A24B 100%);
    --bg-ticker: #fffcf2;

    /* 邊框 */
    --border-light: #f0ede5;
    --border-soft: #e8e4db;
    --border-gold: rgba(201, 162, 75, 0.28);
    --border-gold-strong: rgba(201, 162, 75, 0.55);

    /* 金色 */
    --gold-50: #FBF7EF;
    --gold-100: #F5EBD1;
    --gold-200: #E8D5A8;
    --gold-300: #D4B96A;
    --gold-400: #C9A24B;
    --gold-500: #B8902F;
    --gold-600: #9A7826;

    /* 文字 */
    --text-primary: #1a1814;
    --text-secondary: #5c564a;
    --text-muted: #9e9890;
    --text-on-gold: #3d2e0f;

    /* 功能色（台灣：紅漲綠跌） */
    --up-color: #D8463B;
    --down-color: #2BA85F;
    --up-bg: rgba(216, 70, 59, 0.06);
    --down-bg: rgba(43, 168, 95, 0.06);

    /* 陰影 */
    --shadow-sm: 0 1px 3px rgba(26, 24, 20, 0.04);
    --shadow-md: 0 4px 16px rgba(26, 24, 20, 0.07);
    --shadow-lg: 0 12px 40px rgba(26, 24, 20, 0.10);
    --shadow-xl: 0 20px 60px rgba(26, 24, 20, 0.12);
    --shadow-gold: 0 4px 20px rgba(201, 162, 75, 0.15);
    --shadow-window: 0 8px 48px rgba(22, 18, 12, 0.08), 0 2px 8px rgba(22, 18, 12, 0.04);

    /* 圓角 */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
}

/* ── body：柔和漸層光斑背景（對應截圖2的 blob 效果） ── */
body {
    background: var(--bg-page) !important;
    background-image:
        radial-gradient(ellipse 80% 55% at 15% 10%, rgba(232, 213, 168, 0.45) 0%, transparent 58%),
        radial-gradient(ellipse 65% 50% at 82% 18%, rgba(212, 185, 106, 0.30) 0%, transparent 52%),
        radial-gradient(ellipse 55% 45% at 68% 82%, rgba(251, 247, 239, 0.70) 0%, transparent 48%),
        radial-gradient(ellipse 40% 35% at 8% 88%, rgba(232, 213, 168, 0.30) 0%, transparent 46%) !important;
    background-attachment: fixed !important;
    color: var(--text-primary) !important;
    font-family: -apple-system, 'PingFang TC', 'Microsoft JhengHei', 'Segoe UI', sans-serif !important;
    line-height: 1.7 !important;
    -webkit-font-smoothing: antialiased;
}
body::before { content: none !important; }
a { color: var(--gold-500); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-400); }

/* ── App Window 主容器（對應截圖1的圓角窗口） ── */
main.container {
    background: var(--bg-window);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-window);
    padding: 28px 24px 36px !important;
    margin-top: 20px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
}

/* ── 導航欄（浮動、潔白、輕盈） ── */
.navbar {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 10px 0 !important;
}
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link,
.navbar .nav-link { color: var(--text-primary) !important; font-weight: 500; font-size: 0.93rem; }
.navbar-brand.logo img { filter: none !important; max-height: 34px; }

.nav-item.hover .nav-link,
.nav-item:hover .nav-link {
    color: var(--gold-500) !important;
    background: transparent !important;
    border-bottom: 2.5px solid var(--gold-400) !important;
    border-radius: 0;
}
.nav-link:hover { background: var(--gold-50) !important; border-radius: var(--radius-sm); }
#mobileSearchBtn { color: var(--text-primary) !important; }
.navbar-toggler-icon { filter: none !important; }
.navbar-toggler { border-color: var(--border-soft) !important; border-radius: var(--radius-sm); }

/* ── 搜尋框（圓角膠囊） ── */
.form-control {
    background: var(--bg-page) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-full) !important;
    color: var(--text-primary) !important;
    padding-left: 16px !important;
    font-size: 0.88rem;
}
.form-control::placeholder { color: var(--text-muted) !important; }
.form-control:focus {
    border-color: var(--gold-400) !important;
    box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.12) !important;
    background: #fff !important;
}
.btn-outline-light {
    border: 1px solid var(--border-soft) !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border-radius: var(--radius-full) !important;
    padding: 6px 16px !important;
}
.btn-outline-light:hover {
    background: var(--gold-400) !important;
    color: #fff !important;
    border-color: var(--gold-400) !important;
}

/* ── 行情跑馬燈（淺金底，細邊） ── */
.ticker-bar {
    background: var(--bg-ticker) !important;
    border-bottom: 1px solid var(--border-gold) !important;
    color: var(--text-secondary) !important;
    font-size: 0.84rem;
    padding: 8px 0 !important;
}

/* ── 區塊標題（金豎線 + 墨字） ── */
.section-title {
    border-left: 4px solid var(--gold-400) !important;
    color: var(--text-primary) !important;
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    padding-left: 14px !important;
    margin-bottom: 18px !important;
    background: transparent !important;
}
h4.section-title, h6.section-title { border-left: 4px solid var(--gold-400) !important; }
.content-box .title,
.content-box h1.title {
    color: var(--text-primary) !important;
    text-shadow: none !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 800 !important;
}

/* ── 卡片（潔白 + 柔和陰影） ── */
.content-box {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 22px 24px !important;
    margin-bottom: 20px !important;
    transition: box-shadow .25s, border-color .25s;
}
.content-box:hover {
    border-color: var(--border-gold) !important;
    box-shadow: var(--shadow-md) !important;
}

/* ── 去背景變體：您可能也喜歡（首頁右欄）── */
.content-box.content-box--bare {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 24px !important;
}
.content-box.content-box--bare .list-group-item,
.content-box.content-box--bare .list-group-item-action {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.content-box.content-box--bare .list-group-item:last-child {
    border-bottom: none !important;
}
.content-box.content-box--bare .list-group-item-action:hover,
.content-box.content-box--bare .list-group-item-action:focus {
    background: transparent !important;
    color: var(--gold-500) !important;
}

/* ── 行情列表容器 ── */
.list-container {
    border: 1px solid var(--border-light) !important;
    background: #fff !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}
.list-container ul { margin: 0; padding: 0; }

/* ── 表頭（金調漸層底） ── */
.list-header {
    background: linear-gradient(90deg, var(--gold-100), var(--gold-50)) !important;
    border-bottom: 1px solid var(--border-gold) !important;
    color: var(--gold-600) !important;
    font-weight: 600 !important;
    font-size: 0.83rem !important;
    letter-spacing: .3px;
    padding: 12px 16px !important;
    display: flex;
    align-items: center;
}
.list-header > div { padding: 0 6px; }

/* ── 行情行（卡片化列表項） ── */
.list-item {
    display: flex;
    align-items: center;
    padding: 13px 16px !important;
    border-bottom: 1px solid var(--border-light) !important;
    transition: background .18s;
    font-size: 0.89rem;
}
.list-item:last-child { border-bottom: none !important; }
.list-item:hover {
    background: var(--bg-card-hover) !important;
}
.list-item .name {
    flex: 1.8;
    min-width: 0;
    font-weight: 600;
}
.list-item .name a {
    color: var(--text-primary) !important;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-item .name a:hover { color: var(--gold-500) !important; }
.list-item .omg { flex: 1.1; text-align: right; font-variant-numeric: tabular-nums; }
.list-item .danwei { font-size: 0.76rem; color: var(--text-muted); margin-left: 3px; }
.list-item .gxsj {
    flex: 1.2;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── 漲跌色（紅漲綠跌）+ 小標籤 ── */
.text-danger { color: var(--up-color) !important; font-weight: 600; }
.text-success { color: var(--down-color) !important; font-weight: 600; }
.list-item .omg.text-danger { background: var(--up-bg); display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); }
.list-item .omg.text-success { background: var(--down-bg); display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); }

/* ── 文章列表 ── */
.list-unstyled { padding: 0; margin: 0; list-style: none; }
.list-unstyled li {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    transition: background .18s;
}
.list-unstyled li:first-child { padding-top: 4px; }
.list-unstyled li:last-child { border-bottom: none; }
.list-unstyled li:hover { background: var(--bg-card-hover); border-radius: var(--radius-sm); margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.list-image { flex-shrink: 0; }
.list-image img {
    width: 140px;
    height: 94px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.list-main { flex: 1; min-width: 0; }
.item-title { font-size: 1rem; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
.item-title a { color: var(--text-primary) !important; }
.item-title a:hover { color: var(--gold-500) !important; }
.item-excerpt p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}
.item-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.item-meta i { margin-right: 4px; color: var(--gold-400); }
.item-meta a { color: var(--text-muted) !important; }
.item-meta a:hover { color: var(--gold-500) !important; }

/* ── 標籤 / 頁籤 ── */
.tags {
    background: #fff !important;
    border: 1px solid var(--border-soft) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-full) !important;
    padding: 5px 14px !important;
    font-size: 0.82rem;
    transition: all .2s;
}
.tags:hover {
    background: var(--gold-50) !important;
    border-color: var(--gold-400) !important;
    color: var(--gold-500) !important;
}

/* ── 按鈕（金調漸層） ── */
.btn-outline-secondary:hover {
    background: var(--gold-400) !important;
    border-color: var(--gold-400) !important;
    color: #fff !important;
}
.btn-primary {
    background: var(--bg-hero-gold) !important;
    border: none !important;
    color: var(--text-on-gold) !important;
    font-weight: 600;
    border-radius: var(--radius-sm) !important;
    padding: 8px 20px !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #D4B96A, #C9A24B) !important;
    color: var(--text-on-gold) !important;
    box-shadow: var(--shadow-gold) !important;
}

/* ── 分頁 ── */
.pagesize {
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-secondary) !important;
    padding: 6px 14px !important;
}
.pagesize:hover {
    background: var(--gold-50) !important;
    color: var(--gold-500) !important;
    border-color: var(--gold-400) !important;
}
.current {
    background: var(--gold-400) !important;
    color: #fff !important;
    border: 1px solid var(--gold-400) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
}

/* ── 頁腳（深墨金邊） ── */
.footer {
    background: #1c1916 !important;
    border-top: 3px solid var(--gold-400) !important;
    color: #b8b2a8 !important;
    padding: 32px 0 24px !important;
    margin-top: 0 !important;
}
.footer a { color: #c7c2ba !important; transition: color .2s; }
.footer a:hover { color: var(--gold-300) !important; }

/* ── 側邊欄卡片 ── */
.rollbar .actions .contbar:hover,
.rollbar .rollbar-item:hover {
    border-color: var(--gold-400) !important;
    box-shadow: var(--shadow-gold);
}

/* ── 內容詳情頁 ── */
.tool_show {
    background: #fff !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 24px !important;
}
.content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.content table caption {
    color: var(--text-on-gold);
    background: var(--bg-hero-gold);
    padding: 10px 16px;
    font-weight: 600;
}
.content table th {
    background: var(--gold-50) !important;
    color: var(--gold-600) !important;
    border-bottom: 1px solid var(--border-gold) !important;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.85rem;
}
.content table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
.content table tr:last-child td { border-bottom: none; }
.content table tr:hover td { background: var(--gold-50); }

/* ── 滾動條（淺金） ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd5c5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-400); }

/* ── AdSense 廣告位 ── */
.adsense-container {
    background: var(--gold-50);
    border: 1px dashed var(--border-gold);
    border-radius: var(--radius-md);
    min-height: 90px;
}
.adsense-container:hover { border-color: var(--gold-400); }
.adsense-row {
    background: var(--gold-50) !important;
    border: 1px dashed var(--border-gold) !important;
    border-radius: var(--radius-sm) !important;
}
.adsense-article {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

/* ── 銀樓報價表專用 ── */
.yinlou-note {
    font-size: 0.81rem;
    color: var(--text-secondary);
    margin: 14px 4px 0;
    line-height: 1.75;
    padding: 12px 16px;
    background: var(--gold-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold-300);
}
.yinlou-note b { color: var(--gold-600); font-weight: 600; }
.list-header .shop, .list-item .shop { flex: 1.6; font-weight: 600; }
.text-gold { color: var(--gold-500) !important; font-weight: 600; }

/* ── Modal（搜尋彈窗） ── */
.modal-content {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}
.modal-body { padding: 24px; }

/* ── 響應式微調 ── */
@media (max-width: 991.98px) {
    main.container {
        border-radius: var(--radius-lg);
        padding: 16px 14px 24px !important;
        margin: 10px 8px 20px;
    }
    .content-box { padding: 16px 14px !important; }
    .list-item { padding: 11px 10px !important; font-size: 0.84rem; }
    .list-header { padding: 10px 10px !important; font-size: 0.78rem; }
    .section-title { font-size: 1.02rem !important; }
    .list-image img { width: 100px; height: 68px; }
}

@media (max-width: 575.98px) {
    main.container {
        border-radius: var(--radius-md);
        padding: 12px 10px 18px !important;
        margin: 4px 4px 14px;
        box-shadow: var(--shadow-md);
    }
    .list-item { flex-wrap: wrap; gap: 4px; }
    .list-item .name { flex: 1 0 100%; order: 1; }
    .list-item .omg { flex: 1; order: 2; }
    .list-item .gxsj { flex: 1; text-align: left; order: 3; font-size: 0.74rem; }
}
