html, body {
    font-size: 18px;
    color: #6c767d;
    background-color: #ebf1f5;
    background-image: url("https://bu.dusays.com/2022/06/04/629b0a2a89425.png");
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100%;
}


/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/

::-webkit-scrollbar {
    width: 5px;
    /* height: 5px; */
    background-color: #F5F5F5;
}


/*定义滚动条轨道 内阴影+圆角*/

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    background-color: #F5F5F5;
}


/*定义滑块 内阴影+圆角*/

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
    background-color: #555;
}
h1 {
    font-size: 36px;
    margin-bottom: .5em;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
    margin-top: 1em;
}

h4 {
    font-size: 16px;
}

h1,
h2,
h3,
h4 {
    color: black;
}

.card {
    border: none;
    padding: 24px 24px 20px;
    border-radius: 22px;
    background-color: rgba(255, 255, 255, 0.7);
}

/* 卡片内行间空白：各一行 */
#hitokoto_text {
    margin-bottom: 1.4em;
    /* 固定一行高度，加载替换文字时不引起卡片抽搐 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .container-fluid {
    margin-top: 1.4em;
}

.card footer {
    margin-top: 1.4em;
}

/* 统计行预留一行高度，不蒜子加载后不跳高 */
.card footer p > span:first-child {
    min-height: 1.4em;
}

.container {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.my-card {
    /* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
}

strike {
    color: red;
}

.btn {
    border-radius: 0;
    margin: 5px 0;
    width: 100%;
    padding: 12px 40px;
    transition: ease;
}

.btn-primary {
    /* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
    padding: 12px 40px;
    transition: ease;
}

.btn-primary:hover {
    box-shadow: 5px -2px 15px 0px rgb(203, 221, 232);
}

.btn-secondary {
    /* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
    padding: 12px 40px;
    transition: ease;
}

.btn-secondary:hover {
    box-shadow: 5px -2px 15px 0px rgb(203, 221, 232);
}

.btn-success {
    /* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
    padding: 12px 40px;
    transition: ease;
}

.btn-success:hover {
    box-shadow: 5px -2px 15px 0px rgb(203, 221, 232);
}

/* 导航按钮：浅色柔和风格 */
.btn-primary {
    background-color: #bfe0f5;
    border-color: #bfe0f5;
    color: #2c5f8a;
}

.btn-primary:hover {
    background-color: #a8d4f0;
    border-color: #a8d4f0;
    color: #2c5f8a;
}

.btn-secondary {
    background-color: #e2e4ea;
    border-color: #e2e4ea;
    color: #4a4f5c;
}

.btn-secondary:hover {
    background-color: #d3d6de;
    border-color: #d3d6de;
    color: #4a4f5c;
}

.btn-success {
    background-color: #cdeeda;
    border-color: #cdeeda;
    color: #2f6b3a;
}

.btn-success:hover {
    background-color: #b8e5c8;
    border-color: #b8e5c8;
    color: #2f6b3a;
}

footer p {
    font-size: 12px;
}

@media (max-width: 1199px) {
    body {
        min-height: 600px;
    }
    h1 {
        font-size: 24px;
    }
    h2 {
        font-size: 20px;
    }
    h3 {
        font-size: 16px;
    }
    h4,
    p {
        font-size: 14px;
    }
    .card {
        padding: 50px 50px 0px;
    }
}

@media(max-width: 767px) {
    /* 手机端：主卡片在屏幕垂直居中 */
    body {
        height: auto;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px 0;
    }
    .container {
        position: static;
        top: auto;
        transform: none;
    }
    .card {
        padding: 20px;
        min-height: auto;
    }
    /* 手机端竖排的三个按钮：四周圆角弧形 */
    .btn {
        border-radius: 12px;
    }
}

#bg-fail-tip {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 6px;
}

/* 左上角歌词面板（风格同左下角播放器：浅蓝半透明毛玻璃，从上方滑入） */
#lyrics-box {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9998;
    width: 290px;
    max-width: calc(100% - 24px);
    background: rgba(191, 224, 245, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(44, 95, 138, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 10px 14px;
    color: #2c5f8a;
    /* 初始藏在屏幕上方，有歌词时滑下来 */
    transform: translateY(calc(-100% - 30px));
    transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.36, 1);
}

#lyrics-box.show {
    transform: translateY(0);
}

/* 点击 ← 后隐藏到左边 */
#lyrics-box.show.hide-left {
    transform: translateY(0) translateX(calc(-100% - 30px));
}

/* 歌词面板的收起按钮（左上角 ←） */
#lyrics-collapse {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(44, 95, 138, 0.15);
    color: #2c5f8a;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

#lyrics-collapse:hover {
    background: rgba(44, 95, 138, 0.3);
}

