/* 流转心语 · 桌宠条（仅心语轮播） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-color: #5c534c;
    --text-light: #8a8078;
    --warm-cream: #faf6f0;
    --muyu-orange: #e86b2a;
    --cloud-track-duration: 100s;
    --mood-calm-accent: #8f9a7e;
    --mood-calm-bg: rgba(143, 154, 126, 0.14);
    --mood-calm-sticker-bg: rgba(143, 154, 126, 0.16);
    --mood-joy-accent: #c49a62;
    --mood-joy-bg: rgba(196, 154, 98, 0.14);
    --mood-joy-sticker-bg: rgba(196, 154, 98, 0.18);
    --mood-relief-accent: #a89585;
    --mood-relief-bg: rgba(168, 149, 133, 0.14);
    --mood-relief-sticker-bg: rgba(168, 149, 133, 0.16);
    --mood-gentle-accent: #c48878;
    --mood-gentle-bg: rgba(196, 136, 120, 0.14);
    --mood-gentle-sticker-bg: rgba(196, 136, 120, 0.17);
    --mood-neutral-accent: #a09084;
    --mood-neutral-bg: rgba(160, 144, 132, 0.12);
    --mood-neutral-sticker-bg: rgba(160, 144, 132, 0.15);
    --pet-titlebar-height: 36px;
}

html,
body.pet-window {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    background: transparent;
}

body.pet-window {
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        180deg,
        rgba(250, 246, 240, 0.96) 0%,
        rgba(245, 238, 230, 0.94) 100%
    );
    border-radius: 14px;
    border: 1px solid rgba(232, 107, 42, 0.12);
    box-shadow: 0 8px 32px rgba(60, 45, 30, 0.18);
}

body.pet-window.pet-click-through {
    opacity: 0.92;
    box-shadow: 0 4px 20px rgba(60, 45, 30, 0.1);
}

body.pet-window.pet-click-through .pet-titlebar-hint::after {
    content: ' · 穿透中';
    color: var(--muyu-orange);
}

/* Electron：标题栏可拖动 */
.pet-titlebar {
    flex-shrink: 0;
    height: var(--pet-titlebar-height);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    -webkit-app-region: drag;
    user-select: none;
    border-bottom: 1px solid rgba(232, 107, 42, 0.08);
    background: rgba(255, 252, 248, 0.55);
}

.pet-titlebar-badge {
    font-size: 15px;
}

.pet-titlebar-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.pet-titlebar-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muyu-orange);
    opacity: 0.75;
    animation: petPulse 2.4s ease-in-out infinite;
}

@keyframes petPulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.pet-titlebar-hint {
    flex: 1;
    min-width: 0;
    font-size: 10px;
    color: var(--text-light);
    opacity: 0.8;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-titlebar-actions {
    flex-shrink: 0;
    margin-left: 8px;
    -webkit-app-region: no-drag;
    position: relative;
}

/* 桌面版右上角「设置」 */
html:not(.pet-desktop-env) .pet-titlebar-actions {
    display: none;
}

.pet-settings-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid rgba(232, 107, 42, 0.35);
    border-radius: 999px;
    background: rgba(232, 107, 42, 0.12);
    color: var(--muyu-orange);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pet-settings-trigger:hover,
.pet-settings-trigger.is-open {
    background: rgba(232, 107, 42, 0.22);
    box-shadow: 0 2px 10px rgba(232, 107, 42, 0.2);
}

.pet-settings-trigger-icon {
    font-size: 13px;
}

.pet-settings-popover {
    position: fixed;
    top: calc(var(--pet-titlebar-height) + 6px);
    right: 10px;
    z-index: 200;
    width: min(272px, calc(100vw - 20px));
    padding: 14px 16px 12px;
    border-radius: 14px;
    background: rgba(255, 252, 248, 0.98);
    border: 1px solid rgba(232, 107, 42, 0.22);
    box-shadow: 0 10px 36px rgba(60, 45, 30, 0.18);
    -webkit-app-region: no-drag;
    animation: petPopoverIn 0.22s ease;
}

.pet-settings-popover[hidden] {
    display: none !important;
}

@keyframes petPopoverIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pet-settings-popover-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.pet-settings-unavailable {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.5;
    margin-top: 8px;
}

.pet-setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-color);
    margin-bottom: 6px;
}

.pet-setting-row:last-child {
    margin-bottom: 0;
}

.pet-setting-opacity .pet-setting-label {
    flex: 0 0 auto;
    min-width: 64px;
}

.pet-setting-opacity input[type='range'] {
    flex: 1;
    min-width: 80px;
    accent-color: var(--muyu-orange);
}

.pet-setting-value {
    flex: 0 0 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--muyu-orange);
    font-weight: 600;
}

.pet-setting-switch {
    justify-content: space-between;
    margin-bottom: 4px;
}

.pet-setting-switch-text {
    font-size: 12px;
    font-weight: 500;
}

