/* ==========================================
   禾彬不動產專屬 CSS 變數設定 (紫色系品牌)
========================================== */
:root {
  --brand: #7C3AED; /* 主題紫 */
  --brand-soft: rgba(124, 58, 237, 0.08); /* 柔和紫背底 */
  --primary-dark: #5B21B6; /* 深紫，用於強調字 */
  --bg: #F6F8FB; /* 系統底色 */
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --divider: #E2E8F0;
  --success: #15803D; /* 正常打卡綠 */
  --warning: #B45309; /* 定位中橘 */
  --danger: #B91C1C; /* 異常紅 */
}

/* ==========================================
   全域基礎重置
========================================== */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    outline: none; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding: 0; 
    color: var(--text-primary); 
    line-height: 1.6;
}

/* ==========================================
   頁首 Header (固定在最上方)
========================================== */
.header { 
    background: var(--brand); 
    padding: 10px 20px; 
    color: #FFFFFF; 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.15); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 60px; 
}
.brand { 
    font-size: 18px; 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    user-select: none;
}
.btn-icon { 
    background: none; 
    border: none; 
    font-size: 20px; 
    cursor: pointer; 
    color: #FFFFFF; 
    transition: 0.2s; 
    opacity: 0.4; /* 預設半透明隱藏感 */
}
.btn-icon:hover { 
    opacity: 1; 
}

/* ==========================================
   前台內容區塊 (Layout & Sections)
========================================== */
.container { 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 20px; 
}
.section { 
    background: var(--surface); 
    margin-bottom: 24px; 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
    border: 1px solid var(--border); 
}
.sec-title { 
    font-size: 18px; 
    font-weight: 700; 
    margin-bottom: 16px; 
    color: var(--text-primary); 
    border-left: 4px solid var(--brand); 
    padding-left: 8px; 
}

/* 服務卡片網格 */
.dash-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 16px; 
    margin-bottom: 24px; 
}
.dash-card { 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.04); 
    transition: transform 0.2s, box-shadow 0.2s;
}
.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    border-color: var(--brand-soft);
}

/* ==========================================
   頁尾 Footer
========================================== */
.site-footer { 
    padding: 30px 15px; 
    background: var(--surface); 
    border-top: 1px solid var(--border); 
    text-align: center; 
    margin-top: 40px;
}
.footer-nav { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 20px; 
}
.footer-nav a { 
    color: var(--text-secondary); 
    text-decoration: none; 
    font-size: 14px; 
    padding: 8px 16px; 
    background: var(--surface-2); 
    border-radius: 20px; 
    transition: 0.2s; 
    font-weight: 600;
}
.footer-nav a:hover { 
    background: var(--brand); 
    color: white; 
}
.footer-copyright { 
    font-size: 12px; 
    color: var(--text-muted); 
    line-height: 1.8; 
}

/* ==========================================
   後台模態框 (Modal) & 表單元件
========================================== */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(17,24,39,0.7); 
    z-index: 100; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(4px); 
}
.modal-box { 
    background: var(--surface); 
    width: 90%; 
    max-width: 450px; 
    border-radius: 12px; 
    padding: 24px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
    animation: popin 0.2s ease-out; 
}

@keyframes popin { 
    from { transform: scale(0.95); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

/* 表單輸入框 */
.form-input { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-size: 14px; 
    background: var(--surface);
    color: var(--text-primary);
    transition: 0.2s; 
}
.form-input:focus { 
    border-color: var(--brand); 
    box-shadow: 0 0 0 3px var(--brand-soft); 
}

/* 按鈕樣式 */
.btn-primary { 
    width: 100%; 
    padding: 14px; 
    background: var(--brand); 
    color: white; 
    border: none; 
    border-radius: 8px; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 4px 6px rgba(124, 58, 237, 0.2);
}
.btn-primary:active { 
    transform: scale(0.98); 
}
.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-outline { 
    width: 100%; 
    padding: 14px; 
    background: var(--surface); 
    color: var(--text-primary); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.2s; 
}
.btn-outline:active { 
    background: var(--surface-2); 
    transform: scale(0.98);
}

/* 自定義捲軸 (針對後台內容過多時) */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--divider);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
