- PortalLink 模型已有 logoUrl,渲染缺口在模板:5 套 footer 增 th:if logo 图(url.upload 补基准+alt 名称+lazy) - 5 套 main.css 增 .link-logo(高20px/contain/垂直居中/过宽截断) - PortalSsrIT+2 例(有 logo 渲染图/无 logo 纯文字无 link-logo);mvn -o test 260/260 全绿
345 lines
10 KiB
CSS
345 lines
10 KiB
CSS
/* ============================================================
|
||
* warm-kinder 皮肤包样式(default 派生)(方案 §8.2)
|
||
* 换肤 = 拷贝 default 目录改 CSS 变量与布局,零后端代码。
|
||
* 轮播图设计尺寸约定:1920×560(管理端上传端按此引导裁剪,D2 决策点确认)。
|
||
* ============================================================ */
|
||
:root {
|
||
--primary: #e8722a;
|
||
--primary-dark: #c25a1a;
|
||
--text: #333;
|
||
--text-light: #777;
|
||
--bg: #fff8f0;
|
||
--card-bg: #fffdf9;
|
||
--border: #f3e3d3;
|
||
--max-width: 1200px;
|
||
}
|
||
|
||
* { box-sizing: border-box; }
|
||
body {
|
||
margin: 0;
|
||
font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
|
||
color: var(--text);
|
||
background: var(--bg);
|
||
}
|
||
a { color: inherit; text-decoration: none; }
|
||
a:hover { color: var(--primary); }
|
||
img { max-width: 100%; }
|
||
time, .item-meta { color: var(--text-light); font-size: 13px; }
|
||
.empty { color: var(--text-light); text-align: center; padding: 32px 0; }
|
||
|
||
/* ===== 头部 ===== */
|
||
.site-header { background: var(--card-bg); border-bottom: 1px solid var(--border); }
|
||
.header-inner {
|
||
max-width: var(--max-width);
|
||
margin: 0 auto;
|
||
padding: 18px 16px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
}
|
||
.site-brand { display: flex; align-items: center; gap: 12px; }
|
||
.site-logo { height: 44px; }
|
||
.site-name { font-size: 26px; font-weight: 700; color: var(--primary); }
|
||
.site-search { display: flex; }
|
||
.site-search input {
|
||
border: 1px solid var(--border);
|
||
border-right: none;
|
||
padding: 8px 12px;
|
||
width: 220px;
|
||
outline: none;
|
||
}
|
||
.site-search button {
|
||
border: none;
|
||
background: var(--primary);
|
||
color: #fff;
|
||
padding: 8px 18px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
/* ===== 专业院系下拉(院系子站切换,《院系子站方案》) ===== */
|
||
/* 悬停展开白底纵向列表,右对齐 + 超高滚动(院系数十个子站场景) */
|
||
.site-colleges { position: relative; }
|
||
.site-colleges .colleges-toggle {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
border: 1px solid var(--border);
|
||
padding: 8px 14px;
|
||
cursor: pointer;
|
||
color: var(--primary);
|
||
font-weight: 600;
|
||
white-space: nowrap;
|
||
}
|
||
.site-colleges .colleges-arrow { font-style: normal; font-size: 12px; color: var(--text-light); }
|
||
.site-colleges .colleges-menu {
|
||
display: none;
|
||
position: absolute;
|
||
top: 100%;
|
||
right: 0;
|
||
min-width: 200px;
|
||
max-height: 420px;
|
||
overflow-y: auto;
|
||
margin: 0;
|
||
padding: 6px 0;
|
||
list-style: none;
|
||
background: var(--card-bg);
|
||
border: 1px solid var(--border);
|
||
border-top: 2px solid var(--primary);
|
||
box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
|
||
z-index: 110;
|
||
}
|
||
.site-colleges:hover .colleges-menu { display: block; }
|
||
.site-colleges .colleges-menu li a {
|
||
display: block;
|
||
padding: 9px 16px;
|
||
color: var(--text);
|
||
white-space: nowrap;
|
||
}
|
||
.site-colleges .colleges-menu li a:hover { background: #f2f6fc; color: var(--primary); }
|
||
.site-colleges .colleges-menu li.active a { color: var(--primary); font-weight: 600; }
|
||
.site-nav { background: var(--primary); }
|
||
.site-nav ul {
|
||
max-width: var(--max-width);
|
||
margin: 0 auto;
|
||
padding: 0 16px;
|
||
list-style: none;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
}
|
||
.site-nav li a {
|
||
display: block;
|
||
padding: 12px 22px;
|
||
color: #fff;
|
||
}
|
||
.site-nav li:hover a, .site-nav li.active a { background: var(--primary-dark); }
|
||
|
||
/* ===== 二级下拉导航 ===== */
|
||
/* 面板为白底纵向列表:需整体覆盖 .site-nav ul 的横向 flex 与内边距 */
|
||
.site-nav > ul > li { position: relative; }
|
||
.site-nav li.has-sub > a::after { content: " ▾"; font-size: 12px; opacity: .85; }
|
||
.site-nav ul.sub-nav {
|
||
display: none;
|
||
position: absolute;
|
||
top: 100%;
|
||
left: 0;
|
||
min-width: 168px;
|
||
max-width: none;
|
||
margin: 0;
|
||
padding: 6px 0;
|
||
list-style: none;
|
||
background: var(--card-bg);
|
||
border: 1px solid var(--border);
|
||
border-top: 2px solid var(--primary);
|
||
box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
|
||
z-index: 100;
|
||
}
|
||
.site-nav li:hover > .sub-nav { display: block; }
|
||
.site-nav .sub-nav li a {
|
||
padding: 9px 16px;
|
||
color: var(--text);
|
||
white-space: nowrap;
|
||
background: none;
|
||
}
|
||
.site-nav .sub-nav li a:hover { background: #f2f6fc; color: var(--primary); }
|
||
.site-nav .sub-nav li.active a { color: var(--primary); font-weight: 600; }
|
||
|
||
/* ===== 首页轮播 ===== */
|
||
.banner { position: relative; max-width: var(--max-width); margin: 16px auto; overflow: hidden; }
|
||
.banner-slides { position: relative; height: 420px; }
|
||
.banner-slide { display: none; position: absolute; inset: 0; }
|
||
.banner-slide.active { display: block; }
|
||
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
|
||
.banner-title {
|
||
position: absolute;
|
||
left: 0; right: 0; bottom: 0;
|
||
padding: 12px 20px;
|
||
color: #fff;
|
||
background: linear-gradient(transparent, rgba(0, 0, 0, .6));
|
||
}
|
||
.banner-dots {
|
||
position: absolute;
|
||
bottom: 12px; right: 20px;
|
||
display: flex; gap: 8px;
|
||
}
|
||
.banner-dots button {
|
||
width: 10px; height: 10px;
|
||
border-radius: 50%;
|
||
border: none;
|
||
background: rgba(255, 255, 255, .6);
|
||
cursor: pointer;
|
||
}
|
||
.banner-dots button.active { background: #fff; }
|
||
|
||
/* ===== 通用区块 ===== */
|
||
.top-strip, .category-block {
|
||
max-width: var(--max-width);
|
||
margin: 16px auto;
|
||
padding: 20px;
|
||
background: var(--card-bg);
|
||
border: 1px solid var(--border);
|
||
}
|
||
.section-title, .block-head h2 {
|
||
margin: 0 0 12px;
|
||
font-size: 20px;
|
||
border-left: 4px solid var(--primary);
|
||
padding-left: 10px;
|
||
}
|
||
.block-head { display: flex; align-items: baseline; justify-content: space-between; }
|
||
.more { font-size: 13px; color: var(--text-light); }
|
||
.top-strip ul, .block-list { list-style: none; margin: 0; padding: 0; }
|
||
.top-strip li, .block-list li {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
padding: 9px 0;
|
||
border-bottom: 1px dashed var(--border);
|
||
}
|
||
.top-strip li:last-child, .block-list li:last-child { border-bottom: none; }
|
||
.top-strip li a, .block-list li a {
|
||
flex: 1;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.top-badge {
|
||
flex: none;
|
||
color: #fff;
|
||
background: var(--primary);
|
||
font-size: 12px;
|
||
padding: 1px 6px;
|
||
border-radius: 2px;
|
||
}
|
||
|
||
/* ===== 列表页 ===== */
|
||
.list-main {
|
||
max-width: var(--max-width);
|
||
margin: 16px auto;
|
||
padding: 24px;
|
||
background: var(--card-bg);
|
||
border: 1px solid var(--border);
|
||
}
|
||
.breadcrumb { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }
|
||
.breadcrumb a { margin-right: 8px; }
|
||
.breadcrumb span { margin-left: 8px; }
|
||
.page-title {
|
||
font-size: 22px;
|
||
border-left: 4px solid var(--primary);
|
||
padding-left: 10px;
|
||
margin: 0 0 18px;
|
||
}
|
||
.article-list { list-style: none; margin: 0; padding: 0; }
|
||
.article-list li { padding: 14px 0; border-bottom: 1px dashed var(--border); }
|
||
.item-title { font-size: 17px; }
|
||
.item-summary {
|
||
color: var(--text-light);
|
||
font-size: 14px;
|
||
margin: 6px 0;
|
||
overflow: hidden;
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 2;
|
||
-webkit-box-orient: vertical;
|
||
}
|
||
.item-meta { display: flex; gap: 10px; align-items: center; }
|
||
|
||
/* ===== 分页 ===== */
|
||
.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0 4px; }
|
||
.pagination a {
|
||
min-width: 34px;
|
||
text-align: center;
|
||
padding: 6px 10px;
|
||
border: 1px solid var(--border);
|
||
background: var(--card-bg);
|
||
}
|
||
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
|
||
|
||
/* ===== 详情/单页 ===== */
|
||
.detail-main {
|
||
max-width: var(--max-width);
|
||
margin: 16px auto;
|
||
padding: 32px;
|
||
background: var(--card-bg);
|
||
border: 1px solid var(--border);
|
||
}
|
||
.article-title { margin: 8px 0 12px; font-size: 26px; text-align: center; }
|
||
.article-meta {
|
||
display: flex;
|
||
gap: 18px;
|
||
justify-content: center;
|
||
flex-wrap: wrap;
|
||
color: var(--text-light);
|
||
font-size: 13px;
|
||
padding-bottom: 18px;
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
.article-content { line-height: 1.9; font-size: 16px; padding-top: 20px; word-break: break-word; }
|
||
.article-content img { height: auto; }
|
||
.article-content table { border-collapse: collapse; width: 100%; }
|
||
.article-content table td, .article-content table th { border: 1px solid var(--border); padding: 6px 10px; }
|
||
.article-sibling { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; font-size: 14px; }
|
||
|
||
/* ===== 页脚 ===== */
|
||
.site-footer { margin-top: 32px; background: var(--primary-dark); color: rgba(255, 255, 255, .85); }
|
||
.footer-links {
|
||
max-width: var(--max-width);
|
||
margin: 0 auto;
|
||
padding: 18px 16px 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 8px;
|
||
}
|
||
.links-group { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; }
|
||
.group-name { font-weight: 600; margin-right: 4px; }
|
||
.footer-info {
|
||
max-width: var(--max-width);
|
||
margin: 0 auto;
|
||
padding: 12px 16px 20px;
|
||
text-align: center;
|
||
font-size: 13px;
|
||
}
|
||
.footer-info p { margin: 4px 0; }
|
||
|
||
/* ===== 移动端适配 ===== */
|
||
@media (max-width: 768px) {
|
||
.header-inner { flex-direction: column; align-items: stretch; }
|
||
.site-search input { flex: 1; width: auto; }
|
||
.site-colleges { align-self: flex-start; }
|
||
.site-colleges .colleges-menu { left: 0; right: auto; min-width: 100%; }
|
||
.banner-slides { height: 200px; }
|
||
.detail-main, .list-main { padding: 18px 14px; }
|
||
.article-title { font-size: 22px; }
|
||
/* 触屏无 hover:子菜单静态平铺(缩进列表),不做浮层 */
|
||
.site-nav ul.sub-nav {
|
||
display: block;
|
||
position: static;
|
||
border: none;
|
||
box-shadow: none;
|
||
background: transparent;
|
||
min-width: 0;
|
||
padding: 0 0 6px;
|
||
}
|
||
.site-nav .sub-nav li a { color: rgba(255, 255, 255, .9); padding: 8px 16px 8px 34px; }
|
||
.site-nav .sub-nav li a:hover { background: var(--primary-dark); color: #fff; }
|
||
}
|
||
|
||
/* ===== warm-kinder 主题差异层(方案 §7:差异仅限 CSS + fragments)===== */
|
||
/* 圆角卡片 + 暖色系 */
|
||
.site-header { border-radius: 0 0 24px 24px; }
|
||
.site-footer { border-radius: 24px 24px 0 0; }
|
||
.banner, .banner-title { border-radius: 20px; overflow: hidden; }
|
||
.site-search input, .site-search button { border-radius: 999px; }
|
||
.footer-info p { color: var(--primary-dark); }
|
||
|
||
/* B4 友链 Logo:与名称并排小图(高度 ~20px,垂直居中;过宽截断不撑破页脚) */
|
||
.links-group a .link-logo,
|
||
.sp-links-row a .link-logo {
|
||
height: 20px;
|
||
width: auto;
|
||
max-width: 64px;
|
||
object-fit: contain;
|
||
vertical-align: middle;
|
||
margin-right: 4px;
|
||
border-radius: 2px;
|
||
}
|