/*
 * 擦屏幕工具 - 独立样式
 * 独立于主站与其他工具页，自包含，无需构建。
 * 页面为全屏纯色背景（默认纯黑），中央提示语随交互渐渐显现、隐藏，
 * 双击提示与工具按钮固定在画面底部并同样渐渐显现、隐藏，
 * 鼠标停止移动后光标一并隐藏，移动即恢复。
 */

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.screen-cleaner-page {
    margin: 0;
    background-color: #000;
    color: #fff;
    font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
    user-select: none;
}

[hidden] {
    display: none !important;
}

/* 鼠标指针闲置隐藏：停止移动后隐藏光标（含按钮等全部元素），移动即恢复 */
body.screen-cleaner-page.cursor-hidden,
body.screen-cleaner-page.cursor-hidden * {
    cursor: none !important;
}

.stage {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* 中央提示语：按 data-show 切换展示对应一条，整体渐渐显现/隐藏 */
.message {
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}

.message.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.2s ease, visibility 0s;
}

.message-text {
    display: none;
    margin: 0;
    font-size: clamp(22px, 4vw, 42px);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
}

.message[data-show="initial"] .message-text[data-key="initial"],
.message[data-show="a"] .message-text[data-key="a"],
.message[data-show="b"] .message-text[data-key="b"] {
    display: block;
}

/* 画面底部提示与工具按钮：固定在画面底部，与中央文字同样的渐渐隐藏样式 */
.below {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}

.below.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.2s ease, visibility 0s;
}

.fullscreen-hint {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 12px;
    border-radius: 999px;
}

.color-tools {
    position: relative;
}

.tool-btn {
    font: inherit;
    font-size: 13px;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 6px 16px;
    cursor: pointer;
}

.tool-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* 调色盘：向上弹出于按钮上方（按钮贴近画面底部），半透明深底保证任意底色上可读 */
.palette {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(28, 28, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.palette-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.swatch {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: var(--swatch);
    cursor: pointer;
}

.swatch:hover {
    transform: scale(1.08);
}

.palette-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

#native-picker {
    flex: none;
    width: 36px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: none;
    cursor: pointer;
}

.palette-input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 5px 8px;
}

.palette-input:focus {
    outline: 1px solid rgba(255, 255, 255, 0.5);
}

.palette-error {
    margin: 0;
    font-size: 12px;
    color: #ff6b6b;
}
