/* =========================================================
   macOS 26 风格毛玻璃博客样式（纯色背景 + 自动亮暗模式）
   保留原布局结构，现代化视觉设计
   ========================================================= */

/* 🌈 基础变量 */
:root {
    --bg-light: #eef0f4;
    --bg-dark: #1f1f22;
    --glass-light: rgba(255, 255, 255, 0.6);
    --glass-dark: rgba(25, 25, 25, 0.45);
    --border-light: rgba(255, 255, 255, 0.7);
    --border-dark: rgba(0, 0, 0, 0.35);
    --text-main-light: #1e1e1e;
    --text-main-dark: #f2f2f2;
    --text-muted-light: #5a5a5a;
    --text-muted-dark: #b0b0b0;
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.55);
    --link-light: #007aff;
    --link-dark: #6ca8ff;
    --code-bg-light: rgba(240, 240, 240, 0.9);
    --code-bg-dark: rgba(30, 30, 30, 0.8);
    --blockquote-light: rgba(255,255,255,0.4);
    --blockquote-dark: rgba(255,255,255,0.08);
}

/* 🌙 夜间模式变量 */
:root[data-theme="dark"] {
    --bg: var(--bg-dark);
    --glass: var(--glass-dark);
    --border: var(--border-dark);
    --text-main: var(--text-main-dark);
    --text-muted: var(--text-muted-dark);
    --shadow: var(--shadow-dark);
    --link: var(--link-dark);
    --code-bg: var(--code-bg-dark);
    --blockquote-bg: var(--blockquote-dark);
}
:root:not([data-theme="dark"]) {
    --bg: var(--bg-light);
    --glass: var(--glass-light);
    --border: var(--border-light);
    --text-main: var(--text-main-light);
    --text-muted: var(--text-muted-light);
    --shadow: var(--shadow-light);
    --link: var(--link-light);
    --code-bg: var(--code-bg-light);
    --blockquote-bg: var(--blockquote-light);
}

/* ========== 全局基础 ========== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "LXGW WenKai Screen", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    font-size: 14px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text-main);
    transition: background 0.6s, color 0.4s;
    display: flex;
    flex-direction: column;
}

/* ========== 布局辅助类 ========== */
.center {
    margin-left: auto;
    margin-right: auto;
}
.text_center {
    text-align: center;
}

/* ========== 通用毛玻璃卡片 ========== */
.glass {
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: background 0.4s, box-shadow 0.4s;
}

/* ========== 导航栏 ========== */
nav table {
    width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 27px;
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 3px;
    border: 1.6px solid var(--text-main);
    background: var(--glass);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px) saturate(160%);
}
nav td {
    padding: 10px;
    text-align: center;
    font-weight: 500;
    color: var(--text-main);
    transition: background 0.3s;
}
nav td.active {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}
:root[data-theme="dark"] nav td.active {
    background: rgba(255, 255, 255, 0.08);
}
nav a {
    text-decoration: none;
    color: inherit;
}

/* ========== 主内容区 ========== */
.main-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    margin: 20px auto;
    width: fit-content;
}
.content-area {
    /*default 100%*/
    width: 100%;
    border: 1.6px solid var(--text-main);
    border-radius: 27px;
    padding:1px;
}

/* 内容表格 */
.content,
.postlist {
    width: 100%;
    border-collapse: collapse;
    border-radius: 22px;
    background: var(--glass);
    box-shadow: var(--shadow);
    border: 1px solid rgb(255 255 255 / 0%);
    overflow: visible; /* 允许 tooltip 溢出显示 */
    transition: background 0.4s;
    border-bottom: rgb(255 255 255 / 0%);
    border-top: rgb(255 255 255 / 0%);
}
.content td,
.postlist td {
    padding: 8px;
    color: var(--text-main);
    width: 100%;
    border-radius:18px;
}

.post-row{
    border-radius: 18px;
}
.main-tbody{
    border-radius: 3px;
}

.postlist tr:hover td {
    background: rgba(255, 255, 255, 0.3);
}
:root[data-theme="dark"] .postlist tr:hover td {
    background: rgba(255, 255, 255, 0.08);
}

/* 分类标题 */
h4 {
    font-size: 18px;
    text-align: center;
    color: var(--text-main);
    margin: 20px 0 10px 0;
}

