/**
 * adnotice — Cookie 同意橫幅
 *
 * 定位與初始隱藏的關鍵樣式由 preload 以 inline <style> 輸出（避免 FOUC），
 * 這支是非阻塞載入的其餘外觀。
 *
 * ⚠ 橫幅顯示期間不得阻擋頁面捲動（規格 §8）。這裡刻意沒有任何
 *   body{overflow:hidden} —— 擋捲動會被 Google 視為更嚴重的內容遮蔽。
 */

.adnotice-cc {
    font-size: 14px;
    line-height: 1.6;
    color: #222;
}

.adnotice-cc-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.adnotice-cc-text { flex: 1 1 420px; }
.adnotice-cc-text a { color: #0a58ca; }

.adnotice-cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.adnotice-cc-btn {
    padding: 8px 16px;
    font: inherit;
    color: #222;
    background: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.adnotice-cc-btn:hover { background: #e6e6e6; }

.adnotice-cc-btn:focus-visible {
    outline: 2px solid #0a58ca;
    outline-offset: 2px;
}

.adnotice-cc-btn-primary {
    color: #fff;
    background: #0a58ca;
    border-color: #0a58ca;
}

.adnotice-cc-btn-primary:hover { background: #084298; }

.adnotice-cc-btn-link {
    background: none;
    border-color: transparent;
    text-decoration: underline;
}

/* 角落樣式時改成直式排列 */
.adnotice-cc-corner .adnotice-cc-inner { display: block; }
.adnotice-cc-corner .adnotice-cc-actions { margin-top: 12px; }

/* --- 常駐入口 --- */

.adnotice-cc-entry {
    position: fixed;
    left: 12px;
    bottom: calc(12px + var(--adnotice-cc-h, 0px));
    z-index: 9400;
    padding: 6px 12px;
    font-size: 12px;
    color: #444;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
}

.adnotice-cc-entry:hover { background: #fff; }

/* --- 自訂設定面板 --- */

.adnotice-cc-panel {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adnotice-cc-panel[hidden] { display: none !important; }

.adnotice-cc-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.adnotice-cc-panel-box {
    position: relative;
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}

.adnotice-cc-panel-box h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.adnotice-cc-panel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    background: none;
    border: 0;
    cursor: pointer;
}

.adnotice-cc-cats {
    list-style: none;
    margin: 0;
    padding: 0;
}

.adnotice-cc-cat {
    padding: 12px 0;
    border-top: 1px solid #eee;
}

.adnotice-cc-cat label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
}

.adnotice-cc-cat input[disabled] { cursor: not-allowed; }
.adnotice-cc-cat-title em { font-weight: 400; font-style: normal; color: #777; }

.adnotice-cc-cat-desc {
    margin: 6px 0 0 26px;
    font-size: 13px;
    color: #555;
}

.adnotice-cc-panel-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

@media (max-width: 575.98px) {
    .adnotice-cc-actions { width: 100%; }
    .adnotice-cc-actions .adnotice-cc-btn { flex: 1 1 auto; }
}

/* --- 政策頁 --- */

.adnotice-policy table { width: 100%; }
.adnotice-policy code { word-break: break-all; }
