/* 液态玻璃效果 - Liquid Glass Effect */

.liquid-glass {
    --w: auto;
    --h: auto;
    --r: 9999px;
    --tr: 15%;
    position: relative;
    border-radius: var(--r);
    border: 1px double rgba(51, 51, 51, 0.08);
    box-shadow:
        inset 2px -2px 1px -1px rgba(255, 255, 255, 0.9),
        inset -2px 2px 1px -1px rgba(255, 255, 255, 0.9),
        inset 6px -6px 1px -6px rgba(255, 255, 255, 0.55),
        inset -6px 6px 1px -6px rgba(255, 255, 255, 0.55),
        inset 0 0 2px rgba(0, 0, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px) saturate(220%);
    filter: brightness(0.95);
    transition: all 0.25s ease;
    overflow: hidden;
}

/* 按钮专用样式 */
button.liquid-glass,
a.liquid-glass {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.liquid-glass::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border-radius: var(--r);
    border: 1px solid rgba(0, 0, 0, 0.9);
    filter: blur(8px);
}

.liquid-glass::after {
    z-index: 2;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--r);
    filter: blur(3px);
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.8) 0%,
        transparent var(--tr),
        transparent calc(100% - var(--tr)),
        rgba(255, 255, 255, 0.8) 100%
    );
    pointer-events: none;
}

.liquid-glass .circle-overlay {
    position: absolute;
    width: calc(100% - 9px);
    height: calc(100% - 9px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--r);
    filter: blur(1px);
    pointer-events: none;
}

/* 悬停效果 */
.liquid-glass:hover {
    filter: brightness(1);
    transform: translateY(-2px);
    box-shadow:
        inset 2px -2px 1px -1px rgba(255, 255, 255, 0.95),
        inset -2px 2px 1px -1px rgba(255, 255, 255, 0.95),
        inset 6px -6px 1px -6px rgba(255, 255, 255, 0.6),
        inset -6px 6px 1px -6px rgba(255, 255, 255, 0.6),
        inset 0 0 2px rgba(0, 0, 0, 0.6),
        0 8px 16px rgba(0, 0, 0, 0.3);
}

.liquid-glass:active {
    transform: translateY(0);
    filter: brightness(0.85);
}

/* 适配不同尺寸的按钮 */
.liquid-glass.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.liquid-glass.btn-md {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.liquid-glass.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* 土黄色主题变体 */
.liquid-glass.theme-gold {
    background: rgba(212, 175, 55, 0.85);
    border-color: rgba(212, 175, 55, 0.3);
}

.liquid-glass.theme-gold:hover {
    background: rgba(212, 175, 55, 0.95);
}

/* 蓝色主题变体 */
.liquid-glass.theme-blue {
    background: rgba(59, 130, 246, 0.85);
    border-color: rgba(59, 130, 246, 0.3);
}

.liquid-glass.theme-blue:hover {
    background: rgba(59, 130, 246, 0.95);
}

/* 红色主题变体 */
.liquid-glass.theme-red {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.3);
}

.liquid-glass.theme-red:hover {
    background: rgba(239, 68, 68, 0.95);
}

/* 绿色主题变体 */
.liquid-glass.theme-green {
    background: rgba(34, 197, 94, 0.85);
    border-color: rgba(34, 197, 94, 0.3);
}

.liquid-glass.theme-green:hover {
    background: rgba(34, 197, 94, 0.95);
}

/* 确保内容在伪元素之上 */
.liquid-glass > * {
    position: relative;
    z-index: 3;
}

/* 兼容深色背景 */
.liquid-glass.dark-bg {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}