/* =========================================
   base.css — 防偷拍工具「安心掃雷」
   設計語言 = 16pts.com（MBTI 主站）
   淺色主題，掃描時才變暗
   ========================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

:root {
    /* 色彩 — MBTI 主站同源（淺色） */
    --bg:           #ECEEE9;
    --bg2:          #E2E5DE;
    --bg3:          #D6DAD2;
    --text:         #2D3436;
    --dim:          #5A6360;
    --muted:        #7C8387;
    --accent:       #7B9E87;
    --accent2:      #6B8E74;
    --glow:         rgba(123,158,135,0.10);
    --card-bg:      rgba(255,255,255,0.72);
    --card-border:  rgba(45,52,54,0.06);
    --card-shadow:  0 1px 3px rgba(45,52,54,0.05), 0 4px 12px rgba(45,52,54,0.03);
    --nav-bg:       rgba(236,238,233,0.92);

    /* 語意色 */
    --success:      #7B9E87;
    --warning:      #C4A96E;
    --danger:       #BF7B7B;

    /* 字體 — 同 MBTI */
    --font-sans:    'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-display: 'Red Hat Display', 'Noto Sans TC', system-ui, sans-serif;

    /* 圓角 */
    --radius-sm:   5px;
    --radius-md:   10px;
    --radius-lg:   20px;
    --radius-full: 40px;

    /* 間距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* 舊變數別名（相容 detect.css） */
    --bg-primary:     var(--bg);
    --bg-card:        var(--bg2);
    --bg-surface:     var(--bg3);
    --accent-warm:    var(--accent);
    --accent-safe:    var(--success);
    --accent-caution: var(--warning);
    --accent-danger:  var(--danger);
    --text-primary:   var(--text);
    --text-secondary: var(--dim);
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  40px;
    --space-2xl: 64px;
    --shadow-sm:   0 1px 4px rgba(0,0,0,0.08);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.1);
    --shadow-warm: 0 4px 20px rgba(123,158,135,0.12);
    --shadow-glow: 0 0 24px rgba(123,158,135,0.15);
    --transition-fast:   150ms ease;
    --transition-base:   250ms ease;
    --transition-slow:   400ms ease;
    --transition-breath: 600ms ease;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
details, summary { cursor: pointer; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }


/* ===== 字體 ===== */

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
}

h3 {
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
}

p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--dim);
}


/* ===== 卡片 — glass-card ===== */

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}


/* ===== 按鈕 — 同 MBTI ===== */

.btn-primary,
a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(123,158,135,0.25);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--accent), #000 10%);
    box-shadow: 0 4px 16px rgba(123,158,135,0.35);
}

.btn-primary:active {
    translate: 0 0.5px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--glow);
}

.btn-complete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(123,158,135,0.08);
    border: 1.5px solid rgba(123,158,135,0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-complete:hover {
    background: rgba(123,158,135,0.15);
    border-color: var(--success);
}

.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(123,158,135,0.06);
    border: 1.5px solid rgba(123,158,135,0.15);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-share:hover {
    background: rgba(123,158,135,0.12);
    border-color: var(--accent);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}


/* ===== 導航 — 由 common.css 統一管理 ===== */
/* site-nav 已廢棄，改用 common.css 的 nav */

/* 舊 nav 樣式已移除，由 /css/common.css 統一管理 */

/* 品牌強調色（安心掃雷 = 莫蘭迪綠） */
.nav-brand-accent {
    color: var(--accent2);
    font-weight: 700;
}


/* ===== 掃描暗房模式（掃描中才啟用） ===== */

body.scanning-mode {
    background-color: #000;
}


/* ===== 動畫 ===== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes checkPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ===== 輔助 ===== */

.text-center { text-align: center; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