/* ========== 广告栏 ========== */
.sidebar {
    position: fixed;
    top: 80px;
    right: 40px;
    width: 200px;
    padding: 12px;
    border-radius: 16px;
    background: var(--glass);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.4s;
}
.ad-box {
    background: rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 10px;
    text-align: center;
    transition: transform 0.25s ease, background 0.4s;
    box-shadow: var(--shadow);
}
.ad-box:hover {
    transform: scale(1.03);
}
:root[data-theme="dark"] .ad-box {
    background: rgba(40, 40, 40, 0.4);
}
.ad-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-main);
}
.ad-img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
pre code {
    white-space: normal;
    border-radius: 6px;
}

/* 响应式 */
@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 90%;
        margin: 20px auto;
    }
    .main-container {
        flex-direction: column;
        align-items: center;
    }
}

/* ========== 页脚 ========== */
.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    border-radius: 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}
.footer hr {
    width: 300px;
    margin: 12px auto;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========== Post 内容区域样式 ========== */
.page {
    display: block;
    width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--glass);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

/* 标题 */
.page h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-top: 10px;
}
.page .meta {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ========== article 内容自动亮暗模式 ========== */
article {
    max-width: 780px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-main);
}
article p {
    margin: 12px 0;
    color: var(--text-main);
}
article h1, article h2, article h3, article h4, article h5, article h6 {
    color: var(--text-main);
}
article a {
    color: var(--link);
    text-decoration: none;
}
article a:hover {
    opacity: 0.8;
}
article blockquote {
    border-left: 4px solid rgba(128, 128, 128, 0.4);
    background: var(--blockquote-bg);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-muted);
    margin: 15px 0;
}
article code {
    /*background: var(--code-bg);*/
    padding: 2px 5px;
    border-radius: 4px;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
}
article pre {
    background: var(--code-bg);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: "JetBrains Mono", monospace;
    line-height: 1.5;
}
article img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
article img:hover {
    transform: scale(1.02);
}
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    border: 1px solid var(--border);
}
article th, article td {
    padding: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
}
article tr:nth-child(even) {
    background: rgba(255,255,255,0.4);
}
:root[data-theme="dark"] article tr:nth-child(even) {
    background: rgba(255,255,255,0.05);
}
article hr {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin: 20px 0;
}
:root[data-theme="dark"] article hr {
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 提示区块 */
/* 提示区块 */
.password-notice {
    background-color: rgba(255, 255, 204, 0.6);
    border: 2px solid #ffcc00;
    padding: 15px;
    margin: 20px 0;
    border-radius: 10px;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.4s, border 0.4s, color 0.4s;
}

/* 🌙 暗色模式 */
:root[data-theme="dark"] .password-notice {
    background-color: rgba(80, 80, 20, 0.25);
    border: 2px solid rgba(255, 230, 100, 0.5);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}


/* ========== 通用效果 ========== */
a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: #0051d4;
}
* {
    transition: background 0.4s, color 0.4s, box-shadow 0.4s, opacity 0.3s;
}

/* 主体内容区域（自动填充中间） */
body > *:not(footer) {
    flex: 1 0 auto;
}

/* 页脚固定在底部 */
footer {
    flex-shrink: 0;
}


/* ==========================
   🔐 Password Modal 样式
   自动亮/暗模式 + macOS 毛玻璃圆角
   ========================== */

/* 模态遮罩 */
.password-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

/* 弹窗主体 */
.password-content {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    width: 320px;
    max-width: 90%;
    padding: 24px 28px;
    text-align: center;
    animation: fadeInModal 0.3s ease;
    color: var(--text-main);
}

/* 标题 */
.password-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--text-main);
}

/* 输入框 */
.password-input {
    width: 80%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}
.password-input:focus {
    border-color: var(--link);
    box-shadow: 0 0 6px rgba(0, 255, 13, 0.4);
}

/* 提交按钮 */
.password-submit {
    padding: 8px 16px;
    margin: 6px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    background-color: var(--link);
    color: #fff;
    transition: background 0.3s ease, transform 0.2s;
}
.password-submit:hover {
    background-color: #008000;
    transform: translateY(-1px);
}

/* 暗色模式下按钮颜色柔和 */
:root[data-theme="dark"] .password-submit {
    background-color: #008000;
}
:root[data-theme="dark"] .password-submit:hover {
    background-color: #008000;
}

