@import url("/fonts/noto-sans-sc.css");

/* ============================================================
   康弘主题页 · 基础样式（蓝白学术 VI）
   ============================================================ */

:root {
    --brand: #2F6FBF;
    --brand-strong: #1D4E8C;
    --brand-rgb: 47, 111, 191;
    --brand-soft: rgba(47, 111, 191, 0.07);
    --brand-soft-2: rgba(47, 111, 191, 0.13);
    --gold: #C29A5D;
    --gold-strong: #A87A3F;
    --gold-soft: #F6EFE3;
    --teal: #318596;
    --ink: #172A3D;
    --ink-2: #465A6D;
    --ink-3: #7E91A4;
    --line: #E2EFF9;
    --line-blue: #C9E3F5;
    --bg: #F4FAFE;
    --card: #FFFFFF;
    --shell: 520px;
    --radius-xl: 10px;
    --radius-lg: 5px;
    --radius-md: 3px;
    --shadow-card: 0 4px 14px rgba(23, 78, 126, 0.05);
    --shadow-soft: 0 10px 28px rgba(23, 78, 126, 0.08);
    --font-sans: "Noto Sans SC Variable", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4, p {
    margin: 0;
}

::selection {
    background: rgba(var(--brand-rgb), 0.16);
    color: var(--ink);
}

/* 桌面背景：蓝白学术氛围 */
body.theme-body,
body.article-body {
    background: #EFF7FD;
}

@media (min-width: 640px) {
    body.theme-body,
    body.article-body {
        background:
            radial-gradient(1000px 500px at 6% -8%, rgba(86, 158, 214, 0.18), transparent 62%),
            radial-gradient(900px 520px at 98% 4%, rgba(49, 133, 150, 0.12), transparent 60%),
            radial-gradient(800px 500px at 50% 112%, rgba(194, 154, 93, 0.12), transparent 62%),
            #EFF7FD;
        background-attachment: fixed;
    }
}

/* 手机容器 */
.page-shell {
    position: relative;
    width: 100%;
    max-width: var(--shell);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    box-shadow: 0 0 80px rgba(18, 54, 92, 0.12);
    overflow-x: clip;
}

@supports not (overflow: clip) {
    .page-shell {
        overflow-x: hidden;
    }
}

/* 无障碍跳转链接 */
.skip-link {
    position: fixed;
    top: 8px;
    left: 50%;
    z-index: 999;
    padding: 8px 16px;
    border-radius: 999px;
    background: #153A5D;
    color: #fff;
    font-size: 12px;
    transform: translate(-50%, -160%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

:focus-visible {
    outline: 2px solid rgba(var(--brand-rgb), 0.55);
    outline-offset: 2px;
}

/* 轻提示 */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(32px + env(safe-area-inset-bottom));
    z-index: 80;
    max-width: 80vw;
    padding: 10px 18px;
    border-radius: 4px;
    background: rgba(17, 48, 79, 0.94);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.2px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* 回到顶部 */
.to-top {
    position: fixed;
    right: max(16px, calc((100vw - var(--shell)) / 2 + 14px));
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line-blue);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 18px rgba(18, 54, 92, 0.14);
    color: var(--brand);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.to-top svg {
    width: 18px;
    height: 18px;
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* 分享引导层：微信内无法由网页直接唤起右上角菜单，用明确指引替代“无声复制” */
.share-sheet {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}
.share-sheet.is-open { opacity: 1; visibility: visible; }
.share-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 30, 52, .46);
    backdrop-filter: blur(2px);
}
.share-sheet__panel {
    position: relative;
    width: min(440px, 100%);
    max-height: 88vh;
    overflow: auto;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 16px 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(9, 35, 66, .26);
    transform: translateY(12px);
    transition: transform .18s ease;
}
.share-sheet.is-open .share-sheet__panel { transform: translateY(0); }
.share-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.share-sheet__eyebrow { margin: 0 0 4px; font-size: .75rem; letter-spacing: .08em; color: #5F7488; }
.share-sheet__title { margin: 0; font-size: 1.05rem; line-height: 1.4; color: #14345A; }
.share-sheet__close { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #F2F6FA; color: #47657F; font-size: 20px; line-height: 1; cursor: pointer; }
.share-sheet__preview { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; margin: 14px 0; border-radius: 12px; background: #EAF2FA; }
.share-sheet__desc { margin: 0 0 10px; font-size: .9rem; line-height: 1.65; color: #47657F; }
.share-sheet__hint { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #F3F8FE; color: #1D4E8C; font-size: .85rem; line-height: 1.6; }
.share-sheet__actions { display: flex; gap: 10px; }
.share-sheet__actions .btn { flex: 1; }
@media (min-width: 640px) {
    .share-sheet { align-items: center; }
    .share-sheet__panel { border-radius: 18px; }
}
