/* =============================================
   小工具网页 — 通用样式系统
   深色沉稳风格，毛玻璃 + 3D 卡片
   ============================================= */

/* 静态沉稳深色背景 */
body {
    margin: 0;
    min-height: 100vh;
    background: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e2e8f0;
    overflow-x: hidden;
}

/* 绝对定位的背景装饰球 */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
}
.blob-1 { width: 400px; height: 400px; background: #312e81; top: -50px; left: -50px; }
.blob-2 { width: 500px; height: 500px; background: #134e4a; bottom: -100px; right: -50px; }
.blob-3 { width: 300px; height: 300px; background: #4c1d95; top: 40%; left: 40%; }

/* 毛玻璃卡片基类 */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

/* 鼠标悬浮动态跟随高光 */
.glass::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.glass:hover::before {
    opacity: 1;
}

.glass-content {
    position: relative;
    z-index: 2;
}

/* 3D 悬浮卡片 */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 通用输入框 */
.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 16px;
    outline: none;
    color: #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.glass-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #64748b;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.3), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* 通用按钮 */
.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.glass-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.glass-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.glass-btn.secondary {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.glass-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

/* 颜色选择器 */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}
input[type="color"]:hover {
    transform: scale(1.1);
}

/* 范围滑块 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 2px solid #475569;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #f8fafc;
}
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* 色盘工具预览字符 */
.preview-char {
    transition: color 0.3s ease, font-size 0.2s ease, margin 0.2s ease;
    font-weight: bold;
    text-shadow: 2px 4px 12px rgba(0,0,0,0.3);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 50;
}
