/**
 * @file    : css/base.css
 * @purpose : 基礎樣式 - Reset、Typography、全局設定
 * @depends : ['css/variables.css']
 */

/* ========================================
   Reset & Box Sizing
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   HTML & Body
   ======================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    line-height: 1.7;
    color: var(--text-secondary);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* APCA Anti-Breakage */
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: var(--font-size-5xl);
}

h2 {
    font-size: var(--font-size-4xl);
}

h3 {
    font-size: var(--font-size-3xl);
}

h4 {
    font-size: var(--font-size-2xl);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary-light);
}

/* ========================================
   Lists
   ======================================== */
ul,
ol {
    list-style: none;
}

/* ========================================
   Images
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Selection
   ======================================== */
::selection {
    background: var(--color-primary);
    color: var(--text-light);
}

/* ========================================
   Focus States (Accessibility)
   ======================================== */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========================================
   Scrollbar (Webkit)
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-section);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}