* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000;
    color: #fff;
}

/* Main container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
    background-color: #000;
}

/* Canvas */
#floyCanvas {
    border: 1px solid #333;
    background-color: #000;
    margin-bottom: 20px;
}

/* Control panel */
.control-panel {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    background-color: #222;
    border-radius: 5px;
}

/* Buttons */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #444;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #666;
}

/* Primary button */
.primary-btn {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.primary-btn:hover {
    background-color: #45a049;
}

.primary-btn:active {
    background-color: #3d8b40;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 属性设置对话框 */
.dialog {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(34, 34, 34, 0.5); /* 降低不透明度 */
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    width: 400px; /* 固定宽度 */
    max-height: 80vh; /* 最大高度为视窗高度的80% */
    z-index: 1000;
    border: 1px solid rgba(68, 68, 68, 0.5); /* 半透明边框 */
    backdrop-filter: blur(3px); /* 添加模糊效果 */
}

.dialog-content {
    display: flex;
    flex-direction: column;
    max-height: calc(80vh - 100px); /* 减去标题和按钮栏的高度 */
    overflow-y: auto; /* 内容超出时出现滚动条 */
}

.dialog-content h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #fff;
    position: sticky;
    top: 0;
    background-color: rgba(34, 34, 34, 0.95);
    z-index: 10;
    padding: 10px 0;
}

.property-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 0.85rem;
}

.property-item label {
    margin-right: 15px;
    width: 120px;
    text-align: right;
    color: #ccc;
    font-size: 0.8rem;
}

.slider-container {
    display: flex;
    align-items: center;
    width: 100%;
}

.slider-container input[type="range"] {
    flex-grow: 1;
    margin: 0 8px;
    height: 4px;
}

.range-value {
    width: 30px;
    text-align: center;
    color: #999;
    font-size: 0.6rem;
    background-color: rgba(0,0,0,0.2);
    border-radius: 2px;
    padding: 1px 3px;
}

.current-value {
    width: 50px;
    text-align: center;
    color: #fff;
    font-size: 0.7rem;
    background-color: rgba(0,0,0,0.3);
    border-radius: 3px;
    padding: 2px 5px;
    margin-left: 8px;
}

.dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    position: sticky;
    bottom: 0;
    background-color: rgba(34, 34, 34, 0.95);
    padding: 10px 0;
    z-index: 10;
}

.dialog-buttons button {
    padding: 8px 15px;
    font-size: 0.8rem;
}

/* Quit message */
.quit-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 24px;
    text-align: center;
}

/* Responsive design */
@media (max-width: 600px) {
    .control-panel {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .dialog-content {
        width: 90%;
        margin: 10px;
    }
}

/* 属性设置窗口 */
.properties-dialog {
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(30, 30, 30, 0.3);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
