Files
wordpress-kratos-yang/assets/css/kratos.css
T

2995 lines
75 KiB
CSS
Raw Normal View History

2022-01-07 11:15:42 +08:00
@charset "UTF-8";
/*--------------------------------------------------------------
>>> Kratos 样式表
>>> Yongquan Yang <yangyq.net>
2022-01-07 11:15:42 +08:00
----------------------------------------------------------------
1. 全局
2. 导航
3. Banner
4. 分页按钮
5. 文章列表
6. 文章正文
7. 内容工具区
8. 文章评论
9. 小工具
10. 404
11. 页脚
--------------------------------------------------------------*/
/*--------------------------------------------------------------
1. 全局
--------------------------------------------------------------*/
body {
overflow-x: hidden;
background: #f5f5f5;
font-weight: 350;
font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, opensans, Optima,
"Microsoft Yahei", sans-serif;
line-height: 1.8;
}
a {
color: #00a2ff;
-webkit-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
}
a:hover {
color: #0097ee;
text-decoration: none;
}
a:focus {
outline: 0;
text-decoration: none;
}
ol,
p,
ul {
margin-bottom: 16px;
color: #333;
font-size: 16px;
}
ul,
ol {
margin: 0 0 16px;
padding-left: 16px;
}
ol > li {
margin-bottom: 6px;
padding-left: 2px;
list-style: decimal;
line-height: 22px;
}
ul > li {
margin-bottom: 6px;
padding-left: 2px;
list-style: circle;
line-height: 22px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0 0 30px 0;
color: #333;
font-weight: 400;
}
.tooltip-inner {
padding: 7px 6px;
font-size: 13px;
}
:active,
:focus,
button:focus {
outline: none;
}
.btn-outline-primary.focus,
.btn-outline-primary:focus,
.btn-outline-primary:not(:disabled):not(.disabled).active:focus,
.btn-outline-primary:not(:disabled):not(.disabled):active:focus,
.show > .btn-outline-primary.dropdown-toggle:focus,
.form-control:focus {
box-shadow: none;
}
::-moz-placeholder {
color: #ffffff;
}
::-webkit-input-placeholder {
color: #ffffff;
}
:-ms-input-placeholder {
color: #ffffff;
}
::selection {
background: #ddd;
color: #000;
text-shadow: none;
}
::-webkit-selection {
background: #ddd;
color: #000;
text-shadow: none;
}
::-moz-selection {
background: #ddd;
color: #000;
text-shadow: none;
}
::-webkit-scrollbar {
overflow: auto;
width: 10px;
height: 6.4px;
}
::-webkit-scrollbar-thumb {
min-width: 25px;
min-height: 25px;
border: 1px solid #e0e0e0;
background-color: #bbbbbb;
}
::-webkit-scrollbar-track {
border: 1px solid #efefef;
background-color: #f7f7f7;
}
.k-main {
padding: 23px 0;
}
.k-main.color {
padding-top: 103px;
}
@media only screen and (max-width: 992px) {
.k-main.color {
padding-top: 92px;
}
}
@media only screen and (max-width: 768px) {
.k-main.color {
padding-top: 83px;
}
}
/*--------------------------------------------------------------
2. 导航
--------------------------------------------------------------*/
.k-nav {
position: absolute;
background-color: rgba(40, 42, 44, 0.6);
}
.k-nav .navbar-brand {
color: #ffffff;
font-size: 24px;
}
.k-nav .navbar-brand img {
width: 100px;
}
.k-nav .navbar-toggler {
padding: 13px;
border-color: transparent;
border-radius: 0;
color: #343a40;
text-transform: uppercase;
font-weight: 600;
font-size: 12px;
}
.k-nav .navbar-nav {
position: relative;
}
.k-nav .navbar-nav li {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.k-nav .navbar-nav > li.nav-item > a {
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 400;
font-size: 17px;
}
.k-nav .line {
display: flex;
width: 24px;
height: 2px;
background: #ffffff;
transition: all 0.3s ease-out;
}
.k-nav .second-line {
margin: 5px 0;
}
.nav-close .first-line {
transform: rotate(45deg) translate3d(5px, 5px, 0);
transform-origin: center;
}
.nav-close .second-line {
transform: scale3d(0, 1, 1);
}
.nav-close .third-line {
transform: rotate(-45deg) translate3d(5px, -5px, 0);
transform-origin: center;
}
.navbar-light .navbar-nav .nav-link,
.navbar-light .navbar-nav .nav-link:focus,
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .active > .nav-link,
.navbar-light .navbar-nav .nav-link.active,
.navbar-light .navbar-nav .nav-link.show,
.navbar-light .navbar-nav .show > .nav-link {
color: #ffffff;
}
.navbar-light .navbar-nav .nav-link:hover {
color: rgba(255, 255, 255, 0.8);
}
.navbar-light .navbar-nav .nav-link .fas {
margin-right: 3px;
}
.navbar-light .navbar-nav .dropdown-menu {
margin: 2px 0 0;
padding: 5px 0;
min-width: 140px;
border: none;
font-size: 15px;
}
.dropdown-item.active,
.dropdown-item:active {
background-color: #00a2ff;
}
.dropdown-toggle::after {
display: inline-block;
margin-left: 2px;
border-top: 0;
border-right: 0;
border-bottom: 0;
border-left: 0;
content: "\e62e";
vertical-align: unset;
font-size: 16px;
font-family: kicon;
transform: rotate(180deg);
}
/*--------------------------------------------------------------
导航多级下拉(3.2.27)
--------------------------------------------------------------
* Bootstrap 4 原生不支持嵌套下拉(.dropdown-submenu 在 BS3 有、
* BS4 删了),主题自己补齐。标记来自 theme-navwalker.php:
* 深层父项 <li class="... dropdown-submenu">,子菜单仍是 <ul class="dropdown-menu">。
*
* 桌面端(>992px)交互:**悬停父项,子菜单从右侧弹出**——
* left:100% 让子菜单左边缘贴住 li 右边缘,无缝隙(有缝隙鼠标
* 移过去就会离开 li,子菜单闪没);top:0 让两行首行对齐。
* 子菜单触发链接不带 data-toggle,开合完全走 CSS hover,
* 避免 Bootstrap 的 dropdown JS 用 Popper 重算位置、把子菜单
* 拽回"父项正下方",跟"从右侧弹出"打架。
*
* 移动端(≤992px):悬停不存在,改为**随父级展开直接平铺**:
* position:static + display:block,用左缩进表达层级。
* 整个菜单收起时它也在 .collapse 里,不会提前露出。 */
.navbar-light .navbar-nav .dropdown-submenu {
position: relative;
}
.navbar-light .navbar-nav .dropdown-submenu > .dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
}
.navbar-light .navbar-nav .dropdown-submenu:hover > .dropdown-menu {
display: block;
}
/* 深层父项的箭头:顶层的 kicon 下箭头在这里换成朝右的 CSS 三角,
表达"向右还有一层"。必须同时清掉 kicon 字体与 rotate(180deg),
否则 content:"" 配上图标字体渲染不出任何东西。 */
.navbar-light .navbar-nav .dropdown-submenu > a.dropdown-toggle::after {
content: "";
border-top: 0.32em solid transparent;
border-bottom: 0.32em solid transparent;
border-left: 0.32em solid currentColor;
font-family: inherit;
transform: none;
vertical-align: 0.08em;
}
@media screen and (max-width: 992px) {
.navbar-light .navbar-nav .dropdown-submenu > .dropdown-menu {
position: static;
display: block;
float: none;
margin-left: 16px;
border-left: 1px solid rgba(255, 255, 255, 0.25);
}
.navbar-light .navbar-nav .dropdown-submenu > a.dropdown-toggle::after {
display: none;
}
}
2022-01-07 11:15:42 +08:00
@media only screen and (min-width: 992px) {
.k-nav {
border-bottom: 1px solid transparent;
background: transparent;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
}
.k-nav .navbar-brand {
padding: 10px 20px;
color: #fff;
}
.k-nav .navbar-brand:focus,
.k-nav .navbar-brand:hover {
color: rgba(255, 255, 255, 0.8);
}
.k-nav .navbar-nav > li.nav-item > a {
padding: 10px 20px;
color: #fff;
}
.k-nav .navbar-nav > li.nav-item > a:focus,
.k-nav .navbar-nav > li.nav-item > a:hover {
color: rgba(255, 255, 255, 0.8);
}
.k-nav.is-fixed {
position: fixed;
top: -67px;
border-bottom: 1px solid white;
background-color: rgba(255, 255, 255, 0.9);
-webkit-transition: -webkit-transform 0.2s;
-moz-transition: -moz-transform 0.2s;
transition: transform 0.2s;
}
.k-nav.is-fixed .navbar-brand {
color: #212529;
}
.k-nav.is-fixed .navbar-brand:focus,
.k-nav.is-fixed .navbar-brand:hover {
color: #007bff;
}
.k-nav.is-fixed .navbar-nav > li.nav-item > a {
color: #212529;
}
.k-nav.is-fixed .navbar-nav > li.nav-item > a:focus,
.k-nav.is-fixed .navbar-nav > li.nav-item > a:hover {
color: #007bff;
}
.k-nav.is-visible {
-webkit-transform: translate3d(0, 100%, 0);
-moz-transform: translate3d(0, 100%, 0);
-o-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
-ms-transform: translate3d(0, 100%, 0);
}
}
@media screen and (max-width: 992px) {
.navbar-light .navbar-nav .dropdown-menu,
.navbar-light .navbar-nav .dropdown-item.active,
.navbar-light .navbar-nav .dropdown-item:active,
.navbar-light .navbar-nav .dropdown-item:focus,
.navbar-light .navbar-nav .dropdown-item:hover {
background-color: transparent;
}
.k-nav .navbar-nav > li.nav-item > a {
font-size: 16px;
}
.navbar-light .navbar-nav .dropdown-item {
color: #ffffff;
}
.navbar-light .navbar-nav .dropdown-menu {
padding: 0;
}
}
@media screen and (max-width: 768px) {
.k-nav .navbar-brand {
font-size: 19px;
}
.navbar-light .navbar-nav .nav-link {
font-size: 16px;
}
.navbar-light .navbar-brand:hover {
color: rgba(255, 255, 255, 0.8);
}
.k-nav .navbar-nav > li.nav-item > a {
font-size: 14px;
}
}
/*--------------------------------------------------------------
3. Banner
--------------------------------------------------------------*/
.k-header .banner {
position: relative;
height: 300px;
}
.k-header .banner .overlay {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
width: 100%;
background: rgba(66, 64, 64, 0.2);
}
.k-header .banner .content {
position: relative;
height: 300px;
background-position: center center;
background-size: cover;
}
.k-header .banner .content .introduce {
position: absolute;
top: 37%;
z-index: 10;
width: 100%;
color: #fff;
text-shadow: 2px 2px 2px #666;
cursor: default;
}
.k-header .banner .content .introduce .title {
margin-bottom: 5px;
font-size: 35px;
}
.k-header .banner .content .introduce .mate {
font-size: 25px;
}
@media screen and (max-width: 768px) {
.k-header .banner {
height: 290px;
}
.k-header .banner .content {
height: 290px;
}
.k-header .banner .content .introduce {
top: 43%;
}
.k-header .banner .content .introduce .title {
font-size: 30px;
}
.k-header .banner .content .introduce .mate {
font-size: 20px;
}
}
/*--------------------------------------------------------------
4. 分页按钮
--------------------------------------------------------------*/
.k-main .board .paginations {
margin: 23px auto;
width: 100%;
text-align: center;
font-size: 14px;
}
.k-main .board .paginations a {
padding: 8px 12px;
background: #fff;
color: #444;
}
.k-main .board .paginations .current {
padding: 8px 12px;
background: #00a2ff;
color: #fff;
font-weight: 400;
}
.k-main .board .paginations .dots {
padding: 8px 12px;
background: #fff;
color: #444;
}
.k-main .details .article .content .paginations {
padding-top: 20px;
width: 100%;
font-size: 14px;
}
.k-main .details .article .content .paginations a {
margin: 0 3px;
}
.k-main .details .article .content .paginations a span {
padding: 7px 12px;
border: solid 1px #00a2ff;
background-color: #f0f8ff;
color: #00a2ff;
}
.k-main .details .article .content .paginations .current span,
.k-main .details .article .content .paginations a span:hover {
padding: 7px 12px;
border: solid 1px #00a2ff;
background: #00a2ff;
color: #ffffff;
font-weight: 400;
}
/*--------------------------------------------------------------
5. 文章列表
--------------------------------------------------------------*/
.k-main .board .article-panel {
margin: 0 0 23px;
border-radius: 0;
background-color: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.k-main .board .article-panel:last-of-type {
margin: 0;
}
.k-main .board .article-panel .a-thumb {
position: relative;
float: left;
overflow: hidden;
margin: 20px;
width: 240px;
height: 145px;
}
.k-main .board .article-panel .a-thumb img {
padding: 2px;
width: 100%;
height: 100%;
border: 1px solid #f3f3f3;
}
.k-main .board .article-panel .a-post {
margin-left: 255px;
padding: 21px 20px 0 3px;
height: 160px;
}
.k-main .board .article-panel .a-post.a-none {
margin-left: 0;
padding: 20px;
height: auto;
}
.k-main .board .article-panel .a-post .header {
display: -webkit-box;
overflow: hidden;
margin: 3px 0 6px;
/* 下面两条已废弃:新版 Chrome 里 max-height 与 -webkit-line-clamp 同时生效会截断成半行。
直接删除而不是注释,因为注释会被 CSS 压缩器剥掉,产物里等于没改。 */
2022-01-07 11:15:42 +08:00
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}
.k-main .board .article-panel .a-post .header .label {
position: relative;
top: -2px;
display: inline-block;
margin-right: 5px;
padding: 4px 6px 3px;
border-radius: 0;
background-color: #00a2ff;
color: #fff;
vertical-align: baseline;
text-align: center;
white-space: nowrap;
font-size: 12px;
line-height: 14px;
}
.k-main .board .article-panel .a-post .header .label .label-arrow {
position: absolute;
top: 6px;
right: -4px;
width: 0;
height: 0;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px solid #00a2ff;
content: "";
vertical-align: top;
}
.k-main .board .article-panel .a-post .header .title {
display: inline;
margin: 0;
font-size: 21px;
}
.k-main .board .article-panel .a-post .header .title a {
color: #333;
}
.k-main .board .article-panel .a-post .header .title a:hover {
color: #0097ee;
}
.k-main .board .article-panel .a-post .content {
display: block;
display: -webkit-box;
overflow: hidden;
max-height: 110px;
text-overflow: ellipsis;
word-wrap: break-word;
cursor: default;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
}
.k-main .board .article-panel .a-post .content p {
margin-bottom: 0;
font-size: 15px;
}
.k-main .board .article-panel .a-meta {
clear: both;
overflow: hidden;
padding: 8px 20px;
border-top: 1px solid #f3f3f3;
font-size: 12px;
line-height: 27px;
}
.k-main .board .article-panel .a-meta span {
font-size: 13px;
line-height: 24px;
cursor: default;
}
.k-main .board .article-panel .a-meta span > i {
margin-right: 3px;
}
.k-main .board .article-panel .a-meta span > a {
color: #333;
}
.k-main .board .article-panel .a-meta span > a:hover {
color: #0097ee;
text-decoration: none;
}
.k-main .board .article-panel .a-meta span > a > i {
margin-left: 3px;
}
.k-main .board .article-panel .search-title {
padding: 20px 25px;
color: #000;
font-size: 18px;
}
.k-main .board .article-panel .nothing {
padding: 50px;
text-align: center;
}
.k-main .board .article-panel .nothing img {
width: 50%;
}
.k-main .board .article-panel .nothing .sorry {
margin-top: 30px;
font-size: 20px;
}
@media screen and (max-width: 768px) {
.k-main .board .article-panel .a-thumb {
position: relative;
float: none;
overflow: hidden;
margin: 0;
margin-bottom: 14px;
padding: 0;
padding-bottom: 53%;
width: auto;
height: 0;
max-width: 100%;
}
.k-main .board .article-panel .a-thumb img {
padding: 0;
height: auto;
max-width: 100%;
border: 0;
}
.k-main .board .article-panel .a-post {
margin-left: 0;
padding: 0 12px;
height: auto;
}
.k-main .board .article-panel .a-post .header {
margin: 0 0 9px;
}
.k-main .board .article-panel .a-post .header .label {
display: none;
}
.k-main .board .article-panel .a-post .header .title {
font-size: 20px;
}
.k-main .board .article-panel .a-post .content {
margin-bottom: 10px;
}
.k-main .board .article-panel .a-post.a-none .content {
margin-bottom: 0;
}
.k-main .board .article-panel .a-meta {
padding: 5px 12px;
}
.k-main .board .article-panel .a-meta span {
font-size: 12px;
}
.k-main .board .article-panel .nothing .sorry {
font-size: 18px;
}
}
/*--------------------------------------------------------------
6. 文章正文
--------------------------------------------------------------*/
.k-main .details .article {
background-color: #fff;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
word-wrap: break-word;
word-break: break-all;
}
.k-main .details .article .breadcrumb-box {
border-bottom: 1px solid #f7f7f7;
}
.k-main .details .article > :first-child {
margin-top: 0;
}
.k-main .details .article > :last-child {
margin-bottom: 0;
}
.k-main .details .article .breadcrumb-box .breadcrumb {
margin-bottom: 0;
padding: 12px 16px;
border-radius: 0;
background-color: inherit;
font-size: 13px;
}
.k-main .details .article .breadcrumb-box .breadcrumb li {
margin-bottom: 0;
list-style: none;
}
.breadcrumb-item + .breadcrumb-item {
padding-left: 0.3rem;
}
.breadcrumb-item + .breadcrumb-item::before {
padding-right: 0.2rem;
}
.k-main .details .article .breadcrumb-box .breadcrumb-item.active {
cursor: default;
}
.k-main .details .article .header {
padding: 0 16px 16px;
}
.k-main .details .article .header .title {
padding-bottom: 0;
border: none;
}
.k-main .details .article .header .meta {
color: #5a5a5a;
font-size: 14px;
cursor: default;
}
.k-main .details .article .header .meta a {
color: inherit;
}
.k-main .details .article .header .meta > span:not(:last-child):after {
margin-right: 5px;
margin-left: 5px;
color: #71777c;
content: "\B7";
}
.k-main .details .article .content {
padding: 0 16px 16px;
word-wrap: break-word;
line-height: 1.8;
word-break: break-all;
}
.k-main .details .article .content::after,
.k-main .details .article .content p::after {
clear: both;
display: block;
content: "";
}
.k-main .details .article h1,
.k-main .details .article .content h2,
.k-main .details .article .content h3,
.k-main .details .article .content h4,
.k-main .details .article .content h5,
.k-main .details .article .content h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 500;
line-height: 32px;
}
.k-main .details .article h1 {
padding-bottom: 4.8px;
/* border-bottom: 1px solid #eaecef; */
font-size: 30px;
line-height: 38px;
}
.k-main .details .article .content h2 {
font-size: 24px;
}
.k-main .details .article .content h2.title {
margin: 16px -16px;
padding: 0 10px;
border-left: 5px solid #00a2ff;
background-color: rgba(243, 243, 243, 0.7);
font-size: 20px;
line-height: 41px;
}
.k-main .details .article .content h3 {
font-size: 18px;
}
.k-main .details .article .content h4 {
font-size: 16px;
}
.k-main .details .article .content h5 {
font-size: 14px;
}
.k-main .details .article .content h6 {
font-size: 12px;
}
.k-main .details .article .content p {
color: #151515;
line-height: 30px;
}
.k-main .details .article .content .progress {
margin-bottom: 16px;
}
.k-main .details .article .content .video-container {
margin-bottom: 16px;
}
.k-main .details .article .content blockquote {
margin-bottom: 16px;
padding: 16px;
border-left: 6px solid #dce6f0;
background: #f2f7fb;
color: #819198;
font-size: 15px;
}
.k-main .details .article .content blockquote p {
margin-bottom: -3px;
}
.k-main .details .article .content hr {
margin: 24px 0;
height: 1px;
border: none;
border-top: 1px solid #a5a5a5;
}
.k-main .details .article .content pre {
margin: 10px 0;
padding: 11px 16px;
border-radius: 4px;
background-color: #f8f8f8;
word-wrap: break-word;
font-size: 11px;
line-height: 1.7;
word-break: break-all;
}
.k-main .details .article .content code {
margin: 0 3px;
padding: 2px 4px;
border-radius: 4px;
background-color: #eff0f1;
color: #333;
font-size: 13px;
word-break: inherit;
}
.k-main .details .article .content kbd {
display: inline-block;
margin: -3px 1.6px 0;
padding: 2.4px 9.6px;
border: 1px solid #adb3b9;
border-radius: 3px;
background-color: #e1e3e5;
box-shadow: 0 1px 0 rgba(12, 13, 14, 0.2), 0 0 0 2px #fff inset;
color: #242729;
vertical-align: middle;
text-shadow: 0 1px 0 #fff;
white-space: nowrap;
font-size: 10px;
line-height: 1.5;
}
.k-main .details .article .content pre code {
margin: 0;
padding: 0;
background-color: transparent;
}
.k-main .details .article .content pre ol {
padding: 0;
}
.k-main .details .article .content pre li {
margin: 0;
list-style: none;
}
.k-main .details .article .content .wp-caption-text {
margin-bottom: 0;
font-size: 14px;
}
.k-main .details .article .content .wp-block-image {
margin-bottom: 0;
}
.k-main .details .article .content .wp-block-image figcaption {
font-size: 14px;
}
.k-main .details .article .content figure {
margin: 0;
}
.k-main .details .article .content .alignleft::after,
.k-main .details .article .content .aligncenter::after,
.k-main .details .article .content .alignright::after {
clear: both;
display: block;
content: "";
}
.k-main .details .article .content .alignleft {
float: left;
margin-right: 16px;
}
.k-main .details .article .content p > img,
.k-main .details .article .content p a > img {
display: block;
}
.k-main .details .article .content .wp-smiley {
display: inline;
}
.k-main .details .article .content .aligncenter {
margin-right: auto;
margin-left: auto;
}
.k-main .details .article .content .alignright {
float: right;
margin-left: 16px;
}
.k-main .details .article .content img {
height: auto;
max-width: 100%;
}
.k-main .details .article .content table {
display: table;
overflow: auto;
width: 100%;
table-layout: fixed;
word-break: break-all;
}
.k-main .details .article .content table th,
.k-main .details .article .content table td {
padding: 8px 16px;
border: 1px solid #e9ebec;
}
.k-main .details .article .content table th {
font-weight: bold;
}
.k-main .details .article .content table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.k-main .details .article .content .alert,
.k-main .details .article .content .card,
.card-header:first-child {
border-radius: 0;
}
.k-main .details .article .content .card-header {
padding: 6px 15px;
}
.k-main .details .article .content .card-body {
padding: 10px 15px;
}
.k-main .details .article .content .alert {
padding: 10px 15px;
}
.k-main .details .article .content .downbtn {
display: inline-block;
margin-bottom: 16px;
padding: 3px 10px;
border: 1px solid #39aaf9;
background: #39aaf9;
color: #fff;
font-size: 14px;
}
.k-main .details .article .content .downbtn:hover {
background: #37a0eb;
color: #fff;
}
.k-main .details .article .content .downbtn:focus {
color: #fff;
text-decoration: none;
}
.k-main .details .article .content .video-container {
position: relative;
overflow: hidden;
padding-bottom: 75%;
height: 0;
}
.k-main .details .article .content .video-container embed,
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.k-main .details .article .content > :last-child {
margin-bottom: 0;
}
.k-main .details .article .copyright {
padding: 0 16px 16px;
}
.k-main .details .article .copyright span {
display: block;
padding: 18px;
background-color: #f7f7fa;
color: #333333;
font-size: 14px;
line-height: 20px;
cursor: default;
}
.k-main .details .article .footer {
padding: 0 16px 10px;
border-top: 1px solid #f2f2f2;
}
.k-main .details .article .footer .tags,
.k-main .details .article .footer .tool {
margin-top: 10px;
}
.k-main .details .article .footer .tags span,
.k-main .details .article .footer .tool span {
color: #333333;
font-size: 14px;
cursor: default;
}
.k-main .details .article .footer .tags a {
margin: 0 5px 0 0;
padding: 2px 7px;
background-color: #a9a9a9;
color: #fff;
font-size: 13px;
}
.k-main .details .article .content .accordion {
margin-bottom: 16px;
border: 1px solid #e5e8ed;
}
.k-main .details .article .content .accordion .acheader {
position: relative;
padding: 5px 15px;
background: #f7f8fa;
}
.k-main .details .article .content .accordion .acheader span {
font-weight: 600;
font-size: 17px;
}
.k-main .details .article .content .accordion .acheader .icon {
position: absolute;
right: 15px;
font-size: 17px;
}
.k-main .details .article .content .accordion .acheader .icon .kicon {
font-size: 17px;
}
.k-main .details .article .content .accordion.active .icon {
-webkit-transition: 0.3s;
transition: 0.3s;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.k-main .details .article .content .accordion .contents {
display: none;
border-top: 1px solid #e6e6e6;
}
.k-main .details .article .content .accordion .contents .inner {
padding: 5px 15px;
}
@media screen and (max-width: 768px) {
.k-main .details .article .header {
padding: 0 16px 12px;
}
.k-main .details .article h1 {
margin-top: 14px;
margin-bottom: 14px;
font-size: 22px;
}
.k-main .details .article .header .meta {
font-size: 12px;
}
.k-main .details .article .content p {
font-size: 15px;
}
.k-main .details .article .content table {
display: block;
word-break: keep-all;
}
.k-main .details .article .header .meta span:not(:first-child) {
margin-left: 5px;
}
.k-main .details .article .header .meta > span:not(:last-child):after {
content: none;
}
.k-main .details .article .content .alert {
padding: 10px 15px;
font-size: 15px;
}
.k-main .details .article .content .card-header {
font-size: 15px;
}
.k-main .details .article .content .card-body {
padding: 12px 15px;
}
.k-main .details .article .content .card-text {
font-size: 14px;
}
}
/*--------------------------------------------------------------
7. 内容工具区
--------------------------------------------------------------*/
.k-main .details .toolbar {
margin-top: 16px;
padding: 20px;
background-color: #fff;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.k-main .details .toolbar .meta {
width: 50%;
cursor: default;
}
.k-main .details .toolbar img {
float: left !important;
margin-right: 8px !important;
width: 56px;
height: 56px;
border-radius: 50%;
}
.k-main .details .toolbar .name {
margin-bottom: -5px;
}
.k-main .details .toolbar .motto {
display: -webkit-box;
overflow: hidden;
margin-top: 10px;
color: #666;
text-overflow: ellipsis;
font-size: 14px;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}
.k-main .details .toolbar .meta .name a {
color: #4a4a4a;
}
.k-main .details .toolbar .share {
margin-top: 12px;
}
.k-main .details .toolbar .share .btn {
width: 90px;
height: 35px;
font-size: 15px;
line-height: 1.65;
}
.k-main .details .toolbar .share .btn-donate {
padding: 3px;
border: 1px solid #00a2ff;
border-radius: 0;
color: #00a2ff;
}
.k-main .details .toolbar .share .btn-donate:focus,
.k-main .details .toolbar .share .btn-donate:hover {
border-color: #00a2ff;
background-color: #00a2ff;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
color: #fff;
}
.k-main .details .toolbar .share .btn-thumbs {
padding: 3px;
border: 1px solid #fb5235;
border-radius: 0;
color: #fb5235;
}
.k-main .details .toolbar .share .btn-thumbs:focus,
.k-main .details .toolbar .share .btn-thumbs:hover {
border-color: #fb5235;
background-color: #fb5235;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
color: #fff;
}
.k-main .details .toolbar .share .btn-primary.focus,
.btn-primary:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.donate-box .meta-pay {
margin-top: 14px;
margin-bottom: 14px;
cursor: default;
}
.donate-box .qr-pay img {
width: 200px;
height: 200px;
}
.donate-box .choose-pay input {
display: none;
}
.donate-box .choose-pay input:checked + label {
border-color: #0092ee;
color: #0092ee;
}
.donate-box .pay-button {
margin: 10px 5px;
width: 132px;
height: 45px;
border: 1px solid #e6e6e6;
border-radius: 2px;
text-align: center;
line-height: 40px;
cursor: pointer;
}
.donate-box .pay-button img {
height: 26px;
}
.k-main .details .post-navigation {
margin-top: 16px;
}
.k-main .details .post-navigation .nav-previous a {
color: #5a5a5a;
}
.k-main .details .post-navigation .nav-next a {
color: #5a5a5a;
}
.k-main .details .post-navigation .nav-previous {
float: left;
padding: 7px 18px;
2022-07-21 11:03:26 +08:00
max-width: 40%;
2022-01-07 11:15:42 +08:00
background-color: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
text-align: left;
}
.k-main .details .post-navigation .nav-next {
float: right;
padding: 7px 18px;
2022-07-21 11:03:26 +08:00
max-width: 40%;
2022-01-07 11:15:42 +08:00
background-color: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
text-align: right;
}
@media screen and (max-width: 768px) {
.k-main .details .toolbar .meta {
margin: 14px 0;
padding-bottom: 16px;
width: 100%;
border-bottom: 1px solid #eee;
}
.k-main .details .toolbar .meta span {
font-size: 12px;
}
.k-main .details .toolbar .meta .love {
display: none !important;
}
.k-main .details .toolbar .share {
margin-top: 16px;
}
.k-main .details .toolbar .motto {
padding-bottom: 5px;
}
.k-main .details .toolbar .share .btn {
width: 88px;
height: 35px;
font-size: 14.5px;
line-height: 1.5;
}
}
/*--------------------------------------------------------------
8. 文章评论
--------------------------------------------------------------*/
.k-main .details .comments {
margin-top: 16px;
padding: 1.6px 16px 16px;
border-radius: 2px;
background-color: #fff;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.k-main .details .post-2 .comments {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.k-main .details .comments .comment-form-author {
padding-right: 5px;
}
.k-main .details .comments .comment-form-email {
padding-left: 5px;
}
.k-main .details .comments .input-group-text {
border: 1px solid #eeeeee;
background-color: #f8f8f8;
}
.k-main .details .comments .form-control {
border: 1px solid #eeeeee;
}
.k-main .details .comments .title {
margin-bottom: 0;
padding: 16px 0;
border-bottom: 1px solid #f0f0f0;
font-size: 19px;
cursor: default;
}
.k-main .details .comments .comment {
padding: 16px 0;
list-style: none;
}
.k-main .details .comments .list > li {
border-bottom: 1px solid #f0f0f0;
}
.k-main .details .comments .comment .avatar {
vertical-align: middle;
}
.k-main .details .comments .comment .avatar img {
display: block;
width: 50px;
height: 50px;
border: 1px solid #eaeaea;
border-radius: 50%;
}
.k-main .details .comments .comment .info {
overflow: hidden;
}
.k-main .details .comments .comment .info .author_name {
display: inline-block;
margin-top: 3px;
color: #252525;
font-weight: 600;
font-style: normal;
font-size: 14px;
line-height: 1.375;
}
.k-main .details .comments .comment .info .author_name a {
color: #252525;
font-weight: 600;
font-size: 14px;
}
.k-main .details .comments .comment .info .content {
margin-bottom: 0 !important;
}
.k-main .details .comments .comment .info .content p {
margin: 0;
color: #000000;
font-size: 13px;
}
.k-main .details .comments .comment .info .content p span {
color: #333;
}
.k-main .details .comments .comment .info .meta,
.k-main .details .comments .comment .info .meta a {
color: #9b9b9b;
font-size: 12.5px;
}
.k-main .details .comments .children {
margin-bottom: 0px;
padding-left: 0px;
}
.k-main .details .comments .children .comment {
margin-bottom: 0px;
padding-bottom: 0px;
}
.k-main .details .comments .comment-respond .comment-textarea {
border: 1px solid #eee;
border-radius: 3px;
background-color: hsla(0, 0%, 71%, 0.1);
}
.k-main .details .comments .comment-respond .comment-textarea textarea {
height: 130px;
border: none;
border-radius: 0;
resize: none;
}
.k-main .details .comments .comment-respond .comment-textarea .text-bar {
overflow: hidden;
padding: 6.4px 8px;
background-color: #f8f8f8;
}
.k-main .details .comments .comment-respond .comment-textarea .text-bar .tool {
padding-top: 4.8px;
}
.k-main
.details
.comments
.comment-respond
.comment-textarea
.text-bar
.tool
a
img {
width: 100%;
}
.k-main .details .comments .comment-respond .comment-textarea .btn-primary {
width: 100px;
border: none;
border-radius: 3px;
background-color: #00a2ff;
font-size: 14px;
}
.k-main .details .comments .comment-respond .comment-textarea .addbtn {
padding: 0 8px;
color: #333333;
}
.k-main .details .comments .comment-respond .comment-textarea .addbtn:hover {
color: #333333;
}
.k-main
.details
.comments
.comment-respond
.comment-textarea
#cancel-comment-reply-link {
display: inline-block;
padding: 6px 12px;
border: none;
border-radius: 3px;
background-color: rgba(0, 0, 0, 0.3);
color: #fff;
vertical-align: middle;
text-align: center;
white-space: nowrap;
font-size: 14px;
line-height: 1.5;
user-select: none;
}
.k-main .details .comments .comment-respond .comment-textarea .text-bar .smile {
position: absolute;
z-index: 9;
visibility: hidden;
padding: 2px;
width: 230px;
height: 102px;
background-color: #fff;
box-shadow: 0 2px 10px 2px rgba(0, 0, 0, 0.11);
transition: all 0.15s ease-out;
transform: perspective(500px) rotateX(-15deg);
transform-origin: 50% 0;
}
.k-main
.details
.comments
.comment-respond
.comment-textarea
.text-bar
.smile
a {
float: left;
display: block;
padding: 4px;
width: 32px;
height: 32px;
border: 2px solid #fff;
background-color: #f0f0f0;
}
.k-main .details .comments .comment-respond .comment-textarea .text-bar .open {
visibility: visible;
transform: none;
}
.k-main .details .comments .comment-respond .error {
padding: 20px;
border: 1px solid #e5e5e5;
border-radius: 4px;
background-color: hsla(0, 0%, 71%, 0.1);
}
.k-main .details .comments .i-reply {
font-size: 12px;
}
#commentpage {
display: block;
}
#commentpage a {
display: inline-block;
width: 144px;
height: 37px;
border: none;
border-radius: 2px;
background-color: #00a2ff;
color: #fff;
font-size: 15px;
line-height: 2.4;
transition: all 0.15s ease-in-out;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media screen and (max-width: 768px) {
.k-main .details .comments .comment-form-author {
padding-right: 15px;
}
.k-main .details .comments .comment-form-email {
padding-left: 15px;
}
}
/*--------------------------------------------------------------
9. 小工具
--------------------------------------------------------------*/
.k-main .sidebar img {
width: 100%;
height: auto;
}
.k-main .sidebar .widget {
margin: 0 0 23px;
padding: 15px 30px;
border-radius: 0;
background-color: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.k-main .sidebar > div:last-child {
margin: 0;
}
/* ══════════════════════════════════════════════════════════════════════
* 「个人简介」挂件(.w-about):尺寸自持(3.2.51)
*
* ── 原来为什么会被大图撑爆 ──────────────────────────────────────────
* 这一组规则原来全部写成三段祖先选择器:
*
* .k-main .sidebar .w-about .wrapper img { width:100px; height:100px }
* .k-main .sidebar .w-about .background { height:120px }
*
* `.k-main` → `.sidebar` → `.w-about` 这三段是**前台文章页/首页的布局**。
* 挂件一旦出现在没有这层祖先的地方:
*
* · WordPress 后台「外观 → 小工具」的挂件预览
* · 区块小工具(Widgets Block Editor)的预览面板
* · 侧栏被别的主题/插件改写结构时
*
* 这些规则**一条都不生效**,头像 <img> 没有任何宽高约束,直接按原图
* 尺寸铺开;`.background` 也会塌成 0 高。
*
* 线上实测(avatar.jpg 原图 2136×2136):
* 有祖先 → 挂件 397×285, 头像 100×100 ✅
* 无祖先 → 挂件 1400×2217,头像 2136×2136 ❌ 撑爆,横向滚动 2156px
*
* ── 现在的做法 ──────────────────────────────────────────────────────
* 只依赖**挂件自己的类名** `.w-about`,不再依赖外层布局。这样无论挂件
* 被丢进什么容器,头像都是固定小圆、背景都是固定高。
*
* 🔴 必须把老的三段选择器**删掉**,不是"再补一条新的"。
* 实测过:`.k-main .sidebar .w-about .wrapper img` 优先级 (0,3,1),
* 而 `.w-about .wrapper img` 只有 (0,2,1)。两条并存时**老规则在前台永远赢**,
* 于是新规则只在后台生效 —— 前台改新规则等于白改,而且会让人误以为
* "改了没反应"。我把头像故意改成 200px 反证过:像素完全不变,
* 因为前台根本用的是老规则。单一真相来源才不会有这个坑。
*
* 🔴 为什么不用 !important:那会让用户/子主题以后想改头像尺寸时
* 完全改不动。
* ══════════════════════════════════════════════════════════════════════ */
/* 背景条:高度不依赖祖先 */
.w-about .background {
height: 120px;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
/* 挂件自身去掉内边距。
*
* 原来写的是 `.k-main .sidebar .w-about, .k-main .sidebar .w-ad { padding:0 }`
* —— 依赖祖先,所以后台预览里会吃 `.widget` 的 15px 内边距,跟前台不一致。
* 下面这组把它拆成两条:
* ① `.w-about` / `.w-ad`(无祖先)—— 覆盖后台/其它容器里的 `.widget` 内边距;
* ② `.k-main .sidebar .w-about` / `.w-ad`(前台)—— 覆盖主题自己的
* `.k-main .sidebar .widget { padding: 15px 30px }`。
*
* 🔴 ② 这条**不能省**:它的对手 `.k-main .sidebar .widget` 优先级 (0,3,0),
* 而 ① 只有 (0,1,0),光靠 ① 在前台会被压回去 —— 实测挂件会多出
* 15px/30px 内边距、整体高 57px(284→341),头像和文字全部错位。
* 两处的**值必须一致**(都是 0),前后台才不会出现分歧。 */
.w-about,
.w-ad {
padding: 0;
}
2022-01-07 11:15:42 +08:00
.k-main .sidebar .w-about,
.k-main .sidebar .w-ad {
padding: 0;
}
/* 头像:固定尺寸 + 裁切,永远不可能超出自己的盒子。
*
* object-fit:cover 是关键 —— 原图 2136×2136、1×1、4000×100、100×4000
* 都能被忠实裁进 100×100 的圆里,不会变形,也不会把盒子撑开。
* 在没有祖先约束的环境里尤其重要:那里没有别的规则兜底。
* (原来是 fill,非正方形头像会被拉伸变形,这次一并修掉。)
*
* 🔴 不要写 display:block —— 实测会带来两处前台外观变化:
* ① 头像从「行内被 text-align:center 居中」变成「块级独占一行」,
* 父级 .wrapper 高度从 50px 变 100px;
* ② x 坐标从 1096.66(居中)变成 948.33(左对齐)。
* 两处都是肉眼可见的位移。保持 inline(默认)才能原样继承 text-center。
*
* 🔴 margin 保持 `-50px 0 0`(水平 0)而不是 `auto`:水平居中本来就由
* 父级 text-align:center 完成,写 auto 在 inline 元素上也不生效。 */
.w-about .wrapper img {
2022-01-07 11:15:42 +08:00
margin: -50px 0 0;
width: 100px;
height: 100px;
max-width: 100px;
max-height: 100px;
object-fit: cover;
2022-01-07 11:15:42 +08:00
border: rgba(255, 255, 255, 0.4) 4px solid;
border-radius: 50%;
}
/* 文字区:同样不依赖祖先 */
.w-about .textwidget {
2022-01-07 11:15:42 +08:00
padding: 5px 20px 20px;
}
.w-about .textwidget p {
2022-01-07 11:15:42 +08:00
margin-bottom: 0;
cursor: default;
}
.w-about .textwidget .username {
2022-01-07 11:15:42 +08:00
font-size: 17px;
font-weight: 500;
margin-bottom: 5px;
}
.w-about .textwidget .about {
2022-01-07 11:15:42 +08:00
font-size: 15px;
}
.k-main .sidebar .w-ad {
position: relative;
}
.k-main .sidebar .w-ad .prompt {
position: absolute;
top: 10px;
right: 10px;
width: 39px;
height: 19px;
background-color: rgba(0, 0, 0, 0.33);
color: #dedede;
text-align: center;
font-size: 12px;
line-height: 19px;
}
/* ══════════════════════════════════════════════════════════════════════
* 「最近评论」挂件(.w-comments)(3.2.52)
*
* ── 为什么自己做,不用插件 ────────────────────────────────────────────
* 原来装的是 Comments Widget Plus。它的三个问题都是实测出来的:
*
* ① 用 `_x('%1$s %2$son%3$s %4$s')` 拼句子,中文渲染成
* 「标题**上的**作者」(zh_CN.po 里 "on" 被译成"上的"),
* 而插件根本没带 zh_CN 语言包(languages/ 只有一个 .pot),
* 所以这句永远是英文语序套中文词。
* ② 文章标题 / 作者 / 摘要**三层同为 16px**,只能靠颜色区分;
* 而标题最长,首条实测 337×96(标题链接 332×50,折 2 行)。
* ③ 实例里 `avatar: false`,纯文字流没有任何视觉抓手。
*
* ── 这组规则的一条硬约束(3.2.51 的教训)────────────────────────────
* 🔴 选择器**只依赖 `.w-comments` 自身**,不写 `.k-main .sidebar .w-comments`。
* 3.2.51 的「个人简介撑爆」就是三段祖先选择器造成的:挂件在
* 后台「外观→小工具」预览里没有 `.k-main .sidebar` 那层祖先,
* 一组规则全部失效,头像按原图 2136px 铺开。
* **前台看起来正常,恰恰是把问题藏死的原因。**
* 🔴 所以这里**故意不写任何内边距规则**:白底与 15px/30px 内边距由
* 外层 `.widget` 提供(前台 `.k-main .sidebar .widget`,
* 后台由 WP 自己的挂件容器提供)。挂件本身不该管这些 ——
* 像 `.w-about` 那样去「对齐」内边距,就又把规则绑回祖先了。
*
* ── 信息层级(这是"漂亮"的全部含义)────────────────────────────────
* 摘要 15px #5a5a5a ← 主体,可点,整段链接到评论锚点
* 作者 14px #00a2ff ← 元信息,主色
* 文章 13px #999 ← 元信息,单行省略
* 时间 13px #999 ← 元信息
* 三层字号**必须不同**,插件"三层同为 16px"是它读起来像一坨的根本原因。
* ══════════════════════════════════════════════════════════════════════ */
/* 挂件内边距:不写。白底 + 15px/30px 由外层 `.widget` 提供,
* 与其它挂件(categories / archive 等)完全一致。理由见上面的 🔴。 */
.w-comments .yang-comment-list {
margin: 0;
padding: 0;
list-style: none;
}
/* 单条:flex 布局。
*
* 🔴 不用 float —— 插件用的是 `float:left` 的头像,长摘要下会出现
* "文字环绕到头像右侧再往下淌",元信息行钻进头像下方,整条错位。
* flex 的每一行都是独立盒子,不会出现环绕。 */
.w-comments .yang-comment-item {
display: flex;
align-items: flex-start;
padding: 12px 0;
border-bottom: 1px dashed #b4afaf;
}
/* 最后一条去掉分隔线 —— 跟 `.w-recommended .bookmark-item:last-child` 一致 */
.w-comments .yang-comment-item:last-child {
padding-bottom: 0;
border-bottom: none;
}
/* 头像:固定圆 + 裁切。
*
* 🔴 object-fit:cover 必须有:评论头像来自 Gravatar,可能是任意宽高比。
* fill(默认)会把人脸拉扁,none 会溢出。
* 🔴 flex-shrink:0 必须有:否则摘要很长时 flex 会把头像压扁(实测
* 40px 会被压到 8px 宽)。 */
.w-comments .yang-comment-avatar {
flex: 0 0 auto;
margin-right: 10px;
}
.w-comments .yang-comment-avatar img {
display: block;
width: 40px;
height: 40px;
max-width: 40px;
max-height: 40px;
object-fit: cover;
border-radius: 50%;
background-color: #f2f2f2;
}
/* 文字区:必须 min-width:0,否则长英文/长 URL 会撑破 flex 容器
* (flex 子项的默认 min-width 是 auto,等于"内容多宽就多宽")。 */
.w-comments .yang-comment-body {
flex: 1 1 auto;
min-width: 0;
}
/* 摘要:主体 */
.w-comments .yang-comment-text {
display: block;
color: #5a5a5a;
font-size: 15px;
line-height: 1.6;
text-decoration: none;
/* 中文长句无空格,必须 break-word,否则一个字都不换行直接溢出 */
overflow-wrap: break-word;
word-wrap: break-word;
}
.w-comments .yang-comment-text:hover {
color: #00a2ff;
}
/* 元信息行:作者 · 时间 · 文章标题 */
.w-comments .yang-comment-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-top: 4px;
color: #999;
font-size: 13px;
line-height: 1.5;
}
.w-comments .yang-comment-author {
color: #00a2ff;
font-size: 14px;
text-decoration: none;
}
.w-comments .yang-comment-sep {
margin: 0 5px;
color: #ccc;
}
.w-comments .yang-comment-time {
flex: 0 0 auto;
color: #999;
}
/* 文章标题:单行省略。
* min-width:0 同样是为了让 flex 允许它比内容窄。 */
.w-comments .yang-comment-post {
flex: 1 1 auto;
min-width: 0;
color: #999;
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.w-comments .yang-comment-post:hover {
color: #00a2ff;
}
/* 窄屏(侧栏整行显示,宽度充裕):让文章标题不必挤在一行里 */
@media (max-width: 991.98px) {
.w-comments .yang-comment-post {
flex: 1 1 100%;
white-space: normal;
overflow: visible;
text-overflow: clip;
}
}
/* ══════════════════════════════════════════════════════════════════════
* 「文章分类」挂件(.w-cats)(3.2.55 / 工单 #24)
*
* ── 它为什么要重做 ────────────────────────────────────────────────────
* 原来侧栏跑的是 WP 核心 `WP_Widget_Categories`,实例配置 `dropdown = 1`,
* 输出的是 `wp_dropdown_categories()` 的一个 `<select>` —— 一个光秃秃的
* 系统下拉框,跟侧栏其余挂件(圆角卡片、14/15px 字号、悬停反馈)完全不搭。
* 更糟的是主题里那套 `.widget_categories ul li` 规则只匹配 `ul`,
* 下拉框里没有 `ul` ⇒ **写了也一条不生效**。
*
* 3.2.54 先改成「父级常显 + 子级折叠树」,8 个父级铺开占约 300px 侧栏高度,
* 被用户否决。3.2.55 改成**真下拉面板**:收起一行、点击弹出、默认只列一级。
* 形态回到"类似原来的 select",但外观是自己画的,能统一到侧栏视觉。
*
* ── 一条硬约束(3.2.51 的教训,别再踩)────────────────────────────────
* 🔴 选择器**只依赖 `.w-cats` 自身**,绝不写 `.k-main .sidebar .w-cats`。
* 3.2.51「个人简介撑爆」就是三段祖先选择器造成的:挂件在后台
* 「外观→小工具」的预览里没有 `.k-main .sidebar` 那层,规则全部失效。
* 前台看着正常,恰恰把问题藏死。
* 🔴 所以这里**不写外边距/白底**:那由外层 `.widget` 提供
* (前台 `.k-main .sidebar .widget`,后台由 WP 自己的挂件容器提供)。
*
* ── 浮层凭什么不被裁掉(实测过,不是猜的)─────────────────────────────
* `.w-cats` 本身就是那个 `.widget`(类名是 `widget w-cats` 两个)。
* 它、`.sidebar`、`.k-main` 都**没有** `overflow` 声明;
* `body { overflow-x: hidden }` 只管横向,纵向裁剪不影响面板。
* ⇒ 面板可以溢出挂件边界往下盖。
* 🔴 若将来给 `.widget` 加上 `overflow:hidden`,面板会被整块切掉 ——
* 这条写在这里就是给那时候看的。
* ══════════════════════════════════════════════════════════════════════ */
/* 定位锚点:面板要相对「触发条」定位,所以 <details> 必须是 containing block。
* 🔴 不能省:缺了它,面板的 absolute 会一路往上找到最近的定位祖先,
* 最坏情况直接贴到视口(`position:absolute` 的包含块规则),
* 面板会飘到页面左上角去。 */
.w-cats .yang-cats-drop {
position: relative;
}
/* ── 触发条(收起时唯一可见的一行)────────────────────────────────── */
.w-cats .yang-cats-trigger {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
border: 1px solid #e7e7e7;
border-radius: 3px;
background-color: #fbfbfb;
color: #333;
font-size: 15px;
line-height: 1.5;
cursor: pointer;
list-style: none; /* 关掉原生三角 marker(Firefox 认这个) */
-webkit-transition: border-color 0.2s, background-color 0.2s;
transition: border-color 0.2s, background-color 0.2s;
/* 关掉长按选中:手机上点开面板时容易顺手把文字选中,很碍事 */
-webkit-user-select: none;
user-select: none;
}
/* Chrome/Safari/Edge 的原生三角 marker 走这个伪元素,不是 list-style */
.w-cats .yang-cats-trigger::-webkit-details-marker {
display: none;
}
.w-cats .yang-cats-trigger:hover {
border-color: #00a2ff;
background-color: #fff;
}
/* 展开时:触发条与面板连成一体(下边圆角收掉、下边框交给面板) */
.w-cats .yang-cats-drop[open] > .yang-cats-trigger {
border-color: #00a2ff;
border-bottom-color: transparent;
border-radius: 3px 3px 0 0;
background-color: #fff;
color: #00a2ff;
}
/* 长分类名:允许任意位置换行(中文没有空格),但不许把箭头挤走 */
.w-cats .yang-cats-label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
overflow-wrap: break-word;
}
/* 箭头:CSS 画的三角,展开时翻 180°。
*
* 🔴 为什么不用字体图标:主题的 kicon 字体只含固定几个字形,
* 加一个要动字体文件;而这个三角用边框就能画,
* 也不会因字体没加载而"箭头消失"。 */
.w-cats .yang-cats-caret {
flex: 0 0 auto;
width: 0;
height: 0;
margin-left: 8px;
border-top: 5px solid #999;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
-webkit-transition: -webkit-transform 0.2s;
transition: transform 0.2s;
}
.w-cats .yang-cats-trigger:hover .yang-cats-caret,
.w-cats .yang-cats-drop[open] > .yang-cats-trigger .yang-cats-caret {
border-top-color: #00a2ff;
}
.w-cats .yang-cats-drop[open] > .yang-cats-trigger .yang-cats-caret {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
/* ── 面板 ──────────────────────────────────────────────────────────────
*
* 🔴 `position: absolute` 是「不推开下面挂件」的关键。
* 若写成 static/relative,展开时整块侧栏往下跳,页面会抖。
*
* 🔴 必须显式写 `:not([open]) .panel { display:none }`,不能只靠浏览器默认。
* 实测背景:`<details>` 收起时浏览器确实不渲染非 summary 子元素,
* 但那属于 UA 样式;一旦面板带 `position:absolute`,某些引擎会把
* "未渲染"与"不参与布局"混起来处理,历史上出现过收起状态仍能
* 被 Tab 聚焦到的情况(焦点跑到看不见的链接上)。显式关掉最稳。
*
* 🔴 `z-index: 20`:主题里更高的只有页脚工具箱的 999(fixed 定位,
* 在页面右下角,与侧栏不重叠)和 banner 的 10。
* 面板要盖住**后面那些挂件**,所以必须建立自己的堆叠层级。 */
.w-cats .yang-cats-panel {
position: absolute;
top: 100%;
right: 0;
left: 0;
z-index: 20;
max-height: 320px;
overflow-x: hidden;
overflow-y: auto;
border: 1px solid #00a2ff;
border-top: none;
border-radius: 0 0 3px 3px;
background-color: #fff;
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
/* iOS 上惯性滚动才顺滑 */
-webkit-overflow-scrolling: touch;
}
.w-cats .yang-cats-drop:not([open]) .yang-cats-panel {
display: none;
}
/* ── 列表与行 ──────────────────────────────────────────────────────────
*
* 🔴🔴 必须重置主题自己的全局 `ul > li`(kratos.css:74):
*
* ul > li { margin-bottom: 6px; padding-left: 2px;
* list-style: circle; line-height: 22px; }
*
* 这一条 3.2.54 是"线上量坐标"才发现的:光看代码很难想到,
* 因为它的特异性 (0,0,2) 看着很弱、而且名字里只是 `ul > li`。
* 不重置的后果都能量出来:
* ① 每行多 6px 下边距,9 行累积 54px —— 面板虚高、滚动条提前出现;
* ② 每行左边多 2px,名字与触发条的文字**对不齐**(差 2px);
* ③ `list-style: circle` 会让每行前面多个圆点;
* ④ `line-height: 22px` 会顶掉组件的 1.5。
*
* ⇒ 在这个组件的每一层 `li` 上都重置,不靠 `:not()` 分叉。
* 3.2.54 正是只在 `:not(.has-children)` 上重置,导致带子级那行漏网。 */
.w-cats .yang-cats-list,
.w-cats .yang-cats-children {
margin: 0;
padding: 0;
list-style: none;
}
.w-cats .yang-cats-item {
display: flex;
align-items: center;
justify-content: space-between;
/* 🔴 flex-wrap 是 3.2.56 支撑"任意层级"的关键:
*
* 有子级的 li 里除了 <a> + <span>,还多一个直接子元素
* `<ul class="yang-cats-children">`。默认 nowrap 时它会挤进同一行,
* 把名字和数字挤扁;
* 这里允许换行,再让子级 ul `flex: 0 0 100%` 独占整行
* ⇒ 子级自然落到父级名字下面,且**父级 li 的 padding-left
* 就成了下一层的缩进基准**(嵌套在内容盒里,缩进逐层累加)。 */
flex-wrap: wrap;
margin-bottom: 0;
padding: 0;
list-style: none;
line-height: 1.5;
}
/* 🔴 这一版的 DOM 结构**统一了**,这是相对 3.2.54 的一处实质改进:
*
* 父级: <li class="yang-cats-item"><a>名字</a><span>数字</span></li>
* 子级: <li class="yang-cats-item"><a>名字</a><span>数字</span></li>
*
* 两者一字不差,都是「<a> + <span> 两个直接子项」,flex 加在 li 上
* 就能两端对齐,不需要区分有没有子级。
*
* 3.2.54 那版父级行是 `<li><details><summary><a/><span/></summary></details></li>`,
* li 里只有 **一个** flex 子项 `<details>`,而 `<details>` 默认宽度
* auto(按内容收缩)⇒ `space-between` 没有第二个子项可推 ⇒ 数字
* 右边界比其他行短 7.1px(实测 [220.5,220.5,227.6,227.6,220.5])。
* 当时的修法是给 `<details>` 加 `flex:1 1 auto; min-width:0`。
* 现在没有嵌套详情框了,**那个 bug 从结构上就不存在了**。 */
.w-cats .yang-cats-list > .yang-cats-item > .yang-cats-link {
min-width: 0;
color: #333;
font-size: 15px;
line-height: 1.5;
text-decoration: none;
/* 中文长分类名没有空格,必须允许任意位置换行,否则撑破面板 */
overflow-wrap: break-word;
word-wrap: break-word;
}
/* 行内点击热区:把内边距放在 <li> 上而不是 <a> 上,
* 这样点在行尾空白处也算点中这一行(<a> 只有文字宽度时热区很窄)。
* 🔴 但 <a> 撑不满只剩一半,所以让 <a> 吃满左侧空间:
* 数字是固定宽的胶囊,<a> 用 flex:1 占其余全部宽度。 */
.w-cats .yang-cats-list > .yang-cats-item {
padding: 0 12px;
}
.w-cats .yang-cats-list > .yang-cats-item > .yang-cats-link,
.w-cats .yang-cats-children > .yang-cats-item > .yang-cats-link {
flex: 1 1 auto;
padding: 8px 0;
}
.w-cats .yang-cats-list > .yang-cats-item:hover,
.w-cats .yang-cats-children > .yang-cats-item:hover {
background-color: #f5faff;
}
.w-cats .yang-cats-list > .yang-cats-item > .yang-cats-link:hover {
color: #00a2ff;
}
/* ── 子分类:任意层级(3.2.56 从"只有两层"改成"有几层列几层")──────────
*
* 🔴 结构(每层都一样,嵌套在父级 li 内部):
*
* <ul class="yang-cats-list">
* <li class="yang-cats-item">
* <a/><span/>
* <ul class="yang-cats-children">
* <li class="yang-cats-item"> <a/><span/> … </li>
* </ul>
* </li>
* </ul>
*
* 🔴 缩进与对齐是怎么同时成立的(这里的算式必须写清楚,改坏很难查):
*
* · 子级 ul 是 li 的 flex 子项,`flex: 0 0 100%` ⇒ 独占一行。
* · 因嵌套在 li 的**内容盒**里,所有层共用一个右边界;
* · 每层 li 只给 **padding-left**(缩进),**padding-right 一律 0**,
* 右侧内边距由最外层的 `.yang-cats-list > .yang-cats-item` 统一给 12px。
*
* ⇒ 任意深度的数字右沿都在同一竖线上(数字要竖着比大小)。
* 3.2.55 就是子级又写了一遍 padding-right,叠成 24px、父子错开 12px。
*
* 🔴 缩进量取 12px/层:面板 250px 宽,减去右侧 12px、数字胶囊约 34px、
* 名字与数字间 8px,留给名字约 196px。三级时名字还剩 172px,
* 中文 15px 字号约能放 11 个字 —— 够用。到四五级会明显挤,
* 所以 CSS 里对超深层的缩进做了收敛(见下面的 `--cat-d` 规则)。
*
* 🔴🔴 缩进只能由一个地方给,不能 ul 和 li 各给一次(3.2.56 实测踩过):
* 第一版 `.yang-cats-children { padding-left: 12px }` 加
* `.yang-cats-children > .yang-cats-item { padding-left: 12px }`
* ⇒ 每层实际缩进 **24px**,几何实测 stepPx=[24,24,18],
* 第 3 层名字就只剩 148px,比设计预期少一半。
* 收敛规则也一起失效(12+6=18,看着像没收敛)。
* ⇒ **子级 ul 的 padding-left 归零,缩进全部由子级 li 的 padding-left 给。**
* 这样一个数字管一件事,收敛规则也能精确生效。 */
.w-cats .yang-cats-children {
/* 独占一整行:父级名字在上,子级列表在下 */
flex: 0 0 100%;
width: 100%;
margin: 0;
/* 🔴 padding-left 必须 0:缩进由子级 li 独立给,两处都加会翻倍 */
padding: 0;
background-color: #fcfcfc;
}
/* 每层子级 li:只留左缩进,右侧归零(右侧由最外层统一给 12px) */
.w-cats .yang-cats-children > .yang-cats-item {
padding: 0 0 0 12px;
}
/* 🔴 第 4 层起缩进收敛:再往下每层只加 6px。
*
* 理由:面板宽度固定,缩进按 12px 线性累加的话,
* 第 5 层只剩 130px 出头,中文名字挤成两三个字一行,反而更难读。
* 分层收敛让深层"还能看出层级"但不至于把空间吃光。
*
* 用 `--cat-d`(渲染时写的真实深度)选层级,而不是靠选择器数嵌套层数 ——
* 后者写死了就只能支持固定层数,又回到 3.2.55 的老问题。 */
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:3"],
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:4"],
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:5"],
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:6"],
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:7"],
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:8"],
.w-cats .yang-cats-children > .yang-cats-item[style*="--cat-d:9"] {
padding-left: 6px;
}
.w-cats .yang-cats-children > .yang-cats-item > .yang-cats-link {
min-width: 0;
color: #777;
font-size: 14px;
line-height: 1.5;
text-decoration: none;
overflow-wrap: break-word;
word-wrap: break-word;
}
/* 更深层再浅一档颜色:三级往下继续淡化,层级更明确(不影响可读性) */
.w-cats .yang-cats-children .yang-cats-children > .yang-cats-item > .yang-cats-link {
color: #8f8f8f;
}
.w-cats .yang-cats-children > .yang-cats-item > .yang-cats-link:hover {
color: #00a2ff;
}
/* ── 文章数 ──────────────────────────────────────────────────────────── */
.w-cats .yang-cats-count {
flex: 0 0 auto;
margin-left: 8px;
padding: 1px 7px;
border-radius: 10px;
background-color: #f5f5f5;
color: #999;
font-size: 12px;
line-height: 18px;
-webkit-transition: 0.2s;
transition: 0.2s;
}
/* 悬停联动:鼠标在整行上时,数字胶囊也变成主题蓝。
*
* 🔴 这里**只需要一条**规则(3.2.54 要两条,因为那版两种行结构不同)。
* 现在父级/子级、有没有子级,DOM 都是 `<li><a/><span/></li>`,
* 所以「悬停 li、染色直接子级 span」这一条就全覆盖。
*
* 🔴 用 `>` 不用空格:子级 li 也是 .yang-cats-item,
* 用空格会在悬停父级行时连带把子级数字也染色。 */
.w-cats .yang-cats-item:hover > .yang-cats-count {
background-color: #00a2ff;
color: #fff;
}
/* ── 当前分类高亮 ────────────────────────────────────────────────────── */
/* 只染色不加粗:加粗会让这一行宽度变化,列表里突兀地抖一下。
* 同时给个浅浅的底色,让"我在这"在面板里一眼看到(面板一打开就是
* 一堆同样式样的行,光靠蓝色文字不够醒目)。 */
.w-cats .yang-cats-item.current-cat > .yang-cats-link {
color: #00a2ff;
}
.w-cats .yang-cats-item.current-cat {
background-color: #f0f8ff;
}
/* 看子分类时,父级也给个提示(不与真正的高亮抢戏:只染字,不铺底) */
.w-cats .yang-cats-item.current-cat-parent > .yang-cats-link {
color: #00a2ff;
}
/* ── 窄屏 ──────────────────────────────────────────────────────────────
* 992px 以下侧栏整行显示、宽度充裕,面板可以高一点少滚动。
* 🔴 只调 max-height,不改宽度/定位 —— 那些由 flex 与 left/right:0 自适应,
* 写死像素就会在别的容器里错位(3.2.51 的老毛病)。 */
@media (max-width: 991.98px) {
.w-cats .yang-cats-panel {
max-height: 60vh;
}
}
2022-01-07 11:15:42 +08:00
.k-main .sidebar .w-recommended .bookmark-item {
display: block;
overflow: hidden;
padding: 8px 0;
border-bottom: 1px dashed #b4afaf;
color: #333;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
}
.k-main .sidebar .w-recommended .bookmark-item:last-child {
border-bottom: none;
}
.k-main .sidebar .w-recommended .bookmark-item .i-book {
margin-right: 7px;
}
.k-main .sidebar .w-recommended .nav-link .kicon {
margin-right: 8px;
}
/* 标签页图标:xl(≥1200px)显示,更窄时隐藏。
*
* 🔴 3.2.50 之前这件事是靠**渲染两份 DOM** 做的:PHP 里输出
* 一个 `d-none d-xl-flex` 的带图标版本和一个 `d-xl-none` 的无图标版本,
* 于是 nav-tab / nav-new-tab / nav-hot-tab / nav-random-tab
* 四个 id 在同一个页面里各出现两次(HTML 非法,aria-labelledby 失效)。
* 现在 DOM 只有一份,显隐交给下面的媒体查询。 */
.k-main .sidebar .w-recommended .nav-link .tab-icon {
display: none;
}
@media (min-width: 1200px) {
.k-main .sidebar .w-recommended .nav-link .tab-icon {
display: inline-block;
}
}
/* 无图标时补一点内边距,避免三个标签挤在一起 */
@media (max-width: 1199.98px) {
.k-main .sidebar .w-recommended .nav-tabs .nav-link {
padding-left: 18px;
padding-right: 18px;
}
}
2022-01-07 11:15:42 +08:00
.k-main .sidebar .title {
position: relative;
margin: 0 0 15px;
padding-bottom: 7px;
border-bottom: 1px solid #e7e7e7;
font-size: 17px;
cursor: default;
}
.k-main .sidebar .title::after {
position: absolute;
bottom: 0;
left: 0;
width: 72px;
height: 2px;
background-color: #00a2ff;
content: "";
}
/* ── 标签聚合 / 友情链接:宽度改为「按容器自适应」
*
* 🔴 3.2.50 之前的写法是两段魔法数字:
*
* .w-tags .item a { width: 164px } ← 默认
* @media (max-width:1310px) { ... { width: 110px } } ← 窄屏
*
* 侧栏宽度由 Bootstrap 的 col-lg-4 决定,在 992px 以下是「整行」,
* 在 992px 以上是容器的 1/3。而 1310px 这个断点**只改标签宽度、
* 不改侧栏宽度**,于是在 1311→1310px 处出现:
*
* 1311px:侧栏内容区 336.7px,标签 164px → 一行 2 个
* 1310px:侧栏内容区 336.7px,标签 110px → 一行 3 个
*
* **窗口变窄,列数反而多了一个**。这是典型的"两次魔法数字叠加":
* 第二段是为了修第一段在某个视口下的溢出,修的时候没管单调性。
*
* 现在不再写死像素,改为按容器百分比:
*
* width: calc(50% - 2px) 默认每行 2 个
* margin: 0 1px 10px 0 左右各 1px,共 2px 被 50%-2px 抵掉
*
* 50%-2px 这个写法保证「一行恰好放 2 个且不多不少」:
* 两个 50%-2px 加两个 1px 右边距 = 100%,再算上 inline-block 之间的
* 空白字符会被 font-size:0 吃掉(见 .item 的声明),所以不会意外换行。
*
* 要改列数只需改这一个百分比,窄屏不会再"越窄越多列"。
*/
.k-main .sidebar .w-tags .item,
.k-main .sidebar .widget_links ul {
/* 🔴 inline-block 元素之间的换行/空格会渲染成一个空格宽度,
两个 50% 就永远放不进一行。font-size:0 让空白字符零宽,
子元素再把字号设回来。这是 inline-block 网格的标准做法。 */
font-size: 0;
}
.k-main .sidebar .w-tags .item a,
.k-main .sidebar .widget_links ul li {
2022-01-07 11:15:42 +08:00
display: inline-block;
margin: 0 1px 10px 0;
padding: 2px 0;
/* 每行 2 个:两个 (50% - 2px) + 两个 1px 右边距 = 100% */
width: calc(50% - 2px);
2022-01-07 11:15:42 +08:00
border: 1px solid #eeeeee;
color: #333;
list-style: none;
text-align: center;
font-size: 14px;
/* 长标签名(如 HarmonyOS)不能撑破格子 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: top;
2022-01-07 11:15:42 +08:00
}
.k-main .sidebar .widget_links ul li {
border: none;
2022-01-07 11:15:42 +08:00
font-size: 15px;
line-height: inherit;
}
.k-main .sidebar .widget_links ul li img {
margin-top: -3px;
width: 25px;
height: 25px;
border-radius: 50%;
}
.k-main .sidebar .w-tags .item a:hover,
.k-main .sidebar .widget_links ul li:hover,
.k-main .sidebar .widget_archive ul li:hover {
background-color: #eeeeee;
}
.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
border-bottom: 2px solid #00a2ff;
background-color: #fff;
color: #333;
}
.nav-tabs .nav-item {
color: #333;
}
.nav-tabs .nav-link {
padding: 8px 28px;
border: 0;
border-bottom: 2px solid #f2f2f2;
}
.nav-tabs {
border-bottom: none;
}
.k-main .sidebar .widget_links ul {
margin-bottom: 0;
padding-left: 0;
}
.k-main .sidebar .widget_links ul li a {
color: #333;
}
.k-main .sidebar #wp-calendar {
width: 100%;
}
.k-main .sidebar caption,
.k-main .sidebar tfoot {
display: none;
}
.k-main .sidebar tbody tr {
font-weight: 400;
font-size: 14px;
font-family: arial;
}
.k-main .sidebar tbody a {
display: block;
border: 1px solid #00a2ff;
background: #edf8ff;
}
.k-main .sidebar tbody tr td,
.k-main .sidebar thead tr th {
text-align: center;
cursor: default;
}
.k-main .sidebar .widget_search .screen-reader-text {
display: none;
}
.btn-search {
background-color: #00a2ff;
border-color: #00a2ff;
}
.btn-search:not(:disabled):not(.disabled):active,
.btn-search:hover,
.btn-search:focus {
background-color: #0095ff;
border-color: #0095ff;
}
.btn-search:not(:disabled):not(.disabled):active:focus {
box-shadow: none;
}
/* ── 归档挂件(核心 widget_archive)的格子布局
*
* 🔴 3.2.54 起这里**只剩归档**,分类那半已经删掉(工单 #24)。
* 原因:原来那套 `.widget_categories ul li` 一条都没生效过 ——
* 线上分类挂件的实例配置是 `dropdown = 1`,核心输出的是
* `<select>` 下拉框(`wp_dropdown_categories`),里面根本没有 `ul`。
* 选择器和渲染形态对不上,规则等于白写。
* 分类改由主题自建的 `w-cats` 接管(样式见本文件后面的分类区块),
* 外侧 classname 也不再是 `widget_categories`,留在这里只会误导人。
*
* 归档挂件仍然用这套(`widget_archive` 的 before_widget 带这个类),
* 所以原样保留,只是把 selector 里分类那一半摘掉。 */
2022-01-07 11:15:42 +08:00
.k-main .sidebar .widget_archive ul {
margin: 0;
padding-left: 0;
}
.k-main .sidebar .widget_archive ul li {
display: inline-block;
overflow: hidden;
margin: 0 1px 4px 0;
padding: 4px 0;
width: 164px;
border: 1px solid #eeeeee;
list-style: none;
text-align: center;
text-overflow: ellipsis;
font-size: 14px;
-webkit-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}
.k-main .sidebar .widget_archive ul li a {
color: #333;
}
.k-main .sidebar .w-search .form-control,
.k-main .sidebar .w-search .btn {
font-size: 15px;
border-radius: 0;
}
.k-main .sidebar .w-search .btn {
padding-left: 25px;
padding-right: 25px;
}
@media screen and (max-width: 1310px) {
.nav-tabs .nav-link {
padding: 8px 22px;
}
/* 🔴 这里本来还有两条把宽定死的规则:
*
* .k-main .sidebar .w-tags .item a,
* .k-main .sidebar .widget_links ul li,
* .k-main .sidebar .widget_categories ul li,
* .k-main .sidebar .widget_archive ul li { width: 110px }
*
* 1310px 这个断点**不改变侧栏宽度**(992px 以上一直是容器 1/3),
* 所以它只做了一件事:把格子压窄 ⇒ 同样宽度下一行多塞一个 ⇒
* 窗口越窄列数越多。3.2.50 起标签与友情链接改成 `calc(50% - 2px)`,
* 由容器宽度自己决定列数;这里只剩 tab 的内边距需要收一收。
*
* 归档那条宽度**保留** —— 它的父元素是 li 列表,不是按行排的网格,
* 压窄只影响观感不影响列数,且原有排版依赖它。见下方规则。
* 分类那条已在 3.2.54 删除(工单 #24):分类改由 .w-cats 接管,
* 不再走 .widget_categories ul li 那套。 */
2022-01-07 11:15:42 +08:00
.k-main .sidebar .widget_archive ul li {
width: 110px;
}
}
@media (min-width: 992px) {
.navbar-expand-lg .navbar-nav .nav-link {
padding-right: 0;
padding-left: 32px;
}
}
/*--------------------------------------------------------------
10. 404
--------------------------------------------------------------*/
.k-main .page404 {
padding: 40px;
text-align: center;
}
.k-main .page404 .overlay {
position: absolute;
top: -1px;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
width: 100%;
height: 101%;
background: url(../img/404.svg) no-repeat center center;
background-size: cover;
}
.k-main .page404 .overlay:after,
.k-main .page404 .overlay:before {
position: absolute;
top: 0;
z-index: 10;
width: 20px;
height: 100%;
background: #ffffff;
content: "";
}
.k-main .page404 .overlay:before {
left: 0;
}
.k-main .page404 .overlay:after {
right: 0;
}
.k-main .page404 .thumbnail {
position: relative;
width: 100%;
height: 500px;
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
}
.k-main .page404 .content {
font-weight: 500;
}
.k-main .page404 .content .title {
font-size: 30px;
}
.k-main .page404 .content .subtitle {
font-size: 16px;
}
.k-main .page404 .content .action {
font-size: 16px;
}
.k-main .page404 .content .action .btn-outline-primary {
width: 110px;
border-radius: 2px;
letter-spacing: 2.4px;
}
.k-main .page404 .content .action .back-prevpage {
border-color: #00a2ff;
background-color: #00a2ff;
color: #fff;
}
.k-main .page404 .content .action .back-prevpage:hover {
border-color: #009ef9;
background-color: #009ef9;
}
.k-main .page404 .content .action .back-index {
border-color: #d8dcdf;
background-color: transparent;
background-image: none;
color: #666;
}
.k-main .page404 .content .action .back-index:hover,
.k-main
.page404
.content
.action
.back-index:not(:disabled):not(.disabled):active {
border-color: #d8dcdf;
background-color: #f6f4f4;
color: #666;
}
@media screen and (max-width: 768px) {
.k-main .page404 .thumbnail {
height: 315px;
}
.k-main .page404 .content .title {
font-size: 21px;
}
.k-main .page404 .content .subtitle {
font-size: 14px;
}
}
@media screen and (max-width: 480px) {
.k-main .page404 .thumbnail {
height: 200px;
}
}
/*--------------------------------------------------------------
11. 页脚
--------------------------------------------------------------*/
.k-footer {
padding: 40px 0;
background: #23282d;
}
.k-footer p {
margin-bottom: 0;
color: #8e8e8e;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 14px;
cursor: default;
}
.k-footer p a {
color: #8e8e8e;
}
.k-footer p a:hover {
color: #0097ee;
}
.k-footer p .police-ico {
display: inline-block;
margin-top: -4px;
margin-right: 6px;
width: 14px;
height: 1pc;
background: url(../img/police-ico.png) 0 0 no-repeat;
vertical-align: middle;
}
.k-footer .f-toolbox > div {
position: fixed;
right: 20px;
z-index: 999;
text-align: center;
}
.k-footer .f-toolbox .gotop .gotop-btn span,
.k-footer .f-toolbox .search span {
2022-01-07 11:15:42 +08:00
display: table-cell;
width: 40px;
height: 40px;
color: #fff;
vertical-align: middle;
font-size: 18px;
}
.k-footer .f-toolbox .gotop {
bottom: 80px;
visibility: hidden;
cursor: pointer;
}
.k-footer .f-toolbox .gotop .gotop-btn {
display: table;
width: 40px;
height: 40px;
color: #fff;
text-align: center;
}
.k-footer .f-toolbox .gotop.active {
visibility: visible;
background: rgba(132, 132, 132, 0.7);
}
.k-footer .f-toolbox .search {
bottom: 30px;
display: table;
background: rgba(132, 132, 132, 0.7);
cursor: pointer;
}
.k-footer .f-toolbox .search input {
width: 100%;
height: 40px;
border: 0;
background: 0 0;
color: #fff;
font-size: 17px;
}
.k-footer .social {
line-height: 45px;
}
.k-footer .social a {
display: inline-block;
padding: 0 7px;
}
.k-footer .social a .kicon {
font-size: 40px;
}
@media screen and (max-width: 768px) {
.k-footer {
padding: 30px 0;
}
.k-footer p {
font-size: 10px;
}
.k-footer .social a .kicon {
font-size: 38px;
}
}