/* 歌词收起后左边缘伸出的半圆长筒按钮（放在上面，从左往右滑出） */
#lyrics-reopen {
    position: fixed;
    left: 0;
    top: 56px;
    z-index: 9997;
    width: 54px;
    height: 38px;
    border: 1px solid rgba(44, 95, 138, 0.3);
    border-left: none;
    border-radius: 0 19px 19px 0;
    background: rgba(191, 224, 245, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #2c5f8a;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    opacity: 0;
    transform: translateX(-24px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#lyrics-reopen.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

#lyrics-song {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lyrics-list {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.lyrics-roll {
    position: absolute;
    inset: 0;
}

.lyrics-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* 固定梯度：中间最深，向两边渐浅 */
#lyrics-p2 {
    transform: translateY(-48px);
    opacity: 0.3;
}

#lyrics-n2 {
    transform: translateY(48px);
    opacity: 0.3;
}

#lyrics-p1 {
    transform: translateY(-24px);
    opacity: 0.6;
}

#lyrics-n1 {
    transform: translateY(24px);
    opacity: 0.6;
}

#lyrics-cur {
    transform: translateY(0);
    opacity: 1;
    font-weight: 700;
    font-size: 15px;
}

/* ===== 依次浮现的文本行 ===== */
.fade-line {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 左下角音乐播放器 ===== */

/* 右下角小鲸鱼挂件 */
#whale {
    position: fixed;
    right: 12px;
    bottom: 4px;
    z-index: 999;
    width: 140px;
    height: 140px;
    /* 入场：初始在屏幕下方，加载完成后升上来 */
    transform: translateY(170px);
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.36, 1), opacity 0.9s ease;
}

#whale.in {
    transform: translateY(0);
    opacity: 1;
}

/* 拖拽松手吸附时缓慢回弹 */
#whale.snapping {
    transition: left 1.4s cubic-bezier(0.25, 0.6, 0.35, 1), top 1.4s cubic-bezier(0.25, 0.6, 0.35, 1);
}

#whale-content {
    position: absolute;
    inset: 0;
    transform: scale(var(--wh-scale, 1));
    transform-origin: right bottom;
    transition: transform 0.12s ease;
    animation: whale-float 4.5s ease-in-out infinite;
}

@keyframes whale-float {
    0%,
    100% {
        transform: scale(var(--wh-scale, 1)) translateY(0);
    }
    50% {
        transform: scale(var(--wh-scale, 1)) translateY(-7px);
    }
}

#whale-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    /* 鲸鱼贴边导致的直角，右下角改成弧形 */
    border-radius: 0 0 14px 0;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.12s ease;
}

#whale.pressing #whale-img {
    transform: scale(0.88);
}

#whale.bounce #whale-img {
    animation: whale-bounce 0.3s ease;
}

@keyframes whale-bounce {
    0% {
        transform: scale(0.88);
    }
    50% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
    }
}

/* 台词气泡（原项目风格：描边云朵 + 分段弹出动画） */
#whale-bubble {
    position: absolute;
    bottom: 84%;
    right: 12px;
    width: 260px;
    aspect-ratio: 1026 / 700;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#whale-bubble.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#whale-bubble svg {
    display: block;
    width: 100%;
    height: 100%;
}

#whale-bubble .wb-shape,
#whale-bubble .wb-b1,
#whale-bubble .wb-b2 {
    opacity: 0;
    transform: scale(0.7);
    transform-box: fill-box;
    transform-origin: 50% 50%;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#whale-bubble.show .wb-shape,
#whale-bubble.show .wb-b1,
#whale-bubble.show .wb-b2 {
    opacity: 1;
    transform: none;
}

#whale-bubble.show .wb-b2 {
    transition-delay: 0s;
}

#whale-bubble.show .wb-b1 {
    transition-delay: 0.13s;
}

#whale-bubble.show .wb-shape {
    transition-delay: 0.26s;
}

#whale-bubble .wb-shape {
    transition-delay: 0.1s;
}

#whale-bubble .wb-b1 {
    transition-delay: 0.2s;
}

#whale-bubble .wb-b2 {
    transition-delay: 0.3s;
}

#whale-bubble .wb-text {
    position: absolute;
    left: 10%;
    right: 20%;
    top: 5%;
    bottom: 31%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #203170;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.16s ease 0.36s;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    pointer-events: none;
}

#whale-bubble.show .wb-text {
    opacity: 1;
}

/* 左吸附时整体水平镜像 */
#whale.left #whale-bubble {
    transform: translateY(10px) scaleX(-1);
}

#whale.left #whale-bubble.show {
    transform: translateY(0) scaleX(-1);
}

/* 菜单按钮（尺寸固定 1.0，位置跟随鲸鱼视觉右上角，随缩放联动） */
#whale-menu {
    position: absolute;
    top: calc(140px - 138px * var(--wh-scale, 1) - 13px);
    right: -8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(32, 49, 112, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 12;
}

#whale-menu svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: #fff;
}

#whale:hover #whale-menu {
    opacity: 1;
}

/* 设置面板（对齐鲸鱼右上角，往右往下贴） */
#whale-panel {
    position: absolute;
    bottom: 100%;
    right: -6px;
    width: 190px;
    background: rgba(255, 255, 255, 0.96);
    border: 2px solid #203170;
    border-radius: 12px;
    padding: 10px 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 11;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#whale-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.whale-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    font-size: 12px;
    color: #203170;
}

