/* ==========================================================
   IMCP 2027 会议主页：全站现代学术极简风美化（完整最终整合版）
   ========================================================== */

/* ----------------------------------------------------------
   一、 全局现代字体与排版
   ---------------------------------------------------------- */
body, 
.conference-page,
.conf_leftMenu,
.confBodyBox,
.support_box,
input, button, select, textarea {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

/* ----------------------------------------------------------
   二、 左右布局与响应式保护（桌面端固定，移动端自适应）
   ---------------------------------------------------------- */
@media (min-width: 768px) {
    .conf_leftMenu {
        width: 260px !important;
        float: left !important;
    }
    .confBodyBox,
    #confSectionsBox > .confBodyBox {
        margin-left: 285px !important; /* 左侧栏 260px + 25px 呼吸间距 */
        float: none !important;
        width: auto !important;
        display: block !important;
    }
}

@media (max-width: 767px) {
    .conf_leftMenu {
        width: 100% !important;
        float: none !important;
        margin-bottom: 20px !important;
    }
    .confBodyBox,
    #confSectionsBox > .confBodyBox {
        margin-left: 0 !important;
    }
}

/* ----------------------------------------------------------
   三、 左侧导航菜单美化
   ---------------------------------------------------------- */
.conf_leftMenu ul#outer {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    background: #ffffff !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.conf_leftMenu ul#outer li {
    border-bottom: 1px solid #f1f5f9 !important;
    margin: 0 !important;
    background: transparent !important;
    transition: all 0.2s ease-in-out !important;
}
.conf_leftMenu ul#outer li:last-child {
    border-bottom: none !important;
}
.conf_leftMenu ul#outer li a {
    padding: 12px 18px !important;
    color: #475569 !important;
    font-weight: 500 !important;
    display: block !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}
.conf_leftMenu ul#outer li a:hover {
    background-color: #f0f7ff !important;
    color: #004098 !important;
    padding-left: 24px !important;
}
.conf_leftMenu ul#outer li.selected,
.conf_leftMenu ul#outer li.active,
.conf_leftMenu ul#outer li[class*="selected"],
.conf_leftMenu ul#outer li[class*="active"] {
    background-color: #f0f7ff !important;
    border-left: 4px solid #004098 !important;
}
.conf_leftMenu ul#outer li.selected a,
.conf_leftMenu ul#outer li.active a {
    color: #004098 !important;
    font-weight: 600 !important;
    padding-left: 14px !important;
}

/* ----------------------------------------------------------
   四、 左侧 “Contact us” 卡片美化 + 注入收款与地址信息
   ---------------------------------------------------------- */
.support_box {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    background: #ffffff !important;
    margin-top: 24px !important;
    overflow: hidden !important;
}
.support_box h3 {
    background: #004098 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 12px 18px !important;
    margin: 0 !important;
    letter-spacing: 0.5px !important;
    border: none !important;
}
.support_box ul {
    padding: 12px 18px !important;
    margin: 0 !important;
    list-style: none !important;
}
.support_box ul li {
    padding: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    border: none !important;
}
.support_box ul li a {
    color: #475569 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    white-space: normal !important;
    word-break: break-all !important;
    text-overflow: unset !important;
    overflow: visible !important;
    display: inline-block !important;
    max-width: 100% !important;
    line-height: 1.4 !important;
}
.support_box ul li a:hover {
    color: #004098 !important;
    text-decoration: underline !important;
}
.support_box ul li .icon-mail,
.support_box ul li span {
    color: #64748b !important;
    margin-right: 10px !important;
}

/* ----------------------------------------------------------
   四（补充）、联系卡片底部：机构名称（深色）与地址（灰色紧凑）
   ---------------------------------------------------------- */
/* 调整 ul 底部边距，保证虚线分割线贴合 */
.support_box ul {
    padding-bottom: 0 !important;
}

/* 1. 机构名称：保持深色、稍微加粗 */
.support_box ul::after {
    content: "National Space Science Center, CAS";
    display: block !important;
    margin: 12px -18px 0 -18px !important; /* 抵消父级内边距，使背景和虚线通栏 */
    padding: 12px 18px 4px 18px !important;
    border-top: 1px dashed #e2e8f0 !important;
    background-color: #f8fafc !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

/* 2. 详细地址：优雅浅灰、更紧凑的行距与字号 */
.support_box::after {
    content: "Jingmi North 2nd Street, Yanqi Economic Development Zone, Huairou District, Beijing, China";
    display: block !important;
    padding: 0 18px 12px 18px !important;
    background-color: #f8fafc !important;
    color: #64748b !important;       /* 优雅柔和的 Slate 灰色 */
    font-size: 11.5px !important;      /* 略微缩小字号，突出主次关系 */
    line-height: 1.3 !important;       /* 紧凑行间距 */
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

/* ----------------------------------------------------------
   五、 右侧主内容区及表格超级重构（针对 rowspan 特殊优化）
   ---------------------------------------------------------- */
.confBodyBox {
    color: #334155 !important;
    line-height: 1.7 !important;
    font-size: 14.5px !important;
}

.confBodyBox h2, 
.confBodyBox h1 {
    color: #0f172a !important; 
    font-size: 24px !important;
    font-weight: 600 !important;
    margin-bottom: 24px !important;
}

/* 富文本展示表格重构（加 .rend-html 避免干扰系统原生日程表） */
.confBodyBox .rend-html table,
#confSectionsBox .rend-html table,
.confBodyBox > table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 28px 0 !important;
    background: #ffffff !important;
    border: 1px solid #dcdfe4 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

.confBodyBox table th,
#confSectionsBox table th {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 600 !important;
    padding: 14px 16px !important;
    border-bottom: 2px solid #cbd5e1 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: 1px solid #e2e8f0 !important;
    font-size: 13.5px !important;
}
.confBodyBox table th:last-child {
    border-right: none !important;
}

.confBodyBox table td,
#confSectionsBox table td {
    padding: 14px 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: 1px solid #f1f5f9 !important;
    color: #334155 !important;
    font-size: 13px !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
}
.confBodyBox table td:last-child {
    border-right: none !important;
}

