/* 桌面内置小组件：时间 4×2 / 音乐 2×2 */

/* ===== 时间：无卡片、只留文字、垂直居中；颜色随壁纸深浅变化 ===== */
.uwu-home-clock {
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    font-family: inherit;
    color: var(--uwu-ink, #fff);
    transition: color .25s;
}
.uwu-home-clock .uhc-time {
    font-size: 72px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
}
.uwu-home-clock .uhc-colon {
    opacity: .62;
    margin: 0 6px;
    animation: uhcBlink 2s steps(1, end) infinite;
}
@keyframes uhcBlink { 50% { opacity: .14; } }
.uwu-home-clock .uhc-sub {
    margin-top: 12px;
    font-size: 12.5px;
    letter-spacing: .4px;
    color: rgba(255, 255, 255, .72);
}
.uwu-home-clock .uhc-sub b { font-weight: 600; color: rgba(255, 255, 255, .93); }

/* 浅色壁纸：自动换成深字 */
.uwu-home-clock.ink-dark { color: #20222b; }
.uwu-home-clock.ink-dark .uhc-time { text-shadow: 0 2px 14px rgba(255, 255, 255, .55); }
.uwu-home-clock.ink-dark .uhc-sub { color: rgba(32, 34, 43, .72); }
.uwu-home-clock.ink-dark .uhc-sub b { color: rgba(32, 34, 43, .92); }

/* ===== 音乐 2×2：无边框、无阴影 ===== */
.uwu-home-music {
    position: relative;
    width: auto;
    height: 100%;
    aspect-ratio: 1 / 1;     /* 强制正方形：格子是 172.5×155 的矩形，卡片只取 155×155 */
    max-width: 100%;
    margin: 0 auto;          /* 多出来的宽度左右均分 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 10px 8px;
    border-radius: 22px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border: 0;
    box-shadow: none;
    overflow: hidden;
    box-sizing: border-box;
}

/* 封面 / 没封面就是转动的唱片 */
.uwu-home-music [data-role="cover"] {
    position: relative;
    width: min(61px, 38%);   /* 窄屏时按比例缩，避免把控制键挤出去 */
    aspect-ratio: 1 / 1;
    height: auto;
    margin-top: 2px;
    flex: 0 0 auto;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c5cff, #ff5f9e 60%, #ffb35c);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform .15s;
}
.uwu-home-music [data-role="cover"]:active { transform: scale(.94); }
.uwu-home-music [data-role="cover"]::after {
    /* 没有封面时画一张黑胶 */
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 50%, #2a2a30 0 17%, transparent 17.7%),
        radial-gradient(circle at 50% 50%, #ff7ab8 0 8%, transparent 8.7%),
        repeating-radial-gradient(circle at 50% 50%, #1c1c22 0 1.6px, #26262e 1.6px 3.2px);
}
.uwu-home-music [data-role="cover"]:not(.has-cover) { background: transparent; }
.uwu-home-music [data-role="cover"]:not(.has-cover)::after { opacity: 1; animation: uhmSpin 3.6s linear infinite; }
.uwu-home-music.is-paused [data-role="cover"] { filter: grayscale(1) brightness(.72); }
.uwu-home-music.is-paused [data-role="cover"]:not(.has-cover)::after { animation-play-state: paused; }
@keyframes uhmSpin { to { transform: rotate(360deg); } }

/* 未播放：盖一层更明显的淡灰（不写字） */
.uwu-home-music.is-paused::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(150, 150, 160, .40);
    z-index: 3;
    pointer-events: none;
}

/* 歌名 - 歌手：13px、下移一点、超长时单向无缝滚动 */
.uwu-home-music .uhm-line {
    position: relative;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 17px;
    text-align: center;
    z-index: 2;
}
.uwu-home-music .uhm-mq-inner {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    transition: transform .28s ease;
}
/* 只有真的在滚时才需要尾巴间距，静止时不要，否则看着偏左 */
.uwu-home-music .uhm-line.run .uhm-mq-inner > span { padding-right: 36px; }
.uwu-home-music .uhm-line.run .uhm-mq-inner {
    animation: uhmLoop var(--dur, 8s) linear infinite;
}
@keyframes uhmLoop {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
/* 暂停时滑回开头并停住，这样永远能看到歌名开头，而不是停在半截 */
.uwu-home-music.is-paused .uhm-mq-inner { animation: none; transform: translateX(0); }

/* 三个控制键：只有中间有底色 */
.uwu-home-music .uhm-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: auto;
    width: 100%;
    z-index: 4;
}
.uwu-home-music .uhm-ctrl button {
    border: 0; padding: 0; background: transparent;
    color: rgba(255, 255, 255, .92);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.uwu-home-music .uhm-nav { width: 22px; height: 22px; }
.uwu-home-music .uhm-nav svg { width: 16px; height: 16px; display: block; }
.uwu-home-music .uhm-nav:active svg { opacity: .6; }
/* 播放/暂停：不要底，只把图案放大（比 `.uhm-ctrl button` 更具体才压得住） */
.uwu-home-music .uhm-ctrl .uhm-play {
    width: 34px; height: 34px; border-radius: 0;
    background: transparent; color: inherit;
    transition: transform .1s;
}
.uwu-home-music .uhm-ctrl .uhm-play svg { width: 22px; height: 22px; display: block; }
.uwu-home-music .uhm-ctrl .uhm-play:active { transform: scale(.9); }

/* 编辑模式下别让按钮被拖动逻辑吃掉 */
.home-grid-layout.edit-mode .uwu-home-music .uhm-ctrl button { pointer-events: none; }