.whale-row > span:first-child {
    width: 30px;
    flex-shrink: 0;
}

.whale-row input[type="range"] {
    flex: 1;
    min-width: 0;
}

.whale-row select {
    flex: 1;
    min-width: 0;
}

.whale-row > span:last-child {
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

#whale-panel label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* 鲸鱼菜单里的隐藏按钮 */
#whale-hide {
    flex: 1;
    border: none;
    border-radius: 6px;
    background: rgba(32, 49, 112, 0.12);
    color: #203170;
    font-size: 12px;
    padding: 6px 0;
    cursor: pointer;
    transition: background 0.2s;
}

#whale-hide:hover {
    background: rgba(32, 49, 112, 0.25);
}

/* 隐藏小鲸鱼后的唤出按钮（右下角，简笔鲸鱼图标，从下方弹出） */
#whale-reopen {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 997;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #fd79a8, #6c5ce7);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(60px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#whale-reopen.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#whale-reopen svg {
    width: 21px;
    height: 21px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 右上角设置（齿轮按钮 + 面板，风格同小鲸鱼面板） */
#settings {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    transform: translateY(-80px);
    transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.36, 1);
}

#settings.in {
    transform: translateY(0);
}

#settings-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #203170;
    background: rgba(255, 255, 255, 0.96);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

#settings-btn:hover {
    transform: rotate(60deg);
}

#settings-btn svg {
    width: 22px;
    height: 22px;
    fill: #203170;
}

#settings-panel {
    position: absolute;
    top: 54px;
    right: 0;
    width: 250px;
    background: rgba(255, 255, 255, 0.96);
    border: 2px solid #203170;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: #203170;
    opacity: 0;
    transform: scale(0.3);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

#settings-panel.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.settings-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.settings-action {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 6px 0;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(32, 49, 112, 0.1);
    color: #203170;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.settings-action:hover {
    background: rgba(32, 49, 112, 0.22);
}

.settings-action svg {
    width: 16px;
    height: 16px;
    stroke: #203170;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-right: 8px;
    flex-shrink: 0;
}

/* ===== 音乐播放器（自绘：列表 + 详情，左下角浮动，浅蓝半透明） ===== */
.player {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 999;
    width: 320px;
    max-width: calc(100% - 24px);
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    background: rgba(191, 224, 245, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #2c5f8a;
    /* 禁止文本选择：进度条区域只显示指针，不出现文本光标 */
    user-select: none;
    -webkit-user-select: none;
    /* 初始藏在屏幕下方，加载完成后滑上来 */
    transform: translateY(calc(100% + 24px));
    transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.36, 1);
}

.player.in {
    transform: translateY(0);
}

.player.hidden {
    transform: translateY(calc(100% + 24px));
}

/* 播放器收起后的展开按钮（从下方弹出） */
#player-reopen {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 998;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #fd79a8, #6c5ce7);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(60px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#player-reopen.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player > * {
    position: relative;
    z-index: 1;
}

.player__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.4);
}

.player__cover {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(44, 95, 138, 0.4);
}

.player.playing .player__cover {
    animation: cover-spin 12s linear infinite;
}

@keyframes cover-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.player__meta {
    flex: 1;
    min-width: 120px;
}

.player__song-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.player__title {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player__btns {
    display: flex;
    gap: 8px;
}

.player__btns button {
    border: none;
    background: rgba(44, 95, 138, 0.15);
    color: #2c5f8a;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: background 0.2s, transform 0.1s;
}

.player__btns button:hover {
    background: rgba(44, 95, 138, 0.28);
}

.player__btns button:active {
    transform: scale(0.92);
}

.player__btns button svg {
    display: block;
    margin: 0 auto;
    width: 15px;
    height: 15px;
    fill: #2c5f8a;
}

.player__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.player__time {
    font-size: 12px;
    opacity: 0.9;
}

.player__track {
    flex: 1;
    height: 16px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.player__track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 5px;
    border-radius: 3px;
    background: rgba(44, 95, 138, 0.25);
}

.player__fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 5px;
    width: 0;
    border-radius: 3px;
    background: #2c5f8a;
}

.player__playlist {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 170px;
    overflow-y: auto;
}

.player__song {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.player__song:hover {
    background: rgba(44, 95, 138, 0.08);
}

.player__song.active {
    background: rgba(44, 95, 138, 0.16);
}

.player__img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.player__context {
    flex: 1;
    margin: 0;
    min-width: 0;
}

.player__context .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.player__song .player__song-name {
    font-size: 12px;
    opacity: 0.85;
    font-weight: normal;
}

.player__song .player__title {
    font-size: 13px;
    opacity: 1;
    margin-top: 0;
}

.player__song-time {
    font-size: 12px;
    opacity: 0.8;
}

.player__playlist::-webkit-scrollbar {
    width: 4px;
}

.player__playlist::-webkit-scrollbar-thumb {
    background: rgba(44, 95, 138, 0.35);
    border-radius: 2px;
}
