/* ==========================================================================
   cinema / base.css — 重置与基础排版
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 650;
    line-height: var(--lh-tight);
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--c-text-muted);
}

img {
    display: block;
    max-width: 100%;
}

svg {
    display: block;
    flex: 0 0 auto;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 键盘可达性：只在键盘导航时出现焦点环 */
:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--c-border-strong) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-thumb {
    background: var(--c-border-strong);
    border-radius: var(--r-pill);
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* 屏幕阅读器专用 */
.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;
}

/* 用户偏好减少动效 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
