/* ============================================================
   GeoCommunity — Base
   ============================================================ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
    background-color: var(--bg-primary); /* 画布兜底，防止短页面底部透色 */
}

body {
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
}

img {
    display: block;
}

/* ---- 链接：默认文本色 + 轻下划线，hover 才用强调色 ---- */
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color var(--dur-fast) var(--ease),
                text-decoration-color var(--dur-fast) var(--ease),
                background-color var(--dur-fast) var(--ease);
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-1);
}

/* ---- 选中文本 ---- */
::selection {
    background: var(--accent-soft);
    color: var(--text-primary);
}

/* ---- 屏幕阅读器 ---- */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    top: -48px;
    left: var(--sp-4);
    z-index: 200;
    padding: var(--sp-2) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    text-decoration: none;
    font-size: 14px;
    transition: top var(--dur) var(--ease);
}

.skip-link:focus {
    top: var(--sp-2);
    color: var(--text-primary);
    text-decoration: none;
}

/* ---- 滚动条（克制）---- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

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

/* ---- 通用淡入动画（仅 opacity）---- */
@keyframes gc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

/* WordPress 必备对齐类 */
.alignleft  { float: left;  margin: var(--sp-2) var(--sp-5) var(--sp-4) 0; }
.alignright { float: right; margin: var(--sp-2) 0 var(--sp-4) var(--sp-5); }
.aligncenter{ margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { max-width: 100%; }
.clearfix::after { content: ""; display: table; clear: both; }
