跳转到内容
打开/关闭菜单
  • 5 条目
  • 2 文件
  • 8 用户
  • 777 编辑
ANACHRONISM
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模板:收缩大标题/styles.css

来自ANACHRONISM
Ancimen​(留言 | 贡献)2026年10月6日 (二) 13:40的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
/* ============================================
   收缩大标题
   标题栏固定,面板向下展开
   ============================================ */

.fold {
    display: block;
    position: relative;
    margin: 1em 0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
}

/* ---- 标题栏(可点击) ---- */
.fold__bar {
    display: block;
    position: relative;
    padding: 1.2em 3.5em 1.2em 1.5em;
    color: #fff;
    cursor: pointer;
    transition: filter 0.3s ease;
}
.fold__bar:hover {
    filter: brightness(1.15);
}

/* ---- 背景水印 ---- */
.fold__watermark {
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5em;
    font-weight: 900;
    line-height: 1;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* ---- 标题组 ---- */
.fold__titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}
.fold__title-cn {
    display: block;
    font-size: 2.5em;
    font-weight: 900;
    letter-spacing: 0.02em;
}
.fold__title-en {
    display: block;
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 0.35em;
}
.fold__title-deco {
    display: block;
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 0.25em;
}

/* ---- 展开符号 ---- */
.fold__icon {
    display: block;
    position: absolute;
    right: 1.2em;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5em;
    height: 1.5em;
    line-height: 1.5em;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    z-index: 2;
    transition: transform 0.3s ease;
}
.fold.is-open .fold__icon {
    transform: translateY(-50%) rotate(45deg);
}

/* ---- 内容面板:向下展开 ---- */
.fold__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}
.fold.is-open .fold__panel {
    grid-template-rows: 1fr;
}
.fold__panel-inner {
    display: block;
    overflow: hidden;
    padding: 0 1.5em;
    color: #333;
    line-height: 1.6;
    transition: padding 0.4s ease;
}
.fold.is-open .fold__panel-inner {
    padding: 1.2em 1.5em;
}