.pet-setting-toggle {
    width: 18px;
    height: 18px;
    accent-color: var(--muyu-orange);
    cursor: pointer;
}

.pet-setting-hint {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.45;
    margin: 0 0 10px 0;
    padding-left: 2px;
}

.pet-setting-hint kbd {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid rgba(160, 144, 132, 0.35);
    background: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    font-family: inherit;
}

.pet-clickthrough-banner {
    position: fixed;
    top: calc(var(--pet-titlebar-height) + 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    max-width: 92%;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(232, 107, 42, 0.92);
    color: #fff;
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(60, 45, 30, 0.2);
    pointer-events: none;
    animation: petPopoverIn 0.25s ease;
}

.pet-settings-popover.is-disabled .pet-setting-row,
.pet-settings-popover.is-disabled .pet-setting-hint {
    opacity: 0.45;
    pointer-events: none;
}

.pet-atmosphere {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 0 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
}

.pet-atmosphere::after {
    display: none;
}

.cloud-words-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    -webkit-app-region: no-drag;
    mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
}

.cloud-words-track-inner {
    display: flex;
    gap: 16px;
    animation: scrollTrack var(--cloud-track-duration) linear infinite;
    width: max-content;
    padding: 4px 20px;
    align-items: stretch;
}

.cloud-words-track.paused .cloud-words-track-inner {
    animation-play-state: paused;
}

@keyframes scrollTrack {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.cloud-word-card {
    flex: 0 0 auto;
    width: 220px;
    min-height: 96px;
    border-radius: 16px;
    padding: 12px 16px 10px;
    position: relative;
    overflow: hidden;
    animation: cardBreath 6s ease-in-out infinite;
    border: 1px solid rgba(220, 200, 180, 0.35);
    box-shadow: 0 4px 14px rgba(90, 70, 50, 0.06);
}

@keyframes cardBreath {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

.cloud-card-glow {
    position: absolute;
    top: -40%;
    right: -20%;
    width: 65%;
    height: 75%;
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(28px);
    pointer-events: none;
}

.cloud-card-quote {
    position: absolute;
    top: 2px;
    left: 10px;
    font-size: 32px;
    line-height: 1;
    font-family: Georgia, serif;
    opacity: 0.07;
    pointer-events: none;
}

.cloud-word-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mood-sticker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--mood-neutral-sticker-bg);
}

.mood-sticker-calm {
    background: var(--mood-calm-sticker-bg);
}
.mood-sticker-joy {
    background: var(--mood-joy-sticker-bg);
}
.mood-sticker-relief {
    background: var(--mood-relief-sticker-bg);
}
.mood-sticker-gentle {
    background: var(--mood-gentle-sticker-bg);
}

.cloud-sticker {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.mood-sticker .sticker-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cloud-word-variant-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.85;
}

.cloud-word-text {
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    font-weight: 500;
}

.cloud-word-foot {
    font-size: 10px;
    opacity: 0.75;
}

.cloud-word-tag {
    letter-spacing: 0.08em;
}

.mood-calm .cloud-word-card,
.cloud-word-card.mood-calm {
    background: var(--mood-calm-bg);
}
.mood-joy .cloud-word-card,
.cloud-word-card.mood-joy {
    background: var(--mood-joy-bg);
}
.mood-relief .cloud-word-card,
.cloud-word-card.mood-relief {
    background: var(--mood-relief-bg);
}
.mood-gentle .cloud-word-card,
.cloud-word-card.mood-gentle {
    background: var(--mood-gentle-bg);
}
.mood-neutral .cloud-word-card,
.cloud-word-card.mood-neutral {
    background: var(--mood-neutral-bg);
}

.cloud-card-v1 .cloud-card-glow {
    background: var(--mood-calm-accent);
}
.cloud-card-v2 .cloud-card-glow {
    background: var(--mood-joy-accent);
}
.cloud-card-v3 .cloud-card-glow {
    background: var(--mood-relief-accent);
}
.cloud-card-v4 .cloud-card-glow {
    background: var(--mood-gentle-accent);
}
.cloud-card-v5 .cloud-card-glow {
    background: var(--mood-neutral-accent);
}
.cloud-card-v6 .cloud-card-glow {
    background: var(--muyu-orange);
}

.cloud-card-v1 .cloud-word-variant-dot {
    background: var(--mood-calm-accent);
}
.cloud-card-v2 .cloud-word-variant-dot {
    background: var(--mood-joy-accent);
}
.cloud-card-v3 .cloud-word-variant-dot {
    background: var(--mood-relief-accent);
}
.cloud-card-v4 .cloud-word-variant-dot {
    background: var(--mood-gentle-accent);
}
.cloud-card-v5 .cloud-word-variant-dot {
    background: var(--mood-neutral-accent);
}
.cloud-card-v6 .cloud-word-variant-dot {
    background: var(--muyu-orange);
}
