/* ======================================================
   GLOBAL COMMON STYLES
   全局通用样式
   ====================================================== */

/* ========== CSS RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    overflow-x: hidden;
    border: none !important;
    outline: none !important;
}

body {
    --font-family-zh: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', Roboto, Helvetica, Arial, sans-serif;
    --font-family-en: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-family-base: var(--font-family-zh);
    --quote-open: "「";
    --quote-close: "」";
    font-family: var(--font-family-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.lang-en {
    --font-family-base: var(--font-family-en);
    --quote-open: "“";
    --quote-close: "”";
}

body.lang-zh {
    --font-family-base: var(--font-family-zh);
    --quote-open: "「";
    --quote-close: "」";
}

body.lang-zh .item-name-en,
body.lang-zh .title-en {
    display: none !important;
}

body.lang-en .item-name-zh,
body.lang-en .title-zh {
    display: none !important;
}

body.lang-zh .title-zh,
body.lang-en .title-en {
    display: inline !important;
}

/* ========== IMAGES & MEDIA ========== */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ========== TABLES ========== */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

/* ========== LINKS ========== */
a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover, a:focus {
    outline: none;
}

/* ========== FORM ELEMENTS ========== */
input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
}

textarea {
    resize: vertical;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

.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;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ========== SCROLL BEHAVIOR ========== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== HIGH DPI SUPPORT ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        margin: 0;
        padding: 0;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    img {
        max-width: 100%;
    }
}
