/* ================================================================
   1. 基础筛选区 & 列表页交互 (全部保留并优化)
   ================================================================ */
.poetry-filter-glass-box {
    background: rgba(30, 20, 50, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px; 
    color: #fff;
}

.poetry-filter-row {
    display: flex; 
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
    position: relative;
}

.p-col-label { flex: 0 0 60px; color: rgba(255,255,255,0.5); font-size: 14px; }
.p-col-all { flex: 0 0 65px; }
.p-col-main { flex: 1; overflow: hidden; }
.p-col-more { flex: 0 0 60px; text-align: right; }

.p-scroll-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 15px;
    overflow-x: auto !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding: 10px 20px !important; 
    position: relative;
}

.p-scroll-container::-webkit-scrollbar { display: none; }

/* 按钮与标签通用样式 */
.p-btn-all, .p-tag-item {
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: "HarmonyOS Sans SC", sans-serif !important;
    font-size: 14px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    padding: 6px 16px !important;
    margin: 4px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    display: inline-block;
}

.p-btn-all.is-active, .p-tag-item.is-current {
    background: linear-gradient(135deg, #7832ff, #0091ea) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(120, 50, 255, 0.4) !important;
    transform: scale(1.05) !important;
}

.p-btn-more { 
    color: #b388ff !important;
    background: rgba(179, 136, 255, 0.3) !important;
    border: 1px solid rgba(179, 136, 255, 0.3) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
}

/* ================================================================
   2. 分类页专属弹窗 (Modal) - 核心恢复
   ================================================================ */
.p-modal {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 999999;
    background-color: rgba(0, 0, 0, 0.45) !important; 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    display: none; /* 由 JS 控制 */
    align-items: center;
    justify-content: center;
}

.p-modal-content {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    background: #1e1432; /* 建议给弹窗主体加一个深色背景 */
    padding: 20px;
    border-radius: 16px;
}

.p-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.p-modal-tabs .tab-item {
    color: rgba(255,255,255,0.5);
    margin-right: 20px;
    cursor: pointer;
    font-size: 18px;
}

.p-modal-tabs .tab-item.active {
    color: #fff;
    border-bottom: 2px solid #7c4dff;
}

.p-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.p-grid-item {
    background: rgba(255,255,255,0.05);
    color: #ccc;
    text-align: center;
    padding: 12px 5px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

/* ================================================================
   3. 详情页 (Single Poetry) - 仅保留排版，不干扰分类弹窗
   ================================================================ */
/* 标题模块：渐变背景 + 毛玻璃效果 */
.poetry-header-card {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(0, 145, 234, 0.2)) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 24px !important;
    padding: 30px !important;
    margin-bottom: 25px !important; /* 确保与正文分块 */
    text-align: center;
    text-align: center;
}

/* 标题文字颜色微调，确保在渐变色下清晰 */
.poetry-header-card .entry-title {
    color: #333 !important;
    margin-bottom: 10px !important;

    font-size: 3em;
    margin-bottom: 15px;
    
}

.poetry-header-card .poetry-meta {
    color: #666 !important;
}


.poetry-card {

    background: transparent !important;

    padding: 20px !important; /* 彻底透明后通常需要归零内边距以对齐外层块 */
}

/* 只针对正文主区域添加毛玻璃效果 */
.poetry-main-area {
    background: rgba(255, 255, 255, 0.3) !important; /* 透明底色 */
    backdrop-filter: blur(15px) !important;        /* 毛玻璃模糊 */
    -webkit-backdrop-filter: blur(15px) !important;
}



/* 注意：此处已彻底移除 .poetry-word-highlight, .show-notes, .line-t, .line-n 等冲突类 */

/* ================================================================
   4. 全局锁定与压感
   ================================================================ */
body.ps-locked {
    background: linear-gradient(135deg, #0b0e14 0%, #1a1a2e 100%) !important;
    background-attachment: fixed !important;
}

body.ps-locked #page {
    backdrop-filter: none !important;
    background-color: transparent !important;
}

.p-btn-all:active, .p-tag-item:active, .p-btn-more:active {
    transform: translateY(0px) scale(0.95) !important;
}




/* --- 诗词详情页设置模块增强：注释列表中词语的气泡样式 --- */



.line-n span b {
    color: #0369a1 !important;        /* 强化文字颜色，与原文高亮一致 */
    background-color: #e0f2fe;        /* 浅蓝色气泡背景 */
    padding: 2px 6px;                 /* 增加内边距形成气泡感 */
    border-radius: 4px;               /* 圆角 */
    margin-right: 6px;                /* 与后面解释文字的间距 */
    font-weight: bold;
    display: inline-block;            /* 确保背景包裹性好 */
}

/* --- 1. 容器与基础布局 --- */
.poetry-layout-v4 .inside-article {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}



.poetry-meta {
    color: #636e72;
    font-size: 1.2em;
}

.poetry-card {
    background: #fff;
    padding: 20px;
}

.poetry-line-item {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.line-q {
    font-size: 1.1em;
    color: #2d3436;
    line-height: 1.4;
    position: relative;
}

/* --- 2. 原文交互核心：修复缝隙 --- */
.poetry-word-highlight {
    position: relative;
    display: inline;
    /* 初始状态强制归零，解决 image_923b14.png 提到的割裂感 */
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    transition: background-color 0.2s;
}

.note-ref {
    display: none; /* 初始隐藏 */
    font-size: 0.55em;
    color: #0984e3;
    margin-left: 1px;
    vertical-align: super;
    font-style: normal;
}

/* --- 优化：点开注释后的原文高亮样式 --- */
.show-notes .poetry-word-highlight {
    cursor: pointer;
    background-color: #e0f2fe !important; 
    color: #0369a1 !important;
    
    /* 关键修改：增加间距和圆角 */
    padding: 2px 8px !important;      /* 增加左右内边距，让气泡宽一点 */
    margin: 0 3px !important;         /* 增加左右外边距，让相邻的气泡彻底分开 */
    border-radius: 8px !important;    /* 更大的圆角，看起来更圆润现代 */
    
    /* 增加一个非常淡的边框，增强精致感（可选） */
    border: 1px solid rgba(3, 105, 161, 0.1) !important;
    
    /* 解决行高被 padding 撑开的问题 */
    display: inline-block;
    line-height: 1.1;
    vertical-align: middle;
}

/* 顺便优化下角标，让它和圆润的气泡更搭 */
.show-notes .note-ref {
    display: inline !important;
    font-weight: bold;
    opacity: 0.8;
}

/* --- 3. 译文与底部注释气泡 --- */
.line-t {
    display: none;
    color: #636e72;
    background: #f8f9fa;
    padding: 10px 15px;
    margin-top: 12px;
    border-radius: 4px;
    font-size: 1.05em;
}

.line-t b { color: #0984e3; margin-right: 5px; }

.line-n {
    display: none; 
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.line-n span {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.note-num {
    font-weight: bold;
    color: #94a3b8;
    margin-right: 6px;
    font-style: normal;
}

.line-n span b {
    color: #1e293b;
    margin-right: 4px;
}

/* --- 4. 按钮控制栏 --- */
.poetry-action-bar {
    text-align: center;
    margin: 40px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-toggle {
    padding: 10px 25px;
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
}

.btn-toggle-t { color: #0984e3; border-color: #0984e3; }
.btn-toggle-n { color: #00b894; border-color: #00b894; }

.btn-toggle-t.active { background: #0984e3; color: #fff; }
.btn-toggle-n.active { background: #00b894; color: #fff; }

/* --- 5. 鉴赏区与点击弹窗 --- */
.poetry-jianshang-section {
    line-height: 2;
    color: #2d3436;
    font-size: 1.1em;
    margin-top: 50px;
}

.poetry-jianshang-section .section-title {
    border-left: 5px solid #2d3436;
    padding-left: 15px;
    margin: 40px 0 20px;
}


/* 统一的毛玻璃容器样式 */
.poetry-card {
    /* 1. 背景透明度：决定玻璃的清透程度 */
    background: rgba(255, 255, 255, 0.4) !important; 
    
    /* 2. 核心模糊效果 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* 兼容 Safari */
    
    /* 3. 边框与阴影：增加立体感 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px; /* 建议圆角稍大，视觉更温润 */
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* 4. 间距布局 */
    padding: 30px;
    margin-bottom: 25px; /* 两个卡片之间的间距 */
    overflow: hidden;
}

/* 针对正文模块的微调 */
#poetry-main-area.poetry-card {
    /* 如果正文需要更强调，可以微调背景色 */
}

/* 针对鉴赏模块的微调 */
.poetry-jianshang-section.poetry-card {
    /* 这里的文字通常较多，行高可以适当增加 */
    line-height: 1.8;
}

/* 移动端适配：减少内边距以保证阅读空间 */
@media (max-width: 768px) {
    .poetry-card {
        padding: 20px;
        margin-bottom: 15px;
        border-radius: 12px;
    }
}



#p-popover {
    display: none;
    position: absolute;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    max-width: 250px;
    line-height: 1.5;
}