/* article.css - 文章列表页面样式（适配9个导航链接） */

/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 100px;
}

/* 悬浮导航栏 - 9个链接样式 */
body > a:not([href^='/article/']) {
    display: inline-block;
    position: fixed;
    top: 0;
    z-index: 1000;
    text-decoration: none;
    padding: 10px 6px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    background-color: rgba(52, 73, 94, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 导航链接悬停效果 */
body > a:not([href^='/article/']):hover {
    background-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 为每个导航链接定位 - 8个左侧导航链接 */
body > a[href='/']:not([href^='/article/']) {
    left: 0;
    width: 8%;
    min-width: 55px;
}

body > a[href='/publicShare']:not([href^='/article/']) {
    left: 8%;
    width: 12%;
    min-width: 85px;
}

body > a[href='/article']:not([href^='/article/']) {
    left: 20%;
    width: 8%;
    min-width: 60px;
    background-color: #3498db;
}

body > a[href='/chat']:not([href^='/article/']) {
    left: 28%;
    width: 10%;
    min-width: 70px;
}

body > a[href='/tools']:not([href^='/article/']) {
    left: 38%;
    width: 8%;
    min-width: 60px;
}

body > a[href='/login']:not([href^='/article/']) {
    left: 46%;
    width: 7%;
    min-width: 55px;
}

body > a[href='/signUp']:not([href^='/article/']) {
    left: 53%;
    width: 7%;
    min-width: 55px;
}

body > a[href='/comment']:not([href^='/article/']) {
    left: 60%;
    width: 12%;
    min-width: 85px;
}

/* xsx图片链接单独处理，固定在右上角（如果存在） */
body > a[href='/xsx'] {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: 55px;
    height: 45px;
    background: transparent;
    border: none;
    padding: 0;
    backdrop-filter: none;
}

/* 主标题 */
h1 {
    margin: 30px auto 40px;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    max-width: 90%;
    text-align: center;
    position: relative;
}

/* 添加文章图标到标题 */
h1::before {
    content: "📚 ";
    margin-right: 10px;
}

/* 页面标题 */
h1:first-of-type {
    margin-top: 20px;
}

/* 文章链接容器样式 */
body > a[href^='/article/'] {
    display: block;
    width: 85%;
    max-width: 700px;
    margin: 20px auto;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    color: #2c3e50;
    padding: 20px 30px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-left: 5px solid #3498db;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* 文章链接悬停效果 */
body > a[href^='/article/']:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.25);
    border-left-color: #2ecc71;
    color: #3498db;
}

/* 文章链接激活效果 */
body > a[href^='/article/']:active {
    transform: translateY(0) scale(0.98);
}

/* 文章链接图标 */
body > a[href^='/article/']::before {
    content: "📄 ";
    margin-right: 10px;
    font-size: 1.2em;
}

/* 文章链接添加编号装饰 */
body > a[href^='/article/']::after {
    content: "→";
    margin-left: 15px;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

body > a[href^='/article/']:hover::after {
    opacity: 1;
    transform: translateX(5px);
}

/* 文章列表容器装饰 */
body > a[href^='/article/']:first-of-type {
    margin-top: 30px;
}

/* 空div的隐藏和装饰 */
div:empty {
    display: none;
}

/* 添加文章数量统计 */
body::after {
    content: "";
    display: block;
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-top: 100px;
    }
    
    /* 导航栏在小屏幕上垂直堆叠 */
    body > a:not([href^='/article/']):not([href='/xsx']) {
        position: fixed;
        display: block;
        width: 100% !important;
        left: 0 !important;
        top: auto;
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.8rem;
        height: 36px;
        text-align: left;
        padding-left: 20px;
    }
    
    /* 为每个导航链接设置垂直位置 - 8个链接（不含随笔） */
    body > a[href='/']:not([href^='/article/']) {
        top: 0;
    }
    
    body > a[href='/publicShare']:not([href^='/article/']) {
        top: 36px;
    }
    
    body > a[href='/article']:not([href^='/article/']) {
        top: 72px;
    }
    
    /* 移动端隐藏随笔导航链接 */
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
    }
    
    body > a[href='/chat']:not([href^='/article/']) {
        top: 108px;
    }
    
    body > a[href='/tools']:not([href^='/article/']) {
        top: 144px;
    }
    
    body > a[href='/login']:not([href^='/article/']) {
        top: 180px;
    }
    
    body > a[href='/signUp']:not([href^='/article/']) {
        top: 216px;
    }
    
    body > a[href='/comment']:not([href^='/article/']) {
        top: 252px;
    }
    
    /* xsx图片链接在移动端调整位置 */
    body > a[href='/xsx'] {
        position: fixed;
        top: 0;
        right: 0;
        width: 45px;
        height: 36px;
    }
    
    h1 {
        margin-top: 72px;
        font-size: 2rem;
    }
    
    body > a[href^='/article/'] {
        width: 95%;
        margin: 15px auto;
        padding: 16px 20px;
        font-size: 1.1rem;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    body > a:not([href^='/article/']):not([href='/xsx']) {
        font-size: 0.7rem;
        padding: 10px 4px;
        height: 42px;
    }
    
    body > a[href='/publicShare']:not([href^='/article/']),
    body > a[href='/comment']:not([href^='/article/']) {
        font-size: 0.65rem;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    body > a[href^='/article/'] {
        width: 90%;
        font-size: 1.15rem;
        padding: 18px 25px;
    }
}

/* 桌面端优化 */
@media (min-width: 1025px) {
    body > a:not([href^='/article/']):not([href='/xsx']) {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

h1 {
    animation: fadeIn 0.8s ease-out;
}

body > a[href^='/article/'] {
    animation: slideInFromLeft 0.6s ease-out;
}

body > a[href^='/article/']:nth-child(odd) {
    animation-delay: 0.1s;
}

body > a[href^='/article/']:nth-child(even) {
    animation-delay: 0.2s;
}

body > a:not([href^='/article/']):not([href='/xsx']) {
    animation: slideInFromTop 0.5s ease-out;
}

/* 添加装饰元素 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #3498db, #2ecc71, #9b59b6, #f39c12);
    z-index: 1002;
}

/* 添加当前页面指示器 */
body > a[href='/article']:not([href^='/article/'])::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px 3px 0 0;
}

/* 添加页面背景装饰点 */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(52, 152, 219, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 30%, rgba(46, 204, 113, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 50% 80%, rgba(155, 89, 182, 0.05) 0%, transparent 20%);
    z-index: -1;
    pointer-events: none;
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    body > a:not([href^='/article/']):not([href='/xsx']) {
        font-size: 0.7rem;
        padding: 6px 10px;
        height: 32px;
    }
    
    body > a[href='/']:not([href^='/article/']) {
        top: 0;
    }
    
    body > a[href='/publicShare']:not([href^='/article/']) {
        top: 32px;
    }
    
    body > a[href='/article']:not([href^='/article/']) {
        top: 64px;
    }
    
    /* 移动端隐藏随笔导航链接 */
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
    }
    
    body > a[href='/chat']:not([href^='/article/']) {
        top: 96px;
    }
    
    body > a[href='/tools']:not([href^='/article/']) {
        top: 128px;
    }
    
    body > a[href='/login']:not([href^='/article/']) {
        top: 160px;
    }
    
    body > a[href='/signUp']:not([href^='/article/']) {
        top: 192px;
    }
    
    body > a[href='/comment']:not([href^='/article/']) {
        top: 224px;
    }
    
    body > a[href='/xsx'] {
        width: 40px;
        height: 32px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-top: 64px;
    }
    
    body > a[href^='/article/'] {
        padding: 14px 18px;
        font-size: 1rem;
        margin: 12px auto;
    }
}

/* 添加平滑滚动效果 */
html {
    scroll-behavior: smooth;
}

/* 优化后的移动端导航样式 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-top: 300px; /* 增加顶部内边距，为堆叠的导航栏留出空间 */
    }
    
    /* 重置所有非文章链接和non-xsx链接的样式 */
    body > a:not([href^='/article/']):not([href='/xsx']) {
        position: fixed;
        display: flex;
        align-items: center;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 40px;
        padding: 0 15px;
        margin: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.85rem;
        font-weight: 500;
        text-align: left;
        background-color: rgba(52, 73, 94, 0.98);
        backdrop-filter: blur(10px);
        z-index: 1000;
        transform: none !important;
        border-radius: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* 为每个导航链接设置垂直位置 - 7个链接（不含随笔和xsx） */
    body > a[href='/']:not([href^='/article/']) {
        top: 0;
    }
    
    body > a[href='/publicShare']:not([href^='/article/']) {
        top: 40px;
    }
    
    body > a[href='/article']:not([href^='/article/']) {
        top: 80px;
    }
    
    /* 移动端强制隐藏随笔导航链接 */
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    body > a[href='/chat']:not([href^='/article/']) {
        top: 120px;
    }
    
    body > a[href='/tools']:not([href^='/article/']) {
        top: 160px;
    }
    
    body > a[href='/login']:not([href^='/article/']) {
        top: 200px;
    }
    
    body > a[href='/signUp']:not([href^='/article/']) {
        top: 240px;
    }
    
    body > a[href='/comment']:not([href^='/article/']) {
        top: 280px;
    }
    
    /* 当前激活页面指示器 */
    body > a[href='/article']:not([href^='/article/'])::after {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background-color: #3498db;
        transform: none;
    }
    
    /* xsx图片链接在移动端调整位置，固定在右上角 */
    body > a[href='/xsx'] {
        position: fixed;
        top: 0;
        right: 0;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        z-index: 1001;
    }
    
    /* 调整主标题位置，避免被导航栏遮挡 */
    h1 {
        margin-top: 340px; /* 为7个导航链接留出空间 */
        font-size: 1.8rem;
    }
    
    /* 文章链接容器样式优化 */
    body > a[href^='/article/'] {
        width: 95%;
        margin: 15px auto;
        padding: 14px 18px;
        font-size: 1rem;
    }
}

/* 如果导航链接数量不同，可以动态计算高度 */
@media (max-width: 768px) {
    /* 根据实际导航链接数量调整，这里假设有8个链接（7个导航 + xsx图标） */
    body {
        padding-top: calc(40px * 7 + 40px);
    }
    
    h1 {
        margin-top: calc(40px * 7 + 60px);
    }
}

/* 更小屏幕的优化（< 480px） */
@media (max-width: 480px) {
    body > a:not([href^='/article/']):not([href='/xsx']) {
        height: 38px;
        font-size: 0.8rem;
        padding: 0 12px;
    }
    
    body > a[href='/']:not([href^='/article/']) { top: 0; }
    body > a[href='/publicShare']:not([href^='/article/']) { top: 38px; }
    body > a[href='/article']:not([href^='/article/']) { top: 76px; }
    
    /* 移动端隐藏随笔导航链接 */
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
    }
    
    body > a[href='/chat']:not([href^='/article/']) { top: 114px; }
    body > a[href='/tools']:not([href^='/article/']) { top: 152px; }
    body > a[href='/login']:not([href^='/article/']) { top: 190px; }
    body > a[href='/signUp']:not([href^='/article/']) { top: 228px; }
    body > a[href='/comment']:not([href^='/article/']) { top: 266px; }
    
    body {
        padding-top: calc(38px * 7 + 38px);
    }
    
    h1 {
        margin-top: calc(38px * 7 + 50px);
        font-size: 1.5rem;
    }
    
    body > a[href='/xsx'] {
        width: 38px;
        height: 38px;
    }
}

/* 添加可选的汉堡菜单按钮（如果需要折叠功能） */
@media (max-width: 768px) {
    /* 如果需要菜单折叠功能，可以使用以下样式 */
    .menu-toggle {
        display: none; /* 默认不显示，如需使用可以添加JavaScript */
    }
    
    /* 或者使用纯CSS实现简单的折叠效果（可选） */
    /*
    body.menu-collapsed > a:not([href^='/article/']):not([href='/xsx']):not(:first-child) {
        display: none;
    }
    */
}
/* ========= 移动端折叠/展开按钮样式 ========= */
.nav-toggle-btn {
    display: none;  /* 桌面端默认隐藏 */
    position: fixed;
    top: 5px;
    left: 10px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.nav-toggle-btn:hover {
    background: #2c3e50;
    transform: scale(1.02);
}

/* 移动端显示按钮 */
@media (max-width: 768px) {
    .nav-toggle-btn {
        display: block;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .nav-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 24px;
        top: 3px;
        left: 8px;
    }
}

/* ========= 移动端折叠/展开功能（默认展开，可收缩） ========= */
@media (max-width: 768px) {
    /* 覆盖之前的强制显示规则，让导航栏可以被JS控制 */
    body > a:not([href^='/article/']):not([href='/xsx']) {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    }
    
    /* 收缩状态：点击按钮后隐藏 */
    body.nav-collapsed > a:not([href^='/article/']):not([href='/xsx']) {
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    /* 确保随笔在移动端始终隐藏，即使有nav-collapsed类也不显示 */
    body.nav-collapsed > a[href='/essay']:not([href^='/article/']),
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: none !important;
    }
}

/* ========= 新增：桌面端“随笔”隐藏并在“文章”悬停时展开 ========= */
/* 仅在桌面端生效（宽度大于768px） */
@media (min-width: 769px) {
    /* 默认隐藏随笔导航项 */
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        pointer-events: none;
    }
    
    /* 当悬浮在文章导航项上时，显示随笔导航项（优雅向下展开） */
    body > a[href='/article']:not([href^='/article/']):hover ~ a[href='/essay']:not([href^='/article/']) {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
    
    /* 同时保证随笔导航项的定位与展开动画正常 */
    body > a[href='/essay']:not([href^='/article/']) {
        position: fixed;
        top: 40px;
        left: 28%;
        width: 8%;
        min-width: 60px;
        z-index: 999;
        background-color: rgba(52, 73, 94, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-20px);
        transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        top: 45px;
        left: 20%;
        border-top: 1px solid rgba(255,255,255,0.2);
        border-radius: 0 0 8px 8px;
        height: 40px;
        line-height: 40px;
        padding: 0 6px;
        font-size: 0.75rem;
    }
    
    /* 调整文章导航悬停时随笔的显示效果 */
    body > a[href='/article']:not([href^='/article/']):hover ~ a[href='/essay'] {
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: inline-block !important;
    }
    
    /* 确保随笔默认完全隐藏，不影响布局 */
    body > a[href='/essay']:not([href^='/article/']) {
        display: none !important;
    }
    
    /* 悬停时显示并展开 */
    body > a[href='/article']:not([href^='/article/']):hover ~ a[href='/essay'] {
        display: inline-block !important;
    }
    
    /* 当鼠标移动到随笔本身上时，保持展开状态，避免立即收回 */
    body > a[href='/article']:not([href^='/article/']):hover ~ a[href='/essay'],
    body > a[href='/essay']:not([href^='/article/']):hover {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
    
    /* 调整随笔样式使其更美观，与文章导航风格协调 */
    body > a[href='/essay']:not([href^='/article/']) {
        background-color: rgba(52, 73, 94, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255,255,255,0.2);
        font-weight: 500;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    body > a[href='/essay']:not([href^='/article/']):hover {
        background-color: #2c3e50;
        transform: translateY(2px);
    }
    
    /* 确保随笔展开时不覆盖其他导航链接，且不影响布局 */
    body > a[href='/essay']:not([href^='/article/']) {
        top: 45px;
        z-index: 1001;
    }
}

/* ========= 美化后的 h1 大标题样式 ========= */
h1 {
    margin: 30px auto 40px;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 40%, #2ecc71 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    letter-spacing: 2px;
    padding-bottom: 20px;
    border-bottom: none;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    animation: fadeIn 0.8s ease-out, shimmer 3s infinite linear;
}

/* 渐变文字扫光动画 */
@keyframes shimmer {
    0% {
        background-position: 0% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 装饰下划线：渐变双线 + 圆点装饰 */
h1::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12);
    border-radius: 4px;
    transition: width 0.4s ease;
}

h1:hover::before {
    width: 140px;
}

/* 添加底部小圆点装饰 */
h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #f39c12;
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s ease;
}

h1:hover::after {
    width: 12px;
    height: 12px;
    background: #e67e22;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.6);
}

/* 保留原有的书籍图标，但做增强处理 */
h1 .icon {
    display: inline-block;
    margin-right: 12px;
    font-size: 0.9em;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #f39c12;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

h1:hover .icon {
    transform: rotate(5deg) scale(1.05);
}

/* 注意：如果 HTML 中 h1 内容为 "文章"，建议包裹图标，但您未改 HTML，
   所以上面的 .icon 样式需要配合 HTML 修改才生效。若无修改，图标样式仍走原来的 h1::before，
   下面保留原图标样式但微调，并与新样式兼容。
   原 h1::before 是 "📚 "，可能会与渐变文字冲突，做如下调整： */
h1::before {
    content: "📚 ";
    font-size: 0.9em;
    margin-right: 8px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #f39c12;
    display: inline-block;
    width: auto;
    height: auto;
    position: static;
    transform: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 覆盖掉原来 h1::before 的绝对定位和宽高，使其作为普通内联元素 */
h1::before {
    position: static;
    transform: none;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
}

/* 同时调整下划线用新的伪元素实现，所以上面改写了 before，
   再用一个额外的伪元素做下划线不现实，因为 before 已被占用。
   改为用 after 做下划线，原有 after 做圆点改为用新的伪元素? 
   但 before 已用作图标，after 用作下划线+圆点简单处理，保持干净。 */
h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.4s;
}

/* 圆点装饰 - 重新用一个额外的伪元素？但 after 已被占用，只能合并样式。
   下面我们在 after 上增加阴影圆点效果，实际显示为下划线的发光扩展。 
   如果想要圆点，可以增加 box-shadow 或单独做，简单点就 hover 下划线变长变亮。 */
h1:hover::after {
    width: 120px;
    background: linear-gradient(90deg, #3498db, #f39c12, #2ecc71);
    box-shadow: 0 0 8px rgba(52,152,219,0.6);
}

/* 移除之前可能冲突的样式，保证渐变文字正常 */
h1 {
    text-shadow: none;
    border-bottom: none;
}

/* 文章页面上传表单美化 - 位于大标题下方、文章列表上方 */
form[action='/shareUpload'] {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: fit-content;
    max-width: 90%;
    margin: 20px auto 35px;
    padding: 18px 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(8px);
    border-radius: 60px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(52, 152, 219, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

form[action='/shareUpload']:hover {
    box-shadow: 0 12px 28px rgba(52, 152, 219, 0.2), 0 0 0 2px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

/* 提示文字样式（"在这里你可以分享文章..."） */
form[action='/shareUpload'] {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.3px;
    flex-wrap: wrap;
    text-align: center;
}

/* 美化文件选择按钮 */
form[action='/shareUpload'] input[type="file"] {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    width: auto;
    min-width: 220px;
}

form[action='/shareUpload'] input[type="file"]:hover {
    background: #ffffff;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 自定义文件选择按钮内部样式 */
form[action='/shareUpload'] input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    color: white;
    padding: 6px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
}

form[action='/shareUpload'] input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #2980b9, #1c6388);
    transform: scale(0.96);
}

/* 美化上传提交按钮 */
form[action='/shareUpload'] input[type="submit"] {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    padding: 10px 32px;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: inherit;
}

form[action='/shareUpload'] input[type="submit"]:hover {
    background: linear-gradient(135deg, #2980b9, #1c6388);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

form[action='/shareUpload'] input[type="submit"]:active {
    transform: translateY(1px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    form[action='/shareUpload'] {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 24px;
        border-radius: 32px;
        width: 90%;
        margin: 15px auto 25px;
        gap: 12px;
    }
    
    form[action='/shareUpload'] {
        font-size: 0.9rem;
        text-align: center;
    }
    
    form[action='/shareUpload'] input[type="file"] {
        width: 100%;
        min-width: unset;
        padding: 10px 15px;
        text-align: center;
    }
    
    form[action='/shareUpload'] input[type="file"]::file-selector-button {
        padding: 6px 16px;
        margin-right: 10px;
    }
    
    form[action='/shareUpload'] input[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
}

/* 平板端优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    form[action='/shareUpload'] {
        gap: 12px;
        padding: 15px 25px;
    }
    
    form[action='/shareUpload'] input[type="file"] {
        min-width: 200px;
    }
}

/* 小屏手机优化 */
@media (max-width: 480px) {
    form[action='/shareUpload'] {
        padding: 16px 18px;
        width: 95%;
    }
    
    form[action='/shareUpload'] input[type="file"] {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    form[action='/shareUpload'] input[type="file"]::file-selector-button {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    
    form[action='/shareUpload'] input[type="submit"] {
        padding: 10px;
        font-size: 0.9rem;
    }
}

/* 添加优雅的聚焦环 */
form[action='/shareUpload'] input[type="file"]:focus,
form[action='/shareUpload'] input[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4);
}

/* 文件选择框已选文件提示优化 */
form[action='/shareUpload'] input[type="file"]:valid {
    border-color: #3498db;
    background-color: #ebf5ff;
}