/* 错误信息 */
.error-message {
    color: #ff3b30;
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

/* 弹出动画 */
@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* 🌙 暗色模式适配 */
:root[data-theme="dark"] .password-content {
    background: rgba(25, 25, 25, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}
:root[data-theme="dark"] .password-input {
    background: rgba(35, 35, 35, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f1f1f1;
}
:root[data-theme="dark"] .password-input:focus {
    border-color: #008000;
    box-shadow: 0 0 6px rgba(114, 211, 65, 0.4);
}

/* 容器对齐 */
.title-cell {
    position: relative;
    white-space: nowrap;
}
/* MacOS26 主题变量（可根据你的全局 root[data-theme] 继承） */
:root {
    --m26-bg: rgba(30, 31, 34, 0.58);
    --m26-fg: #e8ecf2;
    --m26-border: rgba(255,255,255,.18);
    --m26-shadow: 0 8px 32px rgba(0,0,0,.35);
}
:root[data-theme="light"] {
    --m26-bg: rgba(255,255,255,.75);
    --m26-fg: #1a1c1f;
    --m26-border: rgba(0,0,0,.18);
    --m26-shadow: 0 8px 24px rgba(0,0,0,.15);
}

/* 小光球本体： */
.updated-dot{
    position: relative; /* 为 tooltip 的绝对定位建立参照 */
    display:inline-block;
    width:9px; height:9px;
    border-radius:9999px;
    background: radial-gradient(35% 35% at 35% 35%, #fff 0%, #1c9867 45%, #13bcc5 100%);
    box-shadow:
            0 0 0 2px rgba(59,130,246,.25),
            0 2px 6px rgba(0,0,0,.25),
            inset 0 0 4px rgba(255,255,255,.7);
    vertical-align: middle;
    margin-left:6px;
    cursor:help;
}


/* 气泡主体：使用 data-tooltip 作为内容 */
.updated-dot::after{
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-main, #eaeef2);
    background: var(--bg, rgba(30,31,34,.65));
    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 99999;
}

/* 小三角（用旋转方块更像毛玻璃） */
.updated-dot::before{
    content: "";
    font-size: 13px;
    line-height: 1;
}

/* 触发：鼠标悬停与键盘聚焦都可见 */
.updated-dot:hover::after,
.updated-dot:hover::before,
.updated-dot:focus-visible::after,
.updated-dot:focus-visible::before{
    opacity:1;
}
.updated-dot:hover::after,
.updated-dot:focus-visible::after{
    opacity: 1;
    /*transform: translateX(-50%) translateY(0);*/
}

/* 避免靠右溢出：当父容器非常靠右时可切换定位方向（可选增强） */
.updated-dot[data-tip-align="right"]::after,
.updated-dot[data-tip-align="right"]::before{
    left:auto; right:0; transform: translateX(0) translateY(4px);
}
.updated-dot[data-tip-align="right"]::after{ transform: translateY(4px); }
.updated-dot[data-tip-align="right"]:hover::after,
.updated-dot[data-tip-align="right"]:focus-visible::after{
    transform: translateY(0);
}
.protected-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* ✅ 内容水平居中 */
    gap: 4px; /* 图标之间的小间距 */
    padding: 5px 3px; /* ✅ 上下内边距稍微增大，左右减小 */
    margin-left: 4px; /* ✅ 原来太大了，这样更紧凑 */
    border-radius: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main, #ccc);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    vertical-align: middle; /* ✅ 与文字垂直对齐 */
    line-height: 1; /* 避免内部文字偏下 */
    transform: translateY(-0.5px); /* ✅ 微调视觉居中 */
}

/* 内部图标样式（可选增强） */
.protected-badge i {
    font-size: 13px;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0.5px);
}

:root[data-theme='light'] .protected-badge {
    background: rgba(255,255,255,0.6);
    color: #1a1c1f;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.5),
    0 2px 8px rgba(0,0,0,0.15);
}

/* 图标或小锁 */
.protected-badge::before {
    content: "";
    font-size: 13px;
    line-height: 1;
}

/* 气泡提示 */
.protected-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-main, #eaeef2);
    background: var(--bg, rgba(30,31,34,.65));
    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 10;
}

/* 小三角 */
.protected-badge::before {
    content: "";
    margin-right: 3px;
}


/* 悬停 / 聚焦 时显示气泡 */
.protected-badge:hover::after,
.protected-badge:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