.confBodyBox table tr:last-child td {
    border-bottom: none !important;
}

/* 付款按钮化预设（针对包含 pay 属性或特定按钮样式的超链接） */
.confBodyBox table td a.btn,
.confBodyBox table td a[href*="pay"] {
    display: inline-block !important;
    background-color: #004098 !important;
    color: #ffffff !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 6px rgba(0, 64, 152, 0.1) !important;
}
.confBodyBox table td a.btn:hover,
.confBodyBox table td a[href*="pay"]:hover {
    background-color: #003380 !important;
    box-shadow: 0 4px 12px rgba(0, 64, 152, 0.2) !important;
    transform: translateY(-1px);
}

/* 隐藏空段落与优化列表间距 */
.confBodyBox p:empty {
    display: none !important;
}
.confBodyBox ul {
    padding-left: 20px !important;
    margin-top: 12px !important;
}
.confBodyBox li {
    margin-bottom: 10px !important;
    line-height: 1.6 !important;
}

/* ----------------------------------------------------------
   六、 彻底隐去整个底部页脚区域
   ---------------------------------------------------------- */
.footer,
footer {
    display: none !important;
}

/* ==========================================================
   九、 页头 "Workshop Homepage" 做成可点链接（菜单条目承载 · 全站每页生效）
   ----------------------------------------------------------
   为什么用菜单条目：真实 <a> 必须存在于每一页的 DOM 里。
   自定义页面的正文只在那一个页面存在（从 Welcome 点去 Registration 就没了）；
   而「事件管理 → Layout → Menu」里新增的「链接」型条目，会在 *所有* 事件页面
   （Welcome / Registration / Abstracts / Payment / Timetable / …）都渲染出真正的 <a>。
   做法：把该 <a> 从左边栏绝对定位到页头信息带内，并收掉它在边栏占的位置。
   实测（1440 视口，测试区与正式区一致）：
         .conf 顶边 = 文档 y50；信息带内三行文字下沿 = .conf 顶边下 152px；
         信息带左沿 = .conf 宽度的一半 − 475px（＝950px 内容列居中后的左沿）。
   维护：改页头标题 / 日期行数 / 加 logo 使文字块变高时，只改 --imcp-text-bottom。
   ========================================================== */
.conf {
    position: relative !important;
    --imcp-text-bottom: 152px;   /* 信息带内三行文字的下沿，距 .conf 顶边 */
    --imcp-pad-bottom: 25px;     /* 信息带底部留白：让这一行上下与前三行同距 */
}
/* 信息带向下延长，给这一行腾出位置 */
.confSubTitleBox {
    padding-bottom: var(--imcp-pad-bottom) !important;
}
/* 原公告条若被启用就收掉（本区曾用它做过初版文案；正式区为空，属空操作） */
.simpleTextAnnouncement {
    display: none !important;
}

/* ⚠️ 关键两条 —— Indico 默认给 #outer 设了 position:relative，
   会把绝对定位的基准从 .conf 抢到左侧菜单里（链接就跑到边栏去了）；
   它同时带的 overflow:hidden 还会把比边栏宽的链接裁掉。两条都必须放开。
   已核实：菜单里没有依赖它定位的绝对定位子项（子菜单 .inner 自身是
   position:relative，不受影响），放开后视觉零变化。 */
.conf_leftMenu ul#outer {
    position: static !important;
    overflow: visible !important;
}

/* 载体＝边栏里那个菜单条目：把它的占位收成 0 并隐形，再让子 <a> 显形。
   注意不能用 display:none —— 那会把子元素一并干掉，链接就彻底没了。 */
.conf_leftMenu ul#outer li:has(a[href*="workshop2027.imcp.ac.cn"]) {
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    visibility: hidden !important;
}
.conf_leftMenu ul#outer a[href*="workshop2027.imcp.ac.cn"] {
    visibility: visible !important;
    position: absolute !important;
    top: calc(var(--imcp-text-bottom) + 2px) !important;   /* 紧接第三行，不留额外空隙 */
    left: max(20px, calc(50% - 475px)) !important;
    height: 18px !important;                   /* 与前三行行高一致 */
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    color: #24425a !important;                 /* 与 .timezone 同色 */
    font: 400 12pt/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    z-index: 9 !important;
}
.conf_leftMenu ul#outer a[href*="workshop2027.imcp.ac.cn"]:hover {
    text-decoration: underline !important;
}
/* 不做窄屏特殊处理：页头高度与视口宽度无关（信息带内容固定 950px，各行都不换行），
   链接在任何宽度下都在同一位置；left 用了 max(20px, …) ，窄屏也不会跑到屏外。
   （曾写过 max-width:420px 的兜底，但 headless 环境拿不到 <420px 的布局视口、
   无法验证，故删除，避免留一段没被验证过的代码。）*/

/* 载体插在菜单末尾，会让原来的最后一项失去 :last-child 的免边框待遇，
   多出一条 1px 分隔线并使下方内容整体下移 1px —— 把前一项的边框也去掉。 */
.conf_leftMenu ul#outer li:has(+ li > a[href*="workshop2027.imcp.ac.cn"]) {
    border-bottom: none !important;
}