/* Zero Room (Secret Base) Styles - Liquid Glass Refined */

#zero-room-screen {
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.zero-room-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #2c3e50, #000000);
    z-index: 0;
    transition: background-image 0.5s ease;
}

/* 顶部导航 - 悬浮玻璃条 */
.zero-room-header {
    position: absolute;
    top: 15px; /* 稍微下移，悬浮感 */
    left: 15px;
    right: 15px;
    width: auto;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    
    /* 胶囊玻璃 */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.zero-room-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 顶部按钮 - 纯图标 */
.glass-icon-btn {
    background: transparent;
    border: none;
    padding: 8px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.glass-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.glass-icon-btn:active {
    transform: scale(0.95);
}

/* 立绘区域 */
.zero-sprite-container {
    position: absolute;
    bottom: 110px; /* 提高一点，不被Dock遮挡 */
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 550px; /* 更高的立绘区域 */
    z-index: 5;
    pointer-events: none; /* 让点击穿透到触摸区 */
}

.zero-sprite {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.3));
    transition: opacity 0.3s;
}

/* 触摸区域 - 保持原样 */
.touch-zone {
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    /* 默认透明 */
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.2s, border 0.2s;
}

/* 编辑模式下的区域样式 */
#zero-room-screen.editing .touch-zone {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

#zero-room-screen.editing .touch-zone.selected {
    background: rgba(0, 122, 255, 0.2);
    border: 2px solid #007aff;
    z-index: 20;
}

.touch-zone.head { top: 5%; left: 30%; width: 40%; height: 15%; border-radius: 50%; }
.touch-zone.body { top: 20%; left: 15%; width: 70%; height: 50%; }

/* 底部Dock - 液态玻璃胶囊 */
.zero-interaction-dock {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    height: 72px; /* 稍微紧凑 */
    
    background: rgba(255, 255, 255, 0.12); /* 稍微通透 */
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    z-index: 10;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Dock按钮 */
.dock-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    width: 50px;
}

.dock-btn:hover .btn-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dock-btn:active .btn-icon {
    transform: scale(0.92);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px; /* iOS squircle-ish */
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.btn-icon svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.btn-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
}

/* 气泡 - 磨砂白 */
.zero-bubble {
    position: absolute;
    top: 18%;
    right: 8%;
    max-width: 200px;
    
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    padding: 14px 18px;
    border-radius: 24px;
    border-bottom-left-radius: 4px; /* 气泡尖角方向 */
    box-shadow: 
        0 8px 24px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.4);
    
    z-index: 8;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.zero-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.zero-bubble p {
    margin: 0;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* 弹窗样式 */
.zero-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zero-modal-content {
    background: rgba(245, 245, 245, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zero-modal-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zero-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.zero-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.file-upload-box {
    background: rgba(255, 255, 255, 0.6);
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 16px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.file-upload-box:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: #007aff;
}

.file-upload-box .placeholder {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

#preview-bg {
    max-width: 100%;
    max-height: 100px;
    border-radius: 8px;
    object-fit: cover;
    margin-top: 5px;
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.preview-grid img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #f5f5f5;
}

.clear-btn {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.zero-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.5);
}

.save-btn {
    width: 100%;
    padding: 12px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.save-btn:active {
    transform: scale(0.98);
}

/* 编辑面板样式 */
.zero-edit-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    z-index: 10000; /* 最高层级 */
    padding: 20px;
    box-sizing: border-box;
    animation: slideUp 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.edit-header {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.edit-header b {
    color: #007aff;
    font-size: 16px;
}

.edit-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-row label {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

.control-row input[type=range] {
    width: 100%;
    height: 4px;
    background: #e5e5ea;
    border-radius: 2px;
    appearance: none;
}

.control-row input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 0.5px solid rgba(0,0,0,0.04);
}

.edit-actions {
    margin-top: 10px;
}
